wizards 0.7.4 → 0.7.6

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 (516) hide show
  1. package/bin/wizards.mjs +95 -26
  2. package/{apps/web/dist/install.sh → install.sh} +23 -5
  3. package/package.json +2 -58
  4. package/apps/runtime/dist/agents/architect.js +0 -444
  5. package/apps/runtime/dist/agents/studio-assistant.js +0 -883
  6. package/apps/runtime/dist/agents/subscription.js +0 -207
  7. package/apps/runtime/dist/agents/thought.js +0 -21
  8. package/apps/runtime/dist/agents/website.js +0 -480
  9. package/apps/runtime/dist/app.js +0 -359
  10. package/apps/runtime/dist/apple/wizards-apple +0 -0
  11. package/apps/runtime/dist/assistant/browser.js +0 -26
  12. package/apps/runtime/dist/assistant/docs.js +0 -158
  13. package/apps/runtime/dist/assistant/knows.js +0 -353
  14. package/apps/runtime/dist/assistant/primer.js +0 -26
  15. package/apps/runtime/dist/assistant/runs.js +0 -24
  16. package/apps/runtime/dist/auth/account.js +0 -175
  17. package/apps/runtime/dist/auth/device.js +0 -112
  18. package/apps/runtime/dist/auth/index.js +0 -358
  19. package/apps/runtime/dist/auth/keys.js +0 -55
  20. package/apps/runtime/dist/auth/local-ticket.js +0 -26
  21. package/apps/runtime/dist/authoring/example.js +0 -74
  22. package/apps/runtime/dist/authoring/guide.js +0 -433
  23. package/apps/runtime/dist/authoring/ops.js +0 -117
  24. package/apps/runtime/dist/browser/fast/action-space.js +0 -160
  25. package/apps/runtime/dist/browser/fast/classifier.js +0 -91
  26. package/apps/runtime/dist/browser/fast/decide.js +0 -171
  27. package/apps/runtime/dist/browser/fast/driver.js +0 -141
  28. package/apps/runtime/dist/browser/fast/instructions.js +0 -33
  29. package/apps/runtime/dist/browser/fast/run.js +0 -249
  30. package/apps/runtime/dist/browser/fast/span-picker.js +0 -153
  31. package/apps/runtime/dist/browser/fast/text-helper.js +0 -178
  32. package/apps/runtime/dist/browser/snapshot.js +0 -335
  33. package/apps/runtime/dist/cli/account.js +0 -385
  34. package/apps/runtime/dist/cli/autostart.js +0 -182
  35. package/apps/runtime/dist/cli/autoupdate.js +0 -221
  36. package/apps/runtime/dist/cli/clients.js +0 -44
  37. package/apps/runtime/dist/cli/connect.js +0 -540
  38. package/apps/runtime/dist/cli/environment.js +0 -93
  39. package/apps/runtime/dist/cli/exec.js +0 -45
  40. package/apps/runtime/dist/cli/features.js +0 -50
  41. package/apps/runtime/dist/cli/home.js +0 -88
  42. package/apps/runtime/dist/cli/install-env.js +0 -33
  43. package/apps/runtime/dist/cli/machine.js +0 -107
  44. package/apps/runtime/dist/cli/main.js +0 -222
  45. package/apps/runtime/dist/cli/mcp.js +0 -136
  46. package/apps/runtime/dist/cli/menu.js +0 -202
  47. package/apps/runtime/dist/cli/processes.js +0 -72
  48. package/apps/runtime/dist/cli/report.js +0 -66
  49. package/apps/runtime/dist/cli/setup.js +0 -335
  50. package/apps/runtime/dist/cli/start.js +0 -276
  51. package/apps/runtime/dist/cli/status.js +0 -203
  52. package/apps/runtime/dist/cli/ui.js +0 -59
  53. package/apps/runtime/dist/cli/uninstall-main.js +0 -20
  54. package/apps/runtime/dist/cli/uninstall.js +0 -231
  55. package/apps/runtime/dist/cli/update.js +0 -86
  56. package/apps/runtime/dist/cli/validate.js +0 -75
  57. package/apps/runtime/dist/cli/versions.js +0 -106
  58. package/apps/runtime/dist/connectors/builtin.js +0 -86
  59. package/apps/runtime/dist/connectors/external.js +0 -409
  60. package/apps/runtime/dist/connectors/gmail.js +0 -107
  61. package/apps/runtime/dist/connectors/imap.js +0 -261
  62. package/apps/runtime/dist/connectors/index.js +0 -325
  63. package/apps/runtime/dist/connectors/mail.js +0 -72
  64. package/apps/runtime/dist/connectors/outlook.js +0 -90
  65. package/apps/runtime/dist/connectors/plugin-connections.js +0 -343
  66. package/apps/runtime/dist/connectors/via-account.js +0 -65
  67. package/apps/runtime/dist/credits/credits.js +0 -100
  68. package/apps/runtime/dist/credits/estimate.js +0 -152
  69. package/apps/runtime/dist/db/adopt.js +0 -149
  70. package/apps/runtime/dist/db/client.js +0 -173
  71. package/apps/runtime/dist/db/control-schema.js +0 -133
  72. package/apps/runtime/dist/db/migrations/control/0000_last_absorbing_man.sql +0 -47
  73. package/apps/runtime/dist/db/migrations/control/0001_gorgeous_nicolaos.sql +0 -41
  74. package/apps/runtime/dist/db/migrations/control/0002_secret_penance.sql +0 -1
  75. package/apps/runtime/dist/db/migrations/control/0003_nasty_mordo.sql +0 -3
  76. package/apps/runtime/dist/db/migrations/control/0004_breezy_eddie_brock.sql +0 -6
  77. package/apps/runtime/dist/db/migrations/control/0005_chilly_oracle.sql +0 -1
  78. package/apps/runtime/dist/db/migrations/control/0006_sleepy_mojo.sql +0 -1
  79. package/apps/runtime/dist/db/migrations/control/0007_common_the_hand.sql +0 -15
  80. package/apps/runtime/dist/db/migrations/control/0008_runner.sql +0 -8
  81. package/apps/runtime/dist/db/migrations/control/0009_plugin_claim.sql +0 -9
  82. package/apps/runtime/dist/db/migrations/control/0010_tan_snowbird.sql +0 -6
  83. package/apps/runtime/dist/db/migrations/control/meta/0000_snapshot.json +0 -311
  84. package/apps/runtime/dist/db/migrations/control/meta/0001_snapshot.json +0 -599
  85. package/apps/runtime/dist/db/migrations/control/meta/0002_snapshot.json +0 -607
  86. package/apps/runtime/dist/db/migrations/control/meta/0003_snapshot.json +0 -311
  87. package/apps/runtime/dist/db/migrations/control/meta/0004_snapshot.json +0 -350
  88. package/apps/runtime/dist/db/migrations/control/meta/0005_snapshot.json +0 -358
  89. package/apps/runtime/dist/db/migrations/control/meta/0006_snapshot.json +0 -365
  90. package/apps/runtime/dist/db/migrations/control/meta/0007_snapshot.json +0 -460
  91. package/apps/runtime/dist/db/migrations/control/meta/0008_snapshot.json +0 -505
  92. package/apps/runtime/dist/db/migrations/control/meta/0009_snapshot.json +0 -561
  93. package/apps/runtime/dist/db/migrations/control/meta/0010_snapshot.json +0 -600
  94. package/apps/runtime/dist/db/migrations/control/meta/_journal.json +0 -83
  95. package/apps/runtime/dist/db/migrations/tenant/0000_eminent_freak.sql +0 -188
  96. package/apps/runtime/dist/db/migrations/tenant/0001_salty_master_chief.sql +0 -1
  97. package/apps/runtime/dist/db/migrations/tenant/0002_cloudy_firebird.sql +0 -1
  98. package/apps/runtime/dist/db/migrations/tenant/0003_brown_warbound.sql +0 -52
  99. package/apps/runtime/dist/db/migrations/tenant/0004_romantic_nocturne.sql +0 -6
  100. package/apps/runtime/dist/db/migrations/tenant/0005_reflective_forgotten_one.sql +0 -2
  101. package/apps/runtime/dist/db/migrations/tenant/0006_hard_war_machine.sql +0 -30
  102. package/apps/runtime/dist/db/migrations/tenant/0007_space_data.sql +0 -43
  103. package/apps/runtime/dist/db/migrations/tenant/0008_run_event_note.sql +0 -1
  104. package/apps/runtime/dist/db/migrations/tenant/0009_knowledge.sql +0 -104
  105. package/apps/runtime/dist/db/migrations/tenant/0010_plugin_connection.sql +0 -15
  106. package/apps/runtime/dist/db/migrations/tenant/0011_runners.sql +0 -2
  107. package/apps/runtime/dist/db/migrations/tenant/0012_assistant_chat.sql +0 -40
  108. package/apps/runtime/dist/db/migrations/tenant/0013_run_origin.sql +0 -1
  109. package/apps/runtime/dist/db/migrations/tenant/0014_run_answer.sql +0 -2
  110. package/apps/runtime/dist/db/migrations/tenant/0015_device_calls.sql +0 -13
  111. package/apps/runtime/dist/db/migrations/tenant/0016_even_trish_tilby.sql +0 -12
  112. package/apps/runtime/dist/db/migrations/tenant/meta/0000_snapshot.json +0 -1323
  113. package/apps/runtime/dist/db/migrations/tenant/meta/0001_snapshot.json +0 -1330
  114. package/apps/runtime/dist/db/migrations/tenant/meta/0002_snapshot.json +0 -1337
  115. package/apps/runtime/dist/db/migrations/tenant/meta/0003_snapshot.json +0 -1605
  116. package/apps/runtime/dist/db/migrations/tenant/meta/0004_snapshot.json +0 -1645
  117. package/apps/runtime/dist/db/migrations/tenant/meta/0005_snapshot.json +0 -1659
  118. package/apps/runtime/dist/db/migrations/tenant/meta/0006_snapshot.json +0 -1696
  119. package/apps/runtime/dist/db/migrations/tenant/meta/0007_snapshot.json +0 -2012
  120. package/apps/runtime/dist/db/migrations/tenant/meta/0008_snapshot.json +0 -2019
  121. package/apps/runtime/dist/db/migrations/tenant/meta/0009_snapshot.json +0 -2837
  122. package/apps/runtime/dist/db/migrations/tenant/meta/0010_snapshot.json +0 -2942
  123. package/apps/runtime/dist/db/migrations/tenant/meta/0011_snapshot.json +0 -2956
  124. package/apps/runtime/dist/db/migrations/tenant/meta/0012_snapshot.json +0 -3132
  125. package/apps/runtime/dist/db/migrations/tenant/meta/0013_snapshot.json +0 -3139
  126. package/apps/runtime/dist/db/migrations/tenant/meta/0014_snapshot.json +0 -3154
  127. package/apps/runtime/dist/db/migrations/tenant/meta/0015_snapshot.json +0 -3243
  128. package/apps/runtime/dist/db/migrations/tenant/meta/0016_snapshot.json +0 -3326
  129. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +0 -125
  130. package/apps/runtime/dist/db/schema.js +0 -602
  131. package/apps/runtime/dist/debug.js +0 -196
  132. package/apps/runtime/dist/docs/dev/index.md +0 -41
  133. package/apps/runtime/dist/docs/dev/meta.json +0 -7
  134. package/apps/runtime/dist/docs/dev/plugins/connections.md +0 -74
  135. package/apps/runtime/dist/docs/dev/plugins/events.md +0 -89
  136. package/apps/runtime/dist/docs/dev/plugins/examples.md +0 -101
  137. package/apps/runtime/dist/docs/dev/plugins/index.md +0 -78
  138. package/apps/runtime/dist/docs/dev/plugins/layout.md +0 -90
  139. package/apps/runtime/dist/docs/dev/plugins/meta.json +0 -28
  140. package/apps/runtime/dist/docs/dev/plugins/quick-start.md +0 -94
  141. package/apps/runtime/dist/docs/dev/plugins/reference.md +0 -348
  142. package/apps/runtime/dist/docs/dev/plugins/reloading.md +0 -76
  143. package/apps/runtime/dist/docs/dev/plugins/routes.md +0 -185
  144. package/apps/runtime/dist/docs/dev/plugins/runners.md +0 -230
  145. package/apps/runtime/dist/docs/dev/plugins/server.md +0 -281
  146. package/apps/runtime/dist/docs/dev/plugins/shipping.md +0 -79
  147. package/apps/runtime/dist/docs/dev/plugins/space.md +0 -297
  148. package/apps/runtime/dist/docs/dev/plugins/starters.md +0 -70
  149. package/apps/runtime/dist/docs/dev/plugins/studio.md +0 -363
  150. package/apps/runtime/dist/docs/dev/plugins/styling.md +0 -129
  151. package/apps/runtime/dist/docs/dev/plugins/tables.md +0 -104
  152. package/apps/runtime/dist/docs/dev/plugins/tools.md +0 -139
  153. package/apps/runtime/dist/docs/dev/wizard-format.md +0 -121
  154. package/apps/runtime/dist/docs/meta.json +0 -3
  155. package/apps/runtime/dist/docs/user/ai-apps.md +0 -112
  156. package/apps/runtime/dist/docs/user/assistant.md +0 -77
  157. package/apps/runtime/dist/docs/user/build-a-wizard.md +0 -116
  158. package/apps/runtime/dist/docs/user/command-line.md +0 -83
  159. package/apps/runtime/dist/docs/user/connectors.md +0 -90
  160. package/apps/runtime/dist/docs/user/create-account.md +0 -52
  161. package/apps/runtime/dist/docs/user/data.md +0 -66
  162. package/apps/runtime/dist/docs/user/first-start.md +0 -60
  163. package/apps/runtime/dist/docs/user/index.md +0 -49
  164. package/apps/runtime/dist/docs/user/install.md +0 -121
  165. package/apps/runtime/dist/docs/user/local-only.md +0 -42
  166. package/apps/runtime/dist/docs/user/meta.json +0 -32
  167. package/apps/runtime/dist/docs/user/models.md +0 -156
  168. package/apps/runtime/dist/docs/user/plugins.md +0 -71
  169. package/apps/runtime/dist/docs/user/run.md +0 -98
  170. package/apps/runtime/dist/docs/user/server.md +0 -52
  171. package/apps/runtime/dist/docs/user/space.md +0 -126
  172. package/apps/runtime/dist/docs/user/steps.md +0 -220
  173. package/apps/runtime/dist/docs/user/test-and-share.md +0 -224
  174. package/apps/runtime/dist/docs/user/troubleshooting.md +0 -67
  175. package/apps/runtime/dist/docs/user/wordpress.md +0 -121
  176. package/apps/runtime/dist/documents/parse.js +0 -246
  177. package/apps/runtime/dist/engenty/connections-external/build-connector.js +0 -193
  178. package/apps/runtime/dist/engenty/connections-external/errors.js +0 -11
  179. package/apps/runtime/dist/engenty/connections-external/import-service.js +0 -270
  180. package/apps/runtime/dist/engenty/connections-external/importer/classify.js +0 -34
  181. package/apps/runtime/dist/engenty/connections-external/importer/map-auth.js +0 -185
  182. package/apps/runtime/dist/engenty/connections-external/importer/normalize-mcp.js +0 -63
  183. package/apps/runtime/dist/engenty/connections-external/importer/normalize-openapi.js +0 -130
  184. package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +0 -143
  185. package/apps/runtime/dist/engenty/connections-external/invoke/mcp-client.js +0 -143
  186. package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +0 -119
  187. package/apps/runtime/dist/engenty/connections-external/oauth-dcr.js +0 -88
  188. package/apps/runtime/dist/engenty/connections-external/registry-client.js +0 -336
  189. package/apps/runtime/dist/engenty/connections-external/registry-source.js +0 -82
  190. package/apps/runtime/dist/engenty/connections-external/types.js +0 -7
  191. package/apps/runtime/dist/engenty/connections-github/connector.js +0 -209
  192. package/apps/runtime/dist/engenty/connections-google/connectors/calendar.js +0 -381
  193. package/apps/runtime/dist/engenty/connections-google/connectors/contacts.js +0 -94
  194. package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +0 -290
  195. package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +0 -567
  196. package/apps/runtime/dist/engenty/connections-google/definitions.js +0 -11
  197. package/apps/runtime/dist/engenty/connections-google/shared.js +0 -73
  198. package/apps/runtime/dist/engenty/connections-hubspot/connector.js +0 -140
  199. package/apps/runtime/dist/engenty/connections-microsoft/action.js +0 -17
  200. package/apps/runtime/dist/engenty/connections-microsoft/graph.js +0 -114
  201. package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +0 -286
  202. package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +0 -492
  203. package/apps/runtime/dist/engenty/connections-s3/s3.js +0 -328
  204. package/apps/runtime/dist/engenty/connections-sdk/files-capability.js +0 -86
  205. package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +0 -150
  206. package/apps/runtime/dist/engenty/connections-sdk/registry.js +0 -89
  207. package/apps/runtime/dist/engenty/connections-sdk/storage-capability.js +0 -84
  208. package/apps/runtime/dist/engenty/connections-sdk/types.js +0 -30
  209. package/apps/runtime/dist/engenty/connections-slack/connector.js +0 -360
  210. package/apps/runtime/dist/engenty/csv-import/csv-matrix.js +0 -178
  211. package/apps/runtime/dist/engenty/csv-import/import-sources.js +0 -87
  212. package/apps/runtime/dist/engenty/csv-import/parse-csv.js +0 -129
  213. package/apps/runtime/dist/engenty/csv-import/serialize-csv.js +0 -20
  214. package/apps/runtime/dist/engenty/csv-import/types.js +0 -1
  215. package/apps/runtime/dist/engenty/csv-import/xlsx-workbook.js +0 -159
  216. package/apps/runtime/dist/engenty/doc-converter/interface.js +0 -9
  217. package/apps/runtime/dist/engenty/doc-converter/page-break.js +0 -92
  218. package/apps/runtime/dist/engenty/doc-converter/providers/local/index.js +0 -72
  219. package/apps/runtime/dist/engenty/document-scanner/schemas/classifier.js +0 -30
  220. package/apps/runtime/dist/engenty/document-scanner/schemas/index.js +0 -4
  221. package/apps/runtime/dist/engenty/document-scanner/schemas/invoice.js +0 -73
  222. package/apps/runtime/dist/engenty/document-scanner/schemas/receipt.js +0 -63
  223. package/apps/runtime/dist/engenty/document-scanner/schemas/shared.js +0 -40
  224. package/apps/runtime/dist/engenty/search-index/chunks.js +0 -164
  225. package/apps/runtime/dist/engenty/search-index/contracts.js +0 -9
  226. package/apps/runtime/dist/engenty/shims/connections-sdk.js +0 -39
  227. package/apps/runtime/dist/engenty/shims/plugin-sdk.js +0 -1
  228. package/apps/runtime/dist/engenty/shims/web-ingest.js +0 -19
  229. package/apps/runtime/dist/engenty/web-ingest/ssrf.js +0 -277
  230. package/apps/runtime/dist/engine/asks.js +0 -82
  231. package/apps/runtime/dist/engine/decide.js +0 -82
  232. package/apps/runtime/dist/engine/device.js +0 -194
  233. package/apps/runtime/dist/engine/events.js +0 -128
  234. package/apps/runtime/dist/engine/input.js +0 -208
  235. package/apps/runtime/dist/engine/owner.js +0 -32
  236. package/apps/runtime/dist/engine/prepare.js +0 -90
  237. package/apps/runtime/dist/engine/push.js +0 -58
  238. package/apps/runtime/dist/engine/requirements.js +0 -355
  239. package/apps/runtime/dist/engine/resources.js +0 -198
  240. package/apps/runtime/dist/engine/runner.js +0 -970
  241. package/apps/runtime/dist/engine/steps.js +0 -1000
  242. package/apps/runtime/dist/engine/surface.js +0 -91
  243. package/apps/runtime/dist/engine/template.js +0 -240
  244. package/apps/runtime/dist/engine/types.js +0 -4
  245. package/apps/runtime/dist/env.js +0 -295
  246. package/apps/runtime/dist/features.js +0 -123
  247. package/apps/runtime/dist/files/blobs.js +0 -22
  248. package/apps/runtime/dist/files/objects.js +0 -86
  249. package/apps/runtime/dist/files/storage.js +0 -120
  250. package/apps/runtime/dist/files/web-images.js +0 -101
  251. package/apps/runtime/dist/film/project.js +0 -257
  252. package/apps/runtime/dist/film/skills.js +0 -91
  253. package/apps/runtime/dist/film/sounds.js +0 -122
  254. package/apps/runtime/dist/film/step.js +0 -289
  255. package/apps/runtime/dist/film/tools.js +0 -99
  256. package/apps/runtime/dist/geocode.js +0 -58
  257. package/apps/runtime/dist/harness/antigravity.js +0 -129
  258. package/apps/runtime/dist/harness/apple.js +0 -270
  259. package/apps/runtime/dist/harness/claude.js +0 -147
  260. package/apps/runtime/dist/harness/codex.js +0 -229
  261. package/apps/runtime/dist/harness/cursor.js +0 -93
  262. package/apps/runtime/dist/harness/env.js +0 -124
  263. package/apps/runtime/dist/harness/index.js +0 -95
  264. package/apps/runtime/dist/harness/model.js +0 -279
  265. package/apps/runtime/dist/harness/prompt.js +0 -121
  266. package/apps/runtime/dist/harness/terminal.js +0 -194
  267. package/apps/runtime/dist/harness/types.js +0 -7
  268. package/apps/runtime/dist/index.js +0 -113
  269. package/apps/runtime/dist/limits.js +0 -81
  270. package/apps/runtime/dist/link-preview.js +0 -60
  271. package/apps/runtime/dist/log.js +0 -106
  272. package/apps/runtime/dist/manage.js +0 -249
  273. package/apps/runtime/dist/mcp/auth.js +0 -161
  274. package/apps/runtime/dist/mcp/bridge.js +0 -59
  275. package/apps/runtime/dist/mcp/flow-app.js +0 -97
  276. package/apps/runtime/dist/mcp/handler.js +0 -54
  277. package/apps/runtime/dist/mcp/scopes.js +0 -14
  278. package/apps/runtime/dist/mcp/seen.js +0 -65
  279. package/apps/runtime/dist/mcp/tools.js +0 -572
  280. package/apps/runtime/dist/media/conversation.js +0 -167
  281. package/apps/runtime/dist/media/ffmpeg.js +0 -121
  282. package/apps/runtime/dist/media/generate.js +0 -120
  283. package/apps/runtime/dist/media/marking.js +0 -121
  284. package/apps/runtime/dist/media/transcribe.js +0 -198
  285. package/apps/runtime/dist/model-errors.js +0 -42
  286. package/apps/runtime/dist/models.js +0 -1164
  287. package/apps/runtime/dist/plugin.js +0 -61
  288. package/apps/runtime/dist/plugins/channels.js +0 -78
  289. package/apps/runtime/dist/plugins/claims.js +0 -56
  290. package/apps/runtime/dist/plugins/discovery.js +0 -155
  291. package/apps/runtime/dist/plugins/events.js +0 -63
  292. package/apps/runtime/dist/plugins/jobs.js +0 -64
  293. package/apps/runtime/dist/plugins/loader.js +0 -508
  294. package/apps/runtime/dist/plugins/migrations.js +0 -69
  295. package/apps/runtime/dist/plugins/pro-keys.js +0 -34
  296. package/apps/runtime/dist/plugins/pro-state.js +0 -83
  297. package/apps/runtime/dist/plugins/pro.js +0 -310
  298. package/apps/runtime/dist/plugins/public.js +0 -44
  299. package/apps/runtime/dist/plugins/registry.js +0 -122
  300. package/apps/runtime/dist/plugins/runs.js +0 -210
  301. package/apps/runtime/dist/render/browser-path.js +0 -54
  302. package/apps/runtime/dist/render/chromium.js +0 -98
  303. package/apps/runtime/dist/render/convert.js +0 -158
  304. package/apps/runtime/dist/render/downloads.js +0 -299
  305. package/apps/runtime/dist/render/guard.js +0 -25
  306. package/apps/runtime/dist/render/shaped.js +0 -137
  307. package/apps/runtime/dist/routes/api.js +0 -440
  308. package/apps/runtime/dist/routes/debug.js +0 -42
  309. package/apps/runtime/dist/routes/delivery.js +0 -90
  310. package/apps/runtime/dist/routes/internal.js +0 -81
  311. package/apps/runtime/dist/routes/lang.js +0 -25
  312. package/apps/runtime/dist/routes/marketplace.js +0 -43
  313. package/apps/runtime/dist/routes/plugin-public.js +0 -113
  314. package/apps/runtime/dist/routes/plugins.js +0 -212
  315. package/apps/runtime/dist/routes/runs.js +0 -1422
  316. package/apps/runtime/dist/routes/studio.js +0 -1629
  317. package/apps/runtime/dist/routes/wizard-stream.js +0 -30
  318. package/apps/runtime/dist/running.js +0 -39
  319. package/apps/runtime/dist/sandbox/docker.js +0 -75
  320. package/apps/runtime/dist/sandbox/index.js +0 -23
  321. package/apps/runtime/dist/sandbox/types.js +0 -1
  322. package/apps/runtime/dist/secrets/crypto.js +0 -28
  323. package/apps/runtime/dist/secrets/signing.js +0 -52
  324. package/apps/runtime/dist/secrets/vault.js +0 -59
  325. package/apps/runtime/dist/services/access.js +0 -88
  326. package/apps/runtime/dist/services/api.js +0 -248
  327. package/apps/runtime/dist/services/architect.js +0 -95
  328. package/apps/runtime/dist/services/assistant-chats.js +0 -311
  329. package/apps/runtime/dist/services/brand.js +0 -85
  330. package/apps/runtime/dist/services/cloud.js +0 -456
  331. package/apps/runtime/dist/services/draft-events.js +0 -27
  332. package/apps/runtime/dist/services/engenty-shapes.js +0 -71
  333. package/apps/runtime/dist/services/errors.js +0 -29
  334. package/apps/runtime/dist/services/files.js +0 -178
  335. package/apps/runtime/dist/services/knowledge-model.js +0 -559
  336. package/apps/runtime/dist/services/knowledge.js +0 -721
  337. package/apps/runtime/dist/services/links.js +0 -16
  338. package/apps/runtime/dist/services/marketplace.js +0 -492
  339. package/apps/runtime/dist/services/onboarding.js +0 -152
  340. package/apps/runtime/dist/services/package-file.js +0 -82
  341. package/apps/runtime/dist/services/package.js +0 -170
  342. package/apps/runtime/dist/services/profile.js +0 -51
  343. package/apps/runtime/dist/services/project-files.js +0 -439
  344. package/apps/runtime/dist/services/project-index.js +0 -707
  345. package/apps/runtime/dist/services/projects.js +0 -387
  346. package/apps/runtime/dist/services/relevance.js +0 -58
  347. package/apps/runtime/dist/services/runners.js +0 -178
  348. package/apps/runtime/dist/services/runs.js +0 -524
  349. package/apps/runtime/dist/services/shares.js +0 -130
  350. package/apps/runtime/dist/services/site.js +0 -270
  351. package/apps/runtime/dist/services/space-categories.js +0 -861
  352. package/apps/runtime/dist/services/space-data.js +0 -792
  353. package/apps/runtime/dist/services/space-origin.js +0 -207
  354. package/apps/runtime/dist/services/spaces.js +0 -656
  355. package/apps/runtime/dist/services/translations.js +0 -306
  356. package/apps/runtime/dist/services/widgets.js +0 -34
  357. package/apps/runtime/dist/services/wizard-icon.js +0 -157
  358. package/apps/runtime/dist/services/wizards.js +0 -420
  359. package/apps/runtime/dist/settings.js +0 -16
  360. package/apps/runtime/dist/store/errors.js +0 -4
  361. package/apps/runtime/dist/store/index.js +0 -299
  362. package/apps/runtime/dist/store/shared-lists.js +0 -123
  363. package/apps/runtime/dist/tenants/control.js +0 -238
  364. package/apps/runtime/dist/tenants/tenant.js +0 -26
  365. package/apps/runtime/dist/texts.js +0 -207
  366. package/apps/runtime/dist/tools/browser.js +0 -703
  367. package/apps/runtime/dist/tools/connector.js +0 -204
  368. package/apps/runtime/dist/tools/index.js +0 -291
  369. package/apps/runtime/dist/tools/mail.js +0 -104
  370. package/apps/runtime/dist/tools/net-guard.js +0 -170
  371. package/apps/runtime/dist/tools/pages.js +0 -81
  372. package/apps/runtime/dist/tools/plugin.js +0 -180
  373. package/apps/runtime/dist/tools/project.js +0 -154
  374. package/apps/runtime/dist/tools/shared.js +0 -69
  375. package/apps/runtime/dist/tools/store.js +0 -238
  376. package/apps/runtime/dist/update.js +0 -113
  377. package/apps/runtime/dist/widgets/bundle.js +0 -99
  378. package/apps/runtime/dist/widgets/render.js +0 -329
  379. package/apps/runtime/dist/widgets/runtime.js +0 -108
  380. package/apps/runtime/dist/widgets/script.js +0 -30
  381. package/apps/runtime/dist/widgets/step.js +0 -223
  382. package/apps/web/dist/ai-labels/ai-black.svg +0 -20
  383. package/apps/web/dist/ai-labels/ai-generated-black.svg +0 -31
  384. package/apps/web/dist/ai-labels/ai-generated-white.svg +0 -32
  385. package/apps/web/dist/ai-labels/ai-modified-black.svg +0 -30
  386. package/apps/web/dist/ai-labels/ai-modified-white.svg +0 -31
  387. package/apps/web/dist/ai-labels/ai-white.svg +0 -21
  388. package/apps/web/dist/assets/AboutDialog-BI6487_s.js +0 -1
  389. package/apps/web/dist/assets/ChangelogDialog-B63QWuUV.js +0 -1
  390. package/apps/web/dist/assets/ChatView-BjQVHGjn.js +0 -10
  391. package/apps/web/dist/assets/EditorPage-DrprS19h.js +0 -3
  392. package/apps/web/dist/assets/FlowPreview-CusP7ci9.js +0 -1
  393. package/apps/web/dist/assets/Harness-BrP-ENHg.css +0 -1
  394. package/apps/web/dist/assets/Harness-CCMqhtuk.js +0 -16
  395. package/apps/web/dist/assets/NewWizardChannels-DpcWsST7.js +0 -1
  396. package/apps/web/dist/assets/NewWizardPage-BXePNBa9.js +0 -7
  397. package/apps/web/dist/assets/OnboardingPage-BtZ6sHJi.js +0 -1
  398. package/apps/web/dist/assets/ProjectPage-DHOL8FXt.js +0 -1
  399. package/apps/web/dist/assets/PublicRunner-BLRVe7G0.js +0 -1
  400. package/apps/web/dist/assets/ReadOnly-BV8o_HtK.js +0 -1
  401. package/apps/web/dist/assets/RunDrawer-D-T8pYfB.js +0 -4
  402. package/apps/web/dist/assets/RunnerView-BinlRsGF.js +0 -1
  403. package/apps/web/dist/assets/SettingsPage-B6M-jFJw.js +0 -1
  404. package/apps/web/dist/assets/SetupPage-DI6c--4V.js +0 -1
  405. package/apps/web/dist/assets/SharePage-C4cESaes.js +0 -1
  406. package/apps/web/dist/assets/changelog-Dj_yd2vG.js +0 -1
  407. package/apps/web/dist/assets/engenty-eXZ-EAwd.js +0 -1
  408. package/apps/web/dist/assets/esm-DXeMu8Lb.js +0 -7
  409. package/apps/web/dist/assets/fluffy-engenty-ClRou7yu.js +0 -456
  410. package/apps/web/dist/assets/index-AfUa8xKD.css +0 -1
  411. package/apps/web/dist/assets/index-yiE9Lun0.js +0 -14
  412. package/apps/web/dist/assets/jsx-runtime-BNakU3Ej.js +0 -1
  413. package/apps/web/dist/assets/lock-R_CfU0Xo.js +0 -1
  414. package/apps/web/dist/assets/oss-credits-cZ9NUaLZ.js +0 -1
  415. package/apps/web/dist/assets/pdfmake-Cx9scTbD.js +0 -228
  416. package/apps/web/dist/assets/phone-CgrIS4_-.js +0 -1
  417. package/apps/web/dist/assets/preload-helper-CNEI7N0N.js +0 -1
  418. package/apps/web/dist/assets/qr-scanner-worker.min-CJaXo3yu.js +0 -98
  419. package/apps/web/dist/assets/qr-scanner.min-C_UI0gH-.js +0 -1
  420. package/apps/web/dist/assets/rolldown-runtime-hePW80VL.js +0 -1
  421. package/apps/web/dist/assets/settings-menu-2IMOOlLl.js +0 -1
  422. package/apps/web/dist/assets/ui-dzGvc3xk.js +0 -137
  423. package/apps/web/dist/assets/upload-BSuTilFF.js +0 -1
  424. package/apps/web/dist/assets/vfs_fonts-DllDSYt1.js +0 -1
  425. package/apps/web/dist/embed.js +0 -266
  426. package/apps/web/dist/favicon.svg +0 -1
  427. package/apps/web/dist/icons/apple-touch-icon.png +0 -0
  428. package/apps/web/dist/icons/icon-192.png +0 -0
  429. package/apps/web/dist/icons/icon-512.png +0 -0
  430. package/apps/web/dist/icons/icon-maskable-512.png +0 -0
  431. package/apps/web/dist/index.html +0 -48
  432. package/apps/web/dist/manifest.webmanifest +0 -21
  433. package/apps/web/dist/mcp/flow.html +0 -980
  434. package/apps/web/dist/sw.js +0 -15
  435. package/modules/README.md +0 -15
  436. package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +0 -1150
  437. package/node_modules/@engenty/wizards/dist/plugin/index.js +0 -4
  438. package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +0 -322
  439. package/node_modules/@engenty/wizards/dist/plugin/studio.js +0 -4
  440. package/node_modules/@engenty/wizards/dist/plugin/thread.d.ts +0 -174
  441. package/node_modules/@engenty/wizards/dist/plugin/thread.js +0 -821
  442. package/node_modules/@engenty/wizards/package.json +0 -11
  443. package/node_modules/@engenty-wizards/shared/dist/assistant.d.ts +0 -174
  444. package/node_modules/@engenty-wizards/shared/dist/assistant.js +0 -65
  445. package/node_modules/@engenty-wizards/shared/dist/changes.d.ts +0 -22
  446. package/node_modules/@engenty-wizards/shared/dist/changes.js +0 -61
  447. package/node_modules/@engenty-wizards/shared/dist/connectors.d.ts +0 -77
  448. package/node_modules/@engenty-wizards/shared/dist/connectors.js +0 -2
  449. package/node_modules/@engenty-wizards/shared/dist/decision.d.ts +0 -76
  450. package/node_modules/@engenty-wizards/shared/dist/decision.js +0 -147
  451. package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +0 -2922
  452. package/node_modules/@engenty-wizards/shared/dist/definition.js +0 -1920
  453. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.d.ts +0 -5
  454. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.js +0 -132
  455. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.d.ts +0 -11
  456. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.js +0 -209
  457. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.d.ts +0 -532
  458. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.js +0 -217
  459. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.d.ts +0 -3
  460. package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.js +0 -3
  461. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.d.ts +0 -14
  462. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.js +0 -166
  463. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.d.ts +0 -33
  464. package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.js +0 -99
  465. package/node_modules/@engenty-wizards/shared/dist/feature-flags.d.ts +0 -78
  466. package/node_modules/@engenty-wizards/shared/dist/feature-flags.js +0 -70
  467. package/node_modules/@engenty-wizards/shared/dist/features.d.ts +0 -41
  468. package/node_modules/@engenty-wizards/shared/dist/features.js +0 -89
  469. package/node_modules/@engenty-wizards/shared/dist/fit.d.ts +0 -71
  470. package/node_modules/@engenty-wizards/shared/dist/fit.js +0 -382
  471. package/node_modules/@engenty-wizards/shared/dist/json-schema.d.ts +0 -14
  472. package/node_modules/@engenty-wizards/shared/dist/json-schema.js +0 -66
  473. package/node_modules/@engenty-wizards/shared/dist/knowledge.d.ts +0 -199
  474. package/node_modules/@engenty-wizards/shared/dist/knowledge.js +0 -68
  475. package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.d.ts +0 -35
  476. package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +0 -107
  477. package/node_modules/@engenty-wizards/shared/dist/marketplace-search.d.ts +0 -20
  478. package/node_modules/@engenty-wizards/shared/dist/marketplace-search.js +0 -136
  479. package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +0 -227
  480. package/node_modules/@engenty-wizards/shared/dist/marketplace.js +0 -354
  481. package/node_modules/@engenty-wizards/shared/dist/merge.d.ts +0 -7
  482. package/node_modules/@engenty-wizards/shared/dist/merge.js +0 -40
  483. package/node_modules/@engenty-wizards/shared/dist/numbers.d.ts +0 -24
  484. package/node_modules/@engenty-wizards/shared/dist/numbers.js +0 -54
  485. package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +0 -224
  486. package/node_modules/@engenty-wizards/shared/dist/projects.js +0 -319
  487. package/node_modules/@engenty-wizards/shared/dist/providers.d.ts +0 -101
  488. package/node_modules/@engenty-wizards/shared/dist/providers.js +0 -390
  489. package/node_modules/@engenty-wizards/shared/dist/run.d.ts +0 -680
  490. package/node_modules/@engenty-wizards/shared/dist/run.js +0 -620
  491. package/node_modules/@engenty-wizards/shared/dist/runner-texts.d.ts +0 -546
  492. package/node_modules/@engenty-wizards/shared/dist/runner-texts.js +0 -523
  493. package/node_modules/@engenty-wizards/shared/dist/runners.d.ts +0 -93
  494. package/node_modules/@engenty-wizards/shared/dist/runners.js +0 -146
  495. package/node_modules/@engenty-wizards/shared/dist/shape.d.ts +0 -102
  496. package/node_modules/@engenty-wizards/shared/dist/shape.js +0 -318
  497. package/node_modules/@engenty-wizards/shared/dist/space-data.d.ts +0 -89
  498. package/node_modules/@engenty-wizards/shared/dist/space-data.js +0 -47
  499. package/node_modules/@engenty-wizards/shared/dist/store.d.ts +0 -117
  500. package/node_modules/@engenty-wizards/shared/dist/store.js +0 -81
  501. package/node_modules/@engenty-wizards/shared/dist/surface.d.ts +0 -115
  502. package/node_modules/@engenty-wizards/shared/dist/surface.js +0 -442
  503. package/node_modules/@engenty-wizards/shared/dist/texts.d.ts +0 -45
  504. package/node_modules/@engenty-wizards/shared/dist/texts.js +0 -54
  505. package/node_modules/@engenty-wizards/shared/dist/translation.d.ts +0 -23
  506. package/node_modules/@engenty-wizards/shared/dist/translation.js +0 -154
  507. package/node_modules/@engenty-wizards/shared/dist/wizard-package.d.ts +0 -48
  508. package/node_modules/@engenty-wizards/shared/dist/wizard-package.js +0 -49
  509. package/node_modules/@engenty-wizards/shared/dist/workspace.d.ts +0 -16
  510. package/node_modules/@engenty-wizards/shared/dist/workspace.js +0 -51
  511. package/node_modules/@engenty-wizards/shared/package.json +0 -10
  512. package/plugin/.claude-plugin/plugin.json +0 -9
  513. package/plugin/.mcp.json +0 -8
  514. package/plugin/commands/wizard.md +0 -8
  515. package/plugin/skills/build-wizard/SKILL.md +0 -27
  516. package/plugin/skills/use-wizard/SKILL.md +0 -18
