@fleox/agent3d 0.2.1 → 0.2.3

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 (47) hide show
  1. package/README.md +11 -10
  2. package/changelog.json +22 -0
  3. package/dist/agent/agent3d.mjs +58 -47
  4. package/dist/agent/chunks/{browser-t_JL_B82.mjs → browser-Br1tURgt.mjs} +21 -2
  5. package/dist/agent/chunks/{check-CBO3Ekx1.mjs → check-CfZcfaPs.mjs} +12 -0
  6. package/dist/agent/chunks/{export-BCI8vKw8.mjs → export-BHugc2H7.mjs} +1 -1
  7. package/dist/agent/chunks/{imageCodec-Dz9PFxi9.mjs → imageCodec-QM0EXQDJ.mjs} +1 -1
  8. package/dist/agent/chunks/{package-BOIyp_2B.mjs → package-fw4h5vsh.mjs} +2 -2
  9. package/dist/agent/chunks/{render-CN4mgGLQ.mjs → render-EHb40avl.mjs} +1 -1
  10. package/dist/agent/chunks/{tools-DT2tetIK.mjs → tools-DKxgjQSJ.mjs} +2 -2
  11. package/dist/runtime/agent3d-runtime.js +2 -2
  12. package/dist/runtime/agent3d-runtime.single.js +2 -2
  13. package/dist/runtime/chunks/catalog--OTp4gjy.js +1 -0
  14. package/dist/runtime/chunks/{generators-D5JUo0jp.js → generators--kOFg1G_.js} +1 -1
  15. package/dist/runtime/chunks/{materials-Dn-bYrZd.js → materials-w3EW0g-7.js} +1 -1
  16. package/dist/runtime/chunks/{model-BCVF3QzB.js → model-DbfZaLni.js} +1 -1
  17. package/dist/runtime/chunks/{params-C2uoUDJ0.js → params-BCNrVCYZ.js} +1 -1
  18. package/dist/runtime/chunks/{postfx-i_J5Vf-l.js → postfx-CFucYRev.js} +1 -1
  19. package/dist/runtime/chunks/{postfx-UgKCbmZs.js → postfx-Cbf_vvOr.js} +1 -1
  20. package/dist/runtime/chunks/{shaders-Dw6zHdu_.js → shaders-Ba3v6Xnj.js} +1 -1
  21. package/dist/runtime/chunks/{svg-CmlFY_8O.js → svg-CfPIQnDG.js} +1 -1
  22. package/dist/runtime/chunks/{text-D1EQpdSU.js → text-BaON-ISS.js} +1 -1
  23. package/dist/studio/assets/{camera-7sEn13L-.js → camera-Be6lnp3k.js} +1 -1
  24. package/dist/studio/assets/{editor-CnbvVkhU.js → editor-Mpnz-b2E.js} +1 -1
  25. package/dist/studio/assets/{game-B04KGAK0.js → game-WMgRSJUD.js} +3 -3
  26. package/dist/studio/assets/{generators-LSni1Yfc.js → generators-DozXE7ta.js} +1 -1
  27. package/dist/studio/assets/{index-3LL5NEIH.js → index-tSGZFEt5.js} +5 -5
  28. package/dist/studio/assets/{model-CNddhwmA.js → model-C2bZTK7-.js} +1 -1
  29. package/dist/studio/assets/{physicsHost-hMU_SDiX.js → physicsHost-CTRsIvfu.js} +1 -1
  30. package/dist/studio/assets/{postfx-BcCZS0Bq.js → postfx-DQtp0JIy.js} +1 -1
  31. package/dist/studio/assets/{runtime-DY_KqD1x.js → runtime-NGp1VdnH.js} +4 -4
  32. package/dist/studio/assets/{shaders-BhMCstyv.js → shaders-BOb6Uter.js} +1 -1
  33. package/dist/studio/assets/{svg-CNKK-h7H.js → svg-CnUMpv_N.js} +1 -1
  34. package/dist/studio/assets/{text-BSPI7dk1.js → text-CGIZs8HE.js} +1 -1
  35. package/dist/studio/index.html +1 -1
  36. package/package.json +2 -2
  37. package/plugin/.claude-plugin/plugin.json +1 -1
  38. package/plugin/skills/agent3d-assets/SKILL.md +24 -24
  39. package/plugin/skills/agent3d-create/SKILL.md +20 -20
  40. package/plugin/skills/agent3d-create/references/art-direction.md +3 -3
  41. package/plugin/skills/agent3d-create/references/recipes.md +6 -6
  42. package/plugin/skills/agent3d-edit/SKILL.md +22 -22
  43. package/plugin/skills/agent3d-edit/references/patch-ops.md +2 -2
  44. package/plugin/skills/agent3d-game/SKILL.md +7 -7
  45. package/plugin/skills/agent3d-publish/SKILL.md +21 -21
  46. package/plugin/skills/agent3d-publish/references/integrations.md +1 -1
  47. package/dist/runtime/chunks/catalog-DL6sgPay.js +0 -1
