asajs 3.0.2 → 3.0.5

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 (286) hide show
  1. package/dist/cjs/compilers/BindingCompiler.js +458 -0
  2. package/dist/cjs/compilers/BindingFunctions.js +267 -0
  3. package/dist/cjs/compilers/Compiler.js +158 -0
  4. package/dist/cjs/compilers/Compress.js +55 -0
  5. package/dist/cjs/compilers/Config.js +138 -0
  6. package/dist/cjs/compilers/Encoder.js +90 -0
  7. package/dist/cjs/compilers/Installer.js +123 -0
  8. package/dist/cjs/compilers/PreCompile.js +86 -0
  9. package/dist/cjs/compilers/generator/GenerateDir.js +51 -0
  10. package/dist/cjs/compilers/generator/JsonBuilder.js +66 -0
  11. package/dist/cjs/compilers/generator/LangBuilder.js +65 -0
  12. package/dist/cjs/compilers/generator/Log.js +45 -0
  13. package/dist/cjs/compilers/generator/Manifest.js +63 -0
  14. package/dist/cjs/compilers/generator/Save.js +87 -0
  15. package/dist/cjs/compilers/generator/SearchFiles.js +70 -0
  16. package/dist/cjs/compilers/generator/Sounds.js +91 -0
  17. package/dist/cjs/compilers/generator/Template.js +54 -0
  18. package/dist/cjs/compilers/generator/UIBuilder.js +123 -0
  19. package/dist/cjs/compilers/reader/Audio.js +81 -0
  20. package/dist/cjs/compilers/reader/Color.js +65 -0
  21. package/dist/cjs/compilers/reader/CurrentLine.js +36 -0
  22. package/dist/cjs/compilers/reader/Env.js +21 -0
  23. package/dist/cjs/compilers/reader/GlobalVariables.js +23 -0
  24. package/dist/cjs/compilers/reader/Object.js +44 -0
  25. package/dist/cjs/compilers/reader/ReadBinding.js +67 -0
  26. package/dist/cjs/compilers/reader/ReadProperties.js +118 -0
  27. package/dist/cjs/components/AddCollectionChill.js +41 -0
  28. package/dist/cjs/components/Animation.js +127 -0
  29. package/dist/cjs/components/AnimationKeyFrame.js +49 -0
  30. package/dist/cjs/components/Class.js +95 -0
  31. package/dist/cjs/components/LocalizeText.js +59 -0
  32. package/dist/cjs/components/Modify.js +377 -0
  33. package/dist/cjs/components/Random.js +104 -0
  34. package/dist/cjs/components/UI.js +387 -0
  35. package/dist/cjs/components/Vanilla.js +57915 -0
  36. package/dist/cjs/index.js +291 -0
  37. package/dist/cjs/package.json +1 -0
  38. package/dist/cjs/template.js +37 -0
  39. package/dist/cjs/types/components/ChildIdentifier.js +16 -0
  40. package/dist/cjs/types/components/Identifier.js +17 -0
  41. package/dist/cjs/types/components/NameCallback.js +16 -0
  42. package/dist/cjs/types/components/UIIdentifier.js +16 -0
  43. package/dist/cjs/types/components/UIInterface.js +16 -0
  44. package/dist/cjs/types/enums/Anchor.js +39 -0
  45. package/dist/cjs/types/enums/AnimTypes.js +39 -0
  46. package/dist/cjs/types/enums/BindingCondition.js +36 -0
  47. package/dist/cjs/types/enums/BindingName.js +4208 -0
  48. package/dist/cjs/types/enums/BindingType.js +35 -0
  49. package/dist/cjs/types/enums/ClipDirecion.js +35 -0
  50. package/dist/cjs/types/enums/Collection.js +202 -0
  51. package/dist/cjs/types/enums/Direction.js +33 -0
  52. package/dist/cjs/types/enums/EasingTypes.js +62 -0
  53. package/dist/cjs/types/enums/EnumColor.js +37 -0
  54. package/dist/cjs/types/enums/FocusNavigationMode.js +34 -0
  55. package/dist/cjs/types/enums/FontSize.js +34 -0
  56. package/dist/cjs/types/enums/FontType.js +35 -0
  57. package/dist/cjs/types/enums/GlobalVariables.js +345 -0
  58. package/dist/cjs/types/enums/InputModeCondition.js +33 -0
  59. package/dist/cjs/types/enums/ItemAuxID.js +31 -0
  60. package/dist/cjs/types/enums/JsonUIArrayName.js +36 -0
  61. package/dist/cjs/types/enums/MappingFrom.js +81 -0
  62. package/dist/cjs/types/enums/MappingTo.js +248 -0
  63. package/dist/cjs/types/enums/MappingTypes.js +34 -0
  64. package/dist/cjs/types/enums/Orientation.js +32 -0
  65. package/dist/cjs/types/enums/Renderer.js +68 -0
  66. package/dist/cjs/types/enums/Rotation.js +33 -0
  67. package/dist/cjs/types/enums/Scope.js +32 -0
  68. package/dist/cjs/types/enums/TextTypes.js +33 -0
  69. package/dist/cjs/types/enums/TextureFileSystem.js +41 -0
  70. package/dist/cjs/types/enums/Types.js +57 -0
  71. package/dist/cjs/types/objects/Animation.js +16 -0
  72. package/dist/cjs/types/objects/BindingHook.js +16 -0
  73. package/dist/cjs/types/objects/BindingInterface.js +16 -0
  74. package/dist/cjs/types/objects/ButtonMapping.js +16 -0
  75. package/dist/cjs/types/objects/Factory.js +16 -0
  76. package/dist/cjs/types/objects/Installer.js +53 -0
  77. package/dist/cjs/types/objects/Manifest.js +56 -0
  78. package/dist/cjs/types/objects/Modify.js +16 -0
  79. package/dist/cjs/types/objects/PropertyBag.js +16 -0
  80. package/dist/cjs/types/objects/Sound.js +16 -0
  81. package/dist/cjs/types/objects/Variables.js +16 -0
  82. package/dist/cjs/types/objects/elements/Button.js +17 -0
  83. package/dist/cjs/types/objects/elements/CollectionPanel.js +17 -0
  84. package/dist/cjs/types/objects/elements/Custom.js +17 -0
  85. package/dist/cjs/types/objects/elements/Dropdown.js +17 -0
  86. package/dist/cjs/types/objects/elements/EditBox.js +17 -0
  87. package/dist/cjs/types/objects/elements/Grid.js +16 -0
  88. package/dist/cjs/types/objects/elements/Image.js +17 -0
  89. package/dist/cjs/types/objects/elements/InputPanel.js +16 -0
  90. package/dist/cjs/types/objects/elements/Label.js +17 -0
  91. package/dist/cjs/types/objects/elements/PropertiesType.js +17 -0
  92. package/dist/cjs/types/objects/elements/Screen.js +17 -0
  93. package/dist/cjs/types/objects/elements/ScrollView.js +17 -0
  94. package/dist/cjs/types/objects/elements/ScrollbarBox.js +17 -0
  95. package/dist/cjs/types/objects/elements/ScrollbarTrack.js +17 -0
  96. package/dist/cjs/types/objects/elements/SelectionWheel.js +17 -0
  97. package/dist/cjs/types/objects/elements/Slider.js +17 -0
  98. package/dist/cjs/types/objects/elements/SliderBox.js +17 -0
  99. package/dist/cjs/types/objects/elements/StackPanel.js +16 -0
  100. package/dist/cjs/types/objects/elements/Toggle.js +17 -0
  101. package/dist/cjs/types/objects/elements/TooltipTrigger.js +16 -0
  102. package/dist/cjs/types/objects/elements/panel.js +16 -0
  103. package/dist/cjs/types/objects/properties/Buttons.js +16 -0
  104. package/dist/cjs/types/objects/properties/CollectionIndexs.js +16 -0
  105. package/dist/cjs/types/objects/properties/Collections.js +16 -0
  106. package/dist/cjs/types/objects/properties/Controls.js +16 -0
  107. package/dist/cjs/types/objects/properties/Dropdowns.js +16 -0
  108. package/dist/cjs/types/objects/properties/Focus.js +16 -0
  109. package/dist/cjs/types/objects/properties/FocusContainerCustom.js +16 -0
  110. package/dist/cjs/types/objects/properties/Grids.js +16 -0
  111. package/dist/cjs/types/objects/properties/Inputs.js +16 -0
  112. package/dist/cjs/types/objects/properties/Layouts.js +16 -0
  113. package/dist/cjs/types/objects/properties/Properties.js +16 -0
  114. package/dist/cjs/types/objects/properties/Renderers.js +16 -0
  115. package/dist/cjs/types/objects/properties/Screens.js +16 -0
  116. package/dist/cjs/types/objects/properties/ScrollViews.js +16 -0
  117. package/dist/cjs/types/objects/properties/SelectionWheels.js +16 -0
  118. package/dist/cjs/types/objects/properties/SliderBoxs.js +16 -0
  119. package/dist/cjs/types/objects/properties/Sliders.js +16 -0
  120. package/dist/cjs/types/objects/properties/Sounds.js +16 -0
  121. package/dist/cjs/types/objects/properties/Specials.js +16 -0
  122. package/dist/cjs/types/objects/properties/Sprites.js +16 -0
  123. package/dist/cjs/types/objects/properties/StackPanels.js +16 -0
  124. package/dist/cjs/types/objects/properties/TTS.js +16 -0
  125. package/dist/cjs/types/objects/properties/TextEdits.js +16 -0
  126. package/dist/cjs/types/objects/properties/Texts.js +16 -0
  127. package/dist/cjs/types/objects/properties/Toggles.js +16 -0
  128. package/dist/cjs/types/objects/properties/TooltipTriggers.js +16 -0
  129. package/dist/cjs/types/objects/properties/Variables.js +16 -0
  130. package/dist/cjs/types/values/Any.js +16 -0
  131. package/dist/cjs/types/values/Binding.js +16 -0
  132. package/dist/cjs/types/values/Bool.js +16 -0
  133. package/dist/cjs/types/values/ColorVector.js +16 -0
  134. package/dist/cjs/types/values/ElementPath.js +16 -0
  135. package/dist/cjs/types/values/Hex.js +16 -0
  136. package/dist/cjs/types/values/Number.js +16 -0
  137. package/dist/cjs/types/values/RangeVector.js +16 -0
  138. package/dist/cjs/types/values/Str.js +16 -0
  139. package/dist/cjs/types/values/StringVector.js +16 -0
  140. package/dist/cjs/types/values/TargetElementPath.js +16 -0
  141. package/dist/cjs/types/values/Variable.js +16 -0
  142. package/dist/cjs/types/values/Vector.js +16 -0
  143. package/dist/esm/index.js +68470 -0
  144. package/dist/esm/package.json +1 -0
  145. package/dist/types/compilers/BindingCompiler.d.ts +44 -0
  146. package/dist/types/compilers/BindingFunctions.d.ts +10 -0
  147. package/dist/types/compilers/Compiler.d.ts +3 -0
  148. package/dist/types/compilers/Compress.d.ts +1 -0
  149. package/dist/types/compilers/Config.d.ts +95 -0
  150. package/dist/types/compilers/Encoder.d.ts +11 -0
  151. package/dist/types/compilers/Installer.d.ts +14 -0
  152. package/dist/types/compilers/PreCompile.d.ts +4 -0
  153. package/dist/types/compilers/generator/GenerateDir.d.ts +1 -0
  154. package/dist/types/compilers/generator/JsonBuilder.d.ts +28 -0
  155. package/dist/types/compilers/generator/LangBuilder.d.ts +4 -0
  156. package/dist/types/compilers/generator/Log.d.ts +9 -0
  157. package/dist/types/compilers/generator/Manifest.d.ts +21 -0
  158. package/dist/types/compilers/generator/Save.d.ts +16 -0
  159. package/dist/types/compilers/generator/SearchFiles.d.ts +11 -0
  160. package/dist/types/compilers/generator/Sounds.d.ts +5 -0
  161. package/dist/types/compilers/generator/Template.d.ts +1 -0
  162. package/dist/types/compilers/generator/UIBuilder.d.ts +9 -0
  163. package/dist/types/compilers/reader/Audio.d.ts +1 -0
  164. package/dist/types/compilers/reader/Color.d.ts +5 -0
  165. package/dist/types/compilers/reader/CurrentLine.d.ts +1 -0
  166. package/dist/types/compilers/reader/Env.d.ts +1 -0
  167. package/dist/types/compilers/reader/GlobalVariables.d.ts +1 -0
  168. package/dist/types/compilers/reader/Object.d.ts +11 -0
  169. package/dist/types/compilers/reader/ReadBinding.d.ts +6 -0
  170. package/dist/types/compilers/reader/ReadProperties.d.ts +3 -0
  171. package/dist/types/components/AddCollectionChill.d.ts +6 -0
  172. package/dist/types/components/Animation.d.ts +15 -0
  173. package/dist/types/components/AnimationKeyFrame.d.ts +10 -0
  174. package/dist/types/components/Class.d.ts +68 -0
  175. package/dist/types/components/LocalizeText.d.ts +21 -0
  176. package/dist/types/components/Modify.d.ts +30 -0
  177. package/dist/types/components/Random.d.ts +20 -0
  178. package/dist/types/components/UI.d.ts +89 -0
  179. package/dist/types/components/Vanilla.d.ts +19729 -0
  180. package/dist/types/index.d.ts +136 -0
  181. package/dist/types/template.d.ts +4 -0
  182. package/dist/types/types/components/ChildIdentifier.d.ts +11 -0
  183. package/dist/types/types/components/Identifier.d.ts +4 -0
  184. package/dist/types/types/components/NameCallback.d.ts +3 -0
  185. package/dist/types/types/components/UIIdentifier.d.ts +4 -0
  186. package/dist/types/types/components/UIInterface.d.ts +16 -0
  187. package/dist/types/types/enums/Anchor.d.ts +11 -0
  188. package/dist/types/types/enums/AnimTypes.d.ts +11 -0
  189. package/dist/types/types/enums/BindingCondition.d.ts +8 -0
  190. package/dist/types/types/enums/BindingName.d.ts +4180 -0
  191. package/dist/types/types/enums/BindingType.d.ts +7 -0
  192. package/dist/types/types/enums/ClipDirecion.d.ts +7 -0
  193. package/dist/types/types/enums/Collection.d.ts +174 -0
  194. package/dist/types/types/enums/Direction.d.ts +5 -0
  195. package/dist/types/types/enums/EasingTypes.d.ts +34 -0
  196. package/dist/types/types/enums/EnumColor.d.ts +9 -0
  197. package/dist/types/types/enums/FocusNavigationMode.d.ts +6 -0
  198. package/dist/types/types/enums/FontSize.d.ts +6 -0
  199. package/dist/types/types/enums/FontType.d.ts +7 -0
  200. package/dist/types/types/enums/GlobalVariables.d.ts +317 -0
  201. package/dist/types/types/enums/InputModeCondition.d.ts +5 -0
  202. package/dist/types/types/enums/ItemAuxID.d.ts +3 -0
  203. package/dist/types/types/enums/JsonUIArrayName.d.ts +7 -0
  204. package/dist/types/types/enums/MappingFrom.d.ts +53 -0
  205. package/dist/types/types/enums/MappingTo.d.ts +220 -0
  206. package/dist/types/types/enums/MappingTypes.d.ts +6 -0
  207. package/dist/types/types/enums/Orientation.d.ts +4 -0
  208. package/dist/types/types/enums/Renderer.d.ts +40 -0
  209. package/dist/types/types/enums/Rotation.d.ts +5 -0
  210. package/dist/types/types/enums/Scope.d.ts +4 -0
  211. package/dist/types/types/enums/TextTypes.d.ts +5 -0
  212. package/dist/types/types/enums/TextureFileSystem.d.ts +13 -0
  213. package/dist/types/types/enums/Types.d.ts +29 -0
  214. package/dist/types/types/objects/Animation.d.ts +36 -0
  215. package/dist/types/types/objects/BindingHook.d.ts +1 -0
  216. package/dist/types/types/objects/BindingInterface.d.ts +21 -0
  217. package/dist/types/types/objects/ButtonMapping.d.ts +18 -0
  218. package/dist/types/types/objects/Factory.d.ts +2 -0
  219. package/dist/types/types/objects/Installer.d.ts +26 -0
  220. package/dist/types/types/objects/Manifest.d.ts +74 -0
  221. package/dist/types/types/objects/Modify.d.ts +52 -0
  222. package/dist/types/types/objects/PropertyBag.d.ts +2 -0
  223. package/dist/types/types/objects/Sound.d.ts +8 -0
  224. package/dist/types/types/objects/Variables.d.ts +1 -0
  225. package/dist/types/types/objects/elements/Button.d.ts +4 -0
  226. package/dist/types/types/objects/elements/CollectionPanel.d.ts +4 -0
  227. package/dist/types/types/objects/elements/Custom.d.ts +5 -0
  228. package/dist/types/types/objects/elements/Dropdown.d.ts +4 -0
  229. package/dist/types/types/objects/elements/EditBox.d.ts +4 -0
  230. package/dist/types/types/objects/elements/Grid.d.ts +4 -0
  231. package/dist/types/types/objects/elements/Image.d.ts +4 -0
  232. package/dist/types/types/objects/elements/InputPanel.d.ts +7 -0
  233. package/dist/types/types/objects/elements/Label.d.ts +4 -0
  234. package/dist/types/types/objects/elements/PropertiesType.d.ts +45 -0
  235. package/dist/types/types/objects/elements/Screen.d.ts +4 -0
  236. package/dist/types/types/objects/elements/ScrollView.d.ts +5 -0
  237. package/dist/types/types/objects/elements/ScrollbarBox.d.ts +4 -0
  238. package/dist/types/types/objects/elements/ScrollbarTrack.d.ts +4 -0
  239. package/dist/types/types/objects/elements/SelectionWheel.d.ts +4 -0
  240. package/dist/types/types/objects/elements/Slider.d.ts +4 -0
  241. package/dist/types/types/objects/elements/SliderBox.d.ts +5 -0
  242. package/dist/types/types/objects/elements/StackPanel.d.ts +7 -0
  243. package/dist/types/types/objects/elements/Toggle.d.ts +4 -0
  244. package/dist/types/types/objects/elements/TooltipTrigger.d.ts +8 -0
  245. package/dist/types/types/objects/elements/panel.d.ts +6 -0
  246. package/dist/types/types/objects/properties/Buttons.d.ts +5 -0
  247. package/dist/types/types/objects/properties/CollectionIndexs.d.ts +4 -0
  248. package/dist/types/types/objects/properties/Collections.d.ts +6 -0
  249. package/dist/types/types/objects/properties/Controls.d.ts +27 -0
  250. package/dist/types/types/objects/properties/Dropdowns.d.ts +6 -0
  251. package/dist/types/types/objects/properties/Focus.d.ts +28 -0
  252. package/dist/types/types/objects/properties/FocusContainerCustom.d.ts +5 -0
  253. package/dist/types/types/objects/properties/Grids.d.ts +15 -0
  254. package/dist/types/types/objects/properties/Inputs.d.ts +13 -0
  255. package/dist/types/types/objects/properties/Layouts.d.ts +35 -0
  256. package/dist/types/types/objects/properties/Properties.d.ts +27 -0
  257. package/dist/types/types/objects/properties/Renderers.d.ts +5 -0
  258. package/dist/types/types/objects/properties/Screens.d.ts +23 -0
  259. package/dist/types/types/objects/properties/ScrollViews.d.ts +17 -0
  260. package/dist/types/types/objects/properties/SelectionWheels.d.ts +13 -0
  261. package/dist/types/types/objects/properties/SliderBoxs.d.ts +6 -0
  262. package/dist/types/types/objects/properties/Sliders.d.ts +23 -0
  263. package/dist/types/types/objects/properties/Sounds.d.ts +10 -0
  264. package/dist/types/types/objects/properties/Specials.d.ts +60 -0
  265. package/dist/types/types/objects/properties/Sprites.d.ts +33 -0
  266. package/dist/types/types/objects/properties/StackPanels.d.ts +5 -0
  267. package/dist/types/types/objects/properties/TTS.d.ts +24 -0
  268. package/dist/types/types/objects/properties/TextEdits.d.ts +19 -0
  269. package/dist/types/types/objects/properties/Texts.d.ts +26 -0
  270. package/dist/types/types/objects/properties/Toggles.d.ts +24 -0
  271. package/dist/types/types/objects/properties/TooltipTriggers.d.ts +7 -0
  272. package/dist/types/types/objects/properties/Variables.d.ts +3 -0
  273. package/dist/types/types/values/Any.d.ts +4 -0
  274. package/dist/types/types/values/Binding.d.ts +2 -0
  275. package/dist/types/types/values/Bool.d.ts +2 -0
  276. package/dist/types/types/values/ColorVector.d.ts +6 -0
  277. package/dist/types/types/values/ElementPath.d.ts +2 -0
  278. package/dist/types/types/values/Hex.d.ts +1 -0
  279. package/dist/types/types/values/Number.d.ts +4 -0
  280. package/dist/types/types/values/RangeVector.d.ts +5 -0
  281. package/dist/types/types/values/Str.d.ts +2 -0
  282. package/dist/types/types/values/StringVector.d.ts +6 -0
  283. package/dist/types/types/values/TargetElementPath.d.ts +1 -0
  284. package/dist/types/types/values/Variable.d.ts +1 -0
  285. package/dist/types/types/values/Vector.d.ts +5 -0
  286. package/package.json +4 -4
