laymur 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +353 -2
  2. package/dist/builders/UIConstraint2DBuilder.d.ts +102 -14
  3. package/dist/composer/UIComposer.d.ts +0 -0
  4. package/dist/composer/UIFullscreenQuad.d.ts +0 -0
  5. package/dist/composer/UIPass.d.ts +0 -0
  6. package/dist/constraints/UIAspectConstraint.d.ts +40 -36
  7. package/dist/constraints/UIConstraint.d.ts +17 -20
  8. package/dist/constraints/UICoverConstraint.d.ts +0 -72
  9. package/dist/constraints/UICustomConstraint.d.ts +60 -0
  10. package/dist/constraints/UIFitConstraint.d.ts +0 -72
  11. package/dist/constraints/UIHeightConstraint.d.ts +32 -38
  12. package/dist/constraints/UIHorizontalDistanceConstraint.d.ts +77 -46
  13. package/dist/constraints/UIHorizontalProportionConstraint.d.ts +49 -40
  14. package/dist/constraints/UISingleParameterConstraint.d.ts +108 -0
  15. package/dist/constraints/UIVerticalDistanceConstraint.d.ts +77 -46
  16. package/dist/constraints/UIVerticalProportionConstraint.d.ts +49 -40
  17. package/dist/constraints/UIWidthConstraint.d.ts +32 -38
  18. package/dist/elements/UIAnchor.d.ts +58 -45
  19. package/dist/elements/UIDummy.d.ts +63 -12
  20. package/dist/elements/UIElement.d.ts +81 -93
  21. package/dist/elements/UIImage.d.ts +64 -33
  22. package/dist/elements/UINineSline.d.ts +0 -0
  23. package/dist/elements/UIProgress.d.ts +7 -95
  24. package/dist/elements/UIScene.d.ts +142 -84
  25. package/dist/elements/UIText.d.ts +124 -43
  26. package/dist/index.d.ts +10 -11
  27. package/dist/index.js +2867 -2718
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.min.js +1 -1
  30. package/dist/index.min.js.map +1 -1
  31. package/dist/layers/UIFullscreenLayer.d.ts +112 -0
  32. package/dist/layers/UILayer.d.ts +134 -57
  33. package/dist/materials/UIInstancedMaterial.d.ts +0 -0
  34. package/dist/materials/UIMaterial.d.ts +6 -6
  35. package/dist/materials/UINineSliceMaterial.d.ts +0 -0
  36. package/dist/materials/UIProgressMaterial.d.ts +0 -4
  37. package/dist/miscellaneous/UIExpression.d.ts +117 -0
  38. package/dist/miscellaneous/UIMicro.d.ts +73 -119
  39. package/dist/miscellaneous/UIOrientation.d.ts +2 -9
  40. package/dist/miscellaneous/UIPriority.d.ts +56 -0
  41. package/dist/miscellaneous/UIRelation.d.ts +43 -0
  42. package/dist/miscellaneous/UITextPadding.d.ts +7 -0
  43. package/dist/miscellaneous/UITextSpan.d.ts +6 -0
  44. package/dist/miscellaneous/UITextStyle.d.ts +18 -0
  45. package/dist/miscellaneous/asserts.d.ts +111 -4
  46. package/dist/miscellaneous/textInterfaces.d.ts +19 -0
  47. package/dist/miscellaneous/textTools.d.ts +8 -5
  48. package/dist/scalable/UIScalableMesh.d.ts +16 -0
  49. package/dist/scalable/UIScalablePlaneMesh.d.ts +14 -0
  50. package/dist/wrappers/UISceneWrapper.d.ts +18 -0
  51. package/dist/wrappers/UISolverWrapper.d.ts +29 -0
  52. package/package.json +1 -1
  53. package/dist/Passes/UIComposer.d.ts +0 -114
  54. package/dist/Passes/UIFullScreenQuad.d.ts +0 -51
  55. package/dist/Passes/UIPass.d.ts +0 -43
  56. package/dist/builders/UIConstraintContainerBuilder.d.ts +0 -20
  57. package/dist/builders/UIConstraintStackBuilder.d.ts +0 -24
  58. package/dist/constraints/UIConstraintPower.d.ts +0 -57
  59. package/dist/constraints/UIConstraintRule.d.ts +0 -46
  60. package/dist/layers/UIFullScreenLayer.d.ts +0 -13
  61. package/dist/miscellaneous/UIBlending.d.ts +0 -7
  62. package/dist/miscellaneous/UITextInterfaces.d.ts +0 -49
  63. package/dist/miscellaneous/math.d.ts +0 -1
  64. package/dist/miscellaneous/microTransformationTools.d.ts +0 -3
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../node_modules/@lume/kiwi/dist/maptype.js","../node_modules/@lume/kiwi/dist/variable.js","../node_modules/@lume/kiwi/dist/expression.js","../node_modules/@lume/kiwi/dist/strength.js","../node_modules/@lume/kiwi/dist/constraint.js","../node_modules/@lume/kiwi/dist/solver.js","../src/miscellaneous/UIOrientation.ts","../src/constraints/UIConstraint.ts","../src/constraints/UIConstraintPower.ts","../src/constraints/UIConstraintRule.ts","../src/constraints/UIHeightConstraint.ts","../node_modules/eventail/dist/index.min.js","../src/elements/UIAnchor.ts","../src/miscellaneous/math.ts","../src/miscellaneous/microTransformationTools.ts","../src/miscellaneous/UIMicro.ts","../src/miscellaneous/UIMode.ts","../src/miscellaneous/UIBlending.ts","../src/materials/UIMaterial.ts","../src/miscellaneous/threeInstances.ts","../src/Passes/UIFullScreenQuad.ts","../src/Passes/UIComposer.ts","../src/elements/UIElement.ts","../src/layers/UILayer.ts","../src/miscellaneous/asserts.ts","../src/constraints/UIHorizontalDistanceConstraint.ts","../src/constraints/UIHorizontalProportionConstraint.ts","../src/constraints/UIVerticalDistanceConstraint.ts","../src/constraints/UIVerticalProportionConstraint.ts","../src/constraints/UIWidthConstraint.ts","../src/builders/UIConstraint2DBuilder.ts","../src/builders/UIConstraintContainerBuilder.ts","../src/builders/UIConstraintStackBuilder.ts","../src/constraints/UIAspectConstraint.ts","../src/constraints/UICoverConstraint.ts","../src/constraints/UIFitConstraint.ts","../src/elements/UIDummy.ts","../src/elements/UIImage.ts","../src/materials/UIProgressMaterial.ts","../src/elements/UIProgress.ts","../src/elements/UIScene.ts","../src/miscellaneous/textTools.ts","../src/elements/UIText.ts","../src/layers/UIFullScreenLayer.ts","../src/miscellaneous/UITextInterfaces.ts","../src/Passes/UIPass.ts"],"sourcesContent":["export function createMap() {\n return new IndexedMap();\n}\nclass IndexedMap {\n index = {};\n array = [];\n /**\n * Returns the number of items in the array.\n */\n size() {\n return this.array.length;\n }\n /**\n * Returns true if the array is empty.\n */\n empty() {\n return this.array.length === 0;\n }\n /**\n * Returns the item at the given array index.\n *\n * @param index The integer index of the desired item.\n */\n itemAt(index) {\n return this.array[index];\n }\n /**\n * Returns true if the key is in the array, false otherwise.\n *\n * @param key The key to locate in the array.\n */\n contains(key) {\n return this.index[key.id()] !== undefined;\n }\n /**\n * Returns the pair associated with the given key, or undefined.\n *\n * @param key The key to locate in the array.\n */\n find(key) {\n const i = this.index[key.id()];\n return i === undefined ? undefined : this.array[i];\n }\n /**\n * Returns the pair associated with the key if it exists.\n *\n * If the key does not exist, a new pair will be created and\n * inserted using the value created by the given factory.\n *\n * @param key The key to locate in the array.\n * @param factory The function which creates the default value.\n */\n setDefault(key, factory) {\n const i = this.index[key.id()];\n if (i === undefined) {\n const pair = new Pair(key, factory());\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n return pair;\n }\n else {\n return this.array[i];\n }\n }\n /**\n * Insert the pair into the array and return the pair.\n *\n * This will overwrite any existing entry in the array.\n *\n * @param key The key portion of the pair.\n * @param value The value portion of the pair.\n */\n insert(key, value) {\n const pair = new Pair(key, value);\n const i = this.index[key.id()];\n if (i === undefined) {\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n }\n else {\n this.array[i] = pair;\n }\n return pair;\n }\n /**\n * Removes and returns the pair for the given key, or undefined.\n *\n * @param key The key to remove from the map.\n */\n erase(key) {\n const i = this.index[key.id()];\n if (i === undefined) {\n return undefined;\n }\n this.index[key.id()] = undefined;\n const pair = this.array[i];\n const last = this.array.pop();\n if (pair !== last) {\n this.array[i] = last;\n this.index[last.first.id()] = i;\n }\n return pair;\n }\n /**\n * Create a copy of this associative array.\n */\n copy() {\n const copy = new IndexedMap();\n for (let i = 0; i < this.array.length; i++) {\n const pair = this.array[i].copy();\n copy.array[i] = pair;\n copy.index[pair.first.id()] = i;\n }\n return copy;\n }\n}\n/**\n * A class which defines a generic pair object.\n * @private\n */\n// tslint:disable: max-classes-per-file\nclass Pair {\n first;\n second;\n /**\n * Construct a new Pair object.\n *\n * @param first The first item of the pair.\n * @param second The second item of the pair.\n */\n constructor(first, second) {\n this.first = first;\n this.second = second;\n }\n /**\n * Create a copy of the pair.\n */\n copy() {\n return new Pair(this.first, this.second);\n }\n}\n","import { Expression } from './expression.js';\n/**\n * The primary user constraint variable.\n *\n * @class\n * @param {String} [name=\"\"] The name to associated with the variable.\n */\nexport class Variable {\n constructor(name = '') {\n this._name = name;\n }\n /**\n * Returns the unique id number of the variable.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the name of the variable.\n *\n * @return {String} name of the variable\n */\n name() {\n return this._name;\n }\n /**\n * Set the name of the variable.\n *\n * @param {String} name Name of the variable\n */\n setName(name) {\n this._name = name;\n }\n /**\n * Returns the user context object of the variable.\n * @private\n */\n context() {\n return this._context;\n }\n /**\n * Set the user context object of the variable.\n * @private\n */\n setContext(context) {\n this._context = context;\n }\n /**\n * Returns the value of the variable.\n *\n * @return {Number} Calculated value\n */\n value() {\n return this._value;\n }\n /**\n * Set the value of the variable.\n * @private\n */\n setValue(value) {\n this._value = value;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the variable.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the variable.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n /**\n * Returns the JSON representation of the variable.\n * @private\n */\n toJSON() {\n return {\n name: this._name,\n value: this._value,\n };\n }\n toString() {\n return this._context + '[' + this._name + ':' + this._value + ']';\n }\n _name;\n _value = 0.0;\n _context = null;\n _id = VarId++;\n}\n/**\n * The internal variable id counter.\n * @private\n */\nlet VarId = 0;\n","import { createMap } from './maptype.js';\nimport { Variable } from './variable.js';\n/**\n * An expression of variable terms and a constant.\n *\n * The constructor accepts an arbitrary number of parameters,\n * each of which must be one of the following types:\n * - number\n * - Variable\n * - Expression\n * - 2-tuple of [number, Variable|Expression]\n *\n * The parameters are summed. The tuples are multiplied.\n *\n * @class\n * @param {...(number|Variable|Expression|Array)} args\n */\nexport class Expression {\n constructor() {\n let parsed = parseArgs(arguments);\n this._terms = parsed.terms;\n this._constant = parsed.constant;\n }\n /**\n * Returns the mapping of terms in the expression.\n *\n * This *must* be treated as const.\n * @private\n */\n terms() {\n return this._terms;\n }\n /**\n * Returns the constant of the expression.\n * @private\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns the computed value of the expression.\n *\n * @private\n * @return {Number} computed value of the expression\n */\n value() {\n let result = this._constant;\n for (let i = 0, n = this._terms.size(); i < n; i++) {\n let pair = this._terms.itemAt(i);\n result += pair.first.value() * pair.second;\n }\n return result;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the expression.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the expression.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n isConstant() {\n return this._terms.size() == 0;\n }\n toString() {\n let result = this._terms.array\n .map(function (pair) {\n return pair.second + '*' + pair.first.toString();\n })\n .join(' + ');\n if (!this.isConstant() && this._constant !== 0) {\n result += ' + ';\n }\n result += this._constant;\n return result;\n }\n _terms;\n _constant;\n}\n/**\n * An internal argument parsing function.\n * @private\n */\nfunction parseArgs(args) {\n let constant = 0.0;\n let factory = () => 0.0;\n let terms = createMap();\n for (let i = 0, n = args.length; i < n; ++i) {\n let item = args[i];\n if (typeof item === 'number') {\n constant += item;\n }\n else if (item instanceof Variable) {\n terms.setDefault(item, factory).second += 1.0;\n }\n else if (item instanceof Expression) {\n constant += item.constant();\n let terms2 = item.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second;\n }\n }\n else if (item instanceof Array) {\n if (item.length !== 2) {\n throw new Error('array must have length 2');\n }\n let value = item[0];\n let value2 = item[1];\n if (typeof value !== 'number') {\n throw new Error('array item 0 must be a number');\n }\n if (value2 instanceof Variable) {\n terms.setDefault(value2, factory).second += value;\n }\n else if (value2 instanceof Expression) {\n constant += value2.constant() * value;\n let terms2 = value2.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second * value;\n }\n }\n else {\n throw new Error('array item 1 must be a variable or expression');\n }\n }\n else {\n throw new Error('invalid Expression argument: ' + item);\n }\n }\n return { terms, constant };\n}\n","/**\n * @class Strength\n */\nexport class Strength {\n /**\n * Create a new symbolic strength.\n *\n * @param a strong\n * @param b medium\n * @param c weak\n * @param [w] weight\n * @return strength\n */\n static create(a, b, c, w = 1.0) {\n let result = 0.0;\n result += Math.max(0.0, Math.min(1000.0, a * w)) * 1000000.0;\n result += Math.max(0.0, Math.min(1000.0, b * w)) * 1000.0;\n result += Math.max(0.0, Math.min(1000.0, c * w));\n return result;\n }\n /**\n * The 'required' symbolic strength.\n */\n static required = Strength.create(1000.0, 1000.0, 1000.0);\n /**\n * The 'strong' symbolic strength.\n */\n static strong = Strength.create(1.0, 0.0, 0.0);\n /**\n * The 'medium' symbolic strength.\n */\n static medium = Strength.create(0.0, 1.0, 0.0);\n /**\n * The 'weak' symbolic strength.\n */\n static weak = Strength.create(0.0, 0.0, 1.0);\n /**\n * Clip a symbolic strength to the allowed min and max.\n * @private\n */\n static clip(value) {\n return Math.max(0.0, Math.min(Strength.required, value));\n }\n}\n","import { Expression } from './expression.js';\nimport { Strength } from './strength.js';\n/**\n * An enum defining the linear constraint operators.\n *\n * |Value|Operator|Description|\n * |----|-----|-----|\n * |`Le`|<=|Less than equal|\n * |`Ge`|>=|Greater than equal|\n * |`Eq`|==|Equal|\n *\n * @enum {Number}\n */\nexport var Operator;\n(function (Operator) {\n Operator[Operator[\"Le\"] = 0] = \"Le\";\n Operator[Operator[\"Ge\"] = 1] = \"Ge\";\n Operator[Operator[\"Eq\"] = 2] = \"Eq\";\n})(Operator || (Operator = {}));\n/**\n * A linear constraint equation.\n *\n * A constraint equation is composed of an expression, an operator,\n * and a strength. The RHS of the equation is implicitly zero.\n *\n * @class\n * @param {Expression} expression The constraint expression (LHS).\n * @param {Operator} operator The equation operator.\n * @param {Expression} [rhs] Right hand side of the expression.\n * @param {Number} [strength=Strength.required] The strength of the constraint.\n */\nexport class Constraint {\n constructor(expression, operator, rhs, strength = Strength.required) {\n this._operator = operator;\n this._strength = Strength.clip(strength);\n if (rhs === undefined && expression instanceof Expression) {\n this._expression = expression;\n }\n else {\n this._expression = expression.minus(rhs);\n }\n }\n /**\n * Returns the unique id number of the constraint.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the expression of the constraint.\n *\n * @return {Expression} expression\n */\n expression() {\n return this._expression;\n }\n /**\n * Returns the relational operator of the constraint.\n *\n * @return {Operator} linear constraint operator\n */\n op() {\n return this._operator;\n }\n /**\n * Returns the strength of the constraint.\n *\n * @return {Number} strength\n */\n strength() {\n return this._strength;\n }\n toString() {\n return (this._expression.toString() + ' ' + ['<=', '>=', '='][this._operator] + ' 0 (' + this._strength.toString() + ')');\n }\n _expression;\n _operator;\n _strength;\n _id = CnId++;\n}\n/**\n * The internal constraint id counter.\n * @private\n */\nlet CnId = 0;\n","import { Constraint, Operator } from './constraint.js';\nimport { Expression } from './expression.js';\nimport { createMap } from './maptype.js';\nimport { Strength } from './strength.js';\n/**\n * The constraint solver class.\n *\n * @class\n */\nexport class Solver {\n /**\n * @type {number} - The max number of solver iterations before an error\n * is thrown, in order to prevent infinite iteration. Default: `10,000`.\n */\n maxIterations = 1000;\n /**\n * Construct a new Solver.\n */\n constructor() { }\n /**\n * Creates and add a constraint to the solver.\n *\n * @param {Expression|Variable} lhs Left hand side of the expression\n * @param {Operator} operator Operator\n * @param {Expression|Variable|Number} rhs Right hand side of the expression\n * @param {Number} [strength=Strength.required] Strength\n */\n createConstraint(lhs, operator, rhs, strength = Strength.required) {\n let cn = new Constraint(lhs, operator, rhs, strength);\n this.addConstraint(cn);\n return cn;\n }\n /**\n * Add a constraint to the solver.\n *\n * @param {Constraint} constraint Constraint to add to the solver\n */\n addConstraint(constraint) {\n let cnPair = this._cnMap.find(constraint);\n if (cnPair !== undefined) {\n throw new Error('duplicate constraint');\n }\n // Creating a row causes symbols to be reserved for the variables\n // in the constraint. If this method exits with an exception,\n // then its possible those variables will linger in the var map.\n // Since its likely that those variables will be used in other\n // constraints and since exceptional conditions are uncommon,\n // i'm not too worried about aggressive cleanup of the var map.\n let data = this._createRow(constraint);\n let row = data.row;\n let tag = data.tag;\n let subject = this._chooseSubject(row, tag);\n // If chooseSubject couldnt find a valid entering symbol, one\n // last option is available if the entire row is composed of\n // dummy variables. If the constant of the row is zero, then\n // this represents redundant constraints and the new dummy\n // marker can enter the basis. If the constant is non-zero,\n // then it represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid && row.allDummies()) {\n if (!nearZero(row.constant())) {\n throw new Error('unsatisfiable constraint');\n }\n else {\n subject = tag.marker;\n }\n }\n // If an entering symbol still isn't found, then the row must\n // be added using an artificial variable. If that fails, then\n // the row represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid) {\n if (!this._addWithArtificialVariable(row)) {\n throw new Error('unsatisfiable constraint');\n }\n }\n else {\n row.solveFor(subject);\n this._substitute(subject, row);\n this._rowMap.insert(subject, row);\n }\n this._cnMap.insert(constraint, tag);\n // Optimizing after each constraint is added performs less\n // aggregate work due to a smaller average system size. It\n // also ensures the solver remains in a consistent state.\n this._optimize(this._objective);\n }\n /**\n * Remove a constraint from the solver.\n *\n * @param {Constraint} constraint Constraint to remove from the solver\n */\n removeConstraint(constraint) {\n let cnPair = this._cnMap.erase(constraint);\n if (cnPair === undefined) {\n throw new Error('unknown constraint');\n }\n // Remove the error effects from the objective function\n // *before* pivoting, or substitutions into the objective\n // will lead to incorrect solver results.\n this._removeConstraintEffects(constraint, cnPair.second);\n // If the marker is basic, simply drop the row. Otherwise,\n // pivot the marker into the basis and then drop the row.\n let marker = cnPair.second.marker;\n let rowPair = this._rowMap.erase(marker);\n if (rowPair === undefined) {\n let leaving = this._getMarkerLeavingSymbol(marker);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('failed to find leaving row');\n }\n rowPair = this._rowMap.erase(leaving);\n rowPair.second.solveForEx(leaving, marker);\n this._substitute(marker, rowPair.second);\n }\n // Optimizing after each constraint is removed ensures that the\n // solver remains consistent. It makes the solver api easier to\n // use at a small tradeoff for speed.\n this._optimize(this._objective);\n }\n /**\n * Test whether the solver contains the constraint.\n *\n * @param {Constraint} constraint Constraint to test for\n * @return {Bool} true or false\n */\n hasConstraint(constraint) {\n return this._cnMap.contains(constraint);\n }\n /**\n * Get an array of the current constraints.\n *\n * @return {Constraint[]}\n */\n getConstraints() {\n return this._cnMap.array.map(({ first }) => first);\n }\n /**\n * Add an edit variable to the solver.\n *\n * @param {Variable} variable Edit variable to add to the solver\n * @param {Number} strength Strength, should be less than `Strength.required`\n */\n addEditVariable(variable, strength) {\n let editPair = this._editMap.find(variable);\n if (editPair !== undefined) {\n throw new Error('duplicate edit variable');\n }\n strength = Strength.clip(strength);\n if (strength === Strength.required) {\n throw new Error('bad required strength');\n }\n let expr = new Expression(variable);\n let cn = new Constraint(expr, Operator.Eq, undefined, strength);\n this.addConstraint(cn);\n let tag = this._cnMap.find(cn).second;\n let info = { tag, constraint: cn, constant: 0.0 };\n this._editMap.insert(variable, info);\n }\n /**\n * Remove an edit variable from the solver.\n *\n * @param {Variable} variable Edit variable to remove from the solver\n */\n removeEditVariable(variable) {\n let editPair = this._editMap.erase(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n this.removeConstraint(editPair.second.constraint);\n }\n /**\n * Test whether the solver contains the edit variable.\n *\n * @param {Variable} variable Edit variable to test for\n * @return {Bool} true or false\n */\n hasEditVariable(variable) {\n return this._editMap.contains(variable);\n }\n /**\n * Suggest the value of an edit variable.\n *\n * @param {Variable} variable Edit variable to suggest a value for\n * @param {Number} value Suggested value\n */\n suggestValue(variable, value) {\n let editPair = this._editMap.find(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n let rows = this._rowMap;\n let info = editPair.second;\n let delta = value - info.constant;\n info.constant = value;\n // Check first if the positive error variable is basic.\n let marker = info.tag.marker;\n let rowPair = rows.find(marker);\n if (rowPair !== undefined) {\n if (rowPair.second.add(-delta) < 0.0) {\n this._infeasibleRows.push(marker);\n }\n this._dualOptimize();\n return;\n }\n // Check next if the negative error variable is basic.\n let other = info.tag.other;\n rowPair = rows.find(other);\n if (rowPair !== undefined) {\n if (rowPair.second.add(delta) < 0.0) {\n this._infeasibleRows.push(other);\n }\n this._dualOptimize();\n return;\n }\n // Otherwise update each row where the error variables exist.\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let rowPair = rows.itemAt(i);\n let row = rowPair.second;\n let coeff = row.coefficientFor(marker);\n if (coeff !== 0.0 && row.add(delta * coeff) < 0.0 && rowPair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(rowPair.first);\n }\n }\n this._dualOptimize();\n }\n /**\n * Update the values of the variables.\n */\n updateVariables() {\n let vars = this._varMap;\n let rows = this._rowMap;\n for (let i = 0, n = vars.size(); i < n; ++i) {\n let pair = vars.itemAt(i);\n let rowPair = rows.find(pair.second);\n if (rowPair !== undefined) {\n pair.first.setValue(rowPair.second.constant());\n }\n else {\n pair.first.setValue(0.0);\n }\n }\n }\n /**\n * Get the symbol for the given variable.\n *\n * If a symbol does not exist for the variable, one will be created.\n * @private\n */\n _getVarSymbol(variable) {\n let factory = () => this._makeSymbol(SymbolType.External);\n return this._varMap.setDefault(variable, factory).second;\n }\n /**\n * Create a new Row object for the given constraint.\n *\n * The terms in the constraint will be converted to cells in the row.\n * Any term in the constraint with a coefficient of zero is ignored.\n * This method uses the `_getVarSymbol` method to get the symbol for\n * the variables added to the row. If the symbol for a given cell\n * variable is basic, the cell variable will be substituted with the\n * basic row.\n *\n * The necessary slack and error variables will be added to the row.\n * If the constant for the row is negative, the sign for the row\n * will be inverted so the constant becomes positive.\n *\n * Returns the created Row and the tag for tracking the constraint.\n * @private\n */\n _createRow(constraint) {\n let expr = constraint.expression();\n let row = new Row(expr.constant());\n // Substitute the current basic variables into the row.\n let terms = expr.terms();\n for (let i = 0, n = terms.size(); i < n; ++i) {\n let termPair = terms.itemAt(i);\n if (!nearZero(termPair.second)) {\n let symbol = this._getVarSymbol(termPair.first);\n let basicPair = this._rowMap.find(symbol);\n if (basicPair !== undefined) {\n row.insertRow(basicPair.second, termPair.second);\n }\n else {\n row.insertSymbol(symbol, termPair.second);\n }\n }\n }\n // Add the necessary slack, error, and dummy variables.\n let objective = this._objective;\n let strength = constraint.strength();\n let tag = { marker: INVALID_SYMBOL, other: INVALID_SYMBOL };\n switch (constraint.op()) {\n case Operator.Le:\n case Operator.Ge: {\n let coeff = constraint.op() === Operator.Le ? 1.0 : -1.0;\n let slack = this._makeSymbol(SymbolType.Slack);\n tag.marker = slack;\n row.insertSymbol(slack, coeff);\n if (strength < Strength.required) {\n let error = this._makeSymbol(SymbolType.Error);\n tag.other = error;\n row.insertSymbol(error, -coeff);\n objective.insertSymbol(error, strength);\n }\n break;\n }\n case Operator.Eq: {\n if (strength < Strength.required) {\n let errplus = this._makeSymbol(SymbolType.Error);\n let errminus = this._makeSymbol(SymbolType.Error);\n tag.marker = errplus;\n tag.other = errminus;\n row.insertSymbol(errplus, -1.0); // v = eplus - eminus\n row.insertSymbol(errminus, 1.0); // v - eplus + eminus = 0\n objective.insertSymbol(errplus, strength);\n objective.insertSymbol(errminus, strength);\n }\n else {\n let dummy = this._makeSymbol(SymbolType.Dummy);\n tag.marker = dummy;\n row.insertSymbol(dummy);\n }\n break;\n }\n }\n // Ensure the row has a positive constant.\n if (row.constant() < 0.0) {\n row.reverseSign();\n }\n return { row, tag };\n }\n /**\n * Choose the subject for solving for the row.\n *\n * This method will choose the best subject for using as the solve\n * target for the row. An invalid symbol will be returned if there\n * is no valid target.\n *\n * The symbols are chosen according to the following precedence:\n *\n * 1) The first symbol representing an external variable.\n * 2) A negative slack or error tag variable.\n *\n * If a subject cannot be found, an invalid symbol will be returned.\n *\n * @private\n */\n _chooseSubject(row, tag) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() === SymbolType.External) {\n return pair.first;\n }\n }\n let type = tag.marker.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.marker) < 0.0) {\n return tag.marker;\n }\n }\n type = tag.other.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.other) < 0.0) {\n return tag.other;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Add the row to the tableau using an artificial variable.\n *\n * This will return false if the constraint cannot be satisfied.\n *\n * @private\n */\n _addWithArtificialVariable(row) {\n // Create and add the artificial variable to the tableau.\n let art = this._makeSymbol(SymbolType.Slack);\n this._rowMap.insert(art, row.copy());\n this._artificial = row.copy();\n // Optimize the artificial objective. This is successful\n // only if the artificial objective is optimized to zero.\n this._optimize(this._artificial);\n let success = nearZero(this._artificial.constant());\n this._artificial = null;\n // If the artificial variable is basic, pivot the row so that\n // it becomes non-basic. If the row is constant, exit early.\n let pair = this._rowMap.erase(art);\n if (pair !== undefined) {\n let basicRow = pair.second;\n if (basicRow.isConstant()) {\n return success;\n }\n let entering = this._anyPivotableSymbol(basicRow);\n if (entering.type() === SymbolType.Invalid) {\n return false; // unsatisfiable (will this ever happen?)\n }\n basicRow.solveForEx(art, entering);\n this._substitute(entering, basicRow);\n this._rowMap.insert(entering, basicRow);\n }\n // Remove the artificial variable from the tableau.\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n rows.itemAt(i).second.removeSymbol(art);\n }\n this._objective.removeSymbol(art);\n return success;\n }\n /**\n * Substitute the parametric symbol with the given row.\n *\n * This method will substitute all instances of the parametric symbol\n * in the tableau and the objective function with the given row.\n *\n * @private\n */\n _substitute(symbol, row) {\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n pair.second.substitute(symbol, row);\n if (pair.second.constant() < 0.0 && pair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(pair.first);\n }\n }\n this._objective.substitute(symbol, row);\n if (this._artificial) {\n this._artificial.substitute(symbol, row);\n }\n }\n /**\n * Optimize the system for the given objective function.\n *\n * This method performs iterations of Phase 2 of the simplex method\n * until the objective function reaches a minimum.\n *\n * @private\n */\n _optimize(objective) {\n let iterations = 0;\n while (iterations < this.maxIterations) {\n let entering = this._getEnteringSymbol(objective);\n if (entering.type() === SymbolType.Invalid) {\n return;\n }\n let leaving = this._getLeavingSymbol(entering);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('the objective is unbounded');\n }\n // pivot the entering symbol into the basis\n let row = this._rowMap.erase(leaving).second;\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n this._rowMap.insert(entering, row);\n iterations++;\n }\n throw new Error('solver iterations exceeded');\n }\n /**\n * Optimize the system using the dual of the simplex method.\n *\n * The current state of the system should be such that the objective\n * function is optimal, but not feasible. This method will perform\n * an iteration of the dual simplex method to make the solution both\n * optimal and feasible.\n *\n * @private\n */\n _dualOptimize() {\n let rows = this._rowMap;\n let infeasible = this._infeasibleRows;\n while (infeasible.length !== 0) {\n let leaving = infeasible.pop();\n let pair = rows.find(leaving);\n if (pair !== undefined && pair.second.constant() < 0.0) {\n let entering = this._getDualEnteringSymbol(pair.second);\n if (entering.type() === SymbolType.Invalid) {\n throw new Error('dual optimize failed');\n }\n // pivot the entering symbol into the basis\n let row = pair.second;\n rows.erase(leaving);\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n rows.insert(entering, row);\n }\n }\n }\n /**\n * Compute the entering variable for a pivot operation.\n *\n * This method will return first symbol in the objective function which\n * is non-dummy and has a coefficient less than zero. If no symbol meets\n * the criteria, it means the objective function is at a minimum, and an\n * invalid symbol is returned.\n *\n * @private\n */\n _getEnteringSymbol(objective) {\n let cells = objective.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n if (pair.second < 0.0 && symbol.type() !== SymbolType.Dummy) {\n return symbol;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Compute the entering symbol for the dual optimize operation.\n *\n * This method will return the symbol in the row which has a positive\n * coefficient and yields the minimum ratio for its respective symbol\n * in the objective function. The provided row *must* be infeasible.\n * If no symbol is found which meats the criteria, an invalid symbol\n * is returned.\n *\n * @private\n */\n _getDualEnteringSymbol(row) {\n let ratio = Number.MAX_VALUE;\n let entering = INVALID_SYMBOL;\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n let c = pair.second;\n if (c > 0.0 && symbol.type() !== SymbolType.Dummy) {\n let coeff = this._objective.coefficientFor(symbol);\n let r = coeff / c;\n if (r < ratio) {\n ratio = r;\n entering = symbol;\n }\n }\n }\n return entering;\n }\n /**\n * Compute the symbol for pivot exit row.\n *\n * This method will return the symbol for the exit row in the row\n * map. If no appropriate exit symbol is found, an invalid symbol\n * will be returned. This indicates that the objective function is\n * unbounded.\n *\n * @private\n */\n _getLeavingSymbol(entering) {\n let ratio = Number.MAX_VALUE;\n let found = INVALID_SYMBOL;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let symbol = pair.first;\n if (symbol.type() !== SymbolType.External) {\n let row = pair.second;\n let temp = row.coefficientFor(entering);\n if (temp < 0.0) {\n let temp_ratio = -row.constant() / temp;\n if (temp_ratio < ratio) {\n ratio = temp_ratio;\n found = symbol;\n }\n }\n }\n }\n return found;\n }\n /**\n * Compute the leaving symbol for a marker variable.\n *\n * This method will return a symbol corresponding to a basic row\n * which holds the given marker variable. The row will be chosen\n * according to the following precedence:\n *\n * 1) The row with a restricted basic varible and a negative coefficient\n * for the marker with the smallest ratio of -constant / coefficient.\n *\n * 2) The row with a restricted basic variable and the smallest ratio\n * of constant / coefficient.\n *\n * 3) The last unrestricted row which contains the marker.\n *\n * If the marker does not exist in any row, an invalid symbol will be\n * returned. This indicates an internal solver error since the marker\n * *should* exist somewhere in the tableau.\n *\n * @private\n */\n _getMarkerLeavingSymbol(marker) {\n let dmax = Number.MAX_VALUE;\n let r1 = dmax;\n let r2 = dmax;\n let invalid = INVALID_SYMBOL;\n let first = invalid;\n let second = invalid;\n let third = invalid;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let row = pair.second;\n let c = row.coefficientFor(marker);\n if (c === 0.0) {\n continue;\n }\n let symbol = pair.first;\n if (symbol.type() === SymbolType.External) {\n third = symbol;\n }\n else if (c < 0.0) {\n let r = -row.constant() / c;\n if (r < r1) {\n r1 = r;\n first = symbol;\n }\n }\n else {\n let r = row.constant() / c;\n if (r < r2) {\n r2 = r;\n second = symbol;\n }\n }\n }\n if (first !== invalid) {\n return first;\n }\n if (second !== invalid) {\n return second;\n }\n return third;\n }\n /**\n * Remove the effects of a constraint on the objective function.\n *\n * @private\n */\n _removeConstraintEffects(cn, tag) {\n if (tag.marker.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.marker, cn.strength());\n }\n if (tag.other.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.other, cn.strength());\n }\n }\n /**\n * Remove the effects of an error marker on the objective function.\n *\n * @private\n */\n _removeMarkerEffects(marker, strength) {\n let pair = this._rowMap.find(marker);\n if (pair !== undefined) {\n this._objective.insertRow(pair.second, -strength);\n }\n else {\n this._objective.insertSymbol(marker, -strength);\n }\n }\n /**\n * Get the first Slack or Error symbol in the row.\n *\n * If no such symbol is present, an invalid symbol will be returned.\n *\n * @private\n */\n _anyPivotableSymbol(row) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let type = pair.first.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n return pair.first;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Returns a new Symbol of the given type.\n *\n * @private\n */\n _makeSymbol(type) {\n return new Symbol(type, this._idTick++);\n }\n _cnMap = createCnMap();\n _rowMap = createRowMap();\n _varMap = createVarMap();\n _editMap = createEditMap();\n _infeasibleRows = [];\n _objective = new Row();\n _artificial = null;\n _idTick = 0;\n}\n/**\n * Test whether a value is approximately zero.\n * @private\n */\nfunction nearZero(value) {\n let eps = 1.0e-8;\n return value < 0.0 ? -value < eps : value < eps;\n}\n/**\n * An internal function for creating a constraint map.\n * @private\n */\nfunction createCnMap() {\n return createMap();\n}\n/**\n * An internal function for creating a row map.\n * @private\n */\nfunction createRowMap() {\n return createMap();\n}\n/**\n * An internal function for creating a variable map.\n * @private\n */\nfunction createVarMap() {\n return createMap();\n}\n/**\n * An internal function for creating an edit map.\n * @private\n */\nfunction createEditMap() {\n return createMap();\n}\n/**\n * An enum defining the available symbol types.\n * @private\n */\nvar SymbolType;\n(function (SymbolType) {\n SymbolType[SymbolType[\"Invalid\"] = 0] = \"Invalid\";\n SymbolType[SymbolType[\"External\"] = 1] = \"External\";\n SymbolType[SymbolType[\"Slack\"] = 2] = \"Slack\";\n SymbolType[SymbolType[\"Error\"] = 3] = \"Error\";\n SymbolType[SymbolType[\"Dummy\"] = 4] = \"Dummy\";\n})(SymbolType || (SymbolType = {}));\n/**\n * An internal class representing a symbol in the solver.\n * @private\n */\nclass Symbol {\n /**\n * Construct a new Symbol\n *\n * @param [type] The type of the symbol.\n * @param [id] The unique id number of the symbol.\n */\n constructor(type, id) {\n this._id = id;\n this._type = type;\n }\n /**\n * Returns the unique id number of the symbol.\n */\n id() {\n return this._id;\n }\n /**\n * Returns the type of the symbol.\n */\n type() {\n return this._type;\n }\n _id;\n _type;\n}\n/**\n * A static invalid symbol\n * @private\n */\nlet INVALID_SYMBOL = new Symbol(SymbolType.Invalid, -1);\n/**\n * An internal row class used by the solver.\n * @private\n */\nclass Row {\n /**\n * Construct a new Row.\n */\n constructor(constant = 0.0) {\n this._constant = constant;\n }\n /**\n * Returns the mapping of symbols to coefficients.\n */\n cells() {\n return this._cellMap;\n }\n /**\n * Returns the constant for the row.\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns true if the row is a constant value.\n */\n isConstant() {\n return this._cellMap.empty();\n }\n /**\n * Returns true if the Row has all dummy symbols.\n */\n allDummies() {\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() !== SymbolType.Dummy) {\n return false;\n }\n }\n return true;\n }\n /**\n * Create a copy of the row.\n */\n copy() {\n let theCopy = new Row(this._constant);\n theCopy._cellMap = this._cellMap.copy();\n return theCopy;\n }\n /**\n * Add a constant value to the row constant.\n *\n * Returns the new value of the constant.\n */\n add(value) {\n return (this._constant += value);\n }\n /**\n * Insert the symbol into the row with the given coefficient.\n *\n * If the symbol already exists in the row, the coefficient\n * will be added to the existing coefficient. If the resulting\n * coefficient is zero, the symbol will be removed from the row.\n */\n insertSymbol(symbol, coefficient = 1.0) {\n let pair = this._cellMap.setDefault(symbol, () => 0.0);\n if (nearZero((pair.second += coefficient))) {\n this._cellMap.erase(symbol);\n }\n }\n /**\n * Insert a row into this row with a given coefficient.\n *\n * The constant and the cells of the other row will be\n * multiplied by the coefficient and added to this row. Any\n * cell with a resulting coefficient of zero will be removed\n * from the row.\n */\n insertRow(other, coefficient = 1.0) {\n this._constant += other._constant * coefficient;\n let cells = other._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n this.insertSymbol(pair.first, pair.second * coefficient);\n }\n }\n /**\n * Remove a symbol from the row.\n */\n removeSymbol(symbol) {\n this._cellMap.erase(symbol);\n }\n /**\n * Reverse the sign of the constant and cells in the row.\n */\n reverseSign() {\n this._constant = -this._constant;\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n pair.second = -pair.second;\n }\n }\n /**\n * Solve the row for the given symbol.\n *\n * This method assumes the row is of the form\n * a * x + b * y + c = 0 and (assuming solve for x) will modify\n * the row to represent the right hand side of\n * x = -b/a * y - c / a. The target symbol will be removed from\n * the row, and the constant and other cells will be multiplied\n * by the negative inverse of the target coefficient.\n *\n * The given symbol *must* exist in the row.\n */\n solveFor(symbol) {\n let cells = this._cellMap;\n let pair = cells.erase(symbol);\n let coeff = -1.0 / pair.second;\n this._constant *= coeff;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n cells.itemAt(i).second *= coeff;\n }\n }\n /**\n * Solve the row for the given symbols.\n *\n * This method assumes the row is of the form\n * x = b * y + c and will solve the row such that\n * y = x / b - c / b. The rhs symbol will be removed from the\n * row, the lhs added, and the result divided by the negative\n * inverse of the rhs coefficient.\n *\n * The lhs symbol *must not* exist in the row, and the rhs\n * symbol must* exist in the row.\n */\n solveForEx(lhs, rhs) {\n this.insertSymbol(lhs, -1.0);\n this.solveFor(rhs);\n }\n /**\n * Returns the coefficient for the given symbol.\n */\n coefficientFor(symbol) {\n let pair = this._cellMap.find(symbol);\n return pair !== undefined ? pair.second : 0.0;\n }\n /**\n * Substitute a symbol with the data from another row.\n *\n * Given a row of the form a * x + b and a substitution of the\n * form x = 3 * y + c the row will be updated to reflect the\n * expression 3 * a * y + a * c + b.\n *\n * If the symbol does not exist in the row, this is a no-op.\n */\n substitute(symbol, row) {\n let pair = this._cellMap.erase(symbol);\n if (pair !== undefined) {\n this.insertRow(row, pair.second);\n }\n }\n _cellMap = createMap();\n _constant;\n}\n","/**\n * Defines the screen orientation states for UI constraints.\n * \n * This enum is used to specify when certain UI constraints should be active\n * based on the current device/screen orientation.\n */\nexport enum UIOrientation {\n /**\n * Indicates a landscape orientation (width > height).\n * Constraints using this value will only be active in landscape mode.\n */\n LANDSCAPE,\n \n /**\n * Indicates a portrait orientation (height > width).\n * Constraints using this value will only be active in portrait mode.\n */\n PORTRAIT,\n \n /**\n * Indicates that the constraint should always be active,\n * regardless of screen orientation.\n */\n ALWAYS,\n}\n\n/**\n * Type guard to check if a value is a valid UIOrientation.\n * \n * @param obj - The value to check\n * @returns True if the value is a valid UIOrientation enum value\n */\nexport function isUIOrientation(obj: unknown): obj is UIOrientation {\n return obj !== null && Object.values(UIOrientation).some((v) => v === obj);\n}\n\n/**\n * Resolves an optional orientation to a definite value.\n * \n * @param orientation - The orientation to resolve, or undefined\n * @returns The provided orientation, or ALWAYS if none was provided\n */\nexport function resolveOrientation(orientation?: UIOrientation): UIOrientation {\n return orientation ?? UIOrientation.ALWAYS;\n}\n","import type { UIAnchor } from \"../elements/UIAnchor\";\nimport type { UIElement } from \"../elements/UIElement\";\nimport type { UILayer } from \"../layers/UILayer\";\n\nimport type { UIOrientation } from \"../miscellaneous/UIOrientation\";\n\n/**\n * Abstract base class for all UI constraints in the system.\n *\n * Constraints control the layout of UI elements by establishing relationships\n * between their properties (position, size) and other elements or the screen.\n *\n * The constraint system uses Kiwi.js under the hood for solving the constraint system.\n * Each constraint adds specific rules to the solver that determine element positioning.\n */\nexport abstract class UIConstraint {\n /**\n * Optional identifier for the constraint.\n * Useful for debugging and identifying constraints.\n */\n public name = \"\";\n\n /**\n * Creates a new UI constraint.\n *\n * @param layer - The UI layer that will manage this constraint\n * @param elements - The set of UI elements affected by this constraint\n */\n constructor(\n public readonly layer: UILayer,\n elements: Set<UIElement | UIAnchor>,\n ) {\n this.layer[\"addUIConstraintInternal\"](this, elements);\n }\n\n /**\n * Destroys the constraint, removing it from the layer and solver.\n * This should be called when the constraint is no longer needed.\n */\n public destroy(): void {\n this.layer[\"removeUIConstraintInternal\"](this);\n }\n\n /**\n * Internal method called when the constraint should be disabled.\n * Typically called when the screen orientation changes and the\n * constraint is not applicable for the current orientation.\n *\n * @param orientation - The current UI orientation\n * @internal\n */\n public abstract [\"disableConstraintInternal\"](\n orientation: UIOrientation,\n ): void;\n\n /**\n * Internal method called when the constraint should be enabled.\n * Typically called when the screen orientation changes and the\n * constraint becomes applicable for the current orientation.\n *\n * @param orientation - The current UI orientation\n * @internal\n */\n public abstract [\"enableConstraintInternal\"](\n orientation: UIOrientation,\n ): void;\n}\n","import { Strength } from \"@lume/kiwi\";\n\n/**\n * Priority values for constraint strength calculation.\n * Higher values indicate stronger constraint enforcement.\n */\nconst HIGH_PRIORITY = 1000;\n/**\n * Medium priority value for constraint strength calculation.\n */\nconst MEDIUM_PRIORITY = 100;\n/**\n * Low priority value for constraint strength calculation.\n */\nconst LOW_PRIORITY = 10;\n\n/**\n * Defines the strength/priority levels for UI constraints.\n *\n * Constraints with higher power (lower index) take precedence over\n * those with lower power when the constraint solver can't satisfy all constraints.\n *\n * The enum values map to different strength configurations in the Kiwi.js solver:\n * - P0: Highest priority, \"required\" constraint that must be satisfied\n * - P1-P7: Decreasing levels of priority\n */\nexport enum UIConstraintPower {\n /** Highest priority - must be satisfied (required constraint) */\n P0,\n /** Very high priority */\n P1,\n /** High priority */\n P2,\n /** Medium-high priority */\n P3,\n /** Medium priority */\n P4,\n /** Medium-low priority */\n P5,\n /** Low priority */\n P6,\n /** Lowest priority */\n P7,\n}\n\n/**\n * Type guard to check if a value is a valid UIConstraintPower.\n *\n * @param obj - The value to check\n * @returns True if the value is a valid UIConstraintPower enum value\n */\nexport function isUIConstraintPower(obj: unknown): obj is UIConstraintPower {\n return (\n obj !== null && Object.values(UIConstraintPower).some((v) => v === obj)\n );\n}\n\n/**\n * Resolves an optional power level to a definite value.\n *\n * @param power - The constraint power to resolve, or undefined\n * @returns The provided power level, or P0 (highest) if none was provided\n */\nexport function resolvePower(power?: UIConstraintPower): UIConstraintPower {\n return power ?? UIConstraintPower.P0;\n}\n\n/**\n * Converts a UIConstraintPower enum value to a Kiwi.js strength value.\n *\n * The Kiwi.js constraint solver uses a three-tiered strength system.\n * This function maps our power levels to appropriate strength values:\n *\n * - P0: Maximum strength in all tiers (required constraint)\n * - P1-P2: Varying strengths in the first tier\n * - P3-P4: Varying strengths in the second tier\n * - P5-P7: Varying strengths in the third tier\n *\n * @param power - The constraint power to convert, or undefined\n * @returns A Kiwi.js strength value corresponding to the power level\n */\nexport function convertPowerToStrength(power?: UIConstraintPower): number {\n switch (power) {\n case UIConstraintPower.P0:\n return Strength.create(HIGH_PRIORITY, HIGH_PRIORITY, HIGH_PRIORITY);\n case UIConstraintPower.P1:\n return Strength.create(MEDIUM_PRIORITY, 0, 0);\n case UIConstraintPower.P2:\n return Strength.create(LOW_PRIORITY, 0, 0);\n case UIConstraintPower.P3:\n return Strength.create(0, MEDIUM_PRIORITY, 0);\n case UIConstraintPower.P4:\n return Strength.create(0, LOW_PRIORITY, 0);\n case UIConstraintPower.P5:\n return Strength.create(0, 0, MEDIUM_PRIORITY);\n case UIConstraintPower.P6:\n return Strength.create(0, 0, LOW_PRIORITY);\n case UIConstraintPower.P7:\n return Strength.create(0, 0, 1);\n default:\n return Strength.create(HIGH_PRIORITY, HIGH_PRIORITY, HIGH_PRIORITY);\n }\n}\n","import { Operator } from \"@lume/kiwi\";\n\n/**\n * Defines the type of relationship between values in a constraint.\n *\n * Maps directly to Kiwi.js Operators for the constraint solver.\n * Used to specify whether values should be equal, less than, or greater than each other.\n */\nexport enum UIConstraintRule {\n /**\n * Values must be equal (x = y).\n * Creates an equality constraint in the solver.\n */\n EQUAL = Operator.Eq,\n\n /**\n * Left value must be less than or equal to right value (x ≤ y).\n * Creates an inequality constraint in the solver.\n */\n LESS = Operator.Le,\n\n /**\n * Left value must be greater than or equal to right value (x ≥ y).\n * Creates an inequality constraint in the solver.\n */\n GREATER = Operator.Ge,\n}\n\n/**\n * Type guard to check if a value is a valid UIConstraintRule.\n *\n * @param obj - The value to check\n * @returns True if the value is a valid UIConstraintRule enum value\n */\nexport function isUIConstraintRule(obj: unknown): obj is UIConstraintRule {\n return obj !== null && Object.values(UIConstraintRule).some((v) => v === obj);\n}\n\n/**\n * Resolves an optional rule to a definite value.\n *\n * @param rule - The constraint rule to resolve, or undefined\n * @returns The provided rule, or EQUAL if none was provided\n */\nexport function resolveRule(rule?: UIConstraintRule): UIConstraintRule {\n return rule ?? UIConstraintRule.EQUAL;\n}\n\n/**\n * Converts a UIConstraintRule to the corresponding Kiwi.js Operator.\n * This function provides a safe way to convert between our enum and Kiwi's enum.\n *\n * @param rule - The constraint rule to convert, or undefined\n * @returns The corresponding Kiwi.js Operator value\n */\nexport function convertRuleToOperator(rule?: UIConstraintRule): Operator {\n switch (rule) {\n case UIConstraintRule.EQUAL:\n return Operator.Eq;\n case UIConstraintRule.LESS:\n return Operator.Le;\n case UIConstraintRule.GREATER:\n return Operator.Ge;\n default:\n return Operator.Eq;\n }\n}\n","import { Constraint, Expression } from \"@lume/kiwi\";\nimport type { UIElement } from \"../elements/UIElement\";\n\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { UIConstraint } from \"./UIConstraint\";\nimport type { UIConstraintPower } from \"./UIConstraintPower\";\nimport { convertPowerToStrength, resolvePower } from \"./UIConstraintPower\";\nimport type { UIConstraintRule } from \"./UIConstraintRule\";\nimport { convertRuleToOperator, resolveRule } from \"./UIConstraintRule\";\n\n/**\n * Configuration options for height constraints.\n */\nexport interface UIHeightOptions {\n /** The fixed height value to constrain the element to */\n height: number;\n /** Priority level for this constraint */\n power: UIConstraintPower;\n /** Rule for the constraint relationship (equal, less than, greater than) */\n rule: UIConstraintRule;\n /** Screen orientation when this constraint should be active */\n orientation: UIOrientation;\n}\n\n/**\n * Constraint that enforces a specific height for a UI element.\n *\n * This constraint can be configured to require an exact height\n * or set minimum/maximum height limits using different rules.\n */\nexport class UIHeightConstraint extends UIConstraint {\n /** The configuration options for this constraint */\n private readonly options: UIHeightOptions;\n /** The Kiwi.js constraint object */\n private constraint?: Constraint;\n\n /**\n * Creates a new height constraint.\n *\n * @param element - The UI element to constrain\n * @param options - Configuration options\n */\n constructor(\n private readonly element: UIElement,\n options: Partial<UIHeightOptions> = {},\n ) {\n super(element.layer, new Set([element]));\n\n this.options = {\n height: options.height ?? element.height,\n power: resolvePower(options.power),\n rule: resolveRule(options.rule),\n orientation: resolveOrientation(options.orientation),\n };\n\n if (\n this.options.orientation === UIOrientation.ALWAYS ||\n this.options.orientation === this.layer.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Destroys this constraint, removing it from the constraint system.\n */\n public override destroy(): void {\n this.destroyConstraints();\n super.destroy();\n }\n\n /**\n * Internal method to disable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"disableConstraintInternal\"](newOrientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n newOrientation !== this.options.orientation\n ) {\n this.destroyConstraints();\n }\n }\n\n /**\n * Internal method to enable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"enableConstraintInternal\"](newOrientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n newOrientation === this.options.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Builds and adds the height constraint to the constraint solver.\n *\n * Creates a constraint that enforces the element's height based\n * on the specified rule (equal to, less than, or greater than).\n *\n */\n protected buildConstraints(): void {\n this.constraint = new Constraint(\n new Expression(this.element[\"heightInternal\"]),\n convertRuleToOperator(this.options.rule),\n this.options.height,\n convertPowerToStrength(this.options.power),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraint);\n }\n\n /**\n * Removes the height constraint from the constraint solver.\n *\n */\n protected destroyConstraints(): void {\n if (this.constraint) {\n this.layer[\"removeConstraintInternal\"](this, this.constraint);\n this.constraint = undefined;\n }\n }\n}\n","class t{constructor(t,i,r=0){this.t=new WeakMap,this.i=new Map,void 0!==t&&(void 0===i?this.i.set(t,r):this.t.set(i,new Map([[t,r]])))}insert(t,i,r=0){if(void 0===i){if(this.i.has(t))return;return void this.i.set(t,r)}const s=this.t.get(i);void 0===s?this.t.set(i,new Map([[t,r]])):s.has(t)||s.set(t,r)}remove(t,i){if(void 0===i)return void this.i.delete(t);const r=this.t.get(i);void 0!==r&&(r.delete(t),0===r.size&&this.t.delete(i))}has(t,i){if(void 0===i)return this.i.has(t);const r=this.t.get(i);return void 0!==r&&r.has(t)}getPriority(t,i){if(void 0===i)return this.i.get(t);const r=this.t.get(i);return void 0!==r?r.get(t):void 0}}class i{constructor(){this.o=new Map}on(t,i,r,s=0){return this.h(t,!1,s,i,r),this}once(t,i,r,s=0){return this.h(t,!0,s,i,r),this}off(t,i,r){const s=this.o.get(t);if(void 0===s)return this;s.u&&(s.u=!1,s.v=s.v.slice());const o=s.v;if(0===o.length)return this.o.delete(t),this;if(void 0===i){this.o.delete(t);for(let t=0;t<o.length;t++){const i=o[t];s.l.remove(i._,i.p)}return this}{const e=o.length;if(o[0]._===i&&o[0].p===r)return 1===e?this.o.delete(t):o.shift(),this;const n=e-1;if(o[n]._===i&&o[n].p===r)return o.pop(),this;if(e<10||o[0].M===o[n].M)for(let t=1;t<n;t++){const s=o[t];if(s._===i&&s.p===r)return o.splice(t,1),this}else{const t=s.l.getPriority(i,r);if(void 0===t)return this;let e=0,n=o.length-1;for(;e<=n;){const i=e+n>>>1;o[i].M<t?e=i+1:n=i-1}const c=e;for(n=o.length-1;e<=n;){const i=e+n>>>1;o[i].M<=t?e=i+1:n=i-1}const h=n;for(let t=c;t<=h;t++)if(o[t]._===i&&o[t].p===r)return o.splice(t,1),this}}return this}emit(t,...i){const r=this.o.get(t);if(void 0===r)return!1;if(0===r.v.length)return!1;r.u?r.v=r.v.slice():r.u=!0;const s=r.v;let o=!1;for(let t=0;t<s.length;t++){const r=s[t];r._.apply(r.p,i),r.k&&(o=!0,r.m=!0)}const e=this.o.get(t);if(void 0===e)return!0;e.v===s&&(e.u=!1);const n=e.v;if(o){let i=0;for(let t=0;t<n.length;t++){const r=n[t];r.m?e.l.remove(r._,r.p):n[i++]=r}0===i?this.o.delete(t):n.length=i}return!0}h(i,r,s,o,e){let n=this.o.get(i);if(void 0===n)return void this.o.set(i,{v:[{_:o,p:e,M:s,k:r,m:!1}],u:!1,l:new t(o,e,s)});if(n.l.has(o,e))throw Error(\"Event listener already exists\");n.l.insert(o,e,s);const c={_:o,p:e,M:s,k:r,m:!1};n.u&&(n.u=!1,n.v=n.v.slice());{const t=n.v,i=c.M;if(0===t.length||t[t.length-1].M<=i)return void t.push(c);if(t[0].M>=i)return void t.unshift(c);{let r=0,s=t.length;for(;r<s;){const o=r+s>>>1;t[o].M<i?r=o+1:s=o}t.splice(r,0,c)}}}}export{i as Eventail};\n//# sourceMappingURL=index.min.js.map\n","import { Variable } from \"@lume/kiwi\";\nimport { Eventail } from \"eventail\";\nimport type { Object3D, WebGLRenderer } from \"three\";\nimport { MathUtils } from \"three\";\nimport {\n convertPowerToStrength,\n UIConstraintPower,\n} from \"../constraints/UIConstraintPower\";\nimport type { UILayer } from \"../layers/UILayer\";\n\nexport abstract class UIAnchor extends Eventail {\n /** X position variable for constraint system */\n public [\"xInternal\"] = new Variable(\"x\");\n\n /** Y position variable for constraint system */\n public [\"yInternal\"] = new Variable(\"y\");\n\n /** Flag indicating whether the element needs recalculation */\n public [\"needsRecalculationInternal\"] = false;\n\n /** Unique identifier for the element */\n public name = MathUtils.generateUUID();\n\n /**\n * Creates a new UI element.\n *\n * @param layer - The UI layer that contains this element\n * @param x - Initial x position\n * @param y - Initial y position\n */\n constructor(\n public readonly layer: UILayer,\n x: number,\n y: number,\n protected readonly object?: Object3D,\n ) {\n super();\n\n if (this.object) {\n this.object.matrixAutoUpdate = false;\n }\n\n this.layer[\"addUIElementInternal\"](this, object);\n\n this.layer[\"addVariableInternal\"](\n this,\n this[\"xInternal\"],\n convertPowerToStrength(UIConstraintPower.P7),\n );\n this.layer[\"addVariableInternal\"](\n this,\n this[\"yInternal\"],\n convertPowerToStrength(UIConstraintPower.P7),\n );\n\n this[\"xInternal\"].setValue(x);\n this[\"yInternal\"].setValue(y);\n\n this.layer[\"suggestVariableInternal\"](this, this[\"xInternal\"], x);\n this.layer[\"suggestVariableInternal\"](this, this[\"yInternal\"], y);\n }\n\n /** Gets the current x position of the anchor */\n public get x(): number {\n return this[\"xInternal\"].value();\n }\n\n /** Gets the current y position of the anchor */\n public get y(): number {\n return this[\"yInternal\"].value();\n }\n\n /** Gets the current z-index (depth) of the element */\n public get zIndex(): number {\n return this.object?.position.z ?? 0;\n }\n\n /** Gets whether the element needs recalculation */\n protected get needsRecalculation(): boolean {\n return this[\"needsRecalculationInternal\"];\n }\n\n /**\n * Sets the x position of the element\n * @param value - New x position\n */\n public set x(value: number) {\n this.layer[\"suggestVariableInternal\"](this, this[\"xInternal\"], value);\n }\n\n /**\n * Sets the y position of the element\n * @param value - New y position\n */\n public set y(value: number) {\n this.layer[\"suggestVariableInternal\"](this, this[\"yInternal\"], value);\n }\n\n /**\n * Sets the z-index (depth) of the element\n * @param value - New z-index\n */\n public set zIndex(value: number) {\n if (this.object && this.object.renderOrder !== value) {\n this.object.position.z = value;\n this.object.renderOrder = value;\n this.layer[\"sortInternal\"]();\n this.object.updateMatrix();\n }\n }\n\n /**\n * Destroys the anchor, cleaning up all resources and removing it from the layer.\n * This should be called when the anchor is no longer needed.\n */\n public destroy(): void {\n this.layer[\"removeVariableInternal\"](this, this[\"yInternal\"]);\n this.layer[\"removeVariableInternal\"](this, this[\"xInternal\"]);\n this.layer[\"removeUIElementInternal\"](this);\n }\n\n /**\n * Internal method called by the rendering system to render this element.\n *\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time elapsed since the last frame\n * @internal\n */\n public [\"renderInternal\"](renderer: WebGLRenderer, deltaTime: number): void {\n this.render(renderer, deltaTime);\n }\n\n /**\n * Applies transformations to the underlying Three.js object.\n * This is called when the element's position, size, or other properties change.\n */\n protected applyTransformations(): void {\n if (this[\"needsRecalculationInternal\"]) {\n if (this.object) {\n this.object.updateMatrix();\n }\n this[\"needsRecalculationInternal\"] = false;\n }\n }\n\n /**\n * Renders the element.\n * This must be implemented by concrete subclasses.\n *\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time elapsed since the last frame\n */\n protected abstract render(renderer: WebGLRenderer, deltaTime: number): void;\n}\n","import { Box2, Vector2 } from \"three\";\n\nconst tempVector2 = new Vector2();\nconst tempBox2 = new Box2();\n\nexport function testElement(\n elementX: number,\n elementY: number,\n elementWidth: number,\n elementHeight: number,\n xClick: number,\n yClick: number,\n): boolean {\n tempVector2.set(xClick, yClick);\n\n tempBox2.min.set(elementX, elementY);\n tempBox2.max.set(elementWidth, elementHeight).add(tempBox2.min);\n return tempBox2.containsPoint(tempVector2);\n}\n","import { Matrix3, Vector3, type Object3D } from \"three\";\nimport type { UIMicroInternal } from \"./UIMicro\";\n\nconst tempMatrixA = new Matrix3();\nconst tempMatrixB = new Matrix3();\nconst tempMatrixC = new Matrix3();\nconst tempMatrixD = new Matrix3();\nconst tempMatrixE = new Matrix3();\nconst tempVectorA = new Vector3();\n\nexport function applyMicroTransformations(\n object: Object3D,\n micro: UIMicroInternal,\n x: number,\n y: number,\n width: number,\n height: number,\n padding: number,\n): void {\n const realX = x - padding;\n const realY = y - padding;\n const realWidth = width + padding * 2;\n const realHeight = height + padding * 2;\n\n const anchorOffsetX = realWidth * micro.anchorX;\n const anchorOffsetY = realHeight * micro.anchorY;\n const centerX = realX + anchorOffsetX;\n const centerY = realY + anchorOffsetY;\n\n const translateToCenter = tempMatrixA.set(\n 1,\n 0,\n -centerX,\n 0,\n 1,\n -centerY,\n 0,\n 0,\n 1,\n );\n\n const scale = tempMatrixB.set(\n micro.scaleX,\n 0,\n 0,\n 0,\n micro.scaleY,\n 0,\n 0,\n 0,\n 1,\n );\n\n const rotation = tempMatrixC.set(\n Math.cos(micro.rotation),\n -Math.sin(micro.rotation),\n 0,\n Math.sin(micro.rotation),\n Math.cos(micro.rotation),\n 0,\n 0,\n 0,\n 1,\n );\n\n const translateFinal = tempMatrixD.set(\n 1,\n 0,\n micro.x + centerX,\n 0,\n 1,\n micro.y + centerY,\n 0,\n 0,\n 1,\n );\n\n const finalMatrix = tempMatrixE\n .multiplyMatrices(translateFinal, rotation)\n .multiply(scale)\n .multiply(translateToCenter);\n\n const point = tempVectorA.set(realX, realY, 1).applyMatrix3(finalMatrix);\n\n object.position.x = point.x;\n object.position.y = point.y;\n object.rotation.z = micro.rotation;\n object.scale.x = realWidth * micro.scaleX;\n object.scale.y = realHeight * micro.scaleY;\n}\n","import { MathUtils } from \"three\";\nimport type { UIElement } from \"../elements/UIElement\";\n\n/**\n * Default position offset value (0)\n */\nconst DEFAULT_POSITION = 0;\n/**\n * Default anchor point value (0.5 = centered)\n */\nconst DEFAULT_ANCHOR = 0.5;\n/**\n * Default scale value (1 = no scaling)\n */\nconst DEFAULT_SCALE = 1;\n/**\n * Default rotation value in radians (0 = no rotation)\n */\nconst DEFAULT_ROTATION = 0;\n\n/**\n * Internal implementation of micro-transformations for UI elements.\n * Stores the raw transformation values and recalculation flag.\n *\n */\nexport class UIMicroInternal {\n /** X-axis offset from element position */\n public x = DEFAULT_POSITION;\n /** Y-axis offset from element position */\n public y = DEFAULT_POSITION;\n /** X-axis anchor point (0-1) where transformations are applied */\n public anchorX = DEFAULT_ANCHOR;\n /** Y-axis anchor point (0-1) where transformations are applied */\n public anchorY = DEFAULT_ANCHOR;\n /** X-axis scaling factor */\n public scaleX = DEFAULT_SCALE;\n /** Y-axis scaling factor */\n public scaleY = DEFAULT_SCALE;\n /** Rotation in radians */\n public rotation = DEFAULT_ROTATION;\n /** Flag indicating whether transformations need to be recalculated */\n public needsRecalculation = false;\n}\n\n/**\n * Provides fine-grained transformations for UI elements.\n *\n * Micro-transformations allow for detailed positioning, scaling, and rotation\n * adjustments relative to an element's base position and dimensions.\n * These transformations are applied on top of the standard element positioning\n * and can be used for effects like pivoting, offsetting, and animation.\n */\nexport class UIMicro {\n /**\n * Creates a new micro-transformation interface.\n *\n * @param raw - The internal state object that stores transformation values\n * @param owner - The UI element that owns these transformations\n */\n constructor(\n private readonly raw: UIMicroInternal,\n private readonly owner: UIElement,\n ) {}\n\n /**\n * Gets the X-axis offset from the element's position.\n */\n public get x(): number {\n return this.raw.x;\n }\n\n /**\n * Gets the Y-axis offset from the element's position.\n */\n public get y(): number {\n return this.raw.y;\n }\n\n /**\n * Gets the X-axis anchor point (0-1) where transformations are applied.\n *\n * - 0.0 = left edge\n * - 0.5 = center (default)\n * - 1.0 = right edge\n */\n public get anchorX(): number {\n return this.raw.anchorX;\n }\n\n /**\n * Gets the Y-axis anchor point (0-1) where transformations are applied.\n *\n * - 0.0 = top edge\n * - 0.5 = center (default)\n * - 1.0 = bottom edge\n */\n public get anchorY(): number {\n return this.raw.anchorY;\n }\n\n /**\n * Gets the X-axis scaling factor.\n *\n * - 1.0 = normal size (default)\n * - > 1.0 = enlarged\n * - < 1.0 = reduced\n */\n public get scaleX(): number {\n return this.raw.scaleX;\n }\n\n /**\n * Gets the Y-axis scaling factor.\n *\n * - 1.0 = normal size (default)\n * - > 1.0 = enlarged\n * - < 1.0 = reduced\n */\n public get scaleY(): number {\n return this.raw.scaleY;\n }\n\n /**\n * Gets the rotation in degrees.\n * Converted from the internal radians value.\n */\n public get angle(): number {\n return MathUtils.radToDeg(this.raw.rotation);\n }\n\n /**\n * Gets the rotation in radians.\n */\n public get rotation(): number {\n return this.raw.rotation;\n }\n\n /**\n * Sets the X-axis offset from the element's position.\n *\n * @param value - X offset in pixels\n */\n public set x(value: number) {\n if (value !== this.raw.x) {\n this.raw.x = value;\n this.raw.needsRecalculation = true;\n }\n }\n\n /**\n * Sets the Y-axis offset from the element's position.\n *\n * @param value - Y offset in pixels\n */\n public set y(value: number) {\n if (value !== this.raw.y) {\n this.raw.y = value;\n this.raw.needsRecalculation = true;\n }\n }\n\n /**\n * Sets the X-axis anchor point where transformations are applied.\n *\n * @param value - X anchor (0-1):\n * - 0.0 = left edge\n * - 0.5 = center (default)\n * - 1.0 = right edge\n */\n public set anchorX(value: number) {\n if (value !== this.raw.anchorX) {\n this.raw.anchorX = value;\n this.raw.needsRecalculation = true;\n }\n }\n\n /**\n * Sets the Y-axis anchor point where transformations are applied.\n *\n * @param value - Y anchor (0-1):\n * - 0.0 = top edge\n * - 0.5 = center (default)\n * - 1.0 = bottom edge\n */\n public set anchorY(value: number) {\n if (value !== this.raw.anchorY) {\n this.raw.anchorY = value;\n this.raw.needsRecalculation = true;\n }\n }\n\n /**\n * Sets the X-axis scaling factor.\n *\n * @param value - X scale factor:\n * - 1.0 = normal size (default)\n * - > 1.0 = enlarged\n * - < 1.0 = reduced\n */\n public set scaleX(value: number) {\n if (value !== this.raw.scaleX) {\n this.raw.scaleX = value;\n this.raw.needsRecalculation = true;\n }\n }\n\n /**\n * Sets the Y-axis scaling factor.\n *\n * @param value - Y scale factor:\n * - 1.0 = normal size (default)\n * - > 1.0 = enlarged\n * - < 1.0 = reduced\n */\n public set scaleY(value: number) {\n if (value !== this.raw.scaleY) {\n this.raw.scaleY = value;\n this.raw.needsRecalculation = true;\n }\n }\n\n /**\n * Sets the rotation in degrees.\n * Automatically converts to radians for internal storage.\n *\n * @param value - Rotation angle in degrees\n */\n public set angle(value: number) {\n const convertedValue = MathUtils.degToRad(value);\n if (convertedValue !== this.raw.rotation) {\n this.raw.rotation = convertedValue;\n this.raw.needsRecalculation = true;\n }\n }\n\n /**\n * Sets the rotation in radians.\n *\n * @param value - Rotation angle in radians\n */\n public set rotation(value: number) {\n if (value !== this.raw.rotation) {\n this.raw.rotation = value;\n this.raw.needsRecalculation = true;\n }\n }\n\n /**\n * Sets the anchor point based on global coordinates relative to the element.\n * Converts the global position to a normalized anchor point (0-1 range).\n *\n * This is useful for setting the pivot point to a specific position,\n * such as making an element rotate around a particular point.\n *\n * @param x - Global X coordinate to set as anchor\n * @param y - Global Y coordinate to set as anchor\n */\n public setAnchorByGlobalPosition(x: number, y: number): void {\n const deltaX = x - this.owner.x;\n const deltaY = y - this.owner.y;\n const newAnchorX = deltaX / this.owner.width;\n const newAnchorY = deltaY / this.owner.height;\n\n if (newAnchorX !== this.raw.anchorX || newAnchorY !== this.raw.anchorY) {\n this.raw.anchorX = newAnchorX;\n this.raw.anchorY = newAnchorY;\n this.raw.needsRecalculation = true;\n }\n }\n\n /**\n * Resets all micro-transformations to their default values.\n *\n * Default values:\n * - Position (x, y): 0\n * - Anchor (anchorX, anchorY): 0.5 (centered)\n * - Scale (scaleX, scaleY): 1.0 (original size)\n * - Rotation: 0 (no rotation)\n *\n * Only triggers recalculation if any values were changed.\n */\n public reset(): void {\n if (\n this.raw.x !== DEFAULT_POSITION ||\n this.raw.y !== DEFAULT_POSITION ||\n this.raw.anchorX !== DEFAULT_ANCHOR ||\n this.raw.anchorY !== DEFAULT_ANCHOR ||\n this.raw.scaleX !== DEFAULT_SCALE ||\n this.raw.scaleY !== DEFAULT_SCALE ||\n this.raw.rotation !== DEFAULT_ROTATION\n ) {\n this.raw.x = DEFAULT_POSITION;\n this.raw.y = DEFAULT_POSITION;\n this.raw.anchorX = DEFAULT_ANCHOR;\n this.raw.anchorY = DEFAULT_ANCHOR;\n this.raw.scaleX = DEFAULT_SCALE;\n this.raw.scaleY = DEFAULT_SCALE;\n this.raw.rotation = DEFAULT_ROTATION;\n this.raw.needsRecalculation = true;\n }\n }\n}\n","/**\n * Defines the visibility and interactivity state of UI elements.\n * \n * UI elements can be in one of three states:\n * - Hidden: Element is not visible and does not receive input\n * - Visible: Element is visible but does not receive input\n * - Interactive: Element is visible and can receive input events\n */\nexport enum UIMode {\n /**\n * Element is not rendered and does not receive input events.\n * Equivalent to setting `display: none` in CSS.\n */\n HIDDEN,\n\n /**\n * Element is rendered but does not receive input events.\n * Equivalent to setting `pointer-events: none` in CSS.\n */\n VISIBLE,\n\n /**\n * Element is rendered and can receive input events.\n * This is the fully active state for UI elements.\n */\n INTERACTIVE,\n}\n","export enum UIBlending {\n NORMAL,\n ADDITIVE,\n SUBTRACTIVE,\n MULTIPLY,\n SCREEN,\n}\n","import type { Texture } from \"three\";\nimport {\n AddEquation,\n AdditiveBlending,\n Color,\n CustomBlending,\n MultiplyBlending,\n NormalBlending,\n OneFactor,\n OneMinusDstColorFactor,\n OneMinusSrcAlphaFactor,\n ShaderMaterial,\n SrcAlphaFactor,\n SubtractiveBlending,\n} from \"three\";\nimport { UIBlending } from \"../miscellaneous/UIBlending\";\n\nexport class UIMaterial extends ShaderMaterial {\n constructor(map?: Texture) {\n super({\n uniforms: {\n map: { value: map },\n opacity: { value: 1.0 },\n color: { value: new Color(1.0, 1.0, 1.0) },\n },\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: /* glsl */ `\n uniform sampler2D map;\n uniform float opacity;\n uniform vec3 color;\n varying vec2 vUv;\n\n void main() {\n vec4 textureColor = texture2D(map, vUv);\n gl_FragColor = vec4(textureColor.rgb * color, textureColor.a * opacity);\n #include <colorspace_fragment>\n }\n `,\n transparent: true,\n lights: false,\n fog: false,\n depthWrite: false,\n depthTest: false,\n });\n }\n\n public getTexture(): Texture | undefined {\n return this.uniforms.map.value;\n }\n\n public getColor(): number {\n return (this.uniforms.color.value as Color).getHex();\n }\n\n public getOpacity(): number {\n return this.uniforms.opacity.value;\n }\n\n public setTexture(value: Texture | undefined): void {\n this.uniforms.map.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setColor(value: number): void {\n (this.uniforms.color.value as Color).setHex(value);\n this.uniformsNeedUpdate = true;\n }\n\n public setOpacity(value: number): void {\n this.uniforms.opacity.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setBlending(blending: UIBlending): void {\n this.premultipliedAlpha = false;\n this.blendEquation = AddEquation;\n this.blendSrc = SrcAlphaFactor;\n this.blendDst = OneMinusSrcAlphaFactor;\n\n switch (blending) {\n case UIBlending.ADDITIVE:\n this.blending = AdditiveBlending;\n break;\n\n case UIBlending.SUBTRACTIVE:\n this.blending = SubtractiveBlending;\n break;\n\n case UIBlending.MULTIPLY:\n this.blending = MultiplyBlending;\n this.premultipliedAlpha = true;\n break;\n\n case UIBlending.SCREEN:\n this.blending = CustomBlending;\n this.blendEquation = AddEquation;\n this.blendSrc = OneMinusDstColorFactor;\n this.blendDst = OneFactor;\n break;\n\n default:\n this.blending = NormalBlending;\n break;\n }\n\n this.needsUpdate = true;\n }\n}\n","import { PlaneGeometry } from \"three\";\n\nconst GEOMETRY_SIZE = 1;\nconst GEOMETRY_OFFSET = 0.5;\n\nexport const geometry = new PlaneGeometry(\n GEOMETRY_SIZE,\n GEOMETRY_SIZE,\n).translate(GEOMETRY_OFFSET, GEOMETRY_OFFSET, 0);\n","import type { Material, WebGLRenderer } from \"three\";\nimport { Mesh, OrthographicCamera, Scene } from \"three\";\nimport { geometry } from \"../miscellaneous/threeInstances\";\n\n/**\n * Shared scene and mesh used by all UIFullScreenQuad instances\n * This optimization avoids creating multiple meshes for rendering quads\n */\nconst scene = new Scene();\nconst mesh = new Mesh(geometry);\nscene.add(mesh);\n\n/**\n * Utility class for rendering a full-screen quad with optional padding\n * Used by the UI composition system to render passes\n */\nexport class UIFullScreenQuad {\n /**\n * Orthographic camera configured for device coordinates\n * Adjusted when padding changes to ensure correct rendering with padding\n */\n private readonly camera = new OrthographicCamera(-1, 1, 1, -1, 0, 1);\n\n /**\n * Creates a new UIFullScreenQuad\n *\n * @param paddingHorizontalInternal - Initial horizontal padding\n * @param paddingVerticalInternal - Initial vertical padding\n */\n constructor(\n private paddingHorizontalInternal = 0,\n private paddingVerticalInternal = 0,\n ) {\n this.updateCameraTransform();\n }\n\n /**\n * Gets the current horizontal padding\n */\n public get paddingHorizontal(): number {\n return this.paddingHorizontalInternal;\n }\n\n /**\n * Gets the current vertical padding\n */\n public get paddingVertical(): number {\n return this.paddingVerticalInternal;\n }\n\n /**\n * Sets the horizontal padding\n * Updates the camera projection when changed\n */\n public set paddingHorizontal(value: number) {\n if (this.paddingHorizontalInternal !== value) {\n this.paddingHorizontalInternal = value;\n this.updateCameraTransform();\n }\n }\n\n /**\n * Sets the vertical padding\n * Updates the camera projection when changed\n */\n public set paddingVertical(value: number) {\n if (this.paddingVerticalInternal !== value) {\n this.paddingVerticalInternal = value;\n this.updateCameraTransform();\n }\n }\n\n /**\n * Renders the fullscreen quad with the provided material\n *\n * @param renderer - The WebGL renderer to use\n * @param material - The material to apply to the fullscreen quad\n */\n public render(renderer: WebGLRenderer, material: Material): void {\n mesh.material = material;\n renderer.render(scene, this.camera);\n }\n\n /**\n * Updates the camera projection matrix to account for padding\n * Expands the camera frustum to include the padded area\n */\n private updateCameraTransform(): void {\n this.camera.left = -this.paddingHorizontalInternal;\n this.camera.right = 1 + this.paddingHorizontalInternal;\n this.camera.bottom = -this.paddingVerticalInternal;\n this.camera.top = 1 + this.paddingVerticalInternal;\n this.camera.updateProjectionMatrix();\n }\n}\n","import type { Material, WebGLRenderer } from \"three\";\nimport {\n LinearFilter,\n NoBlending,\n RGBAFormat,\n UnsignedByteType,\n WebGLRenderTarget,\n} from \"three\";\nimport { UIMaterial } from \"../materials/UIMaterial\";\nimport { UIFullScreenQuad } from \"./UIFullScreenQuad\";\nimport type { UIPass } from \"./UIPass\";\n\n/**\n * UI composition system for applying post-processing effects to rendered UI\n * The system manages render targets and passes to create complex visual effects\n */\n\n/**\n * Internal implementation of the UI composition system\n * Handles the actual rendering and composition of passes\n */\nexport class UIComposerInternal {\n /** Collection of all registered composition passes */\n public readonly passes: UIPass[] = [];\n\n /** Source render target used during ping-pong rendering */\n private fromRenderTarget: WebGLRenderTarget;\n /** Destination render target used during ping-pong rendering */\n private toRenderTarget: WebGLRenderTarget;\n\n /** Default material used to render the final result */\n private readonly defaultMaterial = new UIMaterial();\n /** Full-screen quad used for rendering */\n private readonly screen = new UIFullScreenQuad();\n\n /** Whether the composition needs to be updated */\n private needsUpdateInternal = false;\n /** Whether the padding has changed since last frame */\n private paddingHasChangedInternal = false;\n /** Current padding value in pixels */\n private paddingInternal = 0;\n\n /**\n * Creates a new UI composer with initial render targets\n */\n constructor() {\n const options = {\n format: RGBAFormat,\n minFilter: LinearFilter,\n magFilter: LinearFilter,\n type: UnsignedByteType,\n depthBuffer: false,\n stencilBuffer: false,\n };\n this.fromRenderTarget = new WebGLRenderTarget(1, 1, options);\n this.toRenderTarget = new WebGLRenderTarget(1, 1, options);\n this.fromRenderTarget.texture.generateMipmaps = false;\n this.toRenderTarget.texture.generateMipmaps = false;\n }\n\n /**\n * Whether the composition needs to be updated in the next frame\n * True when either the composer or any valuable passes need update\n */\n public get needsUpdate(): boolean {\n return (\n (this.needsUpdateInternal && this.hasValuablePasses()) ||\n this.hasPassesNeedingUpdate()\n );\n }\n\n /**\n * Whether the padding has changed since the last frame\n * Used to trigger layout updates when padding changes\n */\n public get paddingHasChanged(): boolean {\n return this.paddingHasChangedInternal;\n }\n\n /**\n * Current padding in pixels used for the composition\n * Calculated as the maximum padding required by all passes\n */\n public get padding(): number {\n return this.paddingInternal;\n }\n\n /**\n * Requests an update for the next frame\n * Will trigger a re-composition of all passes\n */\n public requestUpdate(): void {\n this.needsUpdateInternal = true;\n }\n\n /**\n * Composes all registered passes to create the final result\n *\n * @param renderer - WebGL renderer to use for composition\n * @param width - Width of the render target in pixels\n * @param height - Height of the render target in pixels\n * @param material - Input material containing the initial texture\n * @param canOverrideBlending - Whether blending can be overridden on the input material\n * @returns Material to use for rendering the composed result\n */\n public compose(\n renderer: WebGLRenderer,\n width: number,\n height: number,\n material: Material,\n canOverrideBlending = true,\n ): Material {\n const hasValuablePasses = this.hasValuablePasses();\n if (\n (!this.needsUpdateInternal || !hasValuablePasses) &&\n !this.hasPassesNeedingUpdate()\n ) {\n if (!hasValuablePasses) {\n this.paddingHasChangedInternal = this.paddingInternal !== 0;\n this.paddingInternal = 0;\n }\n this.needsUpdateInternal = false;\n return hasValuablePasses ? this.defaultMaterial : material;\n }\n\n const padding = this.calculatePadding();\n this.paddingHasChangedInternal = this.paddingInternal !== padding;\n this.paddingInternal = padding;\n\n const widthWithPadding = width + padding * 2;\n const heightWithPadding = height + padding * 2;\n\n this.fromRenderTarget.setSize(widthWithPadding, heightWithPadding);\n this.toRenderTarget.setSize(widthWithPadding, heightWithPadding);\n this.setScreenPadding(width, height, padding);\n\n renderer.setClearColor(0x000000, 0);\n renderer.setRenderTarget(this.toRenderTarget);\n renderer.clear(true, false, false);\n\n const originalBlending = material.blending;\n if (canOverrideBlending) {\n material.blending = NoBlending;\n }\n this.screen.render(renderer, material);\n material.blending = originalBlending;\n\n const options = { width, height, padding };\n\n for (const pass of this.passes) {\n if (pass.needsUpdate || pass.isValuable) {\n this.reverseRenderTargets();\n renderer.setRenderTarget(this.toRenderTarget);\n renderer.clear(true, false, false);\n pass.render(renderer, this.fromRenderTarget.texture, options);\n }\n }\n\n this.needsUpdateInternal = false;\n this.defaultMaterial.setTexture(this.toRenderTarget.texture);\n return this.defaultMaterial;\n }\n\n /**\n * Cleans up resources used by the composer\n * Should be called when the composer is no longer needed\n */\n public destroy(): void {\n this.fromRenderTarget.dispose();\n this.toRenderTarget.dispose();\n }\n\n /**\n * Checks if any passes are valuable (contribute meaningful effects)\n * @returns True if at least one pass is valuable\n */\n private hasValuablePasses(): boolean {\n return this.passes.some((p) => p.isValuable);\n }\n\n /**\n * Checks if any passes need an update\n * @returns True if at least one pass needs update\n */\n private hasPassesNeedingUpdate(): boolean {\n return this.passes.some((p) => p.needsUpdate);\n }\n\n /**\n * Calculates the maximum padding required by all passes\n * @returns Maximum padding value in pixels\n */\n private calculatePadding(): number {\n return this.passes.reduce((a, p) => Math.max(a, p.padding), 0);\n }\n\n /**\n * Updates the screen quad's padding based on dimensions\n *\n * @param width - Width of the render target in pixels\n * @param height - Height of the render target in pixels\n * @param padding - Padding value in pixels\n */\n private setScreenPadding(\n width: number,\n height: number,\n padding: number,\n ): void {\n this.screen.paddingHorizontal = padding / width;\n this.screen.paddingVertical = padding / height;\n }\n\n /**\n * Swaps the from and to render targets\n * Used for ping-pong rendering between passes\n */\n private reverseRenderTargets(): void {\n const fromRenderTarget = this.fromRenderTarget;\n this.fromRenderTarget = this.toRenderTarget;\n this.toRenderTarget = fromRenderTarget;\n }\n}\n\n/**\n * Public interface for the UI composition system\n * Provides a simplified API for managing UI passes\n */\nexport class UIComposer {\n /**\n * Creates a new UI composer\n *\n * @param raw - Internal implementation that handles actual rendering\n */\n constructor(private readonly raw: UIComposerInternal) {}\n\n /**\n * Collection of all registered composition passes\n * Add passes to this collection to apply effects to the UI\n */\n public get passes(): UIPass[] {\n return this.raw.passes;\n }\n}\n","import { Variable } from \"@lume/kiwi\";\nimport { Eventail } from \"eventail\";\nimport type { WebGLRenderer } from \"three\";\nimport { MathUtils, type Object3D } from \"three\";\nimport {\n convertPowerToStrength,\n UIConstraintPower,\n} from \"../constraints/UIConstraintPower\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { testElement } from \"../miscellaneous/math\";\nimport { applyMicroTransformations } from \"../miscellaneous/microTransformationTools\";\nimport { UIMicro, UIMicroInternal } from \"../miscellaneous/UIMicro\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIComposer, UIComposerInternal } from \"../Passes/UIComposer\";\n\n/**\n * Events that can be emitted by UI elements.\n */\nexport enum UIElementEvent {\n /** Triggered when an interactive element is clicked */\n CLICK = \"click\",\n}\n\n/**\n * Abstract base class for all UI elements in the system.\n * Provides core functionality for positioning, sizing, and rendering UI elements.\n *\n * Each UI element has:\n * - Position (x, y) and size (width, height) variables\n * - Layer management integration\n * - Event handling capabilities\n * - Micro transformations support\n * - Rendering capabilities\n */\nexport abstract class UIElement extends Eventail {\n /** X position variable for constraint system */\n public [\"xInternal\"] = new Variable(\"x\");\n\n /** Y position variable for constraint system */\n public [\"yInternal\"] = new Variable(\"y\");\n\n /** Width variable for constraint system */\n public [\"widthInternal\"] = new Variable(\"width\");\n\n /** Height variable for constraint system */\n public [\"heightInternal\"] = new Variable(\"height\");\n\n /** Flag indicating whether the element needs recalculation */\n public [\"needsRecalculationInternal\"] = false;\n\n /** Unique identifier for the element */\n public name = MathUtils.generateUUID();\n\n /** Micro transformation interface for the element */\n public readonly micro: UIMicro;\n\n /** Composer interface for the element */\n public readonly composer: UIComposer;\n\n /** Internal micro transformation implementation */\n protected readonly microInternal = new UIMicroInternal();\n\n /** Internal composer implementation */\n protected readonly composerInternal = new UIComposerInternal();\n\n /** Current visibility/interactivity mode */\n protected modeInternal = UIMode.VISIBLE;\n\n /**\n * Creates a new UI element.\n *\n * @param layer - The UI layer that contains this element\n * @param object - The Three.js object that represents this element\n * @param x - Initial x position\n * @param y - Initial y position\n * @param width - Initial width\n * @param height - Initial height\n */\n constructor(\n public readonly layer: UILayer,\n protected readonly object: Object3D,\n x: number,\n y: number,\n width: number,\n height: number,\n ) {\n super();\n this.micro = new UIMicro(this.microInternal, this);\n this.composer = new UIComposer(this.composerInternal);\n\n this.object.matrixAutoUpdate = false;\n\n this.layer[\"addUIElementInternal\"](this, this.object);\n\n this.layer[\"addVariableInternal\"](\n this,\n this[\"xInternal\"],\n convertPowerToStrength(UIConstraintPower.P7),\n );\n this.layer[\"addVariableInternal\"](\n this,\n this[\"yInternal\"],\n convertPowerToStrength(UIConstraintPower.P7),\n );\n this.layer[\"addVariableInternal\"](\n this,\n this[\"widthInternal\"],\n convertPowerToStrength(UIConstraintPower.P5),\n );\n this.layer[\"addVariableInternal\"](\n this,\n this[\"heightInternal\"],\n convertPowerToStrength(UIConstraintPower.P5),\n );\n\n this[\"xInternal\"].setValue(x);\n this[\"yInternal\"].setValue(y);\n this[\"widthInternal\"].setValue(width);\n this[\"heightInternal\"].setValue(height);\n\n this.layer[\"suggestVariableInternal\"](this, this[\"xInternal\"], x);\n this.layer[\"suggestVariableInternal\"](this, this[\"yInternal\"], y);\n this.layer[\"suggestVariableInternal\"](this, this[\"widthInternal\"], width);\n this.layer[\"suggestVariableInternal\"](this, this[\"heightInternal\"], height);\n }\n\n /** Gets the current x position of the element */\n public get x(): number {\n return this[\"xInternal\"].value();\n }\n\n /** Gets the current y position of the element */\n public get y(): number {\n return this[\"yInternal\"].value();\n }\n\n /** Gets the current width of the element */\n public get width(): number {\n return this[\"widthInternal\"].value();\n }\n\n /** Gets the current height of the element */\n public get height(): number {\n return this[\"heightInternal\"].value();\n }\n\n /** Gets the current z-index (depth) of the element */\n public get zIndex(): number {\n return this.object.position.z;\n }\n\n /** Gets the current visibility/interactivity mode of the element */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /** Gets whether the element needs recalculation */\n protected get needsRecalculation(): boolean {\n return this[\"needsRecalculationInternal\"];\n }\n\n /**\n * Sets the x position of the element\n * @param value - New x position\n */\n public set x(value: number) {\n this.layer[\"suggestVariableInternal\"](this, this[\"xInternal\"], value);\n }\n\n /**\n * Sets the y position of the element\n * @param value - New y position\n */\n public set y(value: number) {\n this.layer[\"suggestVariableInternal\"](this, this[\"yInternal\"], value);\n }\n\n /**\n * Sets the width of the element\n * @param value - New width\n */\n public set width(value: number) {\n this.layer[\"suggestVariableInternal\"](this, this[\"widthInternal\"], value);\n }\n\n /**\n * Sets the height of the element\n * @param value - New height\n */\n public set height(value: number) {\n this.layer[\"suggestVariableInternal\"](this, this[\"heightInternal\"], value);\n }\n\n /**\n * Sets the z-index (depth) of the element\n * @param value - New z-index\n */\n public set zIndex(value: number) {\n if (this.object.renderOrder !== value) {\n this.object.position.z = value;\n this.object.renderOrder = value;\n this.layer[\"sortInternal\"]();\n this.object.updateMatrix();\n }\n }\n\n /**\n * Sets the visibility/interactivity mode of the element\n * @param value - New UI mode\n */\n public set mode(value: UIMode) {\n this.modeInternal = value;\n this.object.visible = value !== UIMode.HIDDEN;\n }\n\n /**\n * Destroys the element, cleaning up all resources and removing it from the layer.\n * This should be called when the element is no longer needed.\n */\n public destroy(): void {\n this.composerInternal.destroy();\n this.layer[\"removeVariableInternal\"](this, this[\"heightInternal\"]);\n this.layer[\"removeVariableInternal\"](this, this[\"widthInternal\"]);\n this.layer[\"removeVariableInternal\"](this, this[\"yInternal\"]);\n this.layer[\"removeVariableInternal\"](this, this[\"xInternal\"]);\n this.layer[\"removeUIElementInternal\"](this);\n }\n\n /**\n * Internal method called by the rendering system to render this element.\n *\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time elapsed since the last frame\n * @internal\n */\n public [\"renderInternal\"](renderer: WebGLRenderer, deltaTime: number): void {\n this.render(renderer, deltaTime);\n }\n\n /**\n * Internal method called by the event system to handle clicks on this element.\n *\n * @param x - X coordinate of the click\n * @param y - Y coordinate of the click\n * @returns Whether the click was handled by this element\n * @internal\n */\n public [\"clickInternal\"](x: number, y: number): boolean {\n return this.click(x, y);\n }\n\n /**\n * Applies transformations to the underlying Three.js object.\n * This is called when the element's position, size, or other properties change.\n */\n protected applyTransformations(): void {\n if (\n this[\"needsRecalculationInternal\"] ||\n this.microInternal.needsRecalculation ||\n this.composerInternal.paddingHasChanged\n ) {\n applyMicroTransformations(\n this.object,\n this.microInternal,\n this.x,\n this.y,\n this.width,\n this.height,\n this.composerInternal.padding,\n );\n\n this.object.updateMatrix();\n\n this[\"needsRecalculationInternal\"] = false;\n this.microInternal.needsRecalculation = false;\n }\n }\n\n /**\n * Handles click events on this element.\n *\n * @param x - X coordinate of the click\n * @param y - Y coordinate of the click\n * @returns Whether the click was handled by this element\n */\n protected click(x: number, y: number): boolean {\n if (this.mode !== UIMode.INTERACTIVE) {\n return false;\n }\n\n this.applyTransformations();\n if (testElement(this.x, this.y, this.width, this.height, x, y)) {\n this.emit(UIElementEvent.CLICK, this);\n return true;\n }\n\n return false;\n }\n\n /**\n * Renders the element.\n * This must be implemented by concrete subclasses.\n *\n * @param renderer - The WebGL renderer\n * @param deltaTime - Time elapsed since the last frame\n */\n protected abstract render(renderer: WebGLRenderer, deltaTime: number): void;\n}\n","import {\n Constraint,\n Expression,\n Operator,\n Solver,\n Strength,\n Variable,\n} from \"@lume/kiwi\";\nimport { Eventail } from \"eventail\";\nimport type { Object3D, WebGLRenderer } from \"three\";\nimport { Color, OrthographicCamera, Scene } from \"three\";\nimport type { UIConstraint } from \"../constraints/UIConstraint\";\nimport { UIAnchor } from \"../elements/UIAnchor\";\nimport { UIElement } from \"../elements/UIElement\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIOrientation } from \"../miscellaneous/UIOrientation\";\n\nconst clearColor = new Color(0x000000);\n\ninterface VariableDescription {\n strength: number;\n suggestedValue: number;\n}\n\ninterface UIElementDescription {\n object?: Object3D;\n variables: Map<Variable, VariableDescription>;\n constraints: Set<UIConstraint>;\n}\n\ninterface UIConstraintDescription {\n elements: Set<UIElement | UIAnchor>;\n variables: Map<Variable, VariableDescription>;\n constraints: Set<Constraint>;\n}\n\nexport enum UILayerEvent {\n ORIENTATION_CHANGED = \"orientation_changed\",\n CLICK = \"click\",\n}\n\nexport abstract class UILayer extends Eventail {\n public mode = UIMode.VISIBLE;\n\n public readonly [\"xInternal\"]: Variable = new Variable();\n public readonly [\"yInternal\"]: Variable = new Variable();\n public readonly [\"widthInternal\"]: Variable = new Variable();\n public readonly [\"heightInternal\"]: Variable = new Variable();\n\n protected readonly scene = new Scene();\n protected readonly camera = new OrthographicCamera();\n protected solver? = new Solver();\n\n protected elements = new Map<UIElement | UIAnchor, UIElementDescription>();\n protected constraints = new Map<UIConstraint, UIConstraintDescription>();\n\n protected constraintX?: Constraint;\n protected constraintY?: Constraint;\n protected constraintW?: Constraint;\n protected constraintH?: Constraint;\n\n protected orientationPrivate = UIOrientation.PORTRAIT;\n protected needsRecalculation = false;\n\n public get orientation(): UIOrientation {\n return this.orientationPrivate;\n }\n\n public get width(): number {\n return this[\"widthInternal\"].value();\n }\n\n public get height(): number {\n return this[\"heightInternal\"].value();\n }\n\n public destroy(): void {\n this.solver = undefined;\n for (const constraint of this.constraints.keys()) {\n constraint.destroy();\n }\n for (const element of this.elements.keys()) {\n element.destroy();\n }\n }\n\n public [\"addUIElementInternal\"](\n element: UIElement | UIAnchor,\n object?: Object3D,\n renderOrder?: number,\n ): void {\n if (this.elements.has(element)) {\n throw new Error(\"Element already added\");\n }\n\n this.elements.set(element, {\n object,\n variables: new Map(),\n constraints: new Set(),\n });\n\n if (object) {\n const zIndex = renderOrder ?? this.scene.children.length;\n\n object.position.z = zIndex;\n object.renderOrder = zIndex;\n\n this.scene.add(object);\n this[\"sortInternal\"]();\n }\n }\n\n public [\"removeUIElementInternal\"](element: UIElement | UIAnchor): void {\n const dependencies = this.elements.get(element);\n if (dependencies === undefined) {\n throw new Error(\"Element not found\");\n }\n\n if (dependencies.variables.size > 0) {\n throw new Error(\"Variables should be removed before removing element\");\n }\n\n if (dependencies.constraints.size > 0) {\n throw new Error(\"Constraints should be removed before removing element\");\n }\n\n this.elements.delete(element);\n if (dependencies.object) {\n this.scene.remove(dependencies.object);\n }\n }\n\n public [\"addUIConstraintInternal\"](\n constraint: UIConstraint,\n elements: Set<UIElement | UIAnchor>,\n ): void {\n if (this.constraints.has(constraint)) {\n throw new Error(\"Constraint already added\");\n }\n\n for (const element of elements) {\n const dependencies = this.elements.get(element);\n if (dependencies === undefined) {\n throw new Error(\"Element not found\");\n }\n\n if (dependencies.constraints.has(constraint)) {\n throw new Error(\"Something went wrong\");\n }\n\n dependencies.constraints.add(constraint);\n }\n\n this.constraints.set(constraint, {\n elements,\n variables: new Map(),\n constraints: new Set(),\n });\n }\n\n public [\"removeUIConstraintInternal\"](constraint: UIConstraint): void {\n const dependencies = this.constraints.get(constraint);\n if (dependencies === undefined) {\n throw new Error(\"Constraint not found\");\n }\n\n if (dependencies.variables.size > 0) {\n throw new Error(\"Variables should be removed before removing constraint\");\n }\n\n if (dependencies.constraints.size > 0) {\n throw new Error(\n \"Constraints should be removed before removing constraint\",\n );\n }\n\n for (const element of dependencies.elements) {\n const dependencies = this.elements.get(element);\n if (dependencies === undefined) {\n throw new Error(\"Element not found\");\n }\n\n if (!dependencies.constraints.has(constraint)) {\n throw new Error(\"Something went wrong\");\n }\n\n dependencies.constraints.delete(constraint);\n }\n\n this.constraints.delete(constraint);\n }\n\n public [\"addConstraintInternal\"](\n owner: UIConstraint,\n constraint: Constraint,\n ): void {\n const dependencies = this.constraints.get(owner);\n if (dependencies === undefined) {\n throw new Error(\"Before adding constraint you need to add it's owner\");\n }\n\n if (dependencies.constraints.has(constraint)) {\n throw new Error(\"Constraint already exists\");\n }\n\n dependencies.constraints.add(constraint);\n try {\n this.solver?.addConstraint(constraint);\n } catch {\n this.rebuildSolver();\n }\n this.needsRecalculation = true;\n }\n\n public [\"removeConstraintInternal\"](\n owner: UIConstraint,\n constraint: Constraint,\n ): void {\n const dependencies = this.constraints.get(owner);\n if (dependencies === undefined) {\n throw new Error(\"Before removing constraint you need to add it's owner\");\n }\n\n if (!dependencies.constraints.has(constraint)) {\n throw new Error(\"Constraint not found\");\n }\n\n dependencies.constraints.delete(constraint);\n try {\n this.solver?.removeConstraint(constraint);\n } catch {\n this.rebuildSolver();\n }\n this.needsRecalculation = true;\n }\n\n public [\"addVariableInternal\"](\n owner: UIElement | UIAnchor | UIConstraint,\n variable: Variable,\n strength: number,\n ): void {\n const dependencies =\n owner instanceof UIElement || owner instanceof UIAnchor\n ? this.elements.get(owner)\n : this.constraints.get(owner);\n\n if (dependencies === undefined) {\n throw new Error(\"Before adding variable you need to add it's owner\");\n }\n\n if (dependencies.variables.has(variable)) {\n throw new Error(\"Variable already exists\");\n }\n\n dependencies.variables.set(variable, {\n strength,\n suggestedValue: variable.value(),\n });\n\n try {\n this.solver?.addEditVariable(variable, strength);\n } catch {\n this.rebuildSolver();\n }\n this.needsRecalculation = true;\n }\n\n public [\"removeVariableInternal\"](\n owner: UIElement | UIAnchor | UIConstraint,\n variable: Variable,\n ): void {\n const dependencies =\n owner instanceof UIElement || owner instanceof UIAnchor\n ? this.elements.get(owner)\n : this.constraints.get(owner);\n\n if (dependencies === undefined) {\n throw new Error(\"Before removing variable you need to add it's owner\");\n }\n\n if (!dependencies.variables.has(variable)) {\n throw new Error(\"Variable does not exist\");\n }\n\n dependencies.variables.delete(variable);\n try {\n this.solver?.removeEditVariable(variable);\n } catch {\n this.rebuildSolver();\n }\n this.needsRecalculation = true;\n }\n\n public [\"suggestVariableInternal\"](\n owner: UIElement | UIAnchor | UIConstraint,\n variable: Variable,\n value: number,\n ): void {\n const dependencies =\n owner instanceof UIElement || owner instanceof UIAnchor\n ? this.elements.get(owner)\n : this.constraints.get(owner);\n\n if (dependencies === undefined) {\n throw new Error(\"Before suggesting variable you need to add it's owner\");\n }\n\n const description = dependencies.variables.get(variable);\n\n if (!description) {\n throw new Error(\"Variable does not exist\");\n }\n\n if (description.suggestedValue !== value) {\n description.suggestedValue = value;\n try {\n this.solver?.suggestValue(variable, value);\n } catch {\n this.rebuildSolver();\n }\n this.needsRecalculation = true;\n }\n }\n\n public [\"sortInternal\"](): void {\n this.scene.children.sort(\n (a: Object3D, b: Object3D) => a.position.z - b.position.z,\n );\n\n for (let i = 0; i < this.scene.children.length; i++) {\n const child = this.scene.children[i];\n child.position.z = i;\n child.renderOrder = i;\n }\n\n const gap = 1;\n\n this.camera.position.set(0, 0, this.scene.children.length + gap);\n this.camera.near = 1;\n this.camera.far = this.scene.children.length + gap + gap;\n this.camera.updateProjectionMatrix();\n this.camera.updateMatrix();\n }\n\n public render(renderer: WebGLRenderer, deltaTime: number): void {\n if (this.mode === UIMode.HIDDEN) {\n return;\n }\n\n const originalRenderTarget = renderer.getRenderTarget();\n const originalClearColor = renderer.getClearColor(clearColor);\n const originalClearAlpha = renderer.getClearAlpha();\n\n if (this.needsRecalculation) {\n this.needsRecalculation = false;\n this.solver?.updateVariables();\n\n for (const element of this.elements.keys()) {\n element[\"needsRecalculationInternal\"] = true;\n }\n }\n\n for (const element of this.elements.keys()) {\n element[\"renderInternal\"](renderer, deltaTime);\n }\n\n renderer.setRenderTarget(originalRenderTarget);\n renderer.setClearColor(originalClearColor);\n renderer.setClearAlpha(originalClearAlpha);\n renderer.render(this.scene, this.camera);\n }\n\n protected clickInternal(x: number, y: number): void {\n if (this.mode !== UIMode.INTERACTIVE) {\n return;\n }\n\n this.emit(UILayerEvent.CLICK, this, x, y);\n\n const elements = [...this.elements.keys()]\n .filter((e: UIElement | UIAnchor) => e instanceof UIElement)\n .filter((e: UIElement) => e.mode === UIMode.INTERACTIVE)\n .sort((a: UIElement, b: UIElement) => a.zIndex - b.zIndex);\n\n for (const element of elements) {\n if (element[\"clickInternal\"](x, y)) {\n break;\n }\n }\n }\n\n protected resizeInternal(width: number, height: number): void {\n this.applyCameraSize(width, height);\n this.rebuildLayerConstraints(width, height);\n this.updateOrientation(width, height);\n this.needsRecalculation = true;\n }\n\n protected applyCameraSize(width: number, height: number): void {\n this.camera.bottom = 0;\n this.camera.left = 0;\n this.camera.right = width;\n this.camera.top = height;\n this.camera.updateProjectionMatrix();\n }\n\n protected rebuildLayerConstraints(width: number, height: number): void {\n if (this.constraintX) {\n this.solver?.removeConstraint(this.constraintX);\n this.constraintX = undefined;\n }\n if (this.constraintY) {\n this.solver?.removeConstraint(this.constraintY);\n this.constraintY = undefined;\n }\n if (this.constraintW) {\n this.solver?.removeConstraint(this.constraintW);\n this.constraintW = undefined;\n }\n if (this.constraintH) {\n this.solver?.removeConstraint(this.constraintH);\n this.constraintH = undefined;\n }\n\n this.constraintX = new Constraint(\n new Expression(this[\"xInternal\"]),\n Operator.Eq,\n 0,\n Strength.required,\n );\n\n this.constraintY = new Constraint(\n new Expression(this[\"yInternal\"]),\n Operator.Eq,\n 0,\n Strength.required,\n );\n\n this.constraintW = new Constraint(\n new Expression(this[\"widthInternal\"]),\n Operator.Eq,\n width,\n Strength.required,\n );\n\n this.constraintH = new Constraint(\n new Expression(this[\"heightInternal\"]),\n Operator.Eq,\n height,\n Strength.required,\n );\n\n this.solver?.addConstraint(this.constraintX);\n this.solver?.addConstraint(this.constraintY);\n this.solver?.addConstraint(this.constraintW);\n this.solver?.addConstraint(this.constraintH);\n }\n\n protected updateOrientation(width: number, height: number): void {\n const lastOrientation = this.orientationPrivate;\n this.orientationPrivate =\n width > height ? UIOrientation.LANDSCAPE : UIOrientation.PORTRAIT;\n\n if (lastOrientation !== this.orientationPrivate) {\n this.solver = undefined;\n\n for (const constraint of this.constraints.keys()) {\n constraint[\"enableConstraintInternal\"](this.orientationPrivate);\n }\n for (const constraint of this.constraints.keys()) {\n constraint[\"disableConstraintInternal\"](this.orientationPrivate);\n }\n\n this.solver = new Solver();\n const descriptions = [\n ...this.elements.values(),\n ...this.constraints.values(),\n ];\n\n for (const description of descriptions) {\n for (const [key, value] of description.variables.entries()) {\n this.solver.addEditVariable(key, value.strength);\n this.solver.suggestValue(key, value.suggestedValue);\n }\n }\n\n if (this.constraintX) {\n this.solver.addConstraint(this.constraintX);\n }\n if (this.constraintY) {\n this.solver.addConstraint(this.constraintY);\n }\n if (this.constraintW) {\n this.solver.addConstraint(this.constraintW);\n }\n if (this.constraintH) {\n this.solver.addConstraint(this.constraintH);\n }\n\n for (const dependency of this.constraints.values()) {\n for (const constraint of dependency.constraints.values()) {\n this.solver.addConstraint(constraint);\n }\n }\n\n this.emit(UILayerEvent.ORIENTATION_CHANGED, this, this.orientation);\n }\n }\n\n private rebuildSolver(): void {\n try {\n this.solver = undefined;\n\n this.solver = new Solver();\n const descriptions = [\n ...this.elements.values(),\n ...this.constraints.values(),\n ];\n\n for (const description of descriptions) {\n for (const [key, value] of description.variables.entries()) {\n this.solver.addEditVariable(key, value.strength);\n this.solver.suggestValue(key, value.suggestedValue);\n }\n }\n\n if (this.constraintX) {\n this.solver.addConstraint(this.constraintX);\n }\n if (this.constraintY) {\n this.solver.addConstraint(this.constraintY);\n }\n if (this.constraintW) {\n this.solver.addConstraint(this.constraintW);\n }\n if (this.constraintH) {\n this.solver.addConstraint(this.constraintH);\n }\n\n for (const dependency of this.constraints.values()) {\n for (const constraint of dependency.constraints.values()) {\n this.solver.addConstraint(constraint);\n }\n }\n } catch (error) {\n throw error;\n }\n }\n}\n","import type { UIAnchor } from \"../elements/UIAnchor\";\nimport type { UIElement } from \"../elements/UIElement\";\nimport { UILayer } from \"../layers/UILayer\";\n\nexport function assertSameLayer(\n elementOne: UIElement | UIAnchor | UILayer,\n elementTwo: UIElement | UIAnchor,\n message?: string,\n): void {\n if (\n (elementOne instanceof UILayer ? elementOne : elementOne.layer) !==\n elementTwo.layer\n ) {\n throw new Error(\n message ??\n `Elements must be on the same layer - element \"${elementTwo.constructor.name}\" cannot interact with elements from a different layer`,\n );\n }\n}\n\nexport function assertSize(\n width: number,\n height: number,\n message?: string,\n): void {\n if (width <= 0 || height <= 0) {\n throw new Error(\n message ??\n `Invalid dimensions: width (${width}) and height (${height}) must both be positive numbers greater than 0`,\n );\n }\n}\n","import { Constraint, Expression } from \"@lume/kiwi\";\nimport { UIAnchor } from \"../elements/UIAnchor\";\nimport { UIElement } from \"../elements/UIElement\";\nimport { UILayer } from \"../layers/UILayer\";\nimport { assertSameLayer } from \"../miscellaneous/asserts\";\n\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { UIConstraint } from \"./UIConstraint\";\nimport type { UIConstraintPower } from \"./UIConstraintPower\";\nimport { convertPowerToStrength, resolvePower } from \"./UIConstraintPower\";\nimport type { UIConstraintRule } from \"./UIConstraintRule\";\nimport { convertRuleToOperator, resolveRule } from \"./UIConstraintRule\";\n\n/**\n * Default anchor value (0.5 = center) for horizontal distance constraint\n */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for horizontal distance constraints.\n */\nexport interface UIHorizontalDistanceOptions {\n /** Horizontal anchor point (0-1) for the first element */\n anchorOne: number;\n /** Horizontal anchor point (0-1) for the second element */\n anchorTwo: number;\n /** The target distance between the two elements' anchor points */\n distance: number;\n /** Priority level for this constraint */\n power: UIConstraintPower;\n /** Rule for the constraint relationship (equal, less than, greater than) */\n rule: UIConstraintRule;\n /** Screen orientation when this constraint should be active */\n orientation: UIOrientation;\n}\n\n/**\n * Constraint that enforces a specific horizontal distance between two UI elements.\n *\n * This constraint measures the distance between two anchor points on the x-axis\n * and ensures it matches (or is less/greater than) the specified distance value.\n */\nexport class UIHorizontalDistanceConstraint extends UIConstraint {\n /** The configuration options for this constraint */\n private readonly options: UIHorizontalDistanceOptions;\n /** The Kiwi.js constraint object */\n private constraint?: Constraint;\n\n /**\n * Creates a new horizontal distance constraint.\n *\n * @param elementOne - The first element or layer\n * @param elementTwo - The second element\n * @param options - Configuration options\n */\n constructor(\n private readonly elementOne: UIElement | UIAnchor | UILayer,\n private readonly elementTwo: UIElement | UIAnchor,\n options: Partial<UIHorizontalDistanceOptions> = {},\n ) {\n assertSameLayer(elementOne, elementTwo);\n super(\n elementTwo.layer,\n new Set(\n elementOne instanceof UIElement || elementOne instanceof UIAnchor\n ? [elementOne, elementTwo]\n : [elementTwo],\n ),\n );\n\n this.options = {\n anchorOne: options.anchorOne ?? DEFAULT_ANCHOR,\n anchorTwo: options.anchorTwo ?? DEFAULT_ANCHOR,\n distance: options.distance ?? 0,\n power: resolvePower(options.power),\n rule: resolveRule(options.rule),\n orientation: resolveOrientation(options.orientation),\n };\n\n if (\n this.options.orientation === UIOrientation.ALWAYS ||\n this.options.orientation === this.layer.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Destroys this constraint, removing it from the constraint system.\n */\n public override destroy(): void {\n this.destroyConstraints();\n super.destroy();\n }\n\n /**\n * Internal method to disable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"disableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation !== this.options.orientation\n ) {\n this.destroyConstraints();\n }\n }\n\n /**\n * Internal method to enable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"enableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation === this.options.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Builds and adds the horizontal distance constraint to the constraint solver.\n *\n * Creates a constraint that enforces the distance between anchor points\n * on the x-axis of two elements based on the specified rule.\n *\n */\n protected buildConstraints(): void {\n const expressionOne =\n this.elementOne instanceof UIElement || this.elementOne instanceof UILayer\n ? new Expression(this.elementOne[\"xInternal\"]).plus(\n new Expression(this.elementOne[\"widthInternal\"]).multiply(\n this.options.anchorOne,\n ),\n )\n : new Expression(this.elementOne[\"xInternal\"]);\n\n const expressionTwo =\n this.elementTwo instanceof UIElement\n ? new Expression(this.elementTwo[\"xInternal\"]).plus(\n new Expression(this.elementTwo[\"widthInternal\"]).multiply(\n this.options.anchorTwo,\n ),\n )\n : new Expression(this.elementTwo[\"xInternal\"]);\n\n this.constraint = new Constraint(\n expressionTwo.minus(expressionOne),\n convertRuleToOperator(this.options.rule),\n this.options.distance,\n convertPowerToStrength(this.options.power),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraint);\n }\n\n /**\n * Removes the horizontal distance constraint from the constraint solver.\n *\n */\n protected destroyConstraints(): void {\n if (this.constraint) {\n this.layer[\"removeConstraintInternal\"](this, this.constraint);\n this.constraint = undefined;\n }\n }\n}\n","import { Constraint, Expression } from \"@lume/kiwi\";\nimport { UIElement } from \"../elements/UIElement\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertSameLayer } from \"../miscellaneous/asserts\";\n\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { UIConstraint } from \"./UIConstraint\";\nimport type { UIConstraintPower } from \"./UIConstraintPower\";\nimport { convertPowerToStrength, resolvePower } from \"./UIConstraintPower\";\nimport type { UIConstraintRule } from \"./UIConstraintRule\";\nimport { convertRuleToOperator, resolveRule } from \"./UIConstraintRule\";\n\n/**\n * Configuration options for horizontal proportion constraints.\n */\nexport interface UIHorizontalProportionOptions {\n /** The proportion ratio between elements' widths */\n proportion: number;\n /** Priority level for this constraint */\n power: UIConstraintPower;\n /** Rule for the constraint relationship (equal, less than, greater than) */\n rule: UIConstraintRule;\n /** Screen orientation when this constraint should be active */\n orientation: UIOrientation;\n}\n\n/**\n * Constraint that enforces a proportional relationship between the widths of two elements.\n *\n * This constraint ensures that the width of one element is proportionally\n * related to the width of another element by a specified ratio.\n */\nexport class UIHorizontalProportionConstraint extends UIConstraint {\n /** The configuration options for this constraint */\n private readonly options: UIHorizontalProportionOptions;\n /** The Kiwi.js constraint object */\n private constraint?: Constraint;\n\n /**\n * Creates a new horizontal proportion constraint.\n *\n * @param elementOne - The reference element or layer\n * @param elementTwo - The element to constrain proportionally\n * @param options - Configuration options\n */\n constructor(\n private readonly elementOne: UIElement | UILayer,\n private readonly elementTwo: UIElement,\n options: Partial<UIHorizontalProportionOptions> = {},\n ) {\n assertSameLayer(elementOne, elementTwo);\n super(\n elementTwo.layer,\n new Set(\n elementOne instanceof UIElement\n ? [elementOne, elementTwo]\n : [elementTwo],\n ),\n );\n\n this.options = {\n proportion: options.proportion ?? 1,\n power: resolvePower(options.power),\n rule: resolveRule(options.rule),\n orientation: resolveOrientation(options.orientation),\n };\n\n if (\n this.options.orientation === UIOrientation.ALWAYS ||\n this.options.orientation === this.layer.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Destroys this constraint, removing it from the constraint system.\n */\n public override destroy(): void {\n this.destroyConstraints();\n super.destroy();\n }\n\n /**\n * Internal method to disable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"disableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation !== this.options.orientation\n ) {\n this.destroyConstraints();\n }\n }\n\n /**\n * Internal method to enable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"enableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation === this.options.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Builds and adds the horizontal proportion constraint to the constraint solver.\n *\n * Creates a constraint expression in the form: (elementOne.width * proportion) - elementTwo.width = 0\n * This ensures the width ratio between elements matches the specified proportion.\n *\n */\n protected buildConstraints(): void {\n const expressionOne = new Expression(\n this.elementOne[\"widthInternal\"],\n ).multiply(this.options.proportion);\n const expressionTwo = new Expression(this.elementTwo[\"widthInternal\"]);\n\n this.constraint = new Constraint(\n expressionOne.minus(expressionTwo),\n convertRuleToOperator(this.options.rule),\n 0,\n convertPowerToStrength(this.options.power),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraint);\n }\n\n /**\n * Removes the horizontal proportion constraint from the constraint solver.\n *\n */\n protected destroyConstraints(): void {\n if (this.constraint) {\n this.layer[\"removeConstraintInternal\"](this, this.constraint);\n this.constraint = undefined;\n }\n }\n}\n","import { Constraint, Expression } from \"@lume/kiwi\";\nimport { UIAnchor } from \"../elements/UIAnchor\";\nimport { UIElement } from \"../elements/UIElement\";\nimport { UILayer } from \"../layers/UILayer\";\nimport { assertSameLayer } from \"../miscellaneous/asserts\";\n\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { UIConstraint } from \"./UIConstraint\";\nimport type { UIConstraintPower } from \"./UIConstraintPower\";\nimport { convertPowerToStrength, resolvePower } from \"./UIConstraintPower\";\nimport type { UIConstraintRule } from \"./UIConstraintRule\";\nimport { convertRuleToOperator, resolveRule } from \"./UIConstraintRule\";\n\n/**\n * Default anchor value (0.5 = center) for vertical distance constraint\n */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for vertical distance constraints.\n */\nexport interface UIVerticalDistanceOptions {\n /** Vertical anchor point (0-1) for the first element */\n anchorOne: number;\n /** Vertical anchor point (0-1) for the second element */\n anchorTwo: number;\n /** The target distance between the two elements' anchor points */\n distance: number;\n /** Priority level for this constraint */\n power: UIConstraintPower;\n /** Rule for the constraint relationship (equal, less than, greater than) */\n rule: UIConstraintRule;\n /** Screen orientation when this constraint should be active */\n orientation: UIOrientation;\n}\n\n/**\n * Constraint that enforces a specific vertical distance between two UI elements.\n *\n * This constraint measures the distance between two anchor points on the y-axis\n * and ensures it matches (or is less/greater than) the specified distance value.\n */\nexport class UIVerticalDistanceConstraint extends UIConstraint {\n /** The configuration options for this constraint */\n private readonly options: UIVerticalDistanceOptions;\n /** The Kiwi.js constraint object */\n private constraint?: Constraint;\n\n /**\n * Creates a new vertical distance constraint.\n *\n * @param elementOne - The first element or layer\n * @param elementTwo - The second element\n * @param options - Configuration options\n */\n constructor(\n private readonly elementOne: UIElement | UIAnchor | UILayer,\n private readonly elementTwo: UIElement | UIAnchor,\n options: Partial<UIVerticalDistanceOptions> = {},\n ) {\n assertSameLayer(elementOne, elementTwo);\n super(\n elementTwo.layer,\n new Set(\n elementOne instanceof UIElement || elementOne instanceof UIAnchor\n ? [elementOne, elementTwo]\n : [elementTwo],\n ),\n );\n\n this.options = {\n anchorOne: options.anchorOne ?? DEFAULT_ANCHOR,\n anchorTwo: options.anchorTwo ?? DEFAULT_ANCHOR,\n distance: options.distance ?? 0,\n power: resolvePower(options.power),\n rule: resolveRule(options.rule),\n orientation: resolveOrientation(options.orientation),\n };\n\n if (\n this.options.orientation === UIOrientation.ALWAYS ||\n this.options.orientation === this.layer.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Destroys this constraint, removing it from the constraint system.\n */\n public override destroy(): void {\n this.destroyConstraints();\n super.destroy();\n }\n\n /**\n * Internal method to disable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"disableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation !== this.options.orientation\n ) {\n this.destroyConstraints();\n }\n }\n\n /**\n * Internal method to enable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"enableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation === this.options.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Builds and adds the vertical distance constraint to the constraint solver.\n *\n * Creates a constraint that enforces the distance between anchor points\n * on the y-axis of two elements based on the specified rule.\n *\n */\n protected buildConstraints(): void {\n const expressionOne =\n this.elementOne instanceof UIElement || this.elementOne instanceof UILayer\n ? new Expression(this.elementOne[\"yInternal\"]).plus(\n new Expression(this.elementOne[\"heightInternal\"]).multiply(\n this.options.anchorOne,\n ),\n )\n : new Expression(this.elementOne[\"yInternal\"]);\n\n const expressionTwo =\n this.elementTwo instanceof UIElement\n ? new Expression(this.elementTwo[\"yInternal\"]).plus(\n new Expression(this.elementTwo[\"heightInternal\"]).multiply(\n this.options.anchorTwo,\n ),\n )\n : new Expression(this.elementTwo[\"yInternal\"]);\n\n this.constraint = new Constraint(\n expressionTwo.minus(expressionOne),\n convertRuleToOperator(this.options.rule),\n this.options.distance,\n convertPowerToStrength(this.options.power),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraint);\n }\n\n /**\n * Removes the vertical distance constraint from the constraint solver.\n *\n */\n protected destroyConstraints(): void {\n if (this.constraint) {\n this.layer[\"removeConstraintInternal\"](this, this.constraint);\n this.constraint = undefined;\n }\n }\n}\n","import { Constraint, Expression } from \"@lume/kiwi\";\nimport { UIElement } from \"../elements/UIElement\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertSameLayer } from \"../miscellaneous/asserts\";\n\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { UIConstraint } from \"./UIConstraint\";\nimport type { UIConstraintPower } from \"./UIConstraintPower\";\nimport { convertPowerToStrength, resolvePower } from \"./UIConstraintPower\";\nimport type { UIConstraintRule } from \"./UIConstraintRule\";\nimport { convertRuleToOperator, resolveRule } from \"./UIConstraintRule\";\n\n/**\n * Configuration options for vertical proportion constraints.\n */\nexport interface UIVerticalProportionOptions {\n /** The proportion ratio between elements' heights */\n proportion: number;\n /** Priority level for this constraint */\n power: UIConstraintPower;\n /** Rule for the constraint relationship (equal, less than, greater than) */\n rule: UIConstraintRule;\n /** Screen orientation when this constraint should be active */\n orientation: UIOrientation;\n}\n\n/**\n * Constraint that enforces a proportional relationship between the heights of two elements.\n *\n * This constraint ensures that the height of one element is proportionally\n * related to the height of another element by a specified ratio.\n */\nexport class UIVerticalProportionConstraint extends UIConstraint {\n /** The configuration options for this constraint */\n private readonly options: UIVerticalProportionOptions;\n /** The Kiwi.js constraint object */\n private constraint?: Constraint;\n\n /**\n * Creates a new vertical proportion constraint.\n *\n * @param elementOne - The reference element or layer\n * @param elementTwo - The element to constrain proportionally\n * @param options - Configuration options\n */\n constructor(\n private readonly elementOne: UIElement | UILayer,\n private readonly elementTwo: UIElement,\n options: Partial<UIVerticalProportionOptions> = {},\n ) {\n assertSameLayer(elementOne, elementTwo);\n super(\n elementTwo.layer,\n new Set(\n elementOne instanceof UIElement\n ? [elementOne, elementTwo]\n : [elementTwo],\n ),\n );\n\n this.options = {\n proportion: options.proportion ?? 1,\n power: resolvePower(options.power),\n rule: resolveRule(options.rule),\n orientation: resolveOrientation(options.orientation),\n };\n\n if (\n this.options.orientation === UIOrientation.ALWAYS ||\n this.options.orientation === this.layer.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Destroys this constraint, removing it from the constraint system.\n */\n public override destroy(): void {\n this.destroyConstraints();\n super.destroy();\n }\n\n /**\n * Internal method to disable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"disableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation !== this.options.orientation\n ) {\n this.destroyConstraints();\n }\n }\n\n /**\n * Internal method to enable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"enableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation === this.options.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Builds and adds the vertical proportion constraint to the constraint solver.\n *\n * Creates a constraint expression in the form: (elementOne.height * proportion) - elementTwo.height = 0\n * This ensures the height ratio between elements matches the specified proportion.\n *\n */\n protected buildConstraints(): void {\n const expressionOne = new Expression(\n this.elementOne[\"heightInternal\"],\n ).multiply(this.options.proportion);\n const expressionTwo = new Expression(this.elementTwo[\"heightInternal\"]);\n\n this.constraint = new Constraint(\n expressionOne.minus(expressionTwo),\n convertRuleToOperator(this.options.rule),\n 0,\n convertPowerToStrength(this.options.power),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraint);\n }\n\n /**\n * Removes the vertical proportion constraint from the constraint solver.\n *\n */\n protected destroyConstraints(): void {\n if (this.constraint) {\n this.layer[\"removeConstraintInternal\"](this, this.constraint);\n this.constraint = undefined;\n }\n }\n}\n","import { Constraint, Expression } from \"@lume/kiwi\";\nimport type { UIElement } from \"../elements/UIElement\";\n\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { UIConstraint } from \"./UIConstraint\";\nimport type { UIConstraintPower } from \"./UIConstraintPower\";\nimport { convertPowerToStrength, resolvePower } from \"./UIConstraintPower\";\nimport type { UIConstraintRule } from \"./UIConstraintRule\";\nimport { convertRuleToOperator, resolveRule } from \"./UIConstraintRule\";\n\n/**\n * Configuration options for width constraints.\n */\nexport interface UIWidthOptions {\n /** The fixed width value to constrain the element to */\n width: number;\n /** Priority level for this constraint */\n power: UIConstraintPower;\n /** Rule for the constraint relationship (equal, less than, greater than) */\n rule: UIConstraintRule;\n /** Screen orientation when this constraint should be active */\n orientation: UIOrientation;\n}\n\n/**\n * Constraint that enforces a specific width for a UI element.\n *\n * This constraint can be configured to require an exact width\n * or set minimum/maximum width limits using different rules.\n */\nexport class UIWidthConstraint extends UIConstraint {\n /** The configuration options for this constraint */\n private readonly options: UIWidthOptions;\n /** The Kiwi.js constraint object */\n private constraint?: Constraint;\n\n /**\n * Creates a new width constraint.\n *\n * @param element - The UI element to constrain\n * @param options - Configuration options\n */\n constructor(\n private readonly element: UIElement,\n options: Partial<UIWidthOptions> = {},\n ) {\n super(element.layer, new Set([element]));\n\n this.options = {\n width: options.width ?? element.width,\n power: resolvePower(options.power),\n rule: resolveRule(options.rule),\n orientation: resolveOrientation(options.orientation),\n };\n\n if (\n this.options.orientation === UIOrientation.ALWAYS ||\n this.options.orientation === this.layer.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Destroys this constraint, removing it from the constraint system.\n */\n public override destroy(): void {\n this.destroyConstraints();\n super.destroy();\n }\n\n /**\n * Internal method to disable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"disableConstraintInternal\"](newOrientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n newOrientation !== this.options.orientation\n ) {\n this.destroyConstraints();\n }\n }\n\n /**\n * Internal method to enable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"enableConstraintInternal\"](newOrientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n newOrientation === this.options.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Builds and adds the width constraint to the constraint solver.\n *\n * Creates a constraint that enforces the element's width based\n * on the specified rule (equal to, less than, or greater than).\n *\n */\n protected buildConstraints(): void {\n this.constraint = new Constraint(\n new Expression(this.element[\"widthInternal\"]),\n convertRuleToOperator(this.options.rule),\n this.options.width,\n convertPowerToStrength(this.options.power),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraint);\n }\n\n /**\n * Removes the width constraint from the constraint solver.\n *\n */\n protected destroyConstraints(): void {\n if (this.constraint) {\n this.layer[\"removeConstraintInternal\"](this, this.constraint);\n this.constraint = undefined;\n }\n }\n}\n","import type { UIConstraintPower } from \"../constraints/UIConstraintPower\";\nimport type { UIConstraintRule } from \"../constraints/UIConstraintRule\";\nimport { UIHeightConstraint } from \"../constraints/UIHeightConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport { UIWidthConstraint } from \"../constraints/UIWidthConstraint\";\nimport type { UIAnchor } from \"../elements/UIAnchor\";\nimport type { UIElement } from \"../elements/UIElement\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport type { UIOrientation } from \"../miscellaneous/UIOrientation\";\n\nexport interface UIType2D<T> {\n h?: T;\n v?: T;\n}\n\ninterface UIConstraint2DOptions {\n power: UIType2D<UIConstraintPower>;\n rule: UIType2D<UIConstraintRule>;\n orientation: UIType2D<UIOrientation>;\n}\n\nexport interface UIConstraintSize2DOptions extends UIConstraint2DOptions {\n size: UIType2D<number>;\n}\n\nexport interface UIConstraintSize2DOptions extends UIConstraint2DOptions {\n anchorOne: UIType2D<number>;\n anchorTwo: UIType2D<number>;\n distance: UIType2D<number>;\n}\n\nexport interface UIConstraintProportion2DOptions extends UIConstraint2DOptions {\n proportion: UIType2D<number>;\n}\n\nexport interface UIConstraint2DResult<TX, TY> {\n x: TX;\n y: TY;\n}\n\nexport class UIConstraint2DBuilder {\n public static size(\n element: UIElement,\n options: Partial<UIConstraintSize2DOptions> = {},\n ): UIConstraint2DResult<UIWidthConstraint, UIHeightConstraint> {\n return {\n x: new UIWidthConstraint(element, {\n width: options.size?.h,\n power: options.power?.h,\n rule: options.rule?.h,\n orientation: options.orientation?.h,\n }),\n y: new UIHeightConstraint(element, {\n height: options.size?.v,\n power: options.power?.v,\n rule: options.rule?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n public static distance(\n elementOne: UIElement | UIAnchor | UILayer,\n elementTwo: UIElement | UIAnchor,\n options: Partial<UIConstraintSize2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalDistanceConstraint,\n UIVerticalDistanceConstraint\n > {\n return {\n x: new UIHorizontalDistanceConstraint(elementOne, elementTwo, {\n anchorOne: options.anchorOne?.h,\n anchorTwo: options.anchorTwo?.h,\n distance: options.distance?.h,\n power: options.power?.h,\n rule: options.rule?.h,\n orientation: options.orientation?.h,\n }),\n y: new UIVerticalDistanceConstraint(elementOne, elementTwo, {\n anchorOne: options.anchorOne?.v,\n anchorTwo: options.anchorTwo?.v,\n distance: options.distance?.v,\n power: options.power?.v,\n rule: options.rule?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n public static proportion(\n elementOne: UIElement | UILayer,\n elementTwo: UIElement,\n options: Partial<UIConstraintProportion2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalProportionConstraint,\n UIVerticalProportionConstraint\n > {\n return {\n x: new UIHorizontalProportionConstraint(elementOne, elementTwo, {\n proportion: options.proportion?.h,\n power: options.power?.h,\n rule: options.rule?.h,\n orientation: options.orientation?.h,\n }),\n y: new UIVerticalProportionConstraint(elementOne, elementTwo, {\n proportion: options.proportion?.v,\n power: options.power?.v,\n rule: options.rule?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n}\n","import type { UIConstraintPower } from \"../constraints/UIConstraintPower\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport type { UIElement } from \"../elements/UIElement\";\nimport type { UIOrientation } from \"../miscellaneous/UIOrientation\";\n\nexport enum UIConstraintContainerDirection {\n FROM_LEFT_TOP,\n FROM_LEFT_BOTTOM,\n}\n\nexport interface UIConstraintContainerBuilderOptions {\n direction: UIConstraintContainerDirection;\n power: UIConstraintPower;\n orientation: UIOrientation;\n}\n\nexport class UIConstraintContainerBuilder {\n public static build(\n container: UIElement,\n elementOne: UIElement,\n elementTwo: UIElement,\n options: Partial<UIConstraintContainerBuilderOptions> = {},\n ): {\n horizontalDistances: UIHorizontalDistanceConstraint[];\n verticalDistances: UIVerticalDistanceConstraint[];\n } {\n const direction =\n options.direction ?? UIConstraintContainerDirection.FROM_LEFT_TOP;\n\n const horizontalDistances: UIHorizontalDistanceConstraint[] = [];\n const verticalDistances: UIVerticalDistanceConstraint[] = [];\n\n horizontalDistances.push(\n new UIHorizontalDistanceConstraint(container, elementOne, {\n anchorOne: 0,\n anchorTwo: 0,\n distance: 0,\n power: options.power,\n orientation: options.orientation,\n }),\n new UIHorizontalDistanceConstraint(container, elementTwo, {\n anchorOne: 1,\n anchorTwo: 1,\n distance: 0,\n power: options.power,\n orientation: options.orientation,\n }),\n );\n\n const anchorOne =\n direction === UIConstraintContainerDirection.FROM_LEFT_TOP ? 1 : 0;\n const anchorTwo =\n direction === UIConstraintContainerDirection.FROM_LEFT_TOP ? 0 : 1;\n\n verticalDistances.push(\n new UIVerticalDistanceConstraint(container, elementOne, {\n anchorOne: anchorOne,\n anchorTwo: anchorOne,\n distance: 0,\n power: options.power,\n orientation: options.orientation,\n }),\n new UIVerticalDistanceConstraint(container, elementTwo, {\n anchorOne: anchorTwo,\n anchorTwo: anchorTwo,\n distance: 0,\n power: options.power,\n orientation: options.orientation,\n }),\n );\n\n return {\n horizontalDistances,\n verticalDistances,\n };\n }\n}\n","import type { UIConstraintPower } from \"../constraints/UIConstraintPower\";\nimport type { UIHorizontalDistanceOptions } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport type { UIHorizontalProportionOptions } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport type { UIVerticalDistanceOptions } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport type { UIVerticalProportionOptions } from \"../constraints/UIVerticalProportionConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport type { UIElement } from \"../elements/UIElement\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport type { UIOrientation } from \"../miscellaneous/UIOrientation\";\n\nexport interface UIConstraintStackBuilderOptions {\n distance: number;\n keepProportions: boolean;\n keepAlignment: boolean;\n power: UIConstraintPower;\n orientation: UIOrientation;\n}\n\nexport interface UIConstraintStackBuilderResult<\n TDistance,\n TProportion,\n TCenter,\n> {\n distanceConstraints: TDistance[];\n proportionConstraints: TProportion[];\n alignmentConstraints: TCenter[];\n}\n\ninterface ConstraintConstructors<TDistance, TProportion, TCenter> {\n distanceConstraint: new (\n elementOne: UIElement | UILayer,\n elementTwo: UIElement,\n options:\n | Partial<UIHorizontalDistanceOptions | UIVerticalDistanceOptions>\n | undefined,\n ) => TDistance;\n proportionConstraint: new (\n elementOne: UIElement | UILayer,\n elementTwo: UIElement,\n options:\n | Partial<UIHorizontalProportionOptions | UIVerticalProportionOptions>\n | undefined,\n ) => TProportion;\n centerDistanceConstraint: new (\n elementOne: UIElement | UILayer,\n elementTwo: UIElement,\n options:\n | Partial<UIHorizontalDistanceOptions | UIVerticalDistanceOptions>\n | undefined,\n ) => TCenter;\n}\n\nexport class UIConstraintStackBuilder {\n public static buildHorizontal(\n elements: UIElement[],\n options: Partial<UIConstraintStackBuilderOptions>,\n ): UIConstraintStackBuilderResult<\n UIHorizontalDistanceConstraint,\n UIHorizontalProportionConstraint,\n UIVerticalDistanceConstraint\n > {\n return this.buildStack(elements, options, {\n distanceConstraint: UIHorizontalDistanceConstraint,\n proportionConstraint: UIHorizontalProportionConstraint,\n centerDistanceConstraint: UIVerticalDistanceConstraint,\n });\n }\n\n public static buildVertical(\n elements: UIElement[],\n options: Partial<UIConstraintStackBuilderOptions>,\n ): UIConstraintStackBuilderResult<\n UIVerticalDistanceConstraint,\n UIVerticalProportionConstraint,\n UIHorizontalDistanceConstraint\n > {\n return this.buildStack(elements, options, {\n distanceConstraint: UIVerticalDistanceConstraint,\n proportionConstraint: UIVerticalProportionConstraint,\n centerDistanceConstraint: UIHorizontalDistanceConstraint,\n });\n }\n\n private static buildStack<TDistance, TProportion, TCenter>(\n elements: UIElement[],\n options: Partial<UIConstraintStackBuilderOptions>,\n constructors: ConstraintConstructors<TDistance, TProportion, TCenter>,\n ): UIConstraintStackBuilderResult<TDistance, TProportion, TCenter> {\n const distances: TDistance[] = [];\n const proportions: TProportion[] = [];\n const centers: TCenter[] = [];\n\n for (let i = 0; i < elements.length - 1; i++) {\n const element = elements[i];\n const nextElement = elements[i + 1];\n\n distances.push(\n new constructors.distanceConstraint(element, nextElement, {\n anchorOne: 1,\n anchorTwo: 0,\n distance: options.distance,\n power: options.power,\n orientation: options.orientation,\n }),\n );\n\n if (options.keepProportions !== false) {\n proportions.push(\n new constructors.proportionConstraint(element, nextElement, {\n power: options.power,\n orientation: options.orientation,\n }),\n );\n }\n\n if (options.keepAlignment !== false) {\n centers.push(\n new constructors.centerDistanceConstraint(element, nextElement, {\n power: options.power,\n anchorOne: 0,\n anchorTwo: 0,\n orientation: options.orientation,\n }),\n );\n }\n }\n\n return {\n distanceConstraints: distances,\n proportionConstraints: proportions,\n alignmentConstraints: centers,\n };\n }\n}\n","import { Constraint, Expression } from \"@lume/kiwi\";\nimport type { UIElement } from \"../elements/UIElement\";\n\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { UIConstraint } from \"./UIConstraint\";\nimport type { UIConstraintPower } from \"./UIConstraintPower\";\nimport { convertPowerToStrength, resolvePower } from \"./UIConstraintPower\";\nimport type { UIConstraintRule } from \"./UIConstraintRule\";\nimport { convertRuleToOperator, resolveRule } from \"./UIConstraintRule\";\n\n/**\n * Configuration options for aspect ratio constraints.\n */\nexport interface UIAspectOptions {\n /** The aspect ratio to maintain (width / height) */\n aspect: number;\n /** Priority level for this constraint */\n power: UIConstraintPower;\n /** Rule for the constraint relationship (equal, less than, greater than) */\n rule: UIConstraintRule;\n /** Screen orientation when this constraint should be active */\n orientation: UIOrientation;\n}\n\n/**\n * Constraint that maintains a specific aspect ratio for a UI element.\n *\n * The aspect ratio is defined as width divided by height (w/h).\n * This constraint ensures that an element maintains its proportions\n * during layout calculations.\n */\nexport class UIAspectConstraint extends UIConstraint {\n /** The configuration options for this constraint */\n private readonly options: UIAspectOptions;\n /** The Kiwi.js constraint object */\n private constraint?: Constraint;\n\n /**\n * Creates a new aspect ratio constraint.\n *\n * @param element - The UI element to constrain\n * @param options - Configuration options\n */\n constructor(\n private readonly element: UIElement,\n options: Partial<UIAspectOptions> = {},\n ) {\n super(element.layer, new Set([element]));\n\n this.options = {\n aspect: options.aspect ?? this.element.width / this.element.height,\n power: resolvePower(options.power),\n rule: resolveRule(options.rule),\n orientation: resolveOrientation(options.orientation),\n };\n\n if (\n this.options.orientation === UIOrientation.ALWAYS ||\n this.options.orientation === this.layer.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Destroys this constraint, removing it from the constraint system.\n */\n public override destroy(): void {\n this.destroyConstraints();\n super.destroy();\n }\n\n /**\n * Internal method to disable this constraint when orientation changes.\n *\n * @param newOrientation - The new screen orientation\n * @internal\n */\n public [\"disableConstraintInternal\"](newOrientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n newOrientation !== this.options.orientation\n ) {\n this.destroyConstraints();\n }\n }\n\n /**\n * Internal method to enable this constraint when orientation changes.\n *\n * @param newOrientation - The new screen orientation\n * @internal\n */\n public [\"enableConstraintInternal\"](newOrientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n newOrientation === this.options.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Builds and adds the aspect ratio constraint to the constraint solver.\n *\n * Creates a constraint expression in the form: width - (height * aspect) = 0\n * This ensures that width/height = aspect.\n *\n */\n protected buildConstraints(): void {\n const expression = new Expression(this.element[\"widthInternal\"]).plus(\n new Expression(this.element[\"heightInternal\"]).multiply(\n -this.options.aspect,\n ),\n );\n\n this.constraint = new Constraint(\n expression,\n convertRuleToOperator(this.options.rule),\n 0,\n convertPowerToStrength(this.options.power),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraint);\n }\n\n /**\n * Removes the aspect ratio constraint from the constraint solver.\n *\n */\n protected destroyConstraints(): void {\n if (this.constraint) {\n this.layer[\"removeConstraintInternal\"](this, this.constraint);\n this.constraint = undefined;\n }\n }\n}\n","import { Constraint, Expression, Operator } from \"@lume/kiwi\";\nimport { UIElement } from \"../elements/UIElement\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertSameLayer } from \"../miscellaneous/asserts\";\n\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { UIConstraint } from \"./UIConstraint\";\n\n/**\n * Default anchor value (0.5 = center) for cover constraint alignment\n */\n\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for cover constraints.\n */\nexport interface UICoverOptions {\n /** Whether to force equal height (true) or allow stretching (false) */\n isStrict: boolean;\n /** Horizontal anchor point (0-1) for alignment between elements */\n horizontalAnchor: number;\n /** Vertical anchor point (0-1) for alignment between elements */\n verticalAnchor: number;\n /** Screen orientation when this constraint should be active */\n orientation: UIOrientation;\n}\n\n/**\n * Constraint that makes an element cover another element or layer.\n *\n * The covering element will:\n * - Be aligned with the covered element using the specified anchors\n * - Have at least the same width and height as the covered element\n * - Optionally maintain strict proportions\n *\n * This is similar to CSS's \"cover\" object-fit behavior.\n */\nexport class UICoverConstraint extends UIConstraint {\n /** The configuration options for this constraint */\n private readonly options: UICoverOptions;\n\n /** Constraint for X-axis alignment */\n private constraintX?: Constraint;\n /** Constraint for Y-axis alignment */\n private constraintY?: Constraint;\n /** Constraint for width relationship */\n private constraintW?: Constraint;\n /** Constraint for height relationship */\n private constraintH?: Constraint;\n /** Optional constraint for maintaining strict proportions */\n private constraintStrict?: Constraint;\n\n /**\n * Creates a new cover constraint.\n *\n * @param elementOne - The element or layer to be covered (the reference)\n * @param elementTwo - The element that will cover the reference\n * @param options - Configuration options\n */\n constructor(\n private readonly elementOne: UIElement | UILayer,\n private readonly elementTwo: UIElement,\n options: Partial<UICoverOptions> = {},\n ) {\n assertSameLayer(elementOne, elementTwo);\n super(\n elementTwo.layer,\n new Set(\n elementOne instanceof UIElement\n ? [elementOne, elementTwo]\n : [elementTwo],\n ),\n );\n\n this.options = {\n isStrict: options.isStrict ?? true,\n horizontalAnchor: options.horizontalAnchor ?? DEFAULT_ANCHOR,\n verticalAnchor: options.verticalAnchor ?? DEFAULT_ANCHOR,\n orientation: resolveOrientation(options.orientation),\n };\n\n if (\n this.options.orientation === UIOrientation.ALWAYS ||\n this.options.orientation === this.layer.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Destroys this constraint, removing it from the constraint system.\n */\n public override destroy(): void {\n this.destroyConstraints();\n super.destroy();\n }\n\n /**\n * Internal method to disable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"disableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation !== this.options.orientation\n ) {\n this.destroyConstraints();\n }\n }\n\n /**\n * Internal method to enable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"enableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation === this.options.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Builds and adds the cover constraints to the constraint solver.\n *\n * Creates five constraints:\n * 1. X alignment between the elements\n * 2. Y alignment between the elements\n * 3. Width covering (elementTwo width ≥ elementOne width)\n * 4. Height covering (elementTwo height ≥ elementOne height)\n * 5. Optional strict proportions (if isStrict = false)\n *\n */\n protected buildConstraints(): void {\n this.constraintX = new Constraint(\n new Expression(this.elementOne[\"xInternal\"]).plus(\n new Expression(this.elementOne[\"widthInternal\"]).multiply(\n this.options.horizontalAnchor,\n ),\n ),\n Operator.Eq,\n new Expression(this.elementTwo[\"xInternal\"]).plus(\n new Expression(this.elementTwo[\"widthInternal\"]).multiply(\n this.options.horizontalAnchor,\n ),\n ),\n );\n\n this.constraintY = new Constraint(\n new Expression(this.elementOne[\"yInternal\"]).plus(\n new Expression(this.elementOne[\"heightInternal\"]).multiply(\n this.options.verticalAnchor,\n ),\n ),\n Operator.Eq,\n new Expression(this.elementTwo[\"yInternal\"]).plus(\n new Expression(this.elementTwo[\"heightInternal\"]).multiply(\n this.options.verticalAnchor,\n ),\n ),\n );\n\n this.constraintW = new Constraint(\n new Expression(this.elementOne[\"widthInternal\"]),\n Operator.Eq,\n new Expression(this.elementTwo[\"widthInternal\"]),\n );\n\n this.constraintH = new Constraint(\n new Expression(this.elementOne[\"heightInternal\"]),\n Operator.Eq,\n new Expression(this.elementTwo[\"heightInternal\"]),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraintX);\n this.layer[\"addConstraintInternal\"](this, this.constraintY);\n this.layer[\"addConstraintInternal\"](this, this.constraintW);\n this.layer[\"addConstraintInternal\"](this, this.constraintH);\n\n if (!this.options.isStrict) {\n this.constraintStrict = new Constraint(\n new Expression(this.elementOne[\"heightInternal\"]),\n Operator.Eq,\n new Expression(this.elementTwo[\"heightInternal\"]),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraintStrict);\n }\n }\n\n /**\n * Removes all cover constraints from the constraint solver.\n *\n */\n protected destroyConstraints(): void {\n if (this.constraintX) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintX);\n this.constraintX = undefined;\n }\n if (this.constraintY) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintY);\n this.constraintY = undefined;\n }\n if (this.constraintW) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintW);\n this.constraintW = undefined;\n }\n if (this.constraintH) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintH);\n this.constraintH = undefined;\n }\n if (this.constraintStrict) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintStrict);\n this.constraintStrict = undefined;\n }\n }\n}\n","import { Constraint, Expression, Operator, Strength } from \"@lume/kiwi\";\nimport { UIElement } from \"../elements/UIElement\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { assertSameLayer } from \"../miscellaneous/asserts\";\n\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { UIConstraint } from \"./UIConstraint\";\n\n/**\n * Default anchor value (0.5 = center) for fit constraint alignment\n */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for fit constraints.\n */\nexport interface UIFitOptions {\n /** Whether to force equal height (true) or allow stretching (false) */\n isStrict: boolean;\n /** Horizontal anchor point (0-1) for alignment between elements */\n horizontalAnchor: number;\n /** Vertical anchor point (0-1) for alignment between elements */\n verticalAnchor: number;\n /** Screen orientation when this constraint should be active */\n orientation: UIOrientation;\n}\n\n/**\n * Constraint that makes an element fit within another element or layer.\n *\n * The fitting element will:\n * - Be aligned with the container element using the specified anchors\n * - Have at most the same width and height as the container element\n * - Optionally maintain strict proportions\n *\n * This is similar to CSS's \"contain\" object-fit behavior.\n */\nexport class UIFitConstraint extends UIConstraint {\n /** The configuration options for this constraint */\n private readonly options: UIFitOptions;\n\n /** Constraint for X-axis alignment */\n private constraintX?: Constraint;\n /** Constraint for Y-axis alignment */\n private constraintY?: Constraint;\n\n /** Constraint for width relationship */\n private constraintW?: Constraint;\n /** Constraint for height relationship */\n private constraintH?: Constraint;\n\n /** Optional constraint for maintaining strict proportions */\n private constraintStrict?: Constraint;\n\n /**\n * Creates a new fit constraint.\n *\n * @param elementOne - The element or layer that contains the fitting element (the container)\n * @param elementTwo - The element that will fit within the container\n * @param options - Configuration options\n */\n constructor(\n private readonly elementOne: UIElement | UILayer,\n private readonly elementTwo: UIElement,\n options: Partial<UIFitOptions> = {},\n ) {\n super(\n elementTwo.layer,\n new Set(\n elementOne instanceof UIElement\n ? [elementOne, elementTwo]\n : [elementTwo],\n ),\n );\n assertSameLayer(elementOne, elementTwo);\n\n this.options = {\n isStrict: options.isStrict ?? true,\n horizontalAnchor: options.horizontalAnchor ?? DEFAULT_ANCHOR,\n verticalAnchor: options.verticalAnchor ?? DEFAULT_ANCHOR,\n orientation: resolveOrientation(options.orientation),\n };\n\n if (\n this.options.orientation === UIOrientation.ALWAYS ||\n this.options.orientation === this.layer.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Destroys this constraint, removing it from the constraint system.\n */\n public override destroy(): void {\n this.destroyConstraints();\n super.destroy();\n }\n\n /**\n * Internal method to disable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"disableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation !== this.options.orientation\n ) {\n this.destroyConstraints();\n }\n }\n\n /**\n * Internal method to enable this constraint when orientation changes.\n *\n * @param orientation - The new screen orientation\n * @internal\n */\n public [\"enableConstraintInternal\"](orientation: UIOrientation): void {\n if (\n this.options.orientation !== UIOrientation.ALWAYS &&\n orientation === this.options.orientation\n ) {\n this.buildConstraints();\n }\n }\n\n /**\n * Builds and adds the fit constraints to the constraint solver.\n *\n * Creates five constraints:\n * 1. X alignment between the elements\n * 2. Y alignment between the elements\n * 3. Width fitting (elementTwo width ≤ elementOne width)\n * 4. Height fitting (elementTwo height ≤ elementOne height)\n * 5. Optional strict proportions (if isStrict = true)\n *\n */\n protected buildConstraints(): void {\n this.constraintX = new Constraint(\n new Expression(this.elementOne[\"xInternal\"]).plus(\n new Expression(this.elementOne[\"widthInternal\"]).multiply(\n this.options.horizontalAnchor,\n ),\n ),\n Operator.Eq,\n new Expression(this.elementTwo[\"xInternal\"]).plus(\n new Expression(this.elementTwo[\"widthInternal\"]).multiply(\n this.options.horizontalAnchor,\n ),\n ),\n );\n\n this.constraintY = new Constraint(\n new Expression(this.elementOne[\"yInternal\"]).plus(\n new Expression(this.elementOne[\"heightInternal\"]).multiply(\n this.options.verticalAnchor,\n ),\n ),\n Operator.Eq,\n new Expression(this.elementTwo[\"yInternal\"]).plus(\n new Expression(this.elementTwo[\"heightInternal\"]).multiply(\n this.options.verticalAnchor,\n ),\n ),\n );\n\n this.constraintW = new Constraint(\n new Expression(this.elementOne[\"widthInternal\"]),\n Operator.Ge,\n new Expression(this.elementTwo[\"widthInternal\"]),\n );\n\n this.constraintH = new Constraint(\n new Expression(this.elementOne[\"heightInternal\"]),\n Operator.Ge,\n new Expression(this.elementTwo[\"heightInternal\"]),\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraintX);\n this.layer[\"addConstraintInternal\"](this, this.constraintY);\n\n this.layer[\"addConstraintInternal\"](this, this.constraintW);\n this.layer[\"addConstraintInternal\"](this, this.constraintH);\n\n if (this.options.isStrict) {\n this.constraintStrict = new Constraint(\n new Expression(this.elementOne[\"heightInternal\"]),\n Operator.Eq,\n new Expression(this.elementTwo[\"heightInternal\"]),\n Strength.strong,\n );\n\n this.layer[\"addConstraintInternal\"](this, this.constraintStrict);\n }\n }\n\n /**\n * Removes all fit constraints from the constraint solver.\n *\n */\n protected destroyConstraints(): void {\n if (this.constraintX) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintX);\n this.constraintX = undefined;\n }\n if (this.constraintY) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintY);\n this.constraintY = undefined;\n }\n if (this.constraintW) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintW);\n this.constraintW = undefined;\n }\n if (this.constraintH) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintH);\n this.constraintH = undefined;\n }\n if (this.constraintStrict) {\n this.layer[\"removeConstraintInternal\"](this, this.constraintStrict);\n this.constraintStrict = undefined;\n }\n }\n}\n","import { Object3D } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Default size for dummy elements when no dimensions are specified\n */\nconst DEFAULT_DUMMY_SIZE = 100;\n\n/**\n * A minimal UI element with no visual representation.\n * Used as a placeholder, spacer, or container for other elements.\n */\nexport class UIDummy extends UIElement {\n /**\n * Creates a new dummy UI element.\n *\n * @param layer - The UI layer that contains this element\n * @param width - Width of the dummy element (defaults to DEFAULT_DUMMY_SIZE)\n * @param height - Height of the dummy element (defaults to DEFAULT_DUMMY_SIZE)\n */\n constructor(\n layer: UILayer,\n width = DEFAULT_DUMMY_SIZE,\n height = DEFAULT_DUMMY_SIZE,\n ) {\n super(layer, new Object3D(), 0, 0, width, height);\n this.applyTransformations();\n }\n\n /**\n * Renders the dummy element.\n * Since dummies have no visual representation, this only applies transformations.\n */\n protected override render(): void {\n this.applyTransformations();\n }\n}\n","import type { Texture, WebGLRenderer } from \"three\";\nimport { Mesh } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIMaterial } from \"../materials/UIMaterial\";\nimport { assertSize } from \"../miscellaneous/asserts\";\nimport { geometry } from \"../miscellaneous/threeInstances\";\nimport { UIBlending } from \"../miscellaneous/UIBlending\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * A UI element that displays an image texture.\n * Renders a textured mesh using the provided texture.\n */\n\nexport class UIImage extends UIElement {\n /** Material used to render the image */\n private readonly material: UIMaterial;\n\n /** The texture displayed by this image */\n private readonly textureInternal: Texture;\n\n private blendingInternal: UIBlending = UIBlending.NORMAL;\n\n /**\n * Creates a new image UI element.\n *\n * @param layer - The UI layer that contains this element\n * @param texture - The texture to display\n * @throws Error if the texture has invalid dimensions\n */\n constructor(layer: UILayer, texture: Texture) {\n const width = texture.image?.width;\n const height = texture.image?.height;\n\n assertSize(\n width,\n height,\n `Invalid image dimensions - texture \"${texture.name || \"unnamed\"}\" has invalid width (${width}) or height (${height}). Image dimensions must be non-zero positive numbers.`,\n );\n\n const material = new UIMaterial(texture);\n const object = new Mesh(geometry, material);\n\n super(layer, object, 0, 0, width, height);\n\n this.material = material;\n this.textureInternal = texture;\n\n this.applyTransformations();\n }\n\n /** Gets the texture displayed by this image */\n public get texture(): Texture {\n return this.textureInternal;\n }\n\n /** Gets the color tint applied to the image */\n public get color(): number {\n return this.material.getColor();\n }\n\n /** Gets the opacity of the image */\n public get opacity(): number {\n return this.material.getOpacity();\n }\n\n /** Gets the blending mode of the image */\n public get blending(): UIBlending {\n return this.blendingInternal;\n }\n\n /**\n * Sets the color tint applied to the image\n * @param value - Color in hexadecimal format\n */\n public set color(value: number) {\n this.material.setColor(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the opacity of the image\n * @param value - Opacity value between 0 (transparent) and 1 (opaque)\n */\n public set opacity(value: number) {\n this.material.setOpacity(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the blending mode of the image\n * @param value - Blending mode to apply\n */\n public set blending(value: UIBlending) {\n this.blendingInternal = value;\n this.material.setBlending(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Destroys the image element, disposing of all resources and removing it from the layer.\n * This should be called when the element is no longer needed.\n */\n public override destroy(): void {\n this.material.dispose();\n super.destroy();\n }\n\n /**\n * Renders the image element.\n *\n * @param renderer - The WebGL renderer\n */\n protected override render(renderer: WebGLRenderer): void {\n (this.object as Mesh).material = this.composerInternal.compose(\n renderer,\n this.textureInternal.image.width,\n this.textureInternal.image.height,\n this.material,\n );\n this.applyTransformations();\n }\n}\n","import type { Texture } from \"three\";\nimport { Color, ShaderMaterial, UniformsUtils } from \"three\";\n\nexport class UIProgressMaterial extends ShaderMaterial {\n constructor(foregroundTexture: Texture, backgroundTexture?: Texture) {\n super({\n uniforms: UniformsUtils.merge([\n {\n background: { value: backgroundTexture },\n foreground: { value: foregroundTexture },\n progress: { value: 1 },\n backgroundColor: { value: new Color(1, 1, 1) },\n foregroundColor: { value: new Color(1, 1, 1) },\n color: { value: new Color(1, 1, 1) },\n backgroundOpacity: { value: 1 },\n foregroundOpacity: { value: 1 },\n opacity: { value: 1 },\n angle: { value: 0 },\n direction: { value: 1 },\n },\n ]),\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: /* glsl */ `\n uniform sampler2D background;\n uniform sampler2D foreground;\n uniform float progress;\n uniform vec3 backgroundColor;\n uniform vec3 foregroundColor;\n uniform vec3 color;\n uniform float backgroundOpacity;\n uniform float foregroundOpacity;\n uniform float opacity;\n uniform float angle;\n uniform float direction;\n varying vec2 vUv;\n\n void main() {\n vec4 backgroundTexture = texture2D(background, vUv);\n vec4 foregroundTexture = texture2D(foreground, vUv);\n\n // Apply common color and opacity\n vec3 finalBackgroundColor = backgroundTexture.rgb * backgroundColor * color;\n vec3 finalForegroundColor = foregroundTexture.rgb * foregroundColor * color;\n float finalBackgroundOpacity = backgroundTexture.a * backgroundOpacity * opacity;\n float finalForegroundOpacity = foregroundTexture.a * foregroundOpacity * opacity;\n\n vec4 backgroundColor = vec4(finalBackgroundColor, finalBackgroundOpacity);\n vec4 foregroundColor = vec4(finalForegroundColor, finalForegroundOpacity);\n\n // Calculate progress threshold with angle and direction\n float adjustedX = mix(vUv.x, 1.0 - vUv.x, step(0.0, -direction));\n float tanAngle = tan(angle);\n float threshold = adjustedX - (vUv.y - 0.5) * tanAngle * sign(direction);\n float progressMask = smoothstep(threshold - 0.01, threshold + 0.01, progress);\n\n gl_FragColor = mix(backgroundColor, foregroundColor, progressMask);\n #include <colorspace_fragment>\n }\n `,\n transparent: true,\n lights: false,\n fog: false,\n depthWrite: false,\n depthTest: false,\n });\n }\n\n public getProgress(): number {\n return this.uniforms.progress.value;\n }\n\n public getBackgroundTexture(): Texture | undefined {\n return this.uniforms.background.value;\n }\n\n public getForegroundTexture(): Texture {\n return this.uniforms.foreground.value;\n }\n\n public getBackgroundColor(): number {\n return (this.uniforms.color.value as Color).getHex();\n }\n\n public getForegroundColor(): number {\n return (this.uniforms.color.value as Color).getHex();\n }\n\n public getColor(): number {\n return (this.uniforms.color.value as Color).getHex();\n }\n\n public getBackgroundOpacity(): number {\n return this.uniforms.backgroundOpacity.value;\n }\n\n public getForegroundOpacity(): number {\n return this.uniforms.foregroundOpacity.value;\n }\n\n public getOpacity(): number {\n return this.uniforms.opacity.value;\n }\n\n public getAngle(): number {\n return this.uniforms.angle.value;\n }\n\n public getIsForwardDirection(): boolean {\n return this.uniforms.direction.value === 1;\n }\n\n public setProgress(value: number): void {\n this.uniforms.progress.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setBackgroundTexture(value: Texture | undefined): void {\n this.uniforms.background.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setForegroundTexture(value: Texture): void {\n this.uniforms.foreground.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setBackgroundColor(value: number): void {\n (this.uniforms.color.value as Color).setHex(value);\n this.uniformsNeedUpdate = true;\n }\n\n public setForegroundColor(value: number): void {\n (this.uniforms.color.value as Color).setHex(value);\n this.uniformsNeedUpdate = true;\n }\n\n public setColor(value: number): void {\n (this.uniforms.color.value as Color).setHex(value);\n this.uniformsNeedUpdate = true;\n }\n\n public setBackgroundOpacity(value: number): void {\n this.uniforms.backgroundOpacity.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setForegroundOpacity(value: number): void {\n this.uniforms.foregroundOpacity.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setOpacity(value: number): void {\n this.uniforms.opacity.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setAngle(value: number): void {\n this.uniforms.angle.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setIsForwardDirection(value: boolean): void {\n this.uniforms.direction.value = value ? 1 : -1;\n this.uniformsNeedUpdate = true;\n }\n}\n","import type { Texture, WebGLRenderer } from \"three\";\nimport { MathUtils, Mesh } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIProgressMaterial } from \"../materials/UIProgressMaterial\";\nimport { assertSize } from \"../miscellaneous/asserts\";\nimport { geometry } from \"../miscellaneous/threeInstances\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Options for customizing the UIProgress element.\n */\n\nexport interface UIProgressOptions {\n /** Optional background texture to display behind the progress indicator */\n textureBackground: Texture;\n /** Progress value from 0 to 1 */\n progress: number;\n /** Whether progress increases in the direction specified by angle (true) or opposite to it (false) */\n isForegroundDirection: boolean;\n /** Angle in degrees specifying the direction of progress */\n angle: number;\n /** Overall color tint applied to both textures */\n color: number;\n /** Overall opacity applied to both textures */\n opacity: number;\n /** Color tint applied to the background texture */\n backgroundColor: number;\n /** Color tint applied to the foreground texture */\n foregroundColor: number;\n /** Opacity of the background texture */\n backgroundOpacity: number;\n /** Opacity of the foreground texture */\n foregroundOpacity: number;\n}\n\n/**\n * A UI element that displays a progress indicator.\n * Can be used for loading bars, health bars, sliders, etc.\n */\n\nexport class UIProgress extends UIElement {\n /** Material used to render the progress indicator */\n private readonly material: UIProgressMaterial;\n /** Width of the underlying image texture */\n private readonly imageWidth: number;\n /** Height of the underlying image texture */\n private readonly imageHeight: number;\n\n /**\n * Creates a new progress UI element.\n *\n * @param layer - The UI layer that contains this element\n * @param textureForeground - The texture to use for the progress indicator\n * @param options - Options to customize the progress indicator\n * @throws Error if either texture has invalid dimensions\n */\n constructor(\n layer: UILayer,\n textureForeground: Texture,\n options: Partial<UIProgressOptions> = {},\n ) {\n const foregroundWidth = textureForeground.image?.width;\n const foregroundHeight = textureForeground.image?.height;\n\n assertSize(\n foregroundWidth,\n foregroundHeight,\n `Invalid image dimensions - texture \"${textureForeground.name || \"unnamed\"}\" has invalid width (${foregroundWidth}) or height (${foregroundHeight}). Image dimensions must be non-zero positive numbers.`,\n );\n\n const backgroundWidth = options.textureBackground?.image?.width;\n const backgroundHeight = options.textureBackground?.image?.height;\n\n if (options.textureBackground) {\n assertSize(\n backgroundWidth,\n backgroundHeight,\n `Invalid image dimensions - texture \"${options.textureBackground.name || \"unnamed\"}\" has invalid width (${backgroundWidth}) or height (${backgroundHeight}). Image dimensions must be non-zero positive numbers.`,\n );\n }\n\n const material = new UIProgressMaterial(\n textureForeground,\n options.textureBackground,\n );\n const object = new Mesh(geometry, material);\n\n if (options.progress) {\n material.setProgress(options.progress);\n }\n\n if (options.isForegroundDirection) {\n material.setIsForwardDirection(options.isForegroundDirection);\n }\n\n if (options.angle) {\n material.setAngle(MathUtils.degToRad(options.angle));\n }\n\n if (options.color) {\n material.setColor(options.color);\n }\n\n if (options.opacity) {\n material.setOpacity(options.opacity);\n }\n\n if (options.backgroundColor) {\n material.setBackgroundColor(options.backgroundColor);\n }\n\n if (options.foregroundColor) {\n material.setForegroundColor(options.foregroundColor);\n }\n\n if (options.backgroundOpacity) {\n material.setBackgroundOpacity(options.backgroundOpacity);\n }\n\n if (options.foregroundOpacity) {\n material.setForegroundOpacity(options.foregroundOpacity);\n }\n\n const imageWidth = backgroundWidth ?? foregroundWidth;\n const imageHeight = foregroundHeight ?? backgroundHeight;\n\n super(layer, object, 0, 0, imageWidth, imageHeight);\n\n this.material = material;\n this.imageWidth = imageWidth;\n this.imageHeight = imageHeight;\n\n this.applyTransformations();\n }\n\n /** Gets the current progress value (0 to 1) */\n public get progress(): number {\n return this.material.getProgress();\n }\n\n /** Gets the background texture if one was provided */\n public get backgroundTexture(): Texture | undefined {\n return this.material.getBackgroundTexture();\n }\n\n /** Gets the foreground texture used for the progress indicator */\n public get foregroundTexture(): Texture {\n return this.material.getForegroundTexture();\n }\n\n /** Gets the color tint applied to the background texture */\n public get backgroundColor(): number {\n return this.material.getBackgroundColor();\n }\n\n /** Gets the color tint applied to the foreground texture */\n public get foregroundColor(): number {\n return this.material.getForegroundColor();\n }\n\n /** Gets the overall color tint applied to both textures */\n public get color(): number {\n return this.material.getColor();\n }\n\n /** Gets the opacity of the background texture */\n public get backgroundOpacity(): number {\n return this.material.getBackgroundOpacity();\n }\n\n /** Gets the opacity of the foreground texture */\n public get foregroundOpacity(): number {\n return this.material.getForegroundOpacity();\n }\n\n /** Gets the overall opacity applied to both textures */\n public get opacity(): number {\n return this.material.getOpacity();\n }\n\n /** Gets the angle in degrees specifying the direction of progress */\n public get angle(): number {\n return MathUtils.radToDeg(this.material.getAngle());\n }\n\n /** Gets whether progress increases in the direction specified by angle (true) or opposite to it (false) */\n public get isForwardDirection(): boolean {\n return this.material.getIsForwardDirection();\n }\n\n /**\n * Sets the progress value\n * @param value - Progress value between 0 (empty) and 1 (full)\n */\n public set progress(value: number) {\n this.material.setProgress(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the color tint applied to the background texture\n * @param value - Color in hexadecimal format\n */\n public set backgroundColor(value: number) {\n this.material.setBackgroundColor(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the color tint applied to the foreground texture\n * @param value - Color in hexadecimal format\n */\n public set foregroundColor(value: number) {\n this.material.setForegroundColor(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the overall color tint applied to both textures\n * @param value - Color in hexadecimal format\n */\n public set color(value: number) {\n this.material.setColor(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the opacity of the background texture\n * @param value - Opacity value between 0 (transparent) and 1 (opaque)\n */\n public set backgroundOpacity(value: number) {\n this.material.setBackgroundOpacity(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the opacity of the foreground texture\n * @param value - Opacity value between 0 (transparent) and 1 (opaque)\n */\n public set foregroundOpacity(value: number) {\n this.material.setForegroundOpacity(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the overall opacity applied to both textures\n * @param value - Opacity value between 0 (transparent) and 1 (opaque)\n */\n public set opacity(value: number) {\n this.material.setOpacity(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the angle specifying the direction of progress\n * @param value - Angle in degrees\n */\n public set angle(value: number) {\n this.material.setAngle(MathUtils.degToRad(value));\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets whether progress increases in the direction specified by angle\n * @param value - true to increase in the direction of angle, false for opposite\n */\n public set isForwardDirection(value: boolean) {\n this.material.setIsForwardDirection(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Destroys the progress element, disposing of all resources and removing it from the layer.\n * This should be called when the element is no longer needed.\n */\n public override destroy(): void {\n this.material.dispose();\n super.destroy();\n }\n\n /**\n * Renders the progress element.\n *\n * @param renderer - The WebGL renderer\n */\n protected override render(renderer: WebGLRenderer): void {\n (this.object as Mesh).material = this.composerInternal.compose(\n renderer,\n this.imageWidth,\n this.imageHeight,\n this.material,\n );\n this.applyTransformations();\n }\n}\n","import type { Camera, WebGLRenderer } from \"three\";\nimport {\n LinearFilter,\n Mesh,\n PerspectiveCamera,\n RGBAFormat,\n Scene,\n UnsignedByteType,\n WebGLRenderTarget,\n} from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIMaterial } from \"../materials/UIMaterial\";\nimport { assertSize } from \"../miscellaneous/asserts\";\nimport { geometry } from \"../miscellaneous/threeInstances\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Defines when a UIScene should be rendered/updated.\n */\nexport enum UISceneUpdateMode {\n /** Scene is rendered on every frame */\n ALWAYS = \"always\",\n /** Scene is rendered when any property changes */\n PROPERTY_CHANGED = \"property_changed\",\n /** Scene is only rendered when explicitly requested */\n MANUAL = \"manual\",\n}\n\n/** Default factor for reducing render target resolution (0.5 = half resolution) */\nconst DEFAULT_RESOLUTION_FACTOR = 0.5;\n/** Minimum allowed resolution factor */\nconst MIN_RESOLUTION_FACTOR = 0.1;\n/** Maximum allowed resolution factor */\nconst MAX_RESOLUTION_FACTOR = 8;\n/** Default width for the scene if not specified */\nconst DEFAULT_WIDTH = 512;\n/** Default height for the scene if not specified */\nconst DEFAULT_HEIGHT = 512;\n/** Default field of view for the perspective camera in degrees */\nconst DEFAULT_FOV = 75;\n/** Default near plane distance for the perspective camera */\nconst DEFAULT_NEAR = 0.1;\n/** Default far plane distance for the perspective camera */\nconst DEFAULT_FAR = 100;\n/** Default update mode for the scene */\nconst DEFAULT_UPDATE_MODE = UISceneUpdateMode.PROPERTY_CHANGED;\n/** Default clear color (black) */\nconst DEFAULT_CLEAR_COLOR = 0x000000;\n/** Default clear alpha (fully transparent) */\nconst DEFAULT_CLEAR_ALPHA = 0;\n/** Whether the scene is rendered immediately by default */\nconst DEFAULT_RENDERED_BY_DEFAULT = false;\n/** Whether to use a depth buffer by default */\nconst DEFAULT_USE_DEPTH = true;\n\n/**\n * Options for customizing the UIScene element.\n */\nexport interface UISceneOptions {\n /** Three.js scene to render */\n scene: Scene;\n /** Camera to use for rendering the scene */\n camera: Camera;\n /** Width of the scene viewport in pixels */\n width: number;\n /** Height of the scene viewport in pixels */\n height: number;\n /** Resolution scaling factor for performance optimization */\n resolutionFactor: number;\n /** Whether the scene should be rendered immediately after creation */\n renderedByDefault: boolean;\n /** Whether to use a depth buffer for rendering */\n useDepth: boolean;\n /** Color to clear the scene with before rendering */\n clearColor: number;\n /** Alpha value for the clear color (0-1) */\n clearAlpha: number;\n /** When the scene should be automatically re-rendered */\n updateBehavior: UISceneUpdateMode;\n}\n\n/**\n * A UI element that renders a Three.js scene as a texture.\n * This allows 3D content to be integrated into the 2D UI system.\n */\nexport class UIScene extends UIElement {\n /** Material used to render the scene's render target */\n private readonly material: UIMaterial;\n /** WebGL render target where the scene is rendered */\n private readonly renderTarget: WebGLRenderTarget;\n\n /** Color to clear the scene with before rendering */\n private clearColorInternal: number;\n /** Alpha value for the clear color */\n private clearAlphaInternal: number;\n\n /** Whether the scene needs to be re-rendered on the next frame */\n private needsRenderInternal = false;\n /** When the scene should be automatically re-rendered */\n private readonly updateModeInternal: UISceneUpdateMode;\n /** Resolution scaling factor for performance optimization */\n private resolutionFactorInternal: number;\n\n /** The Three.js scene being rendered */\n private sceneInternal: Scene;\n /** The camera used for rendering the scene */\n private cameraInternal: Camera;\n\n /**\n * Creates a new scene UI element.\n *\n * @param layer - The UI layer that contains this element\n * @param options - Options to customize the scene\n * @throws Error if resolution factor is out of valid range or dimensions are invalid\n */\n constructor(layer: UILayer, options: Partial<UISceneOptions> = {}) {\n const resolutionFactor =\n options.resolutionFactor ?? DEFAULT_RESOLUTION_FACTOR;\n\n if (\n resolutionFactor < MIN_RESOLUTION_FACTOR ||\n resolutionFactor > MAX_RESOLUTION_FACTOR\n ) {\n throw new Error(\n `Invalid resolution factor: ${resolutionFactor}. Must be between ${MIN_RESOLUTION_FACTOR} and ${MAX_RESOLUTION_FACTOR}.`,\n );\n }\n\n const width = options.width ?? DEFAULT_WIDTH;\n const height = options.height ?? DEFAULT_HEIGHT;\n\n assertSize(\n width,\n height,\n `Invalid width or height: ${width}x${height}. Must be positive.`,\n );\n\n const renderTarget = new WebGLRenderTarget(\n width * resolutionFactor,\n height * resolutionFactor,\n {\n format: RGBAFormat,\n minFilter: LinearFilter,\n magFilter: LinearFilter,\n type: UnsignedByteType,\n depthBuffer: options.useDepth ?? DEFAULT_USE_DEPTH,\n stencilBuffer: false,\n },\n );\n\n const material = new UIMaterial(renderTarget.texture);\n const object = new Mesh(geometry, material);\n\n super(layer, object, 0, 0, width, height);\n\n this.sceneInternal = options.scene ?? new Scene();\n this.cameraInternal =\n options.camera ??\n new PerspectiveCamera(\n DEFAULT_FOV,\n width / height,\n DEFAULT_NEAR,\n DEFAULT_FAR,\n );\n\n this.resolutionFactorInternal = resolutionFactor;\n\n this.updateModeInternal = options.updateBehavior ?? DEFAULT_UPDATE_MODE;\n\n if (options.renderedByDefault ?? DEFAULT_RENDERED_BY_DEFAULT) {\n this.needsRenderInternal = true;\n }\n\n this.clearColorInternal = options.clearColor ?? DEFAULT_CLEAR_COLOR;\n this.clearAlphaInternal = options.clearAlpha ?? DEFAULT_CLEAR_ALPHA;\n\n this.renderTarget = renderTarget;\n this.material = material;\n\n this.applyTransformations();\n }\n\n /** Gets whether the scene needs to be re-rendered on the next frame */\n public get needsRender(): boolean {\n return this.needsRenderInternal;\n }\n\n /** Gets the color tint applied to the rendered scene */\n public get color(): number {\n return this.material.getColor();\n }\n\n /** Gets the opacity of the rendered scene */\n public get opacity(): number {\n return this.material.getOpacity();\n }\n\n /** Gets the Three.js scene being rendered */\n public get scene(): Scene {\n return this.sceneInternal;\n }\n\n /** Gets the camera used for rendering the scene */\n public get camera(): Camera {\n return this.cameraInternal;\n }\n\n /** Gets the color used to clear the scene before rendering */\n public get clearColor(): number {\n return this.clearColorInternal;\n }\n\n /** Gets the alpha value for the clear color */\n public get clearAlpha(): number {\n return this.clearAlphaInternal;\n }\n\n /** Gets the resolution scaling factor */\n public get resolutionFactor(): number {\n return this.resolutionFactorInternal;\n }\n\n /**\n * Sets the color tint applied to the rendered scene\n * @param value - Color in hexadecimal format\n */\n public set color(value: number) {\n this.material.setColor(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the opacity of the rendered scene\n * @param value - Opacity value between 0 (transparent) and 1 (opaque)\n */\n public set opacity(value: number) {\n this.material.setOpacity(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the Three.js scene to be rendered\n * @param value - Scene to render\n */\n public set scene(value: Scene) {\n if (this.sceneInternal !== value) {\n this.sceneInternal = value;\n if (this.updateModeInternal === UISceneUpdateMode.PROPERTY_CHANGED) {\n this.requestRender();\n }\n }\n }\n\n /**\n * Sets the camera used for rendering the scene\n * @param value - Camera to use\n */\n public set camera(value: Camera) {\n if (this.cameraInternal !== value) {\n this.cameraInternal = value;\n if (this.updateModeInternal === UISceneUpdateMode.PROPERTY_CHANGED) {\n this.requestRender();\n }\n }\n }\n\n /**\n * Sets the color used to clear the scene before rendering\n * @param value - Clear color in hexadecimal format\n */\n public set clearColor(value: number) {\n if (this.clearColorInternal !== value) {\n this.clearColorInternal = value;\n if (this.updateModeInternal === UISceneUpdateMode.PROPERTY_CHANGED) {\n this.requestRender();\n }\n }\n }\n\n /**\n * Sets the alpha value for the clear color\n * @param value - Alpha value between 0 (transparent) and 1 (opaque)\n */\n public set clearAlpha(value: number) {\n if (this.clearAlphaInternal !== value) {\n this.clearAlphaInternal = value;\n if (this.updateModeInternal === UISceneUpdateMode.PROPERTY_CHANGED) {\n this.requestRender();\n }\n }\n }\n\n /**\n * Sets the resolution scaling factor\n * @param value - Resolution factor (e.g., 0.5 for half resolution)\n */\n public set resolutionFactor(value: number) {\n if (this.resolutionFactorInternal !== value) {\n this.resolutionFactorInternal = value;\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n if (this.updateModeInternal === UISceneUpdateMode.PROPERTY_CHANGED) {\n this.requestRender();\n }\n }\n }\n\n /**\n * Destroys the scene element, disposing of all resources and removing it from the layer.\n * This should be called when the element is no longer needed.\n */\n public override destroy(): void {\n this.material.dispose();\n this.renderTarget.dispose();\n super.destroy();\n }\n\n /**\n * Requests that the scene be re-rendered on the next frame.\n * This is used when the scene is in MANUAL update mode or when properties change.\n */\n public requestRender(): void {\n this.needsRenderInternal = true;\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Renders the scene element.\n * This will render the Three.js scene to a texture if needed,\n * then apply that texture to the mesh.\n *\n * @param renderer - The WebGL renderer\n */\n protected override render(renderer: WebGLRenderer): void {\n if (\n this.needsRenderInternal ||\n this.updateModeInternal === UISceneUpdateMode.ALWAYS\n ) {\n this.needsRenderInternal = false;\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n renderer.setClearColor(this.clearColorInternal, this.clearAlpha);\n renderer.setRenderTarget(this.renderTarget);\n renderer.clear(true, true, false);\n renderer.render(this.sceneInternal, this.cameraInternal);\n }\n\n (this.object as Mesh).material = this.composerInternal.compose(\n renderer,\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n this.material,\n );\n this.applyTransformations();\n }\n}\n","import type {\n UIChunkMetrics,\n UITextChunk,\n UITextLine,\n UITextPadding,\n UITextSize,\n UITextStyle,\n} from \"./UITextInterfaces\";\n\nexport function resolvePadding(\n padding?: Partial<UITextPadding> | number,\n): UITextPadding {\n if (typeof padding === \"number\") {\n return {\n left: padding,\n right: padding,\n top: padding,\n bottom: padding,\n };\n }\n return {\n left: Math.max(padding?.left ?? 0, 0),\n right: Math.max(padding?.right ?? 0, 0),\n top: Math.max(padding?.top ?? 0, 0),\n bottom: Math.max(padding?.bottom ?? 0, 0),\n };\n}\n\nexport function resolveTextStyle(\n currentStyle?: Partial<UITextStyle>,\n baseStyle?: Partial<UITextStyle>,\n): UITextStyle {\n const fontSize = Math.max(\n currentStyle?.fontSize ?? baseStyle?.fontSize ?? 16,\n 1,\n );\n const lineHeight =\n currentStyle?.lineHeight ?? baseStyle?.lineHeight ?? fontSize * 1.2;\n const shadowBlur = Math.max(\n currentStyle?.shadowBlur ?? baseStyle?.shadowBlur ?? 0,\n 0,\n );\n const strokeWidth = Math.max(\n currentStyle?.strokeWidth ?? baseStyle?.strokeWidth ?? 0,\n 0,\n );\n return {\n color: currentStyle?.color ?? baseStyle?.color ?? \"#000000\",\n fontFamily: currentStyle?.fontFamily ?? baseStyle?.fontFamily ?? \"Arial\",\n fontSize,\n fontStyle: currentStyle?.fontStyle ?? baseStyle?.fontStyle ?? \"normal\",\n fontWeight: currentStyle?.fontWeight ?? baseStyle?.fontWeight ?? \"normal\",\n lineHeight,\n\n enableShadow:\n currentStyle?.enableShadow ?? baseStyle?.enableShadow ?? false,\n shadowOffsetX: currentStyle?.shadowOffsetX ?? baseStyle?.shadowOffsetX ?? 0,\n shadowOffsetY: currentStyle?.shadowOffsetY ?? baseStyle?.shadowOffsetY ?? 0,\n shadowBlur,\n shadowColor:\n currentStyle?.shadowColor ?? baseStyle?.shadowColor ?? \"transparent\",\n\n enableStroke:\n currentStyle?.enableStroke ?? baseStyle?.enableStroke ?? false,\n strokeColor:\n currentStyle?.strokeColor ?? baseStyle?.strokeColor ?? \"transparent\",\n strokeWidth,\n };\n}\n\nexport function splitText(text: string): string[] {\n return text.match(/\\S+|\\s|\\n/g) ?? [];\n}\n\nexport function measureTextChunk(\n context: CanvasRenderingContext2D,\n chunk: string,\n style: UITextStyle,\n): UIChunkMetrics {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (chunk === \"\\n\") {\n return {\n width: Math.ceil(0),\n height: style.lineHeight,\n baseline: 0,\n lineHeight: style.lineHeight,\n };\n }\n\n const metrics = context.measureText(chunk);\n const width = metrics.width;\n\n const height = Math.ceil(\n metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n );\n\n return {\n width: Math.ceil(width),\n height: height,\n baseline: metrics.actualBoundingBoxDescent,\n lineHeight: style.lineHeight,\n };\n}\n\nexport function wrapTextLines(\n maxWidth: number,\n chunks: UITextChunk[],\n): UITextLine[] {\n const lines: UITextLine[] = [];\n let currentLine: UITextChunk[] = [];\n let currentWidth = 0;\n let currentHeight = 0;\n let currentBaseline = 0;\n let currentLineHeight = 0;\n\n for (const chunk of chunks) {\n if (chunk.text === \"\\n\") {\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n currentLine = [];\n currentWidth = 0;\n currentHeight = 0;\n currentBaseline = 0;\n currentLineHeight = 0;\n continue;\n }\n\n if (\n currentWidth + chunk.metrics.width <= maxWidth ||\n currentLine.length === 0\n ) {\n currentLine.push(chunk);\n currentWidth += chunk.metrics.width;\n currentHeight = Math.max(currentHeight, chunk.metrics.height);\n currentBaseline = Math.max(currentBaseline, chunk.metrics.baseline);\n currentLineHeight = Math.max(currentLineHeight, chunk.metrics.lineHeight);\n } else {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n currentLine = [chunk];\n currentWidth = chunk.metrics.width;\n currentHeight = chunk.metrics.height;\n currentBaseline = chunk.metrics.baseline;\n currentLineHeight = chunk.metrics.lineHeight;\n }\n }\n\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n\n return lines;\n}\n\nexport function calculateTextBlockSize(lines: UITextLine[]): UITextSize {\n if (lines.length === 0) {\n return { width: 0, height: 0 };\n }\n\n const maxLineWidth = Math.max(...lines.map((line) => line.width));\n\n let totalHeight = 0;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n if (i === 0) {\n totalHeight += line.height;\n } else {\n totalHeight += line.lineHeight;\n }\n\n if (i === lines.length - 1) {\n totalHeight += line.baseline;\n }\n }\n\n return {\n width: maxLineWidth,\n height: totalHeight,\n };\n}\n\nexport function renderText(\n x: number,\n y: number,\n text: string,\n style: UITextStyle,\n context: CanvasRenderingContext2D,\n): void {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (style.enableShadow) {\n context.shadowOffsetX = style.shadowOffsetX;\n context.shadowOffsetY = style.shadowOffsetY;\n context.shadowBlur = style.shadowBlur;\n context.shadowColor = style.shadowColor;\n }\n\n if (style.enableStroke) {\n context.strokeStyle = style.strokeColor;\n context.lineWidth = style.strokeWidth;\n context.strokeText(text, x, y);\n }\n\n context.fillStyle = style.color;\n context.fillText(text, x, y);\n}\n\nexport function renderTextLines(\n paddingTop: number,\n paddingLeft: number,\n lines: UITextLine[],\n context: CanvasRenderingContext2D,\n): void {\n let currentY = paddingTop;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n let currentX = paddingLeft;\n currentY += i === 0 ? line.height : line.lineHeight;\n\n for (const chunk of line.chunks) {\n renderText(currentX, currentY, chunk.text, chunk.style, context);\n currentX += chunk.metrics.width;\n }\n }\n}\n","import type { WebGLRenderer } from \"three\";\nimport { CanvasTexture, Mesh } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIMaterial } from \"../materials/UIMaterial\";\nimport {\n calculateTextBlockSize,\n measureTextChunk,\n renderTextLines,\n resolvePadding,\n resolveTextStyle,\n splitText,\n wrapTextLines,\n} from \"../miscellaneous/textTools\";\nimport { geometry } from \"../miscellaneous/threeInstances\";\nimport type {\n UITextChunk,\n UITextPadding,\n UITextSize,\n UITextSpan,\n UITextStyle,\n} from \"../miscellaneous/UITextInterfaces\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Options for customizing the UIText element.\n */\nexport interface UITextOptions {\n /** Maximum width of the text block before wrapping occurs */\n maxWidth: number;\n /** Padding around the text */\n padding: Partial<UITextPadding>;\n /** Default style to apply to text spans that don't specify their own style */\n defaultStyle: Partial<UITextStyle>;\n}\n\n/** Default maximum line width for text if not otherwise specified */\nconst DEFAULT_LINE_SIZE = 1024;\n\n/**\n * A UI element that displays formatted text.\n * Renders text to a canvas and displays it as a texture on a mesh.\n */\nexport class UIText extends UIElement {\n /** Material used to render the text */\n private readonly material: UIMaterial;\n /** Texture containing the rendered text */\n private readonly texture: CanvasTexture;\n\n /** Canvas element used to render the text */\n private readonly canvas: HTMLCanvasElement;\n /** 2D rendering context for the canvas */\n private readonly context: CanvasRenderingContext2D;\n\n /** Size of the text block without padding */\n private readonly textBlockSize: UITextSize;\n /** Padding values applied around the text */\n private readonly padding: UITextPadding;\n /** Cached aspect ratio for performance optimization */\n private suggestedAspect = 0;\n\n /**\n * Creates a new text UI element.\n *\n * @param layer - The UI layer that contains this element\n * @param spans - Text content to display, either as a string, text span, or array of text spans/strings\n * @param options - Options to customize the text rendering\n * @throws Error if canvas context creation fails\n */\n constructor(\n layer: UILayer,\n spans: (UITextSpan | string)[] | UITextSpan | string,\n options: Partial<UITextOptions> = {},\n ) {\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n\n if (!context) {\n throw new Error(\"Failed to create canvas context\");\n }\n\n const chunks: UITextChunk[] = [];\n const processedSpans = Array.isArray(spans) ? spans : [spans];\n\n for (const span of processedSpans) {\n const isSpanString = typeof span === \"string\";\n const spanText = isSpanString ? span : span.text;\n const style = resolveTextStyle(\n isSpanString ? undefined : span.style,\n options.defaultStyle,\n );\n\n for (const text of splitText(spanText)) {\n const metrics = measureTextChunk(context, text, style);\n chunks.push({ text, style, metrics });\n }\n }\n\n const wrappedLines = wrapTextLines(\n options.maxWidth ?? DEFAULT_LINE_SIZE,\n chunks,\n );\n const textBlockSize = calculateTextBlockSize(wrappedLines);\n\n const padding = resolvePadding(options.padding);\n\n canvas.width = textBlockSize.width + padding.left + padding.right;\n canvas.height = textBlockSize.height + padding.top + padding.bottom;\n\n const texture = new CanvasTexture(canvas);\n\n const material = new UIMaterial(texture);\n const object = new Mesh(geometry, material);\n\n super(layer, object, 0, 0, textBlockSize.width, textBlockSize.height);\n\n this.material = material;\n this.texture = texture;\n\n this.canvas = canvas;\n this.context = context;\n\n this.textBlockSize = textBlockSize;\n this.padding = padding;\n\n renderTextLines(\n this.padding.top,\n this.padding.left,\n wrappedLines,\n this.context,\n );\n\n this.texture.needsUpdate = true;\n this.applyTransformations();\n }\n\n /** Gets the color tint applied to the text */\n public get color(): number {\n return this.material.getColor();\n }\n\n /** Gets the opacity of the text */\n public get opacity(): number {\n return this.material.getOpacity();\n }\n\n /**\n * Sets the color tint applied to the text\n * @param value - Color in hexadecimal format\n */\n public set color(value: number) {\n this.material.setColor(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Sets the opacity of the text\n * @param value - Opacity value between 0 (transparent) and 1 (opaque)\n */\n public set opacity(value: number) {\n this.material.setOpacity(value);\n this.composerInternal.requestUpdate();\n }\n\n /**\n * Destroys the text element, disposing of all resources and removing it from the layer.\n * This should be called when the element is no longer needed.\n */\n public override destroy(): void {\n this.material.dispose();\n this.texture.dispose();\n this.canvas.remove();\n super.destroy();\n }\n\n /**\n * Applies transformations to the text element, ensuring the aspect ratio\n * matches the rendered text to prevent distortion.\n *\n * This overrides the base implementation to maintain the correct aspect ratio.\n */\n public override applyTransformations(): void {\n super.applyTransformations();\n\n const currentAspect = this.width / this.height;\n if (this.suggestedAspect !== currentAspect) {\n this.suggestedAspect = currentAspect;\n\n const targetAspect =\n (this.textBlockSize.width + this.padding.left + this.padding.right) /\n (this.textBlockSize.height + this.padding.top + this.padding.bottom);\n\n this.height = this.width / targetAspect;\n }\n }\n\n /**\n * Renders the text element.\n *\n * @param renderer - The WebGL renderer\n */\n protected override render(renderer: WebGLRenderer): void {\n (this.object as Mesh).material = this.composerInternal.compose(\n renderer,\n this.texture.image.width,\n this.texture.image.height,\n this.material,\n );\n this.applyTransformations();\n }\n}\n","import type { WebGLRenderer } from \"three\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UILayer } from \"./UILayer\";\n\nconst DEFAULT_SCREEN_HEIGHT = 1920;\n\nexport class UIFullScreenLayer extends UILayer {\n private targetScreenHeight?: number = DEFAULT_SCREEN_HEIGHT;\n\n constructor() {\n super();\n window.addEventListener(\"resize\", this.onResize);\n window.addEventListener(\"pointerdown\", this.onClick);\n this.onResize();\n }\n\n public get tergetScreenHeight(): number | undefined {\n return this.targetScreenHeight;\n }\n\n public set tergetScreenHeight(value: number | undefined) {\n this.targetScreenHeight = value;\n this.resizeInternal(window.innerWidth, window.innerHeight);\n }\n\n public override destroy(): void {\n window.removeEventListener(\"resize\", this.onResize);\n window.removeEventListener(\"pointerdown\", this.onClick);\n super.destroy();\n }\n\n public override render(renderer: WebGLRenderer, deltaTime: number): void {\n renderer.clear(false, true, true);\n super.render(renderer, deltaTime);\n }\n\n private calculateScale(): number {\n const targetHeight = this.tergetScreenHeight ?? window.innerHeight;\n return targetHeight / window.innerHeight;\n }\n\n private readonly onResize = (): void => {\n const scale = this.calculateScale();\n this.resizeInternal(window.innerWidth * scale, window.innerHeight * scale);\n };\n\n private readonly onClick = (event: PointerEvent): void => {\n if (this.mode !== UIMode.INTERACTIVE) {\n return;\n }\n\n const rect =\n event.target instanceof HTMLElement\n ? event.target.getBoundingClientRect()\n : null;\n\n const offsetX = rect ? event.clientX - rect.left : event.clientX;\n const offsetY = rect\n ? rect.bottom - event.clientY\n : window.innerHeight - event.clientY;\n\n const scale = this.calculateScale();\n this.clickInternal(offsetX * scale, offsetY * scale);\n };\n}\n","export interface UITextStyle {\n color: string;\n\n fontFamily: string;\n fontSize: number;\n fontStyle: \"normal\" | \"italic\" | \"oblique\";\n fontWeight: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | number;\n lineHeight: number;\n\n enableShadow: boolean;\n shadowOffsetX: number;\n shadowOffsetY: number;\n shadowBlur: number;\n shadowColor: string;\n\n enableStroke: boolean;\n strokeColor: string;\n strokeWidth: number;\n}\n\nexport interface UITextPadding {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\nexport interface UITextSize {\n width: number;\n height: number;\n}\n\nexport interface UIChunkMetrics {\n width: number;\n height: number;\n baseline: number;\n lineHeight: number;\n}\n\nexport interface UITextChunk {\n text: string;\n style: UITextStyle;\n metrics: UIChunkMetrics;\n}\n\nexport interface UITextLine {\n chunks: UITextChunk[];\n width: number;\n height: number;\n baseline: number;\n lineHeight: number;\n}\n\nexport interface UITextSpan {\n text: string;\n style?: Partial<UITextStyle>;\n}\n\nexport function isUITextSpan(obj?: unknown): obj is UITextSpan {\n return (\n obj !== null &&\n typeof obj === \"object\" &&\n \"text\" in obj &&\n typeof obj.text === \"string\"\n );\n}\n","import type { Texture, WebGLRenderer } from \"three\";\n\n/**\n * Options passed to a UIPass when rendering\n */\nexport interface UIPassRenderOptions {\n /** Width of the render target in pixels (without padding) */\n width: number;\n /** Height of the render target in pixels (without padding) */\n height: number;\n /** Current padding used for the render target */\n padding: number;\n}\n\n/**\n * Abstract base class for all UI composition passes\n *\n * UI passes are used to apply post-processing effects to the rendered UI\n * Each pass can be chained together in a UIComposer to create complex effects\n */\nexport abstract class UIPass {\n /**\n * The amount of padding in pixels this pass requires\n * The compositor will use the maximum padding value from all passes\n */\n public abstract get padding(): number;\n\n /**\n * Whether this pass needs to be updated in the next frame\n * Set to true when properties change to trigger a re-render\n */\n public abstract get needsUpdate(): boolean;\n\n /**\n * Whether this pass contributes a meaningful effect\n * Passes that are not valuable may be skipped during composition\n */\n public abstract get isValuable(): boolean;\n\n /**\n * Renders this pass\n *\n * @param renderer - The WebGL renderer to use\n * @param texture - The input texture from the previous pass\n * @param options - Render options including dimensions and padding\n */\n public abstract render(\n renderer: WebGLRenderer,\n texture: Texture,\n options: UIPassRenderOptions,\n ): void;\n}\n"],"names":["Eventail","DEFAULT_ANCHOR"],"mappings":";;AAAO,SAAS,SAAS,GAAG;AAC5B,IAAI,OAAO,IAAI,UAAU,EAAE;AAC3B;AACA,MAAM,UAAU,CAAC;AACjB,IAAI,KAAK,GAAG,EAAE;AACd,IAAI,KAAK,GAAG,EAAE;AACd;AACA;AACA;AACA,IAAI,IAAI,GAAG;AACX,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM;AAChC,IAAI;AACJ;AACA;AACA;AACA,IAAI,KAAK,GAAG;AACZ,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;AACtC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,CAAC,KAAK,EAAE;AAClB,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AAChC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,QAAQ,CAAC,GAAG,EAAE;AAClB,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,SAAS;AACjD,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC,GAAG,EAAE;AACd,QAAQ,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA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W,CAAC;IAC5D;IAEgB,OAAO,GAAA;AACrB,QAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,mBAAU;AACnD,QAAA,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,kBAAS;QACvD,KAAK,CAAC,OAAO,EAAE;IACjB;IAEgB,MAAM,CAAC,QAAuB,EAAE,SAAiB,EAAA;QAC/D,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC;AACjC,QAAA,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC;IACnC;AAEA,IAAA,uBAAA,GAAA;QACE,MAAM,YAAY,GAAG,IAAI,CAAC,kBAAkB,IAAI,MAAM,CAAC,WAAW;AAClE,QAAA,OAAO,YAAY,GAAG,MAAM,CAAC,WAAW;IAC1C;AAyBD;;ACNK,SAAU,YAAY,CAAC,GAAa,EAAA;IACxC,QACE,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK,QAAQ;AACvB,QAAA,MAAM,IAAI,GAAG;AACb,QAAA,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ;AAEhC;;ACnDA;;;;;AAKG;MACmB,MAAM,CAAA;AA+B3B;;;;","x_google_ignoreList":[0,1,2,3,4,5,11]}
1
+ {"version":3,"file":"index.js","sources":["../src/miscellaneous/UIExpression.ts","../node_modules/eventail/dist/index.min.js","../src/miscellaneous/UIMode.ts","../src/miscellaneous/UIOrientation.ts","../node_modules/@lume/kiwi/dist/maptype.js","../node_modules/@lume/kiwi/dist/variable.js","../node_modules/@lume/kiwi/dist/expression.js","../node_modules/@lume/kiwi/dist/strength.js","../node_modules/@lume/kiwi/dist/constraint.js","../node_modules/@lume/kiwi/dist/solver.js","../src/miscellaneous/UIPriority.ts","../src/wrappers/UISceneWrapper.ts","../src/miscellaneous/UIRelation.ts","../src/wrappers/UISolverWrapper.ts","../src/layers/UILayer.ts","../src/constraints/UIConstraint.ts","../src/constraints/UISingleParameterConstraint.ts","../src/constraints/UIHeightConstraint.ts","../src/miscellaneous/asserts.ts","../src/constraints/UIHorizontalDistanceConstraint.ts","../src/constraints/UIHorizontalProportionConstraint.ts","../src/constraints/UIVerticalDistanceConstraint.ts","../src/constraints/UIVerticalProportionConstraint.ts","../src/constraints/UIWidthConstraint.ts","../src/builders/UIConstraint2DBuilder.ts","../src/constraints/UIAspectConstraint.ts","../src/constraints/UICustomConstraint.ts","../src/elements/UIAnchor.ts","../src/elements/UIDummy.ts","../src/miscellaneous/UIMicro.ts","../src/elements/UIElement.ts","../src/materials/UIMaterial.ts","../src/miscellaneous/threeInstances.ts","../src/elements/UIImage.ts","../src/materials/UIProgressMaterial.ts","../src/elements/UIProgress.ts","../src/elements/UIScene.ts","../src/miscellaneous/UITextStyle.ts","../src/miscellaneous/textTools.ts","../src/miscellaneous/UITextPadding.ts","../src/elements/UIText.ts","../src/layers/UIFullscreenLayer.ts","../src/miscellaneous/UITextSpan.ts"],"sourcesContent":["/**\n * Mathematical expression builder for constraint equations in the UI layout system.\n *\n * UIExpression represents linear mathematical expressions of the form:\n * constant + coefficient₁ × variable₁ + coefficient₂ × variable₂ + ... + coefficientₙ × variableₙ\n *\n * These expressions are used to build constraint equations for the Kiwi solver,\n * enabling complex mathematical relationships between UI element properties.\n * Variables are referenced by their numeric descriptors from the solver system.\n *\n * @see {@link UIConstraint} - Constraints that use expressions\n * @see {@link UISolverWrapper} - Solver integration that creates variables\n */\nexport class UIExpression {\n /** The constant term of the expression. */\n public constant: number;\n /** Map of variable descriptors to their coefficients in the expression. */\n private readonly terms: Map<number, number>;\n\n /**\n * Creates a new UIExpression instance.\n *\n * @param constant - The constant term of the expression (defaults to 0)\n * @param terms - Optional array of [variableDescriptor, coefficient] pairs\n */\n constructor(constant = 0, terms?: [number, number][]) {\n this.constant = constant;\n this.terms = terms ? new Map(terms) : new Map();\n }\n\n /**\n * Creates a new expression that represents the sum of two expressions.\n *\n * Performs mathematical addition: (a.constant + a.terms) + (b.constant + b.terms)\n * Coefficients for the same variables are combined.\n *\n * @param a - The first expression\n * @param b - The second expression\n * @returns A new expression representing a + b\n */\n public static plus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant + b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.plus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Creates a new expression that represents the difference of two expressions.\n *\n * Performs mathematical subtraction: (a.constant + a.terms) - (b.constant + b.terms)\n * Coefficients for the same variables are combined with subtraction.\n *\n * @param a - The first expression (minuend)\n * @param b - The second expression (subtrahend)\n * @returns A new expression representing a - b\n */\n public static minus(a: UIExpression, b: UIExpression): UIExpression {\n const result = new UIExpression(\n a.constant - b.constant,\n Array.from(a.terms.entries()),\n );\n for (const [variableIndex, coefficient] of b.terms) {\n result.minus(variableIndex, coefficient);\n }\n return result;\n }\n\n /**\n * Adds a variable term to this expression (mutating operation).\n *\n * If the variable already exists in the expression, its coefficient is\n * increased by the specified amount. Otherwise, a new term is added.\n *\n * @param variableIndex - The variable descriptor from the solver\n * @param coefficient - The coefficient to add for this variable\n * @returns This expression instance for method chaining\n */\n public plus(variableIndex: number, coefficient: number): this {\n this.terms.set(\n variableIndex,\n (this.terms.get(variableIndex) ?? 0) + coefficient,\n );\n return this;\n }\n\n /**\n * Subtracts a variable term from this expression (mutating operation).\n *\n * If the variable already exists in the expression, its coefficient is\n * decreased by the specified amount. Otherwise, a new term with negative\n * coefficient is added.\n *\n * @param variableIndex - The variable descriptor from the solver\n * @param coefficient - The coefficient to subtract for this variable\n * @returns This expression instance for method chaining\n */\n public minus(variableIndex: number, coefficient: number): this {\n return this.plus(variableIndex, -coefficient);\n }\n\n /**\n * Multiplies all terms in this expression by a scalar value (mutating operation).\n *\n * Both the constant term and all variable coefficients are multiplied\n * by the specified value.\n *\n * @param value - The scalar value to multiply by\n * @returns This expression instance for method chaining\n */\n public multiply(value: number): this {\n this.constant *= value;\n for (const [variableIndex, coefficient] of this.terms) {\n this.terms.set(variableIndex, coefficient * value);\n }\n return this;\n }\n\n /**\n * Divides all terms in this expression by a scalar value (mutating operation).\n *\n * Both the constant term and all variable coefficients are divided\n * by the specified value.\n *\n * @param value - The scalar value to divide by (must not be zero)\n * @returns This expression instance for method chaining\n */\n public divide(value: number): this {\n return this.multiply(1 / value);\n }\n\n /**\n * Checks if the expression contains a term for the specified variable.\n *\n * @param variableIndex - The variable descriptor to check for\n * @returns True if the expression has a term for this variable, false otherwise\n */\n public hasTerm(variableIndex: number): boolean {\n return this.terms.has(variableIndex);\n }\n\n /**\n * Copies the content of another expression into this expression (mutating operation).\n *\n * Replaces all terms and the constant of this expression with those\n * from the source expression.\n *\n * @param expression - The source expression to copy from\n * @returns This expression instance for method chaining\n */\n public copy(expression: UIExpression): this {\n this.constant = expression.constant;\n this.terms.clear();\n for (const [variableIndex, coefficient] of expression.terms) {\n this.terms.set(variableIndex, coefficient);\n }\n return this;\n }\n\n /**\n * Creates a deep copy of this expression.\n *\n * The returned expression is completely independent and can be modified\n * without affecting the original.\n *\n * @returns A new UIExpression instance with the same content\n */\n public clone(): UIExpression {\n return new UIExpression(this.constant, Array.from(this.terms.entries()));\n }\n\n /**\n * Prepares the variable terms for internal solver operations.\n *\n * Converts the internal terms map to an array format suitable for\n * integration with the constraint solver system.\n *\n * @returns Array of [variableDescriptor, coefficient] pairs\n * @internal\n */\n protected [\"prepareTermsInternal\"](): [number, number][] {\n return Array.from(this.terms.entries());\n }\n}\n","class t{constructor(t,i,r=0){this.t=new WeakMap,this.i=new Map,void 0!==t&&(void 0===i?this.i.set(t,r):this.t.set(i,new Map([[t,r]])))}insert(t,i,r=0){if(void 0===i){if(this.i.has(t))return;return void this.i.set(t,r)}const s=this.t.get(i);void 0===s?this.t.set(i,new Map([[t,r]])):s.has(t)||s.set(t,r)}remove(t,i){if(void 0===i)return void this.i.delete(t);const r=this.t.get(i);void 0!==r&&(r.delete(t),0===r.size&&this.t.delete(i))}has(t,i){if(void 0===i)return this.i.has(t);const r=this.t.get(i);return void 0!==r&&r.has(t)}getPriority(t,i){if(void 0===i)return this.i.get(t);const r=this.t.get(i);return void 0!==r?r.get(t):void 0}}class i{constructor(){this.o=new Map}on(t,i,r,s=0){return this.h(t,!1,s,i,r),this}once(t,i,r,s=0){return this.h(t,!0,s,i,r),this}off(t,i,r){const s=this.o.get(t);if(void 0===s)return this;s.u&&(s.u=!1,s.v=s.v.slice());const o=s.v;if(0===o.length)return this.o.delete(t),this;if(void 0===i){this.o.delete(t);for(let t=0;t<o.length;t++){const i=o[t];s.l.remove(i._,i.p)}return this}{const e=o.length;if(o[0]._===i&&o[0].p===r)return 1===e?this.o.delete(t):o.shift(),this;const n=e-1;if(o[n]._===i&&o[n].p===r)return o.pop(),this;if(e<10||o[0].M===o[n].M)for(let t=1;t<n;t++){const s=o[t];if(s._===i&&s.p===r)return o.splice(t,1),this}else{const t=s.l.getPriority(i,r);if(void 0===t)return this;let e=0,n=o.length-1;for(;e<=n;){const i=e+n>>>1;o[i].M<t?e=i+1:n=i-1}const c=e;for(n=o.length-1;e<=n;){const i=e+n>>>1;o[i].M<=t?e=i+1:n=i-1}const h=n;for(let t=c;t<=h;t++)if(o[t]._===i&&o[t].p===r)return o.splice(t,1),this}}return this}emit(t,...i){const r=this.o.get(t);if(void 0===r)return!1;if(0===r.v.length)return!1;r.u?r.v=r.v.slice():r.u=!0;const s=r.v;let o=!1;for(let t=0;t<s.length;t++){const r=s[t];r._.apply(r.p,i),r.k&&(o=!0,r.m=!0)}const e=this.o.get(t);if(void 0===e)return!0;e.v===s&&(e.u=!1);const n=e.v;if(o){let i=0;for(let t=0;t<n.length;t++){const r=n[t];r.m?e.l.remove(r._,r.p):n[i++]=r}0===i?this.o.delete(t):n.length=i}return!0}h(i,r,s,o,e){let n=this.o.get(i);if(void 0===n)return void this.o.set(i,{v:[{_:o,p:e,M:s,k:r,m:!1}],u:!1,l:new t(o,e,s)});if(n.l.has(o,e))throw Error(\"Event listener already exists\");n.l.insert(o,e,s);const c={_:o,p:e,M:s,k:r,m:!1};n.u&&(n.u=!1,n.v=n.v.slice());{const t=n.v,i=c.M;if(0===t.length||t[t.length-1].M<=i)return void t.push(c);if(t[0].M>=i)return void t.unshift(c);{let r=0,s=t.length;for(;r<s;){const o=r+s>>>1;t[o].M<i?r=o+1:s=o}t.splice(r,0,c)}}}}export{i as Eventail};\n//# sourceMappingURL=index.min.js.map\n","/**\n * Defines the visibility and interactivity state of UI elements.\n *\n * UI elements can be in one of three states:\n * - Hidden: Element is not visible and does not receive input\n * - Visible: Element is visible but does not receive input\n * - Interactive: Element is visible and can receive input events\n */\nexport enum UIMode {\n /**\n * Element is not rendered and does not receive input events.\n * Equivalent to setting `display: none` in CSS.\n */\n HIDDEN = 0,\n\n /**\n * Element is rendered but does not receive input events.\n * Equivalent to setting `pointer-events: none` in CSS.\n */\n VISIBLE = 1,\n\n /**\n * Element is rendered and can receive input events.\n * This is the fully active state for UI elements.\n */\n INTERACTIVE = 2,\n}\n","/**\n * Defines the screen orientation states for UI constraints.\n *\n * This enum is used to specify when certain UI constraints should be active\n * based on the current device/screen orientation.\n */\nexport enum UIOrientation {\n /**\n * Indicates a landscape orientation (width > height).\n * Constraints using this value will only be active in landscape mode.\n */\n HORIZONTAL = 0,\n\n /**\n * Indicates a portrait orientation (height > width).\n * Constraints using this value will only be active in portrait mode.\n */\n VERTICAL = 1,\n\n /**\n * Indicates that the constraint should always be active,\n * regardless of screen orientation.\n */\n ALWAYS = 2,\n}\n\n/**\n * Resolves an optional orientation to a definite value.\n *\n * @param orientation - The orientation to resolve, or undefined\n * @returns The provided orientation, or ALWAYS if none was provided\n */\nexport function resolveOrientation(orientation?: UIOrientation): UIOrientation {\n return orientation ?? UIOrientation.ALWAYS;\n}\n","export function createMap() {\n return new IndexedMap();\n}\nclass IndexedMap {\n index = {};\n array = [];\n /**\n * Returns the number of items in the array.\n */\n size() {\n return this.array.length;\n }\n /**\n * Returns true if the array is empty.\n */\n empty() {\n return this.array.length === 0;\n }\n /**\n * Returns the item at the given array index.\n *\n * @param index The integer index of the desired item.\n */\n itemAt(index) {\n return this.array[index];\n }\n /**\n * Returns true if the key is in the array, false otherwise.\n *\n * @param key The key to locate in the array.\n */\n contains(key) {\n return this.index[key.id()] !== undefined;\n }\n /**\n * Returns the pair associated with the given key, or undefined.\n *\n * @param key The key to locate in the array.\n */\n find(key) {\n const i = this.index[key.id()];\n return i === undefined ? undefined : this.array[i];\n }\n /**\n * Returns the pair associated with the key if it exists.\n *\n * If the key does not exist, a new pair will be created and\n * inserted using the value created by the given factory.\n *\n * @param key The key to locate in the array.\n * @param factory The function which creates the default value.\n */\n setDefault(key, factory) {\n const i = this.index[key.id()];\n if (i === undefined) {\n const pair = new Pair(key, factory());\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n return pair;\n }\n else {\n return this.array[i];\n }\n }\n /**\n * Insert the pair into the array and return the pair.\n *\n * This will overwrite any existing entry in the array.\n *\n * @param key The key portion of the pair.\n * @param value The value portion of the pair.\n */\n insert(key, value) {\n const pair = new Pair(key, value);\n const i = this.index[key.id()];\n if (i === undefined) {\n this.index[key.id()] = this.array.length;\n this.array.push(pair);\n }\n else {\n this.array[i] = pair;\n }\n return pair;\n }\n /**\n * Removes and returns the pair for the given key, or undefined.\n *\n * @param key The key to remove from the map.\n */\n erase(key) {\n const i = this.index[key.id()];\n if (i === undefined) {\n return undefined;\n }\n this.index[key.id()] = undefined;\n const pair = this.array[i];\n const last = this.array.pop();\n if (pair !== last) {\n this.array[i] = last;\n this.index[last.first.id()] = i;\n }\n return pair;\n }\n /**\n * Create a copy of this associative array.\n */\n copy() {\n const copy = new IndexedMap();\n for (let i = 0; i < this.array.length; i++) {\n const pair = this.array[i].copy();\n copy.array[i] = pair;\n copy.index[pair.first.id()] = i;\n }\n return copy;\n }\n}\n/**\n * A class which defines a generic pair object.\n * @private\n */\n// tslint:disable: max-classes-per-file\nclass Pair {\n first;\n second;\n /**\n * Construct a new Pair object.\n *\n * @param first The first item of the pair.\n * @param second The second item of the pair.\n */\n constructor(first, second) {\n this.first = first;\n this.second = second;\n }\n /**\n * Create a copy of the pair.\n */\n copy() {\n return new Pair(this.first, this.second);\n }\n}\n","import { Expression } from './expression.js';\n/**\n * The primary user constraint variable.\n *\n * @class\n * @param {String} [name=\"\"] The name to associated with the variable.\n */\nexport class Variable {\n constructor(name = '') {\n this._name = name;\n }\n /**\n * Returns the unique id number of the variable.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the name of the variable.\n *\n * @return {String} name of the variable\n */\n name() {\n return this._name;\n }\n /**\n * Set the name of the variable.\n *\n * @param {String} name Name of the variable\n */\n setName(name) {\n this._name = name;\n }\n /**\n * Returns the user context object of the variable.\n * @private\n */\n context() {\n return this._context;\n }\n /**\n * Set the user context object of the variable.\n * @private\n */\n setContext(context) {\n this._context = context;\n }\n /**\n * Returns the value of the variable.\n *\n * @return {Number} Calculated value\n */\n value() {\n return this._value;\n }\n /**\n * Set the value of the variable.\n * @private\n */\n setValue(value) {\n this._value = value;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the variable.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the variable.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n /**\n * Returns the JSON representation of the variable.\n * @private\n */\n toJSON() {\n return {\n name: this._name,\n value: this._value,\n };\n }\n toString() {\n return this._context + '[' + this._name + ':' + this._value + ']';\n }\n _name;\n _value = 0.0;\n _context = null;\n _id = VarId++;\n}\n/**\n * The internal variable id counter.\n * @private\n */\nlet VarId = 0;\n","import { createMap } from './maptype.js';\nimport { Variable } from './variable.js';\n/**\n * An expression of variable terms and a constant.\n *\n * The constructor accepts an arbitrary number of parameters,\n * each of which must be one of the following types:\n * - number\n * - Variable\n * - Expression\n * - 2-tuple of [number, Variable|Expression]\n *\n * The parameters are summed. The tuples are multiplied.\n *\n * @class\n * @param {...(number|Variable|Expression|Array)} args\n */\nexport class Expression {\n constructor() {\n let parsed = parseArgs(arguments);\n this._terms = parsed.terms;\n this._constant = parsed.constant;\n }\n /**\n * Returns the mapping of terms in the expression.\n *\n * This *must* be treated as const.\n * @private\n */\n terms() {\n return this._terms;\n }\n /**\n * Returns the constant of the expression.\n * @private\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns the computed value of the expression.\n *\n * @private\n * @return {Number} computed value of the expression\n */\n value() {\n let result = this._constant;\n for (let i = 0, n = this._terms.size(); i < n; i++) {\n let pair = this._terms.itemAt(i);\n result += pair.first.value() * pair.second;\n }\n return result;\n }\n /**\n * Creates a new Expression by adding a number, variable or expression\n * to the expression.\n *\n * @param {Number|Variable|Expression} value Value to add.\n * @return {Expression} expression\n */\n plus(value) {\n return new Expression(this, value);\n }\n /**\n * Creates a new Expression by substracting a number, variable or expression\n * from the expression.\n *\n * @param {Number|Variable|Expression} value Value to substract.\n * @return {Expression} expression\n */\n minus(value) {\n return new Expression(this, typeof value === 'number' ? -value : [-1, value]);\n }\n /**\n * Creates a new Expression by multiplying with a fixed number.\n *\n * @param {Number} coefficient Coefficient to multiply with.\n * @return {Expression} expression\n */\n multiply(coefficient) {\n return new Expression([coefficient, this]);\n }\n /**\n * Creates a new Expression by dividing with a fixed number.\n *\n * @param {Number} coefficient Coefficient to divide by.\n * @return {Expression} expression\n */\n divide(coefficient) {\n return new Expression([1 / coefficient, this]);\n }\n isConstant() {\n return this._terms.size() == 0;\n }\n toString() {\n let result = this._terms.array\n .map(function (pair) {\n return pair.second + '*' + pair.first.toString();\n })\n .join(' + ');\n if (!this.isConstant() && this._constant !== 0) {\n result += ' + ';\n }\n result += this._constant;\n return result;\n }\n _terms;\n _constant;\n}\n/**\n * An internal argument parsing function.\n * @private\n */\nfunction parseArgs(args) {\n let constant = 0.0;\n let factory = () => 0.0;\n let terms = createMap();\n for (let i = 0, n = args.length; i < n; ++i) {\n let item = args[i];\n if (typeof item === 'number') {\n constant += item;\n }\n else if (item instanceof Variable) {\n terms.setDefault(item, factory).second += 1.0;\n }\n else if (item instanceof Expression) {\n constant += item.constant();\n let terms2 = item.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second;\n }\n }\n else if (item instanceof Array) {\n if (item.length !== 2) {\n throw new Error('array must have length 2');\n }\n let value = item[0];\n let value2 = item[1];\n if (typeof value !== 'number') {\n throw new Error('array item 0 must be a number');\n }\n if (value2 instanceof Variable) {\n terms.setDefault(value2, factory).second += value;\n }\n else if (value2 instanceof Expression) {\n constant += value2.constant() * value;\n let terms2 = value2.terms();\n for (let j = 0, k = terms2.size(); j < k; j++) {\n let termPair = terms2.itemAt(j);\n terms.setDefault(termPair.first, factory).second += termPair.second * value;\n }\n }\n else {\n throw new Error('array item 1 must be a variable or expression');\n }\n }\n else {\n throw new Error('invalid Expression argument: ' + item);\n }\n }\n return { terms, constant };\n}\n","/**\n * @class Strength\n */\nexport class Strength {\n /**\n * Create a new symbolic strength.\n *\n * @param a strong\n * @param b medium\n * @param c weak\n * @param [w] weight\n * @return strength\n */\n static create(a, b, c, w = 1.0) {\n let result = 0.0;\n result += Math.max(0.0, Math.min(1000.0, a * w)) * 1000000.0;\n result += Math.max(0.0, Math.min(1000.0, b * w)) * 1000.0;\n result += Math.max(0.0, Math.min(1000.0, c * w));\n return result;\n }\n /**\n * The 'required' symbolic strength.\n */\n static required = Strength.create(1000.0, 1000.0, 1000.0);\n /**\n * The 'strong' symbolic strength.\n */\n static strong = Strength.create(1.0, 0.0, 0.0);\n /**\n * The 'medium' symbolic strength.\n */\n static medium = Strength.create(0.0, 1.0, 0.0);\n /**\n * The 'weak' symbolic strength.\n */\n static weak = Strength.create(0.0, 0.0, 1.0);\n /**\n * Clip a symbolic strength to the allowed min and max.\n * @private\n */\n static clip(value) {\n return Math.max(0.0, Math.min(Strength.required, value));\n }\n}\n","import { Expression } from './expression.js';\nimport { Strength } from './strength.js';\n/**\n * An enum defining the linear constraint operators.\n *\n * |Value|Operator|Description|\n * |----|-----|-----|\n * |`Le`|<=|Less than equal|\n * |`Ge`|>=|Greater than equal|\n * |`Eq`|==|Equal|\n *\n * @enum {Number}\n */\nexport var Operator;\n(function (Operator) {\n Operator[Operator[\"Le\"] = 0] = \"Le\";\n Operator[Operator[\"Ge\"] = 1] = \"Ge\";\n Operator[Operator[\"Eq\"] = 2] = \"Eq\";\n})(Operator || (Operator = {}));\n/**\n * A linear constraint equation.\n *\n * A constraint equation is composed of an expression, an operator,\n * and a strength. The RHS of the equation is implicitly zero.\n *\n * @class\n * @param {Expression} expression The constraint expression (LHS).\n * @param {Operator} operator The equation operator.\n * @param {Expression} [rhs] Right hand side of the expression.\n * @param {Number} [strength=Strength.required] The strength of the constraint.\n */\nexport class Constraint {\n constructor(expression, operator, rhs, strength = Strength.required) {\n this._operator = operator;\n this._strength = Strength.clip(strength);\n if (rhs === undefined && expression instanceof Expression) {\n this._expression = expression;\n }\n else {\n this._expression = expression.minus(rhs);\n }\n }\n /**\n * Returns the unique id number of the constraint.\n * @private\n */\n id() {\n return this._id;\n }\n /**\n * Returns the expression of the constraint.\n *\n * @return {Expression} expression\n */\n expression() {\n return this._expression;\n }\n /**\n * Returns the relational operator of the constraint.\n *\n * @return {Operator} linear constraint operator\n */\n op() {\n return this._operator;\n }\n /**\n * Returns the strength of the constraint.\n *\n * @return {Number} strength\n */\n strength() {\n return this._strength;\n }\n toString() {\n return (this._expression.toString() + ' ' + ['<=', '>=', '='][this._operator] + ' 0 (' + this._strength.toString() + ')');\n }\n _expression;\n _operator;\n _strength;\n _id = CnId++;\n}\n/**\n * The internal constraint id counter.\n * @private\n */\nlet CnId = 0;\n","import { Constraint, Operator } from './constraint.js';\nimport { Expression } from './expression.js';\nimport { createMap } from './maptype.js';\nimport { Strength } from './strength.js';\n/**\n * The constraint solver class.\n *\n * @class\n */\nexport class Solver {\n /**\n * @type {number} - The max number of solver iterations before an error\n * is thrown, in order to prevent infinite iteration. Default: `10,000`.\n */\n maxIterations = 1000;\n /**\n * Construct a new Solver.\n */\n constructor() { }\n /**\n * Creates and add a constraint to the solver.\n *\n * @param {Expression|Variable} lhs Left hand side of the expression\n * @param {Operator} operator Operator\n * @param {Expression|Variable|Number} rhs Right hand side of the expression\n * @param {Number} [strength=Strength.required] Strength\n */\n createConstraint(lhs, operator, rhs, strength = Strength.required) {\n let cn = new Constraint(lhs, operator, rhs, strength);\n this.addConstraint(cn);\n return cn;\n }\n /**\n * Add a constraint to the solver.\n *\n * @param {Constraint} constraint Constraint to add to the solver\n */\n addConstraint(constraint) {\n let cnPair = this._cnMap.find(constraint);\n if (cnPair !== undefined) {\n throw new Error('duplicate constraint');\n }\n // Creating a row causes symbols to be reserved for the variables\n // in the constraint. If this method exits with an exception,\n // then its possible those variables will linger in the var map.\n // Since its likely that those variables will be used in other\n // constraints and since exceptional conditions are uncommon,\n // i'm not too worried about aggressive cleanup of the var map.\n let data = this._createRow(constraint);\n let row = data.row;\n let tag = data.tag;\n let subject = this._chooseSubject(row, tag);\n // If chooseSubject couldnt find a valid entering symbol, one\n // last option is available if the entire row is composed of\n // dummy variables. If the constant of the row is zero, then\n // this represents redundant constraints and the new dummy\n // marker can enter the basis. If the constant is non-zero,\n // then it represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid && row.allDummies()) {\n if (!nearZero(row.constant())) {\n throw new Error('unsatisfiable constraint');\n }\n else {\n subject = tag.marker;\n }\n }\n // If an entering symbol still isn't found, then the row must\n // be added using an artificial variable. If that fails, then\n // the row represents an unsatisfiable constraint.\n if (subject.type() === SymbolType.Invalid) {\n if (!this._addWithArtificialVariable(row)) {\n throw new Error('unsatisfiable constraint');\n }\n }\n else {\n row.solveFor(subject);\n this._substitute(subject, row);\n this._rowMap.insert(subject, row);\n }\n this._cnMap.insert(constraint, tag);\n // Optimizing after each constraint is added performs less\n // aggregate work due to a smaller average system size. It\n // also ensures the solver remains in a consistent state.\n this._optimize(this._objective);\n }\n /**\n * Remove a constraint from the solver.\n *\n * @param {Constraint} constraint Constraint to remove from the solver\n */\n removeConstraint(constraint) {\n let cnPair = this._cnMap.erase(constraint);\n if (cnPair === undefined) {\n throw new Error('unknown constraint');\n }\n // Remove the error effects from the objective function\n // *before* pivoting, or substitutions into the objective\n // will lead to incorrect solver results.\n this._removeConstraintEffects(constraint, cnPair.second);\n // If the marker is basic, simply drop the row. Otherwise,\n // pivot the marker into the basis and then drop the row.\n let marker = cnPair.second.marker;\n let rowPair = this._rowMap.erase(marker);\n if (rowPair === undefined) {\n let leaving = this._getMarkerLeavingSymbol(marker);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('failed to find leaving row');\n }\n rowPair = this._rowMap.erase(leaving);\n rowPair.second.solveForEx(leaving, marker);\n this._substitute(marker, rowPair.second);\n }\n // Optimizing after each constraint is removed ensures that the\n // solver remains consistent. It makes the solver api easier to\n // use at a small tradeoff for speed.\n this._optimize(this._objective);\n }\n /**\n * Test whether the solver contains the constraint.\n *\n * @param {Constraint} constraint Constraint to test for\n * @return {Bool} true or false\n */\n hasConstraint(constraint) {\n return this._cnMap.contains(constraint);\n }\n /**\n * Get an array of the current constraints.\n *\n * @return {Constraint[]}\n */\n getConstraints() {\n return this._cnMap.array.map(({ first }) => first);\n }\n /**\n * Add an edit variable to the solver.\n *\n * @param {Variable} variable Edit variable to add to the solver\n * @param {Number} strength Strength, should be less than `Strength.required`\n */\n addEditVariable(variable, strength) {\n let editPair = this._editMap.find(variable);\n if (editPair !== undefined) {\n throw new Error('duplicate edit variable');\n }\n strength = Strength.clip(strength);\n if (strength === Strength.required) {\n throw new Error('bad required strength');\n }\n let expr = new Expression(variable);\n let cn = new Constraint(expr, Operator.Eq, undefined, strength);\n this.addConstraint(cn);\n let tag = this._cnMap.find(cn).second;\n let info = { tag, constraint: cn, constant: 0.0 };\n this._editMap.insert(variable, info);\n }\n /**\n * Remove an edit variable from the solver.\n *\n * @param {Variable} variable Edit variable to remove from the solver\n */\n removeEditVariable(variable) {\n let editPair = this._editMap.erase(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n this.removeConstraint(editPair.second.constraint);\n }\n /**\n * Test whether the solver contains the edit variable.\n *\n * @param {Variable} variable Edit variable to test for\n * @return {Bool} true or false\n */\n hasEditVariable(variable) {\n return this._editMap.contains(variable);\n }\n /**\n * Suggest the value of an edit variable.\n *\n * @param {Variable} variable Edit variable to suggest a value for\n * @param {Number} value Suggested value\n */\n suggestValue(variable, value) {\n let editPair = this._editMap.find(variable);\n if (editPair === undefined) {\n throw new Error('unknown edit variable');\n }\n let rows = this._rowMap;\n let info = editPair.second;\n let delta = value - info.constant;\n info.constant = value;\n // Check first if the positive error variable is basic.\n let marker = info.tag.marker;\n let rowPair = rows.find(marker);\n if (rowPair !== undefined) {\n if (rowPair.second.add(-delta) < 0.0) {\n this._infeasibleRows.push(marker);\n }\n this._dualOptimize();\n return;\n }\n // Check next if the negative error variable is basic.\n let other = info.tag.other;\n rowPair = rows.find(other);\n if (rowPair !== undefined) {\n if (rowPair.second.add(delta) < 0.0) {\n this._infeasibleRows.push(other);\n }\n this._dualOptimize();\n return;\n }\n // Otherwise update each row where the error variables exist.\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let rowPair = rows.itemAt(i);\n let row = rowPair.second;\n let coeff = row.coefficientFor(marker);\n if (coeff !== 0.0 && row.add(delta * coeff) < 0.0 && rowPair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(rowPair.first);\n }\n }\n this._dualOptimize();\n }\n /**\n * Update the values of the variables.\n */\n updateVariables() {\n let vars = this._varMap;\n let rows = this._rowMap;\n for (let i = 0, n = vars.size(); i < n; ++i) {\n let pair = vars.itemAt(i);\n let rowPair = rows.find(pair.second);\n if (rowPair !== undefined) {\n pair.first.setValue(rowPair.second.constant());\n }\n else {\n pair.first.setValue(0.0);\n }\n }\n }\n /**\n * Get the symbol for the given variable.\n *\n * If a symbol does not exist for the variable, one will be created.\n * @private\n */\n _getVarSymbol(variable) {\n let factory = () => this._makeSymbol(SymbolType.External);\n return this._varMap.setDefault(variable, factory).second;\n }\n /**\n * Create a new Row object for the given constraint.\n *\n * The terms in the constraint will be converted to cells in the row.\n * Any term in the constraint with a coefficient of zero is ignored.\n * This method uses the `_getVarSymbol` method to get the symbol for\n * the variables added to the row. If the symbol for a given cell\n * variable is basic, the cell variable will be substituted with the\n * basic row.\n *\n * The necessary slack and error variables will be added to the row.\n * If the constant for the row is negative, the sign for the row\n * will be inverted so the constant becomes positive.\n *\n * Returns the created Row and the tag for tracking the constraint.\n * @private\n */\n _createRow(constraint) {\n let expr = constraint.expression();\n let row = new Row(expr.constant());\n // Substitute the current basic variables into the row.\n let terms = expr.terms();\n for (let i = 0, n = terms.size(); i < n; ++i) {\n let termPair = terms.itemAt(i);\n if (!nearZero(termPair.second)) {\n let symbol = this._getVarSymbol(termPair.first);\n let basicPair = this._rowMap.find(symbol);\n if (basicPair !== undefined) {\n row.insertRow(basicPair.second, termPair.second);\n }\n else {\n row.insertSymbol(symbol, termPair.second);\n }\n }\n }\n // Add the necessary slack, error, and dummy variables.\n let objective = this._objective;\n let strength = constraint.strength();\n let tag = { marker: INVALID_SYMBOL, other: INVALID_SYMBOL };\n switch (constraint.op()) {\n case Operator.Le:\n case Operator.Ge: {\n let coeff = constraint.op() === Operator.Le ? 1.0 : -1.0;\n let slack = this._makeSymbol(SymbolType.Slack);\n tag.marker = slack;\n row.insertSymbol(slack, coeff);\n if (strength < Strength.required) {\n let error = this._makeSymbol(SymbolType.Error);\n tag.other = error;\n row.insertSymbol(error, -coeff);\n objective.insertSymbol(error, strength);\n }\n break;\n }\n case Operator.Eq: {\n if (strength < Strength.required) {\n let errplus = this._makeSymbol(SymbolType.Error);\n let errminus = this._makeSymbol(SymbolType.Error);\n tag.marker = errplus;\n tag.other = errminus;\n row.insertSymbol(errplus, -1.0); // v = eplus - eminus\n row.insertSymbol(errminus, 1.0); // v - eplus + eminus = 0\n objective.insertSymbol(errplus, strength);\n objective.insertSymbol(errminus, strength);\n }\n else {\n let dummy = this._makeSymbol(SymbolType.Dummy);\n tag.marker = dummy;\n row.insertSymbol(dummy);\n }\n break;\n }\n }\n // Ensure the row has a positive constant.\n if (row.constant() < 0.0) {\n row.reverseSign();\n }\n return { row, tag };\n }\n /**\n * Choose the subject for solving for the row.\n *\n * This method will choose the best subject for using as the solve\n * target for the row. An invalid symbol will be returned if there\n * is no valid target.\n *\n * The symbols are chosen according to the following precedence:\n *\n * 1) The first symbol representing an external variable.\n * 2) A negative slack or error tag variable.\n *\n * If a subject cannot be found, an invalid symbol will be returned.\n *\n * @private\n */\n _chooseSubject(row, tag) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() === SymbolType.External) {\n return pair.first;\n }\n }\n let type = tag.marker.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.marker) < 0.0) {\n return tag.marker;\n }\n }\n type = tag.other.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n if (row.coefficientFor(tag.other) < 0.0) {\n return tag.other;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Add the row to the tableau using an artificial variable.\n *\n * This will return false if the constraint cannot be satisfied.\n *\n * @private\n */\n _addWithArtificialVariable(row) {\n // Create and add the artificial variable to the tableau.\n let art = this._makeSymbol(SymbolType.Slack);\n this._rowMap.insert(art, row.copy());\n this._artificial = row.copy();\n // Optimize the artificial objective. This is successful\n // only if the artificial objective is optimized to zero.\n this._optimize(this._artificial);\n let success = nearZero(this._artificial.constant());\n this._artificial = null;\n // If the artificial variable is basic, pivot the row so that\n // it becomes non-basic. If the row is constant, exit early.\n let pair = this._rowMap.erase(art);\n if (pair !== undefined) {\n let basicRow = pair.second;\n if (basicRow.isConstant()) {\n return success;\n }\n let entering = this._anyPivotableSymbol(basicRow);\n if (entering.type() === SymbolType.Invalid) {\n return false; // unsatisfiable (will this ever happen?)\n }\n basicRow.solveForEx(art, entering);\n this._substitute(entering, basicRow);\n this._rowMap.insert(entering, basicRow);\n }\n // Remove the artificial variable from the tableau.\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n rows.itemAt(i).second.removeSymbol(art);\n }\n this._objective.removeSymbol(art);\n return success;\n }\n /**\n * Substitute the parametric symbol with the given row.\n *\n * This method will substitute all instances of the parametric symbol\n * in the tableau and the objective function with the given row.\n *\n * @private\n */\n _substitute(symbol, row) {\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n pair.second.substitute(symbol, row);\n if (pair.second.constant() < 0.0 && pair.first.type() !== SymbolType.External) {\n this._infeasibleRows.push(pair.first);\n }\n }\n this._objective.substitute(symbol, row);\n if (this._artificial) {\n this._artificial.substitute(symbol, row);\n }\n }\n /**\n * Optimize the system for the given objective function.\n *\n * This method performs iterations of Phase 2 of the simplex method\n * until the objective function reaches a minimum.\n *\n * @private\n */\n _optimize(objective) {\n let iterations = 0;\n while (iterations < this.maxIterations) {\n let entering = this._getEnteringSymbol(objective);\n if (entering.type() === SymbolType.Invalid) {\n return;\n }\n let leaving = this._getLeavingSymbol(entering);\n if (leaving.type() === SymbolType.Invalid) {\n throw new Error('the objective is unbounded');\n }\n // pivot the entering symbol into the basis\n let row = this._rowMap.erase(leaving).second;\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n this._rowMap.insert(entering, row);\n iterations++;\n }\n throw new Error('solver iterations exceeded');\n }\n /**\n * Optimize the system using the dual of the simplex method.\n *\n * The current state of the system should be such that the objective\n * function is optimal, but not feasible. This method will perform\n * an iteration of the dual simplex method to make the solution both\n * optimal and feasible.\n *\n * @private\n */\n _dualOptimize() {\n let rows = this._rowMap;\n let infeasible = this._infeasibleRows;\n while (infeasible.length !== 0) {\n let leaving = infeasible.pop();\n let pair = rows.find(leaving);\n if (pair !== undefined && pair.second.constant() < 0.0) {\n let entering = this._getDualEnteringSymbol(pair.second);\n if (entering.type() === SymbolType.Invalid) {\n throw new Error('dual optimize failed');\n }\n // pivot the entering symbol into the basis\n let row = pair.second;\n rows.erase(leaving);\n row.solveForEx(leaving, entering);\n this._substitute(entering, row);\n rows.insert(entering, row);\n }\n }\n }\n /**\n * Compute the entering variable for a pivot operation.\n *\n * This method will return first symbol in the objective function which\n * is non-dummy and has a coefficient less than zero. If no symbol meets\n * the criteria, it means the objective function is at a minimum, and an\n * invalid symbol is returned.\n *\n * @private\n */\n _getEnteringSymbol(objective) {\n let cells = objective.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n if (pair.second < 0.0 && symbol.type() !== SymbolType.Dummy) {\n return symbol;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Compute the entering symbol for the dual optimize operation.\n *\n * This method will return the symbol in the row which has a positive\n * coefficient and yields the minimum ratio for its respective symbol\n * in the objective function. The provided row *must* be infeasible.\n * If no symbol is found which meats the criteria, an invalid symbol\n * is returned.\n *\n * @private\n */\n _getDualEnteringSymbol(row) {\n let ratio = Number.MAX_VALUE;\n let entering = INVALID_SYMBOL;\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let symbol = pair.first;\n let c = pair.second;\n if (c > 0.0 && symbol.type() !== SymbolType.Dummy) {\n let coeff = this._objective.coefficientFor(symbol);\n let r = coeff / c;\n if (r < ratio) {\n ratio = r;\n entering = symbol;\n }\n }\n }\n return entering;\n }\n /**\n * Compute the symbol for pivot exit row.\n *\n * This method will return the symbol for the exit row in the row\n * map. If no appropriate exit symbol is found, an invalid symbol\n * will be returned. This indicates that the objective function is\n * unbounded.\n *\n * @private\n */\n _getLeavingSymbol(entering) {\n let ratio = Number.MAX_VALUE;\n let found = INVALID_SYMBOL;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let symbol = pair.first;\n if (symbol.type() !== SymbolType.External) {\n let row = pair.second;\n let temp = row.coefficientFor(entering);\n if (temp < 0.0) {\n let temp_ratio = -row.constant() / temp;\n if (temp_ratio < ratio) {\n ratio = temp_ratio;\n found = symbol;\n }\n }\n }\n }\n return found;\n }\n /**\n * Compute the leaving symbol for a marker variable.\n *\n * This method will return a symbol corresponding to a basic row\n * which holds the given marker variable. The row will be chosen\n * according to the following precedence:\n *\n * 1) The row with a restricted basic varible and a negative coefficient\n * for the marker with the smallest ratio of -constant / coefficient.\n *\n * 2) The row with a restricted basic variable and the smallest ratio\n * of constant / coefficient.\n *\n * 3) The last unrestricted row which contains the marker.\n *\n * If the marker does not exist in any row, an invalid symbol will be\n * returned. This indicates an internal solver error since the marker\n * *should* exist somewhere in the tableau.\n *\n * @private\n */\n _getMarkerLeavingSymbol(marker) {\n let dmax = Number.MAX_VALUE;\n let r1 = dmax;\n let r2 = dmax;\n let invalid = INVALID_SYMBOL;\n let first = invalid;\n let second = invalid;\n let third = invalid;\n let rows = this._rowMap;\n for (let i = 0, n = rows.size(); i < n; ++i) {\n let pair = rows.itemAt(i);\n let row = pair.second;\n let c = row.coefficientFor(marker);\n if (c === 0.0) {\n continue;\n }\n let symbol = pair.first;\n if (symbol.type() === SymbolType.External) {\n third = symbol;\n }\n else if (c < 0.0) {\n let r = -row.constant() / c;\n if (r < r1) {\n r1 = r;\n first = symbol;\n }\n }\n else {\n let r = row.constant() / c;\n if (r < r2) {\n r2 = r;\n second = symbol;\n }\n }\n }\n if (first !== invalid) {\n return first;\n }\n if (second !== invalid) {\n return second;\n }\n return third;\n }\n /**\n * Remove the effects of a constraint on the objective function.\n *\n * @private\n */\n _removeConstraintEffects(cn, tag) {\n if (tag.marker.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.marker, cn.strength());\n }\n if (tag.other.type() === SymbolType.Error) {\n this._removeMarkerEffects(tag.other, cn.strength());\n }\n }\n /**\n * Remove the effects of an error marker on the objective function.\n *\n * @private\n */\n _removeMarkerEffects(marker, strength) {\n let pair = this._rowMap.find(marker);\n if (pair !== undefined) {\n this._objective.insertRow(pair.second, -strength);\n }\n else {\n this._objective.insertSymbol(marker, -strength);\n }\n }\n /**\n * Get the first Slack or Error symbol in the row.\n *\n * If no such symbol is present, an invalid symbol will be returned.\n *\n * @private\n */\n _anyPivotableSymbol(row) {\n let cells = row.cells();\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n let type = pair.first.type();\n if (type === SymbolType.Slack || type === SymbolType.Error) {\n return pair.first;\n }\n }\n return INVALID_SYMBOL;\n }\n /**\n * Returns a new Symbol of the given type.\n *\n * @private\n */\n _makeSymbol(type) {\n return new Symbol(type, this._idTick++);\n }\n _cnMap = createCnMap();\n _rowMap = createRowMap();\n _varMap = createVarMap();\n _editMap = createEditMap();\n _infeasibleRows = [];\n _objective = new Row();\n _artificial = null;\n _idTick = 0;\n}\n/**\n * Test whether a value is approximately zero.\n * @private\n */\nfunction nearZero(value) {\n let eps = 1.0e-8;\n return value < 0.0 ? -value < eps : value < eps;\n}\n/**\n * An internal function for creating a constraint map.\n * @private\n */\nfunction createCnMap() {\n return createMap();\n}\n/**\n * An internal function for creating a row map.\n * @private\n */\nfunction createRowMap() {\n return createMap();\n}\n/**\n * An internal function for creating a variable map.\n * @private\n */\nfunction createVarMap() {\n return createMap();\n}\n/**\n * An internal function for creating an edit map.\n * @private\n */\nfunction createEditMap() {\n return createMap();\n}\n/**\n * An enum defining the available symbol types.\n * @private\n */\nvar SymbolType;\n(function (SymbolType) {\n SymbolType[SymbolType[\"Invalid\"] = 0] = \"Invalid\";\n SymbolType[SymbolType[\"External\"] = 1] = \"External\";\n SymbolType[SymbolType[\"Slack\"] = 2] = \"Slack\";\n SymbolType[SymbolType[\"Error\"] = 3] = \"Error\";\n SymbolType[SymbolType[\"Dummy\"] = 4] = \"Dummy\";\n})(SymbolType || (SymbolType = {}));\n/**\n * An internal class representing a symbol in the solver.\n * @private\n */\nclass Symbol {\n /**\n * Construct a new Symbol\n *\n * @param [type] The type of the symbol.\n * @param [id] The unique id number of the symbol.\n */\n constructor(type, id) {\n this._id = id;\n this._type = type;\n }\n /**\n * Returns the unique id number of the symbol.\n */\n id() {\n return this._id;\n }\n /**\n * Returns the type of the symbol.\n */\n type() {\n return this._type;\n }\n _id;\n _type;\n}\n/**\n * A static invalid symbol\n * @private\n */\nlet INVALID_SYMBOL = new Symbol(SymbolType.Invalid, -1);\n/**\n * An internal row class used by the solver.\n * @private\n */\nclass Row {\n /**\n * Construct a new Row.\n */\n constructor(constant = 0.0) {\n this._constant = constant;\n }\n /**\n * Returns the mapping of symbols to coefficients.\n */\n cells() {\n return this._cellMap;\n }\n /**\n * Returns the constant for the row.\n */\n constant() {\n return this._constant;\n }\n /**\n * Returns true if the row is a constant value.\n */\n isConstant() {\n return this._cellMap.empty();\n }\n /**\n * Returns true if the Row has all dummy symbols.\n */\n allDummies() {\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n if (pair.first.type() !== SymbolType.Dummy) {\n return false;\n }\n }\n return true;\n }\n /**\n * Create a copy of the row.\n */\n copy() {\n let theCopy = new Row(this._constant);\n theCopy._cellMap = this._cellMap.copy();\n return theCopy;\n }\n /**\n * Add a constant value to the row constant.\n *\n * Returns the new value of the constant.\n */\n add(value) {\n return (this._constant += value);\n }\n /**\n * Insert the symbol into the row with the given coefficient.\n *\n * If the symbol already exists in the row, the coefficient\n * will be added to the existing coefficient. If the resulting\n * coefficient is zero, the symbol will be removed from the row.\n */\n insertSymbol(symbol, coefficient = 1.0) {\n let pair = this._cellMap.setDefault(symbol, () => 0.0);\n if (nearZero((pair.second += coefficient))) {\n this._cellMap.erase(symbol);\n }\n }\n /**\n * Insert a row into this row with a given coefficient.\n *\n * The constant and the cells of the other row will be\n * multiplied by the coefficient and added to this row. Any\n * cell with a resulting coefficient of zero will be removed\n * from the row.\n */\n insertRow(other, coefficient = 1.0) {\n this._constant += other._constant * coefficient;\n let cells = other._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n this.insertSymbol(pair.first, pair.second * coefficient);\n }\n }\n /**\n * Remove a symbol from the row.\n */\n removeSymbol(symbol) {\n this._cellMap.erase(symbol);\n }\n /**\n * Reverse the sign of the constant and cells in the row.\n */\n reverseSign() {\n this._constant = -this._constant;\n let cells = this._cellMap;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n let pair = cells.itemAt(i);\n pair.second = -pair.second;\n }\n }\n /**\n * Solve the row for the given symbol.\n *\n * This method assumes the row is of the form\n * a * x + b * y + c = 0 and (assuming solve for x) will modify\n * the row to represent the right hand side of\n * x = -b/a * y - c / a. The target symbol will be removed from\n * the row, and the constant and other cells will be multiplied\n * by the negative inverse of the target coefficient.\n *\n * The given symbol *must* exist in the row.\n */\n solveFor(symbol) {\n let cells = this._cellMap;\n let pair = cells.erase(symbol);\n let coeff = -1.0 / pair.second;\n this._constant *= coeff;\n for (let i = 0, n = cells.size(); i < n; ++i) {\n cells.itemAt(i).second *= coeff;\n }\n }\n /**\n * Solve the row for the given symbols.\n *\n * This method assumes the row is of the form\n * x = b * y + c and will solve the row such that\n * y = x / b - c / b. The rhs symbol will be removed from the\n * row, the lhs added, and the result divided by the negative\n * inverse of the rhs coefficient.\n *\n * The lhs symbol *must not* exist in the row, and the rhs\n * symbol must* exist in the row.\n */\n solveForEx(lhs, rhs) {\n this.insertSymbol(lhs, -1.0);\n this.solveFor(rhs);\n }\n /**\n * Returns the coefficient for the given symbol.\n */\n coefficientFor(symbol) {\n let pair = this._cellMap.find(symbol);\n return pair !== undefined ? pair.second : 0.0;\n }\n /**\n * Substitute a symbol with the data from another row.\n *\n * Given a row of the form a * x + b and a substitution of the\n * form x = 3 * y + c the row will be updated to reflect the\n * expression 3 * a * y + a * c + b.\n *\n * If the symbol does not exist in the row, this is a no-op.\n */\n substitute(symbol, row) {\n let pair = this._cellMap.erase(symbol);\n if (pair !== undefined) {\n this.insertRow(row, pair.second);\n }\n }\n _cellMap = createMap();\n _constant;\n}\n","import { Strength } from \"@lume/kiwi\";\n\n/** High priority value for constraint solver strength calculations. */\nconst HIGH_PRIORITY = 1000;\n/** Medium priority value for constraint solver strength calculations. */\nconst MEDIUM_PRIORITY = 100;\n/** Low priority value for constraint solver strength calculations. */\nconst LOW_PRIORITY = 10;\n\n/**\n * Priority levels for UI layout constraints and variables.\n *\n * UIPriority defines a hierarchical system of priority levels used by the\n * constraint solver to determine which constraints should take precedence\n * when conflicts arise. Lower numeric values represent higher priority,\n * with P0 being the highest priority and P7 being the lowest.\n *\n * The priority system maps to Kiwi solver strength values with different\n * strength components (required, strong, medium, weak) to create a nuanced\n * priority hierarchy for layout solving.\n *\n * @see {@link convertPriority} - Converts to Kiwi solver strength values\n */\nexport enum UIPriority {\n /** Highest priority - required constraints that must be satisfied. */\n P0 = 0,\n /** High priority - strong constraints with medium strength. */\n P1 = 1,\n /** Medium-high priority - strong constraints with low strength. */\n P2 = 2,\n /** Medium priority - medium strength constraints. */\n P3 = 3,\n /** Medium-low priority - medium strength constraints with low weight. */\n P4 = 4,\n /** Low priority - weak strength constraints with medium weight. */\n P5 = 5,\n /** Very low priority - weak strength constraints with low weight. */\n P6 = 6,\n /** Lowest priority - weak strength constraints with minimal weight. */\n P7 = 7,\n}\n\n/**\n * Converts UIPriority enum values to Kiwi solver strength values.\n *\n * This function maps the UI priority levels to the three-component strength\n * system used by the Kiwi constraint solver (required, strong, medium, weak).\n * Higher priority levels get stronger constraint strength values.\n *\n * @param priority - The UI priority level to convert\n * @returns The corresponding Kiwi solver strength value\n * @throws Will throw an error if an invalid priority is provided\n * @see {@link UIPriority} - Priority level definitions\n */\nexport function convertPriority(priority: UIPriority): number {\n switch (priority) {\n case UIPriority.P0:\n return Strength.create(HIGH_PRIORITY, HIGH_PRIORITY, HIGH_PRIORITY);\n case UIPriority.P1:\n return Strength.create(MEDIUM_PRIORITY, 0, 0);\n case UIPriority.P2:\n return Strength.create(LOW_PRIORITY, 0, 0);\n case UIPriority.P3:\n return Strength.create(0, MEDIUM_PRIORITY, 0);\n case UIPriority.P4:\n return Strength.create(0, LOW_PRIORITY, 0);\n case UIPriority.P5:\n return Strength.create(0, 0, MEDIUM_PRIORITY);\n case UIPriority.P6:\n return Strength.create(0, 0, LOW_PRIORITY);\n case UIPriority.P7:\n return Strength.create(0, 0, 1);\n default:\n throw new Error(`Invalid priority: ${priority}`);\n }\n}\n\n/**\n * Resolves an optional priority value to a concrete UIPriority.\n *\n * If no priority is provided, returns the default highest priority (P0).\n * This function is commonly used in constraint creation where priority\n * is an optional parameter.\n *\n * @param priority - The optional priority value to resolve\n * @returns The resolved priority, defaulting to P0 if undefined\n */\nexport function resolvePriority(priority?: UIPriority): UIPriority {\n return priority ?? UIPriority.P0;\n}\n","import type { Object3D, WebGLRenderer } from \"three\";\nimport { OrthographicCamera, Scene } from \"three\";\nimport type { UIElement } from \"../elements/UIElement\";\n\nexport class UISceneWrapper {\n private readonly scene = new Scene();\n private readonly camera: OrthographicCamera;\n private readonly elements = new Map<UIElement, Object3D>();\n\n constructor(w: number, h: number) {\n this.camera = new OrthographicCamera(0, w, h, 0, -1, 1);\n }\n\n public insertObject(element: UIElement, object: Object3D): void {\n if (this.elements.has(element)) {\n throw new Error(\"Element already exists\");\n }\n this.elements.set(element, object);\n this.scene.add(object);\n }\n\n public replaceObject(element: UIElement, object: Object3D): void {\n const oldObject = this.elements.get(element);\n if (oldObject === undefined) {\n throw new Error(\"Element not found\");\n }\n\n this.scene.remove(oldObject);\n this.scene.add(object);\n this.elements.set(element, object);\n }\n\n public removeObject(element: UIElement): void {\n const object = this.elements.get(element);\n if (object === undefined) {\n throw new Error(\"Element not found\");\n }\n\n this.scene.remove(object);\n this.elements.delete(element);\n }\n\n public resize(w: number, h: number): void {\n this.camera.right = w;\n this.camera.top = h;\n this.camera.updateProjectionMatrix();\n }\n\n public getVisibility(element: UIElement): boolean {\n const object = this.elements.get(element);\n if (object === undefined) {\n throw new Error(\"Element not found\");\n }\n\n return object.visible;\n }\n\n public getZIndex(element: UIElement): number {\n const object = this.elements.get(element);\n if (object === undefined) {\n throw new Error(\"Element not found\");\n }\n\n return object.renderOrder;\n }\n\n public setZIndex(element: UIElement, zIndex: number): void {\n const object = this.elements.get(element);\n if (object === undefined) {\n throw new Error(\"Element not found\");\n }\n\n object.renderOrder = zIndex;\n }\n\n public setVisibility(element: UIElement, visible: boolean): void {\n const object = this.elements.get(element);\n if (object === undefined) {\n throw new Error(\"Element not found\");\n }\n\n object.visible = visible;\n }\n\n public getSortedVisibleElements(): UIElement[] {\n return Array.from(this.elements.keys()).sort(\n (a, b) => this.getZIndex(a) - this.getZIndex(b),\n );\n }\n\n public render(renderer: WebGLRenderer, deltaTime: number): void {\n for (const [element, object] of this.elements) {\n const micro = element.micro;\n const cos = Math.cos(micro.rotation);\n const sin = Math.sin(micro.rotation);\n const width = element.width * micro.scaleX;\n const height = element.height * micro.scaleY;\n const anchorOffsetX = micro.anchorX * width;\n const anchorOffsetY = micro.anchorY * height;\n const rotatedAnchorX = anchorOffsetX * cos - anchorOffsetY * sin;\n const rotatedAnchorY = anchorOffsetX * sin + anchorOffsetY * cos;\n\n object.position.x = element.x + micro.x - rotatedAnchorX;\n object.position.y = element.y + micro.y - rotatedAnchorY;\n object.scale.x = width;\n object.scale.y = height;\n object.rotation.z = micro.rotation;\n element[\"onBeforeRenderInternal\"](renderer, deltaTime);\n }\n renderer.render(this.scene, this.camera);\n }\n}\n","import { Operator } from \"@lume/kiwi\";\n\n/**\n * Relational operators for UI layout constraints.\n *\n * UIRelation defines the mathematical relationship between the left-hand\n * and right-hand sides of constraint equations. These relations are used\n * by the constraint solver to determine how expressions should be compared\n * when solving layout constraints.\n *\n * @see {@link convertRelation} - Converts to Kiwi solver operators\n */\nexport enum UIRelation {\n /** Equality relation: left-hand side equals right-hand side. */\n EQUAL = 0,\n /** Less than or equal relation: left-hand side ≤ right-hand side. */\n LESS_THAN = 1,\n /** Greater than or equal relation: left-hand side ≥ right-hand side. */\n GREATER_THAN = 2,\n}\n\n/**\n * Converts UIRelation enum values to Kiwi solver operator values.\n *\n * This function maps the UI relation types to the corresponding operators\n * used by the Kiwi constraint solver for mathematical comparisons in\n * constraint equations.\n *\n * @param relation - The UI relation type to convert\n * @returns The corresponding Kiwi solver operator\n * @throws Will throw an error if an invalid relation is provided\n * @see {@link UIRelation} - Relation type definitions\n */\nexport function convertRelation(relation: UIRelation): Operator {\n switch (relation) {\n case UIRelation.EQUAL:\n return Operator.Eq;\n case UIRelation.LESS_THAN:\n return Operator.Le;\n case UIRelation.GREATER_THAN:\n return Operator.Ge;\n default:\n throw new Error(`Invalid relation: ${relation}`);\n }\n}\n\n/**\n * Resolves an optional relation value to a concrete UIRelation.\n *\n * If no relation is provided, returns the default equality relation.\n * This function is commonly used in constraint creation where relation\n * is an optional parameter.\n *\n * @param relation - The optional relation value to resolve\n * @returns The resolved relation, defaulting to EQUAL if undefined\n */\nexport function resolveRelation(relation?: UIRelation): UIRelation {\n return relation ?? UIRelation.EQUAL;\n}\n","import { Constraint, Expression, Solver, Variable } from \"@lume/kiwi\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport { convertPriority, UIPriority } from \"../miscellaneous/UIPriority\";\nimport { convertRelation, UIRelation } from \"../miscellaneous/UIRelation\";\n\ninterface VariableDescription {\n variable: Variable;\n priority: UIPriority;\n value: number;\n constraint?: Constraint;\n}\n\ninterface ConstraintDescription {\n constraint: Constraint;\n lhs: UIExpression;\n rhs: UIExpression;\n priority: UIPriority;\n relation: UIRelation;\n enabled: boolean;\n}\n\nexport class UISolverWrapper {\n private solver = new Solver();\n private recalculationRequired = false;\n\n private readonly variables = new Map<number, VariableDescription>();\n private lastVariableIndex = 0;\n\n private readonly constraints = new Map<number, ConstraintDescription>();\n private lastConstraintIndex = 0;\n\n public createVariable(value: number, priority: UIPriority): number {\n const index = this.lastVariableIndex++;\n const variable = new Variable();\n\n if (priority === UIPriority.P0) {\n const description: VariableDescription = { variable, priority, value };\n this.variables.set(index, description);\n description.constraint = this.buildConstraint(\n new UIExpression(0, [[index, 1]]),\n new UIExpression(value),\n UIRelation.EQUAL,\n priority,\n );\n this.solver.addConstraint(description.constraint);\n } else {\n this.variables.set(index, { variable, priority, value });\n this.solver.addEditVariable(variable, convertPriority(priority));\n this.solver.suggestValue(variable, value);\n }\n this.recalculationRequired = true;\n return index;\n }\n\n public removeVariable(index: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n throw new Error(`Variable ${index} is used in constraint`);\n }\n }\n\n description.constraint\n ? this.solver.removeConstraint(description.constraint)\n : this.solver.removeEditVariable(description.variable);\n\n this.variables.delete(index);\n this.recalculationRequired = true;\n }\n\n public suggestVariableValue(index: number, value: number): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (description.value !== value) {\n description.value = value;\n\n if (description.constraint) {\n description.constraint = this.rebuildRawConstraint(\n description.constraint,\n new UIExpression().plus(index, 1),\n new UIExpression(description.value),\n UIRelation.EQUAL,\n description.priority,\n );\n } else {\n this.solver.suggestValue(description.variable, value);\n }\n\n this.recalculationRequired = true;\n }\n }\n\n public setVariablePriority(index: number, priority: UIPriority): void {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (priority !== description.priority) {\n description.priority = priority;\n\n if (description.constraint) {\n description.constraint = this.rebuildRawConstraint(\n description.constraint,\n new UIExpression().plus(index, 1),\n new UIExpression(description.value),\n UIRelation.EQUAL,\n description.priority,\n );\n } else {\n this.rebuildVariable(index, description);\n }\n\n this.recalculationRequired = true;\n }\n }\n\n public readVariableValue(index: number): number {\n const description = this.variables.get(index);\n if (description === undefined) {\n throw new Error(`Variable ${index} does not exist`);\n }\n\n if (this.recalculationRequired) {\n this.solver.updateVariables();\n this.recalculationRequired = false;\n }\n\n return description.variable.value();\n }\n\n public createConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n enabled: boolean,\n ): number {\n const index = this.lastConstraintIndex++;\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n this.constraints.set(index, {\n constraint,\n lhs: lhs.clone(),\n rhs: rhs.clone(),\n priority,\n relation,\n enabled,\n });\n this.solver.addConstraint(constraint);\n this.recalculationRequired = true;\n return index;\n }\n\n public removeConstraint(index: number): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n this.solver.removeConstraint(description.constraint);\n this.constraints.delete(index);\n this.recalculationRequired = true;\n }\n\n public setConstraintLHS(index: number, lhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.lhs.copy(lhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n public setConstraintRHS(index: number, rhs: UIExpression): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.rhs.copy(rhs);\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n public setConstraintRelation(index: number, relation: UIRelation): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.relation = relation;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n public setConstraintPriority(index: number, priority: UIPriority): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n description.priority = priority;\n this.rebuildConstraintByDescription(description);\n this.recalculationRequired = true;\n }\n\n public setConstraintEnabled(index: number, enabled: boolean): void {\n const description = this.constraints.get(index);\n if (description === undefined) {\n throw new Error(`Constraint ${index} does not exist`);\n }\n\n if (enabled !== description.enabled) {\n description.enabled = enabled;\n try {\n description.enabled\n ? this.solver.addConstraint(description.constraint)\n : this.solver.removeConstraint(description.constraint);\n } catch {\n this.rebuildSolver();\n }\n this.recalculationRequired = true;\n }\n }\n\n private convertExpression(expression: UIExpression): Expression {\n return new Expression(\n ...expression[\"prepareTermsInternal\"]().map(\n ([variableIndex, coefficient]): [number, Variable] => {\n const variable = this.variables.get(variableIndex);\n if (variable === undefined) {\n throw new Error(`Variable ${variableIndex} does not exist`);\n }\n return [coefficient, variable.variable];\n },\n ),\n expression.constant,\n );\n }\n\n private rebuildVariable(\n index: number,\n description: VariableDescription,\n ): void {\n let rebuildRequired = false;\n const dependConstraints: ConstraintDescription[] = [];\n\n for (const cDescription of this.constraints.values()) {\n if (cDescription.lhs.hasTerm(index) || cDescription.rhs.hasTerm(index)) {\n if (!rebuildRequired) {\n try {\n this.solver.removeConstraint(cDescription.constraint);\n } catch {\n rebuildRequired = true;\n }\n }\n dependConstraints.push(cDescription);\n }\n }\n\n this.solver.removeEditVariable(description.variable);\n this.solver.addEditVariable(\n description.variable,\n convertPriority(description.priority),\n );\n\n for (const cDescription of dependConstraints) {\n cDescription.constraint = new Constraint(\n this.convertExpression(cDescription.lhs),\n convertRelation(cDescription.relation),\n this.convertExpression(cDescription.rhs),\n convertPriority(cDescription.priority),\n );\n }\n\n if (!rebuildRequired) {\n for (const cDescription of dependConstraints) {\n try {\n this.solver.addConstraint(cDescription.constraint);\n } catch {\n rebuildRequired = true;\n break;\n }\n }\n }\n\n if (rebuildRequired) {\n this.rebuildSolver();\n }\n }\n\n private rebuildConstraintByDescription(\n description: ConstraintDescription,\n ): void {\n description.constraint = description.enabled\n ? this.rebuildRawConstraint(\n description.constraint,\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n )\n : this.buildConstraint(\n description.lhs,\n description.rhs,\n description.relation,\n description.priority,\n );\n }\n\n private rebuildRawConstraint(\n oldConstraint: Constraint,\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n let isSolverCrashed = false;\n\n try {\n this.solver.removeConstraint(oldConstraint);\n } catch {\n isSolverCrashed = true;\n }\n\n const constraint = this.buildConstraint(lhs, rhs, relation, priority);\n\n if (!isSolverCrashed) {\n try {\n this.solver.addConstraint(constraint);\n } catch {\n isSolverCrashed = true;\n }\n }\n\n if (isSolverCrashed) {\n this.rebuildSolver();\n }\n\n return constraint;\n }\n\n private buildConstraint(\n lhs: UIExpression,\n rhs: UIExpression,\n relation: UIRelation,\n priority: UIPriority,\n ): Constraint {\n return new Constraint(\n this.convertExpression(lhs),\n convertRelation(relation),\n this.convertExpression(rhs),\n convertPriority(priority),\n );\n }\n\n private rebuildSolver(): void {\n this.solver = new Solver();\n\n for (const description of this.variables.values()) {\n this.solver.addEditVariable(description.variable, description.priority);\n this.solver.suggestValue(description.variable, description.value);\n }\n\n for (const description of this.constraints.values()) {\n this.solver.addConstraint(description.constraint);\n }\n }\n}\n","import { Eventail } from \"eventail\";\nimport type { WebGLRenderer } from \"three\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UISceneWrapper } from \"../wrappers/UISceneWrapper\";\nimport { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Events that can be emitted by UI layers.\n */\nexport enum UILayerEvent {\n /** Emitted when the layer's orientation changes between horizontal and vertical. */\n ORIENTATION_CHANGE = \"orientation_change\",\n /** Emitted when the layer's visibility/interaction mode changes. */\n MODE_CHANGE = \"mode_change\",\n}\n\n/**\n * Abstract base class for UI layout containers with constraint solving and rendering.\n *\n * UILayer serves as the fundamental container for UI elements, providing constraint-based\n * layout solving, 3D scene management, and event handling. It manages the layer's\n * dimensions through solver variables, handles orientation changes, and coordinates\n * rendering and interaction for all contained elements.\n *\n * Each layer maintains its own constraint solver and scene graph, allowing for\n * independent layout calculation and rendering optimization.\n *\n * @see {@link UIElement} - Elements contained within layers\n * @see {@link UISolverWrapper} - Constraint solving system\n * @see {@link UISceneWrapper} - 3D scene management\n * @see {@link UIOrientation} - Layer orientation states\n */\nexport abstract class UILayer extends Eventail {\n /** Optional name identifier for the layer. */\n public name = \"\";\n\n /**\n * Solver variable descriptor for the x-coordinate position.\n * This variable is managed by the constraint solver system.\n */\n public readonly xVariable: number;\n\n /**\n * Solver variable descriptor for the y-coordinate position.\n * This variable is managed by the constraint solver system.\n */\n public readonly yVariable: number;\n\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /**\n * Constraint solver wrapper for managing layout calculations.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper = new UISolverWrapper();\n\n /**\n * 3D scene wrapper for managing rendering and element hierarchy.\n * @see {@link UISceneWrapper}\n */\n protected readonly sceneWrapper: UISceneWrapper;\n\n /** Internal storage for the current visibility/interaction mode. */\n protected modeInternal: UIMode = UIMode.VISIBLE;\n\n /** Internal storage for the current orientation state. */\n protected orientationInternal: UIOrientation;\n\n /**\n * Creates a new UILayer instance with specified dimensions.\n *\n * Initializes the constraint solver with position and dimension variables,\n * sets up the 3D scene wrapper, and determines the initial orientation\n * based on the width-to-height ratio.\n *\n * @param w - Initial width of the layer\n * @param h - Initial height of the layer\n */\n constructor(w: number, h: number) {\n super();\n this.sceneWrapper = new UISceneWrapper(w, h);\n this.xVariable = this.solverWrapper.createVariable(0, UIPriority.P0);\n this.yVariable = this.solverWrapper.createVariable(0, UIPriority.P0);\n this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P0);\n this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P0);\n this.orientationInternal =\n w > h ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n }\n\n /**\n * Gets the current width value from the constraint solver.\n * @returns The current layer width in pixels\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the constraint solver.\n * @returns The current layer height in pixels\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Gets the current visibility and interaction mode.\n * @returns The current UIMode setting\n * @see {@link UIMode}\n */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /**\n * Gets the current orientation state.\n * @returns The current orientation (horizontal or vertical)\n * @see {@link UIOrientation}\n */\n public get orientation(): UIOrientation {\n return this.orientationInternal;\n }\n\n /**\n * Sets the visibility and interaction mode and emits change event.\n * @param value - The new UIMode setting\n * @see {@link UIMode}\n */\n public set mode(value: UIMode) {\n if (value !== this.modeInternal) {\n this.modeInternal = value;\n this.emit(UILayerEvent.MODE_CHANGE, this.modeInternal, this);\n }\n }\n\n /**\n * Internal method for resizing the layer and updating orientation.\n *\n * Updates the solver variables for width and height, resizes the scene wrapper,\n * and determines if the orientation has changed based on the new dimensions.\n * Emits an orientation change event if the orientation has changed.\n *\n * @param width - The new layer width\n * @param height - The new layer height\n * @protected\n */\n protected resizeInternal(width: number, height: number): void {\n this.solverWrapper.suggestVariableValue(this.wVariable, width);\n this.solverWrapper.suggestVariableValue(this.hVariable, height);\n this.sceneWrapper.resize(width, height);\n\n const orientation =\n width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;\n\n if (orientation !== this.orientationInternal) {\n this.orientationInternal = orientation;\n this.emit(\n UILayerEvent.ORIENTATION_CHANGE,\n this.orientationInternal,\n this,\n );\n }\n }\n\n /**\n * Internal method for rendering the layer and its elements.\n *\n * Delegates rendering to the scene wrapper if the layer is not hidden.\n * This method is called during the rendering loop to update and draw\n * all elements contained within the layer.\n *\n * @param renderer - The WebGL renderer instance\n * @param deltaTime - Time elapsed since the last frame in seconds\n * @protected\n */\n protected renderInternal(renderer: WebGLRenderer, deltaTime: number): void {\n if (this.mode !== UIMode.HIDDEN) {\n this.sceneWrapper.render(renderer, deltaTime);\n }\n }\n\n /**\n * Internal method for handling click events on the layer.\n *\n * Processes click events by testing elements in reverse z-order (top to bottom)\n * until one handles the click. Only processes clicks when the layer is in\n * interactive mode.\n *\n * @param x - The x-coordinate of the click\n * @param y - The y-coordinate of the click\n * @protected\n */\n protected clickInternal(x: number, y: number): void {\n if (this.mode === UIMode.INTERACTIVE) {\n for (const element of this.sceneWrapper.getSortedVisibleElements()) {\n if (element[\"onClickInternal\"](x, y)) {\n return;\n }\n }\n }\n }\n\n /**\n * Internal method for accessing the constraint solver wrapper.\n *\n * Provides access to the layer's constraint solver for elements and\n * constraints that need to create variables or constraints.\n *\n * @returns The constraint solver wrapper instance\n * @internal\n */\n protected [\"getSolverWrapperInternal\"](): UISolverWrapper {\n return this.solverWrapper;\n }\n\n /**\n * Internal method for accessing the 3D scene wrapper.\n *\n * Provides access to the layer's scene management system for elements\n * that need to be added to or removed from the 3D scene.\n *\n * @returns The scene wrapper instance\n * @internal\n */\n protected [\"getSceneWrapperInternal\"](): UISceneWrapper {\n return this.sceneWrapper;\n }\n}\n","import { type UILayer } from \"../layers/UILayer\";\n\nimport type { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Abstract base class for all UI layout constraints.\n *\n * UIConstraint serves as the fundamental building block for the constraint-based\n * layout system. It provides access to the solver wrapper for creating and\n * managing constraint relationships between UI elements. All concrete constraint\n * implementations must extend this class to participate in the layout solving process.\n *\n * @see {@link UILayer} - Container layer for constraints\n * @see {@link UISolverWrapper} - Constraint solver integration\n */\nexport abstract class UIConstraint {\n /** Optional name identifier for the constraint. */\n public name = \"\";\n\n /**\n * Reference to the constraint solver wrapper for managing solver operations.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper: UISolverWrapper;\n\n /**\n * Creates a new UIConstraint instance.\n *\n * @param layer - The UI layer that contains this constraint\n */\n constructor(public readonly layer: UILayer) {\n this.solverWrapper = this.layer[\"getSolverWrapperInternal\"]();\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport { UILayerEvent } from \"../layers/UILayer\";\nimport {\n resolveOrientation,\n UIOrientation,\n} from \"../miscellaneous/UIOrientation\";\nimport { resolvePriority, type UIPriority } from \"../miscellaneous/UIPriority\";\nimport { resolveRelation, type UIRelation } from \"../miscellaneous/UIRelation\";\nimport { UIConstraint } from \"./UIConstraint\";\n\n/**\n * Configuration options for UISingleParameterConstraint creation.\n */\nexport interface UISingleParameterConstraintOptions {\n /** Priority level for the constraint in the solver hierarchy. */\n priority: UIPriority;\n /** Mathematical relation type for the constraint equation. */\n relation: UIRelation;\n /** Orientation context for when the constraint should be active. */\n orientation: UIOrientation;\n}\n\n/**\n * Abstract base class for constraints that operate with configurable parameters.\n *\n * UISingleParameterConstraint extends UIConstraint with common functionality\n * for constraints that need priority, relation, and orientation configuration.\n * It provides automatic orientation-based enabling/disabling of constraints\n * and manages the lifecycle of solver constraint descriptors.\n *\n * @see {@link UIConstraint} - Base constraint class\n * @see {@link UIPriority} - Priority level configuration\n * @see {@link UIRelation} - Mathematical relation types\n * @see {@link UIOrientation} - Orientation-based activation\n */\nexport abstract class UISingleParameterConstraint extends UIConstraint {\n /** Internal storage for the constraint priority level. */\n protected priorityInternal: UIPriority;\n /** Internal storage for the constraint relation type. */\n protected relationInternal: UIRelation;\n /** Internal storage for the constraint orientation setting. */\n protected orientationInternal: UIOrientation;\n\n /** The constraint descriptor managed by the solver system. */\n protected abstract readonly constraint: number;\n\n /**\n * Creates a new UISingleParameterConstraint instance.\n *\n * Initializes the constraint with resolved default values and sets up\n * orientation change event handling for dynamic constraint activation.\n *\n * @param layer - The UI layer that contains this constraint\n * @param priority - Optional priority level (defaults to P0)\n * @param relation - Optional relation type (defaults to EQUAL)\n * @param orientation - Optional orientation setting (defaults to ALWAYS)\n */\n constructor(\n layer: UILayer,\n priority?: UIPriority,\n relation?: UIRelation,\n orientation?: UIOrientation,\n ) {\n super(layer);\n this.priorityInternal = resolvePriority(priority);\n this.relationInternal = resolveRelation(relation);\n this.orientationInternal = resolveOrientation(orientation);\n this.layer.on(UILayerEvent.ORIENTATION_CHANGE, this.onOrientationChange);\n }\n\n /**\n * Gets the current priority level of the constraint.\n * @returns The constraint priority level\n */\n public get priority(): UIPriority {\n return this.priorityInternal;\n }\n\n /**\n * Gets the current mathematical relation type of the constraint.\n * @returns The constraint relation type\n */\n public get relation(): UIRelation {\n return this.relationInternal;\n }\n\n /**\n * Gets the current orientation setting of the constraint.\n * @returns The constraint orientation setting\n */\n public get orientation(): UIOrientation {\n return this.orientationInternal;\n }\n\n /**\n * Sets a new priority level for the constraint.\n * @param value - The new priority level\n */\n public set priority(value: UIPriority) {\n if (value !== this.priorityInternal) {\n this.priorityInternal = value;\n this.solverWrapper.setConstraintPriority(\n this.constraint,\n this.priorityInternal,\n );\n }\n }\n\n /**\n * Sets a new mathematical relation type for the constraint.\n * @param value - The new relation type\n */\n public set relation(value: UIRelation) {\n if (value !== this.relationInternal) {\n this.relationInternal = value;\n this.solverWrapper.setConstraintRelation(\n this.constraint,\n this.relationInternal,\n );\n }\n }\n\n /**\n * Sets a new orientation setting for the constraint.\n * @param value - The new orientation setting\n */\n public set orientation(value: UIOrientation) {\n if (value !== this.orientationInternal) {\n this.orientationInternal = value;\n this.onOrientationChange();\n }\n }\n\n /**\n * Destroys the constraint by cleaning up event listeners and solver resources.\n *\n * This method removes the orientation change event listener and removes\n * the constraint from the solver system. After calling this method,\n * the constraint should not be used anymore.\n */\n public destroy(): void {\n this.layer.off(UILayerEvent.ORIENTATION_CHANGE, this.onOrientationChange);\n this.solverWrapper.removeConstraint(this.constraint);\n }\n\n /**\n * Determines if the constraint should be enabled based on orientation.\n *\n * The constraint is enabled if its orientation is set to ALWAYS or if\n * it matches the current layer orientation.\n *\n * @returns True if the constraint should be enabled, false otherwise\n * @protected\n */\n protected isConstraintEnabled(): boolean {\n return (\n this.orientationInternal === UIOrientation.ALWAYS ||\n this.orientationInternal === this.layer.orientation\n );\n }\n\n /**\n * Event handler for layer orientation changes.\n *\n * Updates the constraint's enabled state in the solver based on the\n * current orientation and the constraint's orientation setting.\n *\n * @private\n */\n private readonly onOrientationChange = (): void => {\n this.solverWrapper.setConstraintEnabled(\n this.constraint,\n this.isConstraintEnabled(),\n );\n };\n}\n","import type { UIElement } from \"../elements/UIElement\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIHeightConstraint creation.\n */\nexport interface UIHeightConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired height value for the element. */\n height: number;\n}\n\n/**\n * Constraint that enforces a specific height value for UI elements.\n *\n * UIHeightConstraint creates a mathematical relationship that fixes an element's\n * height to a constant value. The constraint equation is: element.height = height.\n * This is useful for ensuring elements maintain a specific height regardless of\n * other layout changes or for setting fixed dimensions in responsive layouts.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIElement} - Elements that can have height constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHeightConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current height value. */\n private heightInternal: number;\n\n /**\n * Creates a new UIHeightConstraint instance.\n *\n * If no height is specified in options, the constraint will use the\n * element's current height as the target height value.\n *\n * @param element - The UI element to apply the height constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIElement,\n options: Partial<UIHeightConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.heightInternal = options.height ?? element.height;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.hVariable, 1]]),\n new UIExpression(this.heightInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current height value being enforced.\n * @returns The height value in pixels\n */\n public get height(): number {\n return this.heightInternal;\n }\n\n /**\n * Sets a new height value and updates the constraint equation.\n * @param value - The new height value in pixels\n */\n public set height(value: number) {\n if (this.heightInternal !== value) {\n this.heightInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import { UILayer } from \"../layers/UILayer\";\n\n/** Small epsilon value for floating-point comparisons and minimum positive number validation. */\nexport const EPSILON = 1e-6;\n\n/**\n * Interface for objects that belong to a UI layer.\n *\n * Elements implementing this interface are associated with a specific layer\n * for constraint solving and rendering management.\n */\nexport interface UILayerElement {\n /** The UI layer that contains this element. */\n layer: UILayer;\n}\n\n/**\n * Interface for UI elements that have a position in 2D space.\n *\n * Point elements are characterized by x and y coordinates represented\n * as solver variable descriptors for constraint-based positioning.\n */\nexport interface UIPointElement {\n /** Solver variable descriptor for the x-coordinate. */\n xVariable: number;\n /** Solver variable descriptor for the y-coordinate. */\n yVariable: number;\n}\n\n/**\n * Interface for UI elements that have both position and dimensions in 2D space.\n *\n * Plane elements extend point elements with width and height properties,\n * enabling rectangular area constraints and positioning.\n */\nexport interface UIPlaneElement extends UIPointElement {\n /** Solver variable descriptor for the width dimension. */\n wVariable: number;\n /** Solver variable descriptor for the height dimension. */\n hVariable: number;\n}\n\n/**\n * Type guard to check if an object implements the UILayerElement interface.\n *\n * @param obj - The object to check\n * @returns True if the object has a valid layer property, false otherwise\n */\nexport function isUILayerElement(obj: unknown): obj is UILayerElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"layer\" in obj &&\n obj.layer instanceof UILayer\n );\n}\n\n/**\n * Type guard to check if an object implements the UIPointElement interface.\n *\n * @param obj - The object to check\n * @returns True if the object has valid xVariable and yVariable properties, false otherwise\n */\nexport function isUIPointElement(obj: unknown): obj is UIPointElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"xVariable\" in obj &&\n typeof obj.xVariable === \"number\" &&\n \"yVariable\" in obj &&\n typeof obj.yVariable === \"number\"\n );\n}\n\n/**\n * Type guard to check if an object implements the UIPlaneElement interface.\n *\n * Note: This function only checks for width and height variables. Objects\n * should also satisfy UIPointElement requirements for complete validation.\n *\n * @param obj - The object to check\n * @returns True if the object has valid wVariable and hVariable properties, false otherwise\n */\nexport function isUIPlaneElement(obj: unknown): obj is UIPlaneElement {\n return (\n typeof obj === \"object\" &&\n obj !== null &&\n \"wVariable\" in obj &&\n typeof obj.wVariable === \"number\" &&\n \"hVariable\" in obj &&\n typeof obj.hVariable === \"number\"\n );\n}\n\n/**\n * Validates that two objects are valid constraint subjects from the same layer.\n *\n * Ensures that both objects are either UILayer instances or UILayerElement instances,\n * that they are not both layers (which cannot be constrained to each other),\n * and that they belong to the same layer for constraint solving.\n *\n * @param a - The first constraint subject\n * @param b - The second constraint subject\n * @param subject - The name of the constraint for error messages\n * @returns The common layer that both subjects belong to\n * @throws Will throw an error if subjects are invalid or from different layers\n */\nexport function assertValidConstraintSubjects(\n a: unknown,\n b: unknown,\n subject: string,\n): UILayer {\n if (a instanceof UILayer && b instanceof UILayer) {\n throw new Error(`${subject}: layer cannot be snapped to another layer`);\n }\n\n let layerA: UILayer;\n let layerB: UILayer;\n\n if (a instanceof UILayer || isUILayerElement(a)) {\n layerA = a instanceof UILayer ? a : a.layer;\n } else {\n throw new Error(`${subject}: A must be a UILayer or a UIPointElement`);\n }\n\n if (b instanceof UILayer || isUILayerElement(b)) {\n layerB = b instanceof UILayer ? b : b.layer;\n } else {\n throw new Error(`${subject}: B must be a UILayer or a UIPointElement`);\n }\n\n if (layerA !== layerB) {\n throw new Error(`${subject}: elements must be on the same layer`);\n }\n\n return layerA;\n}\n\n/**\n * Validates that a value is a finite number within safe integer range.\n *\n * Checks that the value is finite (not NaN, Infinity, or -Infinity) and\n * within the safe integer range for reliable mathematical operations.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is not finite or exceeds safe range\n */\nexport function assertValidNumber(value: number, subject: string): void {\n if (!Number.isFinite(value)) {\n throw new Error(`${subject}: value must be a finite number`);\n }\n\n if (Math.abs(value) > Number.MAX_SAFE_INTEGER) {\n throw new Error(`${subject}: value exceeds maximum safe integer range`);\n }\n}\n\n/**\n * Validates that a value is a positive number above the epsilon threshold.\n *\n * First validates that the value is a finite number, then ensures it is\n * greater than or equal to EPSILON to avoid numerical precision issues\n * with very small positive values.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is invalid or not sufficiently positive\n * @see {@link assertValidNumber}\n */\nexport function assertValidPositiveNumber(\n value: number,\n subject: string,\n): void {\n assertValidNumber(value, subject);\n\n if (value < EPSILON) {\n throw new Error(\n `${subject}: value must be greater than or equal to ${EPSILON}`,\n );\n }\n}\n\n/**\n * Validates that a value is a non-negative number (including zero).\n *\n * First validates that the value is a finite number, then ensures it is\n * greater than or equal to zero. Unlike assertValidPositiveNumber, this\n * function allows zero as a valid value.\n *\n * @param value - The number to validate\n * @param subject - The name of the value for error messages\n * @throws Will throw an error if the value is invalid or negative\n * @see {@link assertValidNumber}\n */\nexport function assertValidNonNegativeNumber(\n value: number,\n subject: string,\n): void {\n assertValidNumber(value, subject);\n if (value < 0) {\n throw new Error(`${subject}: value must be greater than or equal to 0`);\n }\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Default anchor point (0.5 = center) for elements when not specified. */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for UIHorizontalDistanceConstraint creation.\n */\nexport interface UIHorizontalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor point for element A (0.0 = left edge, 0.5 = center, 1.0 = right edge). */\n anchorA: number;\n /** Anchor point for element B (0.0 = left edge, 0.5 = center, 1.0 = right edge). */\n anchorB: number;\n /** The desired horizontal distance between the elements. */\n distance: number;\n}\n\n/**\n * Constraint that enforces horizontal distance between two UI elements.\n *\n * UIHorizontalDistanceConstraint creates a mathematical relationship that maintains\n * a specific horizontal distance between two elements using configurable anchor points.\n * For plane elements, anchors determine the reference point (0.0 = left, 0.5 = center, 1.0 = right).\n * For point elements, the anchor is always the element's position. The constraint equation is:\n * (elementB.x + elementB.width * anchorB) - (elementA.x + elementA.width * anchorA) = distance\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPointElement} - Point elements that can be constrained\n * @see {@link UIPlaneElement} - Plane elements that can be constrained\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHorizontalDistanceConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for element A's anchor point. */\n private anchorAInternal: number;\n /** Internal storage for element B's anchor point. */\n private anchorBInternal: number;\n /** Internal storage for the horizontal distance value. */\n private distanceInternal: number;\n\n /**\n * Creates a new UIHorizontalDistanceConstraint instance.\n *\n * The constraint will use default anchor points (0.5 = center) and zero distance\n * if not specified in options. Both elements must be from the same layer.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIHorizontalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalDistanceConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current horizontal distance being enforced.\n * @returns The horizontal distance in pixels\n */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /**\n * Gets the anchor point for element A.\n * @returns The anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /**\n * Gets the anchor point for element B.\n * @returns The anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /**\n * Sets a new horizontal distance and updates the constraint equation.\n * @param value - The new horizontal distance in pixels\n */\n public set distance(value: number) {\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /**\n * Sets a new anchor point for element A and updates the constraint equation.\n * @param value - The new anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorA(value: number) {\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Sets a new anchor point for element B and updates the constraint equation.\n * @param value - The new anchor value (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorB(value: number) {\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementB.x + elementB.width * anchorB) - (elementA.x + elementA.width * anchorA)\n * For point elements, only the x position is used since they have no width.\n * For plane elements, the anchor determines the reference point within the element's width.\n *\n * @returns The UIExpression representing the horizontal distance calculation\n * @private\n */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.xVariable, 1],\n [this.a.wVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.xVariable, 1);\n } else {\n throw new Error(\"A is not a valid element type\");\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.xVariable, 1],\n [this.b.wVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.xVariable, 1);\n } else {\n throw new Error(\"B is not a valid element type\");\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidConstraintSubjects } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIHorizontalProportionConstraint creation.\n */\nexport interface UIHorizontalProportionConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The proportional relationship between element widths (elementA.width = elementB.width * proportion). */\n proportion: number;\n}\n\n/**\n * Constraint that enforces proportional width relationships between two UI elements.\n *\n * UIHorizontalProportionConstraint creates a mathematical relationship that maintains\n * a proportional ratio between the widths of two plane elements. The constraint equation is:\n * elementA.width * proportion = elementB.width, which can be rearranged as:\n * elementA.width * proportion - elementB.width = 0\n *\n * This is useful for creating responsive layouts where elements need to maintain\n * specific width ratios, such as sidebar-to-content ratios or grid column proportions.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Plane elements that can have proportional constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIHorizontalProportionConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the current proportion value. */\n private proportionInternal: number;\n\n /**\n * Creates a new UIHorizontalProportionConstraint instance.\n *\n * The constraint will enforce the relationship: elementA.width * proportion = elementB.width.\n * If no proportion is specified, it defaults to 1.0 (equal widths).\n * Both elements must be from the same layer.\n *\n * @param a - The first UI plane element (whose width will be multiplied by proportion)\n * @param b - The second UI plane element (target width for the proportion)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIHorizontalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIHorizontalProportionConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.proportionInternal = options.proportion ?? 1;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(0),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current proportion value being enforced.\n * @returns The proportion ratio (elementA.width = elementB.width * proportion)\n */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /**\n * Sets a new proportion value and updates the constraint equation.\n * @param value - The new proportion ratio\n */\n public set proportion(value: number) {\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementA.width * proportion) - elementB.width = 0\n * This enforces the relationship: elementA.width * proportion = elementB.width\n *\n * @returns The UIExpression representing the proportional width relationship\n * @private\n */\n private buildLHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.wVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.wVariable, 1]]),\n );\n }\n}\n","import type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidConstraintSubjects,\n isUIPlaneElement,\n isUIPointElement,\n} from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/** Default anchor point (0.5 = center) for elements when not specified. */\nconst DEFAULT_ANCHOR = 0.5;\n\n/**\n * Configuration options for UIVerticalDistanceConstraint creation.\n */\nexport interface UIVerticalDistanceConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** Anchor point for element A (0.0 = top edge, 0.5 = center, 1.0 = bottom edge). */\n anchorA: number;\n /** Anchor point for element B (0.0 = top edge, 0.5 = center, 1.0 = bottom edge). */\n anchorB: number;\n /** The desired vertical distance between the elements. */\n distance: number;\n}\n\n/**\n * Constraint that enforces vertical distance between two UI elements.\n *\n * UIVerticalDistanceConstraint creates a mathematical relationship that maintains\n * a specific vertical distance between two elements using configurable anchor points.\n * For plane elements, anchors determine the reference point (0.0 = top, 0.5 = center, 1.0 = bottom).\n * For point elements, the anchor is always the element's position. The constraint equation is:\n * (elementB.y + elementB.height * anchorB) - (elementA.y + elementA.height * anchorA) = distance\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPointElement} - Point elements that can be constrained\n * @see {@link UIPlaneElement} - Plane elements that can be constrained\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIVerticalDistanceConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for element A's anchor point. */\n private anchorAInternal: number;\n /** Internal storage for element B's anchor point. */\n private anchorBInternal: number;\n /** Internal storage for the vertical distance value. */\n private distanceInternal: number;\n\n /**\n * Creates a new UIVerticalDistanceConstraint instance.\n *\n * The constraint will use default anchor points (0.5 = center) and zero distance\n * if not specified in options. Both elements must be from the same layer.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPointElement | UIPlaneElement,\n private readonly b: UIPointElement | UIPlaneElement,\n options: Partial<UIVerticalDistanceConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalDistanceConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;\n this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;\n this.distanceInternal = options.distance ?? 0;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(this.distanceInternal),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current vertical distance being enforced.\n * @returns The vertical distance in pixels\n */\n public get distance(): number {\n return this.distanceInternal;\n }\n\n /**\n * Gets the anchor point for element A.\n * @returns The anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorA(): number {\n return this.anchorAInternal;\n }\n\n /**\n * Gets the anchor point for element B.\n * @returns The anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorB(): number {\n return this.anchorBInternal;\n }\n\n /**\n * Sets a new vertical distance and updates the constraint equation.\n * @param value - The new vertical distance in pixels\n */\n public set distance(value: number) {\n if (this.distanceInternal !== value) {\n this.distanceInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(this.distanceInternal),\n );\n }\n }\n\n /**\n * Sets a new anchor point for element A and updates the constraint equation.\n * @param value - The new anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorA(value: number) {\n if (this.anchorAInternal !== value) {\n this.anchorAInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Sets a new anchor point for element B and updates the constraint equation.\n * @param value - The new anchor value (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorB(value: number) {\n if (this.anchorBInternal !== value) {\n this.anchorBInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementB.y + elementB.height * anchorB) - (elementA.y + elementA.height * anchorA)\n * For point elements, only the y position is used since they have no height.\n * For plane elements, the anchor determines the reference point within the element's height.\n *\n * @returns The UIExpression representing the vertical distance calculation\n * @private\n */\n private buildLHS(): UIExpression {\n let aExpression: UIExpression;\n let bExpression: UIExpression;\n\n if (isUIPlaneElement(this.a)) {\n aExpression = new UIExpression(0, [\n [this.a.yVariable, 1],\n [this.a.hVariable, this.anchorAInternal],\n ]);\n } else if (isUIPointElement(this.a)) {\n aExpression = new UIExpression().plus(this.a.yVariable, 1);\n } else {\n throw new Error(\"A is not a valid element type\");\n }\n\n if (isUIPlaneElement(this.b)) {\n bExpression = new UIExpression(0, [\n [this.b.yVariable, 1],\n [this.b.hVariable, this.anchorBInternal],\n ]);\n } else if (isUIPointElement(this.b)) {\n bExpression = new UIExpression().plus(this.b.yVariable, 1);\n } else {\n throw new Error(\"B is not a valid element type\");\n }\n\n return UIExpression.minus(bExpression, aExpression);\n }\n}\n","import type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport { assertValidConstraintSubjects } from \"../miscellaneous/asserts\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIVerticalProportionConstraint creation.\n */\nexport interface UIVerticalProportionConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The proportional relationship between element heights (elementA.height = elementB.height * proportion). */\n proportion: number;\n}\n\n/**\n * Constraint that enforces proportional height relationships between two UI elements.\n *\n * UIVerticalProportionConstraint creates a mathematical relationship that maintains\n * a proportional ratio between the heights of two plane elements. The constraint equation is:\n * elementA.height * proportion = elementB.height, which can be rearranged as:\n * elementA.height * proportion - elementB.height = 0\n *\n * This is useful for creating responsive layouts where elements need to maintain\n * specific height ratios, such as header-to-content ratios or row height proportions.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIPlaneElement} - Plane elements that can have proportional constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIVerticalProportionConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the current proportion value. */\n private proportionInternal: number;\n\n /**\n * Creates a new UIVerticalProportionConstraint instance.\n *\n * The constraint will enforce the relationship: elementA.height * proportion = elementB.height.\n * If no proportion is specified, it defaults to 1.0 (equal heights).\n * Both elements must be from the same layer.\n *\n * @param a - The first UI plane element (whose height will be multiplied by proportion)\n * @param b - The second UI plane element (target height for the proportion)\n * @param options - Configuration options for the constraint\n * @throws Will throw an error if elements are not from the same layer\n * @see {@link assertValidConstraintSubjects}\n */\n constructor(\n private readonly a: UIPlaneElement,\n private readonly b: UIPlaneElement,\n options: Partial<UIVerticalProportionConstraintOptions> = {},\n ) {\n super(\n assertValidConstraintSubjects(a, b, \"UIVerticalProportionConstraint\"),\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.proportionInternal = options.proportion ?? 1;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(0),\n this.relationInternal,\n this.priorityInternal,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current proportion value being enforced.\n * @returns The proportion ratio (elementA.height = elementB.height * proportion)\n */\n public get proportion(): number {\n return this.proportionInternal;\n }\n\n /**\n * Sets a new proportion value and updates the constraint equation.\n * @param value - The new proportion ratio\n */\n public set proportion(value: number) {\n if (this.proportionInternal !== value) {\n this.proportionInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: (elementA.height * proportion) - elementB.height = 0\n * This enforces the relationship: elementA.height * proportion = elementB.height\n *\n * @returns The UIExpression representing the proportional height relationship\n * @private\n */\n private buildLHS(): UIExpression {\n return UIExpression.minus(\n new UIExpression(0, [[this.a.hVariable, this.proportionInternal]]),\n new UIExpression(0, [[this.b.hVariable, 1]]),\n );\n }\n}\n","import type { UIElement } from \"../elements/UIElement\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIWidthConstraint creation.\n */\nexport interface UIWidthConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired width value for the element. */\n width: number;\n}\n\n/**\n * Constraint that enforces a specific width value for UI elements.\n *\n * UIWidthConstraint creates a mathematical relationship that fixes an element's\n * width to a constant value. The constraint equation is: element.width = width.\n * This is useful for ensuring elements maintain a specific width regardless of\n * other layout changes or for setting fixed dimensions in responsive layouts.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIElement} - Elements that can have width constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIWidthConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current width value. */\n private widthInternal: number;\n\n /**\n * Creates a new UIWidthConstraint instance.\n *\n * If no width is specified in options, the constraint will use the\n * element's current width as the target width value.\n *\n * @param element - The UI element to apply the width constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIElement,\n options: Partial<UIWidthConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.widthInternal = options.width ?? element.width;\n\n this.constraint = this.solverWrapper.createConstraint(\n new UIExpression(0, [[this.element.wVariable, 1]]),\n new UIExpression(this.widthInternal),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current width value being enforced.\n * @returns The width value in pixels\n */\n public get width(): number {\n return this.widthInternal;\n }\n\n /**\n * Sets a new width value and updates the constraint equation.\n * @param value - The new width value in pixels\n */\n public set width(value: number) {\n if (this.widthInternal !== value) {\n this.widthInternal = value;\n this.solverWrapper.setConstraintRHS(\n this.constraint,\n new UIExpression(value),\n );\n }\n }\n}\n","import { UIHeightConstraint } from \"../constraints/UIHeightConstraint\";\nimport { UIHorizontalDistanceConstraint } from \"../constraints/UIHorizontalDistanceConstraint\";\nimport { UIHorizontalProportionConstraint } from \"../constraints/UIHorizontalProportionConstraint\";\nimport { UIVerticalDistanceConstraint } from \"../constraints/UIVerticalDistanceConstraint\";\nimport { UIVerticalProportionConstraint } from \"../constraints/UIVerticalProportionConstraint\";\nimport { UIWidthConstraint } from \"../constraints/UIWidthConstraint\";\nimport type { UIElement } from \"../elements/UIElement\";\nimport type { UIPlaneElement, UIPointElement } from \"../miscellaneous/asserts\";\nimport type { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport type { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UIRelation } from \"../miscellaneous/UIRelation\";\n\n/**\n * Generic 2D type for specifying horizontal and vertical values.\n *\n * This interface allows configuration of properties that can have\n * different values for horizontal and vertical directions.\n *\n * @template T - The type of values for horizontal and vertical properties\n */\nexport interface UIType2D<T> {\n /** Horizontal (x-axis) value. */\n h?: T;\n /** Vertical (y-axis) value. */\n v?: T;\n}\n\n/**\n * Base options for 2D constraint configuration.\n */\ninterface UIConstraint2DOptions {\n /** Priority levels for horizontal and vertical constraints. */\n priority: UIType2D<UIPriority>;\n /** Mathematical relations for horizontal and vertical constraints. */\n relation: UIType2D<UIRelation>;\n /** Orientation settings for horizontal and vertical constraints. */\n orientation: UIType2D<UIOrientation>;\n}\n\n/**\n * Configuration options for 2D size constraints.\n */\nexport interface UIConstraintSize2DOptions extends UIConstraint2DOptions {\n /** Size values for horizontal (width) and vertical (height) dimensions. */\n size: UIType2D<number>;\n}\n\n/**\n * Configuration options for 2D distance constraints.\n */\nexport interface UIConstraintDistance2DOptions extends UIConstraint2DOptions {\n /** Anchor points for element A in horizontal and vertical directions. */\n anchorA: UIType2D<number>;\n /** Anchor points for element B in horizontal and vertical directions. */\n anchorB: UIType2D<number>;\n /** Distance values for horizontal and vertical spacing. */\n distance: UIType2D<number>;\n}\n\n/**\n * Configuration options for 2D proportion constraints.\n */\nexport interface UIConstraintProportion2DOptions extends UIConstraint2DOptions {\n /** Proportion ratios for horizontal and vertical relationships. */\n proportion: UIType2D<number>;\n}\n\n/**\n * Result object containing horizontal and vertical constraint instances.\n *\n * @template TH - The type of the horizontal constraint\n * @template TV - The type of the vertical constraint\n */\nexport interface UIConstraint2DResult<TH, TV> {\n /** The horizontal constraint instance. */\n h: TH;\n /** The vertical constraint instance. */\n v: TV;\n}\n\n/**\n * Builder utility for creating paired horizontal and vertical constraints.\n *\n * UIConstraint2DBuilder simplifies the creation of constraint pairs that work\n * together to define 2D relationships between UI elements. Instead of manually\n * creating separate horizontal and vertical constraints, this builder allows\n * you to specify both dimensions at once with a unified interface.\n *\n * This is particularly useful for creating consistent spacing, sizing, and\n * proportional relationships across both axes simultaneously.\n *\n * @see {@link UIWidthConstraint} - Horizontal size constraints\n * @see {@link UIHeightConstraint} - Vertical size constraints\n * @see {@link UIHorizontalDistanceConstraint} - Horizontal spacing constraints\n * @see {@link UIVerticalDistanceConstraint} - Vertical spacing constraints\n */\nexport class UIConstraint2DBuilder {\n /**\n * Creates paired width and height constraints for an element.\n *\n * This method generates both horizontal (width) and vertical (height)\n * size constraints simultaneously, allowing you to set fixed dimensions\n * for both axes with a single call.\n *\n * @param element - The UI element to apply size constraints to\n * @param options - Configuration options for both width and height constraints\n * @returns Object containing the created width and height constraint instances\n */\n public static size(\n element: UIElement,\n options: Partial<UIConstraintSize2DOptions> = {},\n ): UIConstraint2DResult<UIWidthConstraint, UIHeightConstraint> {\n return {\n h: new UIWidthConstraint(element, {\n width: options.size?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIHeightConstraint(element, {\n height: options.size?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates paired horizontal and vertical distance constraints between two elements.\n *\n * This method generates both horizontal and vertical spacing constraints\n * simultaneously, allowing you to define 2D spacing relationships with\n * configurable anchor points for both axes.\n *\n * @param a - The first UI element (point or plane element)\n * @param b - The second UI element (point or plane element)\n * @param options - Configuration options for both horizontal and vertical distance constraints\n * @returns Object containing the created horizontal and vertical distance constraint instances\n */\n public static distance(\n a: UIPointElement | UIPlaneElement,\n b: UIPointElement | UIPlaneElement,\n options: Partial<UIConstraintDistance2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalDistanceConstraint,\n UIVerticalDistanceConstraint\n > {\n return {\n h: new UIHorizontalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.h,\n anchorB: options.anchorB?.h,\n distance: options.distance?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalDistanceConstraint(a, b, {\n anchorA: options.anchorA?.v,\n anchorB: options.anchorB?.v,\n distance: options.distance?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n\n /**\n * Creates paired horizontal and vertical proportion constraints between two elements.\n *\n * This method generates both horizontal (width) and vertical (height)\n * proportion constraints simultaneously, allowing you to define proportional\n * relationships for both dimensions with a single call.\n *\n * @param a - The first UI plane element (whose dimensions will be multiplied by proportion)\n * @param b - The second UI plane element (target dimensions for the proportion)\n * @param options - Configuration options for both horizontal and vertical proportion constraints\n * @returns Object containing the created horizontal and vertical proportion constraint instances\n */\n public static proportion(\n a: UIPlaneElement,\n b: UIPlaneElement,\n options: Partial<UIConstraintProportion2DOptions> = {},\n ): UIConstraint2DResult<\n UIHorizontalProportionConstraint,\n UIVerticalProportionConstraint\n > {\n return {\n h: new UIHorizontalProportionConstraint(a, b, {\n proportion: options.proportion?.h,\n priority: options.priority?.h,\n relation: options.relation?.h,\n orientation: options.orientation?.h,\n }),\n v: new UIVerticalProportionConstraint(a, b, {\n proportion: options.proportion?.v,\n priority: options.priority?.v,\n relation: options.relation?.v,\n orientation: options.orientation?.v,\n }),\n };\n }\n}\n","import type { UIElement } from \"../elements/UIElement\";\nimport { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Configuration options for UIAspectConstraint creation.\n */\nexport interface UIAspectConstraintOptions\n extends UISingleParameterConstraintOptions {\n /** The desired aspect ratio (width/height) for the element. */\n aspect: number;\n}\n\n/**\n * Constraint that maintains a specific aspect ratio for UI elements.\n *\n * UIAspectConstraint enforces a mathematical relationship between an element's\n * width and height to maintain a constant aspect ratio. The constraint equation\n * is: width = height * aspect. This is useful for ensuring elements maintain\n * their proportions during layout changes or for enforcing specific aspect\n * ratios like 16:9 for video content.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIElement} - Elements that can have aspect constraints applied\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n */\nexport class UIAspectConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n\n /** Internal storage for the current aspect ratio value. */\n private aspectInternal: number;\n\n /**\n * Creates a new UIAspectConstraint instance.\n *\n * If no aspect ratio is specified in options, the constraint will use the\n * element's current width-to-height ratio as the target aspect ratio.\n *\n * @param element - The UI element to apply the aspect constraint to\n * @param options - Configuration options for the constraint\n */\n constructor(\n private readonly element: UIElement,\n options: Partial<UIAspectConstraintOptions> = {},\n ) {\n super(\n element.layer,\n options.priority,\n options.relation,\n options.orientation,\n );\n\n this.aspectInternal = options.aspect ?? element.width / element.height;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.buildLHS(),\n new UIExpression(0),\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current aspect ratio being enforced.\n * @returns The aspect ratio (width/height)\n */\n public get aspect(): number {\n return this.aspectInternal;\n }\n\n /**\n * Sets a new aspect ratio and updates the constraint equation.\n * @param value - The new aspect ratio (width/height)\n */\n public set aspect(value: number) {\n if (this.aspectInternal !== value) {\n this.aspectInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());\n }\n }\n\n /**\n * Builds the left-hand side expression for the constraint equation.\n *\n * Creates the expression: width - (height * aspect) = 0\n * This enforces the relationship: width = height * aspect\n *\n * @returns The UIExpression representing the constraint equation\n * @private\n */\n private buildLHS(): UIExpression {\n return new UIExpression(0, [\n [this.element.wVariable, 1],\n [this.element.hVariable, -this.aspectInternal],\n ]);\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport type { UIExpression } from \"../miscellaneous/UIExpression\";\nimport type { UISingleParameterConstraintOptions } from \"./UISingleParameterConstraint\";\nimport { UISingleParameterConstraint } from \"./UISingleParameterConstraint\";\n\n/**\n * Constraint that allows custom mathematical relationships between UI elements.\n *\n * UICustomConstraint provides maximum flexibility by allowing direct specification\n * of the left-hand side (LHS) and right-hand side (RHS) expressions for constraint\n * equations. This enables creation of complex mathematical relationships that may\n * not be covered by the specialized constraint types. The constraint equation is:\n * LHS relation RHS (e.g., LHS = RHS, LHS ≤ RHS, or LHS ≥ RHS)\n *\n * This is useful for implementing custom layout logic, complex mathematical\n * relationships between multiple elements, or prototype new constraint types.\n *\n * @see {@link UISingleParameterConstraint} - Base class for single-parameter constraints\n * @see {@link UIExpression} - Mathematical expressions for constraint equations\n * @see {@link UILayer} - Container layer for constraints\n */\nexport class UICustomConstraint extends UISingleParameterConstraint {\n /** The constraint descriptor managed by the solver system. */\n protected override readonly constraint: number;\n /** Internal storage for the left-hand side expression. */\n private lhsInternal: UIExpression;\n /** Internal storage for the right-hand side expression. */\n private rhsInternal: UIExpression;\n\n /**\n * Creates a new UICustomConstraint instance with custom expressions.\n *\n * The constraint will enforce the relationship: LHS relation RHS, where\n * the relation is determined by the options (defaults to equality).\n *\n * @param layer - The UI layer that contains this constraint\n * @param lhs - The left-hand side expression of the constraint equation\n * @param rhs - The right-hand side expression of the constraint equation\n * @param options - Configuration options for the constraint\n */\n constructor(\n layer: UILayer,\n lhs: UIExpression,\n rhs: UIExpression,\n options: Partial<UISingleParameterConstraintOptions> = {},\n ) {\n super(layer, options.priority, options.relation, options.orientation);\n\n this.lhsInternal = lhs;\n this.rhsInternal = rhs;\n\n this.constraint = this.solverWrapper.createConstraint(\n this.lhsInternal,\n this.rhsInternal,\n this.relation,\n this.priority,\n this.isConstraintEnabled(),\n );\n }\n\n /**\n * Gets the current left-hand side expression.\n * @returns The LHS expression of the constraint equation\n */\n public get lhs(): UIExpression {\n return this.lhsInternal;\n }\n\n /**\n * Gets the current right-hand side expression.\n * @returns The RHS expression of the constraint equation\n */\n public get rhs(): UIExpression {\n return this.rhsInternal;\n }\n\n /**\n * Sets a new left-hand side expression and updates the constraint.\n * @param value - The new LHS expression for the constraint equation\n */\n public setLHS(value: UIExpression): void {\n this.lhsInternal = value;\n this.solverWrapper.setConstraintLHS(this.constraint, this.lhsInternal);\n }\n\n /**\n * Sets a new right-hand side expression and updates the constraint.\n * @param value - The new RHS expression for the constraint equation\n */\n public setRHS(value: UIExpression): void {\n this.rhsInternal = value;\n this.solverWrapper.setConstraintRHS(this.constraint, this.rhsInternal);\n }\n}\n","import { Eventail } from \"eventail\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport type { UIPointElement } from \"../miscellaneous/asserts\";\nimport { assertValidNumber } from \"../miscellaneous/asserts\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISolverWrapper } from \"../wrappers/UISolverWrapper\";\n\n/**\n * Abstract base class representing a minimal UI element as a point in 2D space.\n *\n * A UIAnchor serves as the fundamental building block for UI layout systems,\n * representing a single point with x and y coordinates. It provides constraint-based\n * positioning through solver variables and serves as an anchor point for more\n * complex UI elements.\n *\n * @see {@link UIPointElement} - Interface defining point element behavior\n * @see {@link UILayer} - Container layer for UI elements\n * @see {@link UISolverWrapper} - Constraint solver integration\n */\nexport abstract class UIAnchor extends Eventail implements UIPointElement {\n /** Optional name identifier for the anchor. */\n public name = \"\";\n\n /**\n * Solver variable descriptor for the x-coordinate.\n * This variable is managed by the constraint solver system.\n */\n public readonly xVariable: number;\n\n /**\n * Solver variable descriptor for the y-coordinate.\n * This variable is managed by the constraint solver system.\n */\n public readonly yVariable: number;\n\n /**\n * Reference to the constraint solver wrapper for variable management.\n * @see {@link UISolverWrapper}\n */\n protected readonly solverWrapper: UISolverWrapper;\n\n /**\n * Creates a new UIAnchor instance.\n *\n * @param layer - The UI layer that contains this anchor\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @throws Will throw an error if x or y are not valid numbers\n * @see {@link assertValidNumber}\n */\n constructor(\n public readonly layer: UILayer,\n x: number,\n y: number,\n ) {\n assertValidNumber(x, \"UIAnchor x\");\n assertValidNumber(y, \"UIAnchor y\");\n\n super();\n this.solverWrapper = this.layer[\"getSolverWrapperInternal\"]();\n this.xVariable = this.solverWrapper.createVariable(x, UIPriority.P7);\n this.yVariable = this.solverWrapper.createVariable(y, UIPriority.P7);\n }\n\n /**\n * Gets the current x-coordinate value from the solver.\n * @returns The current x-coordinate position\n */\n public get x(): number {\n return this.solverWrapper.readVariableValue(this.xVariable);\n }\n\n /**\n * Gets the current y-coordinate value from the solver.\n * @returns The current y-coordinate position\n */\n public get y(): number {\n return this.solverWrapper.readVariableValue(this.yVariable);\n }\n\n /**\n * Sets the x-coordinate value through the solver system.\n * @param value - The new x-coordinate value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set x(value: number) {\n assertValidNumber(value, \"UIAnchor x\");\n this.solverWrapper.suggestVariableValue(this.xVariable, value);\n }\n\n /**\n * Sets the y-coordinate value through the solver system.\n * @param value - The new y-coordinate value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set y(value: number) {\n assertValidNumber(value, \"UIAnchor y\");\n this.solverWrapper.suggestVariableValue(this.yVariable, value);\n }\n\n /**\n * Destroys the anchor by removing its solver variables.\n *\n * This method cleans up the solver variables associated with this anchor,\n * effectively removing it from the constraint solving system. After calling\n * this method, the anchor should not be used anymore.\n */\n public destroy(): void {\n this.solverWrapper.removeVariable(this.yVariable);\n this.solverWrapper.removeVariable(this.xVariable);\n }\n}\n","import type { UILayer } from \"../layers/UILayer\";\nimport {\n assertValidPositiveNumber,\n type UIPlaneElement,\n} from \"../miscellaneous/asserts\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport { UIAnchor } from \"./UIAnchor\";\n\n/** Default width and height value for UIDummy elements. */\nconst DEFAULT_SIZE = 100;\n\n/**\n * Abstract UI element that extends UIAnchor with dimensions but without rendering.\n *\n * UIDummy represents a rectangular area in the UI layout system that has position\n * and dimensions (width and height) but does not perform any visual rendering.\n * It serves as a placeholder or spacer element in constraint-based layouts,\n * useful for defining layout structure without visual content.\n *\n * @see {@link UIAnchor} - Base class providing position functionality\n * @see {@link UIPlaneElement} - Interface defining dimensional element behavior\n * @see {@link UILayer} - Container layer for UI elements\n */\nexport abstract class UIDummy extends UIAnchor implements UIPlaneElement {\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /**\n * Creates a new UIDummy instance with position and dimensions.\n *\n * @param layer - The UI layer that contains this dummy element\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @param width - Initial width dimension (defaults to 100)\n * @param height - Initial height dimension (defaults to 100)\n * @throws Will throw an error if width or height are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n constructor(\n layer: UILayer,\n x: number,\n y: number,\n width: number = DEFAULT_SIZE,\n height: number = DEFAULT_SIZE,\n ) {\n assertValidPositiveNumber(width, \"UIDummy width\");\n assertValidPositiveNumber(height, \"UIDummy height\");\n\n super(layer, x, y);\n this.wVariable = this.solverWrapper.createVariable(width, UIPriority.P6);\n this.hVariable = this.solverWrapper.createVariable(height, UIPriority.P6);\n }\n\n /**\n * Gets the current width value from the solver.\n * @returns The current width dimension\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the solver.\n * @returns The current height dimension\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Sets the width value through the solver system.\n * @param value - The new width dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIDummy width\");\n this.solverWrapper.suggestVariableValue(this.wVariable, value);\n }\n\n /**\n * Sets the height value through the solver system.\n * @param value - The new height dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIDummy height\");\n this.solverWrapper.suggestVariableValue(this.hVariable, value);\n }\n\n /**\n * Destroys the dummy element by removing its solver variables.\n *\n * This method cleans up the dimension solver variables (width and height)\n * associated with this dummy element, then calls the parent destroy method\n * to clean up position variables. After calling this method, the dummy\n * element should not be used anymore.\n */\n public override destroy(): void {\n this.solverWrapper.removeVariable(this.hVariable);\n this.solverWrapper.removeVariable(this.wVariable);\n super.destroy();\n }\n}\n","import { MathUtils } from \"three\";\n\n/** Default position value for x and y coordinates. */\nconst DEFAULT_POSITION = 0;\n/** Default anchor point value for anchorX and anchorY. */\nconst DEFAULT_ANCHOR = 0;\n/** Default scale value for scaleX and scaleY. */\nconst DEFAULT_SCALE = 1;\n/** Default rotation value in radians. */\nconst DEFAULT_ROTATION = 0;\n\n/**\n * Micro-transformation system for non-constraint based UI element adjustments.\n *\n * UIMicro provides a lightweight transformation system that operates independently\n * of the constraint solver. It manages position offsets, anchor points, scaling,\n * and rotation transformations that can be applied to UI elements for animations,\n * visual effects, or fine-tuned positioning without affecting the constraint-based\n * layout system.\n *\n * All transformations are tracked with change detection to optimize rendering\n * performance by only recalculating when properties have actually changed.\n *\n * @see {@link UIElement} - Elements that use micro transformations\n */\nexport class UIMicro {\n /** Internal storage for x-coordinate offset. */\n private xInternal: number = DEFAULT_POSITION;\n /** Internal storage for y-coordinate offset. */\n private yInternal: number = DEFAULT_POSITION;\n /** Internal storage for x-axis anchor point. */\n private anchorXInternal: number = DEFAULT_ANCHOR;\n /** Internal storage for y-axis anchor point. */\n private anchorYInternal: number = DEFAULT_ANCHOR;\n /** Internal storage for x-axis scale factor. */\n private scaleXInternal: number = DEFAULT_SCALE;\n /** Internal storage for y-axis scale factor. */\n private scaleYInternal: number = DEFAULT_SCALE;\n /** Internal storage for rotation in radians. */\n private rotationInternal: number = DEFAULT_ROTATION;\n /** Flag indicating if any transformation properties have changed. */\n private recalculationRequired = false;\n\n /**\n * Gets the x-coordinate offset for micro positioning.\n * @returns The x-offset value\n */\n public get x(): number {\n return this.xInternal;\n }\n\n /**\n * Gets the y-coordinate offset for micro positioning.\n * @returns The y-offset value\n */\n public get y(): number {\n return this.yInternal;\n }\n\n /**\n * Gets the x-axis anchor point for transformations.\n * @returns The anchor point (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public get anchorX(): number {\n return this.anchorXInternal;\n }\n\n /**\n * Gets the y-axis anchor point for transformations.\n * @returns The anchor point (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public get anchorY(): number {\n return this.anchorYInternal;\n }\n\n /**\n * Gets the x-axis scale factor.\n * @returns The scale factor (1.0 = normal size)\n */\n public get scaleX(): number {\n return this.scaleXInternal;\n }\n\n /**\n * Gets the y-axis scale factor.\n * @returns The scale factor (1.0 = normal size)\n */\n public get scaleY(): number {\n return this.scaleYInternal;\n }\n\n /**\n * Gets the uniform scale factor (maximum of scaleX and scaleY).\n * @returns The larger of the two scale factors\n */\n public get size(): number {\n return Math.max(this.scaleXInternal, this.scaleYInternal);\n }\n\n /**\n * Gets the rotation angle in degrees.\n * @returns The rotation angle in degrees\n */\n public get angle(): number {\n return MathUtils.radToDeg(this.rotationInternal);\n }\n\n /**\n * Gets the rotation angle in radians.\n * @returns The rotation angle in radians\n */\n public get rotation(): number {\n return this.rotationInternal;\n }\n\n /**\n * Sets the x-coordinate offset for micro positioning.\n * @param value - The new x-offset value\n */\n public set x(value: number) {\n if (value !== this.xInternal) {\n this.xInternal = value;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Sets the y-coordinate offset for micro positioning.\n * @param value - The new y-offset value\n */\n public set y(value: number) {\n if (value !== this.yInternal) {\n this.yInternal = value;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Sets the x-axis anchor point for transformations.\n * @param value - The anchor point (0.0 = left, 0.5 = center, 1.0 = right)\n */\n public set anchorX(value: number) {\n if (value !== this.anchorXInternal) {\n this.anchorXInternal = value;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Sets the y-axis anchor point for transformations.\n * @param value - The anchor point (0.0 = top, 0.5 = center, 1.0 = bottom)\n */\n public set anchorY(value: number) {\n if (value !== this.anchorYInternal) {\n this.anchorYInternal = value;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Sets the x-axis scale factor.\n * @param value - The scale factor (1.0 = normal size)\n */\n public set scaleX(value: number) {\n if (value !== this.scaleXInternal) {\n this.scaleXInternal = value;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Sets the y-axis scale factor.\n * @param value - The scale factor (1.0 = normal size)\n */\n public set scaleY(value: number) {\n if (value !== this.scaleYInternal) {\n this.scaleYInternal = value;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Sets both scale factors to the same value for uniform scaling.\n * @param value - The uniform scale factor (1.0 = normal size)\n */\n public set size(value: number) {\n if (value !== this.scaleXInternal || value !== this.scaleYInternal) {\n this.scaleXInternal = value;\n this.scaleYInternal = value;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Sets the rotation angle in degrees.\n * @param value - The rotation angle in degrees\n */\n public set angle(value: number) {\n const rotation = MathUtils.degToRad(value);\n if (rotation !== this.rotationInternal) {\n this.rotationInternal = rotation;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Sets the rotation angle in radians.\n * @param value - The rotation angle in radians\n */\n public set rotation(value: number) {\n if (value !== this.rotationInternal) {\n this.rotationInternal = value;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Resets all transformation properties to their default values.\n *\n * This method restores position (0,0), anchor (0,0), scale (1,1),\n * and rotation (0) to their initial states. Only triggers recalculation\n * if any values actually change.\n */\n public reset(): void {\n if (\n this.xInternal !== DEFAULT_POSITION ||\n this.yInternal !== DEFAULT_POSITION ||\n this.anchorXInternal !== DEFAULT_ANCHOR ||\n this.anchorYInternal !== DEFAULT_ANCHOR ||\n this.scaleXInternal !== DEFAULT_SCALE ||\n this.scaleYInternal !== DEFAULT_SCALE ||\n this.rotationInternal !== DEFAULT_ROTATION\n ) {\n this.xInternal = DEFAULT_POSITION;\n this.yInternal = DEFAULT_POSITION;\n this.anchorXInternal = DEFAULT_ANCHOR;\n this.anchorYInternal = DEFAULT_ANCHOR;\n this.scaleXInternal = DEFAULT_SCALE;\n this.scaleYInternal = DEFAULT_SCALE;\n this.rotationInternal = DEFAULT_ROTATION;\n this.recalculationRequired = true;\n }\n }\n\n /**\n * Gets whether any transformation properties have changed since last reset.\n *\n * This method is used internally by the rendering system to determine\n * if transformation matrices need to be recalculated.\n *\n * @returns True if recalculation is required, false otherwise\n * @internal\n */\n protected [\"getRecalculationRequiredInternal\"](): boolean {\n return this.recalculationRequired;\n }\n\n /**\n * Resets the recalculation flag after transformations have been applied.\n *\n * This method is called internally by the rendering system after\n * transformation matrices have been updated.\n *\n * @internal\n */\n protected [\"resetRecalculationRequiredInternal\"](): void {\n this.recalculationRequired = false;\n }\n}\n","import type { WebGLRenderer } from \"three\";\nimport { type Object3D } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport type { UIPlaneElement } from \"../miscellaneous/asserts\";\nimport {\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"../miscellaneous/asserts\";\nimport { UIMicro } from \"../miscellaneous/UIMicro\";\nimport { UIMode } from \"../miscellaneous/UIMode\";\nimport { UIPriority } from \"../miscellaneous/UIPriority\";\nimport type { UISceneWrapper } from \"../wrappers/UISceneWrapper\";\nimport { UIAnchor } from \"./UIAnchor\";\n\n/**\n * Events that can be emitted by UI elements.\n */\nexport enum UIElementEvent {\n /** Emitted when the element is clicked. */\n CLICK = \"click\",\n}\n\n/**\n * Abstract base class for all renderable UI elements with dimensions.\n *\n * UIElement serves as the fundamental building block for all other UI elements\n * that need to be visually rendered. It extends UIAnchor with dimensional properties\n * and integrates with the Three.js rendering system through Object3D. This class\n * provides essential functionality for positioning, sizing, rendering, visibility,\n * z-index management, and user interaction.\n *\n * @template T - The type of Three.js Object3D used for rendering\n * @see {@link UIAnchor} - Base class providing position functionality\n * @see {@link UIPlaneElement} - Interface defining dimensional element behavior\n * @see {@link UISceneWrapper} - Scene management for rendering\n * @see {@link UIMicro} - Micro-optimization utilities\n */\nexport abstract class UIElement<T extends Object3D = Object3D>\n extends UIAnchor\n implements UIPlaneElement\n{\n /** Micro-transformation system for non-constraint based positioning, scaling, and rotation adjustments. */\n public readonly micro = new UIMicro();\n\n /**\n * Solver variable descriptor for the width dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly wVariable: number;\n\n /**\n * Solver variable descriptor for the height dimension.\n * This variable is managed by the constraint solver system.\n */\n public readonly hVariable: number;\n\n /**\n * Reference to the scene wrapper for rendering management.\n * @see {@link UISceneWrapper}\n */\n protected readonly sceneWrapper: UISceneWrapper;\n\n /** Internal storage for the current visibility/interaction mode. */\n protected modeInternal: UIMode = UIMode.VISIBLE;\n\n /**\n * Creates a new UIElement instance with rendering capabilities.\n *\n * @param layer - The UI layer that contains this element\n * @param x - Initial x-coordinate position\n * @param y - Initial y-coordinate position\n * @param width - Initial width dimension (must be positive)\n * @param height - Initial height dimension (must be positive)\n * @param object - The Three.js Object3D used for rendering this element\n * @throws Will throw an error if width or height are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n constructor(\n layer: UILayer,\n x: number,\n y: number,\n width: number,\n height: number,\n protected readonly object: T,\n ) {\n assertValidPositiveNumber(width, \"UIElement width\");\n assertValidPositiveNumber(height, \"UIElement height\");\n\n super(layer, x, y);\n this.sceneWrapper = this.layer[\"getSceneWrapperInternal\"]();\n this.sceneWrapper.insertObject(this, this.object);\n this.wVariable = this.solverWrapper.createVariable(width, UIPriority.P6);\n this.hVariable = this.solverWrapper.createVariable(height, UIPriority.P6);\n }\n\n /**\n * Gets the current width value from the solver.\n * @returns The current width dimension\n */\n public get width(): number {\n return this.solverWrapper.readVariableValue(this.wVariable);\n }\n\n /**\n * Gets the current height value from the solver.\n * @returns The current height dimension\n */\n public get height(): number {\n return this.solverWrapper.readVariableValue(this.hVariable);\n }\n\n /**\n * Gets the current z-index (depth) value from the scene.\n * @returns The current z-index for rendering order\n */\n public get zIndex(): number {\n return this.sceneWrapper.getZIndex(this);\n }\n\n /**\n * Gets the current visibility and interaction mode.\n * @returns The current UIMode setting\n * @see {@link UIMode}\n */\n public get mode(): UIMode {\n return this.modeInternal;\n }\n\n /**\n * Sets the width value through the solver system.\n * @param value - The new width dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set width(value: number) {\n assertValidPositiveNumber(value, \"UIElement width\");\n this.solverWrapper.suggestVariableValue(this.wVariable, value);\n }\n\n /**\n * Sets the height value through the solver system.\n * @param value - The new height dimension (must be positive)\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set height(value: number) {\n assertValidPositiveNumber(value, \"UIElement height\");\n this.solverWrapper.suggestVariableValue(this.hVariable, value);\n }\n\n /**\n * Sets the z-index (depth) value for rendering order.\n * @param value - The new z-index value\n * @throws Will throw an error if value is not a valid number\n * @see {@link assertValidNumber}\n */\n public set zIndex(value: number) {\n assertValidNumber(value, \"UIElement zIndex\");\n this.sceneWrapper.setZIndex(this, value);\n }\n\n /**\n * Sets the visibility and interaction mode.\n * @param value - The new UIMode setting\n * @see {@link UIMode}\n */\n public set mode(value: UIMode) {\n if (value !== this.modeInternal) {\n this.modeInternal = value;\n this.sceneWrapper.setVisibility(this, value !== UIMode.HIDDEN);\n }\n }\n\n /**\n * Destroys the UI element by cleaning up all associated resources.\n *\n * This method removes the element from the rendering scene, cleans up\n * dimension solver variables, and calls the parent destroy method to\n * clean up position variables. After calling this method, the element\n * should not be used anymore.\n */\n public override destroy(): void {\n this.solverWrapper.removeVariable(this.hVariable);\n this.solverWrapper.removeVariable(this.wVariable);\n this.sceneWrapper.removeObject(this);\n super.destroy();\n }\n\n /**\n * Internal method for handling click events.\n *\n * Determines if the click coordinates intersect with this element's bounds\n * and emits a CLICK event if the element is in interactive mode.\n *\n * @param x - The x-coordinate of the click\n * @param y - The y-coordinate of the click\n * @returns True if the click was handled by this element\n * @internal\n */\n protected [\"onClickInternal\"](x: number, y: number): boolean {\n const isClicked =\n this.modeInternal === UIMode.INTERACTIVE &&\n x > this.x &&\n x < this.x + this.width &&\n y > this.y &&\n y < this.y + this.height;\n if (isClicked) {\n this.emit(UIElementEvent.CLICK, x, y, this);\n }\n return isClicked;\n }\n\n /**\n * Internal method called before rendering each frame.\n *\n * This is a hook method that can be overridden by subclasses to perform\n * pre-render operations such as updating animations, transforms, or\n * other dynamic properties.\n *\n * @param renderer - The WebGL renderer instance\n * @param deltaTime - Time elapsed since the last frame in seconds\n * @internal\n */\n protected [\"onBeforeRenderInternal\"](\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- empty basic method, parameters unused\n renderer: WebGLRenderer,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- empty basic method, parameters unused\n deltaTime: number,\n ): void {}\n}\n","import type { Texture } from \"three\";\nimport { Color, ShaderMaterial } from \"three\";\n\nconst DEFAULT_ALPHA_TEST = 0.75;\n\nexport class UIMaterial extends ShaderMaterial {\n constructor(map?: Texture) {\n super({\n uniforms: {\n map: { value: map },\n opacity: { value: 1.0 },\n color: { value: new Color(1.0, 1.0, 1.0) },\n alphaTest: { value: DEFAULT_ALPHA_TEST },\n },\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: /* glsl */ `\n uniform sampler2D map;\n uniform float opacity;\n uniform vec3 color;\n uniform float alphaTest;\n varying vec2 vUv;\n\n void main() {\n vec4 diffuseColor = texture2D(map, vUv);\n #include <alphatest_fragment>\n gl_FragColor = vec4(diffuseColor.rgb * color, diffuseColor.a * opacity);\n #include <colorspace_fragment>\n }\n `,\n transparent: false,\n alphaTest: DEFAULT_ALPHA_TEST,\n lights: false,\n fog: false,\n depthWrite: false,\n depthTest: false,\n });\n }\n\n public getTexture(): Texture {\n return this.uniforms.map.value;\n }\n\n public getColor(): number {\n return (this.uniforms.color.value as Color).getHex();\n }\n\n public getOpacity(): number {\n return this.uniforms.opacity.value;\n }\n\n public getTransparency(): boolean {\n return this.transparent;\n }\n\n public setTexture(value: Texture): this {\n this.uniforms.map.value = value;\n this.uniformsNeedUpdate = true;\n return this;\n }\n\n public setColor(value: number): this {\n (this.uniforms.color.value as Color).setHex(value);\n this.uniformsNeedUpdate = true;\n return this;\n }\n\n public setOpacity(value: number): this {\n this.uniforms.opacity.value = value;\n this.uniformsNeedUpdate = true;\n return this;\n }\n\n public setTransparency(value: boolean): this {\n if (this.transparent !== value) {\n this.transparent = value;\n this.uniforms.alphaTest.value = value ? DEFAULT_ALPHA_TEST : 0;\n this.needsUpdate = true;\n this.uniformsNeedUpdate = true;\n }\n return this;\n }\n}\n","import { PlaneGeometry } from \"three\";\n\nconst GEOMETRY_SIZE = 1;\nconst GEOMETRY_OFFSET = GEOMETRY_SIZE / 2;\n\nexport const geometry = new PlaneGeometry(\n GEOMETRY_SIZE,\n GEOMETRY_SIZE,\n).translate(GEOMETRY_OFFSET, GEOMETRY_OFFSET, 0);\n","import type { Texture } from \"three\";\nimport { Mesh } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIMaterial } from \"../materials/UIMaterial\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { geometry } from \"../miscellaneous/threeInstances\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * UI element for displaying textured images.\n *\n * UIImage is a concrete implementation of UIElement that renders a textured\n * image using Three.js Mesh and UIMaterial. It automatically sizes itself\n * to match the texture dimensions and provides control over visual properties\n * such as color tinting, opacity, and transparency.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link UIMaterial} - Material system for rendering\n * @see {@link Texture} - Three.js texture for image data\n */\nexport class UIImage extends UIElement<Mesh> {\n /** The material used for rendering the image. */\n private readonly material: UIMaterial;\n\n /** Internal storage for the current texture. */\n private readonly textureInternal: Texture;\n\n /**\n * Creates a new UIImage instance.\n *\n * The image will automatically size itself to match the texture's dimensions.\n * The position defaults to (0, 0) if not specified.\n *\n * @param layer - The UI layer that contains this image\n * @param texture - The Three.js texture to display\n * @param x - Initial x-coordinate position (defaults to 0)\n * @param y - Initial y-coordinate position (defaults to 0)\n */\n constructor(layer: UILayer, texture: Texture, x = 0, y = 0) {\n const width = texture.image.width;\n const height = texture.image.height;\n\n const material = new UIMaterial(texture);\n const object = new Mesh(geometry, material);\n\n super(layer, x, y, width, height, object);\n this.material = material;\n this.textureInternal = texture;\n }\n\n /**\n * Gets the current texture being displayed.\n * @returns The current Three.js texture\n */\n public get texture(): Texture {\n return this.textureInternal;\n }\n\n /**\n * Gets the current color tint applied to the image.\n * @returns The color value as a number (e.g., 0xFFFFFF for white)\n */\n public get color(): number {\n return this.material.getColor();\n }\n\n /**\n * Gets the current opacity level of the image.\n * @returns The opacity value between 0.0 (transparent) and 1.0 (opaque)\n */\n public get opacity(): number {\n return this.material.getOpacity();\n }\n\n /**\n * Gets whether transparency is enabled for the image.\n * @returns True if transparency is enabled, false otherwise\n */\n public get transparency(): boolean {\n return this.material.getTransparency();\n }\n\n /**\n * Sets a new texture for the image.\n *\n * When setting a new texture, the image will automatically resize to match\n * the new texture's dimensions.\n *\n * @param value - The new Three.js texture to display\n * @throws Will throw an error if the texture dimensions are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n public set texture(value: Texture) {\n const width = value.image.width;\n const height = value.image.height;\n\n assertValidPositiveNumber(width, \"UIImage texture width\");\n assertValidPositiveNumber(height, \"UIImage texture height\");\n\n this.material.setTexture(value);\n this.solverWrapper.suggestVariableValue(this.wVariable, width);\n this.solverWrapper.suggestVariableValue(this.hVariable, height);\n }\n\n /**\n * Sets the color tint applied to the image.\n * @param value - The color value as a number (e.g., 0xFFFFFF for white)\n */\n public set color(value: number) {\n this.material.setColor(value);\n }\n\n /**\n * Sets the opacity level of the image.\n * @param value - The opacity value between 0.0 (transparent) and 1.0 (opaque)\n */\n public set opacity(value: number) {\n this.material.setOpacity(value);\n }\n\n /**\n * Sets whether transparency is enabled for the image.\n * @param value - True to enable transparency, false to disable\n */\n public set transparency(value: boolean) {\n this.material.setTransparency(value);\n }\n\n /**\n * Destroys the image by cleaning up all associated resources.\n *\n * This method disposes of the material resources and calls the parent\n * destroy method to clean up the underlying UI element. After calling\n * this method, the image should not be used anymore.\n */\n public override destroy(): void {\n this.material.dispose();\n super.destroy();\n }\n}\n","import type { Texture } from \"three\";\nimport { Color, ShaderMaterial, UniformsUtils } from \"three\";\n\nexport class UIProgressMaterial extends ShaderMaterial {\n constructor(foregroundTexture: Texture, backgroundTexture?: Texture) {\n super({\n uniforms: UniformsUtils.merge([\n {\n background: { value: backgroundTexture },\n foreground: { value: foregroundTexture },\n progress: { value: 1 },\n backgroundColor: { value: new Color(1, 1, 1) },\n foregroundColor: { value: new Color(1, 1, 1) },\n color: { value: new Color(1, 1, 1) },\n backgroundOpacity: { value: 1 },\n foregroundOpacity: { value: 1 },\n opacity: { value: 1 },\n angle: { value: 0 },\n direction: { value: 1 },\n },\n ]),\n vertexShader: /* glsl */ `\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n `,\n fragmentShader: /* glsl */ `\n uniform sampler2D background;\n uniform sampler2D foreground;\n uniform float progress;\n uniform vec3 backgroundColor;\n uniform vec3 foregroundColor;\n uniform vec3 color;\n uniform float backgroundOpacity;\n uniform float foregroundOpacity;\n uniform float opacity;\n uniform float angle;\n uniform float direction;\n varying vec2 vUv;\n\n void main() {\n vec4 backgroundTexture = texture2D(background, vUv);\n vec4 foregroundTexture = texture2D(foreground, vUv);\n\n // Apply common color and opacity\n vec3 finalBackgroundColor = backgroundTexture.rgb * backgroundColor * color;\n vec3 finalForegroundColor = foregroundTexture.rgb * foregroundColor * color;\n float finalBackgroundOpacity = backgroundTexture.a * backgroundOpacity * opacity;\n float finalForegroundOpacity = foregroundTexture.a * foregroundOpacity * opacity;\n\n vec4 backgroundColor = vec4(finalBackgroundColor, finalBackgroundOpacity);\n vec4 foregroundColor = vec4(finalForegroundColor, finalForegroundOpacity);\n\n // Calculate progress threshold with angle and direction\n float adjustedX = mix(vUv.x, 1.0 - vUv.x, step(0.0, -direction));\n float tanAngle = tan(angle);\n float threshold = adjustedX - (vUv.y - 0.5) * tanAngle * sign(direction);\n float progressMask = smoothstep(threshold - 0.01, threshold + 0.01, progress);\n\n gl_FragColor = mix(backgroundColor, foregroundColor, progressMask);\n #include <colorspace_fragment>\n }\n `,\n transparent: true,\n lights: false,\n fog: false,\n depthWrite: false,\n depthTest: false,\n });\n }\n\n public getProgress(): number {\n return this.uniforms.progress.value;\n }\n\n public getBackgroundTexture(): Texture | undefined {\n return this.uniforms.background.value;\n }\n\n public getForegroundTexture(): Texture {\n return this.uniforms.foreground.value;\n }\n\n public getBackgroundColor(): number {\n return (this.uniforms.color.value as Color).getHex();\n }\n\n public getForegroundColor(): number {\n return (this.uniforms.color.value as Color).getHex();\n }\n\n public getBackgroundOpacity(): number {\n return this.uniforms.backgroundOpacity.value;\n }\n\n public getForegroundOpacity(): number {\n return this.uniforms.foregroundOpacity.value;\n }\n\n public getAngle(): number {\n return this.uniforms.angle.value;\n }\n\n public getIsForwardDirection(): boolean {\n return this.uniforms.direction.value === 1;\n }\n\n public setProgress(value: number): void {\n this.uniforms.progress.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setBackgroundTexture(value: Texture | undefined): void {\n this.uniforms.background.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setForegroundTexture(value: Texture): void {\n this.uniforms.foreground.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setBackgroundColor(value: number): void {\n (this.uniforms.color.value as Color).setHex(value);\n this.uniformsNeedUpdate = true;\n }\n\n public setForegroundColor(value: number): void {\n (this.uniforms.color.value as Color).setHex(value);\n this.uniformsNeedUpdate = true;\n }\n\n public setBackgroundOpacity(value: number): void {\n this.uniforms.backgroundOpacity.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setForegroundOpacity(value: number): void {\n this.uniforms.foregroundOpacity.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setAngle(value: number): void {\n this.uniforms.angle.value = value;\n this.uniformsNeedUpdate = true;\n }\n\n public setIsForwardDirection(value: boolean): void {\n this.uniforms.direction.value = value ? 1 : -1;\n this.uniformsNeedUpdate = true;\n }\n}\n","import type { Texture } from \"three\";\nimport { MathUtils, Mesh } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIProgressMaterial } from \"../materials/UIProgressMaterial\";\nimport { assertValidPositiveNumber } from \"../miscellaneous/asserts\";\nimport { geometry } from \"../miscellaneous/threeInstances\";\nimport { UIElement } from \"./UIElement\";\n\nexport interface UIProgressOptions {\n x: number;\n y: number;\n textureBackground: Texture;\n progress: number;\n isForegroundDirection: boolean;\n angle: number;\n backgroundColor: number;\n foregroundColor: number;\n backgroundOpacity: number;\n foregroundOpacity: number;\n}\n\nexport class UIProgress extends UIElement<Mesh> {\n private readonly material: UIProgressMaterial;\n\n constructor(\n layer: UILayer,\n textureForeground: Texture,\n options: Partial<UIProgressOptions> = {},\n ) {\n const foregroundWidth = textureForeground.image?.width;\n const foregroundHeight = textureForeground.image?.height;\n\n assertValidPositiveNumber(\n foregroundWidth,\n \"UIProgress foreground texture width\",\n );\n assertValidPositiveNumber(\n foregroundHeight,\n \"UIProgress foreground texture height\",\n );\n\n const backgroundWidth = options.textureBackground?.image?.width;\n const backgroundHeight = options.textureBackground?.image?.height;\n\n if (options.textureBackground) {\n assertValidPositiveNumber(\n backgroundWidth,\n \"UIProgress background texture width\",\n );\n assertValidPositiveNumber(\n backgroundHeight,\n \"UIProgress background texture height\",\n );\n }\n\n const material = new UIProgressMaterial(\n textureForeground,\n options.textureBackground,\n );\n const object = new Mesh(geometry, material);\n\n if (options.progress !== undefined) {\n material.setProgress(options.progress);\n }\n\n if (options.isForegroundDirection !== undefined) {\n material.setIsForwardDirection(options.isForegroundDirection);\n }\n\n if (options.angle !== undefined) {\n material.setAngle(MathUtils.degToRad(options.angle));\n }\n\n if (options.backgroundColor !== undefined) {\n material.setBackgroundColor(options.backgroundColor);\n }\n\n if (options.foregroundColor !== undefined) {\n material.setForegroundColor(options.foregroundColor);\n }\n\n if (options.backgroundOpacity !== undefined) {\n material.setBackgroundOpacity(options.backgroundOpacity);\n }\n\n if (options.foregroundOpacity !== undefined) {\n material.setForegroundOpacity(options.foregroundOpacity);\n }\n\n const imageWidth = backgroundWidth ?? foregroundWidth;\n const imageHeight = foregroundHeight ?? backgroundHeight;\n\n super(\n layer,\n options.x ?? 0,\n options.y ?? 0,\n imageWidth,\n imageHeight,\n object,\n );\n\n this.material = material;\n }\n\n public get progress(): number {\n return this.material.getProgress();\n }\n\n public get backgroundTexture(): Texture | undefined {\n return this.material.getBackgroundTexture();\n }\n\n public get foregroundTexture(): Texture {\n return this.material.getForegroundTexture();\n }\n\n public get backgroundColor(): number {\n return this.material.getBackgroundColor();\n }\n\n public get foregroundColor(): number {\n return this.material.getForegroundColor();\n }\n\n public get backgroundOpacity(): number {\n return this.material.getBackgroundOpacity();\n }\n\n public get foregroundOpacity(): number {\n return this.material.getForegroundOpacity();\n }\n\n public get angle(): number {\n return MathUtils.radToDeg(this.material.getAngle());\n }\n\n public get isForwardDirection(): boolean {\n return this.material.getIsForwardDirection();\n }\n\n public set progress(value: number) {\n this.material.setProgress(value);\n }\n\n public set backgroundTexture(value: Texture | undefined) {\n if (value) {\n const width = value.image.width;\n const height = value.image.height;\n\n assertValidPositiveNumber(width, \"UIElement background texture width\");\n assertValidPositiveNumber(height, \"UIElement background texture height\");\n }\n\n this.material.setBackgroundTexture(value);\n }\n\n public set foregroundTexture(value: Texture) {\n const width = value.image.width;\n const height = value.image.height;\n\n assertValidPositiveNumber(width, \"UIImage texture width\");\n assertValidPositiveNumber(height, \"UIImage texture height\");\n\n this.material.setForegroundTexture(value);\n this.solverWrapper.suggestVariableValue(this.wVariable, width);\n this.solverWrapper.suggestVariableValue(this.hVariable, height);\n }\n\n public set backgroundColor(value: number) {\n this.material.setBackgroundColor(value);\n }\n\n public set foregroundColor(value: number) {\n this.material.setForegroundColor(value);\n }\n\n public set backgroundOpacity(value: number) {\n this.material.setBackgroundOpacity(value);\n }\n\n public set foregroundOpacity(value: number) {\n this.material.setForegroundOpacity(value);\n }\n\n public set angle(value: number) {\n this.material.setAngle(MathUtils.degToRad(value));\n }\n\n public set isForwardDirection(value: boolean) {\n this.material.setIsForwardDirection(value);\n }\n\n public override destroy(): void {\n this.material.dispose();\n super.destroy();\n }\n}\n","import type { Camera, WebGLRenderer } from \"three\";\nimport {\n LinearFilter,\n Mesh,\n PerspectiveCamera,\n RGBAFormat,\n Scene,\n UnsignedByteType,\n WebGLRenderTarget,\n} from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIMaterial } from \"../materials/UIMaterial\";\nimport { geometry } from \"../miscellaneous/threeInstances\";\nimport { UIElement } from \"./UIElement\";\n\n/**\n * Update modes for controlling when the 3D scene should be re-rendered.\n */\nexport enum UISceneUpdateMode {\n /** Re-render the scene every frame. */\n EACH_FRAME = 1,\n /** Re-render the scene every second frame for performance. */\n EACH_SECOND_FRAME = 2,\n /** Re-render the scene only when properties change. */\n PROPERTY_CHANGED = 3,\n /** Re-render the scene only when manually requested. */\n MANUAL = 4,\n}\n\n/** Default resolution factor for render target sizing. */\nconst DEFAULT_RESOLUTION_FACTOR = 0.5;\n/** Minimum allowed resolution factor to prevent performance issues. */\nconst MIN_RESOLUTION_FACTOR = 0.1;\n/** Maximum allowed resolution factor to prevent memory issues. */\nconst MAX_RESOLUTION_FACTOR = 2;\n/** Default width for the scene render target in pixels. */\nconst DEFAULT_WIDTH = 512;\n/** Default height for the scene render target in pixels. */\nconst DEFAULT_HEIGHT = 512;\n/** Default field of view for the perspective camera in degrees. */\nconst DEFAULT_CAMERA_FOV = 75;\n/** Default near clipping plane distance for the camera. */\nconst DEFAULT_CAMERA_NEAR = 0.1;\n/** Default far clipping plane distance for the camera. */\nconst DEFAULT_CAMERA_FAR = 100;\n/** Default update mode for scene rendering. */\nconst DEFAULT_UPDATE_MODE = UISceneUpdateMode.PROPERTY_CHANGED;\n/** Default clear color for the render target. */\nconst DEFAULT_CLEAR_COLOR = 0x000000;\n/** Default clear alpha for the render target. */\nconst DEFAULT_CLEAR_ALPHA = 0;\n/** Default depth buffer usage setting. */\nconst DEFAULT_USE_DEPTH = true;\n\n/**\n * Configuration options for UIScene element creation.\n */\nexport interface UISceneOptions {\n /** Initial x-coordinate position. */\n x: number;\n /** Initial y-coordinate position. */\n y: number;\n /** Width of the scene render target in pixels. */\n width: number;\n /** Height of the scene render target in pixels. */\n height: number;\n\n /** Three.js scene to render. */\n scene: Scene;\n /** Camera to use for rendering the scene. */\n camera: Camera;\n /** Update mode controlling when the scene is re-rendered. */\n updateMode: UISceneUpdateMode;\n /** Resolution factor for render target sizing (0.1 to 2.0). */\n resolutionFactor: number;\n /** Clear color for the render target background. */\n clearColor: number;\n /** Clear alpha for the render target background. */\n clearAlpha: number;\n /** Whether to enable depth buffer for the render target. */\n enableDepthBuffer: boolean;\n}\n\n/**\n * UI element for rendering 3D scenes to texture within the UI system.\n *\n * UIScene is a concrete implementation of UIElement that renders a Three.js\n * scene to a WebGL render target and displays it as a texture. It provides\n * control over rendering frequency, resolution, and visual properties. This\n * allows embedding complex 3D content within the 2D UI layout system with\n * performance optimizations through configurable update modes.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link UISceneUpdateMode} - Update mode configuration\n * @see {@link Scene} - Three.js scene for 3D content\n * @see {@link Camera} - Three.js camera for scene rendering\n */\nexport class UIScene extends UIElement<Mesh> {\n /** The material used for rendering the scene texture. */\n private readonly material: UIMaterial;\n\n /** The WebGL render target for off-screen scene rendering. */\n private readonly renderTarget: WebGLRenderTarget;\n\n /** Internal storage for the current Three.js scene. */\n private sceneInternal: Scene;\n /** Internal storage for the current camera. */\n private cameraInternal: Camera;\n /** Internal storage for the current update mode. */\n private updateModeInternal: UISceneUpdateMode;\n /** Internal storage for the current resolution factor. */\n private resolutionFactorInternal: number;\n /** Internal storage for the current clear color. */\n private clearColorInternal: number;\n /** Internal storage for the current clear alpha. */\n private clearAlphaInternal: number;\n\n /** Frame alternation boolean for EACH_SECOND_FRAME update mode. */\n private frameBoolean = true;\n /** Flag indicating if properties have changed requiring a re-render. */\n private propertyChanged = false;\n /** Flag indicating if a manual render has been requested. */\n private renderRequired = false;\n\n /**\n * Creates a new UIScene instance with 3D scene rendering capabilities.\n *\n * The scene element creates a WebGL render target for off-screen rendering\n * and displays the result as a texture. A default perspective camera is\n * created if none is provided.\n *\n * @param layer - The UI layer that contains this scene element\n * @param options - Configuration options for scene rendering\n * @throws Will throw an error if resolution factor is outside valid range (0.1-2.0)\n */\n constructor(layer: UILayer, options: Partial<UISceneOptions> = {}) {\n const resolutionFactor =\n options.resolutionFactor ?? DEFAULT_RESOLUTION_FACTOR;\n\n if (\n resolutionFactor < MIN_RESOLUTION_FACTOR ||\n resolutionFactor > MAX_RESOLUTION_FACTOR\n ) {\n throw new Error(\n `Invalid resolution factor: ${resolutionFactor}. Must be between ${MIN_RESOLUTION_FACTOR} and ${MAX_RESOLUTION_FACTOR}.`,\n );\n }\n\n const width = options.width ?? DEFAULT_WIDTH;\n const height = options.height ?? DEFAULT_HEIGHT;\n\n const renderTarget = new WebGLRenderTarget(\n width * resolutionFactor,\n height * resolutionFactor,\n {\n format: RGBAFormat,\n minFilter: LinearFilter,\n magFilter: LinearFilter,\n type: UnsignedByteType,\n depthBuffer: options.enableDepthBuffer ?? DEFAULT_USE_DEPTH,\n stencilBuffer: false,\n },\n );\n\n const material = new UIMaterial(renderTarget.texture);\n const object = new Mesh(geometry, material);\n\n super(layer, 0, 0, width, height, object);\n\n this.material = material;\n this.renderTarget = renderTarget;\n\n this.sceneInternal = options.scene ?? new Scene();\n this.cameraInternal =\n options.camera ??\n new PerspectiveCamera(\n DEFAULT_CAMERA_FOV,\n width / height,\n DEFAULT_CAMERA_NEAR,\n DEFAULT_CAMERA_FAR,\n );\n\n this.resolutionFactorInternal = resolutionFactor;\n this.updateModeInternal = options.updateMode ?? DEFAULT_UPDATE_MODE;\n\n this.clearColorInternal = options.clearColor ?? DEFAULT_CLEAR_COLOR;\n this.clearAlphaInternal = options.clearAlpha ?? DEFAULT_CLEAR_ALPHA;\n\n if (options.updateMode === UISceneUpdateMode.PROPERTY_CHANGED) {\n this.renderRequired = true;\n }\n }\n\n /**\n * Gets the current color tint applied to the scene texture.\n * @returns The color value as a number (e.g., 0xFFFFFF for white)\n */\n public get color(): number {\n return this.material.getColor();\n }\n\n /**\n * Gets the current opacity level of the scene texture.\n * @returns The opacity value between 0.0 (transparent) and 1.0 (opaque)\n */\n public get opacity(): number {\n return this.material.getOpacity();\n }\n\n /**\n * Gets whether transparency is enabled for the scene texture.\n * @returns True if transparency is enabled, false otherwise\n */\n public get transparency(): boolean {\n return this.material.getTransparency();\n }\n\n /**\n * Gets the Three.js scene being rendered.\n * @returns The current Three.js scene\n */\n public get scene(): Scene {\n return this.sceneInternal;\n }\n\n /**\n * Gets the camera used for rendering the scene.\n * @returns The current Three.js camera\n */\n public get camera(): Camera {\n return this.cameraInternal;\n }\n\n /**\n * Gets the current update mode controlling render frequency.\n * @returns The current update mode\n */\n public get updateMode(): UISceneUpdateMode {\n return this.updateModeInternal;\n }\n\n /**\n * Gets the resolution factor for render target sizing.\n * @returns The resolution factor between 0.1 and 2.0\n */\n public get resolutionFactor(): number {\n return this.resolutionFactorInternal;\n }\n\n /**\n * Gets the clear color used for the render target background.\n * @returns The clear color as a number\n */\n public get clearColor(): number {\n return this.clearColorInternal;\n }\n\n /**\n * Gets the clear alpha used for the render target background.\n * @returns The clear alpha value between 0.0 and 1.0\n */\n public get clearAlpha(): number {\n return this.clearAlphaInternal;\n }\n\n /**\n * Sets the color tint applied to the scene texture.\n * @param value - The color value as a number (e.g., 0xFFFFFF for white)\n */\n public set color(value: number) {\n this.material.setColor(value);\n }\n\n /**\n * Sets the opacity level of the scene texture.\n * @param value - The opacity value between 0.0 (transparent) and 1.0 (opaque)\n */\n public set opacity(value: number) {\n this.material.setOpacity(value);\n }\n\n /**\n * Sets whether transparency is enabled for the scene texture.\n * @param value - True to enable transparency, false to disable\n */\n public set transparency(value: boolean) {\n this.material.setTransparency(value);\n }\n\n /**\n * Sets a new Three.js scene to render and marks for re-render.\n * @param value - The new Three.js scene\n */\n public set scene(value: Scene) {\n if (this.sceneInternal !== value) {\n this.sceneInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets a new camera for rendering and marks for re-render.\n * @param value - The new Three.js camera\n */\n public set camera(value: Camera) {\n if (this.cameraInternal !== value) {\n this.cameraInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the update mode controlling render frequency and marks for re-render.\n * @param value - The new update mode\n */\n public set updateMode(value: UISceneUpdateMode) {\n if (this.updateModeInternal !== value) {\n this.updateModeInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the resolution factor and resizes the render target accordingly.\n * @param value - The new resolution factor between 0.1 and 2.0\n */\n public set resolutionFactor(value: number) {\n if (this.resolutionFactorInternal !== value) {\n this.resolutionFactorInternal = value;\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the clear color for the render target background and marks for re-render.\n * @param value - The new clear color as a number\n */\n public set clearColor(value: number) {\n if (this.clearColorInternal !== value) {\n this.clearColorInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Sets the clear alpha for the render target background and marks for re-render.\n * @param value - The new clear alpha value between 0.0 and 1.0\n */\n public set clearAlpha(value: number) {\n if (this.clearAlphaInternal !== value) {\n this.clearAlphaInternal = value;\n this.propertyChanged = true;\n }\n }\n\n /**\n * Destroys the scene element by cleaning up all associated resources.\n *\n * This method disposes of the material and render target resources,\n * and calls the parent destroy method to clean up the underlying UI element.\n * After calling this method, the scene element should not be used anymore.\n */\n public override destroy(): void {\n this.material.dispose();\n this.renderTarget.dispose();\n super.destroy();\n }\n\n /**\n * Manually requests a re-render of the scene.\n *\n * This method is useful when the update mode is set to MANUAL and you\n * want to trigger a scene re-render without changing any properties.\n */\n public requestRender(): void {\n this.renderRequired = true;\n }\n\n /**\n * Internal method called before rendering each frame.\n *\n * This method handles the conditional rendering of the 3D scene based on\n * the current update mode. It manages frame counting, property change detection,\n * and manual render requests to optimize performance.\n *\n * @param renderer - The WebGL renderer instance\n * @internal\n */\n protected override [\"onBeforeRenderInternal\"](renderer: WebGLRenderer): void {\n if (\n this.updateModeInternal === UISceneUpdateMode.EACH_FRAME ||\n (this.updateModeInternal === UISceneUpdateMode.EACH_SECOND_FRAME &&\n this.frameBoolean) ||\n (this.updateModeInternal === UISceneUpdateMode.PROPERTY_CHANGED &&\n this.propertyChanged) ||\n (this.updateModeInternal === UISceneUpdateMode.MANUAL &&\n this.renderRequired)\n ) {\n this.renderRequired = false;\n this.propertyChanged = false;\n this.frameBoolean = !this.frameBoolean;\n\n this.renderTarget.setSize(\n this.width * this.resolutionFactorInternal,\n this.height * this.resolutionFactorInternal,\n );\n renderer.setClearColor(this.clearColorInternal, this.clearAlpha);\n renderer.setRenderTarget(this.renderTarget);\n renderer.clear(true, true, false);\n renderer.render(this.sceneInternal, this.cameraInternal);\n }\n }\n}\n","import {\n assertValidNonNegativeNumber,\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"./asserts\";\n\nexport interface UITextStyle {\n color: string;\n\n fontFamily: string;\n fontSize: number;\n fontStyle: \"normal\" | \"italic\" | \"oblique\";\n fontWeight: \"normal\" | \"bold\" | \"bolder\" | \"lighter\" | number;\n lineHeight: number;\n\n enableShadow: boolean;\n shadowOffsetX: number;\n shadowOffsetY: number;\n shadowBlur: number;\n shadowColor: string;\n\n enableStroke: boolean;\n strokeColor: string;\n strokeWidth: number;\n}\n\nexport function isUITextStyle(obj: unknown): obj is UITextStyle {\n if (typeof obj !== \"object\" || obj === null) {\n return false;\n }\n\n const candidate = obj as Record<string, unknown>;\n\n return (\n typeof candidate.color === \"string\" &&\n typeof candidate.fontFamily === \"string\" &&\n typeof candidate.fontSize === \"number\" &&\n (candidate.fontStyle === \"normal\" ||\n candidate.fontStyle === \"italic\" ||\n candidate.fontStyle === \"oblique\") &&\n (candidate.fontWeight === \"normal\" ||\n candidate.fontWeight === \"bold\" ||\n candidate.fontWeight === \"bolder\" ||\n candidate.fontWeight === \"lighter\" ||\n typeof candidate.fontWeight === \"number\") &&\n typeof candidate.lineHeight === \"number\" &&\n typeof candidate.enableShadow === \"boolean\" &&\n typeof candidate.shadowOffsetX === \"number\" &&\n typeof candidate.shadowOffsetY === \"number\" &&\n typeof candidate.shadowBlur === \"number\" &&\n typeof candidate.shadowColor === \"string\" &&\n typeof candidate.enableStroke === \"boolean\" &&\n typeof candidate.strokeColor === \"string\" &&\n typeof candidate.strokeWidth === \"number\"\n );\n}\n\nconst DEFAULT_TEXT_STYLE: UITextStyle = {\n color: \"#000000\",\n\n fontFamily: \"Arial\",\n fontSize: 16,\n fontStyle: \"normal\",\n fontWeight: \"normal\",\n lineHeight: 1.2,\n\n enableShadow: false,\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 0,\n shadowColor: \"transparent\",\n\n enableStroke: false,\n strokeColor: \"#000000\",\n strokeWidth: 0,\n};\n\nexport function resolveTextStyle(\n style?: Partial<UITextStyle>,\n commonStyle?: Partial<UITextStyle>,\n): UITextStyle {\n const fontSize =\n style?.fontSize ?? commonStyle?.fontSize ?? DEFAULT_TEXT_STYLE.fontSize;\n assertValidPositiveNumber(fontSize, \"Font size\");\n\n const fontWeight = style?.fontWeight ?? commonStyle?.fontWeight ?? \"normal\";\n if (typeof fontWeight === \"number\") {\n assertValidPositiveNumber(fontWeight, \"Font weight\");\n }\n\n const lineHeight =\n style?.lineHeight ??\n commonStyle?.lineHeight ??\n fontSize * DEFAULT_TEXT_STYLE.lineHeight;\n assertValidNumber(lineHeight, \"Line height\");\n\n const shadowOffsetX =\n style?.shadowOffsetX ??\n commonStyle?.shadowOffsetX ??\n DEFAULT_TEXT_STYLE.shadowOffsetX;\n assertValidNonNegativeNumber(shadowOffsetX, \"Shadow offset X\");\n\n const shadowOffsetY =\n style?.shadowOffsetY ??\n commonStyle?.shadowOffsetY ??\n DEFAULT_TEXT_STYLE.shadowOffsetY;\n assertValidNonNegativeNumber(shadowOffsetY, \"Shadow offset Y\");\n\n const shadowBlur =\n style?.shadowBlur ??\n commonStyle?.shadowBlur ??\n DEFAULT_TEXT_STYLE.shadowBlur;\n assertValidNonNegativeNumber(shadowBlur, \"Shadow blur\");\n\n const strokeWidth =\n style?.strokeWidth ??\n commonStyle?.strokeWidth ??\n DEFAULT_TEXT_STYLE.strokeWidth;\n assertValidNonNegativeNumber(strokeWidth, \"Stroke width\");\n\n return {\n color: style?.color ?? commonStyle?.color ?? DEFAULT_TEXT_STYLE.color,\n\n fontFamily:\n style?.fontFamily ??\n commonStyle?.fontFamily ??\n DEFAULT_TEXT_STYLE.fontFamily,\n fontSize,\n fontStyle:\n style?.fontStyle ??\n commonStyle?.fontStyle ??\n DEFAULT_TEXT_STYLE.fontStyle,\n fontWeight,\n lineHeight,\n\n enableShadow:\n style?.enableShadow ??\n commonStyle?.enableShadow ??\n DEFAULT_TEXT_STYLE.enableShadow,\n shadowOffsetX,\n shadowOffsetY,\n shadowBlur,\n shadowColor:\n style?.shadowColor ??\n commonStyle?.shadowColor ??\n DEFAULT_TEXT_STYLE.shadowColor,\n\n enableStroke:\n style?.enableStroke ??\n commonStyle?.enableStroke ??\n DEFAULT_TEXT_STYLE.enableStroke,\n strokeColor:\n style?.strokeColor ??\n commonStyle?.strokeColor ??\n DEFAULT_TEXT_STYLE.strokeColor,\n strokeWidth,\n };\n}\n","import type {\n UIChunkMetrics,\n UITextChunk,\n UITextContent,\n UITextLine,\n UITextSize,\n} from \"./textInterfaces\";\nimport { resolveTextStyle, type UITextStyle } from \"./UITextStyle\";\n\nexport function splitText(text: string): string[] {\n return text.match(/\\S+|\\s|\\n/g) ?? [];\n}\n\nexport function measureTextChunk(\n context: CanvasRenderingContext2D,\n chunk: string,\n style: UITextStyle,\n): UIChunkMetrics {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (chunk === \"\\n\") {\n return {\n width: Math.ceil(0),\n height: style.lineHeight,\n baseline: 0,\n lineHeight: style.lineHeight,\n };\n }\n\n const metrics = context.measureText(chunk);\n const width = Math.ceil(metrics.width);\n const height = Math.ceil(\n metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n );\n\n return {\n width,\n height,\n baseline: metrics.actualBoundingBoxDescent,\n lineHeight: style.lineHeight,\n };\n}\n\nexport function buildLines(\n maxWidth: number,\n chunks: UITextChunk[],\n): UITextLine[] {\n const lines: UITextLine[] = [];\n let currentLine: UITextChunk[] = [];\n let currentWidth = 0;\n let currentHeight = 0;\n let currentBaseline = 0;\n let currentLineHeight = 0;\n\n for (const chunk of chunks) {\n if (chunk.text === \"\\n\") {\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n currentLine = [];\n currentWidth = 0;\n currentHeight = 0;\n currentBaseline = 0;\n currentLineHeight = 0;\n continue;\n }\n\n if (\n currentWidth + chunk.metrics.width <= maxWidth ||\n currentLine.length === 0\n ) {\n currentLine.push(chunk);\n currentWidth += chunk.metrics.width;\n currentHeight = Math.max(currentHeight, chunk.metrics.height);\n currentBaseline = Math.max(currentBaseline, chunk.metrics.baseline);\n currentLineHeight = Math.max(currentLineHeight, chunk.metrics.lineHeight);\n } else {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n currentLine = [chunk];\n currentWidth = chunk.metrics.width;\n currentHeight = chunk.metrics.height;\n currentBaseline = chunk.metrics.baseline;\n currentLineHeight = chunk.metrics.lineHeight;\n }\n }\n\n if (currentLine.length > 0) {\n lines.push({\n chunks: currentLine,\n width: currentWidth,\n height: currentHeight,\n baseline: currentBaseline,\n lineHeight: currentLineHeight,\n });\n }\n\n return lines;\n}\n\nexport function calculateTextSize(lines: UITextLine[]): UITextSize {\n if (lines.length === 0) {\n return { width: 0, height: 0 };\n }\n\n const maxLineWidth = Math.max(...lines.map((line) => line.width));\n\n let totalHeight = 0;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n totalHeight += i === 0 ? line.height : line.lineHeight;\n\n if (i === lines.length - 1) {\n totalHeight += line.baseline;\n }\n }\n\n return {\n width: maxLineWidth,\n height: totalHeight,\n };\n}\n\nexport function renderText(\n x: number,\n y: number,\n text: string,\n style: UITextStyle,\n context: CanvasRenderingContext2D,\n): void {\n context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize}px ${style.fontFamily}`;\n\n if (style.enableShadow) {\n context.shadowOffsetX = style.shadowOffsetX;\n context.shadowOffsetY = style.shadowOffsetY;\n context.shadowBlur = style.shadowBlur;\n context.shadowColor = style.shadowColor;\n }\n\n if (style.enableStroke) {\n context.strokeStyle = style.strokeColor;\n context.lineWidth = style.strokeWidth;\n context.strokeText(text, x, y);\n }\n\n context.fillStyle = style.color;\n context.fillText(text, x, y);\n}\n\nexport function renderTextLines(\n paddingTop: number,\n paddingLeft: number,\n lines: UITextLine[],\n context: CanvasRenderingContext2D,\n): void {\n let currentY = paddingTop;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n let currentX = paddingLeft;\n currentY += i === 0 ? line.height : line.lineHeight;\n\n for (const chunk of line.chunks) {\n renderText(currentX, currentY, chunk.text, chunk.style, context);\n currentX += chunk.metrics.width;\n }\n }\n}\n\nexport function calculateTextContentParameters(\n context: CanvasRenderingContext2D,\n content: UITextContent,\n maxLineWidth: number,\n commonStyle?: Partial<UITextStyle>,\n): { lines: UITextLine[]; size: UITextSize } {\n const chunks: UITextChunk[] = [];\n\n for (const span of Array.isArray(content) ? content : [content]) {\n const isSpanString = typeof span === \"string\";\n const spanString = isSpanString ? span : span.text;\n const style = resolveTextStyle(\n isSpanString ? undefined : span.style,\n commonStyle,\n );\n\n for (const text of splitText(spanString)) {\n const metrics = measureTextChunk(context, text, style);\n chunks.push({ text, style, metrics });\n }\n }\n\n const lines = buildLines(maxLineWidth, chunks);\n const textSize = calculateTextSize(lines);\n\n return { lines, size: textSize };\n}\n","import { assertValidNonNegativeNumber } from \"./asserts\";\n\nexport interface UITextPadding {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\nexport function resolvePadding(value: unknown): UITextPadding {\n if (typeof value === \"number\") {\n return { left: value, right: value, top: value, bottom: value };\n }\n\n if (typeof value === \"object\" && value !== null) {\n const left =\n \"left\" in value && typeof value.left === \"number\" ? value.left : 0;\n const right =\n \"right\" in value && typeof value.right === \"number\" ? value.right : 0;\n const top = \"top\" in value && typeof value.top === \"number\" ? value.top : 0;\n const bottom =\n \"bottom\" in value && typeof value.bottom === \"number\" ? value.bottom : 0;\n\n assertValidNonNegativeNumber(left, \"Padding left\");\n assertValidNonNegativeNumber(right, \"Padding right\");\n assertValidNonNegativeNumber(top, \"Padding top\");\n assertValidNonNegativeNumber(bottom, \"Padding bottom\");\n\n return { left, right, top, bottom };\n }\n\n return { left: 0, right: 0, top: 0, bottom: 0 };\n}\n","import type { WebGLRenderer } from \"three\";\nimport { CanvasTexture, Mesh } from \"three\";\nimport type { UILayer } from \"../layers/UILayer\";\nimport { UIMaterial } from \"../materials/UIMaterial\";\nimport type { UITextContent } from \"../miscellaneous/textInterfaces\";\nimport {\n calculateTextContentParameters,\n renderTextLines,\n} from \"../miscellaneous/textTools\";\nimport { geometry } from \"../miscellaneous/threeInstances\";\nimport {\n resolvePadding,\n type UITextPadding,\n} from \"../miscellaneous/UITextPadding\";\nimport { type UITextStyle } from \"../miscellaneous/UITextStyle\";\nimport { UIElement } from \"./UIElement\";\n\n/** Default maximum width for text elements in pixels. */\nconst DEFAULT_MAX_WIDTH = 1024;\n\n/**\n * Configuration options for UIText element creation.\n */\nexport interface UITextOptions {\n /** Maximum width in pixels before text wrapping occurs. */\n maxWidth: number;\n /** Padding configuration for text content. */\n padding: Partial<UITextPadding>;\n /** Common style properties applied to all text content. */\n commonStyle: Partial<UITextStyle>;\n}\n\n/**\n * UI element for rendering dynamic text with canvas-based rendering.\n *\n * UIText is a concrete implementation of UIElement that renders text content\n * using HTML5 Canvas and displays it as a texture. It supports rich text\n * formatting, automatic text wrapping, padding, and dynamic resizing based\n * on content. The text is rendered to a canvas texture which is then applied\n * to a Three.js mesh for display in the 3D scene.\n *\n * @see {@link UIElement} - Base class providing UI element functionality\n * @see {@link UITextContent} - Text content structure\n * @see {@link UITextStyle} - Text styling options\n * @see {@link UITextPadding} - Padding configuration\n */\nexport class UIText extends UIElement<Mesh> {\n /** The material used for rendering the text texture. */\n private readonly material: UIMaterial;\n\n /** The canvas texture containing the rendered text. */\n private readonly texture: CanvasTexture;\n\n /** The HTML canvas element used for text rendering. */\n private readonly canvas: HTMLCanvasElement;\n\n /** The 2D rendering context for drawing text on the canvas. */\n private readonly context: CanvasRenderingContext2D;\n\n /** Internal storage for the current text content. */\n private contentInternal: UITextContent;\n\n /** Internal storage for the maximum width before text wrapping. */\n private maxWidthInternal: number;\n\n /** Internal storage for the current padding configuration. */\n private paddingInternal: UITextPadding;\n\n /** Internal storage for the common text style properties. */\n private commonStyleInternal: Partial<UITextStyle>;\n\n /** Target aspect ratio for the text element based on content. */\n private targetAspectRatio = 1;\n\n /** Last calculated aspect ratio for comparison during rendering. */\n private lastAspectRatio = 1;\n\n /**\n * Creates a new UIText instance with dynamic text rendering.\n *\n * The text element will automatically size itself based on the content\n * and specified options. A canvas is created for rendering the text,\n * which is then used as a texture for the 3D mesh.\n *\n * @param layer - The UI layer that contains this text element\n * @param content - The text content to display\n * @param options - Configuration options for text rendering\n * @param x - Initial x-coordinate position (defaults to 0)\n * @param y - Initial y-coordinate position (defaults to 0)\n * @throws Will throw an error if canvas context creation fails\n */\n constructor(\n layer: UILayer,\n content: UITextContent,\n options: Partial<UITextOptions> = {},\n x = 0,\n y = 0,\n ) {\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n\n if (!context) {\n throw new Error(\"Failed to create canvas context\");\n }\n\n const texture = new CanvasTexture(canvas);\n const material = new UIMaterial(texture);\n const object = new Mesh(geometry, material);\n\n super(layer, x, y, 2, 2, object);\n\n this.material = material;\n this.texture = texture;\n\n this.canvas = canvas;\n this.context = context;\n\n this.contentInternal = content;\n this.maxWidthInternal = options.maxWidth ?? DEFAULT_MAX_WIDTH;\n this.paddingInternal = resolvePadding(options.padding);\n this.commonStyleInternal = options.commonStyle ?? {};\n\n this.rebuildText();\n }\n\n /**\n * Gets the current color tint applied to the text.\n * @returns The color value as a number (e.g., 0xFFFFFF for white)\n */\n public get color(): number {\n return this.material.getColor();\n }\n\n /**\n * Gets the current opacity level of the text.\n * @returns The opacity value between 0.0 (transparent) and 1.0 (opaque)\n */\n public get opacity(): number {\n return this.material.getOpacity();\n }\n\n /**\n * Gets whether transparency is enabled for the text.\n * @returns True if transparency is enabled, false otherwise\n */\n public get transparency(): boolean {\n return this.material.getTransparency();\n }\n\n /**\n * Gets the current text content being displayed.\n * @returns The current text content structure\n */\n public get content(): UITextContent {\n return this.contentInternal;\n }\n\n /**\n * Gets the maximum width before text wrapping occurs.\n * @returns The maximum width in pixels\n */\n public get maxWidth(): number {\n return this.maxWidthInternal;\n }\n\n /**\n * Gets the current padding configuration.\n * @returns The padding configuration for all sides\n */\n public get padding(): UITextPadding {\n return this.paddingInternal;\n }\n\n /**\n * Gets the common style properties applied to the text.\n * @returns The partial text style configuration\n */\n public get commonStyle(): Partial<UITextStyle> {\n return this.commonStyleInternal;\n }\n\n /**\n * Sets the color tint applied to the text.\n * @param value - The color value as a number (e.g., 0xFFFFFF for white)\n */\n public set color(value: number) {\n this.material.setColor(value);\n }\n\n /**\n * Sets the opacity level of the text.\n * @param value - The opacity value between 0.0 (transparent) and 1.0 (opaque)\n */\n public set opacity(value: number) {\n this.material.setOpacity(value);\n }\n\n /**\n * Sets whether transparency is enabled for the text.\n * @param value - True to enable transparency, false to disable\n */\n public set transparency(value: boolean) {\n this.material.setTransparency(value);\n }\n\n /**\n * Sets new text content and triggers a rebuild.\n * @param value - The new text content structure\n */\n public set content(value: UITextContent) {\n this.contentInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets the maximum width before text wrapping and triggers a rebuild.\n * @param value - The new maximum width in pixels\n */\n public set maxWidth(value: number) {\n this.maxWidthInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets new padding configuration and triggers a rebuild.\n * @param value - The new padding configuration\n */\n public set padding(value: UITextPadding) {\n this.paddingInternal = value;\n this.rebuildText();\n }\n\n /**\n * Sets new common style properties and triggers a rebuild.\n * @param value - The new partial text style configuration\n */\n public set commonStyle(value: Partial<UITextStyle>) {\n this.commonStyleInternal = value;\n this.rebuildText();\n }\n\n /**\n * Destroys the text element by cleaning up all associated resources.\n *\n * This method disposes of the material and texture resources, removes\n * the canvas element from the DOM, and calls the parent destroy method\n * to clean up the underlying UI element. After calling this method,\n * the text element should not be used anymore.\n */\n public override destroy(): void {\n this.material.dispose();\n this.texture.dispose();\n this.canvas.remove();\n super.destroy();\n }\n\n /**\n * Internal method called before rendering each frame.\n *\n * Updates the element's height to maintain the correct aspect ratio\n * based on the text content dimensions. This ensures the text is\n * displayed without distortion.\n *\n * @param renderer - The WebGL renderer instance\n * @param deltaTime - Time elapsed since the last frame in seconds\n * @internal\n */\n protected override [\"onBeforeRenderInternal\"](\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- parameter required by parent\n renderer: WebGLRenderer,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- parameter required by parent\n deltaTime: number,\n ): void {\n if (this.lastAspectRatio !== this.width / this.height) {\n this.lastAspectRatio = this.targetAspectRatio;\n this.height = this.width / this.targetAspectRatio;\n }\n }\n\n /**\n * Rebuilds the text canvas and texture based on current content and settings.\n *\n * This method calculates the text layout, resizes the canvas to fit the content\n * with padding, renders the text lines to the canvas, and updates the texture.\n * It also calculates and sets the target aspect ratio for proper display.\n *\n * @private\n */\n private rebuildText(): void {\n const { lines, size } = calculateTextContentParameters(\n this.context,\n this.content,\n this.maxWidthInternal,\n this.commonStyleInternal,\n );\n\n this.canvas.width =\n size.width + this.paddingInternal.left + this.paddingInternal.right;\n this.canvas.height =\n size.height + this.paddingInternal.top + this.paddingInternal.bottom;\n\n this.targetAspectRatio =\n (size.width + this.paddingInternal.left + this.paddingInternal.right) /\n (size.height + this.paddingInternal.top + this.paddingInternal.bottom);\n\n renderTextLines(\n this.paddingInternal.top,\n this.paddingInternal.left,\n lines,\n this.context,\n );\n this.texture.needsUpdate = true;\n }\n}\n","import type { WebGLRenderer } from \"three\";\nimport {\n assertValidNumber,\n assertValidPositiveNumber,\n} from \"../miscellaneous/asserts\";\nimport { UIOrientation } from \"../miscellaneous/UIOrientation\";\nimport { UILayer } from \"./UILayer\";\n\n/**\n * UI layer that manages fullscreen interfaces with optional fixed dimensions and automatic scaling.\n *\n * UIFullscreenLayer extends UILayer to provide automatic browser window integration,\n * handling window resize events and pointer interactions. It supports optional fixed\n * width or height constraints that enable responsive scaling while maintaining\n * design proportions across different screen sizes.\n *\n * The layer automatically calculates scaling factors based on the orientation and\n * fixed dimension constraints, ensuring consistent layout appearance regardless\n * of the actual browser window size.\n *\n * @see {@link UILayer} - Base layer functionality\n * @see {@link UIOrientation} - Orientation-based scaling behavior\n */\nexport class UIFullscreenLayer extends UILayer {\n /** Internal storage for the optional fixed width constraint. */\n private fixedWidthInternal?: number;\n /** Internal storage for the optional fixed height constraint. */\n private fixedHeightInternal?: number;\n\n /**\n * Creates a new UIFullscreenLayer instance with optional fixed dimensions.\n *\n * The layer will automatically resize to match the browser window and set up\n * event listeners for window resize and pointer events. Fixed dimensions\n * enable proportional scaling while maintaining design aspect ratios.\n *\n * @param fixedWidth - Optional fixed width for proportional scaling\n * @param fixedHeight - Optional fixed height for proportional scaling\n * @throws Will throw an error if fixed dimensions are not valid positive numbers\n * @see {@link assertValidPositiveNumber}\n */\n constructor(fixedWidth: number | undefined, fixedHeight: number | undefined) {\n if (fixedWidth !== undefined) {\n assertValidPositiveNumber(fixedWidth, \"UIFullscreenLayer.fixedWidth\");\n }\n if (fixedHeight !== undefined) {\n assertValidPositiveNumber(fixedHeight, \"UIFullscreenLayer.fixedHeight\");\n }\n\n super(1, 1);\n this.fixedWidthInternal = fixedWidth;\n this.fixedHeightInternal = fixedHeight;\n window.addEventListener(\"resize\", this.onResize);\n window.addEventListener(\"pointerdown\", this.onClick);\n this.onResize();\n }\n\n /**\n * Gets the current fixed width constraint.\n * @returns The fixed width in pixels, or undefined if not set\n */\n public get fixedWidth(): number | undefined {\n return this.fixedWidthInternal;\n }\n\n /**\n * Gets the current fixed height constraint.\n * @returns The fixed height in pixels, or undefined if not set\n */\n public get fixedHeight(): number | undefined {\n return this.fixedHeightInternal;\n }\n\n /**\n * Sets a new fixed width constraint and triggers resize recalculation.\n * @param value - The new fixed width in pixels, or undefined to remove constraint\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set fixedWidth(value: number | undefined) {\n if (value !== undefined) {\n assertValidPositiveNumber(value, \"UIFullscreenLayer.fixedWidth\");\n }\n\n if (value !== this.fixedWidthInternal) {\n this.fixedWidthInternal = value;\n this.onResize();\n }\n }\n\n /**\n * Sets a new fixed height constraint and triggers resize recalculation.\n * @param value - The new fixed height in pixels, or undefined to remove constraint\n * @throws Will throw an error if value is not a valid positive number\n * @see {@link assertValidPositiveNumber}\n */\n public set fixedHeight(value: number | undefined) {\n if (value !== undefined) {\n assertValidPositiveNumber(value, \"UIFullscreenLayer.fixedHeight\");\n }\n\n if (value !== this.fixedHeightInternal) {\n this.fixedHeightInternal = value;\n this.onResize();\n }\n }\n\n /**\n * Destroys the fullscreen layer by removing all event listeners.\n *\n * This method cleans up window event listeners for resize and pointer events.\n * After calling this method, the layer will no longer respond to window\n * changes and should not be used anymore.\n */\n public destroy(): void {\n window.removeEventListener(\"resize\", this.onResize);\n window.removeEventListener(\"pointerdown\", this.onClick);\n }\n\n /**\n * Renders the fullscreen layer and all its contained elements.\n *\n * Clears the depth and stencil buffers and delegates rendering to the\n * parent layer's render method. This ensures proper rendering order\n * and buffer management for fullscreen interfaces.\n *\n * @param renderer - The WebGL renderer instance\n * @param deltaTime - Time elapsed since the last frame in seconds\n * @throws Will throw an error if deltaTime is not a valid number\n * @see {@link assertValidNumber}\n */\n public render(renderer: WebGLRenderer, deltaTime: number): void {\n assertValidNumber(deltaTime, \"UIFullscreenLayer.deltaTime\");\n renderer.clear(false, true, true);\n super.renderInternal(renderer, deltaTime);\n }\n\n /**\n * Calculates the scaling factor based on orientation and fixed dimensions.\n *\n * The scaling factor is determined by the current orientation and which\n * fixed dimension constraint is active. In horizontal orientation, fixed\n * width takes precedence; in vertical orientation, fixed height takes precedence.\n *\n * @returns The scaling factor to apply to window dimensions\n * @private\n */\n private calculateScale(): number {\n if (this.orientation === UIOrientation.HORIZONTAL) {\n if (this.fixedWidth !== undefined) {\n return this.fixedWidth / window.innerWidth;\n } else if (this.fixedHeight !== undefined) {\n return this.fixedHeight / window.innerHeight;\n } else {\n return 1;\n }\n } else {\n if (this.fixedHeight !== undefined) {\n return this.fixedHeight / window.innerHeight;\n } else if (this.fixedWidth !== undefined) {\n return this.fixedWidth / window.innerWidth;\n } else {\n return 1;\n }\n }\n }\n\n /**\n * Event handler for window resize events.\n *\n * Recalculates the scaling factor and updates the layer dimensions\n * based on the new window size and fixed dimension constraints.\n *\n * @private\n */\n private readonly onResize = (): void => {\n const scale = this.calculateScale();\n this.resizeInternal(window.innerWidth * scale, window.innerHeight * scale);\n };\n\n /**\n * Event handler for pointer down events.\n *\n * Converts browser pointer coordinates to layer coordinates by accounting\n * for element positioning and applying the appropriate scaling factor.\n * The y-coordinate is flipped to match the UI coordinate system.\n *\n * @param event - The pointer event from the browser\n * @private\n */\n private readonly onClick = (event: PointerEvent): void => {\n const r =\n event.target instanceof HTMLElement\n ? event.target.getBoundingClientRect()\n : null;\n\n const x = r ? event.clientX - r.left : event.clientX;\n const y = r ? r.bottom - event.clientY : window.innerHeight - event.clientY;\n\n const scale = this.calculateScale();\n this.clickInternal(x * scale, y * scale);\n };\n}\n","import { isUITextStyle, type UITextStyle } from \"./UITextStyle\";\n\nexport interface UITextSpan {\n text: string;\n style?: Partial<UITextStyle>;\n}\n\nexport function isUITextSpan(obj?: unknown): obj is UITextSpan {\n return (\n obj !== null &&\n typeof obj === \"object\" &&\n \"text\" in obj &&\n typeof obj.text === \"string\" &&\n (!(\"style\" in obj) || isUITextStyle(obj.style))\n );\n}\n"],"names":["Eventail","DEFAULT_ANCHOR"],"mappings":";;AAAA;;;;;;;;;;;;AAYG;MACU,YAAY,CAAA;AAMvB;;;;;AAKG;AACH,IAAA,WAAA,CAAY,QAAQ,GAAG,CAAC,EAAE,KAA0B,EAAA;AAClD,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,IAAI,kBAAS,KAAK,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE;IACjD;AAEA;;;;;;;;;AASG;AACI,IAAA,OAAO,IAAI,CAAC,CAAe,EAAE,CAAe,EAAA;QACjD,MAAM,MAAM,GAAG,IAAI,YAAY,CAC7B,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,EACvB,KAAK,CAAC,IAAI,CAAC,CAAC,gBAAO,OAAO,EAAE,CAAC,CAC9B;QACD,KAAK,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA,cAAA,EAAQ;AAClD,YAAA,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;QACzC;AACA,QAAA,OAAO,MAAM;IACf;AAEA;;;;;;;;;AASG;AACI,IAAA,OAAO,KAAK,CAAC,CAAe,EAAE,CAAe,EAAA;QAClD,MAAM,MAAM,GAAG,IAAI,YAAY,CAC7B,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,EACvB,KAAK,CAAC,IAAI,CAAC,CAAC,gBAAO,OAAO,EAAE,CAAC,CAC9B;QACD,KAAK,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA,cAAA,EAAQ;AAClD,YAAA,MAAM,CAAC,KAAK,CAAC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