@holoscript/core 8.0.8 → 8.0.10

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 (463) hide show
  1. package/LICENSE +21 -0
  2. package/bin/holoscript.cjs +5 -1
  3. package/dist/GLTFPipeline-L76YTXKA.js +15 -0
  4. package/dist/GLTFPipeline-ZWJN7GI6.cjs +36 -0
  5. package/dist/HoloCompositionParser-K76KTEEE.js +12 -0
  6. package/dist/HoloCompositionParser-UZH6Y4HO.cjs +45 -0
  7. package/dist/HoloScriptCodeParser-2D4ERFUZ.js +6 -0
  8. package/dist/HoloScriptCodeParser-UDRLDA7I.cjs +23 -0
  9. package/dist/HoloScriptPlusParser-FTMCGWXD.js +13 -0
  10. package/dist/HoloScriptPlusParser-LQR5GIKF.cjs +30 -0
  11. package/dist/HoloScriptRuntime-UTRLJI5L.js +12 -0
  12. package/dist/HoloScriptRuntime-YBYXJHJN.cjs +21 -0
  13. package/dist/SceneIRCompiler-63KA3M2F.js +17 -0
  14. package/dist/SceneIRCompiler-KWUFHZ4O.cjs +42 -0
  15. package/dist/{USDZExporter-AUHZODOF.cjs → USDZExporter-ML4UMIGC.cjs} +3 -3
  16. package/dist/{USDZExporter-GXB4AUSG.js → USDZExporter-ZFKLQ76G.js} +3 -3
  17. package/dist/agents/index.cjs +1 -1
  18. package/dist/agents/index.js +1 -1
  19. package/dist/audit/AuditLogger.d.ts +106 -0
  20. package/dist/audit/AuditQueryBuilder.d.ts +79 -0
  21. package/dist/audit/ComplianceReporter.d.ts +90 -0
  22. package/dist/audit/index.d.ts +13 -0
  23. package/dist/{chunk-FGMDMJM7.js → chunk-2BYAUHBO.js} +3 -3
  24. package/dist/{chunk-EDPYCLRC.cjs → chunk-2E6PP5UE.cjs} +83 -59
  25. package/dist/{chunk-GASCWJK5.js → chunk-2EGGAZT3.js} +65 -287
  26. package/dist/{chunk-SIEXCILW.js → chunk-2I3XAGMF.js} +3 -3
  27. package/dist/{chunk-OS533P33.cjs → chunk-2KKOYZYI.cjs} +1074 -1655
  28. package/dist/chunk-2MQKNDNH.js +51 -0
  29. package/dist/{chunk-7DMMMBCY.cjs → chunk-2X3IPCBK.cjs} +10 -10
  30. package/dist/chunk-2ZOTBO25.cjs +202 -0
  31. package/dist/chunk-356N4NPM.cjs +152 -0
  32. package/dist/{chunk-X3GJPRVK.cjs → chunk-36NPLOI4.cjs} +92 -81
  33. package/dist/{chunk-SLU6UPJI.cjs → chunk-37HHY7RH.cjs} +5 -5
  34. package/dist/{chunk-YDPEHCCI.cjs → chunk-3CDDRUER.cjs} +3 -118
  35. package/dist/chunk-3F7ZZWIN.js +1651 -0
  36. package/dist/chunk-3ILD7TKP.cjs +187 -0
  37. package/dist/{chunk-X27QRG4C.cjs → chunk-3IUHTGDD.cjs} +153 -41
  38. package/dist/{chunk-PXNZ6TME.js → chunk-4376VHNJ.js} +60 -36
  39. package/dist/{chunk-YKGPCZEE.cjs → chunk-4FIBOJW6.cjs} +10 -10
  40. package/dist/chunk-4Q7RKQQI.cjs +14195 -0
  41. package/dist/{chunk-YCM6QQRT.cjs → chunk-566ZB4LZ.cjs} +180 -8
  42. package/dist/{chunk-2Y3V22SG.js → chunk-5CURIYGT.js} +3 -3
  43. package/dist/{chunk-QBWNJXNR.js → chunk-5FYMCVBY.js} +5 -5
  44. package/dist/{chunk-ZA34AN3R.js → chunk-5LVFTGKH.js} +841 -12
  45. package/dist/{chunk-Z6PMDS4G.js → chunk-5OUOMBKK.js} +1090 -53
  46. package/dist/chunk-63AUAIL6.js +48 -0
  47. package/dist/chunk-655FATJU.js +110 -0
  48. package/dist/{chunk-TQ377OLB.cjs → chunk-65S62L4D.cjs} +28 -22
  49. package/dist/chunk-6NTAZN5Z.cjs +502 -0
  50. package/dist/chunk-6TRX6AR2.js +9376 -0
  51. package/dist/chunk-6ZCCLKS2.cjs +51 -0
  52. package/dist/{chunk-MDR235RZ.js → chunk-734OB5SK.js} +721 -8
  53. package/dist/{chunk-Q2Q34NF3.js → chunk-77QI552M.js} +6 -6
  54. package/dist/{chunk-WKX5AMOY.js → chunk-7I74JWPW.js} +3 -3
  55. package/dist/{chunk-5FSKKMR7.cjs → chunk-7IDJDMPU.cjs} +232 -4
  56. package/dist/chunk-7VBKRGIZ.cjs +847 -0
  57. package/dist/{chunk-KCPHASCO.js → chunk-AATYYLYK.js} +5 -5
  58. package/dist/{chunk-DTGBOSEM.cjs → chunk-AWXFEAQL.cjs} +12 -12
  59. package/dist/{chunk-THCK6ECW.js → chunk-B3CWTCK2.js} +231 -3
  60. package/dist/chunk-BCP4E7MD.cjs +997 -0
  61. package/dist/chunk-BG7RPYJP.js +91 -0
  62. package/dist/{chunk-VF257YKO.js → chunk-BP4KTMLY.js} +117 -5
  63. package/dist/{chunk-YN6IETRZ.js → chunk-BQJ3YBF3.js} +6424 -987
  64. package/dist/{chunk-7X5PNIQJ.js → chunk-BXSOEQI3.js} +27 -25
  65. package/dist/{chunk-WFKVS2K4.cjs → chunk-C65C5VED.cjs} +1101 -55
  66. package/dist/{chunk-KOUAQL2B.cjs → chunk-CANAL6CT.cjs} +1569 -168
  67. package/dist/{chunk-FDSGHPAK.js → chunk-CBSDJF3B.js} +3 -3
  68. package/dist/{chunk-FEWUHQNM.cjs → chunk-CFVK26P4.cjs} +4 -4
  69. package/dist/{chunk-M7K4LE66.cjs → chunk-CI33NINL.cjs} +4 -4
  70. package/dist/{chunk-2OWDB4FB.js → chunk-CKV5NYAE.js} +6 -6
  71. package/dist/{chunk-LPS5AMQD.cjs → chunk-CM4NHXVO.cjs} +24 -24
  72. package/dist/chunk-D3HSRXYB.js +115 -0
  73. package/dist/{chunk-FNHJRI32.js → chunk-DBH3D2MU.js} +1561 -160
  74. package/dist/{chunk-GW3LKD5C.js → chunk-DJNH4HFW.js} +3 -3
  75. package/dist/{chunk-2GCNOI2U.cjs → chunk-DN6F4DHH.cjs} +9 -3
  76. package/dist/chunk-DQRJ5RJG.js +432 -0
  77. package/dist/{chunk-C7ZBSV2Q.js → chunk-DUG3OQAS.js} +106 -43
  78. package/dist/chunk-ECUYJOJ2.cjs +199 -0
  79. package/dist/chunk-EEMTCAK7.js +182 -0
  80. package/dist/{chunk-3SKLAUDD.cjs → chunk-EI3J6LTW.cjs} +359 -581
  81. package/dist/{chunk-SSSN7VAM.js → chunk-EM2OGPYE.js} +4 -4
  82. package/dist/{chunk-56VOWURB.cjs → chunk-ENZCIQZC.cjs} +522 -453
  83. package/dist/chunk-ESBXUYOC.cjs +836 -0
  84. package/dist/{chunk-L5U4W6JC.js → chunk-ESSEF6U2.js} +4 -4
  85. package/dist/chunk-ET3AN4W3.js +824 -0
  86. package/dist/chunk-EXKSFGSX.cjs +14 -14
  87. package/dist/{chunk-I76GIKN7.cjs → chunk-F3YT6GUF.cjs} +17 -17
  88. package/dist/{chunk-WRWEX5ZF.js → chunk-F75DZBBI.js} +3 -3
  89. package/dist/{chunk-4JGRWHZJ.js → chunk-FG6PYGIZ.js} +12 -6
  90. package/dist/chunk-FGGJQRLZ.js +14 -14
  91. package/dist/{chunk-SXOSDZD6.js → chunk-FWCHPCD4.js} +128 -10
  92. package/dist/{chunk-XW6IXEQH.cjs → chunk-G35CAQ7I.cjs} +5 -5
  93. package/dist/{chunk-7VMGP2FW.js → chunk-G6KACNMO.js} +132 -188
  94. package/dist/{chunk-FJPADH77.cjs → chunk-GAWJJAGT.cjs} +6 -6
  95. package/dist/chunk-GGR7QUKK.cjs +4724 -0
  96. package/dist/chunk-GIBF4BHH.js +14098 -0
  97. package/dist/{chunk-AWB7QYY6.cjs → chunk-GILYQ5VH.cjs} +6 -6
  98. package/dist/{chunk-FWVYAMNW.cjs → chunk-GKFCHGCM.cjs} +4 -4
  99. package/dist/{chunk-Y3ZFVUUU.js → chunk-GLEJ2TLS.js} +3 -3
  100. package/dist/{chunk-3GWWJT7L.js → chunk-GP3OKSKT.js} +13 -13
  101. package/dist/chunk-GTIPOEHN.js +196 -0
  102. package/dist/{chunk-LMJ5EBV7.cjs → chunk-GZPUA2TL.cjs} +16 -15
  103. package/dist/{chunk-IELX2OKI.js → chunk-H4LJ4HEA.js} +3 -115
  104. package/dist/{chunk-ACVWFGBI.cjs → chunk-HCX4SMFK.cjs} +3 -3
  105. package/dist/{chunk-HYNTS5CP.js → chunk-HHRZ6STP.js} +24 -2
  106. package/dist/chunk-HIDEIEFG.js +48 -0
  107. package/dist/{chunk-W6RW64BB.cjs → chunk-HSWBIDZM.cjs} +228 -5
  108. package/dist/{chunk-GSOUNWEL.js → chunk-HVX7QQYK.js} +1035 -1616
  109. package/dist/{chunk-TRCGG42I.cjs → chunk-IFW5IW4L.cjs} +6502 -1019
  110. package/dist/{chunk-F5LKJ6F5.cjs → chunk-IJU6AS67.cjs} +32 -28
  111. package/dist/{chunk-TVANHNJ7.js → chunk-IK6Z2HNC.js} +173 -3
  112. package/dist/{chunk-QGMUTVVH.cjs → chunk-IS7NTKY5.cjs} +20 -20
  113. package/dist/{chunk-YFVQWSNJ.js → chunk-IXWGYWH6.js} +3 -3
  114. package/dist/chunk-J2DAS2PL.js +148 -0
  115. package/dist/chunk-JBQXZIWB.js +148 -0
  116. package/dist/chunk-JBYBMBMW.js +261 -0
  117. package/dist/{chunk-LWUOUCYL.js → chunk-JEJ7TT54.js} +5 -5
  118. package/dist/{chunk-DUCB6LGL.js → chunk-JOTCTHN5.js} +211 -5
  119. package/dist/{chunk-47RUFYKR.js → chunk-K56UVEXV.js} +3 -3
  120. package/dist/{chunk-XSFNHP2E.js → chunk-KB26H447.js} +3 -3
  121. package/dist/{chunk-3NGDZZR4.js → chunk-KEYG7HGY.js} +430 -37
  122. package/dist/{chunk-DY72BMU5.js → chunk-KFVNCW4Q.js} +4 -4
  123. package/dist/chunk-KPGC7SK2.js +192 -0
  124. package/dist/chunk-KROXXBK5.cjs +53 -0
  125. package/dist/{chunk-ZPZAVHXL.cjs → chunk-LB3ZZMKT.cjs} +137 -19
  126. package/dist/chunk-LDYZWNJW.cjs +1654 -0
  127. package/dist/{chunk-UGXHYIWT.cjs → chunk-LHNHO27U.cjs} +28 -28
  128. package/dist/{chunk-ULMSSHCJ.cjs → chunk-LMB555QB.cjs} +405 -38
  129. package/dist/{chunk-CBJY23VL.js → chunk-MD4IVS42.js} +3 -3
  130. package/dist/{chunk-VMLKSV26.js → chunk-MDDWEBCX.js} +226 -3
  131. package/dist/chunk-MUWH4QK5.cjs +94 -0
  132. package/dist/{chunk-T6W3Z3SH.cjs → chunk-N2ILK7BF.cjs} +4 -4
  133. package/dist/{chunk-6EX3I5P4.cjs → chunk-N74QRJGP.cjs} +6 -6
  134. package/dist/chunk-NFFHLX37.cjs +132 -0
  135. package/dist/chunk-NJSYWX7H.js +190 -0
  136. package/dist/{chunk-SH5PPVK7.cjs → chunk-NQN5LFN4.cjs} +165 -221
  137. package/dist/chunk-NTQRFOPP.cjs +56 -0
  138. package/dist/{chunk-YFWRJW4B.js → chunk-NWMJPTVL.js} +51 -55
  139. package/dist/{chunk-63ZGNR2T.cjs → chunk-OC6GV5QH.cjs} +42 -42
  140. package/dist/{chunk-7E7GCQCK.js → chunk-OG3MBHM3.js} +9 -3
  141. package/dist/chunk-OMNHTCS4.cjs +264 -0
  142. package/dist/chunk-OQXB6NNC.cjs +117 -0
  143. package/dist/{chunk-Y57W2CT5.cjs → chunk-OV46CCA2.cjs} +51 -55
  144. package/dist/{chunk-6PRZIHGL.cjs → chunk-OV6HHKLE.cjs} +21 -266
  145. package/dist/{chunk-C37BHB7N.cjs → chunk-P26YYPOO.cjs} +5 -5
  146. package/dist/{chunk-2BZHWUSR.cjs → chunk-P7JEKJTZ.cjs} +16 -16
  147. package/dist/{chunk-NGBXXZLL.cjs → chunk-PDXX5UI4.cjs} +45 -45
  148. package/dist/{chunk-FHQFPYV4.js → chunk-PJFTTSKE.js} +8 -7
  149. package/dist/{chunk-GVFJ6T4S.cjs → chunk-PVODJEJ7.cjs} +721 -8
  150. package/dist/{chunk-ZZ7RO2UQ.js → chunk-Q265VZJ4.js} +3 -3
  151. package/dist/{chunk-E7JP3BS3.cjs → chunk-Q47JEE2C.cjs} +4 -4
  152. package/dist/chunk-QBY7LRN2.js +281 -0
  153. package/dist/{chunk-GH6C2QGW.cjs → chunk-QEDMOGF3.cjs} +857 -16
  154. package/dist/{chunk-5WUNN6ZN.cjs → chunk-QHSAVOOL.cjs} +24 -2
  155. package/dist/chunk-QJNCDVYM.cjs +137 -0
  156. package/dist/chunk-QM7FJB5W.js +4717 -0
  157. package/dist/chunk-QQFB4RT2.cjs +448 -0
  158. package/dist/chunk-QSYBHQAD.cjs +196 -0
  159. package/dist/{chunk-2YSNA2F2.cjs → chunk-QVJMDVYZ.cjs} +5 -5
  160. package/dist/chunk-RAJMAX6D.js +131 -0
  161. package/dist/{chunk-VVKVQZI6.js → chunk-RAN3ECAS.js} +3 -3
  162. package/dist/chunk-RKGUZBOC.js +79 -0
  163. package/dist/{chunk-HLFDZ35S.cjs → chunk-RRQIAJLQ.cjs} +8 -8
  164. package/dist/{chunk-PABONWKI.js → chunk-RXQNRZ5F.js} +3 -3
  165. package/dist/{chunk-7ZHYEITD.cjs → chunk-S4O7CFHQ.cjs} +10 -11
  166. package/dist/chunk-SE7ANBGN.js +128 -0
  167. package/dist/{chunk-X2AVEAZM.cjs → chunk-SJIRCTIS.cjs} +176 -2
  168. package/dist/{chunk-WXQ57LAO.js → chunk-SQXAZHDG.js} +4 -4
  169. package/dist/chunk-SR73L5ZP.cjs +84 -0
  170. package/dist/{chunk-OABEO6HH.js → chunk-SZOLTWWD.js} +2349 -214
  171. package/dist/{chunk-5JEU52DW.js → chunk-TPZ3BN2D.js} +3 -3
  172. package/dist/{chunk-QFU53KRH.js → chunk-TSTFYGGX.js} +4 -5
  173. package/dist/{chunk-EBS32AJI.cjs → chunk-TZCFKZ6Z.cjs} +5 -5
  174. package/dist/chunk-UCVZXQ63.js +724 -0
  175. package/dist/chunk-UGQ3QNV6.js +992 -0
  176. package/dist/chunk-UNMVGZVW.js +142 -0
  177. package/dist/{chunk-TEVX443G.js → chunk-UTUD6GJI.js} +178 -6
  178. package/dist/chunk-UXBYA7DV.cjs +155 -0
  179. package/dist/chunk-V6GXFSK7.cjs +443 -0
  180. package/dist/chunk-VHORVGCG.cjs +761 -0
  181. package/dist/{chunk-B4EKV6HQ.js → chunk-VKCTYLDN.js} +500 -442
  182. package/dist/{chunk-O3MGZDCT.cjs → chunk-VTEXJOSD.cjs} +63 -63
  183. package/dist/chunk-VVAAZITA.cjs +287 -0
  184. package/dist/{chunk-V7AKE5VT.cjs → chunk-W2GA3EQB.cjs} +435 -42
  185. package/dist/chunk-W4GABFCR.js +37 -0
  186. package/dist/chunk-WKEK4NCA.js +490 -0
  187. package/dist/{chunk-5A4TCHOC.cjs → chunk-WNYXT4TE.cjs} +4 -4
  188. package/dist/{chunk-S762UEV5.js → chunk-WTH23ISI.js} +6 -6
  189. package/dist/{chunk-BTKZGHAV.js → chunk-WWNCM473.js} +10 -6
  190. package/dist/{chunk-4YNYPHH3.cjs → chunk-X75H75UY.cjs} +2351 -213
  191. package/dist/{chunk-LYJJI7ZK.cjs → chunk-XCUDDFKC.cjs} +216 -9
  192. package/dist/chunk-YAO4HPJL.cjs +120 -0
  193. package/dist/chunk-YKY2JBER.cjs +9443 -0
  194. package/dist/chunk-YP5CHEYU.cjs +154 -0
  195. package/dist/{chunk-WRNEH5MO.js → chunk-YW3I2FQL.js} +18 -7
  196. package/dist/{chunk-BRNUPDHJ.js → chunk-Z557DVYN.js} +386 -19
  197. package/dist/{chunk-VSACG2AR.js → chunk-Z6LZUYZF.js} +21 -264
  198. package/dist/chunk-ZHPMP447.cjs +43 -0
  199. package/dist/{chunk-LODTHGST.cjs → chunk-ZK7KX5CD.cjs} +133 -70
  200. package/dist/{chunk-CCPSNT6B.cjs → chunk-ZRPALBQB.cjs} +5 -5
  201. package/dist/chunk-ZVFHPMC5.js +824 -0
  202. package/dist/chunk-ZVQMKUGJ.js +443 -0
  203. package/dist/cli/holoscript-runner.cjs +86 -48
  204. package/dist/cli/holoscript-runner.js +54 -16
  205. package/dist/codebase/index.cjs +1 -1
  206. package/dist/codebase/index.js +1 -1
  207. package/dist/compiler/agent-inference.cjs +11 -11
  208. package/dist/compiler/agent-inference.js +9 -6
  209. package/dist/compiler/android-xr.cjs +13 -12
  210. package/dist/compiler/android-xr.js +11 -10
  211. package/dist/compiler/android.cjs +12 -12
  212. package/dist/compiler/android.js +10 -10
  213. package/dist/compiler/business-quest.cjs +10 -10
  214. package/dist/compiler/business-quest.js +2 -2
  215. package/dist/compiler/coco.cjs +1 -1
  216. package/dist/compiler/coco.js +1 -1
  217. package/dist/compiler/context.cjs +9 -9
  218. package/dist/compiler/context.js +6 -6
  219. package/dist/compiler/daimon-seed.cjs +36 -0
  220. package/dist/compiler/daimon-seed.js +12 -0
  221. package/dist/compiler/domain-block-utils.cjs +205 -156
  222. package/dist/compiler/domain-block-utils.js +8 -7
  223. package/dist/compiler/dtdl.cjs +10 -10
  224. package/dist/compiler/dtdl.js +7 -7
  225. package/dist/compiler/gltf-pipeline.cjs +9 -9
  226. package/dist/compiler/gltf-pipeline.js +2 -2
  227. package/dist/compiler/godot.cjs +10 -9
  228. package/dist/compiler/godot.js +9 -8
  229. package/dist/compiler/incremental.cjs +11 -11
  230. package/dist/compiler/incremental.js +6 -6
  231. package/dist/compiler/index.cjs +2585 -3273
  232. package/dist/compiler/index.d.ts +149 -35
  233. package/dist/compiler/index.js +2197 -3102
  234. package/dist/compiler/ios.cjs +11 -11
  235. package/dist/compiler/ios.js +9 -9
  236. package/dist/compiler/llm-provider-capabilities.cjs +9 -9
  237. package/dist/compiler/llm-provider-capabilities.js +6 -6
  238. package/dist/compiler/nodetoy.cjs +1 -1
  239. package/dist/compiler/nodetoy.js +1 -1
  240. package/dist/compiler/openxr.cjs +11 -10
  241. package/dist/compiler/openxr.js +10 -9
  242. package/dist/compiler/remotion.cjs +1 -1
  243. package/dist/compiler/remotion.js +1 -1
  244. package/dist/compiler/reproducibility.cjs +1 -1
  245. package/dist/compiler/reproducibility.js +1 -1
  246. package/dist/compiler/sdf.cjs +11 -10
  247. package/dist/compiler/sdf.js +9 -8
  248. package/dist/compiler/semantic-scene.cjs +7 -7
  249. package/dist/compiler/semantic-scene.js +2 -2
  250. package/dist/compiler/state.cjs +9 -9
  251. package/dist/compiler/state.js +7 -7
  252. package/dist/compiler/trait-composition.cjs +11 -11
  253. package/dist/compiler/trait-composition.js +7 -7
  254. package/dist/compiler/traits/ProvenanceSemiring.d.ts +167 -0
  255. package/dist/compiler/traits/Semiring.d.ts +26 -0
  256. package/dist/compiler/unity.cjs +11 -10
  257. package/dist/compiler/unity.js +10 -9
  258. package/dist/compiler/unreal.cjs +12 -11
  259. package/dist/compiler/unreal.js +10 -9
  260. package/dist/compiler/urdf.cjs +18 -17
  261. package/dist/compiler/urdf.js +9 -8
  262. package/dist/compiler/usd-physics.cjs +11 -10
  263. package/dist/compiler/usd-physics.js +8 -7
  264. package/dist/compiler/visionos.cjs +11 -10
  265. package/dist/compiler/visionos.js +10 -9
  266. package/dist/compiler/vrchat.cjs +11 -10
  267. package/dist/compiler/vrchat.js +9 -8
  268. package/dist/compiler/wasm.cjs +14 -13
  269. package/dist/compiler/wasm.js +9 -8
  270. package/dist/compiler/webgpu.cjs +10 -9
  271. package/dist/compiler/webgpu.js +9 -8
  272. package/dist/constants.cjs +398 -0
  273. package/dist/constants.js +9 -0
  274. package/dist/coordinators/index.cjs +4 -1
  275. package/dist/coordinators/index.js +4 -1
  276. package/dist/debugger.cjs +11 -9
  277. package/dist/debugger.js +9 -7
  278. package/dist/{dist-ACXG6IH5.cjs → dist-GRMOP2UL.cjs} +341 -65
  279. package/dist/{dist-VD4L6V7Q.js → dist-ZBUKU2JG.js} +333 -63
  280. package/dist/entries/interop.cjs +23 -23
  281. package/dist/entries/interop.js +3 -3
  282. package/dist/entries/scripting.cjs +12 -11
  283. package/dist/entries/scripting.js +8 -7
  284. package/dist/evolution/index.cjs +66 -0
  285. package/dist/evolution/index.d.ts +162 -0
  286. package/dist/evolution/index.js +17 -0
  287. package/dist/hololand/index.cjs +41 -37
  288. package/dist/hololand/index.js +3 -3
  289. package/dist/index.cjs +12394 -3224
  290. package/dist/index.d.ts +260 -18
  291. package/dist/index.js +10755 -2182
  292. package/dist/keyword-registry/PluginKeywordRegistry.d.ts +138 -0
  293. package/dist/keyword-registry/index.cjs +29 -0
  294. package/dist/keyword-registry/index.d.ts +1 -0
  295. package/dist/keyword-registry/index.js +4 -0
  296. package/dist/math/tropical-spmv.cjs +11 -11
  297. package/dist/math/tropical-spmv.d.ts +1 -0
  298. package/dist/math/tropical-spmv.js +2 -2
  299. package/dist/math/tropicalSpmv.d.ts +43 -0
  300. package/dist/math/vec3.cjs +1 -1
  301. package/dist/math/vec3.js +1 -1
  302. package/dist/matter/StagedMatter.d.ts +82 -0
  303. package/dist/matter/index.cjs +17 -0
  304. package/dist/matter/index.d.ts +1 -0
  305. package/dist/matter/index.js +4 -0
  306. package/dist/{ml-dsa-Z7JDKW4L.js → ml-dsa-J6VKVT4K.js} +3 -3
  307. package/dist/{ml-dsa-FSKBTE3W.cjs → ml-dsa-MTIK4ZUQ.cjs} +23 -23
  308. package/dist/paper-0c-spike/index.cjs +1 -1
  309. package/dist/paper-0c-spike/index.js +1 -1
  310. package/dist/parameter-envelope/ParameterEnvelope.d.ts +128 -0
  311. package/dist/parameter-envelope/index.cjs +17 -0
  312. package/dist/parameter-envelope/index.d.ts +2 -0
  313. package/dist/parameter-envelope/index.js +4 -0
  314. package/dist/parser/HoloCompositionTypes.d.ts +2013 -0
  315. package/dist/parser/PipelineParser.d.ts +162 -0
  316. package/dist/parser.cjs +36 -20
  317. package/dist/parser.js +13 -9
  318. package/dist/plugin-manifest/ManifestAutoLoader.d.ts +35 -0
  319. package/dist/plugin-manifest/PluginManifest.d.ts +156 -0
  320. package/dist/plugin-manifest/index.cjs +25 -0
  321. package/dist/plugin-manifest/index.d.ts +2 -0
  322. package/dist/plugin-manifest/index.js +4 -0
  323. package/dist/plugin-solver-contract/PluginSolverContract.d.ts +288 -0
  324. package/dist/plugin-solver-contract/index.cjs +41 -0
  325. package/dist/plugin-solver-contract/index.d.ts +1 -0
  326. package/dist/plugin-solver-contract/index.js +4 -0
  327. package/dist/policy/ContentPolicyGate.d.ts +51 -0
  328. package/dist/policy/PolicyPack.d.ts +120 -0
  329. package/dist/policy/blocklist.d.ts +32 -0
  330. package/dist/policy/defaults.d.ts +44 -0
  331. package/dist/policy/index.cjs +106 -0
  332. package/dist/policy/index.d.ts +17 -0
  333. package/dist/policy/index.js +5 -0
  334. package/dist/policy/jsonLogic.d.ts +31 -0
  335. package/dist/policy/types.d.ts +174 -0
  336. package/dist/proof-composition/ProofCompositionLaw.d.ts +93 -0
  337. package/dist/proof-composition/index.cjs +25 -0
  338. package/dist/proof-composition/index.d.ts +1 -0
  339. package/dist/proof-composition/index.js +4 -0
  340. package/dist/receipts/hash-policy.d.ts +85 -0
  341. package/dist/reconstruction/index.cjs +75 -47
  342. package/dist/reconstruction/index.js +5 -5
  343. package/dist/runtime/plugin-trait-registrar.d.ts +36 -0
  344. package/dist/runtime.cjs +81 -79
  345. package/dist/runtime.js +9 -7
  346. package/dist/scene-presets-EDKYZ5GW.js +4 -0
  347. package/dist/scene-presets-NCW2CFRS.cjs +17 -0
  348. package/dist/self-improvement/index.cjs +1 -1
  349. package/dist/self-improvement/index.js +1 -1
  350. package/dist/{src-PT2FERDV.cjs → src-G3D7ZATQ.cjs} +545 -21
  351. package/dist/{src-J6CM4AUR.js → src-UXYA7HM6.js} +539 -16
  352. package/dist/storage/index.cjs +10 -10
  353. package/dist/storage/index.js +3 -3
  354. package/dist/testing.cjs +1 -1
  355. package/dist/testing.js +1 -1
  356. package/dist/tools/index.cjs +3631 -0
  357. package/dist/tools/index.js +3581 -0
  358. package/dist/traitDocs/traitDocs.cjs +9 -9
  359. package/dist/traitDocs/traitDocs.d.ts +1 -0
  360. package/dist/traitDocs/traitDocs.js +3 -3
  361. package/dist/traits/ControlLoopTrait.d.ts +154 -0
  362. package/dist/traits/KinematicChainTrait.d.ts +116 -0
  363. package/dist/traits/SensorSamplingTrait.d.ts +154 -0
  364. package/dist/traits/TraitTypes.d.ts +270 -0
  365. package/dist/traits/TransactionTrait.d.ts +121 -0
  366. package/dist/traits/botanical-lotus.cjs +54 -50
  367. package/dist/traits/botanical-lotus.js +2 -5
  368. package/dist/traits/control-loop.cjs +21 -0
  369. package/dist/traits/control-loop.d.ts +1 -0
  370. package/dist/traits/control-loop.js +4 -0
  371. package/dist/traits/engines/cloth-verlet.d.ts +65 -0
  372. package/dist/traits/engines/index.cjs +19 -19
  373. package/dist/traits/engines/index.d.ts +15 -275
  374. package/dist/traits/engines/index.js +3 -3
  375. package/dist/traits/engines/motion-data-schema.d.ts +119 -0
  376. package/dist/traits/engines/motion-matching.d.ts +102 -0
  377. package/dist/traits/engines/noise.d.ts +25 -0
  378. package/dist/traits/engines/onnx-adapter.d.ts +173 -0
  379. package/dist/traits/engines/onnx-motion-matching.d.ts +163 -0
  380. package/dist/traits/engines/pfnn-network.d.ts +92 -0
  381. package/dist/traits/engines/synthetic-walk-cycle.d.ts +38 -0
  382. package/dist/traits/engines/tensor-ops.d.ts +15 -0
  383. package/dist/traits/index.cjs +2789 -1259
  384. package/dist/traits/index.d.ts +35 -0
  385. package/dist/traits/index.js +1692 -411
  386. package/dist/traits/kinematic-chain.cjs +25 -0
  387. package/dist/traits/kinematic-chain.d.ts +1 -0
  388. package/dist/traits/kinematic-chain.js +4 -0
  389. package/dist/traits/sensor-sampling.cjs +33 -0
  390. package/dist/traits/sensor-sampling.d.ts +1 -0
  391. package/dist/traits/sensor-sampling.js +4 -0
  392. package/dist/traits/simulation-solver-factory.cjs +1 -1
  393. package/dist/traits/simulation-solver-factory.js +1 -1
  394. package/dist/traits/transaction.cjs +29 -0
  395. package/dist/traits/transaction.d.ts +1 -0
  396. package/dist/traits/transaction.js +4 -0
  397. package/dist/traits/webcam-gaze.cjs +1 -1
  398. package/dist/traits/webcam-gaze.js +1 -1
  399. package/dist/type-checker.cjs +7 -6
  400. package/dist/type-checker.js +5 -4
  401. package/dist/types/AdvancedTypeSystem.d.ts +489 -0
  402. package/dist/types/HoloScriptPlus.d.ts +810 -0
  403. package/dist/types/base.d.ts +248 -0
  404. package/dist/types.d.ts +799 -0
  405. package/dist/world/index.cjs +3 -4
  406. package/dist/world/index.js +3 -4
  407. package/dist/world-model/index.cjs +1 -1
  408. package/dist/world-model/index.js +1 -1
  409. package/dist/wot/index.cjs +1 -1
  410. package/dist/wot/index.js +1 -1
  411. package/package.json +135 -69
  412. package/dist/GLTFPipeline-3EJLL3TS.cjs +0 -38
  413. package/dist/GLTFPipeline-3OWJV2VK.js +0 -17
  414. package/dist/HoloScriptPlusParser-ADWRY5OS.cjs +0 -698
  415. package/dist/HoloScriptPlusParser-JLJDXHSC.js +0 -693
  416. package/dist/HoloScriptPlusParser-QCGFPWIL.cjs +0 -27
  417. package/dist/HoloScriptPlusParser-WENAFEFV.js +0 -10
  418. package/dist/HoloScriptRuntime-GGRVEU4T.cjs +0 -19
  419. package/dist/HoloScriptRuntime-GJK6VJPH.js +0 -10
  420. package/dist/chunk-22Q5A6RV.js +0 -979
  421. package/dist/chunk-4C57PR42.js +0 -468
  422. package/dist/chunk-4W5G5QVL.cjs +0 -847
  423. package/dist/chunk-5ET6L4NS.js +0 -487
  424. package/dist/chunk-C4GSLCHE.cjs +0 -7153
  425. package/dist/chunk-F2G6CWFT.js +0 -7089
  426. package/dist/chunk-G6PNEASF.cjs +0 -814
  427. package/dist/chunk-GTA4Q3A3.js +0 -1491
  428. package/dist/chunk-HCCQLAA4.cjs +0 -74
  429. package/dist/chunk-HFSVMKM3.cjs +0 -72
  430. package/dist/chunk-KAIVDEIG.cjs +0 -4539
  431. package/dist/chunk-KQU64CIX.cjs +0 -1508
  432. package/dist/chunk-MSYSQ2AJ.js +0 -4533
  433. package/dist/chunk-NHJLP37F.js +0 -70
  434. package/dist/chunk-NHYRRAGI.cjs +0 -490
  435. package/dist/chunk-OIQYIIO3.cjs +0 -473
  436. package/dist/chunk-OL46QLBJ.js +0 -61
  437. package/dist/chunk-SKZPC5AG.cjs +0 -984
  438. package/dist/chunk-SLHLXUMO.js +0 -445
  439. package/dist/chunk-UOIGFQXC.cjs +0 -9750
  440. package/dist/chunk-UOL6Y5TD.cjs +0 -759
  441. package/dist/chunk-UVFI7XIR.cjs +0 -452
  442. package/dist/chunk-VEPGBETF.js +0 -844
  443. package/dist/chunk-XQ5MWMP2.js +0 -756
  444. package/dist/chunk-XT6JY5W5.js +0 -9684
  445. package/dist/chunk-YRRAUB35.js +0 -811
  446. package/dist/compiler/GasOptimizationAnalyzer.d.ts +0 -73
  447. package/dist/compiler/NFTMarketplaceCompiler.d.ts +0 -23
  448. package/dist/compiler/ar.cjs +0 -23
  449. package/dist/compiler/ar.js +0 -11
  450. package/dist/compiler/babylon.cjs +0 -21
  451. package/dist/compiler/babylon.js +0 -15
  452. package/dist/compiler/multi-layer.cjs +0 -24
  453. package/dist/compiler/multi-layer.js +0 -15
  454. package/dist/compiler/playcanvas.cjs +0 -19
  455. package/dist/compiler/playcanvas.js +0 -13
  456. package/dist/compiler/r3f.cjs +0 -39
  457. package/dist/compiler/r3f.d.ts +0 -22
  458. package/dist/compiler/r3f.js +0 -17
  459. package/dist/compiler/vrr.cjs +0 -24
  460. package/dist/compiler/vrr.js +0 -12
  461. package/dist/parser/NFTMarketplaceTypes.d.ts +0 -191
  462. package/dist/playwright-3AT3AKTV.cjs +0 -98673
  463. package/dist/playwright-VZPDVUEQ.js +0 -98660