@@ -0,0 +1,387 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ var UI_exports = {};
22
+ __export(UI_exports, {
23
+ UI: () => UI
24
+ });
25
+ module.exports = __toCommonJS(UI_exports);
26
+ var import_Config = require("../compilers/Config");
27
+ var import_JsonBuilder = require("../compilers/generator/JsonBuilder");
28
+ var import_Log = require("../compilers/generator/Log");
29
+ var import_CurrentLine = require("../compilers/reader/CurrentLine");
30
+ var import_Object = require("../compilers/reader/Object");
31
+ var import_ReadBinding = require("../compilers/reader/ReadBinding");
32
+ var import_ReadProperties = require("../compilers/reader/ReadProperties");
33
+ var import_MappingTypes = require("../types/enums/MappingTypes");
34
+ var import_Types = require("../types/enums/Types");
35
+ var import_Modify = require("./Modify");
36
+ var import_Random = require("./Random");
37
+ const typeExtend = {};
38
+ const _UI = class _UI {
39
+ constructor(identifier) {
40
+ __publicField(this, "name");
41
+ __publicField(this, "namespace");
42
+ __publicField(this, "extends");
43
+ __publicField(this, "sourceBindings", {});
44
+ __publicField(this, "type");
45
+ __publicField(this, "controls");
46
+ __publicField(this, "bindings");
47
+ __publicField(this, "button_mappings");
48
+ __publicField(this, "variables");
49
+ __publicField(this, "anims");
50
+ __publicField(this, "properties");
51
+ const config = import_Config.Configs.getConfig();
52
+ if (identifier instanceof _UI || identifier instanceof import_Modify.Modify) {
53
+ this.name = import_Random.Random.getName();
54
+ this.namespace = import_Random.Random.getNamespace();
55
+ this.extends = identifier.getPath();
56
+ } else {
57
+ this.name = !config.compiler.UI.obfuscateName && (identifier == null ? void 0 : identifier.name) || import_Random.Random.getName();
58
+ this.namespace = !config.compiler.UI.obfuscateName && (identifier == null ? void 0 : identifier.namespace) || import_Random.Random.getNamespace();
59
+ if (identifier == null ? void 0 : identifier.extends) {
60
+ if (identifier.type) {
61
+ this.type = identifier.type;
62
+ }
63
+ if (identifier.extends instanceof _UI)
64
+ this.extends = "".concat(identifier.extends.getPath());
65
+ else if (identifier.extends instanceof import_Modify.Modify) this.extends = identifier.extends.getPath();
66
+ else if (typeof identifier.extends === "string") this.extends = identifier.extends;
67
+ else this.extends = "".concat(identifier.extends.namespace, ".").concat(identifier.extends.name);
68
+ } else {
69
+ if (config.compiler.UI.obfuscateType && identifier.namespace !== "_type_c") {
70
+ const type = (identifier == null ? void 0 : identifier.type) || import_Types.Types.Panel;
71
+ this.extends = typeExtend[type] || (typeExtend[type] = new _UI({
72
+ name: type,
73
+ namespace: "_type_c",
74
+ type
75
+ }).getPath());
76
+ } else this.type = (identifier == null ? void 0 : identifier.type) || import_Types.Types.Panel;
77
+ }
78
+ if (identifier == null ? void 0 : identifier.properties) this.setProperties(identifier.properties);
79
+ }
80
+ import_JsonBuilder.JsonBuilder.registerElement(this.namespace, this);
81
+ }
82
+ static panel(properties, identifier) {
83
+ return new _UI({
84
+ ...identifier,
85
+ type: import_Types.Types.Panel,
86
+ properties
87
+ });
88
+ }
89
+ static stackPanel(properties, identifier) {
90
+ return new _UI({
91
+ ...identifier,
92
+ type: import_Types.Types.StackPanel,
93
+ properties
94
+ });
95
+ }
96
+ static collectionPanel(properties, identifier) {
97
+ return new _UI({
98
+ ...identifier,
99
+ type: import_Types.Types.CollectionPanel,
100
+ properties
101
+ });
102
+ }
103
+ static inputPanel(properties, identifier) {
104
+ return new _UI({
105
+ ...identifier,
106
+ type: import_Types.Types.InputPanel,
107
+ properties
108
+ });
109
+ }
110
+ static grid(properties, identifier) {
111
+ return new _UI({
112
+ ...identifier,
113
+ type: import_Types.Types.Grid,
114
+ properties
115
+ });
116
+ }
117
+ static button(properties, identifier) {
118
+ return new _UI({
119
+ ...identifier,
120
+ type: import_Types.Types.Button,
121
+ properties
122
+ });
123
+ }
124
+ static toggle(properties, identifier) {
125
+ return new _UI({
126
+ ...identifier,
127
+ type: import_Types.Types.Toggle,
128
+ properties
129
+ });
130
+ }
131
+ static label(properties, identifier) {
132
+ return new _UI({
133
+ ...identifier,
134
+ type: import_Types.Types.Label,
135
+ properties
136
+ });
137
+ }
138
+ static image(properties, identifier) {
139
+ return new _UI({
140
+ ...identifier,
141
+ type: import_Types.Types.Image,
142
+ properties
143
+ });
144
+ }
145
+ static dropdown(properties, identifier) {
146
+ return new _UI({
147
+ ...identifier,
148
+ type: import_Types.Types.Dropdown,
149
+ properties
150
+ });
151
+ }
152
+ static slider(properties, identifier) {
153
+ return new _UI({
154
+ ...identifier,
155
+ type: import_Types.Types.Slider,
156
+ properties
157
+ });
158
+ }
159
+ static sliderBox(properties, identifier) {
160
+ return new _UI({
161
+ ...identifier,
162
+ type: import_Types.Types.SliderBox,
163
+ properties
164
+ });
165
+ }
166
+ static editBox(properties, identifier) {
167
+ return new _UI({
168
+ ...identifier,
169
+ type: import_Types.Types.EditBox,
170
+ properties
171
+ });
172
+ }
173
+ static scrollView(properties, identifier) {
174
+ return new _UI({
175
+ ...identifier,
176
+ type: import_Types.Types.ScrollView,
177
+ properties
178
+ });
179
+ }
180
+ static scrollbarTrack(properties, identifier) {
181
+ return new _UI({
182
+ ...identifier,
183
+ type: import_Types.Types.ScrollbarTrack,
184
+ properties
185
+ });
186
+ }
187
+ static scrollbarBox(properties, identifier) {
188
+ return new _UI({
189
+ ...identifier,
190
+ type: import_Types.Types.ScrollbarBox,
191
+ properties
192
+ });
193
+ }
194
+ static screen(properties, identifier) {
195
+ return new _UI({
196
+ ...identifier,
197
+ type: import_Types.Types.Screen,
198
+ properties
199
+ });
200
+ }
201
+ static custom(renderer, properties, identifier) {
202
+ return new _UI({
203
+ ...identifier,
204
+ type: import_Types.Types.Custom,
205
+ properties: {
206
+ ...properties,
207
+ renderer
208
+ }
209
+ });
210
+ }
211
+ static tooltipTrigger(properties, identifier) {
212
+ return new _UI({
213
+ ...identifier,
214
+ type: import_Types.Types.TooltipTrigger,
215
+ properties
216
+ });
217
+ }
218
+ static extend(extendElement, properties, identifier) {
219
+ if (identifier)
220
+ return new _UI({
221
+ extends: extendElement,
222
+ ...identifier
223
+ });
224
+ else
225
+ return new _UI({
226
+ extends: extendElement,
227
+ properties
228
+ });
229
+ }
230
+ searchBinding(bindingName, controlName, targetBindingName) {
231
+ var _a, _b;
232
+ for (let index = 0; index < (((_a = this.bindings) == null ? void 0 : _a.length) || 0); index++) {
233
+ const binding = (_b = this.bindings) == null ? void 0 : _b[index];
234
+ if (controlName) {
235
+ if ((binding == null ? void 0 : binding.source_control_name) === controlName && binding.source_property_name === bindingName) {
236
+ if (targetBindingName) {
237
+ if (binding.target_property_name === targetBindingName) {
238
+ return targetBindingName;
239
+ } else return void 0;
240
+ } else return binding.target_property_name;
241
+ }
242
+ } else {
243
+ if ((binding == null ? void 0 : binding.source_property_name) === bindingName) {
244
+ if (targetBindingName) {
245
+ if (binding.target_property_name === targetBindingName) {
246
+ return targetBindingName;
247
+ } else return void 0;
248
+ } else return binding.target_property_name;
249
+ }
250
+ }
251
+ }
252
+ return void 0;
253
+ }
254
+ setProperties(properties) {
255
+ var _a;
256
+ if (properties.property_bag) {
257
+ properties.property_bag = {
258
+ ...(_a = this.properties) == null ? void 0 : _a.property_bag,
259
+ ...properties.property_bag
260
+ };
261
+ }
262
+ this.properties = {
263
+ ...this.properties || {},
264
+ ...properties
265
+ };
266
+ return this;
267
+ }
268
+ isDuplicate(name) {
269
+ for (const childElement of this.controls || []) {
270
+ const childKey = Object.keys(childElement)[0];
271
+ const childName = childKey.split("@")[0];
272
+ if (childName === name) return true;
273
+ }
274
+ return false;
275
+ }
276
+ isRecusive(name) {
277
+ return name === this.name;
278
+ }
279
+ addChild(element, properties, name, callback) {
280
+ if (!this.controls) this.controls = [];
281
+ name || (name = import_Random.Random.getName());
282
+ if (this.isDuplicate(name)) {
283
+ import_Log.Log.warning("".concat((0, import_CurrentLine.CurrentLine)(), " child element should have a unique name!"));
284
+ }
285
+ if (typeof element === "string") {
286
+ this.controls.push({
287
+ ["".concat(name, "@").concat(element)]: properties ? (0, import_ReadProperties.ReadProperties)(properties) : {}
288
+ });
289
+ } else if (element instanceof _UI || element instanceof import_Modify.Modify) {
290
+ {
291
+ if ((element == null ? void 0 : element.getPath()) === this.getPath()) {
292
+ import_Log.Log.warning("".concat((0, import_CurrentLine.CurrentLine)(), " child element should have a unique name!"));
293
+ }
294
+ this.controls.push({
295
+ ["".concat(name, "@").concat(element == null ? void 0 : element.getPath())]: properties ? (0, import_ReadProperties.ReadProperties)(properties) : {}
296
+ });
297
+ }
298
+ }
299
+ callback == null ? void 0 : callback(this, name);
300
+ return this;
301
+ }
302
+ addBindings(bindings) {
303
+ if (Array.isArray(bindings)) for (const binding of bindings) this.addBindings(binding);
304
+ else (this.bindings || (this.bindings = [])).push((0, import_ReadBinding.ReadBinding)(bindings, this));
305
+ return this;
306
+ }
307
+ addVariables(variables) {
308
+ this.variables || (this.variables = {});
309
+ import_Object.Obj.forEach(variables, (key, value) => {
310
+ this.variables[key] = {
311
+ ...import_Object.Obj.map(value, (k, v) => {
312
+ return { key: k, value: (0, import_ReadProperties.ReadValue)(v) };
313
+ })
314
+ };
315
+ });
316
+ return this;
317
+ }
318
+ getUI() {
319
+ var _a;
320
+ const code = (0, import_ReadProperties.ReadProperties)((_a = this.properties) != null ? _a : {});
321
+ for (const key of ["type", "controls", "bindings", "button_mappings", "anims"])
322
+ if (this[key]) code[key] = this[key];
323
+ for (const bindingKey in this.sourceBindings) {
324
+ const targetBinding = this.sourceBindings[bindingKey];
325
+ const [sourceBinding, sourceControl] = bindingKey.split(":");
326
+ code.bindings.push({
327
+ binding_type: "view",
328
+ source_control_name: sourceControl,
329
+ source_property_name: sourceBinding,
330
+ target_property_name: targetBinding
331
+ });
332
+ }
333
+ if (this.variables)
334
+ import_Object.Obj.forEach(this.variables, (k, v) => {
335
+ (code.variables || (code.variables = [])).push({
336
+ requires: k,
337
+ ...v
338
+ });
339
+ });
340
+ return code;
341
+ }
342
+ getPath() {
343
+ return "".concat(this.namespace, ".").concat(this.name);
344
+ }
345
+ getElement() {
346
+ return "@".concat(this.getPath());
347
+ }
348
+ getFullPath() {
349
+ return "".concat(this.name).concat(this.extends ? "@".concat(this.extends) : "");
350
+ }
351
+ extend(identifier, properties) {
352
+ return new _UI({
353
+ ...identifier,
354
+ extends: this,
355
+ properties
356
+ });
357
+ }
358
+ addAnimation(animation, startIndex) {
359
+ (this.anims || (this.anims = [])).push(animation.getKeyIndex(startIndex || 0));
360
+ return this;
361
+ }
362
+ addMapping(mapping) {
363
+ if (Array.isArray(mapping)) mapping.forEach((v) => this.addMapping(v));
364
+ else {
365
+ mapping.mapping_type || (mapping.mapping_type = import_MappingTypes.MappingType.Global);
366
+ (this.button_mappings || (this.button_mappings = [])).push(mapping);
367
+ }
368
+ return this;
369
+ }
370
+ static apply() {
371
+ }
372
+ static bind() {
373
+ }
374
+ static call() {
375
+ }
376
+ static toString() {
377
+ }
378
+ };
379
+ __publicField(_UI, "arguments", "");
380
+ __publicField(_UI, "caller", "");
381
+ __publicField(_UI, "length", "");
382
+ __publicField(_UI, "name", "");
383
+ let UI = _UI;
384
+ // Annotate the CommonJS export names for ESM import in node:
385
+ 0 && (module.exports = {
386
+ UI
387
+ });