@@ -0,0 +1 @@
1
+ var e=(e,t,n,r,i)=>({name:e,type:`number`,description:t,default:n,min:r,max:i}),t=(e,t,n,r,i)=>({name:e,type:`integer`,description:t,default:n,min:r,max:i}),n=(e,t,n)=>({name:e,type:`boolean`,description:t,default:n}),r=(e,t,n)=>({name:e,type:`color`,description:t,default:n}),i=(e,t,n)=>({name:e,type:`colors`,description:t,default:n}),a=(e,t,n)=>({name:e,type:`vec3`,description:t,default:n}),o=(e,t,n,r)=>({name:e,type:`enum`,description:t,options:n,default:r}),s=t(`segments`,``,32,3,256),c=[{id:`box`,description:``,params:[e(`width`,``,1,0),e(`height`,``,1,0),e(`depth`,``,1,0)],cost:`12`},{id:`roundedBox`,description:``,params:[e(`width`,``,1,0),e(`height`,``,1,0),e(`depth`,``,1,0),e(`radius`,``,.1,0),t(`segments`,``,4,1,16)],cost:`~500`},{id:`sphere`,description:``,params:[e(`radius`,``,.5,0),s,t(`heightSegments`,``,24,2,256)],cost:`segments*heightSegments*2`},{id:`cylinder`,description:``,params:[e(`radiusTop`,``,.5,0),e(`radiusBottom`,``,.5,0),e(`height`,``,1,0),s,n(`openEnded`,``,!1)],cost:`segments*4`},{id:`cone`,description:``,params:[e(`radius`,``,.5,0),e(`height`,``,1,0),s],cost:`segments*2`},{id:`capsule`,description:``,params:[e(`radius`,``,.3,0),e(`length`,``,.6,0),t(`segments`,``,16,2,64)],cost:`~1000`},{id:`torus`,description:``,params:[e(`radius`,``,.5,0),e(`tube`,``,.15,0),t(`radialSegments`,``,24,2),t(`tubularSegments`,``,64,3),e(`arc`,``,360,0,360)],cost:`radialSegments*tubularSegments*2`},{id:`torusKnot`,description:``,params:[e(`radius`,``,.5,0),e(`tube`,``,.15,0),t(`tubularSegments`,``,128,3),t(`radialSegments`,``,16,3),t(`p`,``,2,1),t(`q`,``,3,1)],cost:`tubularSegments*radialSegments*2`},{id:`plane`,description:``,params:[e(`width`,``,1,0),e(`height`,``,1,0),t(`widthSegments`,``,1,1),t(`heightSegments`,``,1,1)],cost:`2`},{id:`circle`,description:``,params:[e(`radius`,``,.5,0),s],cost:`segments`},{id:`ring`,description:``,params:[e(`innerRadius`,``,.3,0),e(`outerRadius`,``,.5,0),s],cost:`segments*2`},{id:`icosahedron`,description:``,params:[e(`radius`,``,.5,0),t(`detail`,``,0,0,6)],cost:`20*4^detail`},{id:`dodecahedron`,description:``,params:[e(`radius`,``,.5,0),t(`detail`,``,0,0,5)],cost:`36`},{id:`octahedron`,description:``,params:[e(`radius`,``,.5,0),t(`detail`,``,0,0,5)],cost:`8`},{id:`tetrahedron`,description:``,params:[e(`radius`,``,.5,0),t(`detail`,``,0,0,5)],cost:`4`},{id:`lathe`,description:``,params:[{name:`points`,type:`array`,description:``,required:!0},s],cost:`points*segments*2`},{id:`extrude`,description:``,params:[{name:`shape`,type:`array`,description:``,required:!0},e(`depth`,``,.2,0),e(`bevel`,``,.02,0)],cost:`~points*20`},{id:`tube`,description:``,params:[{name:`points`,type:`array`,description:``,required:!0},e(`radius`,``,.05,0),t(`tubularSegments`,``,64,2),t(`radialSegments`,``,8,3),n(`closed`,``,!1)],cost:`tubularSegments*radialSegments*2`}],l=[{id:`plastic`,description:``,props:{type:`physical`,color:`#e8e8e8`,roughness:.35,metalness:0,clearcoat:.3}},{id:`matte`,description:``,props:{type:`standard`,color:`#d9d9d9`,roughness:.95,metalness:0}},{id:`clay`,description:``,props:{type:`standard`,color:`#e9dccb`,roughness:.8,metalness:0}},{id:`chrome`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:.05,metalness:1}},{id:`brushedMetal`,description:``,props:{type:`physical`,color:`#c8ccd2`,roughness:.35,metalness:1,anisotropy:.6}},{id:`gold`,description:``,props:{type:`physical`,color:`#ffcf6b`,roughness:.15,metalness:1}},{id:`copper`,description:``,props:{type:`physical`,color:`#e8926a`,roughness:.25,metalness:1}},{id:`glass`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:.02,metalness:0,transmission:1,thickness:.5,ior:1.5}},{id:`frostedGlass`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:.4,metalness:0,transmission:1,thickness:.8,ior:1.4}},{id:`rubber`,description:``,props:{type:`standard`,color:`#2b2b2b`,roughness:1,metalness:0}},{id:`pearl`,description:``,props:{type:`physical`,color:`#f4f1ee`,roughness:.25,metalness:0,iridescence:1,clearcoat:1}},{id:`holographic`,description:``,props:{type:`physical`,color:`#d7e3ff`,roughness:.15,metalness:.9,iridescence:1}},{id:`neon`,description:``,props:{type:`standard`,color:`#ff2fd6`,emissive:`#ff2fd6`,emissiveIntensity:3,roughness:.5}},{id:`toon`,description:``,props:{type:`toon`,color:`#ffb347`}},{id:`flat`,description:``,props:{type:`basic`,color:`#ffffff`}},{id:`lowpoly`,description:``,props:{type:`standard`,color:`#8bc34a`,roughness:.9,flatShading:!0}},{id:`velvet`,description:``,props:{type:`physical`,color:`#7b2d5b`,roughness:.9,sheen:1}},{id:`wireframe`,description:``,props:{type:`basic`,color:`#7cf7ff`,wireframe:!0}},{id:`normal`,description:``,props:{type:`normal`}},{id:`carPaint`,description:``,props:{type:`physical`,color:`#b3121f`,metalness:.6,roughness:.4,clearcoat:1,clearcoatRoughness:.03,normalMap:{procedural:`flakes`,scale:40},normalScale:.2}},{id:`ceramic`,description:``,props:{type:`physical`,color:`#f3efe8`,roughness:.45,metalness:0,clearcoat:1,clearcoatRoughness:.06}},{id:`marble`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:.2,metalness:0,clearcoat:.4,clearcoatRoughness:.1,map:{procedural:`marble`},triplanar:.5}},{id:`terrazzo`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:.45,metalness:0,map:{procedural:`terrazzo`},triplanar:.5}},{id:`wood`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:.5,metalness:0,clearcoat:.5,clearcoatRoughness:.2,map:{procedural:`wood`}}},{id:`carbonFiber`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:.35,metalness:.3,clearcoat:1,clearcoatRoughness:.04,map:{procedural:`carbon`,scale:12},anisotropy:.5}},{id:`leather`,description:``,props:{type:`physical`,color:`#6b3a22`,roughness:.62,metalness:0,sheen:.5,sheenRoughness:.5,sheenColor:`#c49a7a`,bumpMap:{procedural:`voronoi`,scale:60},bumpScale:.6}},{id:`satin`,description:``,props:{type:`physical`,color:`#c9a0dc`,roughness:.4,metalness:0,sheen:1,sheenRoughness:.3,sheenColor:`#ffffff`,anisotropy:.4}},{id:`silk`,description:``,props:{type:`physical`,color:`#f2d7c9`,roughness:.3,metalness:0,sheen:1,sheenRoughness:.2,sheenColor:`#fff4ec`,specularIntensity:.6}},{id:`brushedAluminium`,description:``,props:{type:`physical`,color:`#d9dce1`,roughness:.3,metalness:1,anisotropy:.85,roughnessMap:{procedural:`brushed`,scale:1}}},{id:`ice`,description:``,props:{type:`physical`,color:`#eaf8ff`,roughness:.1,metalness:0,transmission:1,thickness:1.2,ior:1.31,attenuationColor:`#8fd3ff`,attenuationDistance:1.2,bumpMap:{procedural:`noise`,scale:3},bumpScale:.4}},{id:`water`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:.02,metalness:0,transmission:1,thickness:1,ior:1.333,attenuationColor:`#4fc3d9`,attenuationDistance:2}},{id:`diamond`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:0,metalness:0,transmission:1,thickness:2.5,ior:2.33,dispersion:8,specularIntensity:1,envMapIntensity:2.5,attenuationColor:`#dde8ff`,attenuationDistance:3}},{id:`gem`,description:``,props:{type:`physical`,color:`#ffe5ec`,roughness:0,metalness:0,transmission:1,thickness:1,ior:1.77,dispersion:2,attenuationColor:`#e0115f`,attenuationDistance:.5,envMapIntensity:1.4}},{id:`jelly`,description:``,props:{type:`physical`,color:`#ff7aa2`,roughness:.12,metalness:0,transmission:.95,thickness:1.5,ior:1.35,attenuationColor:`#ff2d6f`,attenuationDistance:.6,clearcoat:1,clearcoatRoughness:.1}},{id:`chromeGradient`,description:``,props:{type:`gradient`,gradient:[`#7f5cff`,`#ff5ca8`,`#ffd36e`],metalness:1,roughness:.08}},{id:`soapBubble`,description:``,props:{type:`physical`,color:`#ffffff`,roughness:0,metalness:0,transmission:1,thickness:.05,ior:1.1,iridescence:1,iridescenceIOR:1.33,iridescenceThicknessRange:[120,900],side:`double`}},{id:`mattePastel`,description:``,props:{type:`physical`,color:`#f7c8d8`,roughness:.75,metalness:0,sheen:.35,sheenRoughness:.8}},{id:`emissiveGradient`,description:``,props:{type:`gradient`,gradient:[`#00e5ff`,`#7c4dff`,`#ff3d9a`],emissive:`#ffffff`,emissiveIntensity:1.6,gradientEmissive:!0,roughness:.4}}],u=[{id:`plasma`,description:``,params:[i(`colors`,``,[`#ff006e`,`#8338ec`,`#3a86ff`]),e(`speed`,``,1,0),e(`scale`,``,1,0)]},{id:`waves`,description:``,params:[i(`colors`,``,[`#0b132b`,`#5bc0be`]),e(`speed`,``,1,0),e(`frequency`,``,8,0)]},{id:`noise`,description:``,params:[i(`colors`,``,[`#1b1b3a`,`#ff9f1c`]),e(`speed`,``,.3,0),e(`scale`,``,2,0)]},{id:`hologram`,description:``,params:[r(`color`,``,`#38f9ff`),e(`speed`,``,1,0),e(`lines`,``,80,0)]},{id:`gradientFlow`,description:``,params:[i(`colors`,``,[`#ff7eb3`,`#ff758c`,`#7afcff`,`#feffb7`]),e(`speed`,``,.4,0)]},{id:`toonRim`,description:``,params:[r(`color`,``,`#ffb347`),r(`rim`,``,`#ffffff`),t(`steps`,``,3,1,8)]},{id:`dissolve`,description:``,params:[r(`color`,``,`#ffffff`),r(`edge`,``,`#ff7b00`),e(`progress`,``,0,0,1)]},{id:`gradientMesh`,description:``,params:[i(`colors`,``,[`#ff6ec4`,`#7873f5`,`#4adede`,`#ffd86f`]),e(`speed`,``,.25,0),e(`scale`,``,1,.1),e(`grain`,``,.04,0,1)]},{id:`aurora`,description:``,params:[i(`colors`,``,[`#00ffa3`,`#00b3ff`,`#b400ff`]),r(`background`,``,`#030714`),e(`speed`,``,.3,0),e(`intensity`,``,1.2,0)]},{id:`liquidChrome`,description:``,params:[i(`colors`,``,[`#0a0a12`,`#5a5f7a`,`#e8ecff`,`#9ab8ff`]),e(`speed`,``,.35,0),e(`scale`,``,1.5,.1)]},{id:`nebula`,description:``,params:[i(`colors`,``,[`#1b0b3b`,`#7b2ff7`,`#f72585`,`#4cc9f0`]),e(`speed`,``,.05,0),e(`stars`,``,1,0,3),e(`scale`,``,1,.1)]},{id:`caustics`,description:``,params:[r(`color`,``,`#bff6ff`),r(`background`,``,`#05677d`),e(`speed`,``,.5,0),e(`scale`,``,3,.1),e(`intensity`,``,1.4,0)]},{id:`fresnelGlow`,description:``,params:[r(`color`,``,`#4cc9f0`),r(`core`,``,`#000000`),e(`power`,``,2.5,.1),e(`intensity`,``,1.5,0),e(`pulse`,``,0,0)]},{id:`iridescentFoil`,description:``,params:[e(`speed`,``,.3,0),e(`scale`,``,2,.1),e(`sparkle`,``,.5,0,1),r(`tint`,``,`#ffffff`)]},{id:`lavaLamp`,description:``,params:[i(`colors`,``,[`#2a0845`,`#ff512f`,`#f09819`]),e(`speed`,``,.3,0),e(`scale`,``,1,.1)]},{id:`grainGradient`,description:``,params:[i(`colors`,``,[`#ffb88c`,`#de6262`,`#4b1248`]),e(`angle`,``,30),e(`grain`,``,.06,0,1),e(`speed`,``,0,0)]},{id:`matrixRain`,description:``,params:[r(`color`,``,`#3dff7a`),r(`background`,``,`#000a03`),e(`speed`,``,1,0),e(`columns`,``,40,4,200)]}],d=[e(`scale`,``,1,.05),t(`seed`,``,1),t(`resolution`,``,512,32,2048)],f=[{id:`marble`,description:``,params:[i(`colors`,``,[`#f4f2ee`,`#b9b6b1`,`#5d5a57`]),e(`veins`,``,.6,0,1),e(`turbulence`,``,1,0),...d]},{id:`wood`,description:``,params:[i(`colors`,``,[`#d9a066`,`#a0632f`,`#6b3a17`]),e(`rings`,``,10,1),e(`grain`,``,.5,0,1),...d]},{id:`terrazzo`,description:``,params:[i(`colors`,``,[`#efe9e1`,`#e07a5f`,`#3d405b`,`#81b29a`,`#f2cc8f`]),e(`density`,``,.5,0,1),e(`chipSize`,``,1,.2,4),...d]},{id:`carbon`,description:``,params:[i(`colors`,``,[`#0b0b0d`,`#2a2c31`,`#5b5e66`]),...d]},{id:`noise`,description:``,params:[i(`colors`,``,[`#000000`,`#ffffff`]),t(`octaves`,``,5,1,8),e(`contrast`,``,1,0),...d]},{id:`voronoi`,description:``,params:[i(`colors`,``,[`#ffffff`,`#000000`]),e(`jitter`,``,1,0,1),...d]},{id:`flakes`,description:``,params:[i(`colors`,``,[`#808080`,`#ffffff`]),e(`strength`,``,.6,0,1),...d]},{id:`brushed`,description:``,params:[i(`colors`,``,[`#9a9a9a`,`#d0d0d0`]),e(`streaks`,``,1,.1),...d]},{id:`grid`,description:``,params:[i(`colors`,``,[`#0b1d3a`,`#6fd3ff`]),t(`cells`,``,8,1,256),e(`lineWidth`,``,.04,0,.5),...d]},{id:`checker`,description:``,params:[i(`colors`,``,[`#ffffff`,`#222222`]),t(`cells`,``,8,1,256),...d]},{id:`stripes`,description:``,params:[i(`colors`,``,[`#ffffff`,`#ff4d6d`]),t(`count`,``,8,1,256),e(`angle`,``,0),e(`softness`,``,.05,0,.5),...d]},{id:`dots`,description:``,params:[i(`colors`,``,[`#ffffff`,`#ff4d6d`]),t(`cells`,``,8,1,256),e(`radius`,``,.3,0,.5),...d]}],p=[e(`intensity`,``,1,0),e(`rotation`,``,0),n(`castShadow`,``,!0),e(`scale`,``,1,.05),r(`color`,``)],m=[{id:`studio-3point`,description:``,params:p},{id:`softbox`,description:``,params:p},{id:`product-top`,description:``,params:p},{id:`rim`,description:``,params:p},{id:`dramatic`,description:``,params:p},{id:`golden-hour`,description:``,params:p},{id:`noon`,description:``,params:p},{id:`overcast`,description:``,params:p},{id:`neon`,description:``,params:p},{id:`moonlight`,description:``,params:p}],h=a(`axis`,``,[0,1,0]),g=[{id:`rotate`,description:``,params:[h,e(`speed`,``,45)],example:{type:`rotate`,axis:[0,1,0],speed:30}},{id:`float`,description:``,params:[e(`amplitude`,``,.15,0),e(`speed`,``,.5,0),e(`phase`,``,0)]},{id:`bob`,description:``,params:[e(`height`,``,.3,0),e(`speed`,``,1.5,0)]},{id:`pulse`,description:``,params:[e(`amount`,``,.08,0),e(`speed`,``,1,0)]},{id:`wobble`,description:``,params:[e(`amount`,``,.08,0),e(`speed`,``,2,0)]},{id:`sway`,description:``,params:[a(`axis`,``,[0,0,1]),e(`angle`,``,8,0),e(`speed`,``,.5,0)]},{id:`orbit`,description:``,params:[a(`center`,``,[0,0,0]),e(`radius`,``,2,0),e(`speed`,``,30),h,n(`faceDirection`,``,!1),e(`phase`,``,0)]},{id:`path`,description:``,params:[{name:`points`,type:`array`,description:``,required:!0},e(`duration`,``,5,0),n(`loop`,``,!0),n(`faceDirection`,``,!0)]},{id:`followPointer`,description:``,params:[e(`strength`,``,.5,0),e(`smoothing`,``,.9,0,.99),o(`mode`,``,[`move`,`rotate`,`both`],`rotate`)]},{id:`lookAtPointer`,description:``,params:[e(`maxAngle`,``,35,0),e(`smoothing`,``,.85,0,.99)]},{id:`hoverScale`,description:``,params:[e(`scale`,``,1.15,0),e(`smoothing`,``,.8,0,.99)]},{id:`hoverLift`,description:``,params:[e(`height`,``,.2),e(`tilt`,``,10)]},{id:`clickBounce`,description:``,params:[e(`amount`,``,.25,0)]},{id:`spinOnClick`,description:``,params:[h,e(`duration`,``,.8,0),o(`trigger`,``,[`click`,`hover`],`click`)]},{id:`scrollRotate`,description:``,params:[h,e(`degrees`,``,360)]},{id:`scrollMove`,description:``,params:[a(`offset`,``,[0,2,0])]},{id:`drift`,description:``,params:[a(`area`,``,[1,1,1]),e(`speed`,``,.3,0),t(`seed`,``,1)]},{id:`blink`,description:``,params:[e(`interval`,``,3,0),e(`duration`,``,.15,0),n(`random`,``,!0)]},{id:`colorCycle`,description:``,params:[i(`colors`,``,[`#ff006e`,`#8338ec`,`#3a86ff`]),e(`speed`,``,.5,0),n(`emissive`,``,!1)]},{id:`flicker`,description:``,params:[e(`amount`,``,.3,0,1),e(`speed`,``,8,0)]},{id:`billboard`,description:``,params:[n(`lockY`,``,!0)]},{id:`appear`,description:``,params:[o(`effect`,``,[`scale`,`fade`,`rise`,`drop`,`spin`],`scale`),e(`duration`,``,.8,0),o(`ease`,``,[`outBack`,`outCubic`,`outElastic`,`outBounce`],`outBack`)]},{id:`magnet`,description:``,params:[e(`radius`,``,.25,0,1),e(`strength`,``,.4,0)]},{id:`spring`,description:``,params:[e(`strength`,``,.4,0),e(`stiffness`,``,120,1),e(`damping`,``,12,0),e(`mass`,``,1,.01),o(`mode`,``,[`move`,`rotate`,`both`],`move`),e(`angle`,``,15,0)],example:{type:`spring`,mode:`both`,strength:.3,damping:9}},{id:`parallax`,description:``,params:[e(`depth`,``,.5),e(`pointer`,``,.3),e(`scroll`,``,0),e(`smoothing`,``,.9,0,.99)],example:{type:`parallax`,depth:1,pointer:.4}},{id:`tilt`,description:``,params:[e(`maxAngle`,``,12,0,60),e(`scale`,``,1.04,0),e(`lift`,``,.1),n(`hoverOnly`,``,!0),n(`reverse`,``,!1),e(`smoothing`,``,.86,0,.99)]},{id:`breathe`,description:``,params:[e(`amount`,``,.04,0),e(`period`,``,4,.1),e(`rise`,``,.02),e(`phase`,``,0)]},{id:`noise`,description:``,params:[a(`amplitude`,``,[.1,.1,.05]),a(`rotation`,``,[3,3,2]),e(`speed`,``,.3,0),t(`seed`,``,1)]},{id:`lookAt`,description:``,params:[{name:`target`,type:`string`,description:`Object id or "camera" (default).`,default:`camera`},a(`point`,``),e(`smoothing`,``,.85,0,.99),n(`lockY`,``,!1)],example:{type:`lookAt`,target:`hero`,lockY:!0}}],_=[{id:`terrain`,description:``,params:[e(`size`,``,40,0),t(`resolution`,``,96,8,512),e(`height`,``,6,0),e(`scale`,``,1,0),t(`octaves`,``,5,1,8),o(`shape`,``,[`hills`,`mountains`,`island`,`dunes`,`canyon`,`basin`,`valley`,`flat`],`hills`),e(`edgeFalloff`,``,void 0,0,1),i(`palette`,``,[`#e2c290`,`#6aa84f`,`#38761d`,`#7f6a5d`,`#ffffff`]),n(`lowpoly`,``,!0),e(`waterLevel`,``,.6),r(`waterColor`,``,`#3d9bd6`),n(`waterPlane`,``,!0),e(`snowLine`,``,1,0,1),e(`snowHeight`,``,void 0,0)],cost:`resolution^2*2+(1-lowpoly)*max(resolution, 48)^2*2+~3200*lowpoly`,material:`The ground (not the water plane). Without colour / preset / map the palette bands are kept (e.g. { "roughness": 0.6, "flatShading": false }).`},{id:`trees`,description:``,params:[t(`count`,``,30,1,2e3),a(`area`,``,[30,0,30]),o(`style`,``,[`pine`,`round`,`palm`,`birch`,`dead`,`mixed`],`mixed`),e(`minScale`,``,.7,0),e(`maxScale`,``,1.4,0),i(`leafColors`,``,[`#2e7d32`,`#43a047`,`#66bb6a`]),r(`trunkColor`,``,`#6d4c41`),n(`onTerrain`,``,!0),n(`sway`,``,!0)],cost:`count*(70*style_pine+200*style_round+460*style_palm+430*style_birch+220*style_dead+212*style_mixed)`},{id:`rocks`,description:``,params:[t(`count`,``,20,1,2e3),a(`area`,``,[20,0,20]),e(`minSize`,``,.3,0),e(`maxSize`,``,1.5,0),i(`colors`,``,[`#8d8d8d`,`#757575`,`#9e9e9e`]),n(`onTerrain`,``,!0)],cost:`count*40`,material:`Every rock. Without colour / preset / map the per-rock colours are kept.`},{id:`grass`,description:``,params:[t(`count`,``,5e3,1,1e5),a(`area`,``,[20,0,20]),e(`height`,``,.4,0),i(`colors`,``,[`#2d6a1f`,`#8bc34a`]),e(`wind`,``,.5,0),n(`onTerrain`,``,!0)],cost:`count*3`},{id:`flowers`,description:``,params:[t(`count`,``,200,1,2e4),a(`area`,``,[20,0,20]),i(`colors`,``,[`#ff5d8f`,`#ffd166`,`#ffffff`,`#9b5de5`]),n(`onTerrain`,``,!0)],cost:`count*56`},{id:`water`,description:``,params:[e(`size`,``,40,0),r(`color`,``,`#1e6fa8`),r(`shallowColor`,``,`#5ec8e5`),r(`foamColor`,``,`#ffffff`),e(`waveHeight`,``,.15,0),e(`waveSpeed`,``,1,0),e(`foam`,``,.6,0),e(`ripples`,``,1,0),e(`depthRange`,``,3,.01),e(`opacity`,``,.9,0,1),n(`lowpoly`,``,!1),n(`reflections`,``,!1),e(`reflectivity`,``,.8,0,1)],cost:`min(size*(3-1.6*lowpoly), 160)^2*2`},{id:`clouds`,description:``,params:[t(`count`,``,8,1,200),a(`area`,``,[40,6,40]),e(`height`,``,10),e(`size`,``,1,0),r(`color`,``,`#ffffff`),r(`shadowColor`,``,`#a9bdd6`),e(`speed`,``,.3,0),o(`style`,``,[`puffy`,`lowpoly`],`puffy`)],cost:`count*(2600-1950*style_lowpoly)`},{id:`city`,description:``,params:[t(`blocks`,``,6,1,40),e(`blockSize`,``,4,0),e(`street`,``,1.2,0),e(`minHeight`,``,1,0),e(`maxHeight`,``,8,0),i(`colors`,``,[`#e0e1dd`,`#778da9`,`#415a77`,`#ffd6a5`]),n(`windows`,``,!0),r(`windowColor`,``,`#ffe8a3`),n(`trees`,``,!0)],cost:`blocks^2*(235+205*trees)`},{id:`character`,description:``,params:[o(`style`,``,[`humanoid`,`astronaut`,`robot`,`blob`,`cat`,`fox`,`bird`,`ghost`],`humanoid`),r(`skin`,``),r(`shirt`,``),r(`pants`,``),r(`hair`,``),r(`accent`,``),o(`expression`,``,[`happy`,`laugh`,`neutral`,`surprised`,`wink`,`sad`,`angry`,`sleepy`],`happy`),o(`hairStyle`,``,[`short`,`long`,`bob`,`bun`,`ponytail`,`spiky`,`curly`,`none`],`short`),o(`outfit`,``,[`tshirt`,`hoodie`,`dress`,`suit`,`overalls`],`tshirt`),{name:`accessories`,type:`array`,description:``,default:[],options:[`cap`,`beanie`,`glasses`,`sunglasses`,`headphones`,`backpack`,`scarf`,`bowtie`,`crown`]},o(`animation`,``,[`idle`,`walk`,`run`,`wave`,`jump`,`dance`,`cheer`,`celebrate`,`sit`,`point`,`talk`,`none`],`idle`),e(`animationSpeed`,``,1,0),e(`height`,``,1.8,0),o(`shading`,``,[`smooth`,`lowpoly`,`toon`],`smooth`),n(`eyesFollowPointer`,``,!1)],cost:`(16100*style_humanoid+17300*style_astronaut+11600*style_robot+7700*style_blob+9500*style_cat+9800*style_fox+9100*style_bird+6400*style_ghost)*(1-0.82*shading_lowpoly)`},{id:`planet`,description:``,params:[e(`radius`,``,2,0),i(`palette`,``,[`#2a6f97`,`#52b788`,`#8d6e63`,`#ffffff`]),e(`landAmount`,``,.45,0,1),n(`rings`,``,!1),r(`ringColor`,``,`#e9c46a`),n(`atmosphere`,``,!0),r(`atmosphereColor`,``,`#8ecae6`),t(`detail`,``,5,1,7),e(`spin`,``,0)],cost:`20*4^detail+~700`,material:`The globe surface (ocean + land; rings and atmosphere keep theirs). Without colour / preset / map the palette is kept.`},{id:`starfield`,description:``,params:[t(`count`,``,3e3,1,5e4),e(`radius`,``,80,0),i(`colors`,``,[`#ffffff`,`#cfe2ff`,`#ffe8c2`]),e(`size`,``,.25,0),n(`twinkle`,``,!0)],cost:`count`},{id:`blob`,description:``,params:[e(`radius`,``,1.2,0),e(`noise`,``,.3,0),e(`speed`,``,.4,0),t(`detail`,``,64,8,256),i(`colors`,``,[`#ff7eb3`,`#a78bfa`,`#60a5fa`,`#5eead4`])],cost:`detail^2*2`,material:`The whole blob; the morph keeps running with any material, shaders included (e.g. { "type": "shader", "shader": "gradientFlow" }, { "preset": "chrome" }). Without colour / preset / map the colour ramp is kept (e.g. { "type": "toon" }).`},{id:`waveGrid`,description:``,params:[t(`columns`,``,60,2,400),t(`rows`,``,30,2,400),e(`spacing`,``,.3,0),e(`amplitude`,``,.5,0),e(`speed`,``,1,0),o(`shape`,``,[`dots`,`bars`,`lines`],`dots`),i(`colors`,``,[`#3a86ff`,`#ff006e`]),n(`pointerRipple`,``,!0)],cost:`columns*rows*(1+shape_lines+11*shape_bars)`},{id:`maze`,description:``,params:[t(`columns`,``,10,2,60),t(`rows`,``,10,2,60),e(`cellSize`,``,2,0),e(`wallHeight`,``,1.5,0),r(`wallColor`,``,`#5e548e`),r(`floorColor`,``,`#e0b1cb`),n(`bodies`,``,!0)],cost:`columns*rows*7`},{id:`road`,description:``,params:[e(`width`,``,6,0),e(`length`,``,60,0),t(`lanes`,``,3,1,8),r(`color`,``,`#3d405b`),r(`lineColor`,``,`#f4f1de`),e(`speed`,``,10,0),i(`curbColors`,``,[`#e63946`,`#f1faee`]),n(`verge`,``,!0),i(`vergeColor`,``,[`#7cc45a`,`#6bb44c`])],cost:`length*14+~220`},{id:`birds`,description:``,params:[t(`count`,``,12,1,500),o(`mode`,``,[`orbit`,`path`,`drift`],`orbit`),a(`area`,``,[40,4,30]),{name:`points`,type:`array`,description:``,default:[]},e(`heading`,``,0),e(`speed`,``,4,0),o(`formation`,``,[`loose`,`v`],`loose`),e(`spread`,``,3,0),e(`size`,``,1,.01),r(`color`,``,`#22252e`),e(`flapSpeed`,``,2.5,0)],example:{count:9,mode:`drift`,formation:`v`,area:[80,2,0],heading:10,speed:5,size:1.2},cost:`count*15`},{id:`floatingIsland`,description:``,params:[e(`radius`,``,3,.1),e(`depth`,``,3.6,.1),e(`hills`,``,1,0,4),i(`grassColors`,``,[`#4f9a3a`,`#7cc24a`,`#b5dd6a`]),r(`dirtColor`,``,`#8a5a3c`),i(`rockColors`,``,[`#7d6b5e`,`#93806f`,`#6a5a52`,`#a08c76`]),t(`trees`,``,6,0,200),o(`treeStyle`,``,[`pine`,`round`,`palm`,`birch`,`dead`,`mixed`],`round`),i(`leafColors`,``,[`#2e7d32`,`#43a047`,`#7cb342`]),t(`rocks`,``,5,0,200),t(`flowers`,``,60,0,5e3),t(`grass`,``,1500,0,3e4),n(`waterfall`,``,!0),r(`waterColor`,``,`#4fc3f7`),t(`debris`,``,6,0,100),e(`float`,``,.12,0),n(`lowpoly`,``,!0)],cost:`~2500+7300*(1-lowpoly)+trees*220+grass*3+flowers*56`,material:`The island body (top + underside). Without colour / preset / map the vertex colours are kept.`},{id:`globe`,description:``,params:[e(`radius`,``,2,.1),t(`dots`,``,12e3,200,6e4),n(`continents`,``,!0),r(`dotColor`,``,`#7dd3fc`),r(`oceanDotColor`,``,`#0b1630`),r(`baseColor`,``,`#0b1630`),e(`dotSize`,``,1,0),{name:`points`,type:`array`,description:``,default:[]},{name:`arcs`,type:`array`,description:``,default:[]},r(`arcColor`,``,`#f472b6`),e(`arcSpeed`,``,1,0),e(`arcWidth`,``,1,0),r(`markerColor`,``,`#fde68a`),e(`markerSize`,``,1,0),n(`atmosphere`,``,!0),r(`atmosphereColor`,``,`#38bdf8`),e(`spin`,``,6),e(`longitude`,``,0),e(`tilt`,``,12)],cost:`dots*(1.9+4.1*(1-continents))+~18000`,material:`The globe body sphere (dots, arcs and atmosphere keep theirs).`},{id:`crystals`,description:``,params:[t(`count`,``,14,1,400),e(`size`,``,1.2,0),i(`colors`,``,[`#7c3aed`,`#22d3ee`,`#f0abfc`]),o(`layout`,``,[`cluster`,`ring`,`scatter`],`cluster`),e(`spread`,``,1,0),e(`glow`,``,.8,0),e(`pulse`,``,1,0),e(`opacity`,``,1,0,1),n(`base`,``,!0),r(`baseColor`,``,`#4b4560`)],cost:`count*16.5+~560*base*layout_cluster`,material:`The crystals (not the base). Without colour / preset / map the gradients are kept.`},{id:`galaxy`,description:``,params:[t(`count`,``,4e4,100,3e5),e(`radius`,``,6,.1),t(`arms`,``,3,1,8),e(`twist`,``,5,0),e(`thickness`,``,.05,0),r(`coreColor`,``,`#ffd8a8`),r(`armColor`,``,`#6d8bff`),r(`accentColor`,``,`#ff7ac8`),e(`size`,``,.035,0),e(`speed`,``,.3),e(`coreGlow`,``,.9,0,1)],cost:`count`},{id:`bars3d`,description:``,params:[{name:`data`,type:`array`,description:``,default:[3,5,4,7,6,9,8]},e(`barWidth`,``,.6,.01),e(`gap`,``,.25,0),e(`maxHeight`,``,3,.01),i(`colors`,``,[`#93c5fd`,`#6366f1`,`#c026d3`]),o(`colorBy`,``,[`value`,`row`,`column`],`value`),o(`shape`,``,[`rounded`,`box`,`cylinder`],`rounded`),o(`animation`,``,[`grow`,`wave`,`none`],`grow`),e(`duration`,``,1.6,.01),n(`base`,``,!0),r(`baseColor`,``,`#eef2ff`)],cost:`dataCells*(970*shape_rounded+12*shape_box+128*shape_cylinder)+~590`,material:`Every bar (per-bar colours are kept as instance colours).`},{id:`abstractShapes`,description:``,params:[t(`count`,``,22,1,300),a(`area`,``,[10,4,2]),i(`colors`,``,[`#ff8fab`,`#ffd166`,`#06d6a0`,`#118ab2`,`#a78bfa`,`#ff6b6b`]),{name:`shapes`,type:`array`,description:``,options:[`sphere`,`torus`,`ring`,`pill`,`cone`,`cube`,`halfDisc`,`squiggle`,`triangle`,`star`]},e(`minSize`,``,.5,0),e(`maxSize`,``,1.6,0),o(`style`,``,[`matte`,`glossy`,`toon`],`matte`),e(`motion`,``,1,0)],cost:`count*1250`,material:`Every shape (per-shape palette colours are kept as instance colours).`}],v=[t(`count`,``,void 0,1,2e5),a(`area`,``),{name:`size`,type:`number`,description:``,min:0},{name:`color`,type:`colors`,description:`A colour or a list of colours (each particle picks one), e.g. "#ffffff" or ["#ff006e", "#ffbe0b"].`},e(`speed`,``,void 0,0),a(`direction`,``),e(`spread`,``,void 0,0,1),{name:`lifetime`,type:`number`,description:``,min:0},e(`opacity`,``,void 0,0,1),o(`blending`,``,[`normal`,`additive`]),o(`shape`,``,[`point`,`soft`,`square`,`circle`,`star`,`spark`,`streak`,`heart`,`bubble`,`smoke`,`petal`,`leaf`,`ring`]),t(`seed`,``)],y=[{id:`stars`,description:``,params:v},{id:`snow`,description:``,params:v},{id:`rain`,description:``,params:v},{id:`fireflies`,description:``,params:v},{id:`confetti`,description:``,params:v},{id:`sparks`,description:``,params:v},{id:`dust`,description:``,params:v},{id:`bubbles`,description:``,params:v},{id:`embers`,description:``,params:v},{id:`hearts`,description:``,params:v},{id:`magic`,description:``,params:v},{id:`smoke`,description:``,params:v},{id:`fire`,description:``,params:v},{id:`petals`,description:``,params:v},{id:`leaves`,description:``,params:v},{id:`galaxyDust`,description:``,params:v},{id:`bokeh`,description:``,params:v}],b=[`none`,`cinematic`,`teal-orange`,`warm`,`cool`,`bleach`,`noir`,`vintage`,`pastel`],x=[`cinematic`,`product`,`dreamy`,`neon`,`retro`,`clean`],S={cinematic:{description:``,values:{contrast:1.12,saturation:.92,vibrance:.1,shadows:`#2f6f86`,highlights:`#ffb27a`,toning:.32,lift:.015,gain:1.02}},"teal-orange":{description:``,values:{contrast:1.18,saturation:1.05,vibrance:.2,shadows:`#1b6f8a`,highlights:`#ff9a4a`,toning:.55,gain:1.03}},warm:{description:``,values:{temperature:.3,tint:.04,saturation:1.06,contrast:1.05,highlights:`#ffcf8f`,toning:.2}},cool:{description:``,values:{temperature:-.3,saturation:.96,contrast:1.06,shadows:`#2d5c9e`,toning:.22}},bleach:{description:``,values:{bleach:.65,saturation:.7,contrast:1.2}},noir:{description:``,values:{saturation:0,contrast:1.35,lift:-.02,gain:1.06}},vintage:{description:``,values:{saturation:.78,contrast:.92,lift:.07,gain:.96,temperature:.15,shadows:`#4f6a5a`,highlights:`#ffe0ae`,toning:.35}},pastel:{description:``,values:{saturation:.82,contrast:.86,lift:.08,gamma:1.08,highlights:`#ffe3ef`,shadows:`#8a9fd8`,toning:.25}}},C={cinematic:{description:``,effects:[{type:`ao`,intensity:.9,radius:.6},{type:`bloom`,strength:.25,radius:.6,threshold:2.2,smoothing:.4},{type:`grading`,look:`cinematic`},{type:`vignette`,offset:1,darkness:.75},{type:`film`,intensity:.06},{type:`taa`,samples:8}]},product:{description:``,effects:[{type:`ao`,intensity:1.1,radius:.5},{type:`bloom`,strength:.15,radius:.5,threshold:2.5,smoothing:.4},{type:`grading`,contrast:1.07,saturation:1.04,vibrance:.1},{type:`sharpen`,amount:.25},{type:`vignette`,offset:1.1,darkness:.4},{type:`taa`,samples:8}]},dreamy:{description:``,effects:[{type:`bloom`,strength:.45,radius:.85,threshold:1,smoothing:.6},{type:`grading`,look:`pastel`},{type:`chromatic`,amount:.0015},{type:`vignette`,offset:1,darkness:.5},{type:`film`,intensity:.04}]},neon:{description:``,effects:[{type:`bloom`,strength:1.3,radius:.55,threshold:.55,smoothing:.2},{type:`lensflare`,intensity:.45,threshold:1.4,streaks:1.2,ghosts:.2,halo:.1},{type:`grading`,contrast:1.15,saturation:1.2,vibrance:.2},{type:`chromatic`,amount:.001},{type:`vignette`,offset:.95,darkness:.95}]},retro:{description:``,effects:[{type:`grading`,look:`vintage`},{type:`film`,intensity:.3,scanlines:.25},{type:`chromatic`,amount:.0025,radial:!1},{type:`vignette`,offset:.9,darkness:1.2},{type:`bloom`,strength:.3,radius:.6,threshold:1.6,smoothing:.4}]},clean:{description:``,effects:[{type:`grading`,contrast:1.04,saturation:1.02},{type:`sharpen`,amount:.15},{type:`vignette`,offset:1.2,darkness:.25},{type:`taa`,samples:8}]}},w=[{id:`look`,description:"Named look preset expanding into a tuned stack (`details.presets` lists exactly what each one expands to). Effects listed next to it override the matching expanded entry param by param.",params:[o(`preset`,``,x,`cinematic`),e(`intensity`,``,1,0,1)],gpu:`medium`,example:{type:`look`,preset:`cinematic`},details:{presets:C}},{id:`bloom`,description:``,params:[e(`strength`,``,.8,0),e(`radius`,``,.4,0),e(`threshold`,``,.85,0),e(`smoothing`,``,.1,0,1)],gpu:`medium`},{id:`ao`,description:``,params:[e(`intensity`,``,1,0,2),e(`radius`,``,.6,.01,10),e(`thickness`,``,1,.01,10),e(`falloff`,``,1,0,1)],gpu:`high`,example:{type:`ao`,intensity:1,radius:.6}},{id:`outline`,description:``,params:[r(`color`,``,`#000000`),e(`thickness`,``,1,0)],gpu:`medium`},{id:`godrays`,description:``,params:[{name:`source`,type:`string`,description:`Where the rays come from: "auto" (sky sun, else the first directional / spot light, else top centre), "sun", or a light id.`,default:`auto`},e(`intensity`,``,.6,0,4),e(`length`,``,.85,0,1),e(`decay`,``,.96,.5,1),r(`color`,``),e(`size`,``,.1,0,1)],gpu:`medium`,example:{type:`godrays`,intensity:.7}},{id:`dof`,description:``,params:[e(`focus`,``,8,0),{name:`focusOn`,type:`string`,description:``},e(`aperture`,``,.002,0),e(`maxblur`,``,.01,0,.1)],gpu:`high`},{id:`lensflare`,description:``,params:[e(`intensity`,``,.5,0,4),e(`threshold`,``,1.2,0),e(`streaks`,``,1,0,4),e(`ghosts`,``,.5,0,4),e(`halo`,``,.3,0,4),r(`tint`,``,`#9fc4ff`)],gpu:`medium`,example:{type:`lensflare`,intensity:.6}},{id:`fxaa`,description:``,params:[],gpu:`low`},{id:`smaa`,description:``,params:[],gpu:`medium`},{id:`taa`,description:``,params:[t(`samples`,``,8,2,64)],gpu:`low`,example:{type:`taa`,samples:8}},{id:`tiltshift`,description:``,params:[e(`focus`,``,.5,0,1),e(`width`,``,.18,0,1),e(`blur`,``,1,0,4)],gpu:`medium`},{id:`pixelate`,description:``,params:[t(`pixelSize`,``,4,1,32)],gpu:`low`},{id:`halftone`,description:``,params:[e(`size`,``,6,2,64),e(`angle`,``,45),n(`mono`,``,!1)],gpu:`low`},{id:`ascii`,description:``,params:[e(`size`,``,8,4,64),n(`mono`,``,!1),r(`color`,``,`#33ff88`)],gpu:`low`},{id:`glitch`,description:``,params:[e(`amount`,``,.5,0,1),e(`speed`,``,1,0,20)],gpu:`low`},{id:`chromatic`,description:``,params:[e(`amount`,``,.002,0,.05),n(`radial`,``,!0)],gpu:`low`},{id:`sharpen`,description:``,params:[e(`amount`,``,.3,0,2)],gpu:`low`},{id:`grading`,description:``,params:[o(`look`,``,b,`none`),e(`intensity`,``,1,0,1),e(`exposure`,``,0,-5,5),e(`contrast`,``,1,0,3),e(`saturation`,``,1,0,3),e(`vibrance`,``,0,-1,1),e(`temperature`,``,0,-1,1),e(`tint`,``,0,-1,1),e(`lift`,``,0,-.5,.5),e(`gamma`,``,1,.2,5),e(`gain`,``,1,0,3),r(`shadows`,``),r(`highlights`,``),e(`toning`,``,0,0,1),e(`bleach`,``,0,0,1)],gpu:`low`,example:{type:`grading`,look:`teal-orange`,intensity:.8},details:{looks:S}},{id:`vignette`,description:``,params:[e(`offset`,``,1,0),e(`darkness`,``,1.1,0),r(`color`,``,`#000000`)],gpu:`low`},{id:`film`,description:``,params:[e(`intensity`,``,.35,0,1),n(`grayscale`,``,!1),e(`scanlines`,``,0,0,1),e(`size`,``,1.5,.5,8)],gpu:`low`}],T=[{id:`sans-bold`,description:``,params:[]},{id:`sans`,description:``,params:[]},{id:`inter-black`,description:``,params:[]},{id:`montserrat-extrabold`,description:``,params:[]},{id:`space-grotesk-bold`,description:``,params:[]},{id:`bebas-neue`,description:``,params:[]},{id:`anton`,description:``,params:[]},{id:`serif-bold`,description:``,params:[]},{id:`serif`,description:``,params:[]},{id:`mono`,description:``,params:[]},{id:`display`,description:``,params:[]},{id:`pacifico`,description:``,params:[]},{id:`lobster`,description:``,params:[]}],E=[{id:`coin`,description:``,params:[]},{id:`jump`,description:``,params:[]},{id:`hit`,description:``,params:[]},{id:`explosion`,description:``,params:[]},{id:`click`,description:``,params:[]},{id:`powerup`,description:``,params:[]},{id:`laser`,description:``,params:[]},{id:`win`,description:``,params:[]},{id:`lose`,description:``,params:[]},{id:`whoosh`,description:``,params:[]},{id:`ambient-pad`,description:``,params:[]},{id:`chiptune-loop`,description:``,params:[]}],D={geometries:c,materialPresets:l,shaders:u,textures:f,lightRigs:m,behaviours:g,generators:_,particlePresets:y,instanceLayouts:[{id:`grid`,description:``,params:[{name:`count`,type:`vec3`,description:``,required:!0},{name:`spacing`,type:`vec3`,description:``,required:!0}],cost:`count[0]*count[1]*count[2] * geometry`,example:{type:`grid`,count:[8,1,8],spacing:[1.2,0,1.2]}},{id:`scatter`,description:``,params:[{...t(`count`,``,void 0,1,2e5),required:!0},{name:`area`,type:`vec3`,description:``,required:!0},e(`minScale`,``,1,0),e(`maxScale`,``,1,0),n(`randomRotation`,``,!1),t(`seed`,``)],cost:`count * geometry`,example:{type:`scatter`,count:200,area:[20,0,20],minScale:.6,maxScale:1.4,randomRotation:!0,seed:3}},{id:`circle`,description:``,params:[{...t(`count`,``,void 0,1,2e5),required:!0},{...e(`radius`,``,void 0,0),required:!0}],cost:`count * geometry`,example:{type:`circle`,count:12,radius:3}},{id:`list`,description:``,params:[{name:`items`,type:`array`,description:``,required:!0}],cost:`items * geometry`,example:{type:`list`,items:[{position:[-1,0,0]},{position:[1,0,0],rotation:[0,45,0],scale:1.5}]}}],postfx:w,fonts:T,sounds:E};function O(e,t){return D[e].find(e=>e.id===t)}export{l as a,f as c,m as i,O as l,c as n,C as o,S as r,u as s,_ as t};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./toon-BsvVk_nK.js";import{t}from"./RoundedBoxGeometry-BViRogcJ.js";import{t as n}from"./params-C2uoUDJ0.js";import{a as r,n as i,o as a,r as o,s}from"./random-eeej60NW.js";import{n as c}from"./BufferGeometryUtils-XmME4f7Z.js";import{$t as l,Bt as u,Dn as d,En as f,Et as p,F as m,G as h,Gt as g,H as _,In as v,J as y,Lt as b,M as x,Mn as S,N as C,Nn as w,On as T,Pn as E,Qt as D,Rt as O,S as k,Sn as A,T as j,Tn as M,Tt as ee,U as N,Ut as P,_ as F,_n as te,_t as ne,an as I,at as re,b as L,bn as ie,bt as ae,d as oe,dn as se,en as ce,et as le,f as ue,fn as de,g as fe,gn as pe,j as me,ln as he,m as R,mn as ge,ot as _e,p as z,q as ve,rn as ye,rt as be,st as xe,un as Se,v as Ce,vt as B,w as we,yt as V}from"./three.module-DnaBiDAJ.js";var Te=class{pos=[];col=[];uv=[];wind=[];useUv=!1;useWind=!1;windFn=null;pushVertex(e,t,n,r,i=0,a=0){if(this.pos.push(e,t,n),this.col.push(r.r,r.g,r.b),this.useUv&&this.uv.push(i,a),this.useWind){let r=this.windFn?this.windFn(e,t,n):[0,0];this.wind.push(r[0],r[1])}}tri(e,t,n,r,i){this.pushVertex(e[0],e[1],e[2],r,i?.[0],i?.[1]),this.pushVertex(t[0],t[1],t[2],r,i?.[2],i?.[3]),this.pushVertex(n[0],n[1],n[2],r,i?.[4],i?.[5])}quad(e,t,n,r,i,a){this.tri(e,t,n,i,a?[a[0],a[1],a[2],a[3],a[4],a[5]]:void 0),this.tri(e,n,r,i,a?[a[0],a[1],a[4],a[5],a[6],a[7]]:void 0)}box(e,t,n,r=n,i={}){let[a,o,s]=e,[c,l,u]=t,d=(e,t,n)=>{if(!i.uv)return;let[r,a,o,s]=i.uv(e,t,n);return[r,a,o,a,o,s,r,s]},f=c-a,p=l-o,m=u-s;this.quad([a,o,u],[c,o,u],[c,l,u],[a,l,u],n,d(`z`,f,p)),this.quad([c,o,s],[a,o,s],[a,l,s],[c,l,s],n,d(`z`,f,p)),this.quad([c,o,u],[c,o,s],[c,l,s],[c,l,u],n,d(`x`,m,p)),this.quad([a,o,s],[a,o,u],[a,l,u],[a,l,s],n,d(`x`,m,p)),this.quad([a,l,u],[c,l,u],[c,l,s],[a,l,s],r,d(`y`,f,m)),i.bottom&&this.quad([a,o,s],[c,o,s],[c,o,u],[a,o,u],n,d(`y`,f,m))}add(e,t,n){let r=e.index?e.toNonIndexed():e,i=r.getAttribute(`position`),a=new w,o=[[0,0,0],[0,0,0],[0,0,0]],s=[[0,0,0],[0,0,0],[0,0,0]];for(let e=0;e<i.count/3;e++){for(let n=0;n<3;n++)a.fromBufferAttribute(i,e*3+n),s[n]=[a.x,a.y,a.z],a.applyMatrix4(t),o[n]=[a.x,a.y,a.z];let r=typeof n==`function`?n((s[0][0]+s[1][0]+s[2][0])/3,(s[0][1]+s[1][1]+s[2][1])/3,(s[0][2]+s[1][2]+s[2][2])/3,e):n;this.tri(o[0],o[1],o[2],r)}r!==e&&r.dispose()}get triangles(){return this.pos.length/9}build(){let e=new R;return e.setAttribute(`position`,new m(this.pos,3)),e.setAttribute(`color`,new m(this.col,3)),this.useUv&&e.setAttribute(`uv`,new m(this.uv,2)),this.useWind&&e.setAttribute(`aWind`,new m(this.wind,2)),e.computeVertexNormals(),e.computeBoundingBox(),e.computeBoundingSphere(),e}};function Ee(e,t,n){let r=e.getAttribute(`position`),i=/* @__PURE__ */ new Map;for(let e=0;e<r.count;e++){let a=`${r.getX(e).toFixed(4)},${r.getY(e).toFixed(4)},${r.getZ(e).toFixed(4)}`,o=i.get(a);o||(o=[(n()-.5)*t,(n()-.5)*t,(n()-.5)*t],i.set(a,o)),r.setXYZ(e,r.getX(e)+o[0],r.getY(e)+o[1],r.getZ(e)+o[2])}return r.needsUpdate=!0,e}var De=(e,t,n,r=1,i=r,a=r,o=0,s=0,c=0)=>new B().compose(new w(e,t,n),new P().setFromEuler(new x(o,s,c)),new w(r,i,a)),Oe=(e,t)=>e.clone().multiplyScalar(t);function ke(e,t,n=new L){if(e.length===1)return n.copy(e[0]);let r=Math.min(1,Math.max(0,t))*(e.length-1),i=Math.min(e.length-2,Math.floor(r));return n.copy(e[i]).lerp(e[i+1],r-i)}var H=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e)));return r*r*(3-2*r)};function Ae(e){let t=[...e.siblings.values()].filter(e=>e.heightAt&&e.object.userData.surface!==`water`),n=e.placement?.position??[0,0,0],r=e=>{let t=e.object.userData.size;if(typeof t!=`number`)return 1/0;let r=e.object.position,i=e.object.scale,a=t/2*Math.abs(i.x||1),o=t/2*Math.abs(i.z||1);return Math.abs(n[0]-r.x)<=a&&Math.abs(n[2]-r.z)<=o?a*o:-1},i=e=>{let t=r(e);return(t<0?2:0)+(e.object.userData.surface===`terrain`?0:1)+(t>0&&Number.isFinite(t)?t/1e9:.5)};t.sort((e,t)=>i(e)-i(t));for(let n of t){if(!n.heightAt)continue;let t=n.object.position,r=n.object.scale,i=e.placement?.position??[0,0,0],a=e.placement?.scale??[1,1,1],o=n.heightAt.bind(n),s=e=>(e-i[1])/(a[1]||1),c=typeof n.object.userData.waterLevel==`number`?s(n.object.userData.waterLevel*r.y+t.y):null;return{snow:typeof n.object.userData.snowLevel==`number`?s(n.object.userData.snowLevel*r.y+t.y):null,height:(e,n)=>{let c=i[0]+e*a[0],l=i[2]+n*a[2];return s(o((c-t.x)/(r.x||1),(l-t.z)/(r.z||1))*r.y+t.y)},water:c}}return null}function je(e,t,n,r=.15,i=!0){let a=null,o={x:0,y:0,z:0};for(let s=0;s<12;s++){let c=(e.next()-.5)*t[0],l=(e.next()-.5)*t[2],u=n?n.height(c,l):(e.next()-.5)*t[1];if(s===0&&(o={x:c,y:u,z:l}),!n)return{x:c,y:u,z:l};let d=n.water===null||u>n.water+r,f=!i||n.snow===null||n.snow===void 0||u<n.snow;if(d&&f)return{x:c,y:u,z:l};d&&(!a||u<a.y)&&(a={x:c,y:u,z:l})}return a??o}function Me(e={}){return new p({vertexColors:!0,flatShading:e.flat??!0,roughness:e.roughness??.9,metalness:e.metalness??0,side:e.side??0})}function Ne(e){e.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose();let n=t.material?Array.isArray(t.material)?t.material:[t.material]:[];for(let e of n){for(let t of Object.values(e))t instanceof ie&&t.dispose();e.dispose()}})}function U(e,t={}){return{object:e,dispose:()=>Ne(e),...t}}var Pe=[`sphere`,`torus`,`ring`,`pill`,`cone`,`cube`,`halfDisc`,`squiggle`,`triangle`,`star`];function Fe(e){switch(e){case`sphere`:return new de(.5,40,28);case`torus`:return new A(.38,.14,24,64);case`ring`:return new A(.42,.045,12,64);case`pill`:return new fe(.2,.6,10,24).rotateZ(Math.PI/2);case`cone`:return new k(.4,.8,40);case`cube`:return new t(.7,.7,.7,4,.08);case`halfDisc`:{let e=new we(.5,.5,.18,40,1,!1,0,Math.PI);return e.rotateX(Math.PI/2),e}case`squiggle`:{let e=Array.from({length:9},(e,t)=>new w((t/8-.5)*1.3,Math.sin(t*1.4)*.16,0));return new M(new F(e),80,.06,12,!1)}case`triangle`:{let e=new I;for(let t=0;t<3;t++){let n=Math.PI/2+t/3*Math.PI*2;t===0?e.moveTo(Math.cos(n)*.5,Math.sin(n)*.5):e.lineTo(Math.cos(n)*.5,Math.sin(n)*.5)}let t=new C(e,{depth:.16,bevelEnabled:!0,bevelThickness:.04,bevelSize:.04,bevelSegments:4});return t.center(),t}case`star`:{let e=new I;for(let t=0;t<10;t++){let n=Math.PI/2+t/10*Math.PI*2,r=t%2?.22:.5;t===0?e.moveTo(Math.cos(n)*r,Math.sin(n)*r):e.lineTo(Math.cos(n)*r,Math.sin(n)*r)}let t=new C(e,{depth:.14,bevelEnabled:!0,bevelThickness:.04,bevelSize:.03,bevelSegments:3});return t.center(),t}}}var Ie=(t,r)=>{let i=n(`abstractShapes`,t,r),a=i.int(`count`),o=i.vec3(`area`),s=i.colors(`colors`),c=i.num(`minSize`),l=Math.max(c,i.num(`maxSize`)),u=i.str(`style`),d=i.num(`motion`),f=i.raw(`shapes`),m=Array.isArray(f)?f.filter(e=>Pe.includes(e)):[],h=m.length?m:[...Pe],g=r.rng,v=[];for(let e=0;e<a;e++){let t=new w,n=-1;for(let e=0;e<14;e++){let e=new w((g.next()-.5)*o[0],(g.next()-.5)*o[1],(g.next()-.5)*o[2]),r=1/0;for(let t of v)r=Math.min(r,e.distanceTo(t.pos)-t.s*.6);r>n&&(n=r,t=e)}let r=c+(l-c)*(1-e/Math.max(1,a))**1.5*g.range(.7,1);v.push({pos:t,s:r,kind:h[e%h.length],color:s[e%s.length],rot:new x(g.range(-.6,.6),g.next()*Math.PI*2,g.range(-.8,.8)),spin:new w(g.range(-.25,.25),g.range(-.35,.35),g.range(-.2,.2)),ph:g.next()*Math.PI*2})}for(let e=v.length-1;e>0;e--){let t=Math.floor(g.next()*(e+1)),n=v[e].color;v[e].color=v[t].color,v[t].color=n}let b=u===`toon`?e({color:16777215}):u===`glossy`?new ee({color:16777215,roughness:.18,clearcoat:1,clearcoatRoughness:.08}):new p({color:16777215,roughness:.62,metalness:0}),S=new _;S.name=`abstractShapes`;let C=[];for(let e of h){let t=v.filter(t=>t.kind===e);if(!t.length)continue;let n=new y(Fe(e),b,t.length);n.name=`shapes-${e}`,n.castShadow=!0,n.receiveShadow=!0,n.userData.materialTarget=!0,t.forEach((e,t)=>n.setColorAt(t,e.color)),n.frustumCulled=!1,S.add(n),C.push({mesh:n,list:t})}let T=new B,E=new P,D=new x,O=new w,k=new w,A=e=>{for(let{mesh:t,list:n}of C)n.forEach((n,r)=>{O.copy(n.pos),O.y+=Math.sin(e*.8+n.ph)*.12*d*(.5+n.s*.5),D.set(n.rot.x+n.spin.x*e*d,n.rot.y+n.spin.y*e*d,n.rot.z+n.spin.z*e*d),E.setFromEuler(D),k.setScalar(n.s),t.setMatrixAt(r,T.compose(O,E,k))}),t.instanceMatrix.needsUpdate=!0};return A(0),U(S,{update:e=>A(e)})},Le=e=>1+2.4*(e-1)**3+1.4*(e-1)**2;function Re(e){if(!Array.isArray(e)||e.length===0)return[[3,5,4,7,6,9,8]];let t=e=>typeof e==`number`&&Number.isFinite(e)?e:e&&typeof e==`object`&&typeof e.value==`number`?e.value:0;return e.every(e=>Array.isArray(e))?e.map(e=>e.map(t)):[e.map(t)]}var ze=(e,r)=>{let i=n(`bars3d`,e,r),a=Re(i.raw(`data`)),o=a.length,s=Math.max(...a.map(e=>e.length),1),c=i.num(`barWidth`),l=i.num(`gap`),u=i.num(`maxHeight`),d=i.colors(`colors`),f=i.str(`colorBy`),m=i.str(`shape`),h=i.str(`animation`),g=i.num(`duration`),v=Math.max(1e-6,...a.flat().map(e=>Math.abs(e))),b=c+l,x;x=m===`cylinder`?new we(.5,.5,1,32):m===`box`?new ue(1,1,1):new t(1,1,1,4,.12),x.translate(0,.5,0);let S=o*s,C=new ee({roughness:.32,metalness:0,clearcoat:.6,clearcoatRoughness:.25}),T=new y(x,C,S);T.name=`bars`,T.castShadow=!0,T.receiveShadow=!0,T.userData.materialTarget=!0;let E=[],D=new L,O=0;for(let e=0;e<o;e++)for(let t=0;t<s;t++){let n=a[e][t]??0,r=Math.max(1e-4,Math.abs(n)/v*u),i=(t-(s-1)/2)*b,c=(e-(o-1)/2)*b,l=f===`row`?o>1?e/(o-1):0:f===`column`?s>1?t/(s-1):0:Math.abs(n)/v;f===`value`?ke(d,l,D):D.copy(d[(f===`row`?e:t)%d.length]),T.setColorAt(O,D),E.push({x:i,z:c,h:r,i:O,delay:(t+e*.6)/Math.max(1,s+o*.6)}),O++}let k=new B,A=new P,j=new w,M=new w,N=e=>{for(let t of E){let n=1;if(h===`grow`){let r=(e-t.delay*g*.6)/(g*.5);n=r<=0?1e-4:r>=1?1:Le(Math.min(1,r)),r>0&&r<1&&(n=Math.max(1e-4,n))}else h===`wave`&&(n=.55+.45*(.5+.5*Math.sin(e*1.6-t.x*.9-t.z*.7)));j.set(t.x,0,t.z),M.set(c,t.h*n,c),T.setMatrixAt(t.i,k.compose(j,A,M))}T.instanceMatrix.needsUpdate=!0};N(0),T.computeBoundingSphere(),T.frustumCulled=!1;let F=new _;if(F.name=`bars3d`,F.add(T),i.bool(`base`)){let e=s*b+l,n=o*b+l,r=new V(new t(e,.12,n,3,.05),new p({color:i.color(`baseColor`),roughness:.6}));r.position.y=-.06,r.receiveShadow=!0,r.castShadow=!0,r.name=`bars-base`,F.add(r)}return U(F,{update:e=>N(e)})};function Be(){let e=[],t=[],n=(n,r,i,a)=>{e.push(...n,...r,...i),t.push(a,a,a)},r=[0,0,.42],i=[0,.01,-.34],a=[0,.07,.04],o=[0,-.06,.02],s=[-.075,0,.04],c=[.075,0,.04];for(let[e,t]of[[s,a],[a,c],[c,o],[o,s]])n(r,e,t,0),n(i,t,e,0);n([0,.01,-.3],[-.14,.02,-.58],[.14,.02,-.58],0);for(let e of[-1,1]){let t=[e*.05,.01,.14],r=[e*.05,.01,-.12],i=[e*.48,0,.1],a=[e*.48,0,-.14],o=[e*1,-.01,-.26];n(t,i,a,1),n(t,a,r,1),n(i,o,a,1)}let l=new R;return l.setAttribute(`position`,new m(e,3)),l.setAttribute(`aWing`,new m(t,1)),l.computeVertexNormals(),l}var Ve=(e,t)=>{let i=n(`birds`,e,t),a=i.int(`count`),o=i.str(`mode`),s=i.vec3(`area`),c=i.num(`speed`),l=i.num(`size`),u=i.num(`spread`),d=i.str(`formation`),f=i.num(`flapSpeed`),m=i.num(`heading`)*Math.PI/180,h=i.color(`color`),g=t.rng,v=Be();v.scale(l/2,l/2,l/2);let b=new Float32Array(a),x=new Float32Array(a);for(let e=0;e<a;e++)b[e]=g.next()*Math.PI*2,x[e]=f*g.range(.82,1.18);v.setAttribute(`aPhase`,new ve(b,1)),v.setAttribute(`aRate`,new ve(x,1));let S=new p({color:16777215,roughness:.9,metalness:0,flatShading:!0,side:2}),C={uTime:{value:0}};S.onBeforeCompile=e=>{Object.assign(e.uniforms,C),e.vertexShader=`uniform float uTime;
1
+ import{t as e}from"./toon-BsvVk_nK.js";import{t}from"./RoundedBoxGeometry-BViRogcJ.js";import{t as n}from"./params-BCNrVCYZ.js";import{a as r,n as i,o as a,r as o,s}from"./random-eeej60NW.js";import{n as c}from"./BufferGeometryUtils-XmME4f7Z.js";import{$t as l,Bt as u,Dn as d,En as f,Et as p,F as m,G as h,Gt as g,H as _,In as v,J as y,Lt as b,M as x,Mn as S,N as C,Nn as w,On as T,Pn as E,Qt as D,Rt as O,S as k,Sn as A,T as j,Tn as M,Tt as ee,U as N,Ut as P,_ as F,_n as te,_t as ne,an as I,at as re,b as L,bn as ie,bt as ae,d as oe,dn as se,en as ce,et as le,f as ue,fn as de,g as fe,gn as pe,j as me,ln as he,m as R,mn as ge,ot as _e,p as z,q as ve,rn as ye,rt as be,st as xe,un as Se,v as Ce,vt as B,w as we,yt as V}from"./three.module-DnaBiDAJ.js";var Te=class{pos=[];col=[];uv=[];wind=[];useUv=!1;useWind=!1;windFn=null;pushVertex(e,t,n,r,i=0,a=0){if(this.pos.push(e,t,n),this.col.push(r.r,r.g,r.b),this.useUv&&this.uv.push(i,a),this.useWind){let r=this.windFn?this.windFn(e,t,n):[0,0];this.wind.push(r[0],r[1])}}tri(e,t,n,r,i){this.pushVertex(e[0],e[1],e[2],r,i?.[0],i?.[1]),this.pushVertex(t[0],t[1],t[2],r,i?.[2],i?.[3]),this.pushVertex(n[0],n[1],n[2],r,i?.[4],i?.[5])}quad(e,t,n,r,i,a){this.tri(e,t,n,i,a?[a[0],a[1],a[2],a[3],a[4],a[5]]:void 0),this.tri(e,n,r,i,a?[a[0],a[1],a[4],a[5],a[6],a[7]]:void 0)}box(e,t,n,r=n,i={}){let[a,o,s]=e,[c,l,u]=t,d=(e,t,n)=>{if(!i.uv)return;let[r,a,o,s]=i.uv(e,t,n);return[r,a,o,a,o,s,r,s]},f=c-a,p=l-o,m=u-s;this.quad([a,o,u],[c,o,u],[c,l,u],[a,l,u],n,d(`z`,f,p)),this.quad([c,o,s],[a,o,s],[a,l,s],[c,l,s],n,d(`z`,f,p)),this.quad([c,o,u],[c,o,s],[c,l,s],[c,l,u],n,d(`x`,m,p)),this.quad([a,o,s],[a,o,u],[a,l,u],[a,l,s],n,d(`x`,m,p)),this.quad([a,l,u],[c,l,u],[c,l,s],[a,l,s],r,d(`y`,f,m)),i.bottom&&this.quad([a,o,s],[c,o,s],[c,o,u],[a,o,u],n,d(`y`,f,m))}add(e,t,n){let r=e.index?e.toNonIndexed():e,i=r.getAttribute(`position`),a=new w,o=[[0,0,0],[0,0,0],[0,0,0]],s=[[0,0,0],[0,0,0],[0,0,0]];for(let e=0;e<i.count/3;e++){for(let n=0;n<3;n++)a.fromBufferAttribute(i,e*3+n),s[n]=[a.x,a.y,a.z],a.applyMatrix4(t),o[n]=[a.x,a.y,a.z];let r=typeof n==`function`?n((s[0][0]+s[1][0]+s[2][0])/3,(s[0][1]+s[1][1]+s[2][1])/3,(s[0][2]+s[1][2]+s[2][2])/3,e):n;this.tri(o[0],o[1],o[2],r)}r!==e&&r.dispose()}get triangles(){return this.pos.length/9}build(){let e=new R;return e.setAttribute(`position`,new m(this.pos,3)),e.setAttribute(`color`,new m(this.col,3)),this.useUv&&e.setAttribute(`uv`,new m(this.uv,2)),this.useWind&&e.setAttribute(`aWind`,new m(this.wind,2)),e.computeVertexNormals(),e.computeBoundingBox(),e.computeBoundingSphere(),e}};function Ee(e,t,n){let r=e.getAttribute(`position`),i=/* @__PURE__ */ new Map;for(let e=0;e<r.count;e++){let a=`${r.getX(e).toFixed(4)},${r.getY(e).toFixed(4)},${r.getZ(e).toFixed(4)}`,o=i.get(a);o||(o=[(n()-.5)*t,(n()-.5)*t,(n()-.5)*t],i.set(a,o)),r.setXYZ(e,r.getX(e)+o[0],r.getY(e)+o[1],r.getZ(e)+o[2])}return r.needsUpdate=!0,e}var De=(e,t,n,r=1,i=r,a=r,o=0,s=0,c=0)=>new B().compose(new w(e,t,n),new P().setFromEuler(new x(o,s,c)),new w(r,i,a)),Oe=(e,t)=>e.clone().multiplyScalar(t);function ke(e,t,n=new L){if(e.length===1)return n.copy(e[0]);let r=Math.min(1,Math.max(0,t))*(e.length-1),i=Math.min(e.length-2,Math.floor(r));return n.copy(e[i]).lerp(e[i+1],r-i)}var H=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e)));return r*r*(3-2*r)};function Ae(e){let t=[...e.siblings.values()].filter(e=>e.heightAt&&e.object.userData.surface!==`water`),n=e.placement?.position??[0,0,0],r=e=>{let t=e.object.userData.size;if(typeof t!=`number`)return 1/0;let r=e.object.position,i=e.object.scale,a=t/2*Math.abs(i.x||1),o=t/2*Math.abs(i.z||1);return Math.abs(n[0]-r.x)<=a&&Math.abs(n[2]-r.z)<=o?a*o:-1},i=e=>{let t=r(e);return(t<0?2:0)+(e.object.userData.surface===`terrain`?0:1)+(t>0&&Number.isFinite(t)?t/1e9:.5)};t.sort((e,t)=>i(e)-i(t));for(let n of t){if(!n.heightAt)continue;let t=n.object.position,r=n.object.scale,i=e.placement?.position??[0,0,0],a=e.placement?.scale??[1,1,1],o=n.heightAt.bind(n),s=e=>(e-i[1])/(a[1]||1),c=typeof n.object.userData.waterLevel==`number`?s(n.object.userData.waterLevel*r.y+t.y):null;return{snow:typeof n.object.userData.snowLevel==`number`?s(n.object.userData.snowLevel*r.y+t.y):null,height:(e,n)=>{let c=i[0]+e*a[0],l=i[2]+n*a[2];return s(o((c-t.x)/(r.x||1),(l-t.z)/(r.z||1))*r.y+t.y)},water:c}}return null}function je(e,t,n,r=.15,i=!0){let a=null,o={x:0,y:0,z:0};for(let s=0;s<12;s++){let c=(e.next()-.5)*t[0],l=(e.next()-.5)*t[2],u=n?n.height(c,l):(e.next()-.5)*t[1];if(s===0&&(o={x:c,y:u,z:l}),!n)return{x:c,y:u,z:l};let d=n.water===null||u>n.water+r,f=!i||n.snow===null||n.snow===void 0||u<n.snow;if(d&&f)return{x:c,y:u,z:l};d&&(!a||u<a.y)&&(a={x:c,y:u,z:l})}return a??o}function Me(e={}){return new p({vertexColors:!0,flatShading:e.flat??!0,roughness:e.roughness??.9,metalness:e.metalness??0,side:e.side??0})}function Ne(e){e.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose();let n=t.material?Array.isArray(t.material)?t.material:[t.material]:[];for(let e of n){for(let t of Object.values(e))t instanceof ie&&t.dispose();e.dispose()}})}function U(e,t={}){return{object:e,dispose:()=>Ne(e),...t}}var Pe=[`sphere`,`torus`,`ring`,`pill`,`cone`,`cube`,`halfDisc`,`squiggle`,`triangle`,`star`];function Fe(e){switch(e){case`sphere`:return new de(.5,40,28);case`torus`:return new A(.38,.14,24,64);case`ring`:return new A(.42,.045,12,64);case`pill`:return new fe(.2,.6,10,24).rotateZ(Math.PI/2);case`cone`:return new k(.4,.8,40);case`cube`:return new t(.7,.7,.7,4,.08);case`halfDisc`:{let e=new we(.5,.5,.18,40,1,!1,0,Math.PI);return e.rotateX(Math.PI/2),e}case`squiggle`:{let e=Array.from({length:9},(e,t)=>new w((t/8-.5)*1.3,Math.sin(t*1.4)*.16,0));return new M(new F(e),80,.06,12,!1)}case`triangle`:{let e=new I;for(let t=0;t<3;t++){let n=Math.PI/2+t/3*Math.PI*2;t===0?e.moveTo(Math.cos(n)*.5,Math.sin(n)*.5):e.lineTo(Math.cos(n)*.5,Math.sin(n)*.5)}let t=new C(e,{depth:.16,bevelEnabled:!0,bevelThickness:.04,bevelSize:.04,bevelSegments:4});return t.center(),t}case`star`:{let e=new I;for(let t=0;t<10;t++){let n=Math.PI/2+t/10*Math.PI*2,r=t%2?.22:.5;t===0?e.moveTo(Math.cos(n)*r,Math.sin(n)*r):e.lineTo(Math.cos(n)*r,Math.sin(n)*r)}let t=new C(e,{depth:.14,bevelEnabled:!0,bevelThickness:.04,bevelSize:.03,bevelSegments:3});return t.center(),t}}}var Ie=(t,r)=>{let i=n(`abstractShapes`,t,r),a=i.int(`count`),o=i.vec3(`area`),s=i.colors(`colors`),c=i.num(`minSize`),l=Math.max(c,i.num(`maxSize`)),u=i.str(`style`),d=i.num(`motion`),f=i.raw(`shapes`),m=Array.isArray(f)?f.filter(e=>Pe.includes(e)):[],h=m.length?m:[...Pe],g=r.rng,v=[];for(let e=0;e<a;e++){let t=new w,n=-1;for(let e=0;e<14;e++){let e=new w((g.next()-.5)*o[0],(g.next()-.5)*o[1],(g.next()-.5)*o[2]),r=1/0;for(let t of v)r=Math.min(r,e.distanceTo(t.pos)-t.s*.6);r>n&&(n=r,t=e)}let r=c+(l-c)*(1-e/Math.max(1,a))**1.5*g.range(.7,1);v.push({pos:t,s:r,kind:h[e%h.length],color:s[e%s.length],rot:new x(g.range(-.6,.6),g.next()*Math.PI*2,g.range(-.8,.8)),spin:new w(g.range(-.25,.25),g.range(-.35,.35),g.range(-.2,.2)),ph:g.next()*Math.PI*2})}for(let e=v.length-1;e>0;e--){let t=Math.floor(g.next()*(e+1)),n=v[e].color;v[e].color=v[t].color,v[t].color=n}let b=u===`toon`?e({color:16777215}):u===`glossy`?new ee({color:16777215,roughness:.18,clearcoat:1,clearcoatRoughness:.08}):new p({color:16777215,roughness:.62,metalness:0}),S=new _;S.name=`abstractShapes`;let C=[];for(let e of h){let t=v.filter(t=>t.kind===e);if(!t.length)continue;let n=new y(Fe(e),b,t.length);n.name=`shapes-${e}`,n.castShadow=!0,n.receiveShadow=!0,n.userData.materialTarget=!0,t.forEach((e,t)=>n.setColorAt(t,e.color)),n.frustumCulled=!1,S.add(n),C.push({mesh:n,list:t})}let T=new B,E=new P,D=new x,O=new w,k=new w,A=e=>{for(let{mesh:t,list:n}of C)n.forEach((n,r)=>{O.copy(n.pos),O.y+=Math.sin(e*.8+n.ph)*.12*d*(.5+n.s*.5),D.set(n.rot.x+n.spin.x*e*d,n.rot.y+n.spin.y*e*d,n.rot.z+n.spin.z*e*d),E.setFromEuler(D),k.setScalar(n.s),t.setMatrixAt(r,T.compose(O,E,k))}),t.instanceMatrix.needsUpdate=!0};return A(0),U(S,{update:e=>A(e)})},Le=e=>1+2.4*(e-1)**3+1.4*(e-1)**2;function Re(e){if(!Array.isArray(e)||e.length===0)return[[3,5,4,7,6,9,8]];let t=e=>typeof e==`number`&&Number.isFinite(e)?e:e&&typeof e==`object`&&typeof e.value==`number`?e.value:0;return e.every(e=>Array.isArray(e))?e.map(e=>e.map(t)):[e.map(t)]}var ze=(e,r)=>{let i=n(`bars3d`,e,r),a=Re(i.raw(`data`)),o=a.length,s=Math.max(...a.map(e=>e.length),1),c=i.num(`barWidth`),l=i.num(`gap`),u=i.num(`maxHeight`),d=i.colors(`colors`),f=i.str(`colorBy`),m=i.str(`shape`),h=i.str(`animation`),g=i.num(`duration`),v=Math.max(1e-6,...a.flat().map(e=>Math.abs(e))),b=c+l,x;x=m===`cylinder`?new we(.5,.5,1,32):m===`box`?new ue(1,1,1):new t(1,1,1,4,.12),x.translate(0,.5,0);let S=o*s,C=new ee({roughness:.32,metalness:0,clearcoat:.6,clearcoatRoughness:.25}),T=new y(x,C,S);T.name=`bars`,T.castShadow=!0,T.receiveShadow=!0,T.userData.materialTarget=!0;let E=[],D=new L,O=0;for(let e=0;e<o;e++)for(let t=0;t<s;t++){let n=a[e][t]??0,r=Math.max(1e-4,Math.abs(n)/v*u),i=(t-(s-1)/2)*b,c=(e-(o-1)/2)*b,l=f===`row`?o>1?e/(o-1):0:f===`column`?s>1?t/(s-1):0:Math.abs(n)/v;f===`value`?ke(d,l,D):D.copy(d[(f===`row`?e:t)%d.length]),T.setColorAt(O,D),E.push({x:i,z:c,h:r,i:O,delay:(t+e*.6)/Math.max(1,s+o*.6)}),O++}let k=new B,A=new P,j=new w,M=new w,N=e=>{for(let t of E){let n=1;if(h===`grow`){let r=(e-t.delay*g*.6)/(g*.5);n=r<=0?1e-4:r>=1?1:Le(Math.min(1,r)),r>0&&r<1&&(n=Math.max(1e-4,n))}else h===`wave`&&(n=.55+.45*(.5+.5*Math.sin(e*1.6-t.x*.9-t.z*.7)));j.set(t.x,0,t.z),M.set(c,t.h*n,c),T.setMatrixAt(t.i,k.compose(j,A,M))}T.instanceMatrix.needsUpdate=!0};N(0),T.computeBoundingSphere(),T.frustumCulled=!1;let F=new _;if(F.name=`bars3d`,F.add(T),i.bool(`base`)){let e=s*b+l,n=o*b+l,r=new V(new t(e,.12,n,3,.05),new p({color:i.color(`baseColor`),roughness:.6}));r.position.y=-.06,r.receiveShadow=!0,r.castShadow=!0,r.name=`bars-base`,F.add(r)}return U(F,{update:e=>N(e)})};function Be(){let e=[],t=[],n=(n,r,i,a)=>{e.push(...n,...r,...i),t.push(a,a,a)},r=[0,0,.42],i=[0,.01,-.34],a=[0,.07,.04],o=[0,-.06,.02],s=[-.075,0,.04],c=[.075,0,.04];for(let[e,t]of[[s,a],[a,c],[c,o],[o,s]])n(r,e,t,0),n(i,t,e,0);n([0,.01,-.3],[-.14,.02,-.58],[.14,.02,-.58],0);for(let e of[-1,1]){let t=[e*.05,.01,.14],r=[e*.05,.01,-.12],i=[e*.48,0,.1],a=[e*.48,0,-.14],o=[e*1,-.01,-.26];n(t,i,a,1),n(t,a,r,1),n(i,o,a,1)}let l=new R;return l.setAttribute(`position`,new m(e,3)),l.setAttribute(`aWing`,new m(t,1)),l.computeVertexNormals(),l}var Ve=(e,t)=>{let i=n(`birds`,e,t),a=i.int(`count`),o=i.str(`mode`),s=i.vec3(`area`),c=i.num(`speed`),l=i.num(`size`),u=i.num(`spread`),d=i.str(`formation`),f=i.num(`flapSpeed`),m=i.num(`heading`)*Math.PI/180,h=i.color(`color`),g=t.rng,v=Be();v.scale(l/2,l/2,l/2);let b=new Float32Array(a),x=new Float32Array(a);for(let e=0;e<a;e++)b[e]=g.next()*Math.PI*2,x[e]=f*g.range(.82,1.18);v.setAttribute(`aPhase`,new ve(b,1)),v.setAttribute(`aRate`,new ve(x,1));let S=new p({color:16777215,roughness:.9,metalness:0,flatShading:!0,side:2}),C={uTime:{value:0}};S.onBeforeCompile=e=>{Object.assign(e.uniforms,C),e.vertexShader=`uniform float uTime;
2
2
  attribute float aWing;
3
3
  attribute float aPhase;
4
4
  attribute float aRate;
@@ -1,4 +1,4 @@
1
- import{Ct as e,Et as t,Gt as n,Mn as r,Qt as i,St as a,T as o,Tt as s,b as c,bt as l,en as u,h as d,ht as f,kn as p,n as m,ot as h,st as g,wt as _}from"./three.module-DnaBiDAJ.js";import{a as v,c as y}from"./catalog-DL6sgPay.js";import{c as b,d as x,i as ee,t as S}from"./util-CyaW1fcW.js";import{n as te}from"./params-C2uoUDJ0.js";import{t as ne}from"./random-eeej60NW.js";import{t as C}from"./toon-BsvVk_nK.js";function w(e){return e.endsWith(`/`)?e:e+`/`}function T(e){let t=w(e.assetBase??`./`),n=w(e.libraryBase??t+`assets/library/`),r=e.assetUrls??{};return e=>{if(r[e])return r[e];if(/^(https?:|data:|blob:|\/)/.test(e))return e;if(e.startsWith(`library:`)){let t=e.slice(8);return t.startsWith(`fonts/`)&&!/\.json$/.test(t)&&(t+=`.typeface.json`),r[`library:`+t]?r[`library:`+t]:n+t}return t+e.replace(/^\.\//,``)}}var E=/* @__PURE__ */ new Map;function D(e){let t=E.get(e);return t||(t=fetch(e).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status} for ${e}`);return t.text()}),t.catch(()=>E.delete(e)),E.set(e,t)),t}async function O(e){return JSON.parse(await D(e))}var k=/* @__PURE__ */ new Map;function A(e){let t=k.get(e);return t||(t=import(`./three.module-DnaBiDAJ.js`).then(e=>e.a).then(t=>new Promise((n,r)=>{new t.TextureLoader().load(e,n,void 0,()=>r(/* @__PURE__ */ Error(`Cannot load texture ${e}`)))})),t.catch(()=>k.delete(e)),k.set(e,t)),t.then(e=>{let t=e.clone();return t.needsUpdate=!0,t})}var j={map:`color`,emissiveMap:`color`,normalMap:`normal`,roughnessMap:`data`,metalnessMap:`data`,aoMap:`data`,bumpMap:`data`,displacementMap:`data`,alphaMap:`data`},M=class{perm=/* @__PURE__ */ new Uint16Array(512);grads=/* @__PURE__ */ new Float32Array(512);constructor(e){let t=ne(e),n=Array.from({length:256},(e,t)=>t);for(let e=255;e>0;e--){let r=Math.floor(t.next()*(e+1));[n[e],n[r]]=[n[r],n[e]]}for(let e=0;e<512;e++)this.perm[e]=n[e&255];for(let e=0;e<256;e++){let n=t.next()*Math.PI*2;this.grads[e*2]=Math.cos(n),this.grads[e*2+1]=Math.sin(n)}}g(e,t,n,r,i,a){let o=(e%n+n)%n,s=(t%r+r)%r,c=this.perm[this.perm[o&255]+s&511]&255;return this.grads[c*2]*i+this.grads[c*2+1]*a}noise(e,t,n,r){let i=Math.floor(e),a=Math.floor(t),o=e-i,s=t-a,c=o*o*o*(o*(o*6-15)+10),l=s*s*s*(s*(s*6-15)+10),u=this.g(i,a,n,r,o,s),d=this.g(i+1,a,n,r,o-1,s),f=this.g(i,a+1,n,r,o,s-1),p=this.g(i+1,a+1,n,r,o-1,s-1);return(u+(d-u)*c+(f-u)*l+(u-d-f+p)*c*l)*1.4}fbm(e,t,n,r,i=n){let a=0,o=.5,s=0,c=n,l=i;for(let n=0;n<r;n++)a+=o*this.noise(e*c,t*l,c,l),s+=o,o*=.5,c*=2,l*=2;return a/s}},N=(e,t,n)=>{let r=Math.imul(e|0,374761393)+Math.imul(t|0,668265263)+Math.imul(n|0,2246822519)|0;return r=Math.imul(r^r>>>13,1274126177),r^=r>>>16,(r>>>0)/4294967296},P=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e||1e-6)));return r*r*(3-2*r)},F=e=>e-Math.floor(e);function I(e,t,n,r,i){let a=e*n,o=t*n,s=Math.floor(a),c=Math.floor(o),l=9,u=9,d=0,f=0;for(let e=-1;e<=1;e++)for(let t=-1;t<=1;t++){let p=s+t,m=c+e,h=(p%n+n)%n,g=(m%n+n)%n,_=p+.5+(N(h,g,i)-.5)*r,v=m+.5+(N(h,g,i+17)-.5)*r,y=Math.hypot(_-a,v-o);y<l?(u=l,l=y,d=h,f=g):y<u&&(u=y)}return{f1:l,f2:u,cx:d,cy:f}}var L={marble(e,t){let n=e.num(`scale`),r=Math.max(1,Math.round(2*n)),i=2+e.num(`veins`)*22,a=e.num(`turbulence`);return{h(e,n){let o=t.fbm(e,n,r*2,5),s=t.fbm(e+.37,n+.71,r*2,5),c=t.fbm(e+o*.12*a,n+s*.12*a,r*3,6),l=(e*.6+n)*r+a*2.6*c,u=(1-Math.abs(Math.sin(Math.PI*l)))**i,d=t.fbm(e+.5,n,r*6,5),f=(1-Math.abs(Math.sin(Math.PI*(l*2.3+d*3))))**(i*2.5)*.45,p=(t.fbm(e,n+.3,r*2,4)*.5+.5)*.18;return Math.min(1,u*.9+f+p)}}},wood(e,t){let n=e.num(`scale`),r=e.num(`rings`),i=e.num(`grain`),a=Math.max(1,Math.round(n));return{h(e,o){let s=t.fbm(e,o,2*a,4,1*a),c=F(e*Math.round(r*n)+s*1.8),l=P(0,.7,c)*(1-P(.85,1,c)),u=t.noise(e*64*a,o*3*a,64*a,3*a)*.5+.5;return Math.min(1,Math.max(0,l*.75+u*i*.35+(s*.5+.5)*.15))}}},terrazzo(e,t,n){let r=Math.max(2,Math.round(10*e.num(`scale`)/e.num(`chipSize`))),i=e.num(`density`),a=Math.max(1,e.colors(`colors`).length-1),o=(e,o)=>{let s=I(e,o,r,1,n);if(N(s.cx,s.cy,n+5)>i)return{m:0,idx:-1};let c=.18+N(s.cx,s.cy,n+9)*.3,l=s.f1+t.noise(e*r*4,o*r*4,r*4,r*4)*.08;return{m:1-P(c-.03,c+.01,l),idx:1+Math.floor(N(s.cx,s.cy,n+3)*a)}};return{h(e,t){return o(e,t).m},pick(e,t){let n=o(e,t);return n.m>.5?n.idx:-1}}},carbon(e,t){let n=Math.max(2,Math.round(8*e.num(`scale`)));return{h(e,r){let i=e*n,a=r*n,o=Math.floor(i),s=Math.floor(a),c=i-o,l=a-s,u=((o+s)%4+4)%4<2,d=u?l:c,f=u?e:r,p=Math.sin(Math.PI*d),m=t.noise(f*n*2,d*40,n*2,40)*.5+.5;return Math.min(1,p*(u?.85:.45)*(.75+m*.25))}}},noise(e,t){let n=Math.max(1,Math.round(4*e.num(`scale`))),r=e.int(`octaves`),i=e.num(`contrast`);return{h:(e,a)=>Math.min(1,Math.max(0,.5+t.fbm(e,a,n,r)*.5*i*1.6))}},voronoi(e,t,n){let r=Math.max(1,Math.round(8*e.num(`scale`))),i=e.num(`jitter`);return{h(e,t){let a=I(e,t,r,i,n);return P(0,.25,a.f2-a.f1)}}},flakes(e,t,n){let r=Math.max(4,Math.round(64*e.num(`scale`))),i=e.num(`strength`);return{h(e,t){return N(Math.floor(e*r),Math.floor(t*r),n)},normal(e,t,a){let o=I(e,t,r,1,n),s=N(o.cx,o.cy,n+1)*Math.PI*2,c=Math.sqrt(N(o.cx,o.cy,n+2))*i,l=Math.cos(s)*c,u=Math.sin(s)*c;a[0]=l,a[1]=u,a[2]=Math.sqrt(Math.max(0,1-l*l-u*u))}}},brushed(e,t){let n=Math.max(1,Math.round(e.num(`scale`))),r=e.num(`streaks`),i=Math.max(8,Math.round(300*r*n));return{h(e,r){let a=t.noise(e*2*n,r*i,2*n,i)*.5+.5,o=t.noise(e*6*n,r*i*2.5,6*n,Math.round(i*2.5))*.5+.5,s=t.fbm(e,r,3*n,3)*.5+.5;return Math.min(1,Math.max(0,a*.5+o*.3+s*.2))}}},grid(e,t,n,r){let i=Math.max(1,Math.round(e.int(`cells`)*e.num(`scale`))),a=i/r,o=Math.max(e.num(`lineWidth`)*.5,a*.75);return{h(e,t){let n=F(e*i),r=F(t*i),s=Math.min(n,1-n,r,1-r);return 1-P(o-a*.5,o+a*.5,s)}}},checker(e){let t=Math.max(1,Math.round(e.int(`cells`)*e.num(`scale`)));return{h:(e,n)=>Math.floor(e*t)+Math.floor(n*t)&1?1:0}},stripes(e){let t=Math.max(1,Math.round(e.int(`count`)*e.num(`scale`))),n=e.num(`angle`)*Math.PI/180,r=Math.round(Math.cos(n)*t),i=Math.round(Math.sin(n)*t),a=Math.max(.002,e.num(`softness`));return{h(e,t){let n=Math.abs(F(e*r+t*i)-.5)*2;return P(.5-a*2,.5+a*2,n)}}},dots(e){let t=Math.max(1,Math.round(e.int(`cells`)*e.num(`scale`))),n=e.num(`radius`);return{h(e,r){let i=F(e*t)-.5,a=F(r*t)-.5;return 1-P(n-.02,n+.01,Math.hypot(i,a))}}}};Object.keys(L);var R=e=>{let t=e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(t*255)))},z=/* @__PURE__ */ new Map;function re(e){return 2**Math.round(Math.log2(Math.max(32,Math.min(2048,e))))}function ie(e,t){let n=t+`:`+JSON.stringify(e),r=z.get(n);if(r)return r;let i=y.find(t=>t.id===e.procedural),a=L[e.procedural];if(!i||!a)throw Error(`Unknown procedural texture "${e.procedural}"`);let o=te(i,e),s=o.int(`seed`),c=re(o.int(`resolution`)),l=a(o,new M(s),s,c),u=new Uint8Array(c*c*4),d=new Float32Array(c*c);for(let e=0;e<c;e++){let t=(e+.5)/c;for(let n=0;n<c;n++)d[e*c+n]=l.h((n+.5)/c,t)}if(t===`color`){let e=o.colors(`colors`).map(e=>[e.r,e.g,e.b]),t=e.length;for(let n=0;n<c;n++)for(let r=0;r<c;r++){let i=n*c+r,a,o,s,f=l.pick?l.pick((r+.5)/c,(n+.5)/c):-1;if(f>=0)[a,o,s]=e[Math.min(f,t-1)];else if(l.pick)[a,o,s]=e[0];else{let n=Math.min(1,Math.max(0,d[i]))*(t-1),r=Math.min(t-2,Math.floor(n)),c=t>1?n-r:0,l=e[Math.max(0,r)],u=e[Math.min(t-1,r+1)];a=l[0]+(u[0]-l[0])*c,o=l[1]+(u[1]-l[1])*c,s=l[2]+(u[2]-l[2])*c}u[i*4]=R(a),u[i*4+1]=R(o),u[i*4+2]=R(s),u[i*4+3]=255}}else if(t===`normal`){let e=[0,0,1],t=c/256*2;for(let n=0;n<c;n++)for(let r=0;r<c;r++){let i=n*c+r,a,o,s;if(l.normal)l.normal((r+.5)/c,(n+.5)/c,e),[a,o,s]=e;else{let e=(e,t)=>d[(t+c)%c*c+(e+c)%c],i=(e(r+1,n-1)+2*e(r+1,n)+e(r+1,n+1)-e(r-1,n-1)-2*e(r-1,n)-e(r-1,n+1))/8,l=(e(r-1,n+1)+2*e(r,n+1)+e(r+1,n+1)-e(r-1,n-1)-2*e(r,n-1)-e(r+1,n-1))/8;a=-i*t,o=-l*t,s=1;let u=Math.hypot(a,o,s);a/=u,o/=u,s/=u}u[i*4]=Math.round((a*.5+.5)*255),u[i*4+1]=Math.round((o*.5+.5)*255),u[i*4+2]=Math.round((s*.5+.5)*255),u[i*4+3]=255}}else for(let e=0;e<c*c;e++){let t=Math.round(Math.min(1,Math.max(0,d[e]))*255);u[e*4]=u[e*4+1]=u[e*4+2]=t,u[e*4+3]=255}let f={data:u,size:c};return z.size>64&&z.clear(),z.set(n,f),f}function ae(e,t){let r=ie(e,t),a=new o(r.data,r.size,r.size,n,p);return a.colorSpace=t===`color`?u:``,a.wrapS=a.wrapT=i,a.magFilter=h,a.minFilter=g,a.generateMipmaps=!0,a.anisotropy=4,a.needsUpdate=!0,a.name=`procedural:${e.procedural}`,a}v.map(e=>e.id);function B(e){let t=e??{},n={...(t.preset?v.find(e=>e.id===t.preset):void 0)?.props??{}};for(let[e,r]of Object.entries(t))r!==void 0&&e!==`preset`&&(n[e]=r);return n.type||=n.shader?`shader`:n.gradient?`gradient`:`standard`,n}function V(e,t,n){let r=e.userData.a3dPatches;if(!r){r=e.userData.a3dPatches=[];let t=e.onBeforeCompile;if(t!==f.prototype.onBeforeCompile){let n=e.customProgramCacheKey.call(e);r.push({key:`own(${n})`,patch:(n,r)=>t.call(e,n,r)})}}if(r.some(e=>e.key===t))return;r.push({key:t,patch:n});let i=r;e.onBeforeCompile=(e,t)=>{for(let n of i)n.patch(e,t)},e.customProgramCacheKey=()=>`agent3d:`+i.map(e=>e.key).join(`+`),e.needsUpdate=!0}var H=null;function U(){if(H)return H;if(typeof document>`u`)return null;let e=document.createElement(`canvas`);e.width=e.height=256;let t=e.getContext(`2d`);if(!t)return null;let n=t.createRadialGradient(97.28,81.92,5.12,128,128,133.12);n.addColorStop(0,`#ffffff`),n.addColorStop(.25,`#e6e6ea`),n.addColorStop(.7,`#7d7f88`),n.addColorStop(1,`#2a2b30`),t.fillStyle=n,t.fillRect(0,0,256,256);let r=t.createRadialGradient(128,128,102.4,128,128,128);return r.addColorStop(0,`rgba(255,255,255,0)`),r.addColorStop(1,`rgba(200,210,255,0.35)`),t.fillStyle=r,t.fillRect(0,0,256,256),H=new d(e),H.colorSpace=u,H}var W={front:0,back:1,double:2},G=8;function K(e,t,n=!1){let r=t.slice(0,G).map(e=>x(e));for(;r.length<G;)r.push(r[r.length-1].clone());let i={uGradColors:{value:r},uGradCount:{value:Math.min(Math.max(t.length,1),G)},uGradMin:{value:-.5},uGradMax:{value:.5}};return V(e,n?`gradient-emissive`:`gradient`,e=>{Object.assign(e.uniforms,i),e.vertexShader=`varying float vGradY;
1
+ import{Ct as e,Et as t,Gt as n,Mn as r,Qt as i,St as a,T as o,Tt as s,b as c,bt as l,en as u,h as d,ht as f,kn as p,n as m,ot as h,st as g,wt as _}from"./three.module-DnaBiDAJ.js";import{a as v,c as y}from"./catalog--OTp4gjy.js";import{c as b,d as x,i as ee,t as S}from"./util-CyaW1fcW.js";import{n as te}from"./params-BCNrVCYZ.js";import{t as ne}from"./random-eeej60NW.js";import{t as C}from"./toon-BsvVk_nK.js";function w(e){return e.endsWith(`/`)?e:e+`/`}function T(e){let t=w(e.assetBase??`./`),n=w(e.libraryBase??t+`assets/library/`),r=e.assetUrls??{};return e=>{if(r[e])return r[e];if(/^(https?:|data:|blob:|\/)/.test(e))return e;if(e.startsWith(`library:`)){let t=e.slice(8);return t.startsWith(`fonts/`)&&!/\.json$/.test(t)&&(t+=`.typeface.json`),r[`library:`+t]?r[`library:`+t]:n+t}return t+e.replace(/^\.\//,``)}}var E=/* @__PURE__ */ new Map;function D(e){let t=E.get(e);return t||(t=fetch(e).then(t=>{if(!t.ok)throw Error(`HTTP ${t.status} for ${e}`);return t.text()}),t.catch(()=>E.delete(e)),E.set(e,t)),t}async function O(e){return JSON.parse(await D(e))}var k=/* @__PURE__ */ new Map;function A(e){let t=k.get(e);return t||(t=import(`./three.module-DnaBiDAJ.js`).then(e=>e.a).then(t=>new Promise((n,r)=>{new t.TextureLoader().load(e,n,void 0,()=>r(/* @__PURE__ */ Error(`Cannot load texture ${e}`)))})),t.catch(()=>k.delete(e)),k.set(e,t)),t.then(e=>{let t=e.clone();return t.needsUpdate=!0,t})}var j={map:`color`,emissiveMap:`color`,normalMap:`normal`,roughnessMap:`data`,metalnessMap:`data`,aoMap:`data`,bumpMap:`data`,displacementMap:`data`,alphaMap:`data`},M=class{perm=/* @__PURE__ */ new Uint16Array(512);grads=/* @__PURE__ */ new Float32Array(512);constructor(e){let t=ne(e),n=Array.from({length:256},(e,t)=>t);for(let e=255;e>0;e--){let r=Math.floor(t.next()*(e+1));[n[e],n[r]]=[n[r],n[e]]}for(let e=0;e<512;e++)this.perm[e]=n[e&255];for(let e=0;e<256;e++){let n=t.next()*Math.PI*2;this.grads[e*2]=Math.cos(n),this.grads[e*2+1]=Math.sin(n)}}g(e,t,n,r,i,a){let o=(e%n+n)%n,s=(t%r+r)%r,c=this.perm[this.perm[o&255]+s&511]&255;return this.grads[c*2]*i+this.grads[c*2+1]*a}noise(e,t,n,r){let i=Math.floor(e),a=Math.floor(t),o=e-i,s=t-a,c=o*o*o*(o*(o*6-15)+10),l=s*s*s*(s*(s*6-15)+10),u=this.g(i,a,n,r,o,s),d=this.g(i+1,a,n,r,o-1,s),f=this.g(i,a+1,n,r,o,s-1),p=this.g(i+1,a+1,n,r,o-1,s-1);return(u+(d-u)*c+(f-u)*l+(u-d-f+p)*c*l)*1.4}fbm(e,t,n,r,i=n){let a=0,o=.5,s=0,c=n,l=i;for(let n=0;n<r;n++)a+=o*this.noise(e*c,t*l,c,l),s+=o,o*=.5,c*=2,l*=2;return a/s}},N=(e,t,n)=>{let r=Math.imul(e|0,374761393)+Math.imul(t|0,668265263)+Math.imul(n|0,2246822519)|0;return r=Math.imul(r^r>>>13,1274126177),r^=r>>>16,(r>>>0)/4294967296},P=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e||1e-6)));return r*r*(3-2*r)},F=e=>e-Math.floor(e);function I(e,t,n,r,i){let a=e*n,o=t*n,s=Math.floor(a),c=Math.floor(o),l=9,u=9,d=0,f=0;for(let e=-1;e<=1;e++)for(let t=-1;t<=1;t++){let p=s+t,m=c+e,h=(p%n+n)%n,g=(m%n+n)%n,_=p+.5+(N(h,g,i)-.5)*r,v=m+.5+(N(h,g,i+17)-.5)*r,y=Math.hypot(_-a,v-o);y<l?(u=l,l=y,d=h,f=g):y<u&&(u=y)}return{f1:l,f2:u,cx:d,cy:f}}var L={marble(e,t){let n=e.num(`scale`),r=Math.max(1,Math.round(2*n)),i=2+e.num(`veins`)*22,a=e.num(`turbulence`);return{h(e,n){let o=t.fbm(e,n,r*2,5),s=t.fbm(e+.37,n+.71,r*2,5),c=t.fbm(e+o*.12*a,n+s*.12*a,r*3,6),l=(e*.6+n)*r+a*2.6*c,u=(1-Math.abs(Math.sin(Math.PI*l)))**i,d=t.fbm(e+.5,n,r*6,5),f=(1-Math.abs(Math.sin(Math.PI*(l*2.3+d*3))))**(i*2.5)*.45,p=(t.fbm(e,n+.3,r*2,4)*.5+.5)*.18;return Math.min(1,u*.9+f+p)}}},wood(e,t){let n=e.num(`scale`),r=e.num(`rings`),i=e.num(`grain`),a=Math.max(1,Math.round(n));return{h(e,o){let s=t.fbm(e,o,2*a,4,1*a),c=F(e*Math.round(r*n)+s*1.8),l=P(0,.7,c)*(1-P(.85,1,c)),u=t.noise(e*64*a,o*3*a,64*a,3*a)*.5+.5;return Math.min(1,Math.max(0,l*.75+u*i*.35+(s*.5+.5)*.15))}}},terrazzo(e,t,n){let r=Math.max(2,Math.round(10*e.num(`scale`)/e.num(`chipSize`))),i=e.num(`density`),a=Math.max(1,e.colors(`colors`).length-1),o=(e,o)=>{let s=I(e,o,r,1,n);if(N(s.cx,s.cy,n+5)>i)return{m:0,idx:-1};let c=.18+N(s.cx,s.cy,n+9)*.3,l=s.f1+t.noise(e*r*4,o*r*4,r*4,r*4)*.08;return{m:1-P(c-.03,c+.01,l),idx:1+Math.floor(N(s.cx,s.cy,n+3)*a)}};return{h(e,t){return o(e,t).m},pick(e,t){let n=o(e,t);return n.m>.5?n.idx:-1}}},carbon(e,t){let n=Math.max(2,Math.round(8*e.num(`scale`)));return{h(e,r){let i=e*n,a=r*n,o=Math.floor(i),s=Math.floor(a),c=i-o,l=a-s,u=((o+s)%4+4)%4<2,d=u?l:c,f=u?e:r,p=Math.sin(Math.PI*d),m=t.noise(f*n*2,d*40,n*2,40)*.5+.5;return Math.min(1,p*(u?.85:.45)*(.75+m*.25))}}},noise(e,t){let n=Math.max(1,Math.round(4*e.num(`scale`))),r=e.int(`octaves`),i=e.num(`contrast`);return{h:(e,a)=>Math.min(1,Math.max(0,.5+t.fbm(e,a,n,r)*.5*i*1.6))}},voronoi(e,t,n){let r=Math.max(1,Math.round(8*e.num(`scale`))),i=e.num(`jitter`);return{h(e,t){let a=I(e,t,r,i,n);return P(0,.25,a.f2-a.f1)}}},flakes(e,t,n){let r=Math.max(4,Math.round(64*e.num(`scale`))),i=e.num(`strength`);return{h(e,t){return N(Math.floor(e*r),Math.floor(t*r),n)},normal(e,t,a){let o=I(e,t,r,1,n),s=N(o.cx,o.cy,n+1)*Math.PI*2,c=Math.sqrt(N(o.cx,o.cy,n+2))*i,l=Math.cos(s)*c,u=Math.sin(s)*c;a[0]=l,a[1]=u,a[2]=Math.sqrt(Math.max(0,1-l*l-u*u))}}},brushed(e,t){let n=Math.max(1,Math.round(e.num(`scale`))),r=e.num(`streaks`),i=Math.max(8,Math.round(300*r*n));return{h(e,r){let a=t.noise(e*2*n,r*i,2*n,i)*.5+.5,o=t.noise(e*6*n,r*i*2.5,6*n,Math.round(i*2.5))*.5+.5,s=t.fbm(e,r,3*n,3)*.5+.5;return Math.min(1,Math.max(0,a*.5+o*.3+s*.2))}}},grid(e,t,n,r){let i=Math.max(1,Math.round(e.int(`cells`)*e.num(`scale`))),a=i/r,o=Math.max(e.num(`lineWidth`)*.5,a*.75);return{h(e,t){let n=F(e*i),r=F(t*i),s=Math.min(n,1-n,r,1-r);return 1-P(o-a*.5,o+a*.5,s)}}},checker(e){let t=Math.max(1,Math.round(e.int(`cells`)*e.num(`scale`)));return{h:(e,n)=>Math.floor(e*t)+Math.floor(n*t)&1?1:0}},stripes(e){let t=Math.max(1,Math.round(e.int(`count`)*e.num(`scale`))),n=e.num(`angle`)*Math.PI/180,r=Math.round(Math.cos(n)*t),i=Math.round(Math.sin(n)*t),a=Math.max(.002,e.num(`softness`));return{h(e,t){let n=Math.abs(F(e*r+t*i)-.5)*2;return P(.5-a*2,.5+a*2,n)}}},dots(e){let t=Math.max(1,Math.round(e.int(`cells`)*e.num(`scale`))),n=e.num(`radius`);return{h(e,r){let i=F(e*t)-.5,a=F(r*t)-.5;return 1-P(n-.02,n+.01,Math.hypot(i,a))}}}};Object.keys(L);var R=e=>{let t=e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055;return Math.max(0,Math.min(255,Math.round(t*255)))},z=/* @__PURE__ */ new Map;function re(e){return 2**Math.round(Math.log2(Math.max(32,Math.min(2048,e))))}function ie(e,t){let n=t+`:`+JSON.stringify(e),r=z.get(n);if(r)return r;let i=y.find(t=>t.id===e.procedural),a=L[e.procedural];if(!i||!a)throw Error(`Unknown procedural texture "${e.procedural}"`);let o=te(i,e),s=o.int(`seed`),c=re(o.int(`resolution`)),l=a(o,new M(s),s,c),u=new Uint8Array(c*c*4),d=new Float32Array(c*c);for(let e=0;e<c;e++){let t=(e+.5)/c;for(let n=0;n<c;n++)d[e*c+n]=l.h((n+.5)/c,t)}if(t===`color`){let e=o.colors(`colors`).map(e=>[e.r,e.g,e.b]),t=e.length;for(let n=0;n<c;n++)for(let r=0;r<c;r++){let i=n*c+r,a,o,s,f=l.pick?l.pick((r+.5)/c,(n+.5)/c):-1;if(f>=0)[a,o,s]=e[Math.min(f,t-1)];else if(l.pick)[a,o,s]=e[0];else{let n=Math.min(1,Math.max(0,d[i]))*(t-1),r=Math.min(t-2,Math.floor(n)),c=t>1?n-r:0,l=e[Math.max(0,r)],u=e[Math.min(t-1,r+1)];a=l[0]+(u[0]-l[0])*c,o=l[1]+(u[1]-l[1])*c,s=l[2]+(u[2]-l[2])*c}u[i*4]=R(a),u[i*4+1]=R(o),u[i*4+2]=R(s),u[i*4+3]=255}}else if(t===`normal`){let e=[0,0,1],t=c/256*2;for(let n=0;n<c;n++)for(let r=0;r<c;r++){let i=n*c+r,a,o,s;if(l.normal)l.normal((r+.5)/c,(n+.5)/c,e),[a,o,s]=e;else{let e=(e,t)=>d[(t+c)%c*c+(e+c)%c],i=(e(r+1,n-1)+2*e(r+1,n)+e(r+1,n+1)-e(r-1,n-1)-2*e(r-1,n)-e(r-1,n+1))/8,l=(e(r-1,n+1)+2*e(r,n+1)+e(r+1,n+1)-e(r-1,n-1)-2*e(r,n-1)-e(r+1,n-1))/8;a=-i*t,o=-l*t,s=1;let u=Math.hypot(a,o,s);a/=u,o/=u,s/=u}u[i*4]=Math.round((a*.5+.5)*255),u[i*4+1]=Math.round((o*.5+.5)*255),u[i*4+2]=Math.round((s*.5+.5)*255),u[i*4+3]=255}}else for(let e=0;e<c*c;e++){let t=Math.round(Math.min(1,Math.max(0,d[e]))*255);u[e*4]=u[e*4+1]=u[e*4+2]=t,u[e*4+3]=255}let f={data:u,size:c};return z.size>64&&z.clear(),z.set(n,f),f}function ae(e,t){let r=ie(e,t),a=new o(r.data,r.size,r.size,n,p);return a.colorSpace=t===`color`?u:``,a.wrapS=a.wrapT=i,a.magFilter=h,a.minFilter=g,a.generateMipmaps=!0,a.anisotropy=4,a.needsUpdate=!0,a.name=`procedural:${e.procedural}`,a}v.map(e=>e.id);function B(e){let t=e??{},n={...(t.preset?v.find(e=>e.id===t.preset):void 0)?.props??{}};for(let[e,r]of Object.entries(t))r!==void 0&&e!==`preset`&&(n[e]=r);return n.type||=n.shader?`shader`:n.gradient?`gradient`:`standard`,n}function V(e,t,n){let r=e.userData.a3dPatches;if(!r){r=e.userData.a3dPatches=[];let t=e.onBeforeCompile;if(t!==f.prototype.onBeforeCompile){let n=e.customProgramCacheKey.call(e);r.push({key:`own(${n})`,patch:(n,r)=>t.call(e,n,r)})}}if(r.some(e=>e.key===t))return;r.push({key:t,patch:n});let i=r;e.onBeforeCompile=(e,t)=>{for(let n of i)n.patch(e,t)},e.customProgramCacheKey=()=>`agent3d:`+i.map(e=>e.key).join(`+`),e.needsUpdate=!0}var H=null;function U(){if(H)return H;if(typeof document>`u`)return null;let e=document.createElement(`canvas`);e.width=e.height=256;let t=e.getContext(`2d`);if(!t)return null;let n=t.createRadialGradient(97.28,81.92,5.12,128,128,133.12);n.addColorStop(0,`#ffffff`),n.addColorStop(.25,`#e6e6ea`),n.addColorStop(.7,`#7d7f88`),n.addColorStop(1,`#2a2b30`),t.fillStyle=n,t.fillRect(0,0,256,256);let r=t.createRadialGradient(128,128,102.4,128,128,128);return r.addColorStop(0,`rgba(255,255,255,0)`),r.addColorStop(1,`rgba(200,210,255,0.35)`),t.fillStyle=r,t.fillRect(0,0,256,256),H=new d(e),H.colorSpace=u,H}var W={front:0,back:1,double:2},G=8;function K(e,t,n=!1){let r=t.slice(0,G).map(e=>x(e));for(;r.length<G;)r.push(r[r.length-1].clone());let i={uGradColors:{value:r},uGradCount:{value:Math.min(Math.max(t.length,1),G)},uGradMin:{value:-.5},uGradMax:{value:.5}};return V(e,n?`gradient-emissive`:`gradient`,e=>{Object.assign(e.uniforms,i),e.vertexShader=`varying float vGradY;
2
2
  `+e.vertexShader.replace(`#include <begin_vertex>`,`#include <begin_vertex>
3
3
  vGradY = position.y;`);let t=`varying float vGradY;\nuniform vec3 uGradColors[${G}];\nuniform int uGradCount;\nuniform float uGradMin;\nuniform float uGradMax;\n`+e.fragmentShader.replace(`vec4 diffuseColor = vec4( diffuse, opacity );`,`float gT = clamp((vGradY - uGradMin) / max(uGradMax - uGradMin, 1e-5), 0.0, 1.0);
4
4
  vec3 gCol = uGradColors[0];
@@ -1 +1 @@
1
- import{H as e,Nn as t,c as n,d as r,ft as i,pt as a}from"./three.module-DnaBiDAJ.js";import{c as o}from"./util-CyaW1fcW.js";import{a as s}from"./materials-Dn-bYrZd.js";var c=/* @__PURE__ */ new Map;function l(e){let t=new Uint8Array(e),n;if(t.byteLength>=20&&new DataView(e).getUint32(0,!0)===1179937895){let r=new DataView(e).getUint32(12,!0);n=new TextDecoder().decode(t.subarray(20,20+r))}else n=new TextDecoder().decode(t);try{let e=JSON.parse(n);return Array.isArray(e.extensionsUsed)?e.extensionsUsed.filter(e=>typeof e==`string`):[]}catch{return[]}}async function u(e){let t=c.get(e);return t||(t=(async()=>{let[{GLTFLoader:t},n]=await Promise.all([import(`./GLTFLoader-Z9Inv-Xm.js`),fetch(e)]);if(!n.ok)throw Error(`HTTP ${n.status} for ${e}`);let r=await n.arrayBuffer(),i=l(r);if(i.includes(`KHR_draco_mesh_compression`))throw Error(`${e} uses Draco compression (KHR_draco_mesh_compression), which the Agent3D runtime does not decode. Re-export it without Draco (Blender: uncheck "Compression"), or convert it to meshopt with gltfpack (\`gltfpack -i in.glb -o out.glb -cc\`), then run \`agent3d assets optimize\`.`);let a=new t;if(i.includes(`EXT_meshopt_compression`)){let{MeshoptDecoder:e}=await import(`./meshopt_decoder.module-DXTYc6wn.js`);await e.ready,a.setMeshoptDecoder(e)}let o=e.slice(0,e.lastIndexOf(`/`)+1);return a.parseAsync(r,/^data:/.test(e)?``:o)})(),t.catch(()=>c.delete(e)),c.set(e,t)),t}function d(e,t){e.traverse(e=>{let n=e;if(n.isMesh&&n.morphTargetDictionary&&n.morphTargetInfluences)for(let[e,r]of Object.entries(t)){let t=n.morphTargetDictionary[e];t!==void 0&&typeof r==`number`&&(n.morphTargetInfluences[t]=r)}})}async function f(c,l){let f=await u(l.resolveAsset(c.src)),{clone:p}=await import(`./SkeletonUtils-DHlReJx3.js`),m=p(f.scene),h=new e;h.add(m),m.updateMatrixWorld(!0);let g=new r().setFromObject(m);if(!g.isEmpty()){let e=g.getSize(new t),n=Math.max(e.x,e.y,e.z),r=c.fit&&n>0?c.fit/n:1;if(m.scale.multiplyScalar(r),c.center!==!1){let e=g.getCenter(new t);m.position.set(-e.x*r,-g.min.y*r,-e.z*r)}}m.traverse(e=>{let t=e;t.isMesh&&(t.castShadow=c.castShadow??!0,t.receiveShadow=c.receiveShadow??!1)}),c.material&&await s(m,c.material,l),c.morph&&d(m,c.morph);let _;if(f.animations.length){let e=new n(m),t=null,r=e=>typeof e==`number`||/^\d+$/.test(String(e))?f.animations[Number(e)]:f.animations.find(t=>t.name===e)??f.animations.find(t=>t.name.toLowerCase().includes(String(e).toLowerCase())),s=/* @__PURE__ */ new Set,u=e=>{let t=r(e);return!t&&!s.has(String(e))&&(s.add(String(e)),l.issue(`asset-load`,`Model ${c.id} has no animation clip "${e}" (clips: ${f.animations.map(e=>e.name).join(`, `)})`,`objects#${c.id}.animation.clip`)),t},d=(n,r={})=>{let s=u(n);if(!s)return;let c=e.clipAction(s);c.setLoop(r.loop===!1?i:a,1/0),c.clampWhenFinished=r.loop===!1,c.timeScale=o(r.speed,1),c.enabled=!0,t&&t!==c?(c.reset().setEffectiveWeight(1).play(),t.crossFadeTo(c,o(r.crossfade,.3),!1)):c.setEffectiveWeight(1).play(),t=c},p=t=>{let n=u(t);if(!n)return null;let r=e.clipAction(n);return r.isRunning()||(r.enabled=!0,r.setLoop(a,1/0),r.play()),r},h={weight(e,t){p(e)?.setEffectiveWeight(Math.max(0,t))},speed(e,t){let n=p(e);n&&(n.timeScale=t)},time(e,t){let n=p(e);n&&(n.paused=!0,n.time=Math.max(0,t))}},g=c.animation??{},v=()=>{e.stopAllAction(),t=null,d(g.clip??0,g),g.offset&&t&&(t.time=Math.max(0,g.offset));for(let[e,t]of Object.entries(g.blend??{}))h.weight(e,t);e.update(0)};_={mixer:e,clips:f.animations,play:d,control:h,reset:v},v()}return{object:h,animator:_}}export{f as buildModel};
1
+ import{H as e,Nn as t,c as n,d as r,ft as i,pt as a}from"./three.module-DnaBiDAJ.js";import{c as o}from"./util-CyaW1fcW.js";import{a as s}from"./materials-w3EW0g-7.js";var c=/* @__PURE__ */ new Map;function l(e){let t=new Uint8Array(e),n;if(t.byteLength>=20&&new DataView(e).getUint32(0,!0)===1179937895){let r=new DataView(e).getUint32(12,!0);n=new TextDecoder().decode(t.subarray(20,20+r))}else n=new TextDecoder().decode(t);try{let e=JSON.parse(n);return Array.isArray(e.extensionsUsed)?e.extensionsUsed.filter(e=>typeof e==`string`):[]}catch{return[]}}async function u(e){let t=c.get(e);return t||(t=(async()=>{let[{GLTFLoader:t},n]=await Promise.all([import(`./GLTFLoader-Z9Inv-Xm.js`),fetch(e)]);if(!n.ok)throw Error(`HTTP ${n.status} for ${e}`);let r=await n.arrayBuffer(),i=l(r);if(i.includes(`KHR_draco_mesh_compression`))throw Error(`${e} uses Draco compression (KHR_draco_mesh_compression), which the Agent3D runtime does not decode. Re-export it without Draco (Blender: uncheck "Compression"), or convert it to meshopt with gltfpack (\`gltfpack -i in.glb -o out.glb -cc\`), then run \`agent3d assets optimize\`.`);let a=new t;if(i.includes(`EXT_meshopt_compression`)){let{MeshoptDecoder:e}=await import(`./meshopt_decoder.module-DXTYc6wn.js`);await e.ready,a.setMeshoptDecoder(e)}let o=e.slice(0,e.lastIndexOf(`/`)+1);return a.parseAsync(r,/^data:/.test(e)?``:o)})(),t.catch(()=>c.delete(e)),c.set(e,t)),t}function d(e,t){e.traverse(e=>{let n=e;if(n.isMesh&&n.morphTargetDictionary&&n.morphTargetInfluences)for(let[e,r]of Object.entries(t)){let t=n.morphTargetDictionary[e];t!==void 0&&typeof r==`number`&&(n.morphTargetInfluences[t]=r)}})}async function f(c,l){let f=await u(l.resolveAsset(c.src)),{clone:p}=await import(`./SkeletonUtils-DHlReJx3.js`),m=p(f.scene),h=new e;h.add(m),m.updateMatrixWorld(!0);let g=new r().setFromObject(m);if(!g.isEmpty()){let e=g.getSize(new t),n=Math.max(e.x,e.y,e.z),r=c.fit&&n>0?c.fit/n:1;if(m.scale.multiplyScalar(r),c.center!==!1){let e=g.getCenter(new t);m.position.set(-e.x*r,-g.min.y*r,-e.z*r)}}m.traverse(e=>{let t=e;t.isMesh&&(t.castShadow=c.castShadow??!0,t.receiveShadow=c.receiveShadow??!1)}),c.material&&await s(m,c.material,l),c.morph&&d(m,c.morph);let _;if(f.animations.length){let e=new n(m),t=null,r=e=>typeof e==`number`||/^\d+$/.test(String(e))?f.animations[Number(e)]:f.animations.find(t=>t.name===e)??f.animations.find(t=>t.name.toLowerCase().includes(String(e).toLowerCase())),s=/* @__PURE__ */ new Set,u=e=>{let t=r(e);return!t&&!s.has(String(e))&&(s.add(String(e)),l.issue(`asset-load`,`Model ${c.id} has no animation clip "${e}" (clips: ${f.animations.map(e=>e.name).join(`, `)})`,`objects#${c.id}.animation.clip`)),t},d=(n,r={})=>{let s=u(n);if(!s)return;let c=e.clipAction(s);c.setLoop(r.loop===!1?i:a,1/0),c.clampWhenFinished=r.loop===!1,c.timeScale=o(r.speed,1),c.enabled=!0,t&&t!==c?(c.reset().setEffectiveWeight(1).play(),t.crossFadeTo(c,o(r.crossfade,.3),!1)):c.setEffectiveWeight(1).play(),t=c},p=t=>{let n=u(t);if(!n)return null;let r=e.clipAction(n);return r.isRunning()||(r.enabled=!0,r.setLoop(a,1/0),r.play()),r},h={weight(e,t){p(e)?.setEffectiveWeight(Math.max(0,t))},speed(e,t){let n=p(e);n&&(n.timeScale=t)},time(e,t){let n=p(e);n&&(n.paused=!0,n.time=Math.max(0,t))}},g=c.animation??{},v=()=>{e.stopAllAction(),t=null,d(g.clip??0,g),g.offset&&t&&(t.time=Math.max(0,g.offset));for(let[e,t]of Object.entries(g.blend??{}))h.weight(e,t);e.update(0)};_={mixer:e,clips:f.animations,play:d,control:h,reset:v},v()}return{object:h,animator:_}}export{f as buildModel};
@@ -1 +1 @@
1
- import{b as e}from"./three.module-DnaBiDAJ.js";import{s as t,t as n}from"./catalog-DL6sgPay.js";var r=(t,n)=>{try{return t?t.color(n).clone():new e(n)}catch{return new e(n)}};function i(e,t,n){let i=t??{},a=t=>{let n=e.params.find(e=>e.name===t);if(!n)throw Error(`${e.id}: no catalog param "${t}"`);return n},o=e=>{let t=a(e),n=i[e];return n===void 0?t.default:n},s=(e,t)=>{let n=a(e);return n.min!==void 0&&t<n.min&&(t=n.min),n.max!==void 0&&t>n.max&&(t=n.max),t},c=e=>{let t=o(e);return typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isFinite(t)||(t=a(e).default),s(e,typeof t==`number`?t:0)};return{num:c,numOrNull:e=>i[e]===null?null:c(e),int:e=>Math.round(c(e)),bool:e=>{let t=o(e);return typeof t==`boolean`?t:!!a(e).default},str:e=>{let t=a(e),n=o(e);return typeof n==`string`&&(!t.options||t.options.includes(n))?n:t.default},color:e=>{let t=o(e);return r(n,typeof t==`string`?t:String(a(e).default??`#ffffff`))},colors:e=>{let t=o(e);return typeof t==`string`&&(t=[t]),Array.isArray(t)&&t.length!==0||(t=a(e).default),t.map(e=>r(n,typeof e==`string`?e:`#ffffff`))},vec3:e=>{let t=o(e),n=a(e).default??[0,0,0];return Array.isArray(t)?[0,1,2].map(e=>typeof t[e]==`number`?t[e]:n[e]):[...n]},raw:e=>o(e)}}var a=(e,t)=>{let n=e.find(e=>e.id===t);if(!n)throw Error(`unknown catalog id ${t}`);return n},o=(e,t,r)=>i(a(n,e),t,r),s=(e,n,r)=>i(a(t,e),n,r);export{i as n,s as r,o as t};
1
+ import{b as e}from"./three.module-DnaBiDAJ.js";import{s as t,t as n}from"./catalog--OTp4gjy.js";var r=(t,n)=>{try{return t?t.color(n).clone():new e(n)}catch{return new e(n)}};function i(e,t,n){let i=t??{},a=t=>{let n=e.params.find(e=>e.name===t);if(!n)throw Error(`${e.id}: no catalog param "${t}"`);return n},o=e=>{let t=a(e),n=i[e];return n===void 0?t.default:n},s=(e,t)=>{let n=a(e);return n.min!==void 0&&t<n.min&&(t=n.min),n.max!==void 0&&t>n.max&&(t=n.max),t},c=e=>{let t=o(e);return typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isFinite(t)||(t=a(e).default),s(e,typeof t==`number`?t:0)};return{num:c,numOrNull:e=>i[e]===null?null:c(e),int:e=>Math.round(c(e)),bool:e=>{let t=o(e);return typeof t==`boolean`?t:!!a(e).default},str:e=>{let t=a(e),n=o(e);return typeof n==`string`&&(!t.options||t.options.includes(n))?n:t.default},color:e=>{let t=o(e);return r(n,typeof t==`string`?t:String(a(e).default??`#ffffff`))},colors:e=>{let t=o(e);return typeof t==`string`&&(t=[t]),Array.isArray(t)&&t.length!==0||(t=a(e).default),t.map(e=>r(n,typeof e==`string`?e:`#ffffff`))},vec3:e=>{let t=o(e),n=a(e).default??[0,0,0];return Array.isArray(t)?[0,1,2].map(e=>typeof t[e]==`number`?t[e]:n[e]):[...n]},raw:e=>o(e)}}var a=(e,t)=>{let n=e.find(e=>e.id===t);if(!n)throw Error(`unknown catalog id ${t}`);return n},o=(e,t,r)=>i(a(n,e),t,r),s=(e,n,r)=>i(a(t,e),n,r);export{i as n,s as r,o as t};
@@ -1 +1 @@
1
- import{l as e,o as t,r as n}from"./catalog-DL6sgPay.js";var r=[`low`,`medium`,`high`,`ultra`],i=/* @__PURE__ */ new Set([`strength`,`intensity`,`darkness`,`amount`,`toning`,`streaks`,`ghosts`,`halo`,`bleach`,`scanlines`]);function a(e){if(!e?.length)return[];let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map;for(let a of e){if(!a||typeof a.type!=`string`)continue;if(a.type!==`look`){n.has(a.type)||n.set(a.type,a);continue}let e=t[String(a.preset??`cinematic`)];if(!e)continue;let o=typeof a.intensity==`number`?Math.max(0,Math.min(1,a.intensity)):1;for(let t of e.effects){if(r.has(t.type))continue;let e={...t};if(o!==1){for(let[n,r]of Object.entries(t))i.has(n)&&typeof r==`number`&&(e[n]=r*o);t.type===`grading`&&t.look&&(e.intensity=o)}r.set(t.type,e)}}let a=[],o=/* @__PURE__ */ new Set,s=e=>{if(o.has(e))return;o.add(e);let t=n.get(e),i=r.get(e);a.push(t&&i?{...i,...t}:t??i)};for(let r of e)if(r&&typeof r.type==`string`){if(r.type!==`look`)s(r.type);else for(let e of t[String(r.preset??`cinematic`)]?.effects??[])n.has(e.type)||s(e.type)}return a}function o(e){let t={exposure:0,contrast:1,saturation:1,vibrance:0,temperature:0,tint:0,lift:0,gamma:1,gain:1,toning:0,bleach:0},r=e.look&&e.look!==`none`?n[e.look]:void 0,i=typeof e.intensity==`number`?Math.max(0,Math.min(1,e.intensity)):1,a={...t};if(r)for(let[e,n]of Object.entries(r.values))a[e]=typeof n==`number`?t[e]+(n-t[e])*i:n;for(let[t,n]of Object.entries(e))t!==`type`&&t!==`look`&&t!==`intensity`&&(typeof n==`number`||typeof n==`string`)&&(a[t]=n);return a}var s={low:0,medium:1,high:2};function c(e){switch(e){case`low`:return{tier:e,dprCap:1,msaa:0,effectScale:.5,maxCost:`medium`,aoSamples:8,dofSamples:16,rays:24,maxStillSamples:4};case`medium`:return{tier:e,dprCap:1.5,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:12,dofSamples:24,rays:32,maxStillSamples:8};case`ultra`:return{tier:e,dprCap:3,msaa:8,effectScale:1,maxCost:`high`,aoSamples:24,dofSamples:64,rays:64,maxStillSamples:64};default:return{tier:`high`,dprCap:2,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:16,dofSamples:40,rays:48,maxStillSamples:32}}}function l(e,t={}){return e&&e!==`auto`?e:t.deterministic?`high`:t.gpu&&/swiftshader|llvmpipe|softpipe|software|microsoft basic render/i.test(t.gpu)?`low`:t.mobile?(t.memoryGb??4)<=2||(t.cores??8)<=4?`low`:`medium`:t.cores!==void 0&&t.cores<=2||t.memoryGb!==void 0&&t.memoryGb<=2?`low`:t.cores!==void 0&&t.cores<=4||t.memoryGb!==void 0&&t.memoryGb<=4||t.gpu&&/intel|mali|adreno|powervr/i.test(t.gpu)?`medium`:`high`}function u(e){let t=r.indexOf(e);return t>0?r[t-1]:null}function d(t){return e(`postfx`,t)?.gpu??`low`}function f(e,t){let n=s[c(t).maxCost],r=[],i=[];for(let t of a(e))s[d(t.type)]>n?i.push(t.type):r.push(t);return{active:r,dropped:i}}export{o as a,c as i,a as n,l as o,u as r,f as t};
1
+ import{l as e,o as t,r as n}from"./catalog--OTp4gjy.js";var r=[`low`,`medium`,`high`,`ultra`],i=/* @__PURE__ */ new Set([`strength`,`intensity`,`darkness`,`amount`,`toning`,`streaks`,`ghosts`,`halo`,`bleach`,`scanlines`]);function a(e){if(!e?.length)return[];let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map;for(let a of e){if(!a||typeof a.type!=`string`)continue;if(a.type!==`look`){n.has(a.type)||n.set(a.type,a);continue}let e=t[String(a.preset??`cinematic`)];if(!e)continue;let o=typeof a.intensity==`number`?Math.max(0,Math.min(1,a.intensity)):1;for(let t of e.effects){if(r.has(t.type))continue;let e={...t};if(o!==1){for(let[n,r]of Object.entries(t))i.has(n)&&typeof r==`number`&&(e[n]=r*o);t.type===`grading`&&t.look&&(e.intensity=o)}r.set(t.type,e)}}let a=[],o=/* @__PURE__ */ new Set,s=e=>{if(o.has(e))return;o.add(e);let t=n.get(e),i=r.get(e);a.push(t&&i?{...i,...t}:t??i)};for(let r of e)if(r&&typeof r.type==`string`){if(r.type!==`look`)s(r.type);else for(let e of t[String(r.preset??`cinematic`)]?.effects??[])n.has(e.type)||s(e.type)}return a}function o(e){let t={exposure:0,contrast:1,saturation:1,vibrance:0,temperature:0,tint:0,lift:0,gamma:1,gain:1,toning:0,bleach:0},r=e.look&&e.look!==`none`?n[e.look]:void 0,i=typeof e.intensity==`number`?Math.max(0,Math.min(1,e.intensity)):1,a={...t};if(r)for(let[e,n]of Object.entries(r.values))a[e]=typeof n==`number`?t[e]+(n-t[e])*i:n;for(let[t,n]of Object.entries(e))t!==`type`&&t!==`look`&&t!==`intensity`&&(typeof n==`number`||typeof n==`string`)&&(a[t]=n);return a}var s={low:0,medium:1,high:2};function c(e){switch(e){case`low`:return{tier:e,dprCap:1,msaa:0,effectScale:.5,maxCost:`medium`,aoSamples:8,dofSamples:16,rays:24,maxStillSamples:4};case`medium`:return{tier:e,dprCap:1.5,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:12,dofSamples:24,rays:32,maxStillSamples:8};case`ultra`:return{tier:e,dprCap:3,msaa:8,effectScale:1,maxCost:`high`,aoSamples:24,dofSamples:64,rays:64,maxStillSamples:64};default:return{tier:`high`,dprCap:2,msaa:4,effectScale:.5,maxCost:`high`,aoSamples:16,dofSamples:40,rays:48,maxStillSamples:32}}}function l(e,t={}){return e&&e!==`auto`?e:t.deterministic?`high`:t.gpu&&/swiftshader|llvmpipe|softpipe|software|microsoft basic render/i.test(t.gpu)?`low`:t.mobile?(t.memoryGb??4)<=2||(t.cores??8)<=4?`low`:`medium`:t.cores!==void 0&&t.cores<=2||t.memoryGb!==void 0&&t.memoryGb<=2?`low`:t.cores!==void 0&&t.cores<=4||t.memoryGb!==void 0&&t.memoryGb<=4||t.gpu&&/intel|mali|adreno|powervr/i.test(t.gpu)?`medium`:`high`}function u(e){let t=r.indexOf(e);return t>0?r[t-1]:null}function d(t){return e(`postfx`,t)?.gpu??`low`}function f(e,t){let n=s[c(t).maxCost],r=[],i=[];for(let t of a(e))s[d(t.type)]>n?i.push(t.type):r.push(t);return{active:r,dropped:i}}export{o as a,c as i,a as n,l as o,u as r,f as t};
@@ -1,4 +1,4 @@
1
- import{An as e,B as t,F as n,Gt as r,In as i,Mn as a,Nn as o,O as s,On as c,Ot as l,Pt as u,Qt as d,Rt as f,T as p,U as m,b as h,bn as g,d as _,gt as v,jn as y,k as b,kn as x,m as S,nn as C,ot as w,qt as T,rn as E,vt as D,wt as O,x as k,yt as A}from"./three.module-DnaBiDAJ.js";import{a as j,i as ee,t as te}from"./postfx-i_J5Vf-l.js";import{c as M,d as N,n as P}from"./util-CyaW1fcW.js";var F=class{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error(`THREE.Pass: .render() must be implemented in derived pass.`)}dispose(){}},ne=new u(-1,1,1,-1,0,1),I=new class extends S{constructor(){super(),this.setAttribute(`position`,new n([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute(`uv`,new n([0,2,0,0,2,0],2))}},L=class{constructor(e){this._mesh=new A(I,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,ne)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}},R={1:`LINEAR_TONE_MAPPING`,2:`REINHARD_TONE_MAPPING`,3:`CINEON_TONE_MAPPING`,4:`ACES_FILMIC_TONE_MAPPING`,6:`AGX_TONE_MAPPING`,7:`NEUTRAL_TONE_MAPPING`,5:`CUSTOM_TONE_MAPPING`},z=`
1
+ import{An as e,B as t,F as n,Gt as r,In as i,Mn as a,Nn as o,O as s,On as c,Ot as l,Pt as u,Qt as d,Rt as f,T as p,U as m,b as h,bn as g,d as _,gt as v,jn as y,k as b,kn as x,m as S,nn as C,ot as w,qt as T,rn as E,vt as D,wt as O,x as k,yt as A}from"./three.module-DnaBiDAJ.js";import{a as j,i as ee,t as te}from"./postfx-CFucYRev.js";import{c as M,d as N,n as P}from"./util-CyaW1fcW.js";var F=class{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error(`THREE.Pass: .render() must be implemented in derived pass.`)}dispose(){}},ne=new u(-1,1,1,-1,0,1),I=new class extends S{constructor(){super(),this.setAttribute(`position`,new n([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute(`uv`,new n([0,2,0,0,2,0],2))}},L=class{constructor(e){this._mesh=new A(I,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,ne)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}},R={1:`LINEAR_TONE_MAPPING`,2:`REINHARD_TONE_MAPPING`,3:`CINEON_TONE_MAPPING`,4:`ACES_FILMIC_TONE_MAPPING`,6:`AGX_TONE_MAPPING`,7:`NEUTRAL_TONE_MAPPING`,5:`CUSTOM_TONE_MAPPING`},z=`
2
2
  vec4 a3dSanitize(vec4 c) {
3
3
  bvec4 bad = bvec4(isnan(c.r) || isinf(c.r), isnan(c.g) || isinf(c.g), isnan(c.b) || isinf(c.b), isnan(c.a) || isinf(c.a));
4
4
  c = vec4(bad.r ? 0.0 : c.r, bad.g ? 0.0 : c.g, bad.b ? 0.0 : c.b, bad.a ? 1.0 : c.a);
@@ -1,4 +1,4 @@
1
- import{Mn as e,Nn as t,b as n,rn as r}from"./three.module-DnaBiDAJ.js";import{r as i}from"./params-C2uoUDJ0.js";import{n as a,t as o}from"./meshGradient.glsl-BMatplLA.js";var s=`
1
+ import{Mn as e,Nn as t,b as n,rn as r}from"./three.module-DnaBiDAJ.js";import{r as i}from"./params-BCNrVCYZ.js";import{n as a,t as o}from"./meshGradient.glsl-BMatplLA.js";var s=`
2
2
  varying vec2 vUv;
3
3
  varying vec3 vPos;
4
4
  varying vec3 vNormalV;
@@ -1 +1 @@
1
- import{F as e,H as t,Mn as n,N as r,b as i,en as a,m as o,on as s,p as c,u as l,yt as u}from"./three.module-DnaBiDAJ.js";import{l as d,n as f,o as p}from"./materials-Dn-bYrZd.js";import{c as m}from"./util-CyaW1fcW.js";import{i as h,n as g,r as _,t as v}from"./extrude-D6WnITQq.js";var y=e=>!!e&&e!==`none`&&e!==`transparent`;function b(e,t,n){if(e===`currentColor`)return n;let r=/^url\(\s*['"]?#([^'")]+)['"]?\s*\)/.exec(e);if(r){let e=t.userData?.gradients?.[r[1]]?.stops??[];if(!e.length)return n;let a=new i(e[0].color),o=new i(e[e.length-1].color);return`#${a.lerp(o,.5).getHexString()}`}try{let t=new i;return t.setStyle(e,a),`#${t.getHexString(a)}`}catch{return n}}function x(e,t){let n=new l;for(let t of e.paths)for(let e of t.subPaths)for(let t of e.getPoints(4))n.expandByPoint(t);return(n.isEmpty()?100:Math.max(n.max.x-n.min.x,n.max.y-n.min.y,1e-6))/(t*10)}function S(e,t,n={}){let r=[],i=Math.max(1,Math.round(m(n.curveSegments,12))),a=x(e,i),o=n.currentColor??`#1f2330`;for(let s of e.paths){let e=s.userData?.style??{};if(e.visibility===`hidden`||e.visibility===`collapse`)continue;let c=m(e.opacity,1);if(y(e.fill)){let t=s.toShapes().map(e=>_(e,a));t.length&&r.push({kind:`fill`,color:b(e.fill,s,o),opacity:m(e.fillOpacity,1)*c,shapes:t})}if(n.strokes!==!1&&y(e.stroke)&&m(e.strokeWidth,1)>0){let n=t.getStrokeStyle(m(e.strokeWidth,1),`#000`,e.strokeLineJoin??`miter`,e.strokeLineCap??`butt`,m(e.strokeMiterLimit,4)),l=[];for(let e of s.subPaths){let r=g(e,a);if(r.length<2)continue;let o=t.pointsToStroke(r,n,i);o&&l.push(o)}if(l.length){let t=l.length===1?l[0]:C(l);r.push({kind:`stroke`,color:b(e.stroke,s,o),opacity:m(e.strokeOpacity,1)*c,stroke:t})}}}return r}function C(e){let t=0;for(let n of e)t+=n.getAttribute(`position`).count;let n=new Float32Array(t*3),r=0;for(let t of e){let e=t.getAttribute(`position`).array;n.set(e,r),r+=e.length,t.dispose()}let i=new o;return i.setAttribute(`position`,new c(n,3)),i}function w(e,t=12){let r=new l;for(let i of e){if(i.shapes)for(let e of i.shapes)for(let n of e.getPoints(t))r.expandByPoint(n);if(i.stroke){let e=i.stroke.getAttribute(`position`);for(let t=0;t<e.count;t++)r.expandByPoint(new n(e.getX(t),e.getY(t)))}}return r}function T(e,t,n,i,a){if(e.kind===`stroke`)return e.stroke?v(e.stroke,t):null;if(!e.shapes?.length)return null;if(t<=0)return new s(e.shapes,i);let o=Math.min(n,t*.45),c=new r(e.shapes,{depth:Math.max(t-o*2,t*.05),curveSegments:i,bevelEnabled:o>0,bevelThickness:o,bevelSize:o*.6,bevelOffset:0,bevelSegments:3});return c.translate(0,0,o),c.clearGroups(),h(c,50*Math.PI/180,a)}async function E(n,r){let[{SVGLoader:i},a]=await Promise.all([import(`./SVGLoader-CV0U1EIF.js`),import(`./BufferGeometryUtils-XmME4f7Z.js`).then(e=>e.t)]),o=n.src.trim().startsWith(`<`)?n.src:await d(r.resolveAsset(n.src)),s=new i().parse(o),c=n.material?p(n.material):void 0,l=typeof c?.color==`string`?c.color:void 0,h=Math.max(1,Math.round(m(n.curveSegments,12))),g=S(s,i,{strokes:n.strokes,curveSegments:h,currentColor:l}),_=new t,v=w(g,h);if(!g.length||v.isEmpty())return _;let y=m(n.size,2),b=Math.max(v.max.x-v.min.x,1e-6),x=Math.max(v.max.y-v.min.y,1e-6),C=n.fit??`width`,E=y/(C===`height`?x:C===`max`?Math.max(b,x):b),D=Math.max(0,m(n.depth,.2)),O=D/E,k=m(n.bevel,0)/E,A=m(n.layerGap,D>0?D*.02:y*.002),j=n.keepColors??!n.material,M=/* @__PURE__ */ new Map,N=async(e,t)=>{let i=j?`${e}|${t}`:`|${t}`,a=M.get(i);if(!a){let o=j?{roughness:.4,metalness:.1,...n.material??{},color:e,...t<1?{opacity:t}:{}}:n.material?{...n.material,...t<1?{opacity:t}:{}}:{color:`#dddddd`,roughness:.4,metalness:.1};a=await f(o,r,{defaultColor:e}),t<1&&(a.transparent=!0),D<=0&&(a.side=2),M.set(i,a)}return a},P=[];for(let e of g){let t=T(e,O,k,h,a);if(!t)continue;t.getAttribute(`normal`)||t.computeVertexNormals();let n=j?`${e.color}|${e.opacity}`:`|${e.opacity}`,r=P[P.length-1];r&&r.key===n?r.geos.push(t):P.push({key:n,color:e.color,opacity:e.opacity,geos:[t]})}let F=new t;for(let[t,n]of P.entries()){for(let t of n.geos){for(let e of Object.keys(t.attributes))[`position`,`normal`,`uv`].includes(e)||t.deleteAttribute(e);t.getAttribute(`uv`)||t.setAttribute(`uv`,new e(new Float32Array(t.getAttribute(`position`).count*2),2))}let r=n.geos.length===1?n.geos[0]:a.mergeGeometries(n.geos.map(e=>e.index?e.toNonIndexed():e),!1)??n.geos[0],i=new u(r,await N(n.color,n.opacity));i.position.z=t*A/E,F.add(i)}let I=(v.min.x+v.max.x)/2,L=(v.min.y+v.max.y)/2;return F.scale.set(E,-E,E),F.position.set(-I*E,L*E,-(D+Math.max(0,P.length-1)*A)/2),_.add(F),_}export{E as buildSvg};
1
+ import{F as e,H as t,Mn as n,N as r,b as i,en as a,m as o,on as s,p as c,u as l,yt as u}from"./three.module-DnaBiDAJ.js";import{l as d,n as f,o as p}from"./materials-w3EW0g-7.js";import{c as m}from"./util-CyaW1fcW.js";import{i as h,n as g,r as _,t as v}from"./extrude-D6WnITQq.js";var y=e=>!!e&&e!==`none`&&e!==`transparent`;function b(e,t,n){if(e===`currentColor`)return n;let r=/^url\(\s*['"]?#([^'")]+)['"]?\s*\)/.exec(e);if(r){let e=t.userData?.gradients?.[r[1]]?.stops??[];if(!e.length)return n;let a=new i(e[0].color),o=new i(e[e.length-1].color);return`#${a.lerp(o,.5).getHexString()}`}try{let t=new i;return t.setStyle(e,a),`#${t.getHexString(a)}`}catch{return n}}function x(e,t){let n=new l;for(let t of e.paths)for(let e of t.subPaths)for(let t of e.getPoints(4))n.expandByPoint(t);return(n.isEmpty()?100:Math.max(n.max.x-n.min.x,n.max.y-n.min.y,1e-6))/(t*10)}function S(e,t,n={}){let r=[],i=Math.max(1,Math.round(m(n.curveSegments,12))),a=x(e,i),o=n.currentColor??`#1f2330`;for(let s of e.paths){let e=s.userData?.style??{};if(e.visibility===`hidden`||e.visibility===`collapse`)continue;let c=m(e.opacity,1);if(y(e.fill)){let t=s.toShapes().map(e=>_(e,a));t.length&&r.push({kind:`fill`,color:b(e.fill,s,o),opacity:m(e.fillOpacity,1)*c,shapes:t})}if(n.strokes!==!1&&y(e.stroke)&&m(e.strokeWidth,1)>0){let n=t.getStrokeStyle(m(e.strokeWidth,1),`#000`,e.strokeLineJoin??`miter`,e.strokeLineCap??`butt`,m(e.strokeMiterLimit,4)),l=[];for(let e of s.subPaths){let r=g(e,a);if(r.length<2)continue;let o=t.pointsToStroke(r,n,i);o&&l.push(o)}if(l.length){let t=l.length===1?l[0]:C(l);r.push({kind:`stroke`,color:b(e.stroke,s,o),opacity:m(e.strokeOpacity,1)*c,stroke:t})}}}return r}function C(e){let t=0;for(let n of e)t+=n.getAttribute(`position`).count;let n=new Float32Array(t*3),r=0;for(let t of e){let e=t.getAttribute(`position`).array;n.set(e,r),r+=e.length,t.dispose()}let i=new o;return i.setAttribute(`position`,new c(n,3)),i}function w(e,t=12){let r=new l;for(let i of e){if(i.shapes)for(let e of i.shapes)for(let n of e.getPoints(t))r.expandByPoint(n);if(i.stroke){let e=i.stroke.getAttribute(`position`);for(let t=0;t<e.count;t++)r.expandByPoint(new n(e.getX(t),e.getY(t)))}}return r}function T(e,t,n,i,a){if(e.kind===`stroke`)return e.stroke?v(e.stroke,t):null;if(!e.shapes?.length)return null;if(t<=0)return new s(e.shapes,i);let o=Math.min(n,t*.45),c=new r(e.shapes,{depth:Math.max(t-o*2,t*.05),curveSegments:i,bevelEnabled:o>0,bevelThickness:o,bevelSize:o*.6,bevelOffset:0,bevelSegments:3});return c.translate(0,0,o),c.clearGroups(),h(c,50*Math.PI/180,a)}async function E(n,r){let[{SVGLoader:i},a]=await Promise.all([import(`./SVGLoader-CV0U1EIF.js`),import(`./BufferGeometryUtils-XmME4f7Z.js`).then(e=>e.t)]),o=n.src.trim().startsWith(`<`)?n.src:await d(r.resolveAsset(n.src)),s=new i().parse(o),c=n.material?p(n.material):void 0,l=typeof c?.color==`string`?c.color:void 0,h=Math.max(1,Math.round(m(n.curveSegments,12))),g=S(s,i,{strokes:n.strokes,curveSegments:h,currentColor:l}),_=new t,v=w(g,h);if(!g.length||v.isEmpty())return _;let y=m(n.size,2),b=Math.max(v.max.x-v.min.x,1e-6),x=Math.max(v.max.y-v.min.y,1e-6),C=n.fit??`width`,E=y/(C===`height`?x:C===`max`?Math.max(b,x):b),D=Math.max(0,m(n.depth,.2)),O=D/E,k=m(n.bevel,0)/E,A=m(n.layerGap,D>0?D*.02:y*.002),j=n.keepColors??!n.material,M=/* @__PURE__ */ new Map,N=async(e,t)=>{let i=j?`${e}|${t}`:`|${t}`,a=M.get(i);if(!a){let o=j?{roughness:.4,metalness:.1,...n.material??{},color:e,...t<1?{opacity:t}:{}}:n.material?{...n.material,...t<1?{opacity:t}:{}}:{color:`#dddddd`,roughness:.4,metalness:.1};a=await f(o,r,{defaultColor:e}),t<1&&(a.transparent=!0),D<=0&&(a.side=2),M.set(i,a)}return a},P=[];for(let e of g){let t=T(e,O,k,h,a);if(!t)continue;t.getAttribute(`normal`)||t.computeVertexNormals();let n=j?`${e.color}|${e.opacity}`:`|${e.opacity}`,r=P[P.length-1];r&&r.key===n?r.geos.push(t):P.push({key:n,color:e.color,opacity:e.opacity,geos:[t]})}let F=new t;for(let[t,n]of P.entries()){for(let t of n.geos){for(let e of Object.keys(t.attributes))[`position`,`normal`,`uv`].includes(e)||t.deleteAttribute(e);t.getAttribute(`uv`)||t.setAttribute(`uv`,new e(new Float32Array(t.getAttribute(`position`).count*2),2))}let r=n.geos.length===1?n.geos[0]:a.mergeGeometries(n.geos.map(e=>e.index?e.toNonIndexed():e),!1)??n.geos[0],i=new u(r,await N(n.color,n.opacity));i.position.z=t*A/E,F.add(i)}let I=(v.min.x+v.max.x)/2,L=(v.min.y+v.max.y)/2;return F.scale.set(E,-E,E),F.position.set(-I*E,L*E,-(D+Math.max(0,P.length-1)*A)/2),_.add(F),_}export{E as buildSvg};
@@ -1,2 +1,2 @@
1
- import{Ft as e,H as t,Mn as n,N as r,an as i,bt as a,m as o,on as s,yt as c}from"./three.module-DnaBiDAJ.js";import{c as l,n as u}from"./materials-Dn-bYrZd.js";import{t as d}from"./easing-CXSz2e6P.js";import{c as f}from"./util-CyaW1fcW.js";import{i as p,r as m}from"./extrude-D6WnITQq.js";var h=/* @__PURE__ */ new Map;function g(e){let t=h.get(e);return t||(t=Promise.all([import(`./FontLoader-dVu9WH2X.js`),l(e)]).then(([e,t])=>new e.FontLoader().parse(t)),t.catch(()=>h.delete(e)),h.set(e,t)),t}var _=e=>{let t=e.normalize(`NFD`);return t.length>1?t[0]:e};function v(e,t,n){let r=e.kerning;if(!r)return 0;let i=r[t]?.[n];if(i!==void 0)return i;let a=_(t),o=_(n);return a===t&&o===n?0:r[a]?.[o]??0}function y(e,t){let n=t.em/e.resolution,r=f(t.letterSpacing,0),i=f(t.lineHeight,1.25)*t.em,a=t.kerning!==!1,o=t=>(e.glyphs[t]??e.glyphs[`?`])?.ha??e.resolution*.5,s=t=>{let i=[],s=0;return t.forEach((c,l)=>{l>0&&(s+=r+(a?v(e,t[l-1],c)*n:0)),i.push(s),s+=o(c)*n}),{xs:i,width:s}},c=[],l=typeof t.maxWidth==`number`&&t.maxWidth>0?t.maxWidth:1/0;for(let e of String(t.text??``).split(`
1
+ import{Ft as e,H as t,Mn as n,N as r,an as i,bt as a,m as o,on as s,yt as c}from"./three.module-DnaBiDAJ.js";import{c as l,n as u}from"./materials-w3EW0g-7.js";import{t as d}from"./easing-CXSz2e6P.js";import{c as f}from"./util-CyaW1fcW.js";import{i as p,r as m}from"./extrude-D6WnITQq.js";var h=/* @__PURE__ */ new Map;function g(e){let t=h.get(e);return t||(t=Promise.all([import(`./FontLoader-dVu9WH2X.js`),l(e)]).then(([e,t])=>new e.FontLoader().parse(t)),t.catch(()=>h.delete(e)),h.set(e,t)),t}var _=e=>{let t=e.normalize(`NFD`);return t.length>1?t[0]:e};function v(e,t,n){let r=e.kerning;if(!r)return 0;let i=r[t]?.[n];if(i!==void 0)return i;let a=_(t),o=_(n);return a===t&&o===n?0:r[a]?.[o]??0}function y(e,t){let n=t.em/e.resolution,r=f(t.letterSpacing,0),i=f(t.lineHeight,1.25)*t.em,a=t.kerning!==!1,o=t=>(e.glyphs[t]??e.glyphs[`?`])?.ha??e.resolution*.5,s=t=>{let i=[],s=0;return t.forEach((c,l)=>{l>0&&(s+=r+(a?v(e,t[l-1],c)*n:0)),i.push(s),s+=o(c)*n}),{xs:i,width:s}},c=[],l=typeof t.maxWidth==`number`&&t.maxWidth>0?t.maxWidth:1/0;for(let e of String(t.text??``).split(`
2
2
  `)){if(l===1/0){c.push(Array.from(e));continue}let t=e.split(/ +/),n=[];for(let e of t){let t=n.length?[...n,` `,...Array.from(e)]:Array.from(e);n.length&&s(t).width>l?(c.push(n),n=Array.from(e)):n=t}c.push(n)}let u=[],d=[],p=0;return c.forEach((e,n)=>{for(;e.length&&e[e.length-1]===` `;)e.pop();let{xs:r,width:a}=s(e);p=Math.max(p,a);let o=t.align===`left`?0:t.align===`right`?-a:-a/2;e.forEach((e,t)=>{e.trim()&&u.push({ch:e,x:r[t]+o,line:n})}),d.push({width:a,y:-n*i})}),{glyphs:u,lines:d,lineHeight:i,width:p}}function b(e){let t=e.data;if(t.capHeight&&t.resolution)return t.capHeight/t.resolution;let n=e.generateShapes(`H`,1);if(!n.length)return .72;let r=new s(n);r.computeBoundingBox();let i=r.boundingBox.max.y-r.boundingBox.min.y;return r.dispose(),i>0?i:.72}function x(e,t){let n=e.data,r=f(t.size,1),i=r/b(e),a=Math.max(0,f(t.depth,.2)),o=a>0?Math.max(0,Math.min(f(t.bevel,Math.min(a*.3,r*.035)),a*.45,r*.08)):0,s=Math.round(Math.max(2,Math.min(32,f(t.curveSegments,a>0?5+r*3:8+r*4)))),c=y(n,{text:t.text,em:i,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,align:t.align??`center`,maxWidth:t.maxWidth,kerning:t.kerning});return{size:r,em:i,depth:a,bevel:o,curveSegments:s,layout:c,offsetY:-(r+(c.lines.length?c.lines[c.lines.length-1].y:0))/2,frontZ:a/2,backZ:-a/2}}function S(e){let t=e.bevel;return{depth:Math.max(e.depth-t*2,1e-4),curveSegments:e.curveSegments,bevelEnabled:t>0,bevelThickness:t,bevelSize:t*.6,bevelOffset:0,bevelSegments:3}}function C(e,t,n){let r=n.em/(n.curveSegments*5);return e.generateShapes(t,n.em).map(e=>m(e,r,1,n.curveSegments))}function w(e,t,n,i){let a=C(e,t,n);if(!a.length)return null;if(n.depth<=0)return new s(a,n.curveSegments);let o=new r(a,S(n));return o.translate(0,0,n.backZ+n.bevel),o.clearGroups(),p(o,50*Math.PI/180,i)}function T(e,t){let n=e.outline;if(!n)return null;let r=n===!0?{}:n,i=Math.max(1e-4,f(r.width,t.size*.06)),a=t.depth>0?t.depth*.5:t.size*.01,o=t.frontZ-a;return{width:i,frontZ:o,backZ:o-Math.max(f(r.depth,t.depth>0?t.depth*.6:t.size*.01),1e-4),material:r.material,color:r.color??`#111111`}}function E(e){let t=0;for(let n=0,r=e.length-1;n<e.length;r=n++)t+=(e[r].x-e[n].x)*(e[r].y+e[n].y);return t/2}function D(e,t,r=2){let i=e.filter((t,n)=>{let r=e[(n+1)%e.length];return Math.hypot(r.x-t.x,r.y-t.y)>1e-9}),a=i.length,o=[];if(a<3)return i.map(e=>new n(e.x,e.y));let s=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.hypot(n,r)||1;return{x:r/i,y:-n/i}};for(let e=0;e<a;e++){let c=i[(e-1+a)%a],l=i[e],u=i[(e+1)%a],d=s(c,l),f=s(l,u),p=(l.x-c.x)*(u.y-l.y)-(l.y-c.y)*(u.x-l.x),m=d.x*f.x+d.y*f.y;if(p>0&&m<.995){let e=Math.atan2(d.y,d.x),r=Math.atan2(f.y,f.x);for(;r<e;)r+=Math.PI*2;for(;r>e+Math.PI*2;)r-=Math.PI*2;let i=Math.max(1,Math.ceil(Math.abs(r-e)/(Math.PI/8)));for(let a=0;a<=i;a++){let s=e+(r-e)*a/i;o.push(new n(l.x+Math.cos(s)*t,l.y+Math.sin(s)*t))}}else{let e=d.x+f.x,i=d.y+f.y,a=Math.hypot(e,i)||1;e/=a,i/=a;let s=Math.max(e*d.x+i*d.y,1/r);o.push(new n(l.x+e*t/s,l.y+i*t/s))}}return o}function O(t,n){let r=[];for(let a of t){let{shape:t,holes:o}=a.extractPoints(1),s=t.slice();E(s)<0&&(s=s.reverse());let c=new i(D(s,n));for(let t of o){let r=t.slice(),i=Math.abs(E(r));E(r)>0&&(r=r.reverse());let a=r.map(e=>e.x),o=r.map(e=>e.y);if(Math.max(...a)-Math.min(...a)<=2*n||Math.max(...o)-Math.min(...o)<=2*n)continue;let s=D(r,n),l=E(s);l<0&&-l>i*.02&&c.holes.push(new e(s))}r.push(c)}return r}function k(e,t,n,i,a){let o=C(e,t,n);if(!o.length)return null;let s=new r(O(o,i.width),{depth:i.frontZ-i.backZ,curveSegments:1,bevelEnabled:!1});return s.translate(0,0,i.backZ),s.clearGroups(),p(s,40*Math.PI/180,a)}function A(e,t,n){let r=/* @__PURE__ */ new Map,i=[];for(let n of e.layout.glyphs){r.has(n.ch)||r.set(n.ch,t(n.ch));let a=r.get(n.ch);if(!a)continue;let o=a.clone();o.translate(n.x,e.layout.lines[n.line].y+e.offsetY,0),i.push(o)}for(let e of r.values())e?.dispose();let a;if(!i.length)a=new o;else{a=(i.length===1?i[0].clone():n.mergeGeometries(i,!1))??new o;for(let e of i)e.dispose()}return a.computeBoundingBox(),a.computeBoundingSphere(),a}function j(e,t,n){let r=f(e.stagger,.04),i=t;if(e.order===`reverse`)i=n-1-t;else if(e.order===`center`)i=Math.abs(t-(n-1)/2);else if(e.order===`random`){let e=(t+1)*2654435761;e=(e^e>>>13)>>>0,i=e%1e3/1e3*(n-1)}return f(e.delay,0)+i*r}function M(e,t){return(n,r)=>{let i=e.effect??`rise`,a=Math.max(f(e.duration,.6),.001),o=e.ease??(i===`scale`||i===`spin`?`outBack`:`outCubic`),s=i!==`scale`,c=[],l=[];if(s){let e=[];r.object.traverse(t=>{let n=t.material;if(n&&!t.userData.depthTwin){e.push(t);for(let e of Array.isArray(n)?n:[n])e.userData.baseOpacity===void 0&&(e.userData.baseOpacity=e.opacity),e.userData.baseTransparent===void 0&&(e.userData.baseTransparent=e.transparent),c.push(e)}});for(let t of e)l.push(P(t))}return{update(e){let n=Math.min(Math.max(e/a,0),1),u=d(o,n),f=r.object;if(s){let e=d(`outCubic`,Math.min(1,n*1.6));for(let t of c)t.opacity=t.userData.baseOpacity*e,t.transparent=e<1||t.userData.baseTransparent;for(let t of l)t.visible=e>0&&e<1}switch(n<=0&&(f.visible=!1),i){case`rise`:f.position.y-=(1-u)*t*.6;break;case`drop`:f.position.y+=(1-u)*t*1.2;break;case`scale`:f.scale.multiplyScalar(Math.max(1e-4,u));break;case`spin`:f.rotation.y+=(1-u)*Math.PI,f.scale.multiplyScalar(Math.max(1e-4,Math.min(1,n*2)))}}}}}var N=null;function P(e){N??=new a({colorWrite:!1,depthWrite:!0});let t=new c(e.geometry,N);return t.name=`${e.name}#depth`,t.visible=!1,t.castShadow=!1,t.receiveShadow=!1,t.renderOrder=-1,t.userData.helper=!0,t.userData.depthTwin=!0,e.add(t),t}function F(e,t){let n=e.font??`sans-bold`;return t.resolveAsset(n.includes(`/`)||n.includes(`:`)?n:`library:fonts/${n}`)}function I(e,t,n){let r=e.userData.gradient;r&&(r.uGradMin.value=t,r.uGradMax.value=n)}async function L(e,n){let[r,i]=await Promise.all([g(F(e,n)),import(`./BufferGeometryUtils-XmME4f7Z.js`).then(e=>e.t)]),a=x(r,e),o=T(e,a),s=!!e.splitLetters||!!e.reveal,l=a.depth<=0,d=()=>u(e.material,n,{defaultColor:`#ffffff`}),f=()=>o?u(o.material??{color:o.color,roughness:.55},n):null,p=(a.layout.lines.length?a.layout.lines[a.layout.lines.length-1].y:0)+a.offsetY,m=a.size+a.offsetY,h=e=>(l&&(e.side=2),e);if(!s){let t=A(a,e=>w(r,e,a,i),i),n=h(await d());I(n,p,m);let s=new c(t,n);if(o){let t=A(a,e=>k(r,e,a,o,i),i),n=await f();if(n){I(n,p,m);let r=new c(t,n);r.name=`${e.id}/outline`,s.add(r)}}return{object:s,letters:[]}}let _=new t,v=/* @__PURE__ */ new Map,y=/* @__PURE__ */ new Map,b=a.size/2,S=[],C=a.layout.glyphs.length,E=0;for(let t of a.layout.glyphs){if(!v.has(t.ch)){let e=w(r,t.ch,a,i),n=0;if(e&&(e.computeBoundingBox(),n=(e.boundingBox.min.x+e.boundingBox.max.x)/2,e.translate(-n,-b,0),e.computeBoundingSphere()),v.set(t.ch,e),o){let e=k(r,t.ch,a,o,i);e?.translate(-n,-b,0),y.set(t.ch,e)}e&&(e.userData.cx=n)}let n=v.get(t.ch);if(!n)continue;let s=n.userData.cx,l=a.layout.lines[t.line].y+a.offsetY,u=h(await d());I(u,p-l-b,m-l-b);let g=new c(n,u);g.position.set(t.x+s,l+b,0);let x=`${e.id}/${E}`;g.name=x,g.userData.a3dId=x;let T=y.get(t.ch);if(T){let e=await f();if(e){I(e,p-l-b,m-l-b);let t=new c(T,e);t.name=`${x}/outline`,g.add(t)}}_.add(g);let D={id:x,object:g,def:{id:x,kind:`text`,text:t.ch}};e.reveal&&(D.reveal={def:{type:`appear`,when:`visible`,delay:j(e.reveal,E,C)},impl:M(e.reveal,a.size)}),S.push(D),E++}return{object:_,letters:S}}export{L as buildText};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./OrbitControls-MlE9XiCg.js","./three.module-CnI50X0U.js"])))=>i.map(i=>d[i]);
2
- import{In as e,It as t,Ln as n,Rt as r,wn as i,x as a}from"./three.module-CnI50X0U.js";import{h as o}from"./index-3LL5NEIH.js";var s=Math.PI/180;function c(e,t,n){return e<t?t:e>n?n:e}function l(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function u(e,t){return typeof e==`boolean`?e:t}function d(e,t){return typeof e==`string`?e:t}function f(e,t){return Array.isArray(e)&&e.length>=3&&e.every(e=>typeof e==`number`)?[e[0],e[1],e[2]]:t}function p(e,t){return typeof e==`string`?[e]:Array.isArray(e)&&e.length&&e.every(e=>typeof e==`string`)?e:t}var m=new Map;function h(e,t=`#ffffff`){let n=typeof e==`string`&&e?e:t,r=m.get(n);if(!r){r=new a;try{r.setStyle(n)}catch{r.setStyle(t)}m.size>512&&m.clear(),m.set(n,r)}return r.clone()}function g(e,t){let n={};if(e)for(let t of e.params)t.default!==void 0&&(n[t.name]=t.default);for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function _(e,t){let n=c(e,0,.999);return n<=0?1:1-n**(t*60)}function v(e){let t=Math.sin(e*127.1+311.7)*43758.5453123;return t-Math.floor(t)}function y(e){e.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose();let n=t.material;if(n)for(let e of Array.isArray(n)?n:[n])b(e)})}function b(e){for(let t of Object.values(e))t instanceof i&&t.dispose();e.dispose()}function x(e){let t=new Set;return e.traverse(e=>{let n=e.material;if(n&&!e.userData.depthTwin)for(let e of Array.isArray(n)?n:[n])t.add(e)}),[...t]}function S(e){let t=(Math.floor(e)|0)^2654435769,n=()=>{t=t+2654435769|0;let e=t;return e=Math.imul(e^e>>>16,2246822507),e=Math.imul(e^e>>>13,3266489909),(e^e>>>16)>>>0},r=n(),i=n(),a=n(),o=n(),s=()=>{r>>>=0,i>>>=0,a>>>=0,o>>>=0;let e=(r+i|0)+o|0;return o=o+1|0,r=i^i>>>9,i=a+(a<<3)|0,a=a<<21|a>>>11,a=a+e|0,(e>>>0)/4294967296};for(let e=0;e<12;e++)s();return{next:s,range:(e,t)=>e+(t-e)*s(),int:(e,t)=>e+Math.floor(s()*(t-e+1)),pick:e=>e[Math.floor(s()*e.length)]}}function C(e,t){let n=(e|0)^2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}var w=new Uint8Array(512),T=new Uint8Array(512);{let e=new Uint8Array(256);for(let t=0;t<256;t++)e[t]=t;let t=S(1337);for(let n=255;n>0;n--){let r=Math.floor(t.next()*(n+1)),i=e[n];e[n]=e[r],e[r]=i}for(let t=0;t<512;t++)w[t]=e[t&255],T[t]=w[t]%12}var E=new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),D=.5*(Math.sqrt(3)-1),O=(3-Math.sqrt(3))/6;function k(e,t){let n=(e+t)*D,r=Math.floor(e+n),i=Math.floor(t+n),a=(r+i)*O,o=e-(r-a),s=t-(i-a),c=+(o>s),l=o>s?0:1,u=o-c+O,d=s-l+O,f=o-1+2*O,p=s-1+2*O,m=r&255,h=i&255,g=0,_=.5-o*o-s*s;if(_>0){let e=T[m+w[h]]*3;_*=_,g+=_*_*(E[e]*o+E[e+1]*s)}let v=.5-u*u-d*d;if(v>0){let e=T[m+c+w[h+l]]*3;v*=v,g+=v*v*(E[e]*u+E[e+1]*d)}let y=.5-f*f-p*p;if(y>0){let e=T[m+1+w[h+1]]*3;y*=y,g+=y*y*(E[e]*f+E[e+1]*p)}return 70*g}var A=1/3,j=1/6;function M(e,t,n){let r=(e+t+n)*A,i=Math.floor(e+r),a=Math.floor(t+r),o=Math.floor(n+r),s=(i+a+o)*j,c=e-(i-s),l=t-(a-s),u=n-(o-s),d,f,p,m,h,g;c>=l?l>=u?[d,f,p,m,h,g]=[1,0,0,1,1,0]:c>=u?[d,f,p,m,h,g]=[1,0,0,1,0,1]:[d,f,p,m,h,g]=[0,0,1,1,0,1]:l<u?[d,f,p,m,h,g]=[0,0,1,0,1,1]:c<u?[d,f,p,m,h,g]=[0,1,0,0,1,1]:[d,f,p,m,h,g]=[0,1,0,1,1,0];let _=c-d+j,v=l-f+j,y=u-p+j,b=c-m+2*j,x=l-h+2*j,S=u-g+2*j,C=c-1+3*j,D=l-1+3*j,O=u-1+3*j,k=i&255,M=a&255,N=o&255,P=0,F=(e,t,n,r)=>{let i=.6-e*e-t*t-n*n;if(i>0){let a=r*3;i*=i,P+=i*i*(E[a]*e+E[a+1]*t+E[a+2]*n)}};return F(c,l,u,T[k+w[M+w[N]]]),F(_,v,y,T[k+d+w[M+f+w[N+p]]]),F(b,x,S,T[k+m+w[M+h+w[N+g]]]),F(C,D,O,T[k+1+w[M+1+w[N+1]]]),32*P}function N(e,t,n,r=2,i=.5){let a=0,o=1,s=1,c=0;for(let l=0;l<n;l++)a+=o*k(e*s+l*17.31,t*s-l*9.17),c+=o,o*=i,s*=r;return c>0?a/c:0}function P(e,t,n,r,i=2,a=.5){let o=0,s=1,c=1,l=0;for(let u=0;u<r;u++)o+=s*M(e*c+u*17.31,t*c-u*9.17,n*c+u*3.7),l+=s,s*=a,c*=i;return l>0?o/l:0}function F(e,t,n,r=2,i=.5){let a=0,o=1,s=1,c=0;for(let l=0;l<n;l++){let n=1-Math.abs(k(e*s+l*31.7,t*s+l*11.3));a+=o*n*n,c+=o,o*=i,s*=r}return c>0?a/c:0}function I(e,i){let a=l(e.near,.1),o=l(e.far,1e3),s;if(e.type===`orthographic`){let n=l(e.zoom,10)/2;s=new t(-n*i,n*i,n,-n,a,o)}else s=new r(l(e.fov,45),i,a,o);s.position.set(...e.position);let c=e.target??[0,0,0];return B(s.position,new n(c[0],c[1],c[2])),s.lookAt(c[0],c[1],c[2]),s}function L(e,t){return!t||!(e>0)||e>=t?1:Math.min(t/e,3)}function R(e,t){return t<=1?e:Math.min(100,2*Math.atan(Math.tan(e*s/2)*t)/s)}function z(e,n,i,a){let o=L(i,a);if(e.userData.fitScale=o,e instanceof r)e.aspect=i,e.fov=R(l(e.userData.restFov,l(n.fov,45)),o),e.updateProjectionMatrix();else if(e instanceof t){let t=(e.userData.zoomHeight??l(n.zoom,10))/2*o;e.left=-t*i,e.right=t*i,e.top=t,e.bottom=-t,e.updateProjectionMatrix()}}function B(e,t){let n=t.x-e.x,r=t.y-e.y,i=t.z-e.z,a=Math.hypot(n,r,i);if(a<1e-9)return;let o=-1e-4/a;e.set(e.x+n*o,e.y+r*o,e.z+i*o)}async function V(i,a,u,d){let f=new n(...i.target??[0,0,0]),p={position:new n(...i.position),target:f.clone(),fov:l(i.fov,45),zoom:l(i.zoom,10)},m=i.controls??`none`,h=p.position.clone(),g=p.target.clone(),v=new e,y=new n,b=!0,x=null;if(m===`orbit`&&u&&!d){let{OrbitControls:e}=await o(async()=>{let{OrbitControls:e}=await import(`./OrbitControls-MlE9XiCg.js`);return{OrbitControls:e}},__vite__mapDeps([0,1]),import.meta.url),t=new e(a,u);t.target.copy(p.target),t.enableDamping=!0,t.dampingFactor=.08,t.enableZoom=i.orbitZoom!==!1,t.enablePan=!1;let n=i.orbitLimits??{};n.minDistance!==void 0&&(t.minDistance=n.minDistance),n.maxDistance!==void 0&&(t.maxDistance=n.maxDistance),n.minPolar!==void 0&&(t.minPolarAngle=n.minPolar*s),n.maxPolar!==void 0&&(t.maxPolarAngle=n.maxPolar*s),n.minAzimuth!==void 0&&(t.minAzimuthAngle=n.minAzimuth*s),n.maxAzimuth!==void 0&&(t.maxAzimuthAngle=n.maxAzimuth*s),i.autoRotate&&(t.autoRotate=!0,t.autoRotateSpeed=i.autoRotate/360*60),x=t}let S=new n,C=new n;return{rest:p,shake:y,orbit:x,update(e,o,u){if(a instanceof r){a.userData.restFov=p.fov;let e=R(p.fov,l(a.userData.fitScale,1));a.fov!==e&&(a.fov=e,a.updateProjectionMatrix())}else if(a instanceof t&&l(a.userData.zoomHeight,l(i.zoom,10))!==p.zoom){a.userData.zoomHeight=p.zoom;let e=(a.right-a.left)/Math.max(a.top-a.bottom,1e-6),t=p.zoom/2*l(a.userData.fitScale,1);a.left=-t*e,a.right=t*e,a.top=t,a.bottom=-t,a.updateProjectionMatrix()}if(x){x.update(),a.position.add(y);return}let d=S.copy(p.position),f=g;if(m===`scroll`&&i.scrollPath?.length){let e=i.scrollPath,t=c(u.scroll,0,1)*(e.length-1),r=Math.min(Math.floor(t),e.length-2),a=e.length===1?0:t-Math.max(r,0),o=a*a*(3-2*a),s=e[Math.max(r,0)],l=e[Math.min(Math.max(r,0)+1,e.length-1)];d.set(...s.position).lerp(new n(...l.position),o);let p=new n(...s.target??i.target??[0,0,0]),m=new n(...l.target??i.target??[0,0,0]);f.copy(p.lerp(m,o))}else if(m===`follow`&&u.followTarget){let e=i.follow??{target:``},t=u.followTarget.getWorldPosition(new n),r=new n(...e.offset??[0,4,8]),a=t.clone().add(r),s=t.clone().add(new n(0,0,-l(e.lookAhead,0))),c=b?1:_(l(e.smoothing,.85),o);h.lerp(a,c),f.lerp(s,c),d=S.copy(h)}else f.copy(p.target);if(u.lookAt&&f.copy(u.lookAt),i.autoRotate&&m!==`follow`){let t=i.autoRotate*s*e,r=d.clone().sub(f);r.applyAxisAngle(new n(0,1,0),t),d.copy(f).add(r)}if(m===`parallax`){let e=i.parallax??{},t=l(e.strength,.5),r=_(l(e.smoothing,.92),o);v.x+=(u.pointer.x*t-v.x)*r,v.y+=(u.pointer.y*t*.6-v.y)*r;let s=f.clone().sub(d).normalize(),c=new n().crossVectors(s,a.up).normalize(),p=new n().crossVectors(c,s).normalize();d.addScaledVector(c,v.x).addScaledVector(p,v.y)}if(i.shake){let t=i.shake,r=l(t.speed,.5),o=l(t.amount,.03),c=l(t.rotation,.4)*s,u=l(t.seed,1)*17.31,p=t=>k(e*r+u,t*7.13)*.75+k(e*r*2.7+u,t*7.13+3.1)*.25,m=f.clone().sub(d),h=m.length()||1;m.divideScalar(h);let g=new n().crossVectors(m,a.up).normalize(),_=new n().crossVectors(g,m).normalize();d.addScaledVector(g,p(0)*o).addScaledVector(_,p(1)*o),C.copy(f).addScaledVector(g,Math.tan(p(2)*c)*h).addScaledVector(_,Math.tan(p(3)*c)*h)}else C.copy(f);a.position.copy(d).add(y),B(a.position,C),a.lookAt(C),b=!1},dispose(){x?.dispose()}}}export{g as C,f as S,x as _,N as a,d as b,k as c,s as d,u as f,v as g,y as h,S as i,M as l,p as m,V as n,P as o,c as p,z as r,C as s,I as t,F as u,l as v,h as x,_ as y};
2
+ import{In as e,It as t,Ln as n,Rt as r,wn as i,x as a}from"./three.module-CnI50X0U.js";import{h as o}from"./index-tSGZFEt5.js";var s=Math.PI/180;function c(e,t,n){return e<t?t:e>n?n:e}function l(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function u(e,t){return typeof e==`boolean`?e:t}function d(e,t){return typeof e==`string`?e:t}function f(e,t){return Array.isArray(e)&&e.length>=3&&e.every(e=>typeof e==`number`)?[e[0],e[1],e[2]]:t}function p(e,t){return typeof e==`string`?[e]:Array.isArray(e)&&e.length&&e.every(e=>typeof e==`string`)?e:t}var m=new Map;function h(e,t=`#ffffff`){let n=typeof e==`string`&&e?e:t,r=m.get(n);if(!r){r=new a;try{r.setStyle(n)}catch{r.setStyle(t)}m.size>512&&m.clear(),m.set(n,r)}return r.clone()}function g(e,t){let n={};if(e)for(let t of e.params)t.default!==void 0&&(n[t.name]=t.default);for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function _(e,t){let n=c(e,0,.999);return n<=0?1:1-n**(t*60)}function v(e){let t=Math.sin(e*127.1+311.7)*43758.5453123;return t-Math.floor(t)}function y(e){e.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose();let n=t.material;if(n)for(let e of Array.isArray(n)?n:[n])b(e)})}function b(e){for(let t of Object.values(e))t instanceof i&&t.dispose();e.dispose()}function x(e){let t=new Set;return e.traverse(e=>{let n=e.material;if(n&&!e.userData.depthTwin)for(let e of Array.isArray(n)?n:[n])t.add(e)}),[...t]}function S(e){let t=(Math.floor(e)|0)^2654435769,n=()=>{t=t+2654435769|0;let e=t;return e=Math.imul(e^e>>>16,2246822507),e=Math.imul(e^e>>>13,3266489909),(e^e>>>16)>>>0},r=n(),i=n(),a=n(),o=n(),s=()=>{r>>>=0,i>>>=0,a>>>=0,o>>>=0;let e=(r+i|0)+o|0;return o=o+1|0,r=i^i>>>9,i=a+(a<<3)|0,a=a<<21|a>>>11,a=a+e|0,(e>>>0)/4294967296};for(let e=0;e<12;e++)s();return{next:s,range:(e,t)=>e+(t-e)*s(),int:(e,t)=>e+Math.floor(s()*(t-e+1)),pick:e=>e[Math.floor(s()*e.length)]}}function C(e,t){let n=(e|0)^2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}var w=new Uint8Array(512),T=new Uint8Array(512);{let e=new Uint8Array(256);for(let t=0;t<256;t++)e[t]=t;let t=S(1337);for(let n=255;n>0;n--){let r=Math.floor(t.next()*(n+1)),i=e[n];e[n]=e[r],e[r]=i}for(let t=0;t<512;t++)w[t]=e[t&255],T[t]=w[t]%12}var E=new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),D=.5*(Math.sqrt(3)-1),O=(3-Math.sqrt(3))/6;function k(e,t){let n=(e+t)*D,r=Math.floor(e+n),i=Math.floor(t+n),a=(r+i)*O,o=e-(r-a),s=t-(i-a),c=+(o>s),l=o>s?0:1,u=o-c+O,d=s-l+O,f=o-1+2*O,p=s-1+2*O,m=r&255,h=i&255,g=0,_=.5-o*o-s*s;if(_>0){let e=T[m+w[h]]*3;_*=_,g+=_*_*(E[e]*o+E[e+1]*s)}let v=.5-u*u-d*d;if(v>0){let e=T[m+c+w[h+l]]*3;v*=v,g+=v*v*(E[e]*u+E[e+1]*d)}let y=.5-f*f-p*p;if(y>0){let e=T[m+1+w[h+1]]*3;y*=y,g+=y*y*(E[e]*f+E[e+1]*p)}return 70*g}var A=1/3,j=1/6;function M(e,t,n){let r=(e+t+n)*A,i=Math.floor(e+r),a=Math.floor(t+r),o=Math.floor(n+r),s=(i+a+o)*j,c=e-(i-s),l=t-(a-s),u=n-(o-s),d,f,p,m,h,g;c>=l?l>=u?[d,f,p,m,h,g]=[1,0,0,1,1,0]:c>=u?[d,f,p,m,h,g]=[1,0,0,1,0,1]:[d,f,p,m,h,g]=[0,0,1,1,0,1]:l<u?[d,f,p,m,h,g]=[0,0,1,0,1,1]:c<u?[d,f,p,m,h,g]=[0,1,0,0,1,1]:[d,f,p,m,h,g]=[0,1,0,1,1,0];let _=c-d+j,v=l-f+j,y=u-p+j,b=c-m+2*j,x=l-h+2*j,S=u-g+2*j,C=c-1+3*j,D=l-1+3*j,O=u-1+3*j,k=i&255,M=a&255,N=o&255,P=0,F=(e,t,n,r)=>{let i=.6-e*e-t*t-n*n;if(i>0){let a=r*3;i*=i,P+=i*i*(E[a]*e+E[a+1]*t+E[a+2]*n)}};return F(c,l,u,T[k+w[M+w[N]]]),F(_,v,y,T[k+d+w[M+f+w[N+p]]]),F(b,x,S,T[k+m+w[M+h+w[N+g]]]),F(C,D,O,T[k+1+w[M+1+w[N+1]]]),32*P}function N(e,t,n,r=2,i=.5){let a=0,o=1,s=1,c=0;for(let l=0;l<n;l++)a+=o*k(e*s+l*17.31,t*s-l*9.17),c+=o,o*=i,s*=r;return c>0?a/c:0}function P(e,t,n,r,i=2,a=.5){let o=0,s=1,c=1,l=0;for(let u=0;u<r;u++)o+=s*M(e*c+u*17.31,t*c-u*9.17,n*c+u*3.7),l+=s,s*=a,c*=i;return l>0?o/l:0}function F(e,t,n,r=2,i=.5){let a=0,o=1,s=1,c=0;for(let l=0;l<n;l++){let n=1-Math.abs(k(e*s+l*31.7,t*s+l*11.3));a+=o*n*n,c+=o,o*=i,s*=r}return c>0?a/c:0}function I(e,i){let a=l(e.near,.1),o=l(e.far,1e3),s;if(e.type===`orthographic`){let n=l(e.zoom,10)/2;s=new t(-n*i,n*i,n,-n,a,o)}else s=new r(l(e.fov,45),i,a,o);s.position.set(...e.position);let c=e.target??[0,0,0];return B(s.position,new n(c[0],c[1],c[2])),s.lookAt(c[0],c[1],c[2]),s}function L(e,t){return!t||!(e>0)||e>=t?1:Math.min(t/e,3)}function R(e,t){return t<=1?e:Math.min(100,2*Math.atan(Math.tan(e*s/2)*t)/s)}function z(e,n,i,a){let o=L(i,a);if(e.userData.fitScale=o,e instanceof r)e.aspect=i,e.fov=R(l(e.userData.restFov,l(n.fov,45)),o),e.updateProjectionMatrix();else if(e instanceof t){let t=(e.userData.zoomHeight??l(n.zoom,10))/2*o;e.left=-t*i,e.right=t*i,e.top=t,e.bottom=-t,e.updateProjectionMatrix()}}function B(e,t){let n=t.x-e.x,r=t.y-e.y,i=t.z-e.z,a=Math.hypot(n,r,i);if(a<1e-9)return;let o=-1e-4/a;e.set(e.x+n*o,e.y+r*o,e.z+i*o)}async function V(i,a,u,d){let f=new n(...i.target??[0,0,0]),p={position:new n(...i.position),target:f.clone(),fov:l(i.fov,45),zoom:l(i.zoom,10)},m=i.controls??`none`,h=p.position.clone(),g=p.target.clone(),v=new e,y=new n,b=!0,x=null;if(m===`orbit`&&u&&!d){let{OrbitControls:e}=await o(async()=>{let{OrbitControls:e}=await import(`./OrbitControls-MlE9XiCg.js`);return{OrbitControls:e}},__vite__mapDeps([0,1]),import.meta.url),t=new e(a,u);t.target.copy(p.target),t.enableDamping=!0,t.dampingFactor=.08,t.enableZoom=i.orbitZoom!==!1,t.enablePan=!1;let n=i.orbitLimits??{};n.minDistance!==void 0&&(t.minDistance=n.minDistance),n.maxDistance!==void 0&&(t.maxDistance=n.maxDistance),n.minPolar!==void 0&&(t.minPolarAngle=n.minPolar*s),n.maxPolar!==void 0&&(t.maxPolarAngle=n.maxPolar*s),n.minAzimuth!==void 0&&(t.minAzimuthAngle=n.minAzimuth*s),n.maxAzimuth!==void 0&&(t.maxAzimuthAngle=n.maxAzimuth*s),i.autoRotate&&(t.autoRotate=!0,t.autoRotateSpeed=i.autoRotate/360*60),x=t}let S=new n,C=new n;return{rest:p,shake:y,orbit:x,update(e,o,u){if(a instanceof r){a.userData.restFov=p.fov;let e=R(p.fov,l(a.userData.fitScale,1));a.fov!==e&&(a.fov=e,a.updateProjectionMatrix())}else if(a instanceof t&&l(a.userData.zoomHeight,l(i.zoom,10))!==p.zoom){a.userData.zoomHeight=p.zoom;let e=(a.right-a.left)/Math.max(a.top-a.bottom,1e-6),t=p.zoom/2*l(a.userData.fitScale,1);a.left=-t*e,a.right=t*e,a.top=t,a.bottom=-t,a.updateProjectionMatrix()}if(x){x.update(),a.position.add(y);return}let d=S.copy(p.position),f=g;if(m===`scroll`&&i.scrollPath?.length){let e=i.scrollPath,t=c(u.scroll,0,1)*(e.length-1),r=Math.min(Math.floor(t),e.length-2),a=e.length===1?0:t-Math.max(r,0),o=a*a*(3-2*a),s=e[Math.max(r,0)],l=e[Math.min(Math.max(r,0)+1,e.length-1)];d.set(...s.position).lerp(new n(...l.position),o);let p=new n(...s.target??i.target??[0,0,0]),m=new n(...l.target??i.target??[0,0,0]);f.copy(p.lerp(m,o))}else if(m===`follow`&&u.followTarget){let e=i.follow??{target:``},t=u.followTarget.getWorldPosition(new n),r=new n(...e.offset??[0,4,8]),a=t.clone().add(r),s=t.clone().add(new n(0,0,-l(e.lookAhead,0))),c=b?1:_(l(e.smoothing,.85),o);h.lerp(a,c),f.lerp(s,c),d=S.copy(h)}else f.copy(p.target);if(u.lookAt&&f.copy(u.lookAt),i.autoRotate&&m!==`follow`){let t=i.autoRotate*s*e,r=d.clone().sub(f);r.applyAxisAngle(new n(0,1,0),t),d.copy(f).add(r)}if(m===`parallax`){let e=i.parallax??{},t=l(e.strength,.5),r=_(l(e.smoothing,.92),o);v.x+=(u.pointer.x*t-v.x)*r,v.y+=(u.pointer.y*t*.6-v.y)*r;let s=f.clone().sub(d).normalize(),c=new n().crossVectors(s,a.up).normalize(),p=new n().crossVectors(c,s).normalize();d.addScaledVector(c,v.x).addScaledVector(p,v.y)}if(i.shake){let t=i.shake,r=l(t.speed,.5),o=l(t.amount,.03),c=l(t.rotation,.4)*s,u=l(t.seed,1)*17.31,p=t=>k(e*r+u,t*7.13)*.75+k(e*r*2.7+u,t*7.13+3.1)*.25,m=f.clone().sub(d),h=m.length()||1;m.divideScalar(h);let g=new n().crossVectors(m,a.up).normalize(),_=new n().crossVectors(g,m).normalize();d.addScaledVector(g,p(0)*o).addScaledVector(_,p(1)*o),C.copy(f).addScaledVector(g,Math.tan(p(2)*c)*h).addScaledVector(_,Math.tan(p(3)*c)*h)}else C.copy(f);a.position.copy(d).add(y),B(a.position,C),a.lookAt(C),b=!1},dispose(){x?.dispose()}}}export{g as C,f as S,x as _,N as a,d as b,k as c,s as d,u as f,v as g,y as h,S as i,M as l,p as m,V as n,P as o,c as p,z as r,C as s,I as t,F as u,l as v,h as x,_ as y};
@@ -1,4 +1,4 @@
1
- import{OrbitControls as e}from"./OrbitControls-MlE9XiCg.js";import{Bt as t,En as n,Ft as r,Ht as i,I as a,In as o,It as s,Kt as c,Ln as l,N as u,Pt as d,Qt as f,Rt as p,St as m,T as h,an as g,at as _,bt as v,d as y,f as b,h as x,hn as ee,it as te,m as S,mn as C,nt as w,on as T,p as E,st as D,vt as O,w as ne,x as k,xt as A,yn as re,zt as ie}from"./three.module-CnI50X0U.js";import{r as ae}from"./camera-7sEn13L-.js";import{a as j,i as M,n as N,o as oe}from"./index-3LL5NEIH.js";var P=new f,F=new l,I=new l,L=new c,se={X:new l(1,0,0),Y:new l(0,1,0),Z:new l(0,0,1)},R={type:`change`},z={type:`mouseDown`,mode:null},ce={type:`mouseUp`,mode:null},le={type:`objectChange`},ue=class extends ne{constructor(e,t=null){super(void 0,t);let n=new ve(this);this._root=n;let r=new ye;this._gizmo=r,n.add(r);let i=new be;this._plane=i,n.add(i);let a=this;function o(e,t){let n=t;Object.defineProperty(a,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,i[e]=t,r[e]=t,a.dispatchEvent({type:e+`-changed`,value:t}),a.dispatchEvent(R))}}),a[e]=t,i[e]=t,r[e]=t}o(`camera`,e),o(`object`,void 0),o(`enabled`,!0),o(`axis`,null),o(`mode`,`translate`),o(`translationSnap`,null),o(`rotationSnap`,null),o(`scaleSnap`,null),o(`space`,`world`),o(`size`,1),this.viewport=null,o(`dragging`,!1),o(`showX`,!0),o(`showY`,!0),o(`showZ`,!0),o(`showXY`,!0),o(`showYZ`,!0),o(`showXZ`,!0),o(`showXYZE`,!0),o(`showE`,!0),o(`minX`,-1/0),o(`maxX`,1/0),o(`minY`,-1/0),o(`maxY`,1/0),o(`minZ`,-1/0),o(`maxZ`,1/0);let s=new l,u=new l,d=new c,f=new c,p=new l,m=new c,h=new l,g=new l,_=new l,v=new l;o(`worldPosition`,s),o(`worldPositionStart`,u),o(`worldQuaternion`,d),o(`worldQuaternionStart`,f),o(`cameraPosition`,p),o(`cameraQuaternion`,m),o(`pointStart`,h),o(`pointEnd`,g),o(`rotationAxis`,_),o(`rotationAngle`,0),o(`eye`,v),this._offset=new l,this._startNorm=new l,this._endNorm=new l,this._cameraScale=new l,this._parentPosition=new l,this._parentQuaternion=new c,this._parentQuaternionInv=new c,this._parentScale=new l,this._worldScaleStart=new l,this._worldQuaternionInv=new c,this._worldScale=new l,this._positionStart=new l,this._quaternionStart=new c,this._scaleStart=new l,this._getPointer=de.bind(this),this._onPointerDown=pe.bind(this),this._onPointerHover=fe.bind(this),this._onPointerMove=me.bind(this),this._onPointerUp=he.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointermove`,this._onPointerHover),this.domElement.addEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerHover),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=``}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&P.setFromCamera(e,this.camera);let t=B(this._gizmo.picker[this.mode],P);this.axis=t?t.object.name:null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&P.setFromCamera(e,this.camera);let t=B(this._plane,P,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,z.mode=this.mode,this.dispatchEvent(z)}}pointerMove(e){let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&P.setFromCamera(e,this.camera);let a=B(this._plane,P,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this._offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf(`X`)===-1&&(this._offset.x=0),t.indexOf(`Y`)===-1&&(this._offset.y=0),t.indexOf(`Z`)===-1&&(this._offset.z=0),i===`local`&&t!==`XYZ`?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(L.copy(this._quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),i===`world`&&(r.getWorldPosition(F),t.search(`X`)!==-1&&(F.x=Math.round(F.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(F.y=Math.round(F.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(F.z=Math.round(F.z/this.translationSnap)*this.translationSnap),r.position.copy(r.parent.worldToLocal(F)))),r.position.x=Math.max(this.minX,Math.min(this.maxX,r.position.x)),r.position.y=Math.max(this.minY,Math.min(this.maxY,r.position.y)),r.position.z=Math.max(this.minZ,Math.min(this.maxZ,r.position.z));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),I.set(e,e,e)}else F.copy(this.pointStart),I.copy(this.pointEnd),F.applyQuaternion(this._worldQuaternionInv),I.applyQuaternion(this._worldQuaternionInv),I.divide(F),t.search(`X`)===-1&&(I.x=1),t.search(`Y`)===-1&&(I.y=1),t.search(`Z`)===-1&&(I.z=1);r.scale.copy(this._scaleStart).multiply(I),this.scaleSnap&&(t.search(`X`)!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this._offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(F.setFromMatrixPosition(this.camera.matrixWorld)),n=!1;t===`XYZE`?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(F.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(se[t]),F.copy(se[t]),i===`local`&&F.applyQuaternion(this.worldQuaternion),F.cross(this.eye),F.length()===0?n=!0:this.rotationAngle=this._offset.dot(F.normalize())*e),(t===`E`||n)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(L.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(L.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(R),this.dispatchEvent(le)}}pointerUp(e){(e===null||e.button===0)&&(this.dragging&&this.axis!==null&&(ce.mode=this.mode,this.dispatchEvent(ce)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(R),this.dispatchEvent(le),this.pointStart.copy(this.pointEnd))}getRaycaster(){return P}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}setColors(e,t,n,r){let i=this._gizmo.materialLib;i.xAxis.color.set(e),i.yAxis.color.set(t),i.zAxis.color.set(n),i.active.color.set(r),i.xAxisTransparent.color.set(e),i.yAxisTransparent.color.set(t),i.zAxisTransparent.color.set(n),i.activeTransparent.color.set(r),i.xAxis._color&&i.xAxis._color.set(e),i.yAxis._color&&i.yAxis._color.set(t),i.zAxis._color&&i.zAxis._color.set(n),i.active._color&&i.active._color.set(r),i.xAxisTransparent._color&&i.xAxisTransparent._color.set(e),i.yAxisTransparent._color&&i.yAxisTransparent._color.set(t),i.zAxisTransparent._color&&i.zAxisTransparent._color.set(n),i.activeTransparent._color&&i.activeTransparent._color.set(r)}};function de(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{let t=this.domElement.getBoundingClientRect(),n=this.viewport,r,i,a,o;return n===null?(r=0,i=0,a=t.width,o=t.height):(r=n.x,i=t.height-n.y-n.w,a=n.z,o=n.w),{x:(e.clientX-t.left-r)/a*2-1,y:-(e.clientY-t.top-i)/o*2+1,button:e.button}}}function fe(e){if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this._getPointer(e))}}function pe(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener(`pointermove`,this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function me(e){this.enabled&&this.pointerMove(this._getPointer(e))}function he(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.pointerUp(this._getPointer(e)))}function B(e,t,n){let r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}var V=new u,H=new l(0,1,0),ge=new l(0,0,0),_e=new v,U=new c,W=new c,G=new l,K=new v,q=new l(1,0,0),J=new l(0,1,0),Y=new l(0,0,1),X=new l,Z=new l,Q=new l,ve=class extends d{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){let t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),this.parent&&(K.copy(this.parent.matrixWorld).invert(),K.decompose(this.position,this.quaternion,this.scale)),super.updateMatrixWorld(e)}dispose(){this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}},ye=class extends d{constructor(){super(),this.isTransformControlsGizmo=!0,this.type=`TransformControlsGizmo`;let e=new m({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new te({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;let o=t.clone();o.opacity=.5;let s=e.clone();s.color.setHex(16711680);let c=e.clone();c.color.setHex(65280);let l=e.clone();l.color.setHex(255);let u=e.clone();u.color.setHex(16711680),u.opacity=.5;let f=e.clone();f.color.setHex(65280),f.opacity=.5;let p=e.clone();p.color.setHex(255),p.opacity=.5;let g=e.clone();g.opacity=.25;let _=e.clone();_.color.setHex(16776960),_.opacity=.25;let v=e.clone();v.color.setHex(16776960);let y=e.clone();y.color.setHex(7895160),this.materialLib={xAxis:s,yAxis:c,zAxis:l,active:v,xAxisTransparent:u,yAxisTransparent:f,zAxisTransparent:p,activeTransparent:_};let b=new h(0,.04,.1,12);b.translate(0,.05,0);let S=new E(.08,.08,.08);S.translate(0,.04,0);let C=new x;C.setAttribute(`position`,new a([0,0,0,1,0,0],3));let T=new h(.0075,.0075,.5,3);T.translate(0,.25,0);function D(e,t){let r=new n(e,.0075,3,64,t*Math.PI*2);return r.rotateY(Math.PI/2),r.rotateX(Math.PI/2),r}function O(){let e=new x;return e.setAttribute(`position`,new a([0,0,0,1,1,1],3)),e}let ne={X:[[new A(b,s),[.5,0,0],[0,0,-Math.PI/2]],[new A(b,s),[-.5,0,0],[0,0,Math.PI/2]],[new A(T,s),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new A(b,c),[0,.5,0]],[new A(b,c),[0,-.5,0],[Math.PI,0,0]],[new A(T,c)]],Z:[[new A(b,l),[0,0,.5],[Math.PI/2,0,0]],[new A(b,l),[0,0,-.5],[-Math.PI/2,0,0]],[new A(T,l),null,[Math.PI/2,0,0]]],XYZ:[[new A(new r(.1,0),g),[0,0,0]]],XY:[[new A(new E(.15,.15,.01),p),[.15,.15,0]]],YZ:[[new A(new E(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.15,.15,.01),f),[.15,0,.15],[-Math.PI/2,0,0]]]},k={X:[[new A(new h(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new A(new h(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new A(new h(.2,0,.6,4),i),[0,.3,0]],[new A(new h(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new A(new h(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new A(new h(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new A(new r(.2,0),i)]],XY:[[new A(new E(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new A(new E(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},re={START:[[new A(new r(.01,2),o),null,null,null,`helper`]],END:[[new A(new r(.01,2),o),null,null,null,`helper`]],DELTA:[[new w(O(),o),null,null,null,`helper`]],X:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new w(C,o),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new w(C,o),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},ie={XYZE:[[new A(D(.5,1),y),null,[0,Math.PI/2,0]]],X:[[new A(D(.5,.5),s)]],Y:[[new A(D(.5,.5),c),null,[0,0,-Math.PI/2]]],Z:[[new A(D(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new A(D(.75,1),_),null,[0,Math.PI/2,0]]]},ae={AXIS:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]]},j={XYZE:[[new A(new ee(.25,10,8),i)]],X:[[new A(new n(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new A(new n(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new A(new n(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new A(new n(.75,.1,2,24),i)]]},M={X:[[new A(S,s),[.5,0,0],[0,0,-Math.PI/2]],[new A(T,s),[0,0,0],[0,0,-Math.PI/2]],[new A(S,s),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new A(S,c),[0,.5,0]],[new A(T,c)],[new A(S,c),[0,-.5,0],[0,0,Math.PI]]],Z:[[new A(S,l),[0,0,.5],[Math.PI/2,0,0]],[new A(T,l),[0,0,0],[Math.PI/2,0,0]],[new A(S,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new A(new E(.15,.15,.01),p),[.15,.15,0]]],YZ:[[new A(new E(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.15,.15,.01),f),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new A(new E(.1,.1,.1),g)]]},N={X:[[new A(new h(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new A(new h(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new A(new h(.2,0,.6,4),i),[0,.3,0]],[new A(new h(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new A(new h(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new A(new h(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new A(new E(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new A(new E(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new A(new E(.2,.2,.2),i),[0,0,0]]]},oe={X:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new w(C,o),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new w(C,o),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]};function P(e){let t=new d;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=P(ne)),this.add(this.gizmo.rotate=P(ie)),this.add(this.gizmo.scale=P(M)),this.add(this.picker.translate=P(k)),this.add(this.picker.rotate=P(j)),this.add(this.picker.scale=P(N)),this.add(this.helper.translate=P(re)),this.add(this.helper.rotate=P(ae)),this.add(this.helper.scale=P(oe)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){let t=(this.mode===`scale`?`local`:this.space)===`local`?this.worldQuaternion:W;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){let r=n[e];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);let i;if(i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(i*this.size/4),r.tag===`helper`)r.visible=!1,r.name===`AXIS`?(r.visible=!!this.axis,this.axis===`X`&&(L.setFromEuler(V.set(0,0,0)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Y`&&(L.setFromEuler(V.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(L.setFromEuler(V.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(L.setFromEuler(V.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(_e.lookAt(ge,H,J)),r.quaternion.multiply(L),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),F.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),F.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(F),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));else{if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else this.mode===`rotate`&&(U.copy(t),H.copy(this.eye).applyQuaternion(L.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(_e.lookAt(this.eye,ge,J)),r.name===`X`&&(L.setFromAxisAngle(q,Math.atan2(-H.y,H.z)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)),r.name===`Y`&&(L.setFromAxisAngle(J,Math.atan2(H.x,H.z)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)),r.name===`Z`&&(L.setFromAxisAngle(Y,Math.atan2(H.y,H.x)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)));r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.visible=r.visible&&(r.name.indexOf(`XY`)===-1||this.showXY),r.visible=r.visible&&(r.name.indexOf(`YZ`)===-1||this.showYZ),r.visible=r.visible&&(r.name.indexOf(`XZ`)===-1||this.showXZ),r.visible=r.visible&&(r.name!==`E`||this.showE),r.visible=r.visible&&(r.name!==`XYZE`||this.showXYZE),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e}))&&(r.material.color.copy(this.materialLib.active.color),r.material.opacity=1)}}super.updateMatrixWorld(e)}},be=class extends A{constructor(){super(new t(1e5,1e5,2,2),new m({visible:!1,wireframe:!0,side:2,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type=`TransformControlsPlane`}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(t=`local`),X.copy(q).applyQuaternion(t===`local`?this.worldQuaternion:W),Z.copy(J).applyQuaternion(t===`local`?this.worldQuaternion:W),Q.copy(Y).applyQuaternion(t===`local`?this.worldQuaternion:W),H.copy(Z),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:H.copy(this.eye).cross(X),G.copy(X).cross(H);break;case`Y`:H.copy(this.eye).cross(Z),G.copy(Z).cross(H);break;case`Z`:H.copy(this.eye).cross(Q),G.copy(Q).cross(H);break;case`XY`:G.copy(Q);break;case`YZ`:G.copy(X);break;case`XZ`:H.copy(Q),G.copy(Z);break;case`XYZ`:case`E`:G.set(0,0,0)}break;default:G.set(0,0,0)}G.length()===0?this.quaternion.copy(this.cameraQuaternion):(K.lookAt(F.set(0,0,0),G,H),this.quaternion.setFromRotationMatrix(K)),super.updateMatrixWorld(e)}},xe=`
1
+ import{OrbitControls as e}from"./OrbitControls-MlE9XiCg.js";import{Bt as t,En as n,Ft as r,Ht as i,I as a,In as o,It as s,Kt as c,Ln as l,N as u,Pt as d,Qt as f,Rt as p,St as m,T as h,an as g,at as _,bt as v,d as y,f as b,h as x,hn as ee,it as te,m as S,mn as C,nt as w,on as T,p as E,st as D,vt as O,w as ne,x as k,xt as A,yn as re,zt as ie}from"./three.module-CnI50X0U.js";import{r as ae}from"./camera-Be6lnp3k.js";import{a as j,i as M,n as N,o as oe}from"./index-tSGZFEt5.js";var P=new f,F=new l,I=new l,L=new c,se={X:new l(1,0,0),Y:new l(0,1,0),Z:new l(0,0,1)},R={type:`change`},z={type:`mouseDown`,mode:null},ce={type:`mouseUp`,mode:null},le={type:`objectChange`},ue=class extends ne{constructor(e,t=null){super(void 0,t);let n=new ve(this);this._root=n;let r=new ye;this._gizmo=r,n.add(r);let i=new be;this._plane=i,n.add(i);let a=this;function o(e,t){let n=t;Object.defineProperty(a,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,i[e]=t,r[e]=t,a.dispatchEvent({type:e+`-changed`,value:t}),a.dispatchEvent(R))}}),a[e]=t,i[e]=t,r[e]=t}o(`camera`,e),o(`object`,void 0),o(`enabled`,!0),o(`axis`,null),o(`mode`,`translate`),o(`translationSnap`,null),o(`rotationSnap`,null),o(`scaleSnap`,null),o(`space`,`world`),o(`size`,1),this.viewport=null,o(`dragging`,!1),o(`showX`,!0),o(`showY`,!0),o(`showZ`,!0),o(`showXY`,!0),o(`showYZ`,!0),o(`showXZ`,!0),o(`showXYZE`,!0),o(`showE`,!0),o(`minX`,-1/0),o(`maxX`,1/0),o(`minY`,-1/0),o(`maxY`,1/0),o(`minZ`,-1/0),o(`maxZ`,1/0);let s=new l,u=new l,d=new c,f=new c,p=new l,m=new c,h=new l,g=new l,_=new l,v=new l;o(`worldPosition`,s),o(`worldPositionStart`,u),o(`worldQuaternion`,d),o(`worldQuaternionStart`,f),o(`cameraPosition`,p),o(`cameraQuaternion`,m),o(`pointStart`,h),o(`pointEnd`,g),o(`rotationAxis`,_),o(`rotationAngle`,0),o(`eye`,v),this._offset=new l,this._startNorm=new l,this._endNorm=new l,this._cameraScale=new l,this._parentPosition=new l,this._parentQuaternion=new c,this._parentQuaternionInv=new c,this._parentScale=new l,this._worldScaleStart=new l,this._worldQuaternionInv=new c,this._worldScale=new l,this._positionStart=new l,this._quaternionStart=new c,this._scaleStart=new l,this._getPointer=de.bind(this),this._onPointerDown=pe.bind(this),this._onPointerHover=fe.bind(this),this._onPointerMove=me.bind(this),this._onPointerUp=he.bind(this),t!==null&&this.connect(t)}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointermove`,this._onPointerHover),this.domElement.addEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerHover),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.style.touchAction=``}getHelper(){return this._root}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&P.setFromCamera(e,this.camera);let t=B(this._gizmo.picker[this.mode],P);this.axis=t?t.object.name:null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&P.setFromCamera(e,this.camera);let t=B(this._plane,P,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,z.mode=this.mode,this.dispatchEvent(z)}}pointerMove(e){let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&P.setFromCamera(e,this.camera);let a=B(this._plane,P,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this._offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf(`X`)===-1&&(this._offset.x=0),t.indexOf(`Y`)===-1&&(this._offset.y=0),t.indexOf(`Z`)===-1&&(this._offset.z=0),i===`local`&&t!==`XYZ`?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(L.copy(this._quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),i===`world`&&(r.getWorldPosition(F),t.search(`X`)!==-1&&(F.x=Math.round(F.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(F.y=Math.round(F.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(F.z=Math.round(F.z/this.translationSnap)*this.translationSnap),r.position.copy(r.parent.worldToLocal(F)))),r.position.x=Math.max(this.minX,Math.min(this.maxX,r.position.x)),r.position.y=Math.max(this.minY,Math.min(this.maxY,r.position.y)),r.position.z=Math.max(this.minZ,Math.min(this.maxZ,r.position.z));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),I.set(e,e,e)}else F.copy(this.pointStart),I.copy(this.pointEnd),F.applyQuaternion(this._worldQuaternionInv),I.applyQuaternion(this._worldQuaternionInv),I.divide(F),t.search(`X`)===-1&&(I.x=1),t.search(`Y`)===-1&&(I.y=1),t.search(`Z`)===-1&&(I.z=1);r.scale.copy(this._scaleStart).multiply(I),this.scaleSnap&&(t.search(`X`)!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this._offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(F.setFromMatrixPosition(this.camera.matrixWorld)),n=!1;t===`XYZE`?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(F.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(se[t]),F.copy(se[t]),i===`local`&&F.applyQuaternion(this.worldQuaternion),F.cross(this.eye),F.length()===0?n=!0:this.rotationAngle=this._offset.dot(F.normalize())*e),(t===`E`||n)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(L.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(L.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(R),this.dispatchEvent(le)}}pointerUp(e){(e===null||e.button===0)&&(this.dragging&&this.axis!==null&&(ce.mode=this.mode,this.dispatchEvent(ce)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(e){return this.object=e,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(R),this.dispatchEvent(le),this.pointStart.copy(this.pointEnd))}getRaycaster(){return P}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}setColors(e,t,n,r){let i=this._gizmo.materialLib;i.xAxis.color.set(e),i.yAxis.color.set(t),i.zAxis.color.set(n),i.active.color.set(r),i.xAxisTransparent.color.set(e),i.yAxisTransparent.color.set(t),i.zAxisTransparent.color.set(n),i.activeTransparent.color.set(r),i.xAxis._color&&i.xAxis._color.set(e),i.yAxis._color&&i.yAxis._color.set(t),i.zAxis._color&&i.zAxis._color.set(n),i.active._color&&i.active._color.set(r),i.xAxisTransparent._color&&i.xAxisTransparent._color.set(e),i.yAxisTransparent._color&&i.yAxisTransparent._color.set(t),i.zAxisTransparent._color&&i.zAxisTransparent._color.set(n),i.activeTransparent._color&&i.activeTransparent._color.set(r)}};function de(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{let t=this.domElement.getBoundingClientRect(),n=this.viewport,r,i,a,o;return n===null?(r=0,i=0,a=t.width,o=t.height):(r=n.x,i=t.height-n.y-n.w,a=n.z,o=n.w),{x:(e.clientX-t.left-r)/a*2-1,y:-(e.clientY-t.top-i)/o*2+1,button:e.button}}}function fe(e){if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this._getPointer(e))}}function pe(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener(`pointermove`,this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function me(e){this.enabled&&this.pointerMove(this._getPointer(e))}function he(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.pointerUp(this._getPointer(e)))}function B(e,t,n){let r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}var V=new u,H=new l(0,1,0),ge=new l(0,0,0),_e=new v,U=new c,W=new c,G=new l,K=new v,q=new l(1,0,0),J=new l(0,1,0),Y=new l(0,0,1),X=new l,Z=new l,Q=new l,ve=class extends d{constructor(e){super(),this.isTransformControlsRoot=!0,this.controls=e,this.visible=!1}updateMatrixWorld(e){let t=this.controls;t.object!==void 0&&(t.object.updateMatrixWorld(),t.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):t.object.parent.matrixWorld.decompose(t._parentPosition,t._parentQuaternion,t._parentScale),t.object.matrixWorld.decompose(t.worldPosition,t.worldQuaternion,t._worldScale),t._parentQuaternionInv.copy(t._parentQuaternion).invert(),t._worldQuaternionInv.copy(t.worldQuaternion).invert()),t.camera.updateMatrixWorld(),t.camera.matrixWorld.decompose(t.cameraPosition,t.cameraQuaternion,t._cameraScale),t.camera.isOrthographicCamera?t.camera.getWorldDirection(t.eye).negate():t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(),this.parent&&(K.copy(this.parent.matrixWorld).invert(),K.decompose(this.position,this.quaternion,this.scale)),super.updateMatrixWorld(e)}dispose(){this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}},ye=class extends d{constructor(){super(),this.isTransformControlsGizmo=!0,this.type=`TransformControlsGizmo`;let e=new m({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new te({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=e.clone();i.opacity=.15;let o=t.clone();o.opacity=.5;let s=e.clone();s.color.setHex(16711680);let c=e.clone();c.color.setHex(65280);let l=e.clone();l.color.setHex(255);let u=e.clone();u.color.setHex(16711680),u.opacity=.5;let f=e.clone();f.color.setHex(65280),f.opacity=.5;let p=e.clone();p.color.setHex(255),p.opacity=.5;let g=e.clone();g.opacity=.25;let _=e.clone();_.color.setHex(16776960),_.opacity=.25;let v=e.clone();v.color.setHex(16776960);let y=e.clone();y.color.setHex(7895160),this.materialLib={xAxis:s,yAxis:c,zAxis:l,active:v,xAxisTransparent:u,yAxisTransparent:f,zAxisTransparent:p,activeTransparent:_};let b=new h(0,.04,.1,12);b.translate(0,.05,0);let S=new E(.08,.08,.08);S.translate(0,.04,0);let C=new x;C.setAttribute(`position`,new a([0,0,0,1,0,0],3));let T=new h(.0075,.0075,.5,3);T.translate(0,.25,0);function D(e,t){let r=new n(e,.0075,3,64,t*Math.PI*2);return r.rotateY(Math.PI/2),r.rotateX(Math.PI/2),r}function O(){let e=new x;return e.setAttribute(`position`,new a([0,0,0,1,1,1],3)),e}let ne={X:[[new A(b,s),[.5,0,0],[0,0,-Math.PI/2]],[new A(b,s),[-.5,0,0],[0,0,Math.PI/2]],[new A(T,s),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new A(b,c),[0,.5,0]],[new A(b,c),[0,-.5,0],[Math.PI,0,0]],[new A(T,c)]],Z:[[new A(b,l),[0,0,.5],[Math.PI/2,0,0]],[new A(b,l),[0,0,-.5],[-Math.PI/2,0,0]],[new A(T,l),null,[Math.PI/2,0,0]]],XYZ:[[new A(new r(.1,0),g),[0,0,0]]],XY:[[new A(new E(.15,.15,.01),p),[.15,.15,0]]],YZ:[[new A(new E(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.15,.15,.01),f),[.15,0,.15],[-Math.PI/2,0,0]]]},k={X:[[new A(new h(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new A(new h(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new A(new h(.2,0,.6,4),i),[0,.3,0]],[new A(new h(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new A(new h(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new A(new h(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new A(new r(.2,0),i)]],XY:[[new A(new E(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new A(new E(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},re={START:[[new A(new r(.01,2),o),null,null,null,`helper`]],END:[[new A(new r(.01,2),o),null,null,null,`helper`]],DELTA:[[new w(O(),o),null,null,null,`helper`]],X:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new w(C,o),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new w(C,o),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},ie={XYZE:[[new A(D(.5,1),y),null,[0,Math.PI/2,0]]],X:[[new A(D(.5,.5),s)]],Y:[[new A(D(.5,.5),c),null,[0,0,-Math.PI/2]]],Z:[[new A(D(.5,.5),l),null,[0,Math.PI/2,0]]],E:[[new A(D(.75,1),_),null,[0,Math.PI/2,0]]]},ae={AXIS:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]]},j={XYZE:[[new A(new ee(.25,10,8),i)]],X:[[new A(new n(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new A(new n(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new A(new n(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new A(new n(.75,.1,2,24),i)]]},M={X:[[new A(S,s),[.5,0,0],[0,0,-Math.PI/2]],[new A(T,s),[0,0,0],[0,0,-Math.PI/2]],[new A(S,s),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new A(S,c),[0,.5,0]],[new A(T,c)],[new A(S,c),[0,-.5,0],[0,0,Math.PI]]],Z:[[new A(S,l),[0,0,.5],[Math.PI/2,0,0]],[new A(T,l),[0,0,0],[Math.PI/2,0,0]],[new A(S,l),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new A(new E(.15,.15,.01),p),[.15,.15,0]]],YZ:[[new A(new E(.15,.15,.01),u),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.15,.15,.01),f),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new A(new E(.1,.1,.1),g)]]},N={X:[[new A(new h(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new A(new h(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new A(new h(.2,0,.6,4),i),[0,.3,0]],[new A(new h(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new A(new h(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new A(new h(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new A(new E(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new A(new E(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new A(new E(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new A(new E(.2,.2,.2),i),[0,0,0]]]},oe={X:[[new w(C,o),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new w(C,o),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new w(C,o),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]};function P(e){let t=new d;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=P(ne)),this.add(this.gizmo.rotate=P(ie)),this.add(this.gizmo.scale=P(M)),this.add(this.picker.translate=P(k)),this.add(this.picker.rotate=P(j)),this.add(this.picker.scale=P(N)),this.add(this.helper.translate=P(re)),this.add(this.helper.rotate=P(ae)),this.add(this.helper.scale=P(oe)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){let t=(this.mode===`scale`?`local`:this.space)===`local`?this.worldQuaternion:W;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){let r=n[e];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);let i;if(i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(i*this.size/4),r.tag===`helper`)r.visible=!1,r.name===`AXIS`?(r.visible=!!this.axis,this.axis===`X`&&(L.setFromEuler(V.set(0,0,0)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Y`&&(L.setFromEuler(V.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(L.setFromEuler(V.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(L),Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(L.setFromEuler(V.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(_e.lookAt(ge,H,J)),r.quaternion.multiply(L),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),F.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),F.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(F),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));else{if(r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`){let e=.99,n=.2;r.name===`X`&&Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Y`&&Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`Z`&&Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(H.copy(Y).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(H.copy(q).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(H.copy(J).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else this.mode===`rotate`&&(U.copy(t),H.copy(this.eye).applyQuaternion(L.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(_e.lookAt(this.eye,ge,J)),r.name===`X`&&(L.setFromAxisAngle(q,Math.atan2(-H.y,H.z)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)),r.name===`Y`&&(L.setFromAxisAngle(J,Math.atan2(H.x,H.z)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)),r.name===`Z`&&(L.setFromAxisAngle(Y,Math.atan2(H.y,H.x)),L.multiplyQuaternions(U,L),r.quaternion.copy(L)));r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.visible=r.visible&&(r.name.indexOf(`XY`)===-1||this.showXY),r.visible=r.visible&&(r.name.indexOf(`YZ`)===-1||this.showYZ),r.visible=r.visible&&(r.name.indexOf(`XZ`)===-1||this.showXZ),r.visible=r.visible&&(r.name!==`E`||this.showE),r.visible=r.visible&&(r.name!==`XYZE`||this.showXYZE),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e}))&&(r.material.color.copy(this.materialLib.active.color),r.material.opacity=1)}}super.updateMatrixWorld(e)}},be=class extends A{constructor(){super(new t(1e5,1e5,2,2),new m({visible:!1,wireframe:!0,side:2,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type=`TransformControlsPlane`}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(t=`local`),X.copy(q).applyQuaternion(t===`local`?this.worldQuaternion:W),Z.copy(J).applyQuaternion(t===`local`?this.worldQuaternion:W),Q.copy(Y).applyQuaternion(t===`local`?this.worldQuaternion:W),H.copy(Z),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:H.copy(this.eye).cross(X),G.copy(X).cross(H);break;case`Y`:H.copy(this.eye).cross(Z),G.copy(Z).cross(H);break;case`Z`:H.copy(this.eye).cross(Q),G.copy(Q).cross(H);break;case`XY`:G.copy(Q);break;case`YZ`:G.copy(X);break;case`XZ`:H.copy(Q),G.copy(Z);break;case`XYZ`:case`E`:G.set(0,0,0)}break;default:G.set(0,0,0)}G.length()===0?this.quaternion.copy(this.cameraQuaternion):(K.lookAt(F.set(0,0,0),G,H),this.quaternion.setFromRotationMatrix(K)),super.updateMatrixWorld(e)}},xe=`
2
2
  varying vec3 vWorld;
3
3
  void main() {
4
4
  vec4 w = modelMatrix * vec4(position, 1.0);