@@ -0,0 +1,4724 @@
1
+ 'use strict';
2
+
3
+ var chunkKROXXBK5_cjs = require('./chunk-KROXXBK5.cjs');
4
+ var chunkYKY2JBER_cjs = require('./chunk-YKY2JBER.cjs');
5
+ var chunkQQFB4RT2_cjs = require('./chunk-QQFB4RT2.cjs');
6
+ var chunkENZCIQZC_cjs = require('./chunk-ENZCIQZC.cjs');
7
+ var chunkV6GXFSK7_cjs = require('./chunk-V6GXFSK7.cjs');
8
+ var chunkTZCFKZ6Z_cjs = require('./chunk-TZCFKZ6Z.cjs');
9
+ var chunkQEDMOGF3_cjs = require('./chunk-QEDMOGF3.cjs');
10
+ var chunkVHORVGCG_cjs = require('./chunk-VHORVGCG.cjs');
11
+ var chunkZK7KX5CD_cjs = require('./chunk-ZK7KX5CD.cjs');
12
+ var chunkHCX4SMFK_cjs = require('./chunk-HCX4SMFK.cjs');
13
+
14
+ // src/compiler/SceneIRCompiler.ts
15
+ chunkVHORVGCG_cjs.init_PerceptualColorPass();
16
+
17
+ // src/traits/visual/presets/hologram-media.visual.ts
18
+ var HOLOGRAM_MEDIA_VISUALS = {
19
+ depth_estimation: {
20
+ material: { roughness: 0.3 },
21
+ emissive: { color: "#6644FF", intensity: 0.2 },
22
+ tags: ["ai", "depth", "hologram"],
23
+ layer: "visual_effect"
24
+ },
25
+ displacement: {
26
+ material: { roughness: 0.4 },
27
+ emissive: { color: "#8866FF", intensity: 0.15 },
28
+ tags: ["3d", "depth", "mesh"],
29
+ layer: "visual_effect"
30
+ },
31
+ segment: {
32
+ material: { roughness: 0.3 },
33
+ emissive: { color: "#FF44AA", intensity: 0.15 },
34
+ tags: ["ai", "segmentation", "mask"],
35
+ layer: "visual_effect"
36
+ },
37
+ animated_texture: {
38
+ material: { roughness: 0.3 },
39
+ emissive: { color: "#44FFAA", intensity: 0.15 },
40
+ tags: ["animation", "texture", "gif"],
41
+ layer: "visual_effect"
42
+ },
43
+ holographic_sprite: {
44
+ material: { roughness: 0.2 },
45
+ emissive: { color: "#AA44FF", intensity: 0.3 },
46
+ tags: ["hologram", "sprite", "3d"],
47
+ layer: "visual_effect"
48
+ },
49
+ quilt: {
50
+ material: { roughness: 0.3 },
51
+ emissive: { color: "#44AAFF", intensity: 0.2 },
52
+ tags: ["hologram", "multiview", "looking-glass"],
53
+ layer: "visual_effect"
54
+ },
55
+ gaussian_splatting: {
56
+ material: { roughness: 0.2 },
57
+ emissive: { color: "#AACCFF", intensity: 0.15 },
58
+ tags: ["3d", "photorealistic", "splat"],
59
+ layer: "visual_effect"
60
+ },
61
+ spatial_video: {
62
+ material: { roughness: 0.3 },
63
+ emissive: { color: "#FF8844", intensity: 0.15 },
64
+ tags: ["video", "stereo", "spatial"],
65
+ layer: "visual_effect"
66
+ },
67
+ image: {
68
+ material: { roughness: 0.4 },
69
+ tags: ["media", "texture", "source"],
70
+ layer: "base_material"
71
+ },
72
+ depth_sequence: {
73
+ material: { roughness: 0.3 },
74
+ emissive: { color: "#6644FF", intensity: 0.1 },
75
+ tags: ["video", "depth", "temporal"],
76
+ layer: "visual_effect"
77
+ },
78
+ temporal_smoothing: {
79
+ material: { roughness: 0.3 },
80
+ tags: ["processing", "temporal"],
81
+ layer: "visual_effect"
82
+ },
83
+ depth_to_normal: {
84
+ material: { roughness: 0.3 },
85
+ emissive: { color: "#8888FF", intensity: 0.1 },
86
+ tags: ["processing", "normal-map"],
87
+ layer: "visual_effect"
88
+ }
89
+ };
90
+
91
+ // src/traits/visual/presets/gaps-physics.visual.ts
92
+ var GAPS_PHYSICS_VISUALS = /* @__PURE__ */ new Map([
93
+ // --- Pillar A: Unified Physics ---
94
+ [
95
+ "fluid",
96
+ {
97
+ material: {
98
+ type: "physical",
99
+ color: "#1a6fc4",
100
+ metalness: 0,
101
+ roughness: 0.05,
102
+ transmission: 0.95,
103
+ ior: 1.33,
104
+ thickness: 0.5
105
+ },
106
+ layers: [
107
+ {
108
+ type: "effect",
109
+ name: "ssfr",
110
+ priority: 50,
111
+ config: {
112
+ resolutionScale: 0.5,
113
+ absorptionColor: [0.4, 0.04, 0],
114
+ absorptionStrength: 2,
115
+ fresnelPower: 0.02,
116
+ refractionStrength: 0.1
117
+ }
118
+ }
119
+ ]
120
+ }
121
+ ],
122
+ [
123
+ "soft_body_pro",
124
+ {
125
+ material: {
126
+ type: "physical",
127
+ color: "#e8a87c",
128
+ metalness: 0,
129
+ roughness: 0.6
130
+ },
131
+ layers: [
132
+ {
133
+ type: "deformation",
134
+ name: "pbd_tearing",
135
+ priority: 45,
136
+ config: { tearThreshold: 0.8, tearColor: "#8b0000" }
137
+ }
138
+ ]
139
+ }
140
+ ],
141
+ [
142
+ "crowd_sim",
143
+ {
144
+ material: {
145
+ type: "standard",
146
+ color: "#7b68ee"
147
+ },
148
+ layers: [
149
+ {
150
+ type: "instanced",
151
+ name: "crowd_instances",
152
+ priority: 30,
153
+ config: { maxInstances: 1e4, lodLevels: 3 }
154
+ }
155
+ ]
156
+ }
157
+ ],
158
+ [
159
+ "deformable_terrain",
160
+ {
161
+ material: {
162
+ type: "standard",
163
+ color: "#8b7355",
164
+ roughness: 0.9
165
+ },
166
+ layers: [
167
+ {
168
+ type: "displacement",
169
+ name: "heightmap_erosion",
170
+ priority: 40,
171
+ config: { displacementScale: 5 }
172
+ }
173
+ ]
174
+ }
175
+ ],
176
+ [
177
+ "volumetric_clouds",
178
+ {
179
+ material: {
180
+ type: "shader",
181
+ color: "#ffffff"
182
+ },
183
+ layers: [
184
+ {
185
+ type: "volumetric",
186
+ name: "cloud_raymarcher",
187
+ priority: 80,
188
+ config: {
189
+ absorptionCoeff: 0.04,
190
+ scatteringCoeff: 0.06,
191
+ phaseG: 0.3,
192
+ maxSteps: 64
193
+ }
194
+ }
195
+ ]
196
+ }
197
+ ],
198
+ [
199
+ "god_rays",
200
+ {
201
+ material: {
202
+ type: "shader",
203
+ color: "#fffde7"
204
+ },
205
+ layers: [
206
+ {
207
+ type: "post_process",
208
+ name: "volumetric_light",
209
+ priority: 85,
210
+ config: { decay: 0.96, weight: 0.5, exposure: 0.3, samples: 100 }
211
+ }
212
+ ]
213
+ }
214
+ ],
215
+ // --- Weather Hub ---
216
+ [
217
+ "weather",
218
+ {
219
+ material: {
220
+ type: "none",
221
+ color: "#87ceeb"
222
+ },
223
+ layers: [
224
+ {
225
+ type: "ambient",
226
+ name: "weather_atmosphere",
227
+ priority: 90,
228
+ config: { affectsLighting: true, affectsFog: true }
229
+ }
230
+ ]
231
+ }
232
+ ],
233
+ // --- Pillar B: Persistent World ---
234
+ [
235
+ "world_state",
236
+ {
237
+ material: {
238
+ type: "none",
239
+ color: "#4a90d9"
240
+ },
241
+ layers: []
242
+ }
243
+ ],
244
+ [
245
+ "spatial_voice",
246
+ {
247
+ material: {
248
+ type: "none",
249
+ color: "#90ee90"
250
+ },
251
+ layers: [
252
+ {
253
+ type: "indicator",
254
+ name: "voice_range",
255
+ priority: 10,
256
+ config: { showRadius: true, radiusColor: "#90ee9040" }
257
+ }
258
+ ]
259
+ }
260
+ ],
261
+ [
262
+ "lip_sync",
263
+ {
264
+ material: {
265
+ type: "none",
266
+ color: "#ffb6c1"
267
+ },
268
+ layers: [
269
+ {
270
+ type: "morph",
271
+ name: "viseme_blendshapes",
272
+ priority: 60,
273
+ config: { blendShapePrefix: "viseme_" }
274
+ }
275
+ ]
276
+ }
277
+ ],
278
+ // --- Pillar C: Living Economy ---
279
+ [
280
+ "ai_companion",
281
+ {
282
+ material: {
283
+ type: "standard",
284
+ color: "#dda0dd",
285
+ emissive: "#330033",
286
+ emissiveIntensity: 0.2
287
+ },
288
+ layers: [
289
+ {
290
+ type: "indicator",
291
+ name: "ai_thinking",
292
+ priority: 15,
293
+ config: { pulseColor: "#9b59b6", pulseSpeed: 1.5 }
294
+ }
295
+ ]
296
+ }
297
+ ],
298
+ [
299
+ "token_gated",
300
+ {
301
+ material: {
302
+ type: "standard",
303
+ color: "#ffd700",
304
+ metalness: 0.8,
305
+ roughness: 0.2
306
+ },
307
+ layers: [
308
+ {
309
+ type: "barrier",
310
+ name: "token_gate_barrier",
311
+ priority: 70,
312
+ config: { barrierColor: "#ffd70060", shimmer: true }
313
+ }
314
+ ]
315
+ }
316
+ ],
317
+ [
318
+ "moderation",
319
+ {
320
+ material: {
321
+ type: "none",
322
+ color: "#ff6347"
323
+ },
324
+ layers: []
325
+ }
326
+ ],
327
+ [
328
+ "anti_grief",
329
+ {
330
+ material: {
331
+ type: "none",
332
+ color: "#32cd32"
333
+ },
334
+ layers: [
335
+ {
336
+ type: "shield",
337
+ name: "grief_shield",
338
+ priority: 95,
339
+ config: { shieldColor: "#32cd3230" }
340
+ }
341
+ ]
342
+ }
343
+ ]
344
+ ]);
345
+
346
+ // src/traits/visual/presets/phone-sleeve-vr.visual.ts
347
+ var PHONE_SLEEVE_VR_VISUALS = {
348
+ // --- Hardware Form Factor ---
349
+ phone_sleeve: {
350
+ material: { roughness: 0.3, metalness: 0.6 },
351
+ emissive: { color: "#00CCFF", intensity: 0.2 },
352
+ tags: ["vr", "phone", "sleeve", "headset"],
353
+ layer: "visual_effect"
354
+ },
355
+ sleeve_nfc_trigger: {
356
+ material: { roughness: 0.4 },
357
+ emissive: { color: "#FFD700", intensity: 0.15 },
358
+ tags: ["nfc", "trigger", "hardware"],
359
+ layer: "visual_effect"
360
+ },
361
+ sleeve_lens_profile: {
362
+ material: { roughness: 0.1, metalness: 0 },
363
+ opacity: 0.6,
364
+ tags: ["lens", "optics"],
365
+ layer: "visual_effect"
366
+ },
367
+ phone_detection: {
368
+ material: { roughness: 0.4 },
369
+ emissive: { color: "#44FF88", intensity: 0.1 },
370
+ tags: ["detection", "calibration"],
371
+ layer: "visual_effect"
372
+ },
373
+ // --- Display ---
374
+ stereo_split: {
375
+ material: { roughness: 0.2 },
376
+ emissive: { color: "#FF44AA", intensity: 0.2 },
377
+ tags: ["stereoscopic", "display", "split"],
378
+ layer: "visual_effect"
379
+ },
380
+ barrel_distortion: {
381
+ material: { roughness: 0.3 },
382
+ emissive: { color: "#AA44FF", intensity: 0.15 },
383
+ tags: ["distortion", "shader", "lens"],
384
+ layer: "visual_effect"
385
+ },
386
+ chromatic_aberration_fix: {
387
+ material: { roughness: 0.3 },
388
+ emissive: { color: "#FF8800", intensity: 0.1 },
389
+ tags: ["color", "correction", "lens"],
390
+ layer: "visual_effect"
391
+ },
392
+ ipd_adjust: {
393
+ material: { roughness: 0.4 },
394
+ emissive: { color: "#44CCFF", intensity: 0.1 },
395
+ tags: ["calibration", "ipd", "comfort"],
396
+ layer: "visual_effect"
397
+ },
398
+ // --- Sensor / Tracking ---
399
+ gyro_head_tracking: {
400
+ material: { roughness: 0.4 },
401
+ emissive: { color: "#00FF88", intensity: 0.15 },
402
+ tags: ["tracking", "gyroscope", "3dof"],
403
+ layer: "visual_effect"
404
+ },
405
+ accel_sensor_fusion: {
406
+ material: { roughness: 0.4 },
407
+ emissive: { color: "#00CC66", intensity: 0.1 },
408
+ tags: ["sensor", "accelerometer", "fusion"],
409
+ layer: "visual_effect"
410
+ },
411
+ mag_drift_correction: {
412
+ material: { roughness: 0.4 },
413
+ emissive: { color: "#8844FF", intensity: 0.1 },
414
+ tags: ["magnetometer", "drift", "correction"],
415
+ layer: "visual_effect"
416
+ },
417
+ positional_estimation: {
418
+ material: { roughness: 0.4 },
419
+ emissive: { color: "#FFAA00", intensity: 0.15 },
420
+ tags: ["6dof", "vio", "tracking"],
421
+ layer: "visual_effect"
422
+ },
423
+ // --- Interaction ---
424
+ gaze_cursor: {
425
+ material: { roughness: 0.2 },
426
+ emissive: { color: "#FFFFFF", intensity: 0.3 },
427
+ tags: ["gaze", "cursor", "reticle"],
428
+ layer: "visual_effect"
429
+ },
430
+ gaze_dwell_select: {
431
+ material: { roughness: 0.3 },
432
+ emissive: { color: "#FFFF44", intensity: 0.2 },
433
+ tags: ["gaze", "dwell", "selection"],
434
+ layer: "visual_effect"
435
+ },
436
+ bt_controller: {
437
+ material: { roughness: 0.5, metalness: 0.3 },
438
+ tags: ["bluetooth", "controller", "input"],
439
+ layer: "visual_effect"
440
+ },
441
+ tap_select: {
442
+ material: { roughness: 0.4 },
443
+ emissive: { color: "#44FF44", intensity: 0.1 },
444
+ tags: ["tap", "capacitive", "input"],
445
+ layer: "visual_effect"
446
+ },
447
+ voice_command: {
448
+ material: { roughness: 0.4 },
449
+ emissive: { color: "#4488FF", intensity: 0.1 },
450
+ tags: ["voice", "speech", "command"],
451
+ layer: "visual_effect"
452
+ },
453
+ // --- Performance ---
454
+ thermal_throttle: {
455
+ material: { roughness: 0.6 },
456
+ emissive: { color: "#FF4400", intensity: 0.2 },
457
+ tags: ["thermal", "throttle", "performance"],
458
+ layer: "visual_effect"
459
+ },
460
+ battery_aware_lod: {
461
+ material: { roughness: 0.5 },
462
+ emissive: { color: "#44FF00", intensity: 0.1 },
463
+ tags: ["battery", "lod", "adaptive"],
464
+ layer: "visual_effect"
465
+ },
466
+ sleeve_foveated: {
467
+ material: { roughness: 0.3 },
468
+ emissive: { color: "#CC44FF", intensity: 0.15 },
469
+ tags: ["foveated", "rendering", "performance"],
470
+ layer: "visual_effect"
471
+ },
472
+ low_persistence: {
473
+ material: { roughness: 0.2 },
474
+ emissive: { color: "#88CCFF", intensity: 0.1 },
475
+ tags: ["display", "persistence", "blur"],
476
+ layer: "visual_effect"
477
+ },
478
+ // --- Comfort ---
479
+ vr_comfort_vignette: {
480
+ material: { roughness: 0.5 },
481
+ opacity: 0.7,
482
+ tags: ["comfort", "vignette", "motion"],
483
+ layer: "visual_effect"
484
+ },
485
+ reorient_snap: {
486
+ material: { roughness: 0.4 },
487
+ emissive: { color: "#44FFCC", intensity: 0.1 },
488
+ tags: ["snap", "recenter", "comfort"],
489
+ layer: "visual_effect"
490
+ },
491
+ static_horizon: {
492
+ material: { roughness: 0.4 },
493
+ emissive: { color: "#88FF88", intensity: 0.1 },
494
+ tags: ["horizon", "stability", "nausea"],
495
+ layer: "visual_effect"
496
+ },
497
+ session_timer: {
498
+ material: { roughness: 0.4 },
499
+ emissive: { color: "#FFCC00", intensity: 0.15 },
500
+ tags: ["timer", "health", "breaks"],
501
+ layer: "visual_effect"
502
+ }
503
+ };
504
+
505
+ // src/traits/visual/index.ts
506
+ var ALL_PRESETS = [
507
+ // Original 12
508
+ chunkYKY2JBER_cjs.MATERIAL_PROPERTIES_VISUALS,
509
+ chunkYKY2JBER_cjs.SURFACE_TEXTURE_VISUALS,
510
+ chunkYKY2JBER_cjs.LIGHTING_VISUALS,
511
+ chunkYKY2JBER_cjs.GEMS_MINERALS_VISUALS,
512
+ chunkYKY2JBER_cjs.FABRIC_CLOTH_VISUALS,
513
+ chunkYKY2JBER_cjs.VISUAL_EFFECTS_VISUALS,
514
+ chunkYKY2JBER_cjs.AGE_CONDITION_VISUALS,
515
+ chunkYKY2JBER_cjs.WATER_FLUID_VISUALS,
516
+ chunkYKY2JBER_cjs.WEATHER_PHENOMENA_VISUALS,
517
+ chunkYKY2JBER_cjs.EMOTION_MOOD_VISUALS,
518
+ chunkYKY2JBER_cjs.SIZE_SCALE_VISUALS,
519
+ chunkYKY2JBER_cjs.ENVIRONMENTAL_BIOME_VISUALS,
520
+ // Expansion wave 1
521
+ chunkYKY2JBER_cjs.MAGIC_FANTASY_VISUALS,
522
+ chunkYKY2JBER_cjs.SCIFI_TECHNOLOGY_VISUALS,
523
+ chunkYKY2JBER_cjs.CREATURES_MYTHICAL_VISUALS,
524
+ chunkYKY2JBER_cjs.NATURE_LIFE_VISUALS,
525
+ chunkYKY2JBER_cjs.FURNITURE_DECOR_VISUALS,
526
+ chunkYKY2JBER_cjs.CONSTRUCTION_BUILDING_VISUALS,
527
+ chunkYKY2JBER_cjs.CONTAINERS_STORAGE_VISUALS,
528
+ chunkYKY2JBER_cjs.SHAPE_FORM_VISUALS,
529
+ chunkYKY2JBER_cjs.ANIMALS_VISUALS,
530
+ chunkYKY2JBER_cjs.MARITIME_NAVAL_VISUALS,
531
+ chunkYKY2JBER_cjs.TIME_PERIOD_VISUALS,
532
+ // Expansion wave 2 — full coverage
533
+ chunkYKY2JBER_cjs.ACCESSIBILITY_VISUALS,
534
+ chunkYKY2JBER_cjs.ACCESSIBILITY_EXTENDED_VISUALS,
535
+ chunkYKY2JBER_cjs.ARCHITECTURE_REALESTATE_VISUALS,
536
+ chunkYKY2JBER_cjs.AUDIO_VISUALS,
537
+ chunkYKY2JBER_cjs.COOKING_FOOD_VISUALS,
538
+ chunkYKY2JBER_cjs.CORE_VR_INTERACTION_VISUALS,
539
+ chunkYKY2JBER_cjs.DATA_VISUALIZATION_VISUALS,
540
+ chunkYKY2JBER_cjs.PERCEPTUAL_COLOR_VISUALS,
541
+ chunkYKY2JBER_cjs.EDUCATION_LEARNING_VISUALS,
542
+ chunkYKY2JBER_cjs.ENVIRONMENT_INPUT_VISUALS,
543
+ chunkYKY2JBER_cjs.GAME_MECHANICS_VISUALS,
544
+ chunkYKY2JBER_cjs.GEOSPATIAL_WEB3_VISUALS,
545
+ chunkYKY2JBER_cjs.HEALTHCARE_MEDICAL_VISUALS,
546
+ chunkYKY2JBER_cjs.HUMANOID_AVATAR_VISUALS,
547
+ chunkYKY2JBER_cjs.INTELLIGENCE_BEHAVIOR_VISUALS,
548
+ chunkYKY2JBER_cjs.INTEROP_COPRESENCE_VISUALS,
549
+ chunkYKY2JBER_cjs.IOT_AUTONOMOUS_AGENTS_VISUALS,
550
+ chunkYKY2JBER_cjs.LOCOMOTION_MOVEMENT_VISUALS,
551
+ chunkYKY2JBER_cjs.MEASUREMENT_SENSING_VISUALS,
552
+ chunkYKY2JBER_cjs.MEDIA_ANALYTICS_VISUALS,
553
+ chunkYKY2JBER_cjs.MULTISENSORY_HAPTIC_VISUALS,
554
+ chunkYKY2JBER_cjs.MUSICAL_SOUND_VISUALS,
555
+ chunkYKY2JBER_cjs.MUSIC_PERFORMANCE_VISUALS,
556
+ chunkYKY2JBER_cjs.NARRATIVE_STORYTELLING_VISUALS,
557
+ chunkYKY2JBER_cjs.NETWORKING_AI_VISUALS,
558
+ chunkYKY2JBER_cjs.NPC_ROLES_VISUALS,
559
+ chunkYKY2JBER_cjs.OBJECT_INTERACTION_VISUALS,
560
+ chunkYKY2JBER_cjs.PARSER_CORE_UI_VISUALS,
561
+ chunkYKY2JBER_cjs.PHYSICAL_AFFORDANCES_VISUALS,
562
+ chunkYKY2JBER_cjs.PHYSICS_EXPANSION_VISUALS,
563
+ chunkYKY2JBER_cjs.PROCEDURAL_GENERATION_VISUALS,
564
+ chunkYKY2JBER_cjs.RESOURCE_GATHERING_VISUALS,
565
+ chunkYKY2JBER_cjs.SAFETY_BOUNDARIES_VISUALS,
566
+ chunkYKY2JBER_cjs.SIGNS_COMMUNICATION_VISUALS,
567
+ chunkYKY2JBER_cjs.SIMPLE_MODIFIERS_VISUALS,
568
+ chunkYKY2JBER_cjs.SOCIAL_COMMERCE_VISUALS,
569
+ chunkYKY2JBER_cjs.SOCIAL_EFFECTS_VISUALS,
570
+ chunkYKY2JBER_cjs.SPORTS_FITNESS_VISUALS,
571
+ chunkYKY2JBER_cjs.STATE_PERSISTENCE_VISUALS,
572
+ chunkYKY2JBER_cjs.TRANSPORTATION_VEHICLES_VISUALS,
573
+ chunkYKY2JBER_cjs.VOLUMETRIC_WEBGPU_VISUALS,
574
+ chunkYKY2JBER_cjs.WEATHER_PARTICLES_VISUALS,
575
+ chunkYKY2JBER_cjs.XR_PLATFORM_VISUALS,
576
+ // Hologram Media Pipeline
577
+ HOLOGRAM_MEDIA_VISUALS,
578
+ // GAPS Feature Roadmap — Phase 1
579
+ GAPS_PHYSICS_VISUALS,
580
+ // Phone Sleeve VR — smartphone-as-headset
581
+ PHONE_SLEEVE_VR_VISUALS
582
+ ];
583
+ function registerAllPresets() {
584
+ const registry = chunkQQFB4RT2_cjs.TraitVisualRegistry.getInstance();
585
+ for (const presetMap of ALL_PRESETS) {
586
+ registry.registerBatch(presetMap);
587
+ }
588
+ }
589
+ registerAllPresets();
590
+
591
+ // src/compiler/SceneIRCompiler.ts
592
+ chunkQEDMOGF3_cjs.init_DomainBlockCompilerMixin();
593
+ chunkTZCFKZ6Z_cjs.init_PlatformConditionalCompilerMixin();
594
+ chunkZK7KX5CD_cjs.init_AgentRBAC();
595
+ chunkZK7KX5CD_cjs.init_CompilerBase();
596
+
597
+ // src/animation/stagger.ts
598
+ function staggerOffsets(count, step, from = 0) {
599
+ if (count <= 0) return [];
600
+ return Array.from({ length: count }, (_, i) => from + i * step);
601
+ }
602
+ function applyStaggerToChildren(children, step, from = 0) {
603
+ if (!step || children.length === 0) return;
604
+ const offsets = staggerOffsets(children.length, step, from);
605
+ children.forEach((child, i) => {
606
+ const channels = child.props?.__animatedTransform;
607
+ if (!Array.isArray(channels)) return;
608
+ const delta = offsets[i];
609
+ for (const ch of channels) {
610
+ if (typeof ch.edge0 === "number") ch.edge0 = ch.edge0 + delta;
611
+ if (typeof ch.edge1 === "number") ch.edge1 = ch.edge1 + delta;
612
+ }
613
+ });
614
+ }
615
+ function defaultEntranceChannel(target) {
616
+ return { prop: "scaleUniform", target, edge0: 0, edge1: 0.4, from: 0, to: 1 };
617
+ }
618
+ function synthesizeEntranceChannels(children, target) {
619
+ let count = 0;
620
+ for (const child of children) {
621
+ const props = child.props;
622
+ if (!props) continue;
623
+ if (props.animated !== true) continue;
624
+ if (Array.isArray(props.__animatedTransform)) continue;
625
+ props.__animatedTransform = [defaultEntranceChannel(target)];
626
+ count += 1;
627
+ }
628
+ return count;
629
+ }
630
+
631
+ // src/compiler/SceneIRCompiler.ts
632
+ var sceneIRNodePool = new chunkKROXXBK5_cjs.ASTNodePool(
633
+ () => ({ type: "", props: {} }),
634
+ (node) => {
635
+ node.type = "";
636
+ node.id = void 0;
637
+ node.props = {};
638
+ node.children = void 0;
639
+ node.traits = void 0;
640
+ node.directives = void 0;
641
+ node.assetMaturity = void 0;
642
+ },
643
+ 0
644
+ // Was 20000 — demand-allocate instead of pre-allocating
645
+ );
646
+ function isVfxParticleTraitName(name) {
647
+ return name.startsWith("vfx_particle_");
648
+ }
649
+ function vfxParticleEffect(name) {
650
+ return name.replace("vfx_particle_", "");
651
+ }
652
+ function gemResonanceConfig(config) {
653
+ return {
654
+ max_distance: 0.5,
655
+ base_frequencies: "auto",
656
+ blend_mode: "harmonic",
657
+ output: "spatial_audio",
658
+ ...config || {}
659
+ };
660
+ }
661
+ var MATERIAL_PRESETS = {
662
+ plastic: { roughness: 0.5, metalness: 0, clearcoat: 0.1 },
663
+ metal: { roughness: 0.2, metalness: 1 },
664
+ chrome: { roughness: 0.05, metalness: 1, envMapIntensity: 1.5 },
665
+ gold: { roughness: 0.3, metalness: 1, color: "#ffd700" },
666
+ copper: { roughness: 0.4, metalness: 1, color: "#b87333" },
667
+ glass: {
668
+ roughness: 0,
669
+ metalness: 0,
670
+ transmission: 0.95,
671
+ ior: 1.5,
672
+ thickness: 0.5,
673
+ transparent: true
674
+ },
675
+ crystal: {
676
+ roughness: 0,
677
+ metalness: 0.1,
678
+ transmission: 0.9,
679
+ ior: 2,
680
+ iridescence: 1,
681
+ iridescenceIOR: 1.3
682
+ },
683
+ wood: { roughness: 0.8, metalness: 0 },
684
+ fabric: {
685
+ roughness: 0.95,
686
+ metalness: 0,
687
+ sheen: 0.5,
688
+ sheenRoughness: 0.8,
689
+ sheenColor: "#ffffff"
690
+ },
691
+ rubber: { roughness: 0.9, metalness: 0 },
692
+ leather: {
693
+ roughness: 0.7,
694
+ metalness: 0,
695
+ sheen: 0.3,
696
+ sheenRoughness: 0.6,
697
+ sheenColor: "#3d2b1f"
698
+ },
699
+ water: {
700
+ roughness: 0,
701
+ metalness: 0,
702
+ transmission: 0.9,
703
+ ior: 1.33,
704
+ transparent: true,
705
+ color: "#006994"
706
+ },
707
+ emissive: { roughness: 0.5, metalness: 0, emissiveIntensity: 2 },
708
+ hologram: {
709
+ roughness: 0,
710
+ metalness: 0.3,
711
+ transparent: true,
712
+ opacity: 0.6,
713
+ emissiveIntensity: 1
714
+ },
715
+ stone: { roughness: 0.85, metalness: 0, color: "#808080" },
716
+ marble: { roughness: 0.15, metalness: 0, color: "#F0EDE6", envMapIntensity: 0.8 },
717
+ shiny: { roughness: 0.05, metalness: 0.3, envMapIntensity: 1.5, clearcoat: 0.8 },
718
+ neon: {
719
+ roughness: 0,
720
+ metalness: 0,
721
+ emissiveIntensity: 3,
722
+ transparent: true,
723
+ opacity: 0.9
724
+ },
725
+ toon: { roughness: 1, metalness: 0 },
726
+ wireframe: { roughness: 0.5, metalness: 0.5, wireframe: true },
727
+ velvet: {
728
+ roughness: 1,
729
+ metalness: 0,
730
+ sheen: 1,
731
+ sheenRoughness: 0.8,
732
+ sheenColor: "#ffffff",
733
+ clearcoat: 0.3
734
+ },
735
+ xray: { roughness: 0, metalness: 0, transparent: true, opacity: 0.3, emissiveIntensity: 0.5 },
736
+ gradient: { roughness: 0.5, metalness: 0 },
737
+ matte: { roughness: 1, metalness: 0 },
738
+ // ===========================================================================
739
+ // REALISTIC FABRICS — differentiated by sheen, roughness, and anisotropy
740
+ // ===========================================================================
741
+ cotton: {
742
+ roughness: 0.95,
743
+ metalness: 0,
744
+ sheen: 0.6,
745
+ sheenRoughness: 0.9,
746
+ sheenColor: "#ffffff"
747
+ },
748
+ polyester: {
749
+ roughness: 0.7,
750
+ metalness: 0,
751
+ sheen: 0.8,
752
+ sheenRoughness: 0.4,
753
+ sheenColor: "#e8e8e8"
754
+ },
755
+ silk: {
756
+ roughness: 0.3,
757
+ metalness: 0,
758
+ sheen: 1,
759
+ sheenRoughness: 0.2,
760
+ sheenColor: "#fffaf0",
761
+ anisotropy: 0.8,
762
+ anisotropyRotation: 0
763
+ },
764
+ satin: {
765
+ roughness: 0.25,
766
+ metalness: 0,
767
+ sheen: 0.9,
768
+ sheenRoughness: 0.15,
769
+ sheenColor: "#fff5ee",
770
+ anisotropy: 0.6,
771
+ anisotropyRotation: 0
772
+ },
773
+ linen: {
774
+ roughness: 0.9,
775
+ metalness: 0,
776
+ sheen: 0.4,
777
+ sheenRoughness: 0.85,
778
+ sheenColor: "#f5f0e8"
779
+ },
780
+ wool: {
781
+ roughness: 1,
782
+ metalness: 0,
783
+ sheen: 0.7,
784
+ sheenRoughness: 1,
785
+ sheenColor: "#e8dcc8"
786
+ },
787
+ denim: {
788
+ roughness: 0.85,
789
+ metalness: 0,
790
+ color: "#2b4570",
791
+ sheen: 0.5,
792
+ sheenRoughness: 0.7,
793
+ sheenColor: "#4a6fa5"
794
+ },
795
+ canvas: {
796
+ roughness: 0.95,
797
+ metalness: 0,
798
+ color: "#c8b88a",
799
+ sheen: 0.3,
800
+ sheenRoughness: 0.9,
801
+ sheenColor: "#d4c9a8"
802
+ },
803
+ burlap: {
804
+ roughness: 1,
805
+ metalness: 0,
806
+ color: "#8b7355",
807
+ sheen: 0.2,
808
+ sheenRoughness: 1,
809
+ sheenColor: "#a08060"
810
+ },
811
+ // ===========================================================================
812
+ // SKIN & ORGANIC — differentiated by subsurface scattering
813
+ // ===========================================================================
814
+ skin: {
815
+ roughness: 0.5,
816
+ metalness: 0,
817
+ color: "#e8b89d",
818
+ thickness: 0.8,
819
+ attenuationColor: "#cc4422",
820
+ attenuationDistance: 0.5
821
+ },
822
+ skin_dark: {
823
+ roughness: 0.45,
824
+ metalness: 0,
825
+ color: "#8d5524",
826
+ thickness: 1,
827
+ attenuationColor: "#661111",
828
+ attenuationDistance: 0.3
829
+ },
830
+ // Dragon / creature material presets
831
+ dragon_bone: {
832
+ roughness: 0.35,
833
+ metalness: 0.15,
834
+ color: "#e8dcc8"
835
+ },
836
+ dragon_leather: {
837
+ roughness: 0.8,
838
+ metalness: 0,
839
+ color: "#5c3a21"
840
+ },
841
+ dragon_scale: {
842
+ roughness: 0.25,
843
+ metalness: 0.4,
844
+ color: "#1a0d3d"
845
+ },
846
+ obsidian: {
847
+ roughness: 0.05,
848
+ metalness: 0.1,
849
+ color: "#0d0d0d",
850
+ clearcoat: 0.9,
851
+ clearcoatRoughness: 0.1,
852
+ envMapIntensity: 1.2
853
+ },
854
+ skin_pale: {
855
+ roughness: 0.55,
856
+ metalness: 0,
857
+ color: "#fde0c8",
858
+ thickness: 0.6,
859
+ attenuationColor: "#ee5533",
860
+ attenuationDistance: 0.6
861
+ },
862
+ candle_wax: {
863
+ roughness: 0.7,
864
+ metalness: 0,
865
+ color: "#fff8dc",
866
+ thickness: 2,
867
+ attenuationColor: "#ffaa44",
868
+ attenuationDistance: 0.3,
869
+ transmission: 0.15
870
+ },
871
+ jade: {
872
+ roughness: 0.2,
873
+ metalness: 0,
874
+ color: "#00a86b",
875
+ thickness: 1.5,
876
+ attenuationColor: "#004d32",
877
+ attenuationDistance: 1,
878
+ transmission: 0.1
879
+ },
880
+ milk: {
881
+ roughness: 0.3,
882
+ metalness: 0,
883
+ color: "#fdfff5",
884
+ thickness: 1,
885
+ attenuationColor: "#fff5d6",
886
+ attenuationDistance: 0.2,
887
+ transmission: 0.6,
888
+ ior: 1.35
889
+ },
890
+ leaf: {
891
+ roughness: 0.6,
892
+ metalness: 0,
893
+ color: "#228b22",
894
+ thickness: 0.3,
895
+ attenuationColor: "#44cc22",
896
+ attenuationDistance: 0.5
897
+ },
898
+ honey: {
899
+ roughness: 0.1,
900
+ metalness: 0,
901
+ color: "#eb9605",
902
+ thickness: 1.5,
903
+ attenuationColor: "#cc6600",
904
+ attenuationDistance: 0.4,
905
+ transmission: 0.7,
906
+ ior: 1.5
907
+ },
908
+ // ===========================================================================
909
+ // MUD & EARTH — differentiated by roughness, color, and subtle properties
910
+ // ===========================================================================
911
+ clay_mud: {
912
+ roughness: 0.95,
913
+ metalness: 0,
914
+ color: "#8b4513",
915
+ thickness: 0.5,
916
+ attenuationColor: "#663311",
917
+ attenuationDistance: 0.8
918
+ },
919
+ sandy_mud: {
920
+ roughness: 0.85,
921
+ metalness: 0.02,
922
+ color: "#c2a66b"
923
+ },
924
+ wet_mud: {
925
+ roughness: 0.4,
926
+ metalness: 0,
927
+ color: "#3d2b1f",
928
+ clearcoat: 0.6,
929
+ clearcoatRoughness: 0.2
930
+ },
931
+ dry_earth: {
932
+ roughness: 1,
933
+ metalness: 0,
934
+ color: "#9b7653"
935
+ },
936
+ peat: {
937
+ roughness: 0.9,
938
+ metalness: 0,
939
+ color: "#2d1f0e"
940
+ },
941
+ red_clay: {
942
+ roughness: 0.95,
943
+ metalness: 0,
944
+ color: "#cc4b2e",
945
+ thickness: 0.4,
946
+ attenuationColor: "#993322",
947
+ attenuationDistance: 0.6
948
+ },
949
+ volcanic_ash: {
950
+ roughness: 0.8,
951
+ metalness: 0.05,
952
+ color: "#3c3c3c"
953
+ },
954
+ wet_sand: {
955
+ roughness: 0.6,
956
+ metalness: 0.02,
957
+ color: "#c2b280",
958
+ clearcoat: 0.3,
959
+ clearcoatRoughness: 0.4
960
+ },
961
+ dry_sand: {
962
+ roughness: 0.95,
963
+ metalness: 0.02,
964
+ color: "#e0cc8e"
965
+ },
966
+ // ===========================================================================
967
+ // METALS (BRUSHED/ANISOTROPIC) — directional roughness
968
+ // ===========================================================================
969
+ brushed_steel: {
970
+ roughness: 0.35,
971
+ metalness: 1,
972
+ color: "#c0c0c0",
973
+ anisotropy: 0.7,
974
+ anisotropyRotation: 0
975
+ },
976
+ brushed_aluminum: {
977
+ roughness: 0.3,
978
+ metalness: 1,
979
+ color: "#d0d0d0",
980
+ anisotropy: 0.8,
981
+ anisotropyRotation: 0
982
+ },
983
+ brushed_copper: {
984
+ roughness: 0.35,
985
+ metalness: 1,
986
+ color: "#b87333",
987
+ anisotropy: 0.6,
988
+ anisotropyRotation: 0
989
+ },
990
+ cast_iron: {
991
+ roughness: 0.7,
992
+ metalness: 0.9,
993
+ color: "#3a3a3a"
994
+ },
995
+ bronze: {
996
+ roughness: 0.45,
997
+ metalness: 1,
998
+ color: "#cd7f32"
999
+ },
1000
+ silver: {
1001
+ roughness: 0.15,
1002
+ metalness: 1,
1003
+ color: "#c0c0c0",
1004
+ envMapIntensity: 1.3
1005
+ },
1006
+ platinum: {
1007
+ roughness: 0.2,
1008
+ metalness: 1,
1009
+ color: "#e5e4e2",
1010
+ envMapIntensity: 1.2
1011
+ },
1012
+ rust: {
1013
+ roughness: 0.9,
1014
+ metalness: 0.3,
1015
+ color: "#8b3a15"
1016
+ },
1017
+ // ===========================================================================
1018
+ // HAIR & FIBERS — anisotropy-driven
1019
+ // ===========================================================================
1020
+ hair_dark: {
1021
+ roughness: 0.35,
1022
+ metalness: 0,
1023
+ color: "#1a1209",
1024
+ anisotropy: 1,
1025
+ anisotropyRotation: Math.PI / 2,
1026
+ sheen: 0.3,
1027
+ sheenRoughness: 0.3,
1028
+ sheenColor: "#2a2219"
1029
+ },
1030
+ hair_blonde: {
1031
+ roughness: 0.3,
1032
+ metalness: 0,
1033
+ color: "#c8a55a",
1034
+ anisotropy: 1,
1035
+ anisotropyRotation: Math.PI / 2,
1036
+ sheen: 0.4,
1037
+ sheenRoughness: 0.25,
1038
+ sheenColor: "#d4b86a"
1039
+ },
1040
+ hair_red: {
1041
+ roughness: 0.35,
1042
+ metalness: 0,
1043
+ color: "#8b3a15",
1044
+ anisotropy: 1,
1045
+ anisotropyRotation: Math.PI / 2,
1046
+ sheen: 0.35,
1047
+ sheenRoughness: 0.3,
1048
+ sheenColor: "#a04520"
1049
+ },
1050
+ // ===========================================================================
1051
+ // WET SURFACES — clearcoat simulates water film
1052
+ // ===========================================================================
1053
+ wet_stone: {
1054
+ roughness: 0.3,
1055
+ metalness: 0,
1056
+ color: "#606060",
1057
+ clearcoat: 0.8,
1058
+ clearcoatRoughness: 0.1
1059
+ },
1060
+ wet_wood: {
1061
+ roughness: 0.4,
1062
+ metalness: 0,
1063
+ color: "#5a3a1a",
1064
+ clearcoat: 0.7,
1065
+ clearcoatRoughness: 0.15
1066
+ },
1067
+ wet_concrete: {
1068
+ roughness: 0.5,
1069
+ metalness: 0,
1070
+ color: "#707070",
1071
+ clearcoat: 0.5,
1072
+ clearcoatRoughness: 0.2
1073
+ },
1074
+ // ===========================================================================
1075
+ // FOOD & ORGANIC — SSS-heavy
1076
+ // ===========================================================================
1077
+ fruit: {
1078
+ roughness: 0.4,
1079
+ metalness: 0,
1080
+ color: "#ff4444",
1081
+ thickness: 0.8,
1082
+ attenuationColor: "#cc2200",
1083
+ attenuationDistance: 0.5,
1084
+ clearcoat: 0.3,
1085
+ clearcoatRoughness: 0.2
1086
+ },
1087
+ cheese: {
1088
+ roughness: 0.7,
1089
+ metalness: 0,
1090
+ color: "#ffc125",
1091
+ thickness: 1.2,
1092
+ attenuationColor: "#cc9900",
1093
+ attenuationDistance: 0.4
1094
+ },
1095
+ bread: {
1096
+ roughness: 0.95,
1097
+ metalness: 0,
1098
+ color: "#c4a35a",
1099
+ thickness: 0.3,
1100
+ attenuationColor: "#8b6914",
1101
+ attenuationDistance: 0.8
1102
+ },
1103
+ chocolate: {
1104
+ roughness: 0.5,
1105
+ metalness: 0,
1106
+ color: "#3b1e08",
1107
+ clearcoat: 0.2,
1108
+ clearcoatRoughness: 0.3
1109
+ },
1110
+ // ===========================================================================
1111
+ // COATED SURFACES — clearcoat-driven
1112
+ // ===========================================================================
1113
+ car_paint: {
1114
+ roughness: 0.1,
1115
+ metalness: 0,
1116
+ clearcoat: 1,
1117
+ clearcoatRoughness: 0.05
1118
+ },
1119
+ lacquer: {
1120
+ roughness: 0.05,
1121
+ metalness: 0,
1122
+ clearcoat: 1,
1123
+ clearcoatRoughness: 0.02
1124
+ },
1125
+ varnished_wood: {
1126
+ roughness: 0.3,
1127
+ metalness: 0,
1128
+ color: "#8b5e3c",
1129
+ clearcoat: 0.9,
1130
+ clearcoatRoughness: 0.1
1131
+ },
1132
+ glazed_ceramic: {
1133
+ roughness: 0.15,
1134
+ metalness: 0,
1135
+ color: "#f0ede6",
1136
+ clearcoat: 0.8,
1137
+ clearcoatRoughness: 0.05
1138
+ },
1139
+ enamel: {
1140
+ roughness: 0.1,
1141
+ metalness: 0,
1142
+ clearcoat: 0.9,
1143
+ clearcoatRoughness: 0.03
1144
+ },
1145
+ // ===========================================================================
1146
+ // IRIDESCENT — thin-film interference
1147
+ // ===========================================================================
1148
+ soap_bubble: {
1149
+ roughness: 0,
1150
+ metalness: 0,
1151
+ transmission: 0.9,
1152
+ ior: 1.33,
1153
+ transparent: true,
1154
+ opacity: 0.3,
1155
+ iridescence: 1,
1156
+ iridescenceIOR: 1.5
1157
+ },
1158
+ oil_slick: {
1159
+ roughness: 0,
1160
+ metalness: 0.1,
1161
+ color: "#1a1a2e",
1162
+ iridescence: 1,
1163
+ iridescenceIOR: 1.8
1164
+ },
1165
+ beetle_shell: {
1166
+ roughness: 0.2,
1167
+ metalness: 0.3,
1168
+ color: "#0a3d0a",
1169
+ iridescence: 0.8,
1170
+ iridescenceIOR: 1.6,
1171
+ clearcoat: 0.5,
1172
+ clearcoatRoughness: 0.1
1173
+ },
1174
+ pearl: {
1175
+ roughness: 0.15,
1176
+ metalness: 0,
1177
+ color: "#fdeef4",
1178
+ iridescence: 0.6,
1179
+ iridescenceIOR: 1.3,
1180
+ sheen: 0.3,
1181
+ sheenRoughness: 0.2,
1182
+ sheenColor: "#fff0f5"
1183
+ },
1184
+ abalone: {
1185
+ roughness: 0.1,
1186
+ metalness: 0.1,
1187
+ color: "#e0f0e8",
1188
+ iridescence: 1,
1189
+ iridescenceIOR: 1.5
1190
+ },
1191
+ // ===========================================================================
1192
+ // GEMSTONES — transmission + IOR + iridescence
1193
+ // ===========================================================================
1194
+ diamond: {
1195
+ roughness: 0,
1196
+ metalness: 0,
1197
+ color: "#ffffff",
1198
+ transmission: 0.95,
1199
+ ior: 2.417,
1200
+ thickness: 0.5,
1201
+ transparent: true
1202
+ },
1203
+ ruby: {
1204
+ roughness: 0.05,
1205
+ metalness: 0,
1206
+ color: "#e0115f",
1207
+ transmission: 0.4,
1208
+ ior: 1.76,
1209
+ thickness: 1
1210
+ },
1211
+ sapphire: {
1212
+ roughness: 0.05,
1213
+ metalness: 0,
1214
+ color: "#0f52ba",
1215
+ transmission: 0.4,
1216
+ ior: 1.77,
1217
+ thickness: 1
1218
+ },
1219
+ emerald: {
1220
+ roughness: 0.1,
1221
+ metalness: 0,
1222
+ color: "#50c878",
1223
+ transmission: 0.3,
1224
+ ior: 1.57,
1225
+ thickness: 1.2
1226
+ },
1227
+ amber: {
1228
+ roughness: 0.1,
1229
+ metalness: 0,
1230
+ color: "#ffbf00",
1231
+ transmission: 0.6,
1232
+ ior: 1.55,
1233
+ thickness: 2,
1234
+ transparent: true,
1235
+ attenuationColor: "#cc6600",
1236
+ attenuationDistance: 1
1237
+ },
1238
+ opal: {
1239
+ roughness: 0.15,
1240
+ metalness: 0,
1241
+ color: "#e8e0d0",
1242
+ iridescence: 0.9,
1243
+ iridescenceIOR: 1.45,
1244
+ transmission: 0.1,
1245
+ ior: 1.45
1246
+ },
1247
+ amethyst: {
1248
+ roughness: 0.05,
1249
+ metalness: 0,
1250
+ color: "#9966cc",
1251
+ transmission: 0.5,
1252
+ ior: 1.54,
1253
+ thickness: 1,
1254
+ transparent: true
1255
+ },
1256
+ topaz: {
1257
+ roughness: 0.02,
1258
+ metalness: 0,
1259
+ color: "#ffc87c",
1260
+ transmission: 0.7,
1261
+ ior: 1.63,
1262
+ thickness: 0.8,
1263
+ transparent: true
1264
+ },
1265
+ turquoise: {
1266
+ roughness: 0.6,
1267
+ metalness: 0,
1268
+ color: "#40e0d0"
1269
+ },
1270
+ lapis_lazuli: {
1271
+ roughness: 0.4,
1272
+ metalness: 0,
1273
+ color: "#26619c",
1274
+ clearcoat: 0.3,
1275
+ clearcoatRoughness: 0.1
1276
+ },
1277
+ // ===========================================================================
1278
+ // MORE METALS — extended metallic palette
1279
+ // ===========================================================================
1280
+ titanium: {
1281
+ roughness: 0.25,
1282
+ metalness: 1,
1283
+ color: "#878681"
1284
+ },
1285
+ tungsten: {
1286
+ roughness: 0.3,
1287
+ metalness: 1,
1288
+ color: "#696969"
1289
+ },
1290
+ tin: {
1291
+ roughness: 0.35,
1292
+ metalness: 1,
1293
+ color: "#b0b0b0",
1294
+ envMapIntensity: 0.8
1295
+ },
1296
+ lead: {
1297
+ roughness: 0.6,
1298
+ metalness: 0.9,
1299
+ color: "#595959"
1300
+ },
1301
+ brass: {
1302
+ roughness: 0.35,
1303
+ metalness: 1,
1304
+ color: "#b5a642"
1305
+ },
1306
+ wrought_iron: {
1307
+ roughness: 0.7,
1308
+ metalness: 0.85,
1309
+ color: "#2c2c2c"
1310
+ },
1311
+ mercury: {
1312
+ roughness: 0,
1313
+ metalness: 1,
1314
+ color: "#d4d4d4",
1315
+ envMapIntensity: 2
1316
+ },
1317
+ // ===========================================================================
1318
+ // NATURAL / WEATHER — environmental surfaces
1319
+ // ===========================================================================
1320
+ snow: {
1321
+ roughness: 0.8,
1322
+ metalness: 0,
1323
+ color: "#f0f8ff",
1324
+ thickness: 0.5,
1325
+ attenuationColor: "#c8e0ff",
1326
+ attenuationDistance: 2
1327
+ },
1328
+ fresh_snow: {
1329
+ roughness: 0.6,
1330
+ metalness: 0,
1331
+ color: "#ffffff",
1332
+ sheen: 0.3,
1333
+ sheenRoughness: 0.5,
1334
+ sheenColor: "#e8f0ff"
1335
+ },
1336
+ frost: {
1337
+ roughness: 0.3,
1338
+ metalness: 0,
1339
+ color: "#e8f4f8",
1340
+ transmission: 0.15,
1341
+ ior: 1.31,
1342
+ clearcoat: 0.4,
1343
+ clearcoatRoughness: 0.1
1344
+ },
1345
+ ice: {
1346
+ roughness: 0.1,
1347
+ metalness: 0,
1348
+ color: "#d6eaf8",
1349
+ transmission: 0.8,
1350
+ ior: 1.31,
1351
+ transparent: true
1352
+ },
1353
+ moss: {
1354
+ roughness: 1,
1355
+ metalness: 0,
1356
+ color: "#4a7c3f",
1357
+ sheen: 0.2,
1358
+ sheenRoughness: 1,
1359
+ sheenColor: "#5a9c4f"
1360
+ },
1361
+ lichen: {
1362
+ roughness: 0.9,
1363
+ metalness: 0,
1364
+ color: "#8fa37a"
1365
+ },
1366
+ bark: {
1367
+ roughness: 0.95,
1368
+ metalness: 0,
1369
+ color: "#5c4033"
1370
+ },
1371
+ dried_leaves: {
1372
+ roughness: 0.9,
1373
+ metalness: 0,
1374
+ color: "#8b6914",
1375
+ thickness: 0.1,
1376
+ attenuationColor: "#664400",
1377
+ attenuationDistance: 0.3
1378
+ },
1379
+ // ===========================================================================
1380
+ // AGED / WEATHERED — patina, tarnish, wear
1381
+ // ===========================================================================
1382
+ patina: {
1383
+ roughness: 0.6,
1384
+ metalness: 0.4,
1385
+ color: "#4a9c7e"
1386
+ },
1387
+ tarnished_silver: {
1388
+ roughness: 0.5,
1389
+ metalness: 0.7,
1390
+ color: "#8a8a7a"
1391
+ },
1392
+ aged_bronze: {
1393
+ roughness: 0.55,
1394
+ metalness: 0.6,
1395
+ color: "#6b8e5a"
1396
+ },
1397
+ weathered_wood: {
1398
+ roughness: 0.95,
1399
+ metalness: 0,
1400
+ color: "#8a8070"
1401
+ },
1402
+ cracked_paint: {
1403
+ roughness: 0.8,
1404
+ metalness: 0,
1405
+ color: "#c8c0b0"
1406
+ },
1407
+ oxidized_copper: {
1408
+ roughness: 0.65,
1409
+ metalness: 0.5,
1410
+ color: "#2e8b57"
1411
+ },
1412
+ // ===========================================================================
1413
+ // CONSTRUCTION — architectural materials
1414
+ // ===========================================================================
1415
+ asphalt: {
1416
+ roughness: 0.9,
1417
+ metalness: 0,
1418
+ color: "#3a3a3a"
1419
+ },
1420
+ cement: {
1421
+ roughness: 0.85,
1422
+ metalness: 0,
1423
+ color: "#a0a0a0"
1424
+ },
1425
+ tile_ceramic: {
1426
+ roughness: 0.2,
1427
+ metalness: 0,
1428
+ color: "#e8e0d0",
1429
+ clearcoat: 0.6,
1430
+ clearcoatRoughness: 0.05
1431
+ },
1432
+ tile_porcelain: {
1433
+ roughness: 0.1,
1434
+ metalness: 0,
1435
+ color: "#f5f5f5",
1436
+ clearcoat: 0.8,
1437
+ clearcoatRoughness: 0.02
1438
+ },
1439
+ linoleum: {
1440
+ roughness: 0.6,
1441
+ metalness: 0,
1442
+ color: "#c0b090",
1443
+ clearcoat: 0.2,
1444
+ clearcoatRoughness: 0.3
1445
+ },
1446
+ drywall: {
1447
+ roughness: 1,
1448
+ metalness: 0,
1449
+ color: "#f0ece0"
1450
+ },
1451
+ rebar: {
1452
+ roughness: 0.6,
1453
+ metalness: 0.9,
1454
+ color: "#5a4a3a"
1455
+ },
1456
+ stucco: {
1457
+ roughness: 0.95,
1458
+ metalness: 0,
1459
+ color: "#e8dcc8"
1460
+ },
1461
+ gravel: {
1462
+ roughness: 1,
1463
+ metalness: 0.02,
1464
+ color: "#8a8070"
1465
+ },
1466
+ // ===========================================================================
1467
+ // LEATHER VARIANTS — sheen + clearcoat differentiation
1468
+ // ===========================================================================
1469
+ suede: {
1470
+ roughness: 1,
1471
+ metalness: 0,
1472
+ color: "#8b6914",
1473
+ sheen: 0.6,
1474
+ sheenRoughness: 1,
1475
+ sheenColor: "#a07828"
1476
+ },
1477
+ patent_leather: {
1478
+ roughness: 0.05,
1479
+ metalness: 0,
1480
+ color: "#1a1a1a",
1481
+ clearcoat: 1,
1482
+ clearcoatRoughness: 0.02
1483
+ },
1484
+ distressed_leather: {
1485
+ roughness: 0.8,
1486
+ metalness: 0,
1487
+ color: "#5a3a1a",
1488
+ sheen: 0.15,
1489
+ sheenRoughness: 0.8,
1490
+ sheenColor: "#4a3010"
1491
+ },
1492
+ nubuck: {
1493
+ roughness: 0.95,
1494
+ metalness: 0,
1495
+ color: "#c8a882",
1496
+ sheen: 0.5,
1497
+ sheenRoughness: 0.9,
1498
+ sheenColor: "#d4b892"
1499
+ },
1500
+ // ===========================================================================
1501
+ // RUBBER VARIANTS
1502
+ // ===========================================================================
1503
+ tire_rubber: {
1504
+ roughness: 0.85,
1505
+ metalness: 0,
1506
+ color: "#1a1a1a"
1507
+ },
1508
+ silicone: {
1509
+ roughness: 0.6,
1510
+ metalness: 0,
1511
+ color: "#e0e0e0",
1512
+ thickness: 0.5,
1513
+ attenuationColor: "#cccccc",
1514
+ attenuationDistance: 1,
1515
+ transmission: 0.05
1516
+ },
1517
+ latex: {
1518
+ roughness: 0.3,
1519
+ metalness: 0,
1520
+ color: "#ffefd5",
1521
+ clearcoat: 0.5,
1522
+ clearcoatRoughness: 0.1,
1523
+ thickness: 0.3,
1524
+ attenuationColor: "#ffcc88",
1525
+ attenuationDistance: 0.5
1526
+ },
1527
+ eraser: {
1528
+ roughness: 0.95,
1529
+ metalness: 0,
1530
+ color: "#ff6b81"
1531
+ },
1532
+ // ===========================================================================
1533
+ // LIQUIDS — transmission + animated surface hints
1534
+ // ===========================================================================
1535
+ lava: {
1536
+ roughness: 0.8,
1537
+ metalness: 0,
1538
+ color: "#ff4400",
1539
+ emissive: "#ff2200",
1540
+ emissiveIntensity: 3
1541
+ },
1542
+ blood: {
1543
+ roughness: 0.2,
1544
+ metalness: 0,
1545
+ color: "#8b0000",
1546
+ clearcoat: 0.7,
1547
+ clearcoatRoughness: 0.05,
1548
+ thickness: 1,
1549
+ attenuationColor: "#440000",
1550
+ attenuationDistance: 0.3
1551
+ },
1552
+ oil_liquid: {
1553
+ roughness: 0.05,
1554
+ metalness: 0,
1555
+ color: "#1a1a0a",
1556
+ clearcoat: 0.9,
1557
+ clearcoatRoughness: 0.02
1558
+ },
1559
+ molten_metal: {
1560
+ roughness: 0.15,
1561
+ metalness: 0.8,
1562
+ color: "#ff8c00",
1563
+ emissive: "#ff6600",
1564
+ emissiveIntensity: 5
1565
+ },
1566
+ syrup: {
1567
+ roughness: 0.1,
1568
+ metalness: 0,
1569
+ color: "#8b4513",
1570
+ transmission: 0.4,
1571
+ ior: 1.49,
1572
+ thickness: 2,
1573
+ attenuationColor: "#663300",
1574
+ attenuationDistance: 0.5
1575
+ },
1576
+ // ===========================================================================
1577
+ // BLACKBODY / THERMAL — temperature-driven emission
1578
+ // ===========================================================================
1579
+ heated_metal_low: {
1580
+ roughness: 0.5,
1581
+ metalness: 0.9,
1582
+ color: "#4a4a4a",
1583
+ emissive: "#ff1a00",
1584
+ emissiveIntensity: 1.5
1585
+ },
1586
+ heated_metal_mid: {
1587
+ roughness: 0.4,
1588
+ metalness: 0.8,
1589
+ color: "#5a5a5a",
1590
+ emissive: "#ff6600",
1591
+ emissiveIntensity: 3
1592
+ },
1593
+ heated_metal_hot: {
1594
+ roughness: 0.3,
1595
+ metalness: 0.7,
1596
+ color: "#6a6a6a",
1597
+ emissive: "#ffcc00",
1598
+ emissiveIntensity: 5
1599
+ },
1600
+ heated_metal_white: {
1601
+ roughness: 0.2,
1602
+ metalness: 0.6,
1603
+ color: "#8a8a8a",
1604
+ emissive: "#ffffff",
1605
+ emissiveIntensity: 8
1606
+ },
1607
+ ember: {
1608
+ roughness: 0.9,
1609
+ metalness: 0,
1610
+ color: "#2a0a00",
1611
+ emissive: "#ff4400",
1612
+ emissiveIntensity: 2
1613
+ },
1614
+ coal: {
1615
+ roughness: 0.85,
1616
+ metalness: 0,
1617
+ color: "#1a1a1a",
1618
+ emissive: "#cc2200",
1619
+ emissiveIntensity: 0.5
1620
+ },
1621
+ // ===========================================================================
1622
+ // SPECIAL EFFECTS — sparkle, glow, energy
1623
+ // ===========================================================================
1624
+ glitter: {
1625
+ roughness: 0.2,
1626
+ metalness: 0.8,
1627
+ color: "#ffd700",
1628
+ envMapIntensity: 2
1629
+ },
1630
+ sequin: {
1631
+ roughness: 0.05,
1632
+ metalness: 1,
1633
+ envMapIntensity: 2.5,
1634
+ iridescence: 0.3
1635
+ },
1636
+ mica: {
1637
+ roughness: 0.3,
1638
+ metalness: 0.2,
1639
+ color: "#c8b888",
1640
+ iridescence: 0.4,
1641
+ iridescenceIOR: 1.58,
1642
+ sheen: 0.2,
1643
+ sheenRoughness: 0.3,
1644
+ sheenColor: "#d4c498"
1645
+ },
1646
+ fluorescent_green: {
1647
+ roughness: 0.5,
1648
+ metalness: 0,
1649
+ color: "#39ff14",
1650
+ emissive: "#39ff14",
1651
+ emissiveIntensity: 1.5
1652
+ },
1653
+ fluorescent_orange: {
1654
+ roughness: 0.5,
1655
+ metalness: 0,
1656
+ color: "#ff6700",
1657
+ emissive: "#ff6700",
1658
+ emissiveIntensity: 1.5
1659
+ },
1660
+ fluorescent_pink: {
1661
+ roughness: 0.5,
1662
+ metalness: 0,
1663
+ color: "#ff1493",
1664
+ emissive: "#ff1493",
1665
+ emissiveIntensity: 1.5
1666
+ },
1667
+ glow_in_dark: {
1668
+ roughness: 0.7,
1669
+ metalness: 0,
1670
+ color: "#2a3a2a",
1671
+ emissive: "#44ff44",
1672
+ emissiveIntensity: 0.8
1673
+ },
1674
+ plasma: {
1675
+ roughness: 0,
1676
+ metalness: 0,
1677
+ color: "#4400ff",
1678
+ emissive: "#8844ff",
1679
+ emissiveIntensity: 4,
1680
+ transparent: true,
1681
+ opacity: 0.7
1682
+ },
1683
+ energy_field: {
1684
+ roughness: 0,
1685
+ metalness: 0,
1686
+ emissive: "#00ccff",
1687
+ emissiveIntensity: 3,
1688
+ transparent: true,
1689
+ opacity: 0.4,
1690
+ transmission: 0.6
1691
+ },
1692
+ force_field: {
1693
+ roughness: 0,
1694
+ metalness: 0,
1695
+ emissive: "#00ff88",
1696
+ emissiveIntensity: 2,
1697
+ transparent: true,
1698
+ opacity: 0.2,
1699
+ iridescence: 0.8,
1700
+ iridescenceIOR: 1.5
1701
+ },
1702
+ // ===========================================================================
1703
+ // RETROREFLECTIVE — safety, signage
1704
+ // ===========================================================================
1705
+ safety_vest: {
1706
+ roughness: 0.6,
1707
+ metalness: 0,
1708
+ color: "#ccff00",
1709
+ emissive: "#ccff00",
1710
+ emissiveIntensity: 0.3
1711
+ },
1712
+ road_sign: {
1713
+ roughness: 0.4,
1714
+ metalness: 0.1,
1715
+ color: "#ffffff",
1716
+ envMapIntensity: 1.8,
1717
+ emissive: "#ffffff",
1718
+ emissiveIntensity: 0.2
1719
+ },
1720
+ reflective_tape: {
1721
+ roughness: 0.2,
1722
+ metalness: 0.3,
1723
+ color: "#e0e0e0",
1724
+ envMapIntensity: 2.5
1725
+ },
1726
+ // ===========================================================================
1727
+ // MISC — everything else in the real world
1728
+ // ===========================================================================
1729
+ chalkboard: {
1730
+ roughness: 0.9,
1731
+ metalness: 0,
1732
+ color: "#2a3a2a"
1733
+ },
1734
+ chalk: {
1735
+ roughness: 1,
1736
+ metalness: 0,
1737
+ color: "#ffffff"
1738
+ },
1739
+ charcoal: {
1740
+ roughness: 0.9,
1741
+ metalness: 0,
1742
+ color: "#1a1a1a"
1743
+ },
1744
+ cork: {
1745
+ roughness: 0.95,
1746
+ metalness: 0,
1747
+ color: "#b88a50"
1748
+ },
1749
+ felt: {
1750
+ roughness: 1,
1751
+ metalness: 0,
1752
+ color: "#5a8a5a",
1753
+ sheen: 0.4,
1754
+ sheenRoughness: 1,
1755
+ sheenColor: "#6a9a6a"
1756
+ },
1757
+ sponge: {
1758
+ roughness: 1,
1759
+ metalness: 0,
1760
+ color: "#e8c840"
1761
+ },
1762
+ porcelain: {
1763
+ roughness: 0.1,
1764
+ metalness: 0,
1765
+ color: "#f8f4f0",
1766
+ clearcoat: 0.7,
1767
+ clearcoatRoughness: 0.02
1768
+ },
1769
+ terracotta: {
1770
+ roughness: 0.85,
1771
+ metalness: 0,
1772
+ color: "#cc6644"
1773
+ },
1774
+ concrete_polished: {
1775
+ roughness: 0.3,
1776
+ metalness: 0,
1777
+ color: "#a0a0a0",
1778
+ clearcoat: 0.3,
1779
+ clearcoatRoughness: 0.15
1780
+ },
1781
+ rope: {
1782
+ roughness: 1,
1783
+ metalness: 0,
1784
+ color: "#c4a35a",
1785
+ sheen: 0.2,
1786
+ sheenRoughness: 1,
1787
+ sheenColor: "#b89848"
1788
+ },
1789
+ wicker: {
1790
+ roughness: 0.9,
1791
+ metalness: 0,
1792
+ color: "#a08050"
1793
+ },
1794
+ parchment: {
1795
+ roughness: 0.8,
1796
+ metalness: 0,
1797
+ color: "#f0e6c8",
1798
+ thickness: 0.1,
1799
+ attenuationColor: "#d4c0a0",
1800
+ attenuationDistance: 0.2
1801
+ },
1802
+ // ===========================================================================
1803
+ // ANIMATED MATERIALS — time-driven surface effects (wired to scene.time)
1804
+ // These set metadata flags that the runtime uses to drive animated shaders.
1805
+ // ===========================================================================
1806
+ flowing_water: {
1807
+ roughness: 0,
1808
+ metalness: 0,
1809
+ color: "#006994",
1810
+ transmission: 0.85,
1811
+ ior: 1.33,
1812
+ transparent: true,
1813
+ _animated: { pattern: "flow", speed: 0.8, amplitude: 0.3 }
1814
+ },
1815
+ rippling_water: {
1816
+ roughness: 0.05,
1817
+ metalness: 0,
1818
+ color: "#005577",
1819
+ transmission: 0.8,
1820
+ ior: 1.33,
1821
+ transparent: true,
1822
+ _animated: { pattern: "ripple", speed: 1, amplitude: 0.4 }
1823
+ },
1824
+ flickering_fire: {
1825
+ roughness: 0.8,
1826
+ metalness: 0,
1827
+ color: "#ff4400",
1828
+ emissive: "#ff2200",
1829
+ emissiveIntensity: 3,
1830
+ _animated: { pattern: "flicker", speed: 3, amplitude: 0.6 }
1831
+ },
1832
+ pulsing_glow: {
1833
+ roughness: 0.5,
1834
+ metalness: 0,
1835
+ emissive: "#00ff88",
1836
+ emissiveIntensity: 2,
1837
+ _animated: { pattern: "pulse", speed: 1.5, amplitude: 0.5 }
1838
+ },
1839
+ breathing_light: {
1840
+ roughness: 0.3,
1841
+ metalness: 0,
1842
+ emissive: "#4488ff",
1843
+ emissiveIntensity: 1.5,
1844
+ _animated: { pattern: "breathe", speed: 0.5, amplitude: 0.8 }
1845
+ },
1846
+ scrolling_lava: {
1847
+ roughness: 0.8,
1848
+ metalness: 0,
1849
+ color: "#ff4400",
1850
+ emissive: "#ff2200",
1851
+ emissiveIntensity: 4,
1852
+ _animated: { pattern: "scroll", speed: 0.3, amplitude: 1 }
1853
+ },
1854
+ waving_grass: {
1855
+ roughness: 0.9,
1856
+ metalness: 0,
1857
+ color: "#228b22",
1858
+ sheen: 0.2,
1859
+ sheenRoughness: 0.8,
1860
+ sheenColor: "#44cc22",
1861
+ _animated: { pattern: "wave", speed: 0.8, amplitude: 0.2 }
1862
+ },
1863
+ flickering_neon: {
1864
+ roughness: 0,
1865
+ metalness: 0,
1866
+ emissive: "#ff00ff",
1867
+ emissiveIntensity: 3.5,
1868
+ transparent: true,
1869
+ opacity: 0.9,
1870
+ _animated: { pattern: "flicker", speed: 5, amplitude: 0.4 }
1871
+ },
1872
+ pulsing_crystal: {
1873
+ roughness: 0,
1874
+ metalness: 0.1,
1875
+ transmission: 0.8,
1876
+ ior: 2,
1877
+ iridescence: 0.8,
1878
+ iridescenceIOR: 1.3,
1879
+ emissive: "#8844ff",
1880
+ emissiveIntensity: 1,
1881
+ _animated: { pattern: "pulse", speed: 0.8, amplitude: 0.6 }
1882
+ },
1883
+ animated_hologram: {
1884
+ roughness: 0,
1885
+ metalness: 0.3,
1886
+ transparent: true,
1887
+ opacity: 0.5,
1888
+ emissive: "#00ccff",
1889
+ emissiveIntensity: 1.5,
1890
+ _animated: { pattern: "scroll", speed: 1.5, amplitude: 0.3 }
1891
+ },
1892
+ boiling_surface: {
1893
+ roughness: 0.7,
1894
+ metalness: 0,
1895
+ color: "#cc4400",
1896
+ emissive: "#ff6600",
1897
+ emissiveIntensity: 2,
1898
+ _animated: { pattern: "noise", speed: 2, amplitude: 0.5 }
1899
+ },
1900
+ shimmer_heat: {
1901
+ roughness: 0,
1902
+ metalness: 0,
1903
+ transparent: true,
1904
+ opacity: 0.15,
1905
+ _animated: { pattern: "wave", speed: 2, amplitude: 0.1 }
1906
+ },
1907
+ // ===========================================================================
1908
+ // VOLUMETRIC MATERIALS — metadata for ray-marched volume rendering
1909
+ // These presets describe volumetric phenomena; the runtime renders them via
1910
+ // a ray marching pass on a bounding box/sphere geometry.
1911
+ // ===========================================================================
1912
+ fog: {
1913
+ roughness: 0,
1914
+ metalness: 0,
1915
+ color: "#c0c0c0",
1916
+ transparent: true,
1917
+ opacity: 0.3,
1918
+ _volumetric: { type: "fog", density: 0.3, scattering: 0.8, absorption: 0.05 }
1919
+ },
1920
+ dense_fog: {
1921
+ roughness: 0,
1922
+ metalness: 0,
1923
+ color: "#a0a0a0",
1924
+ transparent: true,
1925
+ opacity: 0.5,
1926
+ _volumetric: { type: "fog", density: 0.7, scattering: 0.9, absorption: 0.1 }
1927
+ },
1928
+ smoke: {
1929
+ roughness: 0,
1930
+ metalness: 0,
1931
+ color: "#404040",
1932
+ transparent: true,
1933
+ opacity: 0.4,
1934
+ _volumetric: {
1935
+ type: "smoke",
1936
+ density: 0.5,
1937
+ scattering: 0.3,
1938
+ absorption: 0.4,
1939
+ riseSpeed: 0.5,
1940
+ turbulence: 0.6
1941
+ }
1942
+ },
1943
+ campfire_smoke: {
1944
+ roughness: 0,
1945
+ metalness: 0,
1946
+ color: "#505050",
1947
+ transparent: true,
1948
+ opacity: 0.35,
1949
+ _volumetric: {
1950
+ type: "smoke",
1951
+ density: 0.4,
1952
+ scattering: 0.25,
1953
+ absorption: 0.5,
1954
+ riseSpeed: 0.8,
1955
+ turbulence: 0.4
1956
+ }
1957
+ },
1958
+ fire_volume: {
1959
+ roughness: 0,
1960
+ metalness: 0,
1961
+ color: "#ff4400",
1962
+ emissive: "#ff2200",
1963
+ emissiveIntensity: 4,
1964
+ transparent: true,
1965
+ opacity: 0.7,
1966
+ _volumetric: {
1967
+ type: "fire",
1968
+ density: 0.6,
1969
+ scattering: 0.1,
1970
+ absorption: 0.2,
1971
+ riseSpeed: 1.2,
1972
+ turbulence: 0.7,
1973
+ temperature: 2500
1974
+ }
1975
+ },
1976
+ candle_flame: {
1977
+ roughness: 0,
1978
+ metalness: 0,
1979
+ color: "#ffaa33",
1980
+ emissive: "#ff8800",
1981
+ emissiveIntensity: 3,
1982
+ transparent: true,
1983
+ opacity: 0.6,
1984
+ _volumetric: {
1985
+ type: "fire",
1986
+ density: 0.4,
1987
+ scattering: 0.05,
1988
+ absorption: 0.1,
1989
+ riseSpeed: 0.3,
1990
+ turbulence: 0.2,
1991
+ temperature: 1800
1992
+ }
1993
+ },
1994
+ clouds: {
1995
+ roughness: 0,
1996
+ metalness: 0,
1997
+ color: "#ffffff",
1998
+ transparent: true,
1999
+ opacity: 0.6,
2000
+ _volumetric: {
2001
+ type: "clouds",
2002
+ density: 0.4,
2003
+ scattering: 0.95,
2004
+ absorption: 0.02,
2005
+ noiseScale: 2,
2006
+ octaves: 6
2007
+ }
2008
+ },
2009
+ storm_clouds: {
2010
+ roughness: 0,
2011
+ metalness: 0,
2012
+ color: "#3a3a4a",
2013
+ transparent: true,
2014
+ opacity: 0.8,
2015
+ _volumetric: {
2016
+ type: "clouds",
2017
+ density: 0.7,
2018
+ scattering: 0.6,
2019
+ absorption: 0.15,
2020
+ noiseScale: 1.5,
2021
+ octaves: 6
2022
+ }
2023
+ },
2024
+ dust_motes: {
2025
+ roughness: 0,
2026
+ metalness: 0,
2027
+ color: "#c8b888",
2028
+ transparent: true,
2029
+ opacity: 0.15,
2030
+ _volumetric: { type: "dust", density: 0.1, scattering: 0.5, absorption: 0.02 }
2031
+ },
2032
+ mist: {
2033
+ roughness: 0,
2034
+ metalness: 0,
2035
+ color: "#e0e8f0",
2036
+ transparent: true,
2037
+ opacity: 0.25,
2038
+ _volumetric: {
2039
+ type: "mist",
2040
+ density: 0.2,
2041
+ scattering: 0.85,
2042
+ absorption: 0.03,
2043
+ heightFalloff: 1.5
2044
+ }
2045
+ },
2046
+ steam: {
2047
+ roughness: 0,
2048
+ metalness: 0,
2049
+ color: "#e8e8e8",
2050
+ transparent: true,
2051
+ opacity: 0.3,
2052
+ _volumetric: {
2053
+ type: "steam",
2054
+ density: 0.35,
2055
+ scattering: 0.7,
2056
+ absorption: 0.05,
2057
+ riseSpeed: 1,
2058
+ turbulence: 0.3
2059
+ }
2060
+ },
2061
+ aurora_borealis: {
2062
+ roughness: 0,
2063
+ metalness: 0,
2064
+ emissive: "#00ff88",
2065
+ emissiveIntensity: 2,
2066
+ transparent: true,
2067
+ opacity: 0.3,
2068
+ _volumetric: {
2069
+ type: "aurora",
2070
+ density: 0.15,
2071
+ scattering: 0.1,
2072
+ absorption: 0.01,
2073
+ emissionIntensity: 2
2074
+ }
2075
+ },
2076
+ nebula: {
2077
+ roughness: 0,
2078
+ metalness: 0,
2079
+ emissive: "#ff44aa",
2080
+ emissiveIntensity: 1.5,
2081
+ transparent: true,
2082
+ opacity: 0.4,
2083
+ _volumetric: {
2084
+ type: "nebula",
2085
+ density: 0.25,
2086
+ scattering: 0.3,
2087
+ absorption: 0.05,
2088
+ emissionIntensity: 1.5,
2089
+ noiseScale: 1
2090
+ }
2091
+ },
2092
+ underwater_caustics: {
2093
+ roughness: 0,
2094
+ metalness: 0,
2095
+ color: "#003366",
2096
+ transparent: true,
2097
+ opacity: 0.2,
2098
+ _volumetric: { type: "underwater", density: 0.15, scattering: 0.6, absorption: 0.1 }
2099
+ },
2100
+ god_rays: {
2101
+ roughness: 0,
2102
+ metalness: 0,
2103
+ color: "#ffffd0",
2104
+ transparent: true,
2105
+ opacity: 0.15,
2106
+ emissive: "#ffff88",
2107
+ emissiveIntensity: 0.5,
2108
+ _volumetric: { type: "god_rays", density: 0.1, scattering: 0.9, absorption: 0.01 }
2109
+ },
2110
+ neon_gas: {
2111
+ roughness: 0,
2112
+ metalness: 0,
2113
+ emissive: "#ff4400",
2114
+ emissiveIntensity: 3,
2115
+ transparent: true,
2116
+ opacity: 0.5,
2117
+ _volumetric: {
2118
+ type: "neon_gas",
2119
+ density: 0.3,
2120
+ scattering: 0.2,
2121
+ absorption: 0.05,
2122
+ emissionIntensity: 3
2123
+ }
2124
+ },
2125
+ explosion: {
2126
+ roughness: 0,
2127
+ metalness: 0,
2128
+ color: "#ff6600",
2129
+ emissive: "#ff4400",
2130
+ emissiveIntensity: 6,
2131
+ transparent: true,
2132
+ opacity: 0.8,
2133
+ _volumetric: {
2134
+ type: "fire",
2135
+ density: 0.8,
2136
+ scattering: 0.15,
2137
+ absorption: 0.3,
2138
+ riseSpeed: 2,
2139
+ turbulence: 1,
2140
+ temperature: 4e3
2141
+ }
2142
+ },
2143
+ toxic_gas: {
2144
+ roughness: 0,
2145
+ metalness: 0,
2146
+ color: "#44cc00",
2147
+ emissive: "#33aa00",
2148
+ emissiveIntensity: 1,
2149
+ transparent: true,
2150
+ opacity: 0.35,
2151
+ _volumetric: {
2152
+ type: "smoke",
2153
+ density: 0.3,
2154
+ scattering: 0.4,
2155
+ absorption: 0.2,
2156
+ riseSpeed: 0.2,
2157
+ turbulence: 0.3
2158
+ }
2159
+ },
2160
+ magical_mist: {
2161
+ roughness: 0,
2162
+ metalness: 0,
2163
+ emissive: "#8844ff",
2164
+ emissiveIntensity: 1.5,
2165
+ transparent: true,
2166
+ opacity: 0.3,
2167
+ iridescence: 0.6,
2168
+ iridescenceIOR: 1.5,
2169
+ _volumetric: {
2170
+ type: "mist",
2171
+ density: 0.2,
2172
+ scattering: 0.5,
2173
+ absorption: 0.03,
2174
+ emissionIntensity: 1.5
2175
+ }
2176
+ },
2177
+ // --- Architectural & Natural Stone ---
2178
+ brick: { roughness: 0.9, metalness: 0, color: "#a6523c" },
2179
+ concrete: { roughness: 0.88, metalness: 0, color: "#8a8a8a" },
2180
+ granite: { roughness: 0.6, metalness: 0, color: "#666670" },
2181
+ sandstone: { roughness: 0.85, metalness: 0, color: "#cca66e" },
2182
+ slate: { roughness: 0.7, metalness: 0, color: "#3f4450" },
2183
+ adobe: { roughness: 0.95, metalness: 0, color: "#bf9160" },
2184
+ plaster: { roughness: 0.82, metalness: 0, color: "#ebe8de" },
2185
+ // --- Plant & Cellulose ---
2186
+ bamboo: { roughness: 0.65, metalness: 0, color: "#b3a84d" },
2187
+ paper: { roughness: 0.9, metalness: 0, color: "#f3f0e5" },
2188
+ cardboard: { roughness: 0.88, metalness: 0, color: "#b88c58" },
2189
+ // --- Organic & Animal ---
2190
+ bone: { roughness: 0.7, metalness: 0, color: "#e0d4b5" },
2191
+ ivory: { roughness: 0.35, metalness: 0, color: "#f0e8c5", envMapIntensity: 0.4 },
2192
+ coral: { roughness: 0.75, metalness: 0, color: "#f2614d" },
2193
+ shell: {
2194
+ roughness: 0.25,
2195
+ metalness: 0.05,
2196
+ color: "#f5ede0",
2197
+ iridescence: 0.8,
2198
+ iridescenceIOR: 1.5,
2199
+ envMapIntensity: 0.6
2200
+ },
2201
+ thatch: { roughness: 0.95, metalness: 0, color: "#c0a84a" },
2202
+ // --- Synthetic & Engineered ---
2203
+ resin: {
2204
+ roughness: 0.08,
2205
+ metalness: 0,
2206
+ transmission: 0.75,
2207
+ ior: 1.5,
2208
+ color: "#e8c46a",
2209
+ transparent: true,
2210
+ opacity: 0.88
2211
+ },
2212
+ foam: { roughness: 0.95, metalness: 0, color: "#f0f0f0" },
2213
+ composite: { roughness: 0.5, metalness: 0.25, color: "#333338" },
2214
+ carbon_fiber: {
2215
+ roughness: 0.28,
2216
+ metalness: 0.6,
2217
+ color: "#111114",
2218
+ envMapIntensity: 1.2,
2219
+ clearcoat: 0.6,
2220
+ clearcoatRoughness: 0.1
2221
+ },
2222
+ kevlar: { roughness: 0.82, metalness: 0, color: "#ccbb66" },
2223
+ fiberglass: {
2224
+ roughness: 0.3,
2225
+ metalness: 0.05,
2226
+ transmission: 0.4,
2227
+ ior: 1.45,
2228
+ color: "#e0ede0",
2229
+ transparent: true,
2230
+ opacity: 0.92
2231
+ },
2232
+ stained_glass: {
2233
+ roughness: 0.05,
2234
+ metalness: 0,
2235
+ transmission: 0.85,
2236
+ ior: 1.52,
2237
+ color: "#cc44ff",
2238
+ transparent: true,
2239
+ opacity: 0.75,
2240
+ thickness: 0.3
2241
+ }
2242
+ };
2243
+ var ENVIRONMENT_PRESETS = {
2244
+ forest_sunset: {
2245
+ background: true,
2246
+ envPreset: "sunset",
2247
+ fog: { color: "#ff9966", near: 10, far: 100 },
2248
+ ground: { color: "#2d5a27" },
2249
+ lighting: {
2250
+ ambient: { color: "#ffa366", intensity: 0.3 },
2251
+ directional: { color: "#ff7700", intensity: 1.5, position: [10, 20, 5], shadows: true }
2252
+ }
2253
+ },
2254
+ cyberpunk_city: {
2255
+ background: true,
2256
+ envPreset: "night",
2257
+ fog: { color: "#0a0020", near: 5, far: 60 },
2258
+ ground: { color: "#1a1a2e" },
2259
+ lighting: {
2260
+ ambient: { color: "#220044", intensity: 0.2 },
2261
+ directional: { color: "#ff00ff", intensity: 0.5, position: [5, 15, 5], shadows: true },
2262
+ points: [
2263
+ { color: "#00ffff", intensity: 3, position: [-5, 3, -5], distance: 15 },
2264
+ { color: "#ff00ff", intensity: 3, position: [5, 3, 5], distance: 15 }
2265
+ ]
2266
+ },
2267
+ postprocessing: { bloom: { intensity: 1.5, luminanceThreshold: 0.1 } }
2268
+ },
2269
+ space_void: {
2270
+ background: true,
2271
+ envPreset: "night",
2272
+ lighting: {
2273
+ ambient: { color: "#111133", intensity: 0.1 },
2274
+ directional: { color: "#ffffff", intensity: 0.5, position: [0, 10, 0], shadows: false }
2275
+ }
2276
+ },
2277
+ studio: {
2278
+ background: true,
2279
+ envPreset: "studio",
2280
+ ground: { color: "#cccccc" },
2281
+ lighting: {
2282
+ ambient: { color: "#ffffff", intensity: 0.4 },
2283
+ directional: { color: "#ffffff", intensity: 1, position: [5, 10, 5], shadows: true }
2284
+ }
2285
+ },
2286
+ underwater: {
2287
+ background: true,
2288
+ envPreset: "dawn",
2289
+ fog: { color: "#003366", near: 2, far: 40 },
2290
+ ground: { color: "#1a3a4a" },
2291
+ lighting: {
2292
+ ambient: { color: "#004488", intensity: 0.3 },
2293
+ directional: { color: "#66aacc", intensity: 0.8, position: [0, 20, 0], shadows: true }
2294
+ }
2295
+ },
2296
+ desert: {
2297
+ background: true,
2298
+ envPreset: "sunset",
2299
+ fog: { color: "#d4a574", near: 20, far: 150 },
2300
+ ground: { color: "#c4a35a" },
2301
+ lighting: {
2302
+ ambient: { color: "#f5deb3", intensity: 0.4 },
2303
+ directional: { color: "#ffffcc", intensity: 2, position: [15, 30, 10], shadows: true }
2304
+ }
2305
+ }
2306
+ };
2307
+ var MESH_TYPES = /* @__PURE__ */ new Set([
2308
+ "orb",
2309
+ "sphere",
2310
+ "cube",
2311
+ "box",
2312
+ "cylinder",
2313
+ "pyramid",
2314
+ "cone",
2315
+ "plane",
2316
+ "torus",
2317
+ "ring",
2318
+ "capsule",
2319
+ "object",
2320
+ "avatar",
2321
+ "dna",
2322
+ "nerf",
2323
+ "volumetric_video",
2324
+ // Procedural geometry types (hull/spline/membrane/blob/metaball)
2325
+ "hull",
2326
+ "spline",
2327
+ "membrane",
2328
+ "blob",
2329
+ "metaball"
2330
+ ]);
2331
+ var UI_COMPONENT_PRESETS = {
2332
+ UIPanel: {
2333
+ component: "Container",
2334
+ // @react-three/uikit Container
2335
+ defaultProps: {
2336
+ flexDirection: "column",
2337
+ padding: 16,
2338
+ backgroundColor: "rgba(0, 0, 0, 0.8)",
2339
+ borderRadius: 8
2340
+ }
2341
+ },
2342
+ UIText: {
2343
+ component: "Text",
2344
+ // @react-three/uikit Text
2345
+ defaultProps: {
2346
+ fontSize: 16,
2347
+ color: "white"
2348
+ }
2349
+ },
2350
+ UIButton: {
2351
+ component: "Button",
2352
+ // Custom button using Container with hover
2353
+ defaultProps: {
2354
+ padding: 12,
2355
+ paddingX: 24,
2356
+ backgroundColor: "#4a90d9",
2357
+ borderRadius: 4,
2358
+ cursor: "pointer"
2359
+ }
2360
+ },
2361
+ UISlider: {
2362
+ component: "Slider",
2363
+ // Custom slider implementation
2364
+ defaultProps: {
2365
+ width: 200,
2366
+ height: 20,
2367
+ trackColor: "#333",
2368
+ fillColor: "#4a90d9",
2369
+ thumbSize: 16
2370
+ }
2371
+ },
2372
+ UIInput: {
2373
+ component: "Input",
2374
+ // @react-three/uikit Input
2375
+ defaultProps: {
2376
+ width: 200,
2377
+ padding: 8,
2378
+ backgroundColor: "#222",
2379
+ borderColor: "#444",
2380
+ borderWidth: 1,
2381
+ borderRadius: 4,
2382
+ color: "white"
2383
+ }
2384
+ },
2385
+ UIImage: {
2386
+ component: "Image",
2387
+ // @react-three/uikit Image
2388
+ defaultProps: {
2389
+ objectFit: "contain"
2390
+ }
2391
+ },
2392
+ UIChart: {
2393
+ component: "Chart",
2394
+ // Custom chart component
2395
+ defaultProps: {
2396
+ width: 300,
2397
+ height: 200,
2398
+ backgroundColor: "#1a1a2e"
2399
+ }
2400
+ },
2401
+ UIGauge: {
2402
+ component: "Gauge",
2403
+ // Custom gauge component
2404
+ defaultProps: {
2405
+ size: 100,
2406
+ strokeWidth: 8,
2407
+ trackColor: "#333",
2408
+ fillColor: "#4a90d9"
2409
+ }
2410
+ }
2411
+ };
2412
+ var QUALITY_TIER_SCALES = {
2413
+ low: {
2414
+ particleScale: 0.25,
2415
+ lodLevel: "draft",
2416
+ maxLights: 2,
2417
+ shadowMapSize: 512,
2418
+ shaderComplexity: "basic"
2419
+ },
2420
+ med: {
2421
+ particleScale: 0.6,
2422
+ lodLevel: "mesh",
2423
+ maxLights: 4,
2424
+ shadowMapSize: 1024,
2425
+ shaderComplexity: "standard"
2426
+ },
2427
+ high: {
2428
+ particleScale: 1,
2429
+ lodLevel: "final",
2430
+ maxLights: 8,
2431
+ shadowMapSize: 2048,
2432
+ shaderComplexity: "physical"
2433
+ },
2434
+ ultra: {
2435
+ particleScale: 1.5,
2436
+ lodLevel: "final",
2437
+ maxLights: 16,
2438
+ shadowMapSize: 4096,
2439
+ shaderComplexity: "physical"
2440
+ }
2441
+ };
2442
+ var SceneIRCompiler = class {
2443
+ constructor(options = {}) {
2444
+ // ─── RBAC Enforcement ─────────────────────────────────────────────────
2445
+ this.rbac = chunkZK7KX5CD_cjs.getRBAC();
2446
+ this.compilerName = options.compilerName ?? "SceneIRCompiler";
2447
+ this.qualityTier = options.qualityTier ?? "high";
2448
+ this.tierScales = QUALITY_TIER_SCALES[this.qualityTier];
2449
+ this._defaultLighting = options.defaultLighting ?? true;
2450
+ this._holomapPointCloud = options.holomapPointCloud;
2451
+ if (options.platformTarget) {
2452
+ this._platformTarget = typeof options.platformTarget === "string" ? chunkTZCFKZ6Z_cjs.createPlatformTarget(options.platformTarget) : options.platformTarget;
2453
+ }
2454
+ }
2455
+ /**
2456
+ * Validate agent permissions before compilation.
2457
+ * Skips validation when no token is provided (backwards compatibility).
2458
+ *
2459
+ * Checks:
2460
+ * 1. AST read access (can the agent read AST?)
2461
+ * 2. Code generation access (can the agent generate code?)
2462
+ * 3. Output path scope (if outputPath provided)
2463
+ *
2464
+ * @param agentToken - Agent JWT token (optional for backwards compat)
2465
+ * @param outputPath - Optional output file path for scope validation
2466
+ * @throws UnauthorizedCompilerAccessError if token is provided but invalid/unauthorized
2467
+ */
2468
+ validateCompilerAccess(agentToken, outputPath) {
2469
+ if (!agentToken) return;
2470
+ const astDecision = this.rbac.checkAccess({
2471
+ token: agentToken,
2472
+ resourceType: "ast" /* AST */,
2473
+ operation: "read",
2474
+ expectedWorkflowStep: "generate_assembly" /* GENERATE_ASSEMBLY */
2475
+ });
2476
+ if (!astDecision.allowed) {
2477
+ throw new chunkZK7KX5CD_cjs.UnauthorizedCompilerAccessError(astDecision, "AST access", this.compilerName);
2478
+ }
2479
+ const codeDecision = this.rbac.checkAccess({
2480
+ token: agentToken,
2481
+ resourceType: "code" /* CODE */,
2482
+ operation: "write",
2483
+ expectedWorkflowStep: "generate_assembly" /* GENERATE_ASSEMBLY */
2484
+ });
2485
+ if (!codeDecision.allowed) {
2486
+ throw new chunkZK7KX5CD_cjs.UnauthorizedCompilerAccessError(codeDecision, "code generation", this.compilerName);
2487
+ }
2488
+ if (outputPath) {
2489
+ const outputDecision = this.rbac.checkAccess({
2490
+ token: agentToken,
2491
+ resourceType: "output" /* OUTPUT */,
2492
+ operation: "write",
2493
+ resourcePath: outputPath,
2494
+ expectedWorkflowStep: "serialize" /* SERIALIZE */
2495
+ });
2496
+ if (!outputDecision.allowed) {
2497
+ throw new chunkZK7KX5CD_cjs.UnauthorizedCompilerAccessError(
2498
+ outputDecision,
2499
+ `output write to '${outputPath}'`,
2500
+ this.compilerName
2501
+ );
2502
+ }
2503
+ }
2504
+ }
2505
+ // ─── Spread Expansion Utility ─────────────────────────────────────────
2506
+ /**
2507
+ * Expands spread expressions in a properties object.
2508
+ * Spreads are stored with keys like `__spread_0`, `__spread_1` and have
2509
+ * the structure: { type: 'spread', argument: <value> }
2510
+ *
2511
+ * @param props - The properties object potentially containing spreads
2512
+ * @param context - Optional context for resolving references (templates, state)
2513
+ * @returns A new object with spreads expanded and merged
2514
+ */
2515
+ expandSpreads(props, context) {
2516
+ const result = {};
2517
+ const spreadKeys = [];
2518
+ for (const [key, value] of Object.entries(props)) {
2519
+ if (key.startsWith("__spread_")) {
2520
+ spreadKeys.push(key);
2521
+ } else if (value && typeof value === "object" && value.type === "spread") {
2522
+ spreadKeys.push(key);
2523
+ } else {
2524
+ if (value && typeof value === "object" && !Array.isArray(value) && !("__ref" in value) && !("__expr" in value)) {
2525
+ result[key] = this.expandSpreads(value, context);
2526
+ } else if (Array.isArray(value)) {
2527
+ result[key] = this.expandArraySpreads(value, context);
2528
+ } else {
2529
+ result[key] = value;
2530
+ }
2531
+ }
2532
+ }
2533
+ for (const spreadKey of spreadKeys) {
2534
+ const spreadValue = props[spreadKey];
2535
+ if (spreadValue && typeof spreadValue === "object" && spreadValue.type === "spread") {
2536
+ const resolved = this.resolveSpreadArgument(
2537
+ spreadValue.argument,
2538
+ context
2539
+ );
2540
+ if (resolved && typeof resolved === "object" && !Array.isArray(resolved)) {
2541
+ Object.assign(result, this.expandSpreads(resolved, context));
2542
+ }
2543
+ }
2544
+ }
2545
+ for (const [key, value] of Object.entries(props)) {
2546
+ if (!key.startsWith("__spread_") && !(value && typeof value === "object" && value.type === "spread")) {
2547
+ if (value && typeof value === "object" && !Array.isArray(value) && !("__ref" in value) && !("__expr" in value)) {
2548
+ result[key] = this.expandSpreads(value, context);
2549
+ } else if (Array.isArray(value)) {
2550
+ result[key] = this.expandArraySpreads(value, context);
2551
+ } else {
2552
+ result[key] = value;
2553
+ }
2554
+ }
2555
+ }
2556
+ return result;
2557
+ }
2558
+ /**
2559
+ * Expands spread expressions within an array.
2560
+ * Spread elements have { type: 'spread', argument: <value> }
2561
+ */
2562
+ expandArraySpreads(arr, context) {
2563
+ const result = [];
2564
+ for (const item of arr) {
2565
+ if (item && typeof item === "object" && item.type === "spread") {
2566
+ const resolved = this.resolveSpreadArgument(
2567
+ item.argument,
2568
+ context
2569
+ );
2570
+ if (Array.isArray(resolved)) {
2571
+ result.push(...resolved);
2572
+ } else if (resolved !== void 0 && resolved !== null) {
2573
+ result.push(resolved);
2574
+ }
2575
+ } else if (item && typeof item === "object" && !Array.isArray(item)) {
2576
+ result.push(this.expandSpreads(item, context));
2577
+ } else {
2578
+ result.push(item);
2579
+ }
2580
+ }
2581
+ return result;
2582
+ }
2583
+ /**
2584
+ * Resolves a spread argument to its value.
2585
+ * Handles: direct values, __ref references, template references
2586
+ */
2587
+ resolveSpreadArgument(argument, context) {
2588
+ if (argument === null || argument === void 0) {
2589
+ return void 0;
2590
+ }
2591
+ if (typeof argument === "object" && !("__ref" in argument)) {
2592
+ return argument;
2593
+ }
2594
+ if (typeof argument === "object" && "__ref" in argument) {
2595
+ const ref = argument.__ref;
2596
+ if (context?.templates) {
2597
+ const template = context.templates.get(ref);
2598
+ if (template) {
2599
+ return template.properties || template;
2600
+ }
2601
+ }
2602
+ if (context?.state && ref in context.state) {
2603
+ return context.state[ref];
2604
+ }
2605
+ if (context?.state && ref.includes(".")) {
2606
+ const parts = ref.split(".");
2607
+ let value = context.state;
2608
+ for (const part of parts) {
2609
+ if (value && typeof value === "object" && part in value) {
2610
+ value = value[part];
2611
+ } else {
2612
+ value = void 0;
2613
+ break;
2614
+ }
2615
+ }
2616
+ if (value !== void 0) {
2617
+ return value;
2618
+ }
2619
+ }
2620
+ return argument;
2621
+ }
2622
+ if (typeof argument === "string") {
2623
+ if (context?.templates) {
2624
+ const template = context.templates.get(argument);
2625
+ if (template) {
2626
+ return template.properties || template;
2627
+ }
2628
+ }
2629
+ return { __ref: argument };
2630
+ }
2631
+ return argument;
2632
+ }
2633
+ // ─── HSPlusAST Compilation ────────────────────────────────────────────
2634
+ compile(ast, agentToken, outputPath) {
2635
+ this.validateCompilerAccess(agentToken, outputPath);
2636
+ const root = this.compileNode(ast.root);
2637
+ if (this.hasPostProcessing(root)) {
2638
+ root.children?.unshift({
2639
+ type: "EffectComposer",
2640
+ props: {},
2641
+ children: this.extractPostProcessingNodes(root)
2642
+ });
2643
+ }
2644
+ this.injectDefaultLighting(root);
2645
+ const domainBlocks = ast.domainBlocks ?? [];
2646
+ if (domainBlocks.length > 0) {
2647
+ const compiled = chunkQEDMOGF3_cjs.compileDomainBlocks(
2648
+ domainBlocks,
2649
+ {
2650
+ material: (block) => {
2651
+ const mat = chunkQEDMOGF3_cjs.compileMaterialBlock(block);
2652
+ return {
2653
+ type: "DomainBlockOutput",
2654
+ props: {
2655
+ __raw: chunkQEDMOGF3_cjs.materialToR3F(mat, this.tierScales),
2656
+ __domain: "material",
2657
+ __name: mat.name
2658
+ },
2659
+ children: []
2660
+ };
2661
+ },
2662
+ physics: (block) => {
2663
+ const phys = chunkQEDMOGF3_cjs.compilePhysicsBlock(block);
2664
+ return {
2665
+ type: "DomainBlockOutput",
2666
+ props: {
2667
+ __raw: chunkQEDMOGF3_cjs.physicsToR3F(phys),
2668
+ __domain: "physics",
2669
+ __name: phys.name || phys.keyword
2670
+ },
2671
+ children: []
2672
+ };
2673
+ },
2674
+ vfx: (block) => {
2675
+ const ps = chunkQEDMOGF3_cjs.compileParticleBlock(block);
2676
+ return {
2677
+ type: "DomainBlockOutput",
2678
+ props: {
2679
+ __raw: chunkQEDMOGF3_cjs.particlesToR3F(ps, this.tierScales),
2680
+ __domain: "vfx",
2681
+ __name: ps.name
2682
+ },
2683
+ children: []
2684
+ };
2685
+ },
2686
+ postfx: (block) => {
2687
+ const pp = chunkQEDMOGF3_cjs.compilePostProcessingBlock(block);
2688
+ return {
2689
+ type: "DomainBlockOutput",
2690
+ props: {
2691
+ __raw: chunkQEDMOGF3_cjs.postProcessingToR3F(pp),
2692
+ __domain: "postfx",
2693
+ __name: pp.name || "PostProcessing"
2694
+ },
2695
+ children: []
2696
+ };
2697
+ },
2698
+ audio: (block) => {
2699
+ const audio = chunkQEDMOGF3_cjs.compileAudioSourceBlock(block);
2700
+ return {
2701
+ type: "DomainBlockOutput",
2702
+ props: { __raw: chunkQEDMOGF3_cjs.audioSourceToR3F(audio), __domain: "audio", __name: audio.name },
2703
+ children: []
2704
+ };
2705
+ },
2706
+ weather: (block) => {
2707
+ const weather = chunkQEDMOGF3_cjs.compileWeatherBlock(block);
2708
+ return {
2709
+ type: "DomainBlockOutput",
2710
+ props: {
2711
+ __raw: chunkQEDMOGF3_cjs.weatherToR3F(weather),
2712
+ __domain: "weather",
2713
+ __name: weather.name || "Weather"
2714
+ },
2715
+ children: []
2716
+ };
2717
+ },
2718
+ simulation: (block) => {
2719
+ const sim = chunkQEDMOGF3_cjs.compileSimulationBlock(block);
2720
+ return {
2721
+ type: "DomainBlockOutput",
2722
+ props: {
2723
+ __raw: chunkQEDMOGF3_cjs.simulationToR3F(sim),
2724
+ __domain: "simulation",
2725
+ __name: sim.name || "Simulation"
2726
+ },
2727
+ children: []
2728
+ };
2729
+ },
2730
+ procedural: (block) => this.compileProceduralScatterNode(block) ?? this.createNode("Group", {}, block.name)
2731
+ }
2732
+ );
2733
+ if (!root.children) root.children = [];
2734
+ for (const c of compiled) {
2735
+ if (typeof c === "object") root.children.push(c);
2736
+ }
2737
+ }
2738
+ return root;
2739
+ }
2740
+ /**
2741
+ * Compiles a declarative 'world' node into R3F scene nodes.
2742
+ * Nested `world.children` (objects) are compiled via the same path as top-level objects.
2743
+ */
2744
+ compileWorldNode(world, templateMap) {
2745
+ const nodes = [];
2746
+ const props = {};
2747
+ if (world.properties) {
2748
+ for (const prop of world.properties) {
2749
+ props[prop.key] = prop.value;
2750
+ }
2751
+ }
2752
+ if (props.ambient_light !== void 0) {
2753
+ nodes.push(
2754
+ this.createNode("ambientLight", {
2755
+ intensity: Number(props.ambient_light)
2756
+ })
2757
+ );
2758
+ }
2759
+ if (props.skybox_color !== void 0) {
2760
+ nodes.push(
2761
+ this.createNode("Environment", {
2762
+ background: true,
2763
+ preset: "sunset"
2764
+ // Default preset if just color is given
2765
+ })
2766
+ );
2767
+ nodes.push(
2768
+ this.createNode("color", {
2769
+ attach: "background",
2770
+ args: [props.skybox_color]
2771
+ })
2772
+ );
2773
+ }
2774
+ if (props.gravity !== void 0) {
2775
+ nodes.push(
2776
+ this.createNode("Physics", {
2777
+ gravity: [0, -Number(props.gravity), 0]
2778
+ })
2779
+ );
2780
+ }
2781
+ const childNodes = [];
2782
+ if (world.children && world.children.length > 0) {
2783
+ for (const child of world.children) {
2784
+ childNodes.push(
2785
+ this.compileObjectDecl(child, templateMap)
2786
+ );
2787
+ }
2788
+ }
2789
+ if (childNodes.length === 0) {
2790
+ return nodes;
2791
+ }
2792
+ const group = this.createNode(
2793
+ "group",
2794
+ {},
2795
+ world.name ? chunkZK7KX5CD_cjs.escapeStringValue(world.name, "JSX") : void 0
2796
+ );
2797
+ group.children = [...nodes, ...childNodes];
2798
+ return [group];
2799
+ }
2800
+ createNode(type, props = {}, id) {
2801
+ const node = sceneIRNodePool.acquire();
2802
+ node.type = type;
2803
+ node.id = id;
2804
+ node.props = props;
2805
+ node.children = [];
2806
+ node.traits = /* @__PURE__ */ new Map();
2807
+ node.directives = [];
2808
+ return node;
2809
+ }
2810
+ /**
2811
+ * Compiles a `procedural` domain block (keyword scatter/procedural/generate/
2812
+ * distribute/pcg_graph) into an instanced `scatter` R3FNode that the web R3F
2813
+ * renderer (ScatterMesh) consumes as a THREE.InstancedMesh.
2814
+ *
2815
+ * Before this method, `.holo` scatter/procedural blocks parsed into the IR but
2816
+ * were silently dropped (compileComposition never read composition.domainBlocks),
2817
+ * so every "dense" world rendered only its hand-listed objects.
2818
+ *
2819
+ * Emitted node shape (shared contract with ImmersiveViewer):
2820
+ * { type: 'scatter', id: block.name, props: { transforms, count, sourceMesh,
2821
+ * hsType, color?, roughness?, metalness?, emissive? }, children: [] }
2822
+ * where each transform is [x, y, z, rotationY, scale].
2823
+ *
2824
+ * Placement is DETERMINISTIC (seeded mulberry32 — never Math.random) so builds
2825
+ * are reproducible. Placement is uniform on the XZ plane within `bounds`, with a
2826
+ * bounded rejection loop honoring `min_distance`.
2827
+ *
2828
+ * v1 limitations (documented):
2829
+ * - .glb/.gltf sourceMesh instances as a `box` placeholder (instancing a loaded
2830
+ * GLB across instances is a follow-up).
2831
+ * - Placement is flat (y=0); slope/terrain-conforming placement is out of scope.
2832
+ */
2833
+ compileProceduralScatterNode(block) {
2834
+ const proc = chunkQEDMOGF3_cjs.compileProceduralBlock(block);
2835
+ const props = block.properties ?? {};
2836
+ let scatterNode;
2837
+ if (Array.isArray(props.nodes)) {
2838
+ for (const n of props.nodes) {
2839
+ const nType = n.type ?? n.op ?? n.keyword ?? n.kind;
2840
+ if (typeof nType === "string" && nType.toLowerCase().includes("scatter")) {
2841
+ scatterNode = n.properties ?? n;
2842
+ break;
2843
+ }
2844
+ }
2845
+ }
2846
+ const rawCount = props.count ?? scatterNode?.count ?? proc.density;
2847
+ const count = Math.floor(typeof rawCount === "number" ? rawCount : 0);
2848
+ if (count < 1) return null;
2849
+ const sourceMesh = proc.sourceMesh || (scatterNode?.source_mesh || scatterNode?.sourceMesh || scatterNode?.mesh) || "box";
2850
+ const isGlb = /\.(glb|gltf)$/i.test(sourceMesh);
2851
+ const hsType = isGlb ? "box" : sourceMesh;
2852
+ const boundsRaw = props.bounds ?? props.area ?? scatterNode?.bounds ?? [10, 0, 10];
2853
+ const bx = typeof boundsRaw[0] === "number" ? boundsRaw[0] : 10;
2854
+ const bz = typeof boundsRaw[2] === "number" ? boundsRaw[2] : 10;
2855
+ const minDistance = (() => {
2856
+ const md = props.min_distance ?? props.minDistance ?? scatterNode?.min_distance;
2857
+ return typeof md === "number" && md > 0 ? md : 0;
2858
+ })();
2859
+ const sr = proc.scaleRange ?? props.scale_range;
2860
+ const sMin = Array.isArray(sr) && typeof sr[0] === "number" ? sr[0] : 1;
2861
+ const sMax = Array.isArray(sr) && typeof sr[1] === "number" ? sr[1] : 1;
2862
+ const randomRotation = (() => {
2863
+ const rr = props.random_rotation ?? props.randomRotation ?? scatterNode?.random_rotation;
2864
+ return rr === true;
2865
+ })();
2866
+ const seed = typeof proc.seed === "number" ? proc.seed : 1337;
2867
+ const rand = chunkHCX4SMFK_cjs.mulberry32(seed);
2868
+ const halfX = bx / 2;
2869
+ const halfZ = bz / 2;
2870
+ const minDistSq = minDistance * minDistance;
2871
+ const transforms = [];
2872
+ const maxAttempts = count * 30;
2873
+ let attempts = 0;
2874
+ while (transforms.length < count && attempts < maxAttempts) {
2875
+ attempts++;
2876
+ const x = (rand() * 2 - 1) * halfX;
2877
+ const z = (rand() * 2 - 1) * halfZ;
2878
+ if (minDistSq > 0) {
2879
+ let tooClose = false;
2880
+ for (const t of transforms) {
2881
+ const dx = t[0] - x;
2882
+ const dz = t[2] - z;
2883
+ if (dx * dx + dz * dz < minDistSq) {
2884
+ tooClose = true;
2885
+ break;
2886
+ }
2887
+ }
2888
+ if (tooClose) continue;
2889
+ }
2890
+ const ry = randomRotation ? rand() * Math.PI * 2 : 0;
2891
+ const scale = sMin + rand() * (sMax - sMin);
2892
+ transforms.push([x, 0, z, ry, scale]);
2893
+ }
2894
+ if (transforms.length < 1) return null;
2895
+ const materialProps = {};
2896
+ if (props.color != null) materialProps.color = props.color;
2897
+ if (props.roughness != null) materialProps.roughness = props.roughness;
2898
+ if (props.metalness != null) materialProps.metalness = props.metalness;
2899
+ if (props.emissive != null) materialProps.emissive = props.emissive;
2900
+ if (props.material != null) materialProps.material = props.material;
2901
+ return this.createNode(
2902
+ "scatter",
2903
+ {
2904
+ transforms,
2905
+ count: transforms.length,
2906
+ sourceMesh,
2907
+ hsType,
2908
+ ...materialProps
2909
+ },
2910
+ block.name
2911
+ );
2912
+ }
2913
+ /**
2914
+ * I.007 closure: emit a node's compiled petal material spec into its props.
2915
+ * Shared by every trait-bearing compile path (compileNode directives + the
2916
+ * .holo compileObjectDecl obj.traits path) so the emission can't silently miss
2917
+ * the real parser route. The spec is the locked CompiledMaterialSpec shape that
2918
+ * the renderer's buildCompiledMaterial consumes — building the petal material
2919
+ * from `.holo` data instead of hand-authoring it.
2920
+ */
2921
+ emitCompiledLotusMaterial(props, config) {
2922
+ const profile = chunkENZCIQZC_cjs.createBotanicalLotusRenderProfile(config);
2923
+ props.__compiledMaterial = chunkENZCIQZC_cjs.buildLotusPetalMaterialSpec(profile);
2924
+ props.__uniformBindings = chunkENZCIQZC_cjs.LOTUS_PETAL_UNIFORM_BINDINGS;
2925
+ props.__petalGeometry = chunkENZCIQZC_cjs.buildLotusPetalGeometryData(
2926
+ chunkENZCIQZC_cjs.lotusPetalGeometryParamsFromProfile(profile)
2927
+ );
2928
+ props.__petalPlacements = chunkENZCIQZC_cjs.buildLotusFlowerPlacements(profile);
2929
+ const scaffold = chunkENZCIQZC_cjs.buildLotusSceneScaffold();
2930
+ props.__lotusScene = {
2931
+ stemHeight: scaffold.stem.height,
2932
+ scaffold,
2933
+ colors: {
2934
+ water: profile.colors.water,
2935
+ leaf: profile.colors.leaf,
2936
+ leafDark: profile.colors.leaf_dark
2937
+ },
2938
+ // The flower CENTRE: the seed pod (receptacle) ringed by stamen filaments —
2939
+ // the iconic lotus centre, colours + count from the profile.
2940
+ center: {
2941
+ seedPod: profile.colors.seed_pod,
2942
+ seedPodRim: profile.colors.seed_pod_rim,
2943
+ stamen: profile.colors.stamen,
2944
+ stamenTip: profile.colors.stamen_tip,
2945
+ stamenCount: profile.stamen_filament_count,
2946
+ // Carpel layout for the flat-topped "shower-head" seed pod, parsed from the
2947
+ // profile's declared dot pattern (e.g. '1_center_7_12_18_radial' → [1,7,12,18]
2948
+ // = 1 central carpel + radial rings of 7, 12, 18). The renderer recesses a
2949
+ // carpel well per entry — the iconic lotus receptacle, compiled from `.holo`.
2950
+ carpelRings: (profile.seed_pod_dot_pattern?.match(/\d+/g) ?? [
2951
+ "1",
2952
+ "7",
2953
+ "12",
2954
+ "18"
2955
+ ]).map(Number)
2956
+ }
2957
+ };
2958
+ const waterColor = profile.colors.water;
2959
+ const leafColor = profile.colors.leaf;
2960
+ const leafDarkColor = profile.colors.leaf_dark;
2961
+ const stemHeight = scaffold.stem.height;
2962
+ const scaffoldNodes = [
2963
+ this.createNode("mesh", {
2964
+ hsType: "plane",
2965
+ width: scaffold.waterSize,
2966
+ height: scaffold.waterSize,
2967
+ rotation: [-Math.PI / 2, 0, 0],
2968
+ color: waterColor,
2969
+ roughness: 0.22,
2970
+ metalness: 0.5,
2971
+ // Mark the pond as a REFLECTIVE surface — the renderer's generic MeshNode draws
2972
+ // it with a mirror material so the flower + pads reflect (a real water read).
2973
+ reflective: true
2974
+ }),
2975
+ ...scaffold.pads.map(
2976
+ (pad, padIdx) => this.createNode("mesh", {
2977
+ hsType: "lilypad",
2978
+ radius: pad.radius,
2979
+ // Per-pad notch width variation so the pads don't look stamped.
2980
+ notchAngle: 0.48 + padIdx % 3 * 0.07,
2981
+ position: pad.pos,
2982
+ rotation: [-Math.PI / 2, 0, pad.rotation],
2983
+ color: pad.dark ? leafDarkColor : leafColor,
2984
+ roughness: 0.85
2985
+ })
2986
+ )
2987
+ ];
2988
+ const stemNode = this.createNode("group", {
2989
+ __animatedTransform: [
2990
+ { prop: "scaleY", target: "developmentalTime", edge0: 0, edge1: 0.42, from: 1e-3, to: 1 },
2991
+ {
2992
+ prop: "posY",
2993
+ target: "developmentalTime",
2994
+ edge0: 0,
2995
+ edge1: 0.42,
2996
+ from: 0,
2997
+ to: stemHeight / 2
2998
+ }
2999
+ ]
3000
+ });
3001
+ stemNode.children = [
3002
+ this.createNode("mesh", {
3003
+ hsType: "cylinder",
3004
+ radiusTop: scaffold.stem.topRadius,
3005
+ radiusBottom: scaffold.stem.bottomRadius,
3006
+ height: stemHeight,
3007
+ color: leafDarkColor,
3008
+ roughness: 0.7
3009
+ })
3010
+ ];
3011
+ scaffoldNodes.push(stemNode);
3012
+ scaffold.leaves.forEach((lf, i) => {
3013
+ const leafNode = this.createNode("group", {
3014
+ position: lf.pos,
3015
+ __animatedTransform: [
3016
+ {
3017
+ prop: "scaleUniform",
3018
+ target: "developmentalTime",
3019
+ edge0: 0.15 + i * 0.08,
3020
+ edge1: 0.55 + i * 0.08,
3021
+ from: 0,
3022
+ to: 1
3023
+ }
3024
+ ]
3025
+ });
3026
+ leafNode.children = [
3027
+ this.createNode("mesh", {
3028
+ hsType: "cylinder",
3029
+ radiusTop: 0.03,
3030
+ radiusBottom: 0.045,
3031
+ height: lf.height,
3032
+ position: [0, lf.height / 2, 0],
3033
+ color: leafDarkColor,
3034
+ roughness: 0.7
3035
+ }),
3036
+ this.createNode("mesh", {
3037
+ hsType: "circle",
3038
+ radius: lf.radius,
3039
+ position: [0, lf.height, 0],
3040
+ rotation: [-Math.PI / 2 + lf.tilt, 0, lf.rotation],
3041
+ color: lf.dark ? leafDarkColor : leafColor,
3042
+ roughness: 0.8
3043
+ })
3044
+ ];
3045
+ scaffoldNodes.push(leafNode);
3046
+ });
3047
+ props.__scaffoldNodes = scaffoldNodes;
3048
+ }
3049
+ compileNode(node) {
3050
+ if (node.type === "system") {
3051
+ return this.compileSystemNode(node);
3052
+ }
3053
+ if (node.type === "component") {
3054
+ return this.compileComponentNode(node);
3055
+ }
3056
+ if (node.type === "timeline") {
3057
+ return this.compileHsplusTimelineNode(node);
3058
+ }
3059
+ const rawProps = node.properties || {};
3060
+ const type = this.mapType(node.type, rawProps);
3061
+ const r3fNode = sceneIRNodePool.acquire();
3062
+ r3fNode.type = type;
3063
+ const rawId = node.id || node.name;
3064
+ r3fNode.id = rawId ? chunkZK7KX5CD_cjs.escapeStringValue(rawId, "JSX") : void 0;
3065
+ r3fNode.props = this.compileProperties(node, rawProps);
3066
+ r3fNode.children = [];
3067
+ r3fNode.traits = /* @__PURE__ */ new Map();
3068
+ r3fNode.directives = node.directives || [];
3069
+ if (node.directives) {
3070
+ for (const directive of node.directives) {
3071
+ if (directive.type === "trait") {
3072
+ r3fNode.traits?.set(
3073
+ directive.name,
3074
+ directive.config
3075
+ );
3076
+ }
3077
+ }
3078
+ }
3079
+ const lotusConfig = r3fNode.traits?.get("botanical_lotus");
3080
+ if (lotusConfig) {
3081
+ this.emitCompiledLotusMaterial(r3fNode.props, lotusConfig);
3082
+ }
3083
+ const enhanced = node;
3084
+ if (enhanced.graphics) {
3085
+ this.applyGraphicsConfig(r3fNode, enhanced.graphics);
3086
+ }
3087
+ if (enhanced.children && Array.isArray(enhanced.children)) {
3088
+ r3fNode.children = enhanced.children.map(
3089
+ (child) => this.compileNode(child)
3090
+ );
3091
+ }
3092
+ return r3fNode;
3093
+ }
3094
+ // ─── HoloComposition Compilation (.holo files) ────────────────────────
3095
+ compileComposition(composition, agentToken, outputPath) {
3096
+ this.validateCompilerAccess(agentToken, outputPath);
3097
+ if (this._platformTarget) {
3098
+ const platformMixin = new chunkTZCFKZ6Z_cjs.PlatformConditionalCompilerMixin();
3099
+ composition = platformMixin.filterForPlatform(composition, this._platformTarget);
3100
+ }
3101
+ const root = sceneIRNodePool.acquire();
3102
+ root.type = "group";
3103
+ root.id = composition.name ? chunkZK7KX5CD_cjs.escapeStringValue(composition.name, "JSX") : void 0;
3104
+ root.props = {};
3105
+ root.children = [];
3106
+ root.traits = /* @__PURE__ */ new Map();
3107
+ root.directives = [];
3108
+ const templateMap = /* @__PURE__ */ new Map();
3109
+ if (Array.isArray(composition.templates)) {
3110
+ for (const tmpl of composition.templates) {
3111
+ templateMap.set(tmpl.name, tmpl);
3112
+ }
3113
+ }
3114
+ if (composition.children && Array.isArray(composition.children)) {
3115
+ for (const child of composition.children) {
3116
+ if (child.type === "template" && child.name) {
3117
+ templateMap.set(child.name, child);
3118
+ }
3119
+ }
3120
+ for (const child of composition.children) {
3121
+ root.children.push(this.compileChildNode(child, templateMap));
3122
+ }
3123
+ }
3124
+ if (composition.environment) {
3125
+ root.children.push(
3126
+ ...this.compileEnvironmentBlock(
3127
+ composition.environment
3128
+ )
3129
+ );
3130
+ }
3131
+ if (Array.isArray(composition.lights)) {
3132
+ for (const light of composition.lights) {
3133
+ root.children.push(this.compileLightBlock(light));
3134
+ }
3135
+ }
3136
+ if (Array.isArray(composition.objects)) {
3137
+ for (const obj of composition.objects) {
3138
+ root.children.push(this.compileObjectDecl(obj, templateMap));
3139
+ }
3140
+ }
3141
+ if (Array.isArray(composition.spatialGroups)) {
3142
+ for (const group of composition.spatialGroups) {
3143
+ root.children.push(this.compileSpatialGroup(group, templateMap));
3144
+ }
3145
+ }
3146
+ if (Array.isArray(composition.timelines)) {
3147
+ for (const timeline of composition.timelines) {
3148
+ root.children.push(
3149
+ this.compileTimelineBlock(timeline)
3150
+ );
3151
+ }
3152
+ }
3153
+ if (Array.isArray(composition.audio)) {
3154
+ for (const audio of composition.audio) {
3155
+ root.children.push(this.compileAudioBlock(audio));
3156
+ }
3157
+ }
3158
+ if (Array.isArray(composition.zones)) {
3159
+ for (const zone of composition.zones) {
3160
+ root.children.push(this.compileZoneBlock(zone));
3161
+ }
3162
+ }
3163
+ if (Array.isArray(composition.worlds)) {
3164
+ for (const world of composition.worlds) {
3165
+ root.children.push(
3166
+ ...this.compileWorldNode(
3167
+ world,
3168
+ templateMap
3169
+ )
3170
+ );
3171
+ }
3172
+ }
3173
+ if (composition.ui) {
3174
+ root.children.push(
3175
+ this.compileUIBlock(composition.ui)
3176
+ );
3177
+ }
3178
+ if (Array.isArray(composition.transitions)) {
3179
+ for (const transition of composition.transitions) {
3180
+ root.children.push(
3181
+ this.compileTransitionBlock(transition)
3182
+ );
3183
+ }
3184
+ }
3185
+ if (Array.isArray(composition.conditionals)) {
3186
+ for (const cond of composition.conditionals) {
3187
+ root.children.push(this.compileConditionalBlock(cond, templateMap));
3188
+ }
3189
+ }
3190
+ if (Array.isArray(composition.iterators)) {
3191
+ for (const iter of composition.iterators) {
3192
+ root.children.push(this.compileForEachBlock(iter, templateMap));
3193
+ }
3194
+ }
3195
+ if (composition.camera) {
3196
+ root.children.push(
3197
+ this.compileCameraBlock(composition.camera)
3198
+ );
3199
+ }
3200
+ if (composition.effects) {
3201
+ root.children.unshift(
3202
+ this.compileEffectsBlock(composition.effects)
3203
+ );
3204
+ } else if (this.hasPostProcessing(root)) {
3205
+ root.children.unshift({
3206
+ type: "EffectComposer",
3207
+ props: {},
3208
+ children: this.extractPostProcessingNodes(root)
3209
+ });
3210
+ }
3211
+ const domainBlocks = composition.domainBlocks ?? [];
3212
+ for (const block of domainBlocks) {
3213
+ const kw = (block.keyword ?? "").toLowerCase();
3214
+ const isProcedural = block.domain === "procedural" || kw === "scatter" || kw === "procedural" || kw === "generate" || kw === "distribute" || kw === "pcg_graph";
3215
+ if (!isProcedural) continue;
3216
+ const node = this.compileProceduralScatterNode(block);
3217
+ if (node) root.children.push(node);
3218
+ }
3219
+ this.injectHolomapPointCloud(root);
3220
+ this.injectDefaultLighting(root);
3221
+ return root;
3222
+ }
3223
+ /** R3F host apps can map this node to BufferGeometry + pointsMaterial from base64 buffers. */
3224
+ injectHolomapPointCloud(root) {
3225
+ const h = this._holomapPointCloud;
3226
+ if (!h || h.pointCount < 1 || !h.positionsB64 || !h.colorsB64) return;
3227
+ if (!root.children) root.children = [];
3228
+ root.children.push({
3229
+ type: "holomapPointCloud",
3230
+ props: {
3231
+ positionsB64: h.positionsB64,
3232
+ colorsB64: h.colorsB64,
3233
+ pointCount: h.pointCount
3234
+ }
3235
+ });
3236
+ }
3237
+ compileLightBlock(light) {
3238
+ const lightMapping = {
3239
+ directional: "directionalLight",
3240
+ point: "pointLight",
3241
+ spot: "spotLight",
3242
+ hemisphere: "hemisphereLight",
3243
+ ambient: "ambientLight",
3244
+ area: "rectAreaLight"
3245
+ };
3246
+ const type = lightMapping[light.lightType] || "directionalLight";
3247
+ const props = {};
3248
+ if (Array.isArray(light.properties)) {
3249
+ for (const prop of light.properties) {
3250
+ const key = prop.key;
3251
+ const value = prop.value;
3252
+ if (key === "cast_shadow" || key === "castShadow") {
3253
+ props.castShadow = value;
3254
+ } else if (key === "ground_color" || key === "groundColor") {
3255
+ props.groundColor = value;
3256
+ } else if (key === "shadow_map_size") {
3257
+ props["shadow-mapSize"] = Array.isArray(value) ? value : [value, value];
3258
+ } else {
3259
+ props[key] = value;
3260
+ }
3261
+ }
3262
+ }
3263
+ if ((light.lightType === "directional" || light.lightType === "spot") && props.castShadow === void 0) {
3264
+ props.castShadow = true;
3265
+ }
3266
+ const r3fNode = sceneIRNodePool.acquire();
3267
+ r3fNode.type = type;
3268
+ r3fNode.id = light.name ? chunkZK7KX5CD_cjs.escapeStringValue(light.name, "JSX") : void 0;
3269
+ r3fNode.props = props;
3270
+ r3fNode.children = [];
3271
+ r3fNode.traits = /* @__PURE__ */ new Map();
3272
+ r3fNode.directives = [];
3273
+ return r3fNode;
3274
+ }
3275
+ compileEffectsBlock(effects) {
3276
+ const children = [];
3277
+ if (Array.isArray(effects.effects)) {
3278
+ for (const effect of effects.effects) {
3279
+ const effectMapping = {
3280
+ bloom: "Bloom",
3281
+ ssao: "SSAO",
3282
+ vignette: "Vignette",
3283
+ dof: "DepthOfField",
3284
+ chromatic_aberration: "ChromaticAberration",
3285
+ tone_mapping: "ToneMapping",
3286
+ noise: "Noise"
3287
+ };
3288
+ const effectType = effect.effectType;
3289
+ const type = effectMapping[effectType] || effectType;
3290
+ children.push(
3291
+ this.createNode(type, { ...effect.properties || {} })
3292
+ );
3293
+ }
3294
+ }
3295
+ const composer = this.createNode("EffectComposer", {});
3296
+ composer.children = children;
3297
+ return composer;
3298
+ }
3299
+ compileCameraBlock(camera) {
3300
+ const props = {};
3301
+ if (Array.isArray(camera.properties)) {
3302
+ for (const prop of camera.properties) {
3303
+ if (prop.key === "field_of_view" || prop.key === "fov") {
3304
+ props.fov = prop.value;
3305
+ } else if (prop.key === "look_at" || prop.key === "lookAt") {
3306
+ props.lookAt = prop.value;
3307
+ } else {
3308
+ props[prop.key] = prop.value;
3309
+ }
3310
+ }
3311
+ }
3312
+ props.cameraType = camera.cameraType;
3313
+ return this.createNode("Camera", props, "__camera");
3314
+ }
3315
+ compileEnvironmentBlock(env) {
3316
+ const nodes = [];
3317
+ const envProps = {};
3318
+ if (env.properties) {
3319
+ for (const prop of env.properties) {
3320
+ envProps[prop.key] = prop.value;
3321
+ }
3322
+ }
3323
+ const presetName = envProps.skybox || envProps.preset;
3324
+ if (presetName) {
3325
+ const preset = ENVIRONMENT_PRESETS[presetName];
3326
+ if (preset) {
3327
+ nodes.push(
3328
+ this.createNode("Environment", {
3329
+ background: true,
3330
+ preset: preset.envPreset || presetName
3331
+ })
3332
+ );
3333
+ const lighting = preset.lighting;
3334
+ if (lighting?.ambient) {
3335
+ nodes.push(
3336
+ this.createNode("ambientLight", {
3337
+ color: lighting.ambient.color,
3338
+ intensity: lighting.ambient.intensity
3339
+ })
3340
+ );
3341
+ }
3342
+ if (lighting?.directional) {
3343
+ const dl = lighting.directional;
3344
+ nodes.push(
3345
+ this.createNode("directionalLight", {
3346
+ color: dl.color,
3347
+ intensity: dl.intensity,
3348
+ position: dl.position,
3349
+ castShadow: dl.shadows !== false,
3350
+ "shadow-mapSize": [2048, 2048]
3351
+ })
3352
+ );
3353
+ }
3354
+ if (Array.isArray(lighting?.points)) {
3355
+ for (const pl of lighting.points) {
3356
+ nodes.push(
3357
+ this.createNode("pointLight", {
3358
+ color: pl.color,
3359
+ intensity: pl.intensity,
3360
+ position: pl.position,
3361
+ distance: pl.distance
3362
+ })
3363
+ );
3364
+ }
3365
+ }
3366
+ const presetMap = preset;
3367
+ if (presetMap.fog) {
3368
+ const fogMap = presetMap.fog;
3369
+ nodes.push(
3370
+ this.createNode("fog", {
3371
+ attach: "fog",
3372
+ color: fogMap.color,
3373
+ near: fogMap.near,
3374
+ far: fogMap.far
3375
+ })
3376
+ );
3377
+ }
3378
+ if (presetMap.ground) {
3379
+ const groundMap = presetMap.ground;
3380
+ nodes.push(
3381
+ this.createNode(
3382
+ "mesh",
3383
+ {
3384
+ hsType: "plane",
3385
+ rotation: [-Math.PI / 2, 0, 0],
3386
+ position: [0, -0.01, 0],
3387
+ receiveShadow: true,
3388
+ args: [200, 200],
3389
+ color: groundMap.color,
3390
+ materialProps: { roughness: 0.8, metalness: 0 }
3391
+ },
3392
+ "__ground"
3393
+ )
3394
+ );
3395
+ }
3396
+ } else {
3397
+ nodes.push(this.createNode("Environment", { background: true, preset: presetName }));
3398
+ }
3399
+ }
3400
+ if (envProps.ambient_light !== void 0) {
3401
+ nodes.push(
3402
+ this.createNode("ambientLight", {
3403
+ intensity: typeof envProps.ambient_light === "number" ? envProps.ambient_light : 0.5
3404
+ })
3405
+ );
3406
+ }
3407
+ const explicitFog = envProps.fog;
3408
+ if (explicitFog && typeof explicitFog === "object") {
3409
+ nodes.push(
3410
+ this.createNode("fog", {
3411
+ attach: "fog",
3412
+ color: explicitFog.color || "#cccccc",
3413
+ near: explicitFog.near || 10,
3414
+ far: explicitFog.far || 100
3415
+ })
3416
+ );
3417
+ }
3418
+ return nodes;
3419
+ }
3420
+ compileObjectDecl(obj, templateMap) {
3421
+ const props = {};
3422
+ let geometryType = "cube";
3423
+ if (obj.template && templateMap) {
3424
+ const tmpl = templateMap.get(obj.template);
3425
+ if (tmpl) {
3426
+ const tmplTraits = tmpl.traits;
3427
+ if (tmplTraits && Array.isArray(tmplTraits)) {
3428
+ const existingTraitNames = new Set(
3429
+ (obj.traits || []).map(
3430
+ (t) => t.name
3431
+ )
3432
+ );
3433
+ obj.traits = [
3434
+ ...tmplTraits.filter(
3435
+ (t) => !existingTraitNames.has(t.name)
3436
+ ),
3437
+ ...obj.traits || []
3438
+ ];
3439
+ }
3440
+ const tmplProps = tmpl.properties;
3441
+ if (tmplProps && Array.isArray(tmplProps)) {
3442
+ const existingKeys = new Set(
3443
+ (obj.properties || []).map(
3444
+ (p) => p.key
3445
+ )
3446
+ );
3447
+ const mergedProps = tmplProps.filter((p) => !existingKeys.has(p.key)).map((p) => ({
3448
+ type: "ObjectProperty",
3449
+ key: p.key,
3450
+ value: p.value
3451
+ }));
3452
+ obj.properties = [...mergedProps, ...obj.properties || []];
3453
+ }
3454
+ }
3455
+ }
3456
+ if (obj.properties && Array.isArray(obj.properties)) {
3457
+ const expandedProperties = [];
3458
+ for (const p of obj.properties) {
3459
+ const prop = p;
3460
+ if (prop && prop.type === "spread") {
3461
+ const resolved = this.resolveSpreadArgument(
3462
+ prop.target || prop.argument,
3463
+ {
3464
+ templates: templateMap
3465
+ }
3466
+ );
3467
+ if (resolved && typeof resolved === "object" && !Array.isArray(resolved)) {
3468
+ for (const [key, value] of Object.entries(resolved)) {
3469
+ expandedProperties.push({ key, value });
3470
+ }
3471
+ } else if (Array.isArray(resolved)) {
3472
+ expandedProperties.push(...resolved);
3473
+ }
3474
+ } else {
3475
+ expandedProperties.push(prop);
3476
+ }
3477
+ }
3478
+ obj.properties = expandedProperties;
3479
+ }
3480
+ if (obj.properties) {
3481
+ for (const p of obj.properties) {
3482
+ const key = p.key;
3483
+ const value = p.value;
3484
+ if (key === "geometry" || key === "mesh") {
3485
+ geometryType = value;
3486
+ } else if (key === "type") {
3487
+ const valStr = value;
3488
+ if (["text", "sparkles", "portal", "audio"].includes(valStr)) {
3489
+ geometryType = valStr;
3490
+ } else if (["directional", "point", "spot", "hemisphere", "ambient", "area"].includes(valStr)) {
3491
+ geometryType = "light";
3492
+ props.lightType = valStr;
3493
+ } else {
3494
+ props[key] = value;
3495
+ }
3496
+ } else if (key === "light_type") {
3497
+ props.lightType = value;
3498
+ } else if (key === "position" && Array.isArray(value)) {
3499
+ props.position = value;
3500
+ } else if (key === "rotation" && Array.isArray(value)) {
3501
+ props.rotation = value;
3502
+ } else if (key === "scale") {
3503
+ props.scale = Array.isArray(value) ? value : [value, value, value];
3504
+ } else if (key === "color") {
3505
+ props.color = value;
3506
+ } else if (key === "src" || key === "model" || key === "source") {
3507
+ props.src = value;
3508
+ geometryType = "model";
3509
+ } else if (key === "text") {
3510
+ props.children = this.resolveValue(value);
3511
+ props.text = this.resolveValue(value);
3512
+ } else if (key === "font_size") {
3513
+ props.fontSize = value;
3514
+ } else if (key === "material") {
3515
+ const currentMaterialProps = props.materialProps || {};
3516
+ if (typeof value === "string" && MATERIAL_PRESETS[value]) {
3517
+ props.materialProps = { ...MATERIAL_PRESETS[value], ...currentMaterialProps };
3518
+ } else if (typeof value === "object" && value !== null) {
3519
+ const valObj = value;
3520
+ if (valObj.preset && typeof valObj.preset === "string" && MATERIAL_PRESETS[valObj.preset]) {
3521
+ const { preset: _, ...rest } = valObj;
3522
+ props.materialProps = {
3523
+ ...MATERIAL_PRESETS[valObj.preset],
3524
+ ...rest,
3525
+ ...currentMaterialProps
3526
+ };
3527
+ } else {
3528
+ props.materialProps = { ...currentMaterialProps, ...valObj };
3529
+ }
3530
+ }
3531
+ } else if (key === "roughness" || key === "metalness" || key === "metallic") {
3532
+ const mProps = props.materialProps || {};
3533
+ mProps[key === "metallic" ? "metalness" : key] = value;
3534
+ props.materialProps = mProps;
3535
+ } else if (key === "opacity") {
3536
+ const mProps = props.materialProps || {};
3537
+ mProps.opacity = value;
3538
+ mProps.transparent = value < 1;
3539
+ props.materialProps = mProps;
3540
+ } else if (key === "emissive") {
3541
+ props.materialProps = {
3542
+ ...props.materialProps || {},
3543
+ emissive: value
3544
+ };
3545
+ } else if (key === "emissiveIntensity" || key === "emissive_intensity") {
3546
+ props.materialProps = {
3547
+ ...props.materialProps || {},
3548
+ emissiveIntensity: value
3549
+ };
3550
+ } else if (key === "size") {
3551
+ if (Array.isArray(value)) {
3552
+ props.args = value;
3553
+ }
3554
+ props.size = value;
3555
+ } else if (key === "radius") {
3556
+ props.size = value * 2;
3557
+ } else if (key === "intensity") {
3558
+ props.intensity = value;
3559
+ } else if (key === "cast_shadow" || key === "castShadow") {
3560
+ props.castShadow = value;
3561
+ } else if (key === "receiveShadow" || key === "receive_shadow") {
3562
+ props.receiveShadow = value;
3563
+ } else if (key === "visible") {
3564
+ props[key] = value;
3565
+ } else if (key === "maturity") {
3566
+ props.maturityOverride = value;
3567
+ } else if (key === "promoteUrl" || key === "promote_url") {
3568
+ props.promoteUrl = value;
3569
+ } else if (key === "collisionShape" || key === "collision_shape") {
3570
+ props.collisionShape = value;
3571
+ } else {
3572
+ props[key] = this.resolveValue(value);
3573
+ }
3574
+ }
3575
+ }
3576
+ if (obj.traits && Array.isArray(obj.traits)) {
3577
+ const semiring = new chunkV6GXFSK7_cjs.ProvenanceSemiring();
3578
+ const physicsApplications = obj.traits.filter((t) => t.name === "physics" || t.name === "collidable").map((t) => {
3579
+ let baseConfig = t.config || {};
3580
+ if (t.name === "collidable" && !baseConfig.type)
3581
+ baseConfig = { ...baseConfig, type: "fixed" };
3582
+ if (t.name === "physics" && !baseConfig.type)
3583
+ baseConfig = { ...baseConfig, type: "dynamic" };
3584
+ return {
3585
+ name: t.name,
3586
+ config: baseConfig,
3587
+ context: obj.provenance?.context
3588
+ };
3589
+ });
3590
+ if (physicsApplications.length > 0) {
3591
+ const { config: mergedPhysics } = semiring.add(physicsApplications);
3592
+ props.rigidBody = { ...mergedPhysics };
3593
+ props.collider = { type: "auto" };
3594
+ if (props.rigidBody?.type === "fixed") {
3595
+ props.castShadow = true;
3596
+ props.receiveShadow = true;
3597
+ }
3598
+ }
3599
+ for (const trait of obj.traits) {
3600
+ const name = trait.name;
3601
+ if (name === "physics" || name === "collidable") {
3602
+ continue;
3603
+ } else if (name === "grabbable") {
3604
+ props.castShadow = true;
3605
+ props.grabbable = trait.config || true;
3606
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3607
+ if (!props.collider) props.collider = { type: "auto" };
3608
+ } else if (name === "hoverable") {
3609
+ props.hoverable = trait.config || true;
3610
+ } else if (name === "animated") {
3611
+ props.animated = trait.config || true;
3612
+ } else if (name === "positional" || name === "spatial_audio") {
3613
+ props.spatial = true;
3614
+ } else if (name === "gem_resonance") {
3615
+ props.gemResonance = gemResonanceConfig(trait.config);
3616
+ props.spatial = true;
3617
+ } else if (name === "shadow") {
3618
+ props.castShadow = true;
3619
+ if (trait.config?.mapSize)
3620
+ props["shadow-mapSize"] = [trait.config.mapSize, trait.config.mapSize];
3621
+ } else if (name === "material") {
3622
+ const presetName = trait.config?.preset;
3623
+ if (presetName && typeof presetName === "string" && MATERIAL_PRESETS[presetName]) {
3624
+ const { preset: _, ...rest } = trait.config;
3625
+ props.materialProps = {
3626
+ ...MATERIAL_PRESETS[presetName],
3627
+ ...rest,
3628
+ ...props.materialProps
3629
+ };
3630
+ } else {
3631
+ props.materialProps = {
3632
+ ...props.materialProps,
3633
+ ...trait.config
3634
+ };
3635
+ }
3636
+ } else if (name === "networked") {
3637
+ props.networked = trait.config || true;
3638
+ } else if (name === "moldable") {
3639
+ props.moldable = trait.config || true;
3640
+ } else if (name === "stretchable") {
3641
+ props.stretchable = trait.config || true;
3642
+ } else if (name === "bloom") {
3643
+ props.bloom = trait.config || { intensity: 1 };
3644
+ } else if (name === "portal") {
3645
+ props.portal = trait.config || true;
3646
+ } else if (name === "attach") {
3647
+ props.attach = trait.config || true;
3648
+ } else if (name === "orbit") {
3649
+ props.orbit = trait.config || true;
3650
+ } else if (name === "look_at") {
3651
+ props.lookAtTarget = trait.config || true;
3652
+ } else if (name === "follow") {
3653
+ props.follow = trait.config || true;
3654
+ } else if (name === "plane_detection") {
3655
+ props.planeDetection = trait.config || { mode: "all" };
3656
+ } else if (name === "mesh_detection") {
3657
+ props.meshDetection = trait.config || { classification: true };
3658
+ } else if (name === "anchor") {
3659
+ props.anchor = trait.config || { type: "spatial" };
3660
+ } else if (name === "persistent_anchor") {
3661
+ props.persistentAnchor = trait.config || { storage: "local" };
3662
+ } else if (name === "shared_anchor") {
3663
+ props.sharedAnchor = trait.config || { authority: "creator" };
3664
+ } else if (name === "occlusion") {
3665
+ props.occlusionMode = trait.config?.mode || "environment";
3666
+ props.occlusion = trait.config || true;
3667
+ } else if (name === "light_estimation") {
3668
+ props.lightEstimation = trait.config || { auto_apply: true };
3669
+ } else if (name === "geospatial") {
3670
+ props.geospatial = trait.config || true;
3671
+ } else if (name === "gaussian_splat") {
3672
+ props.gaussianSplat = trait.config || true;
3673
+ } else if (name === "nerf") {
3674
+ props.nerf = trait.config || true;
3675
+ } else if (name === "volumetric_video") {
3676
+ props.volumetricVideo = trait.config || true;
3677
+ } else if (name === "point_cloud") {
3678
+ props.pointCloud = trait.config || true;
3679
+ } else if (name === "photogrammetry") {
3680
+ props.photogrammetry = trait.config || true;
3681
+ } else if (name === "web_surface") {
3682
+ props.webSurface = trait.config || true;
3683
+ } else if (name === "cloth") {
3684
+ props.cloth = trait.config || { stiffness: 0.8 };
3685
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3686
+ } else if (name === "fluid") {
3687
+ props.fluid = trait.config || { viscosity: 0.01 };
3688
+ props.__gapsComponents = props.__gapsComponents || [];
3689
+ props.__gapsComponents.push("FluidRenderer");
3690
+ } else if (name === "soft_body") {
3691
+ props.softBody = trait.config || { elasticity: 0.5 };
3692
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3693
+ } else if (name === "rope") {
3694
+ props.rope = trait.config || { segments: 20 };
3695
+ } else if (name === "chain") {
3696
+ props.chain = trait.config || { link_count: 20 };
3697
+ } else if (name === "wind") {
3698
+ props.wind = trait.config || { strength: 5 };
3699
+ } else if (name === "buoyancy") {
3700
+ props.buoyancy = trait.config || { water_level: 0 };
3701
+ } else if (name === "destruction") {
3702
+ props.destruction = trait.config || { health: 100 };
3703
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3704
+ if (!props.collider) props.collider = { type: "auto" };
3705
+ } else if (name === "soft_body_pro") {
3706
+ props.softBodyPro = trait.config || { tear_threshold: 0.5 };
3707
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
3708
+ } else if (name === "crowd_sim") {
3709
+ props.crowdSim = trait.config || { max_agents: 1e3 };
3710
+ } else if (name === "deformable_terrain") {
3711
+ props.deformableTerrain = trait.config || { resolution: 256 };
3712
+ } else if (name === "volumetric_clouds") {
3713
+ props.volumetricClouds = trait.config || { coverage: 0.5 };
3714
+ props.__gapsComponents = props.__gapsComponents || [];
3715
+ props.__gapsComponents.push("CloudRenderer");
3716
+ } else if (name === "god_rays") {
3717
+ props.godRays = trait.config || { intensity: 1 };
3718
+ props.__gapsComponents = props.__gapsComponents || [];
3719
+ props.__gapsComponents.push("GodRaysEffect");
3720
+ } else if (name === "spatial_voice") {
3721
+ props.spatialVoice = trait.config || { max_distance: 30 };
3722
+ props.spatial = true;
3723
+ } else if (name === "ai_companion") {
3724
+ props.aiCompanion = trait.config || { personality: "friendly" };
3725
+ } else if (name === "moderation") {
3726
+ props.moderation = trait.config || { sensitivity: "medium" };
3727
+ } else if (name === "anti_grief") {
3728
+ props.antiGrief = trait.config || { detection_window: 30 };
3729
+ } else if (name === "world_state") {
3730
+ props.worldState = trait.config || { sync_rate: 10 };
3731
+ } else if (name === "token_gated") {
3732
+ props.tokenGated = trait.config || { token_contract: "", min_balance: 1 };
3733
+ } else if (name === "ambisonics") {
3734
+ props.ambisonics = trait.config || { order: 1 };
3735
+ props.spatial = true;
3736
+ } else if (name === "hrtf") {
3737
+ props.hrtf = trait.config || true;
3738
+ props.spatial = true;
3739
+ } else if (name === "reverb_zone") {
3740
+ props.reverbZone = trait.config || { preset: "room" };
3741
+ } else if (name === "audio_occlusion") {
3742
+ props.audioOcclusion = trait.config || true;
3743
+ } else if (name === "audio_portal") {
3744
+ props.audioPortal = trait.config || true;
3745
+ } else if (name === "head_tracked_audio") {
3746
+ props.headTrackedAudio = trait.config || true;
3747
+ props.spatial = true;
3748
+ } else if (name === "accessible") {
3749
+ props.accessible = trait.config || { role: "generic" };
3750
+ } else if (name === "alt_text") {
3751
+ props.altText = trait.config?.text || "";
3752
+ } else if (name === "magnifiable") {
3753
+ props.magnifiable = trait.config || { max_scale: 3 };
3754
+ } else if (name === "high_contrast") {
3755
+ props.highContrast = trait.config || { mode: "outline" };
3756
+ } else if (name === "perceptual_color") {
3757
+ props.perceptualColor = trait.config || true;
3758
+ } else if (name === "motion_reduced") {
3759
+ props.motionReduced = trait.config || true;
3760
+ if (props.animated) props.animated = false;
3761
+ } else if (name === "compute") {
3762
+ props.compute = trait.config || true;
3763
+ } else if (name === "gpu_particle") {
3764
+ props.gpuParticle = trait.config || { count: 1e4 };
3765
+ } else if (isVfxParticleTraitName(name)) {
3766
+ const particleConfig = {
3767
+ effect: vfxParticleEffect(name),
3768
+ ...trait.config || {}
3769
+ };
3770
+ const gpuParticles = props.gpuParticles ?? [];
3771
+ props.gpuParticles = [...gpuParticles, particleConfig];
3772
+ if (!props.gpuParticle) props.gpuParticle = particleConfig;
3773
+ } else if (name === "gpu_physics") {
3774
+ props.gpuPhysics = trait.config || true;
3775
+ } else if (name === "digital_twin") {
3776
+ props.digitalTwin = trait.config || true;
3777
+ } else if (name === "sensor") {
3778
+ props.sensor = trait.config || true;
3779
+ } else if (name === "data_binding") {
3780
+ props.dataBinding = trait.config || true;
3781
+ } else if (name === "behavior_tree") {
3782
+ props.behaviorTree = trait.config || true;
3783
+ } else if (name === "llm_agent") {
3784
+ props.llmAgent = trait.config || true;
3785
+ } else if (name === "neural_link") {
3786
+ props.neuralLink = trait.config || { model: "brittney-v4.gguf", temperature: 0.7 };
3787
+ } else if (name === "perception") {
3788
+ props.perception = trait.config || { sight_range: 20 };
3789
+ } else if (name === "patrol") {
3790
+ props.patrol = trait.config || true;
3791
+ } else if (name === "co_located") {
3792
+ props.coLocated = trait.config || true;
3793
+ } else if (name === "shared_world") {
3794
+ props.sharedWorld = trait.config || true;
3795
+ } else if (name === "voice_proximity") {
3796
+ props.voiceProximity = trait.config || { max_distance: 20 };
3797
+ props.spatial = true;
3798
+ } else if (name === "spatial_persona") {
3799
+ props.spatialPersona = trait.config || { style: "realistic" };
3800
+ } else if (name === "shareplay") {
3801
+ props.sharePlay = trait.config || { activity_type: "custom" };
3802
+ } else if (name === "object_tracking") {
3803
+ props.objectTracking = trait.config || true;
3804
+ } else if (name === "scene_reconstruction") {
3805
+ props.sceneReconstruction = trait.config || { mode: "mesh" };
3806
+ } else if (name === "eye_tracked") {
3807
+ props.eyeTracked = true;
3808
+ } else if (name === "eye_hand_fusion") {
3809
+ props.eyeHandFusion = true;
3810
+ } else if (name === "controlnet") {
3811
+ props.controlNet = trait.config || { model: "canny" };
3812
+ } else if (name === "ai_texture_gen") {
3813
+ props.aiTextureGen = trait.config || { style: "photorealistic" };
3814
+ } else if (name === "diffusion_realtime") {
3815
+ props.diffusionRealtime = trait.config || { backend: "cuda" };
3816
+ } else if (name === "ai_upscaling") {
3817
+ props.aiUpscaling = trait.config || { factor: 2 };
3818
+ } else if (name === "ai_inpainting") {
3819
+ props.aiInpainting = trait.config || true;
3820
+ } else if (name === "neural_forge") {
3821
+ props.neuralForge = trait.config || true;
3822
+ } else if (name === "embedding_search") {
3823
+ props.embeddingSearch = trait.config || { dimensions: 1536 };
3824
+ } else if (name === "ai_npc_brain") {
3825
+ props.aiNpcBrain = trait.config || { model: "llm" };
3826
+ } else if (name === "vector_db") {
3827
+ props.vectorDb = trait.config || true;
3828
+ } else if (name === "vision" || name === "ai_vision") {
3829
+ props.vision = trait.config || { task: "detection" };
3830
+ } else if (name === "spatial_awareness") {
3831
+ props.spatialAwareness = trait.config || true;
3832
+ } else if (name === "neural_animation") {
3833
+ props.neuralAnimation = trait.config || { style: "motion_matching" };
3834
+ } else if (name === "draft") {
3835
+ props.draftMode = true;
3836
+ props.draftShape = trait.config?.shape || "box";
3837
+ props.draftColor = trait.config?.color || "#88aaff";
3838
+ props.draftOpacity = trait.config?.opacity ?? 1;
3839
+ props.draftWireframe = trait.config?.wireframe || false;
3840
+ if (trait.config?.collision !== false) {
3841
+ if (!props.rigidBody) props.rigidBody = { type: "fixed" };
3842
+ if (!props.collider) props.collider = { type: "auto" };
3843
+ }
3844
+ } else if (name === "botanical_lotus") {
3845
+ this.emitCompiledLotusMaterial(props, trait.config || {});
3846
+ } else {
3847
+ props[name] = trait.config || true;
3848
+ if (!props.__unrecognizedTraits) {
3849
+ props.__unrecognizedTraits = [];
3850
+ }
3851
+ props.__unrecognizedTraits.push(name);
3852
+ }
3853
+ }
3854
+ }
3855
+ if (obj.traits && Array.isArray(obj.traits)) {
3856
+ const traitNames = obj.traits.map(
3857
+ (t) => t.name
3858
+ );
3859
+ const compositor = new chunkQQFB4RT2_cjs.TraitCompositor();
3860
+ const composedMaterial = compositor.compose(traitNames);
3861
+ if (Object.keys(composedMaterial).length > 0) {
3862
+ props.materialProps = {
3863
+ ...props.materialProps,
3864
+ ...composedMaterial
3865
+ };
3866
+ }
3867
+ }
3868
+ const perceptualTrait = Array.isArray(obj.traits) ? obj.traits.find((trait) => trait.name === "perceptual_color") : void 0;
3869
+ const perceptualTraitConfig = perceptualTrait ? perceptualTrait.config && typeof perceptualTrait.config === "object" ? perceptualTrait.config : {} : void 0;
3870
+ this.applyPerceptualColorProps(
3871
+ props,
3872
+ perceptualTraitConfig,
3873
+ this.isScientificColorNode(geometryType, props)
3874
+ );
3875
+ let type;
3876
+ if (geometryType === "model" && props.src) {
3877
+ type = "gltfModel";
3878
+ } else if (geometryType === "light") {
3879
+ const lightType = props.lightType || props.type || "directional";
3880
+ const lightMapping = {
3881
+ directional: "directionalLight",
3882
+ point: "pointLight",
3883
+ spot: "spotLight",
3884
+ hemisphere: "hemisphereLight",
3885
+ ambient: "ambientLight",
3886
+ area: "rectAreaLight"
3887
+ };
3888
+ type = lightMapping[lightType] || "directionalLight";
3889
+ delete props.lightType;
3890
+ } else if (geometryType === "text") {
3891
+ type = "Text";
3892
+ } else if (geometryType === "sparkles") {
3893
+ type = "Sparkles";
3894
+ } else if (geometryType === "portal") {
3895
+ type = "Portal";
3896
+ } else if (geometryType === "gaussian_splat" || geometryType === "splat" || props.gaussianSplat !== void 0) {
3897
+ type = "splat";
3898
+ } else {
3899
+ type = "mesh";
3900
+ props.hsType = geometryType;
3901
+ if (!props.args) {
3902
+ const size = typeof props.size === "number" ? props.size : 1;
3903
+ props.args = this.getGeometryArgs(geometryType, { size });
3904
+ }
3905
+ }
3906
+ const r3fNode = this.createNode(type, props, obj.name);
3907
+ if (props.draftMode) {
3908
+ r3fNode.assetMaturity = "draft";
3909
+ } else if (props.maturityOverride) {
3910
+ const m = props.maturityOverride;
3911
+ if (m === "draft" || m === "mesh" || m === "final") {
3912
+ r3fNode.assetMaturity = m;
3913
+ }
3914
+ }
3915
+ delete props.maturityOverride;
3916
+ if (obj.children && Array.isArray(obj.children)) {
3917
+ for (const child of obj.children) {
3918
+ r3fNode.children.push(this.compileObjectDecl(child));
3919
+ }
3920
+ }
3921
+ if (props.__gapsComponents && Array.isArray(props.__gapsComponents)) {
3922
+ for (const componentType of props.__gapsComponents) {
3923
+ const componentProps = {};
3924
+ if (componentType === "CloudRenderer" && props.volumetricClouds) {
3925
+ const vc = props.volumetricClouds;
3926
+ componentProps.coverage = vc.coverage ?? 0.5;
3927
+ componentProps.altitude = vc.altitude ?? 500;
3928
+ componentProps.windOffset = vc.wind ?? [0, 0, 0];
3929
+ componentProps.layers = vc.layers ?? 3;
3930
+ } else if (componentType === "GodRaysEffect" && props.godRays) {
3931
+ const gr = props.godRays;
3932
+ componentProps.intensity = gr.intensity ?? 1;
3933
+ componentProps.decay = gr.decay ?? 0.96;
3934
+ componentProps.lightColor = gr.color ?? "#fffde7";
3935
+ } else if (componentType === "FluidRenderer" && props.fluid) {
3936
+ const fl = props.fluid;
3937
+ componentProps.color = fl.color ?? "#1a6fc4";
3938
+ componentProps.particleSize = fl.particle_radius ?? 0.02;
3939
+ componentProps.renderMode = fl.render_mode ?? "points";
3940
+ }
3941
+ r3fNode.children.push(
3942
+ this.createNode(componentType, componentProps, `${obj.name}-${componentType}`)
3943
+ );
3944
+ }
3945
+ delete props.__gapsComponents;
3946
+ }
3947
+ return r3fNode;
3948
+ }
3949
+ /**
3950
+ * Compile a SystemNode into an R3FNode.
3951
+ *
3952
+ * Systems are logical containers with state, actions, lifecycle hooks,
3953
+ * and optionally child objects/UI. In the R3F tree, a system compiles
3954
+ * to a group node annotated with its rich metadata (state, actions,
3955
+ * hooks) so the runtime/renderer can wire up behavior.
3956
+ */
3957
+ compileSystemNode(node, templateMap) {
3958
+ const props = {};
3959
+ if (node.state) {
3960
+ props.systemState = node.state;
3961
+ }
3962
+ if (node.actions) {
3963
+ props.systemActions = node.actions;
3964
+ }
3965
+ if (node.hooks) {
3966
+ props.systemHooks = node.hooks;
3967
+ }
3968
+ if (node.properties && typeof node.properties === "object") {
3969
+ for (const [key, value] of Object.entries(node.properties)) {
3970
+ props[key] = value;
3971
+ }
3972
+ }
3973
+ const r3fNode = this.createNode("System", props, node.id || node.name);
3974
+ if (node.directives) {
3975
+ r3fNode.directives = node.directives;
3976
+ }
3977
+ if (node.directives) {
3978
+ for (const d of node.directives) {
3979
+ if (d.type === "trait") {
3980
+ r3fNode.traits?.set(d.name, d.config || {});
3981
+ }
3982
+ }
3983
+ }
3984
+ if (node.children && Array.isArray(node.children)) {
3985
+ for (const child of node.children) {
3986
+ r3fNode.children.push(this.compileChildNode(child, templateMap));
3987
+ }
3988
+ }
3989
+ if (node.ui && Array.isArray(node.ui)) {
3990
+ for (const uiNode of node.ui) {
3991
+ r3fNode.children.push(this.compileNode(uiNode));
3992
+ }
3993
+ }
3994
+ return r3fNode;
3995
+ }
3996
+ /**
3997
+ * Compile a ComponentNode into an R3FNode.
3998
+ *
3999
+ * Components are UI-focused containers with props, state, actions,
4000
+ * and render/UI blocks. They compile to a group node annotated with
4001
+ * component metadata for the runtime.
4002
+ */
4003
+ compileComponentNode(node, templateMap) {
4004
+ const props = {};
4005
+ if (node.props) {
4006
+ props.componentProps = node.props;
4007
+ }
4008
+ if (node.state) {
4009
+ props.componentState = node.state;
4010
+ }
4011
+ if (node.actions) {
4012
+ props.componentActions = node.actions;
4013
+ }
4014
+ if (node.hooks) {
4015
+ props.componentHooks = node.hooks;
4016
+ }
4017
+ if (node.properties && typeof node.properties === "object") {
4018
+ for (const [key, value] of Object.entries(node.properties)) {
4019
+ props[key] = value;
4020
+ }
4021
+ }
4022
+ const r3fNode = this.createNode(
4023
+ "Component",
4024
+ props,
4025
+ node.id || node.name
4026
+ );
4027
+ if (node.directives) {
4028
+ r3fNode.directives = node.directives;
4029
+ }
4030
+ if (node.directives) {
4031
+ for (const d of node.directives) {
4032
+ if (d.type === "trait") {
4033
+ r3fNode.traits?.set(d.name, d.config || {});
4034
+ }
4035
+ }
4036
+ }
4037
+ if (node.children && Array.isArray(node.children)) {
4038
+ for (const child of node.children) {
4039
+ r3fNode.children.push(this.compileChildNode(child, templateMap));
4040
+ }
4041
+ }
4042
+ if (node.ui && Array.isArray(node.ui)) {
4043
+ for (const uiNode of node.ui) {
4044
+ r3fNode.children.push(this.compileNode(uiNode));
4045
+ }
4046
+ }
4047
+ return r3fNode;
4048
+ }
4049
+ /**
4050
+ * Dispatch a child node to the appropriate compile method based on its type.
4051
+ * Used by compileSystemNode, compileComponentNode, and compileComposition
4052
+ * when processing the parser's children array.
4053
+ */
4054
+ compileChildNode(child, templateMap) {
4055
+ switch (child.type) {
4056
+ case "system":
4057
+ return this.compileSystemNode(child, templateMap);
4058
+ case "component":
4059
+ return this.compileComponentNode(child, templateMap);
4060
+ case "object":
4061
+ return this.compileObjectDecl(child, templateMap);
4062
+ case "template":
4063
+ if (templateMap && typeof child.name === "string") {
4064
+ templateMap.set(child.name, child);
4065
+ }
4066
+ return this.compileTemplateNode(child, templateMap);
4067
+ case "spatial_group":
4068
+ return this.compileSpatialGroup(child, templateMap);
4069
+ default:
4070
+ return this.compileNode(child);
4071
+ }
4072
+ }
4073
+ /**
4074
+ * Compile a template node. Templates define reusable types.
4075
+ * In the R3F tree, they compile to an empty group (they're not
4076
+ * rendered directly — objects "using" them inherit their properties).
4077
+ */
4078
+ compileTemplateNode(node, _templateMap) {
4079
+ const props = {};
4080
+ if (node.state || node.properties?.state) {
4081
+ props.templateState = node.state || node.properties?.state;
4082
+ }
4083
+ if (node.properties) {
4084
+ for (const [key, value] of Object.entries(node.properties)) {
4085
+ if (key !== "state") {
4086
+ props[key] = value;
4087
+ }
4088
+ }
4089
+ }
4090
+ return this.createNode("Template", props, node.name);
4091
+ }
4092
+ compileSpatialGroup(group, templateMap) {
4093
+ const props = {};
4094
+ let staggerStep = 0;
4095
+ if (group.properties) {
4096
+ for (const prop of group.properties) {
4097
+ if (prop.key === "position") props.position = prop.value;
4098
+ else if (prop.key === "rotation") props.rotation = prop.value;
4099
+ else if (prop.key === "scale")
4100
+ props.scale = Array.isArray(prop.value) ? prop.value : [prop.value, prop.value, prop.value];
4101
+ else if (prop.key === "stagger") {
4102
+ const n = Number(prop.value);
4103
+ if (Number.isFinite(n)) {
4104
+ staggerStep = n;
4105
+ props.stagger = n;
4106
+ }
4107
+ }
4108
+ }
4109
+ }
4110
+ const node = this.createNode("group", props, group.name);
4111
+ if (group.objects) {
4112
+ for (const obj of group.objects)
4113
+ node.children.push(this.compileObjectDecl(obj, templateMap));
4114
+ }
4115
+ if (group.groups) {
4116
+ for (const sub of group.groups)
4117
+ node.children.push(this.compileSpatialGroup(sub, templateMap));
4118
+ }
4119
+ if (staggerStep && node.children) {
4120
+ const entranceTarget = `entrance_${String(group.name ?? "group").replace(
4121
+ /[^a-zA-Z0-9_]/g,
4122
+ "_"
4123
+ )}`;
4124
+ const synthesized = synthesizeEntranceChannels(
4125
+ node.children,
4126
+ entranceTarget
4127
+ );
4128
+ applyStaggerToChildren(node.children, staggerStep);
4129
+ if (synthesized > 0) {
4130
+ node.children.push(this.buildEntranceDriver(entranceTarget));
4131
+ }
4132
+ }
4133
+ return node;
4134
+ }
4135
+ /**
4136
+ * Build a hidden `Timeline` node that ramps `target` 0→1, played by the
4137
+ * existing `<TimelineDriver>`, so the synthesized `@animated` entrance channels
4138
+ * in a staggered group animate with no author-supplied timeline. (S3)
4139
+ */
4140
+ buildEntranceDriver(target) {
4141
+ const driver = this.createNode("Timeline", { autoplay: true, loop: false });
4142
+ driver.children = [
4143
+ this.createNode("TimelineEntry", {
4144
+ time: 0,
4145
+ actionKind: "animate",
4146
+ target,
4147
+ properties: { value: 0 }
4148
+ }),
4149
+ this.createNode("TimelineEntry", {
4150
+ time: 1,
4151
+ actionKind: "animate",
4152
+ target,
4153
+ properties: { value: 1 }
4154
+ })
4155
+ ];
4156
+ return driver;
4157
+ }
4158
+ compileTimelineBlock(timeline) {
4159
+ const entries = [];
4160
+ if (timeline.entries) {
4161
+ for (const entry of timeline.entries) {
4162
+ const action = entry.action;
4163
+ const entryProps = { time: entry.time, actionKind: action.kind };
4164
+ if (action.kind === "animate") {
4165
+ entryProps.target = action.target;
4166
+ entryProps.properties = action.properties;
4167
+ } else if (action.kind === "emit") {
4168
+ entryProps.event = action.event;
4169
+ if (action.data !== void 0) entryProps.data = action.data;
4170
+ } else if (action.kind === "call") {
4171
+ entryProps.method = action.method;
4172
+ if (action.args) entryProps.args = action.args;
4173
+ }
4174
+ entries.push(this.createNode("TimelineEntry", entryProps));
4175
+ }
4176
+ }
4177
+ const safeName = timeline.name ? chunkZK7KX5CD_cjs.escapeStringValue(timeline.name, "JSX") : void 0;
4178
+ const timelineNode = this.createNode(
4179
+ "Timeline",
4180
+ { autoplay: timeline.autoplay, loop: timeline.loop },
4181
+ safeName
4182
+ );
4183
+ timelineNode.children = entries;
4184
+ return timelineNode;
4185
+ }
4186
+ /**
4187
+ * Compile a `.hsplus` keyframe-track timeline (HoloScriptPlusParser shape:
4188
+ * `{ type:'timeline', children:[{ type:'track', target, keyframes:[{time,value,easing}] }] }`,
4189
+ * the Theatre.js harvest grammar) into the SAME `Timeline` + `TimelineEntry`
4190
+ * R3F shape the existing `<TimelineDriver>` already plays — one `TimelineEntry`
4191
+ * per keyframe, grouped by the track's target. The per-keyframe `easing` is
4192
+ * carried onto the entry so the driver can honor it (driver-side application is
4193
+ * the S4b slice; today the driver tweens with smoothstep). End-to-end: a
4194
+ * keyframe-track timeline now DRIVES `__animatedTransform` consumers.
4195
+ */
4196
+ compileHsplusTimelineNode(node) {
4197
+ const entries = [];
4198
+ const children = node.children || [];
4199
+ for (const track of children) {
4200
+ if (track.type !== "track") continue;
4201
+ const target = track.target;
4202
+ const keyframes = track.keyframes || [];
4203
+ for (const kf of keyframes) {
4204
+ const entryProps = {
4205
+ time: Number(kf.time),
4206
+ actionKind: "animate",
4207
+ target,
4208
+ properties: { value: this.resolveKeyframeValue(kf.value) }
4209
+ };
4210
+ if (typeof kf.easing === "string") entryProps.easing = kf.easing;
4211
+ entries.push(this.createNode("TimelineEntry", entryProps));
4212
+ }
4213
+ }
4214
+ const props = node.properties || {};
4215
+ const safeName = node.name ? chunkZK7KX5CD_cjs.escapeStringValue(node.name, "JSX") : void 0;
4216
+ const timelineNode = this.createNode(
4217
+ "Timeline",
4218
+ { autoplay: props.autoplay, loop: props.loop },
4219
+ safeName
4220
+ );
4221
+ timelineNode.children = entries;
4222
+ return timelineNode;
4223
+ }
4224
+ /** Resolve a keyframe value (a HoloScriptPlusParser `parseValue` result) to a
4225
+ * number — a bare number, a `{ value }` literal wrapper, or a coercible. */
4226
+ resolveKeyframeValue(v) {
4227
+ if (typeof v === "number") return v;
4228
+ if (v && typeof v === "object" && "value" in v) {
4229
+ const n2 = Number(v.value);
4230
+ return Number.isFinite(n2) ? n2 : 0;
4231
+ }
4232
+ const n = Number(v);
4233
+ return Number.isFinite(n) ? n : 0;
4234
+ }
4235
+ compileAudioBlock(audio) {
4236
+ const props = {};
4237
+ if (audio.properties) {
4238
+ for (const prop of audio.properties) {
4239
+ if (prop.key === "src" || prop.key === "source") {
4240
+ props.src = prop.value;
4241
+ } else if (prop.key === "rolloff") {
4242
+ props.rolloffFactor = prop.value;
4243
+ } else {
4244
+ props[prop.key] = prop.value;
4245
+ }
4246
+ }
4247
+ }
4248
+ const safeName = audio.name ? chunkZK7KX5CD_cjs.escapeStringValue(audio.name, "JSX") : void 0;
4249
+ return this.createNode("Audio", props, safeName);
4250
+ }
4251
+ compileZoneBlock(zone) {
4252
+ const props = {};
4253
+ if (zone.properties) {
4254
+ for (const prop of zone.properties) {
4255
+ props[prop.key] = prop.value;
4256
+ }
4257
+ }
4258
+ if (zone.handlers && zone.handlers.length > 0) {
4259
+ props.handlers = zone.handlers.map(
4260
+ (h) => ({
4261
+ event: h.event,
4262
+ parameters: h.parameters,
4263
+ body: h.body
4264
+ })
4265
+ );
4266
+ }
4267
+ const safeName = zone.name ? chunkZK7KX5CD_cjs.escapeStringValue(zone.name, "JSX") : void 0;
4268
+ return this.createNode("Zone", props, safeName);
4269
+ }
4270
+ compileUIBlock(ui) {
4271
+ const children = [];
4272
+ if (ui.elements) {
4273
+ for (const el of ui.elements) {
4274
+ const elProps = {};
4275
+ if (el.properties) {
4276
+ for (const prop of el.properties) {
4277
+ if (prop.key === "font_size") {
4278
+ elProps.fontSize = prop.value;
4279
+ } else {
4280
+ elProps[prop.key] = this.resolveValue(prop.value);
4281
+ }
4282
+ }
4283
+ }
4284
+ const safeElName = el.name ? chunkZK7KX5CD_cjs.escapeStringValue(el.name, "JSX") : void 0;
4285
+ children.push(this.createNode("UIElement", elProps, safeElName));
4286
+ }
4287
+ }
4288
+ const uiNode = this.createNode("UI", {}, "__ui");
4289
+ uiNode.children = children;
4290
+ return uiNode;
4291
+ }
4292
+ compileTransitionBlock(transition) {
4293
+ const props = {};
4294
+ if (transition.properties) {
4295
+ for (const prop of transition.properties) {
4296
+ props[prop.key] = prop.value;
4297
+ }
4298
+ }
4299
+ const safeName = transition.name ? chunkZK7KX5CD_cjs.escapeStringValue(transition.name, "JSX") : void 0;
4300
+ return this.createNode("Transition", props, safeName);
4301
+ }
4302
+ compileConditionalBlock(cond, templateMap) {
4303
+ const children = [];
4304
+ if (cond.objects) {
4305
+ for (const obj of cond.objects)
4306
+ children.push(this.compileObjectDecl(obj, templateMap));
4307
+ }
4308
+ if (cond.spatialGroups) {
4309
+ for (const g of cond.spatialGroups)
4310
+ children.push(this.compileSpatialGroup(g, templateMap));
4311
+ }
4312
+ const elseChildren = [];
4313
+ if (cond.elseObjects) {
4314
+ for (const obj of cond.elseObjects)
4315
+ elseChildren.push(this.compileObjectDecl(obj, templateMap));
4316
+ }
4317
+ if (cond.elseSpatialGroups) {
4318
+ for (const g of cond.elseSpatialGroups)
4319
+ elseChildren.push(this.compileSpatialGroup(g, templateMap));
4320
+ }
4321
+ const conditionalNode = this.createNode("ConditionalGroup", {
4322
+ condition: cond.condition,
4323
+ elseChildren: elseChildren.length > 0 ? elseChildren : void 0
4324
+ });
4325
+ conditionalNode.children = children;
4326
+ return conditionalNode;
4327
+ }
4328
+ compileForEachBlock(iter, templateMap) {
4329
+ const templateChildren = [];
4330
+ if (iter.objects) {
4331
+ for (const obj of iter.objects)
4332
+ templateChildren.push(this.compileObjectDecl(obj, templateMap));
4333
+ }
4334
+ if (iter.spatialGroups) {
4335
+ for (const g of iter.spatialGroups)
4336
+ templateChildren.push(this.compileSpatialGroup(g, templateMap));
4337
+ }
4338
+ const forEachNode = this.createNode("ForEachGroup", {
4339
+ variable: iter.variable,
4340
+ iterable: iter.iterable
4341
+ });
4342
+ forEachNode.children = templateChildren;
4343
+ return forEachNode;
4344
+ }
4345
+ /**
4346
+ * Resolve a property value, converting bind expressions into runtime-reactive markers.
4347
+ */
4348
+ resolveValue(value) {
4349
+ if (value && typeof value === "object" && value.__bind) {
4350
+ return {
4351
+ __bind: true,
4352
+ source: value.source,
4353
+ transform: value.transform
4354
+ };
4355
+ }
4356
+ return value;
4357
+ }
4358
+ // ─── Shared Helpers ───────────────────────────────────────────────────
4359
+ injectDefaultLighting(root) {
4360
+ if (!this._defaultLighting) return;
4361
+ if (!this.treeHasLights(root)) {
4362
+ const shadowSize = this.tierScales.shadowMapSize;
4363
+ root.children?.unshift(
4364
+ this.createNode("ambientLight", { intensity: 0.4, color: "#ffffff" }),
4365
+ this.createNode("directionalLight", {
4366
+ intensity: 1,
4367
+ position: [5, 10, 5],
4368
+ castShadow: true,
4369
+ "shadow-mapSize": [shadowSize, shadowSize],
4370
+ color: "#ffffff"
4371
+ })
4372
+ );
4373
+ }
4374
+ }
4375
+ treeHasLights(node) {
4376
+ if (node.type.toLowerCase().includes("light")) return true;
4377
+ return node.children?.some((c) => this.treeHasLights(c)) || false;
4378
+ }
4379
+ hasPostProcessing(node) {
4380
+ if (node.traits?.has("bloom") || node.traits?.has("postprocessing"))
4381
+ return true;
4382
+ if (node.props.bloom) return true;
4383
+ return node.children?.some((c) => this.hasPostProcessing(c)) || false;
4384
+ }
4385
+ extractPostProcessingNodes(node) {
4386
+ const effects = [];
4387
+ const ppTrait = node.traits?.get(
4388
+ "postprocessing"
4389
+ );
4390
+ if (ppTrait) {
4391
+ if (ppTrait.bloom)
4392
+ effects.push(this.createNode("Bloom", ppTrait.bloom));
4393
+ if (ppTrait.ssao)
4394
+ effects.push(this.createNode("SSAO", ppTrait.ssao));
4395
+ if (ppTrait.vignette)
4396
+ effects.push(this.createNode("Vignette", ppTrait.vignette));
4397
+ }
4398
+ if (node.props.bloom) {
4399
+ const bloom = node.props.bloom;
4400
+ const bloomProps = typeof bloom === "object" && bloom !== null ? bloom : { intensity: 1 };
4401
+ effects.push(this.createNode("Bloom", bloomProps));
4402
+ }
4403
+ node.children?.forEach((child) => effects.push(...this.extractPostProcessingNodes(child)));
4404
+ return effects;
4405
+ }
4406
+ mapType(type, props) {
4407
+ if (type === "environment") {
4408
+ if (props.name && typeof props.name === "string" && ENVIRONMENT_PRESETS[props.name]) {
4409
+ Object.assign(props, ENVIRONMENT_PRESETS[props.name]);
4410
+ }
4411
+ return "Environment";
4412
+ }
4413
+ if (type === "light") {
4414
+ const lightType = props.type || "directional";
4415
+ const lightMapping = {
4416
+ directional: "directionalLight",
4417
+ point: "pointLight",
4418
+ spot: "spotLight",
4419
+ hemisphere: "hemisphereLight",
4420
+ ambient: "ambientLight",
4421
+ area: "rectAreaLight"
4422
+ };
4423
+ return lightMapping[lightType] || "directionalLight";
4424
+ }
4425
+ if (type === "portal") return "Portal";
4426
+ if (type === "sparkles") return "Sparkles";
4427
+ if (MESH_TYPES.has(type)) {
4428
+ props.hsType = type;
4429
+ return "mesh";
4430
+ }
4431
+ const mapping = {
4432
+ ambient_light: "ambientLight",
4433
+ model: "gltfModel",
4434
+ audio: "positionalAudio",
4435
+ composition: "group",
4436
+ scale: "group",
4437
+ focus: "group",
4438
+ spatial_agent: "SpatialAgent",
4439
+ spatial_container: "group",
4440
+ ui_panel: "UIPanel",
4441
+ ui_text: "UIText",
4442
+ ui_button: "UIButton",
4443
+ ui_slider: "UISlider",
4444
+ ui_input: "UIInput",
4445
+ ui_image: "UIImage",
4446
+ ui_chart: "UIChart",
4447
+ ui_gauge: "UIGauge",
4448
+ ui_value: "UIValue",
4449
+ ui_status_indicator: "UIStatusIndicator",
4450
+ tool_slot: "ToolSlot",
4451
+ behavior: "group",
4452
+ system: "System",
4453
+ component: "Component",
4454
+ dna: "DNA",
4455
+ gaussian_splat: "splat",
4456
+ splat: "splat",
4457
+ nerf: "NeRF",
4458
+ volumetric_video: "VolumetricVideo",
4459
+ world: "group"
4460
+ };
4461
+ return mapping[type] || type;
4462
+ }
4463
+ applyPerceptualColorProps(props, traitConfig, scientific) {
4464
+ const input = this.resolvePerceptualColorInput(props, traitConfig, scientific);
4465
+ if (!input) return;
4466
+ const pass = chunkVHORVGCG_cjs.applyPerceptualColorPass(input);
4467
+ props.perceptualColor = pass;
4468
+ if (pass.palette) {
4469
+ props.palette = pass.palette.colors;
4470
+ }
4471
+ if (pass.gradient) {
4472
+ props.gradient = pass.gradient.stops;
4473
+ props.gradientColors = pass.gradient.colors;
4474
+ }
4475
+ if (pass.colorMap) {
4476
+ props.colorMap = pass.colorMap.name;
4477
+ props.colorMapColors = pass.colorMap.colors;
4478
+ delete props.color_map;
4479
+ }
4480
+ if (!props.color && pass.gradient?.colors[0]) {
4481
+ props.color = pass.gradient.colors[0];
4482
+ }
4483
+ const materialProps = props.materialProps && typeof props.materialProps === "object" ? props.materialProps : {};
4484
+ if (pass.gradient?.colors[0] && materialProps.color === void 0) {
4485
+ props.materialProps = { ...materialProps, color: pass.gradient.colors[0] };
4486
+ }
4487
+ }
4488
+ resolvePerceptualColorInput(props, traitConfig, scientific) {
4489
+ const palette = this.stringArray(props.palette) ?? this.stringArray(traitConfig?.palette);
4490
+ const gradient = this.gradientStops(props.gradient) ?? this.gradientStops(traitConfig?.gradient);
4491
+ const colorMap = this.colorMapValue(props.colorMap) ?? this.colorMapValue(props.color_map) ?? this.colorMapValue(traitConfig?.color_map) ?? this.colorMapValue(traitConfig?.colorMap);
4492
+ const hasColorInput = palette !== void 0 || gradient !== void 0 || colorMap !== void 0;
4493
+ if (!traitConfig && !(scientific && hasColorInput)) return void 0;
4494
+ const mode = typeof traitConfig?.mode === "string" ? traitConfig.mode : "auto";
4495
+ const base = {
4496
+ steps: this.numberValue(traitConfig?.steps) ?? this.numberValue(props.steps) ?? 7,
4497
+ dampening: this.numberValue(traitConfig?.dampening),
4498
+ targetDeltaE: this.numberValue(traitConfig?.target_delta_e) ?? this.numberValue(traitConfig?.targetDeltaE),
4499
+ neutralAxis: this.booleanValue(traitConfig?.neutral_axis) ?? this.booleanValue(traitConfig?.neutralAxis),
4500
+ scientific
4501
+ };
4502
+ if (mode === "palette") return { ...base, palette: palette ?? ["#1F77B4", "#FF7F0E"] };
4503
+ if (mode === "gradient") return { ...base, gradient: gradient ?? palette };
4504
+ if (mode === "color_map") return { ...base, colorMap: colorMap ?? "viridis" };
4505
+ if (colorMap !== void 0) return { ...base, colorMap };
4506
+ if (gradient !== void 0) return { ...base, gradient };
4507
+ if (palette !== void 0) return { ...base, palette };
4508
+ return { ...base, colorMap: "viridis" };
4509
+ }
4510
+ isScientificColorNode(type, props) {
4511
+ return type === "heatmap_view" || type === "heatmap" || type === "chart" || type === "graph" || type === "scatter_plot" || type === "line_graph" || props.scientific === true || props.color_map !== void 0 || props.colorMap !== void 0;
4512
+ }
4513
+ stringArray(value) {
4514
+ return Array.isArray(value) && value.every((entry) => typeof entry === "string") ? [...value] : void 0;
4515
+ }
4516
+ gradientStops(value) {
4517
+ const stringColors = this.stringArray(value);
4518
+ if (stringColors) return stringColors;
4519
+ if (!Array.isArray(value)) return void 0;
4520
+ const stops = [];
4521
+ for (const entry of value) {
4522
+ if (!entry || typeof entry !== "object") continue;
4523
+ const record = entry;
4524
+ if (typeof record.t === "number" && typeof record.color === "string") {
4525
+ stops.push({ t: record.t, color: record.color });
4526
+ }
4527
+ }
4528
+ return stops.length > 0 ? stops : void 0;
4529
+ }
4530
+ colorMapValue(value) {
4531
+ if (typeof value === "string") return value;
4532
+ return this.gradientStops(value) ?? this.stringArray(value);
4533
+ }
4534
+ numberValue(value) {
4535
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
4536
+ }
4537
+ booleanValue(value) {
4538
+ return typeof value === "boolean" ? value : void 0;
4539
+ }
4540
+ compileProperties(node, rawProps) {
4541
+ const expandedProps = this.expandSpreads(rawProps);
4542
+ const props = { ...expandedProps };
4543
+ if (node.position) {
4544
+ props.position = node.position;
4545
+ }
4546
+ if (rawProps.position && Array.isArray(rawProps.position)) {
4547
+ props.position = rawProps.position;
4548
+ }
4549
+ if (node.hologram) {
4550
+ const h = node.hologram;
4551
+ if (h.color) props.color = h.color;
4552
+ if (MESH_TYPES.has(node.type)) {
4553
+ props.args = this.getGeometryArgs(node.type, h);
4554
+ props.hsType = node.type;
4555
+ }
4556
+ }
4557
+ if (rawProps.scale !== void 0 && !props.scale) {
4558
+ props.scale = Array.isArray(rawProps.scale) ? rawProps.scale : [rawProps.scale, rawProps.scale, rawProps.scale];
4559
+ }
4560
+ if (rawProps.geometry && !props.hsType) {
4561
+ props.hsType = rawProps.geometry;
4562
+ props.args = this.getGeometryArgs(rawProps.geometry, { size: rawProps.size || 1 });
4563
+ }
4564
+ if (rawProps.material && typeof rawProps.material === "string" && MATERIAL_PRESETS[rawProps.material]) {
4565
+ props.materialProps = {
4566
+ ...MATERIAL_PRESETS[rawProps.material],
4567
+ ...props.materialProps
4568
+ };
4569
+ }
4570
+ if (node.directives) {
4571
+ for (const d of node.directives) {
4572
+ if (d.type === "trait") {
4573
+ if (d.name === "grabbable") {
4574
+ props.castShadow = true;
4575
+ props.grabbable = d.config || true;
4576
+ if (!props.rigidBody) props.rigidBody = { type: "dynamic" };
4577
+ if (!props.collider) props.collider = { type: "auto" };
4578
+ } else if (d.name === "animated") {
4579
+ props.animated = d.config || true;
4580
+ } else if (d.name === "spatial_audio" || d.name === "voice") {
4581
+ props.spatial = true;
4582
+ } else if (d.name === "gem_resonance") {
4583
+ props.gemResonance = gemResonanceConfig(
4584
+ d.config
4585
+ );
4586
+ props.spatial = true;
4587
+ } else if (d.name === "networked") {
4588
+ props.networked = d.config || true;
4589
+ } else if (d.name === "moldable") {
4590
+ props.moldable = d.config || true;
4591
+ } else if (d.name === "stretchable") {
4592
+ props.stretchable = d.config || true;
4593
+ } else if (d.name === "ai_driven") {
4594
+ props.ai_driven = d.config || true;
4595
+ } else if (d.name === "dialogue") {
4596
+ props.dialogue = d.config || true;
4597
+ } else if (d.name === "gesture") {
4598
+ props.gesture = d.config || true;
4599
+ } else if (d.name === "haptic") {
4600
+ props.haptic = d.config || true;
4601
+ } else if (d.name === "avatar_embodiment") {
4602
+ props.avatarEmbodiment = d.config || true;
4603
+ } else if (d.name === "lip_sync") {
4604
+ props.lipSync = d.config || true;
4605
+ } else if (d.name === "emotion_directive") {
4606
+ props.emotionDirective = d.config || true;
4607
+ } else if (d.name === "stt") {
4608
+ props.stt = d.config || true;
4609
+ } else if (d.name === "tts") {
4610
+ props.tts = d.config || true;
4611
+ } else if (d.name === "generate") {
4612
+ props.generate = d.config;
4613
+ } else if (d.name === "skeleton") {
4614
+ props.skeleton = d.config || true;
4615
+ } else if (d.name === "body") {
4616
+ props.body = d.config || true;
4617
+ } else if (d.name === "gaussian_splat") {
4618
+ props.gaussianSplat = d.config || true;
4619
+ } else if (d.name === "nerf") {
4620
+ props.nerf = d.config || true;
4621
+ } else if (d.name === "volumetric_video") {
4622
+ props.volumetricVideo = d.config || true;
4623
+ } else if (d.name === "web_surface") {
4624
+ props.webSurface = d.config || true;
4625
+ }
4626
+ }
4627
+ }
4628
+ }
4629
+ const perceptualDirective = node.directives?.find(
4630
+ (directive) => directive.type === "trait" && directive.name === "perceptual_color"
4631
+ );
4632
+ const perceptualDirectiveConfig = perceptualDirective ? perceptualDirective.config && typeof perceptualDirective.config === "object" ? perceptualDirective.config : {} : void 0;
4633
+ this.applyPerceptualColorProps(
4634
+ props,
4635
+ perceptualDirectiveConfig,
4636
+ this.isScientificColorNode(node.type, props)
4637
+ );
4638
+ delete props.type;
4639
+ delete props.geometry;
4640
+ return props;
4641
+ }
4642
+ applyGraphicsConfig(r3fNode, graphics) {
4643
+ if (graphics.material) {
4644
+ const m = graphics.material;
4645
+ const materialProps = {};
4646
+ if (m.preset && MATERIAL_PRESETS[m.preset]) {
4647
+ Object.assign(materialProps, MATERIAL_PRESETS[m.preset]);
4648
+ }
4649
+ if (m.type === "pbr" && m.pbr) {
4650
+ if (m.pbr.baseColor) materialProps["color"] = this.mapColor(m.pbr.baseColor);
4651
+ if (m.pbr.metallic !== void 0) materialProps["metalness"] = m.pbr.metallic;
4652
+ if (m.pbr.roughness !== void 0) materialProps["roughness"] = m.pbr.roughness;
4653
+ if (m.pbr.emission) materialProps["emissive"] = this.mapColor(m.pbr.emission);
4654
+ if (m.pbr.emissionStrength) materialProps["emissiveIntensity"] = m.pbr.emissionStrength;
4655
+ if (m.pbr.clearcoat !== void 0) materialProps["clearcoat"] = m.pbr.clearcoat;
4656
+ if (m.pbr.transmission !== void 0) materialProps["transmission"] = m.pbr.transmission;
4657
+ if (m.pbr.ior !== void 0) materialProps["ior"] = m.pbr.ior;
4658
+ if (m.pbr.iridescence !== void 0) materialProps["iridescence"] = m.pbr.iridescence;
4659
+ }
4660
+ const prior = r3fNode.props.materialProps ?? {};
4661
+ r3fNode.props.materialProps = { ...prior, ...materialProps };
4662
+ }
4663
+ if (graphics.lighting) {
4664
+ const l = graphics.lighting;
4665
+ if (r3fNode.type.toLowerCase().includes("light")) {
4666
+ if (l.shadows) r3fNode.props.castShadow = true;
4667
+ if (l.intensity !== void 0) r3fNode.props.intensity = l.intensity;
4668
+ if (l.color) r3fNode.props.color = this.mapColor(l.color);
4669
+ }
4670
+ if (r3fNode.type === "Environment" && l.preset) {
4671
+ r3fNode.props.preset = l.preset;
4672
+ }
4673
+ }
4674
+ if (graphics.networked) {
4675
+ r3fNode.props.networked = graphics.networked;
4676
+ }
4677
+ }
4678
+ mapColor(c) {
4679
+ if (typeof c === "string") return c;
4680
+ if (typeof c === "number") return `#${c.toString(16).padStart(6, "0")}`;
4681
+ if (c.r !== void 0) {
4682
+ const r = c.r > 1 ? c.r : Math.floor(c.r * 255);
4683
+ const g = c.g > 1 ? c.g : Math.floor(c.g * 255);
4684
+ const b = c.b > 1 ? c.b : Math.floor(c.b * 255);
4685
+ return `rgb(${r}, ${g}, ${b})`;
4686
+ }
4687
+ return "#ffffff";
4688
+ }
4689
+ getGeometryArgs(type, hologram) {
4690
+ const size = hologram.size || 1;
4691
+ switch (type) {
4692
+ case "sphere":
4693
+ case "orb":
4694
+ return [size * 0.5, 32, 32];
4695
+ case "cube":
4696
+ case "box":
4697
+ return [size, size, size];
4698
+ case "cylinder":
4699
+ return [size * 0.5, size * 0.5, size, 32];
4700
+ case "pyramid":
4701
+ case "cone":
4702
+ return [size * 0.5, 0, size, 4];
4703
+ case "plane":
4704
+ return [size, size];
4705
+ case "torus":
4706
+ return [size * 0.5, size * 0.15, 16, 32];
4707
+ case "ring":
4708
+ return [size * 0.3, size * 0.5, 32];
4709
+ case "capsule":
4710
+ return [size * 0.3, size * 0.5, 4, 16];
4711
+ default:
4712
+ return [size, size, size];
4713
+ }
4714
+ }
4715
+ };
4716
+
4717
+ exports.ENVIRONMENT_PRESETS = ENVIRONMENT_PRESETS;
4718
+ exports.MATERIAL_PRESETS = MATERIAL_PRESETS;
4719
+ exports.QUALITY_TIER_SCALES = QUALITY_TIER_SCALES;
4720
+ exports.SceneIRCompiler = SceneIRCompiler;
4721
+ exports.UI_COMPONENT_PRESETS = UI_COMPONENT_PRESETS;
4722
+ exports.registerAllPresets = registerAllPresets;
4723
+ //# sourceMappingURL=chunk-GGR7QUKK.cjs.map
4724
+ //# sourceMappingURL=chunk-GGR7QUKK.cjs.map