@@ -1,456 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{a as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./engenty-eXZ-EAwd.js";var f=e(t(),1),p=new Map,m=null,h=new WeakMap;function g(e){let t=p.get(e);if(t)return t;if(!m){let e=document.createElement(`canvas`);e.width=1,e.height=1,m=e.getContext(`2d`,{willReadFrequently:!0})}let n=[.5,.5,.5];if(m){m.clearRect(0,0,1,1),m.fillStyle=`#808080`,m.fillStyle=e,m.fillRect(0,0,1,1);let[t,r,i]=m.getImageData(0,0,1,1).data;n=[t/255,r/255,i/255]}return p.set(e,n),n}function _(e,t){let n=h.get(e);return n||(n=document.createElement(`span`),n.setAttribute(`aria-hidden`,`true`),n.style.cssText=`position:absolute;width:0;height:0;overflow:hidden;visibility:hidden`,e.appendChild(n),h.set(e,n)),n.style.color=``,n.style.color=t,g(getComputedStyle(n).color||`#808080`)}var v=(e,t,n)=>[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n,e[2]+(t[2]-e[2])*n];function ee(e,t){let n=_(e,a[d[t]]),r=Math.max(...n),i=[Math.min(1,n[0]+n[0]/(r||1)*.45),Math.min(1,n[1]+n[1]/(r||1)*.45),Math.min(1,n[2]+n[2]/(r||1)*.45)];return{body:v(n,[1,1,1],.12),deep:v(n,[.03,.02,.06],.62),tip:v(i,[1,1,1],.12)}}var y=`#version 300 es
2
- precision highp float;
3
- #define BLOBS ${c}
4
- #define EXTRAS ${i}
5
- #define VIEW ${152 .toFixed(1)}
6
- #define ORIGIN ${(-16).toFixed(1)}
7
- #define TAU 6.2831853
8
- uniform vec2 uResolution;
9
- uniform float uTime;
10
- uniform vec4 uBlobs[BLOBS];
11
- uniform float uFalloff;
12
- uniform float uScale;
13
- uniform float uFur;
14
- uniform float uPeriod;
15
- uniform float uInflate;
16
- uniform float uDensity;
17
- uniform float uThick;
18
- uniform vec2 uLean;
19
- uniform vec2 uTurn;
20
- uniform float uGoggles;
21
- uniform vec3 uLight;
22
- uniform vec3 uBody;
23
- uniform vec3 uDeep;
24
- uniform vec3 uTip;
25
- uniform vec3 uEye;
26
- uniform float uWind;
27
- uniform vec2 uGaze;
28
- uniform vec4 uExtras[EXTRAS];
29
- uniform vec4 uExtraMeta[EXTRAS];
30
- uniform vec2 uWobble;
31
- uniform float uClarity;
32
- uniform float uSoftness;
33
- uniform vec4 uPull;
34
- #ifdef JELLY_COAT
35
-
36
- vec3 deformJelly(vec3 p) {
37
- vec3 q=p-vec3(60.0,60.0,0.0);
38
- vec3 local=q/max(uScale,1.0);
39
- float softness=clamp(uSoftness,0.0,1.5);
40
- float phase=TAU*uTime/uPeriod;
41
- vec2 lag=clamp(uWobble,vec2(-7.0),vec2(7.0));
42
- float squash=softness*(sin(phase)*0.08+sin(phase*1.7)*0.012+lag.y*0.012);
43
- q.xz*=inversesqrt(1.0+squash);
44
- q.y*=1.0+squash;
45
- float top=clamp(1.0-p.y/125.0,0.0,1.0);
46
- q.x+=softness*(lag.x*1.15*top*top+sin(phase*0.8+local.y*2.5)*0.8);
47
- float wave=sin(local.x*3.1+uTime*1.15)*sin(local.y*2.7-uTime*0.85)*sin(local.z*2.6+uTime*0.65);
48
- vec3 d1=local-vec3(-0.42,-0.32,0.72);
49
- vec3 d2=local-vec3(0.45,0.46,0.7);
50
- float dents=-3.2*exp(-dot(d1,d1)*8.0)-2.1*exp(-dot(d2,d2)*9.0);
51
- float face=1.0-0.8*exp(-dot(p.xy-uEye.xy,p.xy-uEye.xy)/(uEye.z*uEye.z*3.0));
52
- q+=normalize(local+vec3(0.0,0.001,0.0))*softness*face*(wave*3.2+dents);
53
- vec2 grab=(p.xy-uPull.xy)/max(uScale*0.65,1.0);
54
- float influence=exp(-dot(grab,grab)*2.0)*smoothstep(-0.2,0.65,local.z);
55
- q.xy+=uPull.zw*softness*influence;
56
- q.z-=length(uPull.zw)*softness*influence*0.15;
57
- return q+vec3(60.0,60.0,0.0);
58
- }
59
-
60
- #endif
61
- vec2 eyeCentre() { return uEye.xy; }
62
- float bodyK(vec2 p) {
63
- float sum=0.0;
64
- for(int i=0;i<BLOBS;i++){
65
- vec4 b=uBlobs[i];if(b.z<=0.0)continue;
66
- vec2 q=(p-b.xy)/b.zw;sum+=exp(-uFalloff*dot(q,q));
67
- }
68
- return sqrt(max(0.0,-log(max(sum,1e-8))/uFalloff));
69
- }
70
- float sdBody(vec2 p){return (bodyK(p)-1.0)*uScale;}
71
- vec3 rotateCoat(vec3 p) {
72
- vec3 q=vec3(p.x,cos(uTurn.y)*p.y-sin(uTurn.y)*p.z,sin(uTurn.y)*p.y+cos(uTurn.y)*p.z);
73
- return vec3(cos(uTurn.x)*q.x+sin(uTurn.x)*q.z,q.y,-sin(uTurn.x)*q.x+cos(uTurn.x)*q.z);
74
- }
75
- vec3 bodyStretch(){float s=sin(TAU*uTime/uPeriod)*0.018;return vec3(1.0+s,1.0-s,1.0/(1.0-s*s));}
76
- vec3 poseCoat(vec3 p) {
77
- float w=TAU*uTime/uPeriod;
78
- #ifdef JELLY_COAT
79
- p=deformJelly(p);
80
- #endif
81
- vec3 q=(p-vec3(60.0,60.0,0.0))*bodyStretch();
82
- q.xy+=uLean*(1.15-p.y/120.0)*0.3;
83
-
84
- q=rotateCoat(q);
85
- q.xy+=vec2(60.0+sin(w)*1.5,60.0+cos(w*0.8)*1.1);
86
- return q;
87
- }
88
- vec3 poseNormal(vec3 p,vec3 normal){
89
- #ifdef JELLY_COAT
90
- vec3 tangent=normalize(cross(normal,abs(normal.y)>0.9?vec3(1.0,0.0,0.0):vec3(0.0,1.0,0.0)));
91
- vec3 bitangent=cross(normal,tangent);
92
- vec3 t=poseCoat(p+tangent*0.12)-poseCoat(p-tangent*0.12);
93
- vec3 b=poseCoat(p+bitangent*0.12)-poseCoat(p-bitangent*0.12);
94
- return normalize(cross(t,b));
95
- #else
96
- return rotateCoat(normalize(normal/bodyStretch()));
97
- #endif
98
- }
99
- float coatZoom(){
100
- float extent=0.0;
101
- for(int i=0;i<BLOBS;i++){
102
- vec4 b=uBlobs[i];if(b.z<=0.0)continue;
103
- extent=max(extent,max(max(abs(b.x-60.0)+b.z,abs(b.y-60.0)+b.w),b.z*uInflate/30.0));
104
- }
105
- return min(1.0,65.0/(extent+uFur*1.2+3.0));
106
- }
107
- vec4 projectCoat(vec3 p){
108
- float zoom=coatZoom();
109
- vec2 screen=(p.xy-60.0)*zoom+60.0;
110
- return vec4((screen.x-ORIGIN)/VIEW*2.0-1.0,1.0-(screen.y-ORIGIN)/VIEW*2.0,-p.z*zoom/150.0,1.0);
111
- }
112
- float sdArc(vec2 q,float r,float span){float a=clamp(atan(q.x,-q.y),-span,span);return length(q-vec2(sin(a),-cos(a))*r);}
113
- vec4 extrasOver(vec2 p,vec3 ink,vec3 bodyCol,float aa){
114
- vec4 acc=vec4(0.0);
115
- for(int i=0;i<EXTRAS;i++){
116
- vec4 m=uExtraMeta[i],g=uExtras[i];int kind=int(m.x+0.5);
117
- if(kind==0||kind==2||(kind==3&&m.w>0.5))continue;
118
- vec2 q=p-g.xy;float distance=1000.0,hw=m.z*0.5;
119
- if(kind==1){distance=length(q)-g.z;hw=0.0;}
120
- else if(kind==3)distance=sdArc(q,g.z,g.w);
121
- else if(kind==4)distance=length(vec2(q.x,max(abs(q.y)-g.z,0.0)));
122
- else if(kind==5){float x=clamp(q.x,0.0,g.z);distance=length(q-vec2(x,-g.w*sin(TAU*x/g.z)));}
123
- float a=(1.0-smoothstep(hw-aa,hw+aa,distance))*m.y;
124
- vec3 color=mix(ink,bodyCol*0.45,0.2);
125
- acc=vec4(color*a,a)+acc*(1.0-a);
126
- }
127
- return acc;
128
- }
129
-
130
- vec4 gogglesOver(vec2 p, float aa, float front) {
131
- if (uGoggles < 0.5) return vec4(0.0);
132
- vec2 q = p - eyeCentre();
133
- float er = uEye.z * 1.35;
134
- float d = length(q);
135
- float outer = er * 1.27;
136
- float bandY = q.y + 1.7 * pow(q.x / max(uScale, 1.0), 2.0);
137
- float band = 1.0 - smoothstep(uEye.z * 0.31 - aa, uEye.z * 0.31 + aa, abs(bandY));
138
- // Taper into the surface; fine irregular coverage lets fur cover the strap ends.
139
- float skin = -sdBody(p);
140
- float grain = sin(p.x * 7.3 + sin(p.y * 4.1)) * 0.6;
141
- float tuck = smoothstep(0.5, 6.0, skin + grain);
142
- band *= tuck * mix(1.0, smoothstep(outer - aa, outer + aa, d), front);
143
- float curve = clamp(skin / max(uScale, 1.0), 0.0, 1.0);
144
- vec3 leather = mix(vec3(0.12, 0.055, 0.025), vec3(0.43, 0.24, 0.1), curve);
145
- float seam = 1.0 - smoothstep(0.12, 0.35, abs(abs(bandY) - uEye.z * 0.22));
146
- leather += vec3(0.11, 0.065, 0.025) * seam * step(0.4, fract(p.x * 0.65));
147
- vec4 acc = vec4(leather * band, band);
148
- return acc;
149
- }
150
-
151
- `;function b(e){let t=[];for(let n=0;n<e.extraMeta.length/4;n++){let[r,,i,a]=e.extraMeta.slice(n*4,n*4+4);if(r!==2&&!(r===3&&a>.5))continue;let[o,s,c,l]=e.extras.slice(n*4,n*4+4),u=r===2?16:32,d=(e,t)=>{let a=e/u*(r===2?Math.PI:l*2)-(r===2?0:l),d=t/16*Math.PI*2,f=r===2?[Math.sin(a)*Math.cos(d),-Math.cos(a),Math.sin(a)*Math.sin(d)]:[Math.sin(a)*Math.cos(d),-Math.cos(a)*Math.cos(d),Math.sin(d)],p=r===2?[o,s,0]:[o+Math.sin(a)*c,s-Math.cos(a)*c,0],m=r===2?c:i*.5;return[...p.map((e,t)=>e+f[t]*m),...f,n]},f=(e,n,r)=>{let i=n.map((t,n)=>t-e[n]),a=r.map((t,n)=>t-e[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]].reduce((t,n,r)=>t+n*e[r+3],0)<0?[e,r,n]:[e,n,r];for(let e of o)t.push(...e)};for(let e=0;e<u;e++)for(let t=0;t<16;t++){let n=d(e,t),r=d(e+1,t),i=d(e+1,t+1),a=d(e,t+1);f(n,r,i),f(n,i,a)}}return new Float32Array(t)}function x(e,t){let n=new Map,r=[[`aPosition`,3,0],[`aNormal`,3,12],[`aExtra`,1,24]];return{draw(i){let a=`${i.extras.join(`,`)}:${i.extraMeta.join(`,`)}`,o=n.get(a);if(!o){let t=e.createBuffer();if(!t)throw Error(`engenty: accessory allocation failed`);let r=b(i);if(e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),o={buffer:t,count:r.length/7},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[n,i,a]of r){let r=e.getAttribLocation(t,n);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i,e.FLOAT,!1,28,a)}e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var S=`${y}
152
- in vec3 aPosition;
153
- in vec3 aNormal;
154
- in float aExtra;
155
- out vec3 vNormal;
156
- out float vAlpha;
157
- void main(){
158
- int index=int(aExtra+0.5);
159
- vec3 p=aPosition;
160
- p.y+=sin(uTime*1.5+float(index)*1.7)*1.2;
161
- p.x+=cos(uTime*1.1+float(index))*0.5;
162
- vNormal=rotateCoat(aNormal);
163
- vAlpha=mix(uExtraMeta[index].y,1.0,0.65);
164
- gl_Position=projectCoat(poseCoat(p));
165
- }
166
- `,C=`${y}
167
- in vec3 vNormal;
168
- in float vAlpha;
169
- out vec4 outColor;
170
- void main(){
171
- vec3 n=normalize(vNormal),light=normalize(uLight);
172
- float diffuse=max(dot(n,light),0.0);
173
- vec3 color=mix(uDeep,uBody,0.55+diffuse*0.45)*(0.7+diffuse*0.45);
174
- vec3 halfLight=normalize(light+vec3(0.0,0.0,1.0));
175
- color+=vec3(0.85)*pow(max(dot(n,halfLight),0.0),48.0);
176
- color+=uTip*pow(1.0-abs(n.z),3.0)*0.2;
177
- outColor=vec4(color*vAlpha,vAlpha);
178
- }
179
- `,w={inflate:27,softness:.05,clarity:.15},T=`uResolution.uTime.uBlobs.uFalloff.uScale.uFur.uPeriod.uInflate.uDensity.uThick.uLean.uLight.uBody.uDeep.uTip.uEye.uWind.uGaze.uTurn.uGoggles.uExtras.uExtraMeta.uWobble.uClarity.uSoftness.uPull`.split(`.`);function E(e,t,n){let r=e.createShader(t);if(!r)throw Error(`engenty fur: could not create shader`);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw e.deleteShader(r),Error(`engenty fur: shader compile failed — ${t}`)}return r}function D(e,t,n){let r=e.getContext(`webgl2`,{alpha:!0,antialias:!0,depth:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,stencil:!1});if(!r)return null;let i=null;try{let e=E(r,r.VERTEX_SHADER,n.vertex),a=E(r,r.FRAGMENT_SHADER,t);if(i=r.createProgram(),!i)throw Error(`engenty fur: could not create program`);if(r.attachShader(i,e),r.attachShader(i,a),r.linkProgram(i),r.deleteShader(e),r.deleteShader(a),!r.getProgramParameter(i,r.LINK_STATUS))throw Error(`engenty fur: link failed — ${r.getProgramInfoLog(i)}`)}catch(e){return i&&r.deleteProgram(i),console.error(e),null}let a={};for(let e of T)a[e]=r.getUniformLocation(i,e);let o=r.createVertexArray();r.bindVertexArray(o);let s=n.geometry(r,i),c=r.useProgram.bind(r);r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA);let l=!1,u=1;return{dispose(){l||(l=!0,s.dispose(),r.deleteVertexArray(o),r.deleteProgram(i))},render(e){l||(c(i),r.bindVertexArray(o),r.uniform2f(a.uResolution,u,u),r.uniform1f(a.uTime,e.time),r.uniform4fv(a.uBlobs,e.blobs),r.uniform1f(a.uFalloff,e.falloff),r.uniform1f(a.uScale,e.scale),r.uniform1f(a.uFur,e.fur),r.uniform1f(a.uPeriod,e.period),r.uniform1f(a.uInflate,e.inflate),r.uniform1f(a.uDensity,e.density),r.uniform1f(a.uThick,e.thick),r.uniform1f(a.uClarity,e.clarity),r.uniform1f(a.uSoftness,e.softness??w.softness),r.uniform4fv(a.uPull,e.pull??[60,60,0,0]),r.uniform2fv(a.uLean,e.lean),r.uniform3fv(a.uLight,e.light),r.uniform3fv(a.uBody,e.body),r.uniform3fv(a.uDeep,e.deep),r.uniform3fv(a.uTip,e.tip),r.uniform3fv(a.uEye,e.eye),r.uniform1f(a.uWind,e.wind),r.uniform2fv(a.uGaze,e.gaze),r.uniform2fv(a.uTurn,e.turn??[0,0]),r.uniform1f(a.uGoggles,+!!e.goggles),r.uniform4fv(a.uExtras,e.extras),r.uniform4fv(a.uExtraMeta,e.extraMeta),r.uniform2fv(a.uWobble,e.wobble),r.enable(r.SCISSOR_TEST),r.scissor(0,0,u,u),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.depthMask(!0),r.frontFace(r.CW),n.doubleSided?r.disable(r.CULL_FACE):(r.enable(r.CULL_FACE),r.cullFace(r.BACK)),n.clear!==!1&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT)),r.depthMask(n.depthWrite!==!1),s.draw(e))},viewport(e){l||(u=e,r.viewport(0,0,e,e))}}}var O=new Map,k=[[0,5,1,6],[0,1,2,6],[0,2,3,6],[0,3,7,6],[0,7,4,6],[0,4,5,6]];function A(e){return`${e.blobs.join(`,`)}:${e.falloff}:${e.inflate}`}function j(e,t){let n=0,r=[0,0,0];for(let i=0;i<t.blobs.length;i+=4){let a=t.blobs[i+2],o=t.blobs[i+3];if(a<=0||o<=0)continue;let s=a*t.inflate/30,c=e[0]-t.blobs[i],l=e[1]-t.blobs[i+1],u=e[2],d=Math.exp(-t.falloff*(c*c/(a*a)+l*l/(o*o)+u*u/(s*s)));n+=d,r[0]+=d*c/(a*a),r[1]+=d*l/(o*o),r[2]+=d*u/(s*s)}let i=Math.hypot(...r)||1;return{value:n,normal:[r[0]/i,r[1]/i,r[2]/i]}}function M(e){let t=A(e),n=O.get(t);if(n)return n;let r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];for(let t=0;t<e.blobs.length;t+=4){if(e.blobs[t+2]<=0)continue;let n=[e.blobs[t],e.blobs[t+1],0],a=[e.blobs[t+2],e.blobs[t+3],e.blobs[t+2]*e.inflate/30];for(let e=0;e<3;e++)r[e]=Math.min(r[e],n[e]-a[e]*1.5),i[e]=Math.max(i[e],n[e]+a[e]*1.5)}let a=2.7,[o,s,c]=i.map((e,t)=>Math.ceil((e-r[t])/a)+1),l=[],u=[];for(let t=0;t<c;t++)for(let n=0;n<s;n++)for(let i=0;i<o;i++){let o=[r[0]+i*a,r[1]+n*a,r[2]+t*a];l.push(o),u.push(j(o,e).value)}let d=Math.exp(-e.falloff),f=[],p=0,m=(e,t)=>{let n=(d-u[e])/(u[t]-u[e]);return[0,1,2].map(r=>l[e][r]+(l[t][r]-l[e][r])*n)},h=(t,n,r)=>{let i=n.map((e,n)=>e-t[n]),a=r.map((e,n)=>e-t[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]],s=Math.hypot(...o)*.5;if(s<1e-9)return;let c=j(t,e).normal,l=o.reduce((e,t,n)=>e+t*c[n],0)<0?[t,r,n]:[t,n,r];for(let t of l)f.push(...t,...j(t,e).normal);p+=s};for(let e=0;e<c-1;e++)for(let t=0;t<s-1;t++)for(let n=0;n<o-1;n++){let r=n+o*(t+s*e),i=o*s,a=[r,r+1,r+o+1,r+o,r+i,r+i+1,r+i+o+1,r+i+o];if(!(a.every(e=>u[e]<d)||a.every(e=>u[e]>=d)))for(let e of k){let t=e.map(e=>a[e]).filter(e=>u[e]>=d),n=e.map(e=>a[e]).filter(e=>u[e]<d);if(t.length===1)h(...n.map(e=>m(t[0],e)));else if(t.length===3)h(...t.map(e=>m(n[0],e)));else if(t.length===2){let e=m(t[0],n[0]),r=m(t[0],n[1]),i=m(t[1],n[0]),a=m(t[1],n[1]);h(e,r,i),h(r,a,i)}}}let g={vertices:new Float32Array(f),area:p};if(O.set(t,g),O.size>24){let e=O.keys().next().value;e&&O.delete(e)}return g}function te(e,t,n){let r=0,i=200;for(let a=0;a<24;a++){let a=(r+i)/2,o=0;for(let r=0;r<e.blobs.length;r+=4){let[i,s,c,l]=e.blobs.slice(r,r+4);c<=0||(o+=Math.exp(-e.falloff*(((t-i)/c)**2+((n-s)/l)**2+(a/(c*e.inflate/30))**2)))}o>Math.exp(-e.falloff)?r=a:i=a}return(r+i)/2}function ne(e){let t=[],[n,r,i]=e.eye,a=i*1.35,o=te(e,n,r),s=(e,n,r)=>{let i=n.map((t,n)=>t-e[n]),a=r.map((t,n)=>t-e[n]),o=[i[1]*a[2]-i[2]*a[1],i[2]*a[0]-i[0]*a[2],i[0]*a[1]-i[1]*a[0]];for(let i of o.reduce((t,n,r)=>t+n*e[r+3],0)<0?[e,r,n]:[e,n,r])t.push(...i)},c=(e,t,n)=>{for(let r=0;r<e;r++)for(let i=0;i<t;i++){let a=n(r/e,i/t),o=n((r+1)/e,i/t),c=n((r+1)/e,(i+1)/t),l=n(r/e,(i+1)/t);s(a,o,c),s(a,c,l)}},l=(e,t,i,a,s)=>c(96,16,(c,l)=>{let u=c*Math.PI*2,d=l*Math.PI*2,f=Math.cos(u)*Math.cos(d)/t,p=Math.sin(u)*Math.cos(d)/t,m=Math.sin(d)/a,h=Math.hypot(f,p,m);return[n+Math.cos(u)*(e+Math.cos(d)*t),r+Math.sin(u)*(e+Math.cos(d)*t),o+i+Math.sin(d)*a,f/h,p/h,m/h,s]});l(a*1.14,a*.2,.3,1.5,0),l(a*1.13,a*.14,2.1,1.8,1);for(let e=0;e<4;e++){let t=Math.PI/4+e*Math.PI/2,i=n+Math.cos(t)*a*1.13,s=r+Math.sin(t)*a*1.13;c(10,12,(e,t)=>{let n=e*Math.PI,r=t*Math.PI*2,a=[Math.sin(n)*Math.cos(r),Math.sin(n)*Math.sin(r),Math.cos(n)];return[i+a[0]*.65,s+a[1]*.65,o+3.9+a[2]*.4,...a,2]})}return c(18,96,(e,t)=>{let i=t*Math.PI*2,s=Math.cos(i)*e,c=Math.sin(i)*e,l=[s*.45,c*.45,1],u=Math.hypot(...l);return[n+s*a,r+c*a,o+2.4+2.3*(1-e*e),l[0]/u,l[1]/u,l[2]/u,3]}),new Float32Array(t)}function re(e,t){let n=new Map,r=[[`aPosition`,3,0],[`aNormal`,3,12],[`aMaterial`,1,24]];return{draw(i){if(!i.goggles)return;let a=`${A(i)}:${i.eye.join(`,`)}`,o=n.get(a);if(!o){let t=e.createBuffer();if(!t)throw Error(`engenty: goggle allocation failed`);let r=ne(i);if(e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW),o={buffer:t,count:r.length/7},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[n,i,a]of r){let r=e.getAttribLocation(t,n);e.enableVertexAttribArray(r),e.vertexAttribPointer(r,i,e.FLOAT,!1,28,a)}e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let{buffer:t}of n.values())e.deleteBuffer(t);n.clear()}}}var N=`${y}
180
- in vec3 aPosition;
181
- in vec3 aNormal;
182
- in float aMaterial;
183
- out vec3 vNormal;
184
- flat out int vMaterial;
185
- void main(){
186
- vNormal=poseNormal(aPosition,aNormal);
187
- vMaterial=int(aMaterial+0.5);
188
- gl_Position=projectCoat(poseCoat(aPosition));
189
- }
190
- `,ie=`${y}
191
- in vec3 vNormal;
192
- flat in int vMaterial;
193
- out vec4 outColor;
194
- void main(){
195
- vec3 n=normalize(vNormal),light=normalize(uLight),view=vec3(0.0,0.0,1.0);
196
- float diffuse=max(dot(n,light),0.0);
197
- float spec=pow(max(dot(n,normalize(light+view)),0.0),48.0);
198
- if(vMaterial==3){
199
- float fres=0.025+0.975*pow(1.0-max(dot(n,view),0.0),5.0);
200
- float shine=pow(max(dot(n,normalize(light+view)),0.0),100.0);
201
- float alpha=0.045+fres*0.3+shine*0.38;
202
- vec3 glass=mix(vec3(0.35,0.65,0.73),vec3(1.0),clamp(shine*3.0,0.0,1.0));
203
- outColor=vec4(glass*alpha,alpha);return;
204
- }
205
- vec3 base=vMaterial==0?vec3(0.1,0.065,0.04):vMaterial==2?vec3(0.3,0.18,0.07):vec3(0.68,0.4,0.12);
206
- vec3 reflected=mix(vec3(0.1,0.065,0.04),vec3(1.0,0.85,0.52),smoothstep(-0.7,0.8,-reflect(-view,n).y));
207
- vec3 color=base*(0.4+diffuse*0.75)+reflected*(vMaterial==0?0.04:0.27)+vec3(1.0,0.9,0.65)*spec*(vMaterial==0?0.1:0.8);
208
- outColor=vec4(color,1.0);
209
- }
210
- `,P=`${y}
211
- in vec3 aPosition;
212
- in vec3 aNormal;
213
- out vec3 vLocal;
214
- out vec3 vNormal;
215
- void main(){
216
- vLocal=aPosition;
217
- vNormal=poseNormal(aPosition,aNormal);
218
- gl_Position=projectCoat(poseCoat(aPosition));
219
- }
220
- `,F=`
221
- in vec3 vLocal;
222
- in vec3 vNormal;
223
- out vec4 outColor;
224
- `,ae=`${y}${F}
225
- void main(){
226
- vec2 p=vLocal.xy;
227
- vec3 n=normalize(vNormal),light=normalize(uLight);
228
- float aa=max(fwidth(p.x),fwidth(p.y))*0.7;
229
- float lit=max(dot(n,light),0.0);
230
- vec3 color=mix(uDeep,uBody,0.48)*(0.65+0.5*lit);
231
- float front=smoothstep(0.0,2.0,vLocal.z);
232
- vec2 ep=p-uEye.xy;
233
- float er=uEye.z*1.35;
234
- color*=mix(0.7,1.0,smoothstep(er*0.9,er*1.35,length(ep))*front+(1.0-front));
235
- float phase=fract(uTime/5.4);
236
- float blink=smoothstep(0.955,0.972,phase)-smoothstep(0.972,0.99,phase);
237
- ep.y/=max(1.0-blink,0.035);
238
- float lens=(1.0-smoothstep(er-aa,er+aa,length(ep)))*front;
239
- vec3 eyeNormal=rotateCoat(vec3(ep/er,sqrt(max(0.0,1.0-dot(ep,ep)/(er*er)))));
240
- vec3 eyeColor=mix(vec3(0.78,0.83,0.92),vec3(1.0),0.5+max(dot(eyeNormal,light),0.0)*0.5);
241
- vec2 pupil=ep-uGaze/max(1.0,length(uGaze))*er*0.42;
242
- float iris=1.0-smoothstep(er*0.43-aa,er*0.43+aa,length(pupil));
243
- eyeColor=mix(eyeColor,vec3(0.075,0.06,0.13),iris);
244
- float glint=1.0-smoothstep(er*0.1,er*0.16,length(pupil+vec2(er*0.14,er*0.17)));
245
- eyeColor=mix(eyeColor,vec3(1.0),glint*iris);
246
- // Directional contact shade from the irregular fur fringe, strongest above.
247
- float angle=atan(ep.y,ep.x);
248
- float edge=length(ep)/er+sin(angle*19.0)*0.025+sin(angle*37.0)*0.015;
249
- float contact=smoothstep(0.72,1.02,edge)*(0.25+0.3*clamp(-ep.y/er,0.0,1.0));
250
- eyeColor*=1.0-contact;
251
- color=mix(color,eyeColor,lens);
252
- vec4 extras=extrasOver(p,uDeep*0.55,uBody,aa)*front*(1.0-lens);
253
- color=color*(1.0-extras.a)+extras.rgb;
254
- vec4 goggles=gogglesOver(p,aa,front);
255
- outColor=vec4(goggles.rgb+color*(1.0-goggles.a),1.0);
256
- }
257
- `,I=`${y}${F}
258
- /** Luminance, for turning a reflection into coverage. */
259
- float lum(vec3 c) { return dot(c, vec3(0.2126, 0.7152, 0.0722)); }
260
-
261
- /**
262
- * Coverage of a soft rectangular window seen in direction \`r\`, sitting in
263
- * the key direction \`w\`. \`soft\` is the blur of the lobe reflecting it.
264
- */
265
- float windowLobe(vec3 r, vec3 w, float soft, bool panes) {
266
- float facing = dot(r, w);
267
- if (facing <= 0.0) { return 0.0; }
268
- // Tangent frame around the window direction.
269
- vec3 ax = normalize(cross(w, vec3(0.0, 0.0, 1.0)));
270
- vec3 ay = cross(w, ax);
271
- vec2 q = vec2(dot(r, ax), dot(r, ay)) / facing;
272
- vec2 half_ = vec2(0.26, 0.42);
273
- vec2 cov = smoothstep(half_ + soft, half_ - soft, abs(q));
274
- float win = cov.x * cov.y;
275
- if (panes) {
276
- // Mullions: two columns, three rows. The grid is what makes a bright
277
- // patch read as a window and the surface as glass.
278
- float bar = 0.018;
279
- float mx = 1.0 - smoothstep(bar, bar + soft, abs(q.x));
280
- float my = 1.0 - smoothstep(bar, bar + soft, abs(abs(q.y) - 0.14));
281
- win *= 1.0 - 0.85 * max(mx, my);
282
- }
283
- return win;
284
- }
285
-
286
- void main(){
287
- vec2 p=vLocal.xy;
288
- vec3 n=normalize(vNormal);
289
- float front=smoothstep(0.0,2.0,vLocal.z);
290
- float aaPx=max(fwidth(p.x),fwidth(p.y))*0.75;
291
- vec4 extras=extrasOver(p,uDeep*0.55,uBody,aaPx)*front;
292
- vec3 light = normalize(uLight);
293
- vec3 view = vec3(0.0, 0.0, 1.0);
294
- // 1 at the thick centre, 0 at the rim.
295
- float ndv = clamp(n.z, 0.0, 1.0);
296
-
297
- // Wavelength-dependent absorption keeps thick gel saturated and its rim clear.
298
- vec3 skin=mix(uBody,vec3(1.0),0.18);
299
- vec3 sigma=-log(max(uBody,0.025)/max(skin,0.026));
300
- float side=clamp(-dot(n.xy,light.xy),-1.0,1.0);
301
- float chord=ndv*(1.3+0.4*side);
302
- vec3 gel=skin*exp(-sigma*chord*1.6);
303
- float wrap=clamp((dot(n,light)+0.6)/1.6,0.0,1.0);
304
- vec3 col=mix(uDeep*0.5,gel,0.42+wrap*0.58)*(0.75+wrap*0.35);
305
- // A soft transmitted lobe brightens the side opposite the key light.
306
- float transmitted=pow(max(dot(n,normalize(vec3(-light.xy,0.45))),0.0),5.0);
307
- col+=mix(uBody,uTip,0.4)*transmitted*(0.32+0.55*(1.0-ndv));
308
- vec3 refracted=refract(-view,n,1.0/1.36);
309
- float focus=pow(max(dot(normalize(vec3(-refracted.xy,ndv)),light),0.0),12.0);
310
- col+=uBody*focus*0.28;
311
-
312
- // Soft, restrained studio reflections follow the deformed surface normal.
313
- float f0=0.023;
314
- float fres=f0+(1.0-f0)*pow(1.0-ndv,5.0);
315
- vec3 r=reflect(-view,n);
316
- float windowHdr=5.0;
317
- vec3 room=mix(vec3(0.075,0.07,0.1),vec3(0.65,0.68,0.73),smoothstep(-0.8,0.8,-r.y));
318
- float key=windowLobe(r,light,0.11,false);
319
- float fill=windowLobe(r,normalize(vec3(0.85,0.12,0.35)),0.14,false);
320
- vec3 coat=vec3(1.0)*key*(0.12+fres*0.24);
321
- vec3 reflection=room*fres*0.24+coat+vec3(0.65,0.84,1.0)*fill*(0.05+fres*0.12);
322
- reflection+=uTip*pow(1.0-ndv,7.0)*0.06;
323
- reflection=1.0-exp(-reflection*1.8);
324
- col=col*(1.0-fres*0.45)+reflection;
325
- // Approximate transmission into the host background; the shared canvas does
326
- // not sample DOM pixels, so this deliberately avoids claiming scene refraction.
327
- float clarity=mix(0.55,0.24,smoothstep(0.0,0.85,ndv))*uClarity;
328
- float alpha=min(1.0,1.0-clarity+lum(reflection)*0.65);
329
- vec4 acc=vec4(min(col,vec3(1.0))*alpha,alpha);
330
-
331
- // ─── eye, in the gel ───────────────────────────────────────────────────────
332
- float phase = fract(uTime / 5.4);
333
- float blink = smoothstep(0.955, 0.972, phase) - smoothstep(0.972, 0.99, phase);
334
- vec2 ep = p - eyeCentre();
335
- ep.y /= max(1.0 - blink, 0.06);
336
- float er = uEye.z * 1.35;
337
- float aa = er * 0.06;
338
- // A soft dark socket under the lens, as if it sits a little inside the gel.
339
- acc.rgb *= mix(1.0, mix(0.7, 1.0, smoothstep(er * 0.95, er * 1.4, length(ep))), front);
340
-
341
- float lens = smoothstep(er + aa, er - aa, length(ep)) * front;
342
- if (lens > 0.0) {
343
- // ─── glass eye ─────────────────────────────────────────────────────────
344
- // The lens is a dome set into the gel and the pupil a dark glass bead on
345
- // it: each has its own hemisphere normal and is shaded like the body —
346
- // window reflection, Fresnel rim, a little light leaking through the
347
- // bead's far side — rather than painted flat.
348
- vec2 el = ep / er;
349
- float ez = sqrt(max(0.0, 1.0 - dot(el, el)));
350
- vec3 en = rotateCoat(vec3(el, ez));
351
- float ndlE = max(dot(en, light), 0.0);
352
- // Sclera: milky glass, darker where the dome meets the socket.
353
- vec3 eyeCol = vec3(0.93, 0.94, 0.97) * (0.62 + 0.38 * ndlE) * mix(0.55, 1.0, smoothstep(0.0, 0.5, ez));
354
-
355
- vec2 pupilAt = uGaze * er * 0.45;
356
- float pr = er * 0.42;
357
- vec2 pl = (ep - pupilAt) / pr;
358
- float pz = sqrt(max(0.0, 1.0 - dot(pl, pl)));
359
- vec3 pn = vec3(pl, pz);
360
- float pupil = smoothstep(pr + aa, pr - aa, length(ep - pupilAt));
361
- if (pupil > 0.0) {
362
- vec3 bead = mix(vec3(0.05, 0.04, 0.10), vec3(0.16, 0.13, 0.24), pow(1.0 - pz, 2.0));
363
- // The bead is transparent too: light entering at the top leaves at the
364
- // bottom edge, warmed by the iris.
365
- float leak = pow(max(dot(pn, normalize(vec3(-light.xy, 0.2))), 0.0), 4.0) * (1.0 - pz);
366
- bead += mix(uTip, vec3(1.0), 0.4) * leak * 0.55;
367
- vec3 pr_ = reflect(-view, pn);
368
- float pf = 0.03 + 0.97 * pow(1.0 - pz, 5.0);
369
- // A bead this small would show the window as a speck; a flatter
370
- // reflection normal spreads it to the broad soft patch a glass eye has.
371
- vec3 prw = reflect(-view, normalize(vec3(pl * 0.4, pz)));
372
- vec3 pref = (mix(vec3(0.12), vec3(0.6), smoothstep(-0.7, 0.9, -pr_.y)) * pf * 2.0)
373
- + vec3(1.0) * windowLobe(prw, light, 0.1, true) * windowHdr * (0.05 + pf * 0.5);
374
- bead += 1.0 - exp(-pref);
375
- eyeCol = mix(eyeCol, min(bead, vec3(1.0)), pupil);
376
- }
377
-
378
- // Wet skin over the whole lens.
379
- vec3 er_ = reflect(-view, en);
380
- float ef = 0.022 + 0.978 * pow(1.0 - ez, 5.0);
381
- vec3 lensRef = vec3(0.7, 0.72, 0.8) * ef * 1.6
382
- + vec3(1.0) * windowLobe(er_, light, 0.06, true) * windowHdr * (0.02 + ef * 0.3);
383
- eyeCol += 1.0 - exp(-lensRef);
384
-
385
- acc.rgb = acc.rgb * (1.0 - lens) + min(eyeCol, vec3(1.0)) * lens;
386
- acc.a = acc.a * (1.0 - lens) + lens;
387
- }
388
-
389
- // Decals sit in the gel: slightly softened by the coat's own alpha, and the
390
- // wet skin's reflection lies over them.
391
- float da = extras.a * 0.92;
392
- acc.rgb = acc.rgb * (1.0 - da) + (extras.rgb + coat * extras.a * 0.5) * 0.92;
393
- acc.a = acc.a * (1.0 - da) + da;
394
-
395
- vec4 goggles = gogglesOver(p, aaPx, front);
396
- outColor = goggles + acc * (1.0 - goggles.a);
397
- }
398
- `,L=8,R=256;function oe(e,t,n,r,i){let a=-Math.sin(n[0]),o=Math.cos(n[0])*Math.sin(n[1]),s=Math.cos(n[0])*Math.cos(n[1]),c=1/0,l=-1/0;for(let t=0;t<e.length;t+=L){let n=e[t]*a+e[t+1]*o+e[t+2]*s;c=Math.min(c,n),l=Math.max(l,n)}i.fill(0);let u=255/Math.max(l-c,.001);for(let t=0;t<r.length;t++){let n=t*L,l=e[n]*a+e[n+1]*o+e[n+2]*s,d=Math.min(255,Math.max(0,Math.floor((l-c)*u)));r[t]=d,i[d]++}let d=0;for(let e=0;e<R;e++){let t=i[e];i[e]=d,d+=t}for(let n=0;n<r.length;n++){let a=i[r[n]]++*L;for(let r=0;r<L;r++)t[a+r]=e[n*L+r]}}function se(e){return{roots:e,sorted:new Float32Array(e.length),buckets:new Uint16Array(e.length/L),counts:new Uint32Array(R),yaw:NaN,pitch:NaN}}function ce(e){let t=M(e),n=781,r=()=>(n=(n*1664525+1013904223)%4294967296,n/4294967296),i=[],a=Math.min(200,Math.max(10,e.density))**2/4e3,o=t.vertices;for(let e=0;e<o.length;e+=18){let t=[o[e+6]-o[e],o[e+7]-o[e+1],o[e+8]-o[e+2]],n=[o[e+12]-o[e],o[e+13]-o[e+1],o[e+14]-o[e+2]],s=Math.hypot(t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0])*.5*a,c=Math.floor(s)+ +(r()<s%1);for(let t=0;t<c;t++){let t=Math.sqrt(r()),n=r(),a=[1-t,t*(1-n),t*n],s=Array.from({length:6},(t,n)=>a.reduce((t,r,i)=>t+r*o[e+i*6+n],0)),c=Math.hypot(s[3],s[4],s[5]);i.push(s[0],s[1],s[2],s[3]/c,s[4]/c,s[5]/c,r(),r())}}return new Float32Array(i)}function z(e,t){let n=new Map,r=e.getAttribLocation(t,`aRoot`),i=e.getAttribLocation(t,`aNormal`),a=e.getAttribLocation(t,`aRandom`);return{draw(t){let o=`${A(t)}:${t.density}`,s=n.get(o);if(!s){let r=e.createBuffer();if(!r)throw Error(`engenty: strand allocation failed`);let i=ce(t);if(e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,i,e.DYNAMIC_DRAW),s={buffer:r,count:i.length/8,order:se(i)},n.set(o,s),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,s.buffer);let c=t.turn??[0,0],l=s.order;(l.yaw!==c[0]||l.pitch!==c[1])&&(oe(l.roots,l.sorted,c,l.buckets,l.counts),e.bufferSubData(e.ARRAY_BUFFER,0,l.sorted),l.yaw=c[0],l.pitch=c[1]);for(let[t,n,o]of[[r,3,0],[i,3,12],[a,2,24]])e.enableVertexAttribArray(t),e.vertexAttribPointer(t,n,e.FLOAT,!1,32,o),e.vertexAttribDivisor(t,1);e.drawArraysInstanced(e.TRIANGLE_STRIP,0,18,s.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}var B=`${y}
399
- in vec3 aRoot;
400
- in vec3 aNormal;
401
- in vec2 aRandom;
402
- out vec3 vColor;
403
- out float vAcross;
404
- out float vCoverage;
405
- void main(){
406
- float t=float(gl_VertexID/2)/8.0;
407
- float side=float(gl_VertexID%2)*2.0-1.0;
408
- float eyeDistance=length(aRoot.xy-uEye.xy);
409
- float front=smoothstep(0.0,2.0,aRoot.z);
410
- float eyeAngle=atan(aRoot.y-uEye.y,aRoot.x-uEye.x);
411
- float rim=uEye.z*1.35;
412
- float fringe=sin(eyeAngle*19.0)*0.025+sin(eyeAngle*37.0)*0.015;
413
- float socket=mix(1.0,smoothstep(rim*(0.88+fringe),rim*(1.08+fringe),eyeDistance),front);
414
- socket=mix(socket,mix(1.0,smoothstep(rim*1.22,rim*1.4,eyeDistance),front),uGoggles);
415
- float bandY=aRoot.y-uEye.y+1.7*pow((aRoot.x-uEye.x)/max(uScale,1.0),2.0);
416
- float strap=(1.0-smoothstep(uEye.z*0.3,uEye.z*0.5,abs(bandY)))*uGoggles*smoothstep(0.5,6.0,-sdBody(aRoot.xy));
417
- // Compress the pile only on the facing surface; side tufts cover strap ends.
418
- strap*=smoothstep(0.45,0.8,abs(aNormal.z));
419
- float underfur=1.0-step(0.36,aRandom.x);
420
- float len=uFur*mix(0.55+aRandom.x*0.55,0.3+aRandom.x*0.5,underfur)*socket*(1.0-strap*0.75);
421
- vec3 tangent=normalize(cross(aNormal,abs(aNormal.y)>0.9?vec3(1.0,0.0,0.0):vec3(0.0,1.0,0.0)));
422
- vec3 flow=aNormal*0.95+tangent*(aRandom.y-0.5)*0.5+vec3(0.04,0.12,0.0);
423
- float nearEye=front*(1.0-smoothstep(rim, rim*1.5,eyeDistance));
424
- flow.xy-=normalize(aRoot.xy-uEye.xy+vec2(0.001))*nearEye*0.7;
425
- float wave=sin(uTime*1.8+aRoot.y*0.09+aRandom.x*TAU);
426
- vec3 bend=vec3(wave*uWind*0.12,0.07+aRandom.y*0.12,0.0);
427
- vec3 centre=poseCoat(aRoot+len*(flow*t+bend*t*t));
428
- vec3 direction=rotateCoat(flow+2.0*bend*t);
429
- vec2 across=normalize(vec2(-direction.y,direction.x)+vec2(0.00001));
430
- float radius=uThick*(0.1+aRandom.y*0.09)*mix(1.0,1.8,underfur)*pow(1.0-t,0.8);
431
- float pixel=VIEW/uResolution.x/coatZoom();
432
- centre.xy+=across*side*max(radius,pixel*0.7);
433
- gl_Position=projectCoat(centre);
434
- vec3 n=normalize(rotateCoat(aNormal/bodyStretch()));
435
- float lit=max(dot(n,normalize(uLight)),0.0);
436
- vColor=mix(uDeep,uBody,0.52+t*0.48)*(0.6+lit*0.65);
437
- vColor+=uTip*pow(1.0-abs(n.z),3.0)*(0.08+t*0.22);
438
- vColor*=0.82+aRandom.y*0.32;
439
- vColor+=vec3(0.08)*pow(lit,12.0)*t;
440
- vAcross=side;
441
- vCoverage=min(1.0,radius/(pixel*0.7))*socket*(1.0-strap*0.85);
442
- }
443
- `,V=`#version 300 es
444
- precision highp float;
445
- in vec3 vColor;
446
- in float vAcross;
447
- in float vCoverage;
448
- out vec4 outColor;
449
- void main(){
450
- float alpha=(1.0-smoothstep(0.35,1.0,abs(vAcross)))*vCoverage;
451
- if(alpha<0.025)discard;
452
- outColor=vec4(vColor*alpha,alpha);
453
- }
454
- `;function H(e,t){let n=new Map,r=e.getAttribLocation(t,`aPosition`),i=e.getAttribLocation(t,`aNormal`);return{draw(t){let a=A(t),o=n.get(a);if(!o){let r=e.createBuffer();if(!r)throw Error(`engenty: body allocation failed`);let i=M(t);if(e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,i.vertices,e.STATIC_DRAW),o={buffer:r,count:i.vertices.length/6},n.set(a,o),n.size>24){let t=n.entries().next().value;t&&(e.deleteBuffer(t[1].buffer),n.delete(t[0]))}}e.bindBuffer(e.ARRAY_BUFFER,o.buffer);for(let[t,n]of[[r,0],[i,12]])e.enableVertexAttribArray(t),e.vertexAttribPointer(t,3,e.FLOAT,!1,24,n);e.drawArrays(e.TRIANGLES,0,o.count)},dispose(){for(let t of n.values())e.deleteBuffer(t.buffer);n.clear()}}}function U(e,t){let n=D(e,t===`fur`?ae:I,{vertex:t===`fur`?P:P.replace(`#version 300 es`,`#version 300 es
455
- #define JELLY_COAT`),geometry:H});if(!n)return null;let r=[n];if(t===`fur`){let t=D(e,V,{vertex:B,geometry:z,clear:!1,doubleSided:!0,depthWrite:!1});if(!t)return n.dispose(),null;r.push(t)}let i=D(e,C,{vertex:S,geometry:x,clear:!1});if(!i){for(let e of r)e.dispose();return null}r.push(i);let a=D(e,ie,{vertex:t===`jelly`?N.replace(`#version 300 es`,`#version 300 es
456
- #define JELLY_COAT`):N,geometry:re,clear:!1});if(!a){for(let e of r)e.dispose();return null}return r.push(a),{render(e){for(let t of r)t.render(e)},viewport(e){for(let t of r)t.viewport(e)},dispose(){for(let e of r)e.dispose()}}}var W=new Map,G=new Set;function le(e){if(G.has(e)||typeof document>`u`)return null;let t=document.createElement(`canvas`);t.width=1,t.height=1;let n=U(t,e);return n?(t.addEventListener(`webglcontextlost`,t=>{t.preventDefault(),W.delete(e)}),{canvas:t,refs:0,renderer:n,size:0}):(G.add(e),null)}function ue(e=`fur`){let t=W.get(e);if(!t){let n=le(e);if(!n)return null;W.set(e,n),t=n}let n=t;n.refs+=1;let r=!1;return{drawInto(t,i,a){if(r||W.get(e)!==n)return;let o=i;o>n.size&&(n.size=o,n.canvas.width=o,n.canvas.height=o),n.renderer.viewport(o),n.renderer.render(a),t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(n.canvas,0,n.canvas.height-o,o,o,0,0,t.canvas.width,t.canvas.height)},release(){r||(r=!0,--n.refs,n.refs<=0&&W.get(e)===n&&(n.renderer.dispose(),W.delete(e)))}}}var K=Math.PI/18;function q(e,t){let n=K/Math.max(1,Math.hypot(e,t));return[e*n,t===0?0:-t*n]}function J(e,t,n){if(n<=0)return;let r=3.8,i=Math.sqrt(110-r*r),a=Math.exp(-3.8*n),o=Math.cos(i*n),s=Math.sin(i*n);for(let[n,c,l]of[[`x`,`vx`,t[0]],[`y`,`vy`,t[1]]]){let t=e[n]-l,u=e[c];e[n]=l+a*(t*o+(u+r*t)/i*s),e[c]=a*(u*o-(r*u+110*t)/i*s)}}function de(e,t){let n={x:0,y:0,vx:0,vy:0},r=[60,60],i=null,a=[0,0],o=!1,s=n=>{if(!t()||n.button!==0||i!==null)return;let s=e.getBoundingClientRect(),c=(n.clientX-s.left)/s.width*152+-16,l=(n.clientY-s.top)/s.height*152+-16;Math.hypot(c-60,l-60)>48||(r[0]=c,r[1]=l,a=[n.clientX,n.clientY],i=n.pointerId,o=!1,e.setPointerCapture(i))},c=r=>{if(r.pointerId!==i)return;if(!t()){l(r);return}let s=e.getBoundingClientRect(),c=(r.clientX-a[0])/s.width*152,u=(r.clientY-a[1])/s.height*152,d=Math.min(1,18/(Math.hypot(c,u)||1));n.x=c*d,n.y=u*d,n.vx=0,n.vy=0,o||=Math.hypot(r.clientX-a[0],r.clientY-a[1])>4},l=t=>{t.pointerId===i&&(i=null,e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId))},u=e=>{o&&=(e.preventDefault(),e.stopPropagation(),!1)};return e.addEventListener(`pointerdown`,s),e.addEventListener(`pointermove`,c),e.addEventListener(`pointerup`,l),e.addEventListener(`pointercancel`,l),e.addEventListener(`lostpointercapture`,l),e.addEventListener(`click`,u,!0),{step(e){return i===null&&J(n,[0,0],e),[r[0],r[1],n.x,n.y]},dispose(){i!==null&&e.hasPointerCapture(i)&&e.releasePointerCapture(i),e.removeEventListener(`pointerdown`,s),e.removeEventListener(`pointermove`,c),e.removeEventListener(`pointerup`,l),e.removeEventListener(`pointercancel`,l),e.removeEventListener(`lostpointercapture`,l),e.removeEventListener(`click`,u,!0)}}}var Y={x:0,y:0},X=new Set,Z=!1;function fe(e){Y.x=e.clientX,Y.y=e.clientY;for(let e of X)e()}function pe(){return Y}function me(e){return!Z&&typeof window<`u`&&(Z=!0,Y.x=window.innerWidth*.62,Y.y=window.innerHeight*.28,window.addEventListener(`pointermove`,fe,{passive:!0})),X.add(e),()=>{X.delete(e)}}var Q=e(n(),1),he={high:{density:68,dprCap:2,thick:1},low:{density:40,dprCap:1,thick:1.15},medium:{density:55,dprCap:1.5,thick:1.05}},ge=1.7,$=0,_e=2.399963,ve=[-.42,-.72,.75],ye=30,be=.5,xe=e=>(e- -16)/152*100;function Se({className:e,motion:t=`auto`,animationSpeed:n=1,turn:i,coat:a=`fur`,goggles:c=!1,interactive:d=!0,look:p=null,kind:m=`round`,overrides:h,quality:g=`high`,size:_=260}){let v=(0,f.useRef)(null),y=(0,f.useRef)(null),b=(0,f.useRef)(0);b.current===0&&($+=1,b.current=$*_e);let x=(0,f.useRef)(null),[S,C]=(0,f.useState)(!0),T=o[m],E=(0,f.useMemo)(()=>s(T),[T]),D=(0,f.useMemo)(()=>l(T),[T]),O=(0,f.useMemo)(()=>r(T),[T]),k=(0,f.useRef)({animationSpeed:n,motion:t,turn:i,goggles:c,blobs:E,extras:D,form:T,interactive:d,kind:m,look:p,overrides:h,quality:g,scale:O,size:_});return k.current={animationSpeed:n,motion:t,turn:i,goggles:c,blobs:E,extras:D,form:T,interactive:d,kind:m,look:p,overrides:h,quality:g,scale:O,size:_},(0,f.useEffect)(()=>{v.current?.()},[m,h,g,_,d,p,c,t,n,i]),(0,f.useEffect)(()=>{let e=y.current,t=x.current;if(!(e&&t))return;let n=e.getContext(`2d`),r=n?ue(a):null;if(!(n&&r)){C(!1);return}let i=b.current,o=window.matchMedia(`(prefers-reduced-motion: reduce)`),s={x:0,y:0},c={x:0,y:0},l={vx:0,vy:0,x:0,y:0},u=0,d=!0,f=0,p=0,m=a===`jelly`?de(t,()=>k.current.interactive&&k.current.motion!==`pause`&&(k.current.motion===`play`||!o.matches)):null,h=g=>{u=0;let _=k.current,v=he[_.quality],y=_.motion===`pause`||_.motion===`auto`&&o.matches,b=y?0:Math.min((g-(p||g))/1e3,.1);f+=b*Math.max(.1,Math.min(2,_.animationSpeed)),p=g;let x=Math.min(window.devicePixelRatio||1,v.dprCap),S=Math.max(1,Math.round(_.size*x));e.width!==S&&(e.width=S,e.height=S);let C=120*S/(ge*152),T=_.overrides?.fur??_.form.fur;if((_.interactive||_.look)&&!y){let e,n,r,i;if(_.look)e=_.look.x,n=_.look.y,r=Math.hypot(e,n)||1,i=Math.min(1,r);else{let a=t.getBoundingClientRect(),o=pe();e=o.x-(a.left+a.width*.5),n=o.y-(a.top+a.height*.48),r=Math.hypot(e,n)||1,i=.35+Math.min(1,r/(a.width*2.4||1))*.65}s.x+=(e/r*5.5*i-s.x)*.16,s.y+=(n/r*3.5*i-s.y)*.16,c.x+=(e/r*i-c.x)*.24,c.y+=(n/r*.9*i-c.y)*.24}J(l,[s.x,s.y],b*Math.max(.1,Math.min(2,_.animationSpeed)));let E=ee(t,_.kind);r.drawInto(n,S,{blobs:_.blobs,clarity:_.overrides?.clarity??w.clarity,softness:_.overrides?.softness??w.softness,pull:m?.step(b*Math.max(.1,Math.min(2,_.animationSpeed))),body:E.body,deep:E.deep,density:Math.min(_.overrides?.density??v.density,C),extraMeta:_.extras.meta,extras:_.extras.geometry,eye:[_.form.eye.x,_.form.eye.y,_.form.eye.r],gaze:[c.x,c.y],goggles:_.goggles,turn:_.turn?q(_.turn.yaw/K,_.turn.pitch/K):q(c.x,c.y),fur:T,inflate:_.overrides?.inflate??(a===`jelly`?w.inflate:ye),lean:[s.x,s.y],light:ve,period:_.form.period,scale:_.scale,falloff:_.form.falloff,thick:_.overrides?.thick??v.thick,time:f+i,tip:E.tip,wind:_.overrides?.wind??be,wobble:[l.x-s.x,l.y-s.y]}),d&&!y&&(u=requestAnimationFrame(h))},g=()=>{u||=(p=0,requestAnimationFrame(h))},_=new IntersectionObserver(([e])=>{d=e?.isIntersecting??!0,d?g():u&&=(cancelAnimationFrame(u),0)},{rootMargin:`120px`});_.observe(t),v.current=g;let S=me(g);return o.addEventListener(`change`,g),g(),()=>{v.current=null,_.disconnect(),m?.dispose(),S(),o.removeEventListener(`change`,g),u&&cancelAnimationFrame(u),r.release()}},[a]),S?(0,Q.jsxs)(`div`,{"aria-hidden":`true`,className:e,ref:x,style:{height:_,position:`relative`,width:_},children:[(0,Q.jsx)(`div`,{style:{background:`radial-gradient(closest-side, rgb(0 0 0 / 0.2), transparent)`,filter:`blur(4px)`,height:`${T.shadowRx*50/152}%`,left:`50%`,position:`absolute`,top:`${xe(110)}%`,transform:`translate(-50%, -50%)`,width:`${T.shadowRx*2.5*100/152}%`}}),(0,Q.jsx)(`canvas`,{ref:y,style:{display:`block`,height:_,width:_,touchAction:a===`jelly`&&d&&t!==`pause`?`none`:void 0,cursor:a===`jelly`&&d?`grab`:void 0}})]}):(0,Q.jsx)(u,{className:e,goggles:c,kind:m,size:_})}export{Se as FluffyEngenty};