@descix/frqtl-web 0.6.0 → 0.6.1-p2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@ comes out of local per-pixel rules — a frame moves one pixel per tick, single
5
5
  rather than force equations. Interference, blackbody spectra and atom-like binding emerge from the
6
6
  automaton.
7
7
 
8
- `0.6.0` (npm dist-tag `latest`). The node twin is `@descix/frqtl-node` — the same
8
+ `0.6.1-p2.1` (npm dist-tag `next`). The node twin is `@descix/frqtl-node` — the same
9
9
  modules, built from the same source.
10
10
 
11
11
  ## Install
@@ -110,7 +110,7 @@ No build step: load `dist/frqtl-web.min.js` with a `<script>` tag and call `FRQT
110
110
  (`FRQTL.Wall`, `FRQTL.SphereEmitter`, …). A min.js page owns only `FRQTL` (and the booted page's
111
111
  `FrqtlPage` seam); bind parts however you like. A page that uses ES modules without a bundler renders its
112
112
  import map from the package's own table: `importMapFor('<dist root URL>/')` (`./project`); a host page that also
113
- imports `./boot`, `./registry`, `./project` or `./host-view` by specifier renders `pageImportMapFor('<dist root URL>/')`;
113
+ imports `./boot`, `./registry`, `./project`, `./host-view` or `./site-graph` by specifier renders `pageImportMapFor('<dist root URL>/')`;
114
114
  it has no manifest row, so read the manifest from the same root: `new URL('dist-manifest.json', root)`. A page that holds only its map
115
115
  recovers the root through `FRQTL_WEB_HOST_SPECIFIERS` (`./project`): `imports[row.specifier]` minus `row.libPath`. The root is an absolute URL or starts with `/`, `./` or `../`
116
116
  (any other root is refused: a browser ignores its rows). `sketchProject(text)` (`./project`) is the one-file
@@ -119,7 +119,8 @@ project of a sketch held as text, for `bootProject(mount, sketchProject(text))`.
119
119
  A DeSciX app asks its shell for a view once, under its own policy: `declareHostView({ sdk: window.DeSciX, mode,
120
120
  fallback })` (`./host-view`), then reads the outcome from `document.documentElement.dataset.descixView` — a row of
121
121
  `HOST_VIEW_OUTCOMES` (`requested:<mode>`, `fallback:<mode>` when the shell's published `view.MODES` lacks `mode` and
122
- offers the optional `fallback`, `unoffered:<mode>`, …), the detail in `dataset.descixViewDetail`. The app vendors
122
+ offers the optional `fallback`, `unoffered:<mode>`, …), the detail in `dataset.descixViewDetail`. A `fallback` must
123
+ differ from `mode`: `declareHostView` throws a TypeError when they are the same string. The app vendors
123
124
  `HOST_SDK_SCRIPT` beside its page.
124
125
 
125
126
  String kinds — `exp.addObject('Wall', props)` — resolve in the SCENE's realm. A host driving a scene in
@@ -134,9 +135,10 @@ into its own document, where no kind is registered.
134
135
  | `./boot` | `bootScene`, `bootProject` (in node it throws, naming `@descix/frqtl-node`) |
135
136
  | `./parts`, `./parts/*` | the parts barrel; one part = one file |
136
137
  | `./project` | `FRQTL_WEB_SPECIFIERS`, `libPathOf`, `importMapFor`, `pageImportMapFor`, `FRQTL_WEB_HOST_SPECIFIERS`, `linkProject`, `sketchProject`, `SKETCH_ENTRY`, `projectIdentity`, `MANIFEST_FILE`, `MANIFEST_KEYS`, `normalizeManifest`, `parseManifest`, `serializeManifest`, `manifestFor`, `RECORD_FILES`, `RECORD_KEYS`, `CHANGE_KEYS`, `OPS`, `BY`, `CLIP_SECONDS`, `CLIP_NAME`, `clipName`, `jsonText`, `recordFolderFaults` |
137
- | `./registry` | the walk-through rungs, the showcase roster, the scene list (`sceneGroups`), `projectOf` |
138
+ | `./registry` | the walk-through rungs, the showcase roster, the scene list (`sceneGroups`), `projectOf`, a showcase tile's link (`showcaseHref(row)` relative to the serving site, `showcaseUrl(row)` absolute on `SHOWCASE_SITE.origin`; `row` is an element of the same imported `EXHIBITS`, and the link carries the row's effective mode on a multi-mode rung), and how STUDIO resolved the link it opened with (`STUDIO_LANDING_ATTR` on `<html>`, a `STUDIO_LANDING_OUTCOMES` id) |
138
139
  | `./kinds` | `registerKind`, `kindNamed`, `kindOf`, `registeredKinds` — the kind registry a composed fork registers in |
139
140
  | `./host-view` | `declareHostView`, `HOST_VIEW_OUTCOMES`, `CONTRACT_VIOLATIONS`, `HOST_SDK_SCRIPT` — the DeSciX host-view declarer an app calls under its own policy (below) |
141
+ | `./site-graph` | `SITE_GRAPH_DIR`, `SITE_BUILD_ATTR`, `SITE_BUILD_ID_RE`, `STATIC_APP_PAGE`, `HOST_PROVIDED_ATTR` — the static site's shape (graph directory, build-stamp attribute, build id pattern, IDE entry page, the attribute declaring a file host-provided), for a reader of a served site (both packages) |
140
142
  | `./shim/controls/registry.js`, `./shim/render/sun-look.js`, `./compat/renderer/display-slot.js`, `./compat/renderer/orbit-bag.js`, `./objects/setup/_collisionMatrixLanes.js`, `./compat/engine.js` | the six non-part modules a scene may import (the rows of `FRQTL_WEB_SPECIFIERS`) |
141
143
  | `./objects/objects/tagger.js`, `./objects/schema/index.js`, `./shim/render/heat-colormap.js`, `./objects/schema/valueNormalizer.js`, `./objects/objects/Box.js`, `./objects/objects/QuantumEmitter.js`, `./shim/expr/ast-schema.js`, `./objects/objects/actionCompiler.js`, `./objects/v1-replacements.js`, `./objects/objects/slitLinerScatter.js`, `./objects/setup/setupSphereEmitter3D.js`, `./objects/objects/directedRedirectProgram.js`, `./compat/renderer/lo-drawn-center.js`, `./objects/setup/setupTunnelPointExit.js`, `./objects/constants/WallBehaviors.js`, `./objects/objects/absorbRadiation.js`, `./objects/geometry/SlabFace.js` | the 17 part-internal modules a forked part file imports (the `tier: 'part-internal'` rows of `FRQTL_WEB_SPECIFIERS`): not a scene API — the linker admits them only from a `parts/*.js` file — and they move with the parts |
142
144
  | `./dist-manifest.json` | sha256 of every dist file |
@@ -17,7 +17,7 @@
17
17
  <body>
18
18
  <div id="frqtl-status" data-role="frqtl-artifact-status">booting FRQTL…</div>
19
19
  <div id="frqtl-mount" data-role="frqtl-artifact-mount"></div>
20
- <script type="importmap">{"imports":{"@descix/frqtl-web/parts":"../frqtl/parts/index.js","@descix/frqtl-web/parts/":"../frqtl/parts/","@descix/frqtl-web/shim/controls/registry.js":"../shim/controls/registry.js","@descix/frqtl-web/shim/render/sun-look.js":"../shim/render/sun-look.js","@descix/frqtl-web/compat/renderer/display-slot.js":"../frqtl/compat/renderer/display-slot.js","@descix/frqtl-web/compat/renderer/orbit-bag.js":"../frqtl/compat/renderer/orbit-bag.js","@descix/frqtl-web/objects/setup/_collisionMatrixLanes.js":"../frqtl/objects/setup/_collisionMatrixLanes.js","@descix/frqtl-web/compat/engine.js":"../frqtl/compat/engine.js","@descix/frqtl-web/kinds":"../frqtl/objects/kinds-entry.js","@descix/frqtl-web/objects/objects/tagger.js":"../frqtl/objects/objects/tagger.js","@descix/frqtl-web/objects/schema/index.js":"../frqtl/objects/schema/index.js","@descix/frqtl-web/shim/render/heat-colormap.js":"../shim/render/heat-colormap.js","@descix/frqtl-web/objects/schema/valueNormalizer.js":"../frqtl/objects/schema/valueNormalizer.js","@descix/frqtl-web/objects/objects/Box.js":"../frqtl/objects/objects/Box.js","@descix/frqtl-web/objects/objects/QuantumEmitter.js":"../frqtl/objects/objects/QuantumEmitter.js","@descix/frqtl-web/shim/expr/ast-schema.js":"../shim/expr/ast-schema.js","@descix/frqtl-web/objects/objects/actionCompiler.js":"../frqtl/objects/objects/actionCompiler.js","@descix/frqtl-web/objects/v1-replacements.js":"../frqtl/objects/v1-replacements.js","@descix/frqtl-web/objects/objects/slitLinerScatter.js":"../frqtl/objects/objects/slitLinerScatter.js","@descix/frqtl-web/objects/setup/setupSphereEmitter3D.js":"../frqtl/objects/setup/setupSphereEmitter3D.js","@descix/frqtl-web/objects/objects/directedRedirectProgram.js":"../frqtl/objects/objects/directedRedirectProgram.js","@descix/frqtl-web/compat/renderer/lo-drawn-center.js":"../frqtl/compat/renderer/lo-drawn-center.js","@descix/frqtl-web/objects/setup/setupTunnelPointExit.js":"../frqtl/objects/setup/setupTunnelPointExit.js","@descix/frqtl-web/objects/constants/WallBehaviors.js":"../frqtl/objects/constants/WallBehaviors.js","@descix/frqtl-web/objects/objects/absorbRadiation.js":"../frqtl/objects/objects/absorbRadiation.js","@descix/frqtl-web/objects/geometry/SlabFace.js":"../frqtl/objects/geometry/SlabFace.js","@descix/frqtl-web/boot":"../frqtl/experiments/_shared/doors.js","@descix/frqtl-web/registry":"../shim/registry/index.js","@descix/frqtl-web/project":"../shim/project/index.js","@descix/frqtl-web/host-view":"../shim/host/index.js"}}</script>
20
+ <script type="importmap">{"imports":{"@descix/frqtl-web/parts":"../frqtl/parts/index.js","@descix/frqtl-web/parts/":"../frqtl/parts/","@descix/frqtl-web/shim/controls/registry.js":"../shim/controls/registry.js","@descix/frqtl-web/shim/render/sun-look.js":"../shim/render/sun-look.js","@descix/frqtl-web/compat/renderer/display-slot.js":"../frqtl/compat/renderer/display-slot.js","@descix/frqtl-web/compat/renderer/orbit-bag.js":"../frqtl/compat/renderer/orbit-bag.js","@descix/frqtl-web/objects/setup/_collisionMatrixLanes.js":"../frqtl/objects/setup/_collisionMatrixLanes.js","@descix/frqtl-web/compat/engine.js":"../frqtl/compat/engine.js","@descix/frqtl-web/kinds":"../frqtl/objects/kinds-entry.js","@descix/frqtl-web/objects/objects/tagger.js":"../frqtl/objects/objects/tagger.js","@descix/frqtl-web/objects/schema/index.js":"../frqtl/objects/schema/index.js","@descix/frqtl-web/shim/render/heat-colormap.js":"../shim/render/heat-colormap.js","@descix/frqtl-web/objects/schema/valueNormalizer.js":"../frqtl/objects/schema/valueNormalizer.js","@descix/frqtl-web/objects/objects/Box.js":"../frqtl/objects/objects/Box.js","@descix/frqtl-web/objects/objects/QuantumEmitter.js":"../frqtl/objects/objects/QuantumEmitter.js","@descix/frqtl-web/shim/expr/ast-schema.js":"../shim/expr/ast-schema.js","@descix/frqtl-web/objects/objects/actionCompiler.js":"../frqtl/objects/objects/actionCompiler.js","@descix/frqtl-web/objects/v1-replacements.js":"../frqtl/objects/v1-replacements.js","@descix/frqtl-web/objects/objects/slitLinerScatter.js":"../frqtl/objects/objects/slitLinerScatter.js","@descix/frqtl-web/objects/setup/setupSphereEmitter3D.js":"../frqtl/objects/setup/setupSphereEmitter3D.js","@descix/frqtl-web/objects/objects/directedRedirectProgram.js":"../frqtl/objects/objects/directedRedirectProgram.js","@descix/frqtl-web/compat/renderer/lo-drawn-center.js":"../frqtl/compat/renderer/lo-drawn-center.js","@descix/frqtl-web/objects/setup/setupTunnelPointExit.js":"../frqtl/objects/setup/setupTunnelPointExit.js","@descix/frqtl-web/objects/constants/WallBehaviors.js":"../frqtl/objects/constants/WallBehaviors.js","@descix/frqtl-web/objects/objects/absorbRadiation.js":"../frqtl/objects/objects/absorbRadiation.js","@descix/frqtl-web/objects/geometry/SlabFace.js":"../frqtl/objects/geometry/SlabFace.js","@descix/frqtl-web/boot":"../frqtl/experiments/_shared/doors.js","@descix/frqtl-web/registry":"../shim/registry/index.js","@descix/frqtl-web/project":"../shim/project/index.js","@descix/frqtl-web/host-view":"../shim/host/index.js","@descix/frqtl-web/site-graph":"../shim/engine/site-graph.js"}}</script>
21
21
  <script>
22
22
  /* BOOT DEADLINE — lib/shim/engine/artifact-shell.js ARTIFACT_BOOT_DEADLINE_MS. */
23
23
  setTimeout(function () {
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@descix/frqtl-web",
3
- "version": "0.6.0",
3
+ "version": "0.6.1-p2.1",
4
4
  "files": {
5
- "artifact/double-slit.html": "dbd71a7eafff43355692ab026af48e65d490d52df356bea565d9a556c3725e4e",
5
+ "artifact/double-slit.html": "25d93abfd0961a5e063429395801160a599fbb8e92c774a3128d5b0ba4ac415a",
6
6
  "artifact/sun.html": "4ec3515a3a94553bb862a7894ecd43757004fd8087ba60ce97622a410b615383",
7
7
  "boot/node-refusal.js": "23ce7b8bb34fb86d19970b7e4275e463ae2963cf8a5c3b4ffe72bd6ff6261b47",
8
8
  "css/bootstrap.min.css": "3c8f27e6009ccfd710a905e6dcf12d0ee3c6f2ac7da05b0572d3e0d12e736fc8",
@@ -10,7 +10,7 @@
10
10
  "experiments/empty/index.html": "063a8a4b23c4242d67a20a442235c798f18fdea1a3a8aebb29872a88030c2e30",
11
11
  "fat/pkg-web/egpt_wasm.js": "4e9c3f04fcfe7b0a481dadd9a87f9bf76c6f34741ff1cdf57fecc2e76c56b8e5",
12
12
  "fat/pkg-web/egpt_wasm_bg.wasm": "e204498ac7439c294653476c0d214345713e6170819281b27bbbcba217a5a5e9",
13
- "frqtl-web.min.js": "e67059a0d53de5bc62ea8f515b3bc9a5db8ddfeb03c84e76bcd7ba8fd29d8471",
13
+ "frqtl-web.min.js": "d5fd8ec170797a99568234f4420f70897cc13a0a043f3e1a2ee22192db38adf0",
14
14
  "frqtl/assets/vendor/acorn.LICENSE": "76a876cf886ff9be2a8b5e2e86514fed06223c8c9f0c1e9ee9606e93841e00b7",
15
15
  "frqtl/assets/vendor/acorn.PINNED.json": "52d5c4cf628a586aec54f780ab6b8d22ae7c22cfb290d0d86c2f589f3106b101",
16
16
  "frqtl/assets/vendor/acorn.mjs": "efb0124a960b34d53f9928c4926bfcfd300bb6a3d7ab64ee949b3a8bed1c7e5f",
@@ -347,7 +347,7 @@
347
347
  "notebooks/stats.html": "360db52d77ef46c690e7c865a7ce672d5032b916a0a0796f6070d5f17b03132b",
348
348
  "notebooks/transcendentals.html": "1dfc5d40f0e3e6cccc785fb73d73ef82e24048d7affd10143370779ef2032b8c",
349
349
  "notebooks/view-vendored-d3.html": "debeeef830f8c328b3b6e13b0b8fe26021ba55802b89d8dbe78b8a0c6c002eac",
350
- "sdk.html": "a0819a160569c57bde307716013392f706d977969e51b074b3d46b31138464a0",
350
+ "sdk.html": "87986ac09292a6d1c8706f7405abee4031b6970030998f67eb3e18f108dfe3d5",
351
351
  "shim/bundle/index.js": "edc501a039ce47102657604df71fbc17ba3e4760ca087055351231c7469f5c50",
352
352
  "shim/bundle/indexHtml.js": "2c4fbc502bb33fce93596cee19e143a58bb63c18d0b18ea597f81610e3a9a027",
353
353
  "shim/bundle/zip.js": "00f7b5fb5f36ff40a59d86758c503d9d7fb43949c1b5a4f2e7367c43d92786f9",
@@ -357,13 +357,14 @@
357
357
  "shim/engine/artifact-shell.js": "f23c327500f8174b12d464868f6ec9c1701e7a9a5faa1c43a2ddafc3191dc38c",
358
358
  "shim/engine/boot-phases.js": "c6e12e12824bcf6f1a289f46e41c898a5416c80c131594525145aae9a3eefbfa",
359
359
  "shim/engine/engine-stack-boot.js": "0abf57dcff2ca2bb025c787a17875d49d54d9218ac08c78cb9c678dbb6118d08",
360
- "shim/engine/router.js": "bd6a6e7b8b670ea146e8789f333c88c8eb62cf40aeab1eec21706d76fbb3e02a",
360
+ "shim/engine/router.js": "2924f9dbdd690fc8703e1b3ad65900c323219919da1f838112513aa64e8e6bda",
361
+ "shim/engine/site-graph.js": "e787c875310ac6ca374c71ae41064b822d8e14ba59f357e7c71b2dcf8699dc70",
361
362
  "shim/experiment-frame/index.js": "5a0219aaa225d8f808c405b08623ce85ada37d83fb4f55f983db3303e431e47f",
362
363
  "shim/expr/ast-schema.js": "4f1133b887639bbd86fab976292323bf4a955cdc873ff7ca8e8a8eb3b416923f",
363
364
  "shim/field-descriptor/index.js": "6647d57d1523519114adc0a5cb66335ec5121c39ab294b9c97bdfb9e5d7f61e0",
364
365
  "shim/frame-data/index.js": "df6957b0b4a8e0ee0035bc970647b90089b421ae7f05911cc047d48457164be6",
365
- "shim/host/host-view.js": "e13619d3340118f81cde6d035dcb689fd72d9341c98c3e95afba911e978dda63",
366
- "shim/host/index.js": "67691951a7ff35b4baf7332987d0128d1eefd0ad185d2989674bea90b17c02f3",
366
+ "shim/host/host-view.js": "feec2f5fdc318e75cd01768c24891f85d2694a269696fcfffd9567d31983cf43",
367
+ "shim/host/index.js": "fade4b171218965570aa2e67e841920ebb3d972ff15e1cfa0394fd3fa123d82c",
367
368
  "shim/index.js": "96165c6161ffddbace0be0cde0b3a83943298531537dd2cc9c6e281b8274ff19",
368
369
  "shim/notebook/canvas-guard.js": "b19d3a86df3835bd617c7130cde997b6f8a8a0c140f95338b733115d5947ed7b",
369
370
  "shim/notebook/catalog.js": "68243a154e12bf36a76598aa554119f6e3b8b5363c8452d157c8a562b9c38dc1",
@@ -394,12 +395,14 @@
394
395
  "shim/project/parts-writer.js": "121fa67261d6f366190c9ac4961fceed2f26ca7f35cf3fbffc767829afc69978",
395
396
  "shim/project/read-text.js": "b89bd70e3a271e1f42c8ce9427a20cdd9a4c4c9c31b64c49ff1f56b095620136",
396
397
  "shim/project/record-format.js": "b680c3752f20535c08be832c6808fae000c2d2325f8caee57f98351043d091be",
397
- "shim/project/specifiers.js": "6a5ba9f91f97902d7b7911ecf9933dab743a99271b30ec4fb50a5d439d344add",
398
+ "shim/project/specifiers.js": "288e5e06e53b873449190f6f85855177a72e52623bd11eef016acafb8095d829",
398
399
  "shim/registry/copy-gate.js": "cfbf52669c849b8837b326f2743458f1ead0720cad51a6c6d409c9bd6c7f9495",
399
- "shim/registry/exhibits.js": "7ee132589bb4c003a06815f78d9e917ba81fd806111d1cee538345b7e5cc6345",
400
- "shim/registry/index.js": "f59357c81c4045c41bfd266a74931e5c21b2c6650ad60b80e8e21bc23699ca34",
400
+ "shim/registry/exhibits.js": "e137951429929dae6c38e996546b66dd19b575ee4f0aafbddf28096c847a27fc",
401
+ "shim/registry/index.js": "3a96c6b8790058663bb3157f6daecbcc199c2472d096b413e1766dd279832c05",
401
402
  "shim/registry/scene-roster.js": "318fe373f71b1c58d05425693f2fad4bd5368f6095b65817c6d637430a0bfb73",
402
403
  "shim/registry/scene-source.js": "c9c4b48c24d4b1ebee1549a7891a1ba708909b94b9403ce28eefbd902cacf49f",
404
+ "shim/registry/showcase-link.js": "daf5c1426aeb3c578bace5e0edea9ba2538cd82336d2cdc944e5fed6decd7551",
405
+ "shim/registry/studio-landing.js": "c34c9e7e77087c2bfa6be9c34dafedb1e3256e92eb1aeb629b7f7182cd2edf9f",
403
406
  "shim/registry/walkthrough.js": "8f8b6f59e9e81c67c9c62f8fb271eee2e4d6e1fba6e116b227a2f1e3f9930230",
404
407
  "shim/render-state/apply.js": "94a9e60cb1722c9a82aa00f2f161fd65e6f438147333856a786e42a4ad5b7064",
405
408
  "shim/render-state/index.js": "72a6a3dcd8037893cb8fbd7ef32b126770e7efaec70847f8e4f2915ddb690b43",
@@ -14,7 +14,7 @@ Build it with:
14
14
  `),hc=[.92,.72,1,.6,.86,.78];function Hg(e){return{color:e&&e.color||[200,200,200],alpha:e&&e.alpha!==void 0?e.alpha/255:1}}o(Hg,"loSkin");function mx(e){var t=Hg(e);return t.color.join(",")+"|"+t.alpha}o(mx,"loSkinSig");function gx(e,t){for(var r=Hg(t),i=Array.isArray(e)?e:[e],n=i.length===hc.length,a=0;a<i.length;a++){var s=i[a];if(s){var l=n?hc[a]:1;!s.map&&s.color&&typeof s.color.setRGB=="function"&&s.color.setRGB(r.color[0]/255*l,r.color[1]/255*l,r.color[2]/255*l);var c=s.map?!0:r.alpha<1;s.transparent!==c&&(s.transparent=c,s.needsUpdate=!0),s.opacity=r.alpha,s.depthWrite=r.alpha>=1}}return r}o(gx,"applyLoSkin");function hp(){var e=zi,t=ai,r=or,i=Za,n=os,a=n.universalRenderCapabilities(e,t,r).concat([e({name:"godrays",type:"number",unit:"intensity",default:0,constraint:{min:0,max:3,integer:!1},description:"God-rays post-process composite intensity (three-only final-composite layer)."}),e({name:"godrayDensity",type:"number",unit:"density",default:.8,constraint:{min:.2,max:1.5,integer:!1},description:"God-rays radial-blur density/spread (only consulted when godrays > 0)."}),e({name:"godraySource",type:"enum",default:cs,constraint:{values:ls.reduce(function(s,l){return s[l]=l,s},{})},description:"What the god-rays are computed from: 'leaf' = the fundamental-layer frames (LOs only occlude), 'all' = the whole lit scene (every frame of every layer and every LO)."}),e({name:"glowIntensity",type:"number",unit:"intensity",default:0,constraint:{min:0,max:3,integer:!1},description:"Per-dim glow-layer intensity multiplier (R4-GEO additive glow shading)."}),e({name:"heat",type:"number",unit:"0-1",default:0,constraint:{min:0,max:1,integer:!1},description:"Heat-ramp shift: warms dense-quanta color toward the hot end of the scheme."}),e({name:"smoke",type:"number",unit:"intensity",default:0,constraint:{min:0,max:16,integer:!1},description:"Smoke-puff layer intensity (per-dim greyscale+soft paint gate)."})]).concat(n.meshRenderCapabilities(e)).concat(n.filterRenderCapabilities(e,i));return a}o(hp,"_renderCapabilitiesThree");function Kg(e){var t=Mf(),r=null,i=null;function n(){return new Error("threeProvider: the physics rect was read before init({width, height}) or setSize(w, h) stated it. FrqtlApp.createCanvas hands the runner's canvas_rect to provider.init \u2014 the provider has no default size.")}o(n,"_unsized");function a(){if(r===null)throw n();return r}o(a,"_physW");function s(){if(i===null)throw n();return i}o(s,"_physH");var l=null,c=null,f=null,u=null,h=!!(e&&e.is3D),g=null,d=0,m={azimuth:0,elevation:0,distance:0,roll:0,target:null};function b(){if(h){if(f){var E=fp,I=E._orbitCenter(m,a(),s()),z=E._orbitCameraBasis(m,a(),s());f.position.set(z.pos.x,z.pos.y,z.pos.z),f.up.set(z.up.x,z.up.y,z.up.z),f.lookAt(I.x,I.y,I.z),f.updateProjectionMatrix()}w&&w.notify(y())}}o(b,"_applyOrbit");function y(){return{azimuth:m.azimuth,elevation:m.elevation,distance:m.distance,roll:m.roll,target:m.target?{x:m.target.x,y:m.target.y,z:m.target.z}:null}}o(y,"_orbitBag");var w=null,x={},S=2048;function A(E){return{cap:E,posArr:new Float32Array(E*3),fullArr:new Float32Array(E),colArr:new Float32Array(E*3),alphaArr:new Float32Array(E),sizeArr:new Float32Array(E),smokeArr:new Float32Array(E)}}o(A,"_makeDimLayerBuffers");function T(E,I,z){var G=x[E];if(G)return G;if(z==="sphere"){var U=Ls(S);return U.visible=!1,c.add(U),G={isSphere:!0,mesh:U,capacity:S,centroid:{x:0,y:0,z:0}},x[E]=G,G}var fe=A(S),re=new t.BufferGeometry;re.setAttribute("position",new t.BufferAttribute(fe.posArr,3)),re.setAttribute("aFullness",new t.BufferAttribute(fe.fullArr,1)),re.setAttribute("aColor",new t.BufferAttribute(fe.colArr,3)),re.setAttribute("aAlpha",new t.BufferAttribute(fe.alphaArr,1)),re.setAttribute("aSize",new t.BufferAttribute(fe.sizeArr,1)),re.setAttribute("aSmoke",new t.BufferAttribute(fe.smokeArr,1)),re.setDrawRange(0,0);var Ge={uIntensity:{value:1},uHeat:{value:0},uSmoke:{value:0},uPersp:{value:h?1:0}};I||(Ge.uShape={value:d});var rt=new t.ShaderMaterial({vertexShader:px,fragmentShader:dx,transparent:!0,depthTest:!0,depthWrite:!1,uniforms:Ge});I&&(rt.blending=t.AdditiveBlending);var Ne=new t.Points(re,rt);return Ne.visible=!1,c.add(Ne),G={geo:re,mat:rt,mesh:Ne,isAdditive:I,bufs:fe,centroid:{x:0,y:0,z:0}},x[E]=G,G}o(T,"_ensureDimLayer");function j(E,I){if(E.isSphere){if(I<=E.capacity)return;for(var z=E.capacity;z<I;)z=z*2;var G=E.mesh,U=Ls(z);U.visible=G.visible,U.renderOrder=G.renderOrder,c.remove(G),G.dispose(),c.add(U),E.mesh=U,E.capacity=z;return}if(!(I<=E.bufs.cap)){for(var fe=E.bufs.cap;fe<I;)fe=fe*2;E.bufs=A(fe),E.geo.setAttribute("position",new t.BufferAttribute(E.bufs.posArr,3)),E.geo.setAttribute("aFullness",new t.BufferAttribute(E.bufs.fullArr,1)),E.geo.setAttribute("aColor",new t.BufferAttribute(E.bufs.colArr,3)),E.geo.setAttribute("aAlpha",new t.BufferAttribute(E.bufs.alphaArr,1)),E.geo.setAttribute("aSize",new t.BufferAttribute(E.bufs.sizeArr,1)),E.geo.setAttribute("aSmoke",new t.BufferAttribute(E.bufs.smokeArr,1))}}o(j,"_growDimLayerIfNeeded");function Q(){for(var E in x)x.hasOwnProperty(E)&&(x[E].mesh.visible=!1)}o(Q,"_hideAllDimLayers");function Y(E){var I=E.x-f.position.x,z=E.y-f.position.y,G=E.z-f.position.z;return I*I+z*z+G*G}o(Y,"_camDistSq");var H=new Map,V=null,C=null,J=0,R=null,K=null,N=null,B=null,ie=null,oe=null,$=null,pe=null,ye=null,ce=null,L=null,ee=null,X=null,te=null,be=null,Oe=null,Ue=null,Ce={},xe=null,Ve={},Ot=0,Wt=0,zt=null,se=null,ve=null,Lt=null,ct=null,Kt=null,Et={},ut=[],ot=null,Qr=0,Yt=!1,hr=null,_n=null,xn=null,pr=null;function tr(E){Wi("threeProvider.init",E&&E.width,E&&E.height);var I=Bo("threeProvider.init",E.parentEl);r=E.width,i=E.height,h=!!(E&&E.is3D),g=E&&E.depth!==void 0?E.depth:null,l=new t.WebGLRenderer({antialias:!1,alpha:!1}),l.setSize(a(),s()),l.setPixelRatio(1),u=l.domElement,I.appendChild(u),h?(f=new t.PerspectiveCamera(hs,a()/s(),.1,1e5),m.distance=Math.max(a(),s())*1.6,b()):f=new t.OrthographicCamera(0,a(),s(),0,-1,1),c=new t.Scene,c.background=new t.Color(0);var z=new t.AmbientLight(16777215,.45);c.add(z);var G=new t.DirectionalLight(16777215,.9);G.position.set(1.2,-2,2.5).normalize(),c.add(G),R=new t.Matrix4,K=new t.Color,ee=new t.Matrix4,X=new t.Vector3,te=new t.Quaternion,be=new t.Vector3,Oe=new t.Color;var U=Er.FIELD_OPTS;Ot=U.w,Wt=U.h,se=new Uint8Array(Ot*Wt),zt=new t.DataTexture(se,Ot,Wt,t.RedFormat,t.UnsignedByteType),zt.minFilter=t.LinearFilter,zt.magFilter=t.LinearFilter,zt.needsUpdate=!0,ve=new t.WebGLRenderTarget(a(),s()),Lt=new t.WebGLRenderTarget(a(),s()),ct=new t.Scene,Kt=new t.OrthographicCamera(-1,1,1,-1,0,1),Yt=!0}o(tr,"_init");function fo(E,I){var z=$a.resolve(E,I),G=z&&Ce[z]?Ce[z].status:"";return[E.shape||(E.drawAsCircle?"c":"r"),E.rect.w,E.rect.h,E.depth||"",E.rect.d||"",E.shellShape||"",E.renderHint||"",E.sprite||"",E.liveCanvas?"L":"",E.renderHint?(E.color||[]).join("-"):"",z||"",G,E.meshScale||"",(E.meshRotation||[]).join("|")].join(",")}o(fo,"_loSig");function ua(E){var I=E&&E.liveCanvas;if(!I)return null;try{var z=typeof I=="function"?I():I;return z||null}catch{return null}}o(ua,"_resolveLiveCanvas");var fa=[{uAxis:"z",uDir:-1,vAxis:"y",vDir:1},{uAxis:"z",uDir:1,vAxis:"y",vDir:1},{uAxis:"x",uDir:1,vAxis:"z",vDir:-1},{uAxis:"x",uDir:1,vAxis:"z",vDir:1},{uAxis:"x",uDir:1,vAxis:"y",vDir:1},{uAxis:"x",uDir:-1,vAxis:"y",vDir:1}];function ho(E,I,z){return z>0?E<=I&&E<=z?{axis:"x",faces:[0,1]}:I<=E&&I<=z?{axis:"y",faces:[2,3]}:{axis:"z",faces:[4,5]}:{axis:"z",faces:[4,5]}}o(ho,"_thinAxisFaces");function fi(E,I){var z=typeof E=="string"?new t.TextureLoader().load(E):new t.CanvasTexture(E);return z.minFilter=t.LinearFilter,z.flipY=!1,I&&I.mirrorU&&(z.wrapS=t.RepeatWrapping,z.repeat.x=-1,z.offset.x=1),I&&I.mirrorV&&(z.wrapT=t.RepeatWrapping,z.repeat.y=-1,z.offset.y=1),z}o(fi,"_makeWorldTexture");function Ci(E,I,z){return new t.MeshBasicMaterial({map:E,transparent:!0,opacity:I,depthWrite:z,side:t.DoubleSide})}o(Ci,"_worldPlaneMaterial");function Fr(E){var I=fa[E]||fa[4];return{mirrorU:I.uDir<0,mirrorV:I.vDir<0}}o(Fr,"_liveFaceTransform");function po(E,I){var z=E.alpha!==void 0?E.alpha/255:1,G=z>=1,U=$a.resolve(E,I);if(U){go(U);var fe=Ce[U];if(fe&&fe.status==="ready"&&fe.scene){var re=fe.scene.clone(!0);re.frustumCulled=!1;var Ge=Math.max(E.rect.w,E.rect.h,E.depth||0)||E.rect.w,rt=typeof E.meshScale=="number"&&E.meshScale>0?E.meshScale:1;return re.scale.setScalar(Ge*fe.norm*rt),E.meshRotation&&re.rotation.set(E.meshRotation[0]||0,E.meshRotation[1]||0,E.meshRotation[2]||0),re}return new t.Group}if(E.liveCanvas){var Ne=ua(E),Fe=E.depth!==void 0&&E.depth>0?E.depth:E.rect.d!==void 0&&E.rect.d>0?E.rect.d:0,it=E.color||[30,40,55],He,Pe;if(Fe>0){var kt=ho(E.rect.w,E.rect.h,Fe),Ie=new t.BoxGeometry(E.rect.w,E.rect.h,Fe);Pe=[];var nt=hc.map(function(Qt,di){var Sn=kt.faces.indexOf(di)!==-1;if(Sn&&Ne){var Rr=Fr(di);return Pe.push({index:di,mirrorU:Rr.mirrorU,mirrorV:Rr.mirrorV}),new t.MeshBasicMaterial({map:fi(Ne,Rr),transparent:!0,opacity:z,depthWrite:G})}return new t.MeshBasicMaterial({color:new t.Color(it[0]/255*Qt,it[1]/255*Qt,it[2]/255*Qt),transparent:z<1,opacity:z,depthWrite:G})});Ne||(Pe=kt.faces.map(function(Qt){var di=Fr(Qt);return{index:Qt,mirrorU:di.mirrorU,mirrorV:di.mirrorV}})),He=new t.Mesh(Ie,nt),He.add(new t.LineSegments(new t.EdgesGeometry(Ie),new t.LineBasicMaterial({color:16777215,transparent:!0,opacity:.35})))}else{var St=new t.PlaneGeometry(E.rect.w,E.rect.h),dr=Fr(4);Pe=[{index:-1,mirrorU:dr.mirrorU,mirrorV:dr.mirrorV}];var Jt;Ne?Jt=Ci(fi(Ne,dr),z,G):Jt=new t.MeshBasicMaterial({color:new t.Color(it[0]/255,it[1]/255,it[2]/255),transparent:z<1,opacity:z,depthWrite:G,side:t.DoubleSide}),He=new t.Mesh(St,Jt)}return He.userData=He.userData||{},He.userData.liveCanvasSrc=Ne||null,He.userData.liveCanvasFaces=Pe,He}var jt=typeof E.shellShape=="string"&&E.shellShape?E.shellShape:null,pi=E.shape==="box"||jt==="box"||jt==="cube"||E.shape===void 0&&jt===null&&E.rect.d!==void 0&&E.rect.d>0;if(pi){var Nr=E.depth!==void 0?E.depth:E.rect.d!==void 0?E.rect.d:E.rect.w,Xr=new t.BoxGeometry(E.rect.w,E.rect.h,Nr),mr=E.color||[200,200,200],jr=hc.map(function(Qt){return new t.MeshBasicMaterial({color:new t.Color(mr[0]/255*Qt,mr[1]/255*Qt,mr[2]/255*Qt),transparent:z<1,opacity:z,depthWrite:G})}),Mr=new t.Mesh(Xr,jr);return Mr.add(new t.LineSegments(new t.EdgesGeometry(Xr),new t.LineBasicMaterial({color:16777215,transparent:!0,opacity:.35}))),Mr}var gt=jt?jt!=="box"&&jt!=="cube"&&jt!=="sphere":!!E.drawAsCircle,ji=jt==="sphere"?new t.SphereGeometry(E.rect.w/2,24,16):gt?new t.CircleGeometry(E.rect.w/2,32):new t.PlaneGeometry(E.rect.w,E.rect.h),Ur;if(E.sprite||E.renderHint){var En=E.sprite?fi(E.sprite,Fr(4)):Kc(E.renderHint,E.color);Ur=Ci(En,z,G)}else Ur=new t.MeshBasicMaterial({color:new t.Color(E.color[0]/255,E.color[1]/255,E.color[2]/255),transparent:z<1,opacity:z,depthWrite:G});return new t.Mesh(ji,Ur)}o(po,"_buildLoMesh");var hi={};function Kc(E,I){var z=E+"|"+(I?I.join(","):"");if(hi[z])return hi[z];var G=document.createElement("canvas");G.width=256,G.height=256;var U=G.getContext("2d");if(E==="gun"){var fe="rgb("+(I?I.join(","):"46,46,52")+")";U.clearRect(0,0,256,256),U.fillStyle=fe,U.fillRect(40,96,120,56),U.fillRect(150,110,86,26),U.save(),U.translate(70,150),U.rotate(.35),U.fillRect(0,0,34,80),U.restore(),U.fillStyle="rgba(150,160,180,0.55)",U.fillRect(40,96,196,8);var re=U.createRadialGradient(236,123,2,236,123,26);re.addColorStop(0,"rgba(255,230,150,0.95)"),re.addColorStop(1,"rgba(255,180,60,0)"),U.fillStyle=re,U.beginPath(),U.arc(236,123,26,0,Math.PI*2),U.fill()}else U.fillStyle="rgb("+(I?I.join(","):"60,60,70")+")",U.fillRect(0,0,256,256),U.strokeStyle="rgba(180,200,220,0.7)",U.lineWidth=6,U.strokeRect(8,8,240,240);var Ge=fi(G,Fr(4));return hi[z]=Ge,Ge}o(Kc,"_hintTexture");function Yc(E,I){var z=!C;if(!V||I>J){for(var G=J||4096;G<I;)G=G*2;V&&(c.remove(V),V.dispose()),(z||!C)&&(C&&C.dispose(),C=new t.BoxGeometry(E,E,E));var U=new t.MeshLambertMaterial({});V=new t.InstancedMesh(C,U,G),V.instanceMatrix.setUsage(t.DynamicDrawUsage),V.instanceColor=new t.InstancedBufferAttribute(new Float32Array(G*3).fill(1),3),V.instanceColor.setUsage(t.DynamicDrawUsage),V.count=0,V.frustumCulled=!1,c.add(V),J=G}}o(Yc,"_ensureCubeMesh");function Ls(E){L||(L=new t.SphereGeometry(.5,8,6));var I=new t.MeshLambertMaterial({}),z=new t.InstancedMesh(L,I,E);return z.instanceMatrix.setUsage(t.DynamicDrawUsage),z.instanceColor=new t.InstancedBufferAttribute(new Float32Array(E*3).fill(1),3),z.instanceColor.setUsage(t.DynamicDrawUsage),z.count=0,z.frustumCulled=!1,z}o(Ls,"_buildSphereInstancedMesh");function mo(E){if(typeof document>"u")throw new Error(E);if(!document.getElementById("egpt-renderer-error")){var I=document.createElement("div");I.id="egpt-renderer-error",I.style.cssText="position:fixed;inset:0;background:#300;color:#fdd;font:14px monospace;padding:18px;white-space:pre-wrap;z-index:99999;overflow:auto;",I.textContent=`render.mesh FAIL-LOUD
15
15
 
16
16
  `+E,document.body.appendChild(I)}typeof console<"u"&&console.error("[three-provider] render.mesh: "+E)}o(mo,"_meshFailLoud");function go(E){if(!Ce[E]){if(typeof t.GLTFLoader>"u"){Ce[E]={status:"error",scene:null,norm:1,error:"loaders-missing"},mo("THREE.GLTFLoader is undefined \u2014 the mesh experiment must boot with bootRealm({ meshLoaders: true }) so the UMD loaders load after three.");return}if(!Ue){var I=new t.GLTFLoader;if(typeof t.DRACOLoader<"u"){var z=Uf(),G=new t.DRACOLoader;G.setDecoderPath(z+"/draco/"),I.setDRACOLoader(G)}Ue=I}Ce[E]={status:"loading",scene:null,norm:1,error:null},Ue.load(E,function(U){var fe=U.scene||U.scenes&&U.scenes[0];if(!fe){Ce[E]={status:"error",scene:null,norm:1,error:"no-scene"},mo("glTF loaded but has no scene: "+E);return}var re=new t.Box3().setFromObject(fe),Ge=new t.Vector3;re.getSize(Ge);var rt=new t.Vector3;re.getCenter(rt);var Ne=Math.max(Ge.x,Ge.y,Ge.z)||1;fe.position.sub(rt);var Fe=new t.Group;Fe.add(fe),Ce[E]={status:"ready",scene:Fe,norm:1/Ne,error:null}},void 0,function(U){Ce[E]={status:"error",scene:null,norm:1,error:String(U)},mo("failed to load render.mesh asset: "+E+`
17
- `+String(U))})}}o(go,"_ensureMeshLoaded");function Ps(E,I,z,G,U){xe||(xe=new t.Group,xe.frustumCulled=!1,c.add(xe));for(var fe=Ve[U]||(Ve[U]=[]),re=typeof G=="number"&&G>0?G:1,Ge=z&&I?I.length:0,rt=0;rt<Ge;rt++){var Ne=I[rt],Fe=fe[rt];Fe||(Fe=E.scene.clone(!0),Fe.frustumCulled=!1,fe[rt]=Fe,xe.add(Fe));var it=Ne.data&&Ne.data.string_map,He=re;if(it&&it["render.meshScale"]!=null){var Pe=Number(it["render.meshScale"]);!isNaN(Pe)&&Pe>0&&(He=Pe)}var kt=(Ne.rect&&Ne.rect.w?Ne.rect.w:1)*E.norm*He;if(Fe.scale.setScalar(kt),Fe.position.set(Ne.rect.x,Ne.rect.y,Ne.z||0),Fe.userData.frameLayer=Ne.layer,it&&it["render.meshRotation"]!=null){var Ie=String(it["render.meshRotation"]).split(",").map(Number);Ie.length>=3&&Ie.every(function(St){return!isNaN(St)})?Fe.rotation.set(Ie[0],Ie[1],Ie[2]):Fe.rotation.set(0,0,0)}else Fe.rotation.set(0,0,0);Fe.visible=!0}for(var nt=Ge;nt<fe.length;nt++)fe[nt]&&(fe[nt].visible=!1);return Ge>0&&xe&&(xe.visible=!0),Ge}o(Ps,"_layoutMeshClones");function Is(E){for(var I in Ve)if(Ve.hasOwnProperty(I)&&!(E&&E.indexOf(I)!==-1))for(var z=Ve[I],G=0;G<z.length;G++)z[G]&&(z[G].visible=!1)}o(Is,"_hideMeshClonesExcept");function Jc(E,I){if(E){for(var z=new Set,G=0;G<E.length;G++){var U=E[G];z.add(U);var fe=fo(U,I),re=H.get(U);if(!re||re.sig!==fe){re&&re.mesh&&c.remove(re.mesh);var Ge=po(U,I);re={mesh:Ge,sig:fe,skinSig:null},H.set(U,re),c.add(Ge)}var rt=mx(U);re.skinSig!==rt&&(re.mesh&&re.mesh.material&&gx(re.mesh.material,U),re.skinSig=rt);var Ne=Vn(U.rect);re.mesh.position.set(Ne[0],Ne[1],Ne[2]);var Fe=typeof U.orientationDeg=="number"?(U.orientationDeg%360+360)%360:0,it=typeof U.pitchDeg=="number"?U.pitchDeg:0;if(U.billboard||(re.mesh.rotation.order="ZYX",re.mesh.rotation.z=Fe*Math.PI/180,re.mesh.rotation.y=it*Math.PI/180),U.billboard&&f&&re.mesh.quaternion.copy(f.quaternion),U.liveCanvas&&re.mesh&&re.mesh.material){for(var He=ua(U),Pe=re.mesh.userData||(re.mesh.userData={}),kt=Pe.liveCanvasFaces||[{index:-1,mirrorU:!1,mirrorV:!1}],Ie=0;Ie<kt.length;Ie++){var nt=kt[Ie],St=nt.index>=0&&Array.isArray(re.mesh.material)?re.mesh.material[nt.index]:re.mesh.material;if(St)if(He&&(Pe.liveCanvasSrc!==He||!St.map)){if(St.map)try{St.map.dispose()}catch{}St.map=fi(He,nt),St.color&&St.color.setRGB(1,1,1),St.transparent=!0,St.needsUpdate=!0}else He&&St.map&&(St.map.needsUpdate=!0)}He&&(Pe.liveCanvasSrc=He)}re.mesh.visible=U.visible!==!1}H.forEach(function(dr,Jt){z.has(Jt)||(dr.mesh.visible=!1)})}}o(Jc,"_syncLargeObjects");function Qc(E){if(!(!E||!E.frameData||!se)){var I=Er.buildHeightField(E.frameData,Object.assign({},Er.FIELD_OPTS,{canvasW:a(),canvasH:s()}));se.set(I),zt.needsUpdate=!0}}o(Qc,"_updateFieldTex");function Xc(E){var I=E.name||"filter";if(Et[I])return Et[I];var z=E.glsl,G=new t.ShaderMaterial({uniforms:{uScene:{value:ve.texture},uField:{value:zt},uResolution:{value:new t.Vector2(a(),s())},uTime:{value:0}},vertexShader:Gg,fragmentShader:z,transparent:!1,depthWrite:!1}),U=new t.Mesh(new t.PlaneGeometry(2,2),G);return ct.add(U),Et[I]=U,U}o(Xc,"_ensureQuadMesh");function Zc(E,I){var z=E.name||"filter",G=Xc(E);G.material.uniforms.uTime.value=I,G.material.uniforms.uResolution.value.set(a(),s()),l.setRenderTarget(ve),l.render(c,f),l.setRenderTarget(null),G.material.uniforms.uScene.value=ve.texture,G.material.uniforms.uField.value=zt,l.render(ct,Kt)}o(Zc,"_applyFilter");function $c(E){var I=us,z=I.fundamentalLayerOf(E),G=[],U=null,fe=[];function re(Pe){Pe&&Pe.visible&&(Pe.visible=!1,G.push(Pe))}o(re,"hide");for(var Ge in x)x.hasOwnProperty(Ge)&&!I.isGodraySource(x[Ge].layer,z)&&re(x[Ge].mesh);V&&V.visible&&(U=V.count,V.count=Qr);for(var rt in Ve)if(Ve.hasOwnProperty(rt))for(var Ne=Ve[rt],Fe=0;Fe<Ne.length;Fe++)Ne[Fe]&&!I.isGodraySource(Ne[Fe].userData.frameLayer,z)&&re(Ne[Fe]);H.forEach(function(Pe){Pe.mesh&&Pe.mesh.traverse(function(kt){for(var Ie=kt.material?Array.isArray(kt.material)?kt.material:[kt.material]:[],nt=0;nt<Ie.length;nt++)Ie[nt]&&Ie[nt].colorWrite!==!1&&(Ie[nt].colorWrite=!1,fe.push(Ie[nt]))})}),l.setRenderTarget(ot.rtSource),l.render(c,f);for(var it=0;it<G.length;it++)G[it].visible=!0;U!==null&&(V.count=U);for(var He=0;He<fe.length;He++)fe[He].colorWrite=!0}o($c,"_renderGodraySource");function eu(E,I){var z=us,G=z.resolveGodraySource(E.godraySource)==="leaf";ot||(ot=z.makeGodrayPasses(t,Gg,a(),s())),l.setRenderTarget(ve),l.render(c,f),G&&$c(I),ot.march(l,Kt,ve,G?ot.rtSource:ve,Lt,ot.lightUV(I,f,E.godraySource),E.godrayDensity,E.godrays)}o(eu,"_renderGodrays");var tu=16724991,ha=16755200,Fs=3407769;function On(E){var I=new t.BufferGeometry;return I.setAttribute("position",new t.BufferAttribute(new Float32Array(E),3)),I}o(On,"_lineGeo");function Zi(E,I){var z=new t.LineSegments(E,new t.LineBasicMaterial({color:I,depthTest:!1,transparent:!0,opacity:1}));return z.renderOrder=9999,z.frustumCulled=!1,z}o(Zi,"_overlayLines");function pa(E,I,z){for(var G=[],U=0;U<I;U++){var fe=U/I*Math.PI*2,re=(U+1)/I*Math.PI*2;G.push(E*Math.cos(fe),E*Math.sin(fe),z||0,E*Math.cos(re),E*Math.sin(re),z||0)}return G}o(pa,"_circlePts");function Ns(){var E=new t.BoxGeometry(1,1,1),I=o(function(){return new t.MeshBasicMaterial({color:0,transparent:!0,opacity:.38,depthTest:!1,depthWrite:!1,side:t.DoubleSide})},"dark"),z=new t.Mesh(E,I());z.add(Zi(new t.EdgesGeometry(E),ha));var G=new t.Mesh(new t.CircleGeometry(1,48),I());return G.add(Zi(On(pa(1,48)),ha)),[z,G].forEach(function(U){U.renderOrder=9997,U.frustumCulled=!1,U.visible=!1,ce.add(U)}),{box:z,disc:G}}o(Ns,"_makeSurround");function vo(E,I,z){var G=I.center;if(I.kind==="sphere"){var U=I.radius+z;return E.disc.position.set(G[0],G[1],G[2]),E.disc.quaternion.copy(f.quaternion),E.disc.scale.setScalar(U),E.disc.visible=!0,E.box.visible=!1,U}return E.box.position.set(G[0],G[1],G[2]),E.box.rotation.order="ZYX",E.box.rotation.z=(I.yawDeg||0)*Math.PI/180,E.box.rotation.y=(I.pitchDeg||0)*Math.PI/180,E.box.scale.set(2*(I.half[0]+z),2*(I.half[1]+z),2*(I.half[2]+z)),E.box.visible=!0,E.disc.visible=!1,Math.hypot(I.half[0],I.half[1],I.half[2])+z}o(vo,"_placeSurround");function da(E){E&&(E.box.visible=!1,E.disc.visible=!1)}o(da,"_hideSurround");function ru(E){var I=E&&E.aimFeedback;if(!h||!I||!I.bounds){N&&(N.visible=!1),ie&&(ie.visible=!1),oe&&(oe.visible=!1),$&&($.visible=!1),da(pe),da(ye);return}ce||(ce=new t.Scene);var z=I.bounds.width,G=I.bounds.height,U=I.bounds.zHalf,fe=z+"x"+G+"x"+U,re=Math.max(4,Math.min(z,G)*.06);if(!N||B!==fe){[N,ie,oe,$].forEach(function(ji){ji&&(ce.remove(ji),ji.geometry.dispose())});var Ge=new t.BoxGeometry(z,G,Math.max(1,2*U));N=new t.LineSegments(new t.EdgesGeometry(Ge),new t.LineBasicMaterial({color:6737151,transparent:!0,opacity:.5,depthTest:!1})),N.renderOrder=9998,N.frustumCulled=!1,ce.add(N),Ge.dispose();var rt=re*.25;ie=Zi(On([-re,0,0,-rt,0,0,rt,0,0,re,0,0,0,-re,0,0,-rt,0,0,rt,0,0,re,0].concat(pa(re*.55,32))),tu),ce.add(ie);var Ne=re*1.6,Fe=Ne*1.35,it=Ne*.22;oe=Zi(On(pa(Ne,48).concat([0,0,0,Fe,0,0,Fe,0,0,Fe-it,it*.6,0,Fe,0,0,Fe-it,-it*.6,0])),ha),ce.add(oe);for(var He=re*.45,Pe=re*.4,kt=[-He,-Pe,0,He,-Pe,0,He,-Pe,0,He,Pe*.4,0,He,Pe*.4,0,-He,Pe*.4,0,-He,Pe*.4,0,-He,-Pe,0],Ie=He*.62,nt=0;nt<12;nt++){var St=nt/12*Math.PI,dr=(nt+1)/12*Math.PI;kt.push(Ie*Math.cos(St),Pe*.4+Ie*.3+Ie*Math.sin(St),0,Ie*Math.cos(dr),Pe*.4+Ie*.3+Ie*Math.sin(dr),0)}kt.push(Ie,Pe*.4,0,Ie,Pe*.4+Ie*.3,0,-Ie,Pe*.4,0,-Ie,Pe*.4+Ie*.3,0),$=Zi(On(kt),Fs),ce.add($),pe||(pe=Ns(),ye=Ns()),B=fe}N.position.set(z/2,G/2,0),N.visible=!0;var Jt=Math.max(a(),s())*1.6,jt=Jt>0&&m.distance>0?m.distance/Jt:1,pi=ps(m,a(),s());ie.position.set(pi.x,pi.y,pi.z),ie.quaternion.copy(f.quaternion),ie.scale.setScalar(jt),ie.visible=!0;var Nr=4*jt,Xr=I.hover?vo(pe,I.hover.volume,Nr):0;if(I.hover||da(pe),I.selected&&!(I.hover&&I.hover.name===I.selected.name)?vo(ye,I.selected.volume,Nr):da(ye),I.grabbed&&I.hover){var mr=I.hover.volume.center,jr=f.up,Mr=Xr+re*.8*jt;$.position.set(mr[0]+jr.x*Mr,mr[1]+jr.y*Mr,mr[2]+jr.z*Mr),$.quaternion.copy(f.quaternion),$.scale.setScalar(jt),$.visible=!0}else $.visible=!1;var gt=I.orientation;gt&&gt.pivot&&(oe.position.set(gt.pivot[0],gt.pivot[1],gt.pivot[2]!=null?gt.pivot[2]:0),oe.rotation.z=(gt.deg||0)*Math.PI/180,oe.scale.setScalar(jt)),oe.visible=!!(gt&&gt.pivot)}o(ru,"_updateAimFeedback");function Ms(){if(!(!ce||!N||!N.visible)){var E=l.autoClear;l.autoClear=!1,l.setRenderTarget(null),l.render(ce,f),l.autoClear=E}}o(Ms,"_renderAimFeedbackPass");function yo(E,I,z){if(Yt){hr=E,ru(z||{}),Jc(I,z||{});var G=z||{},U=G.renderBaseCanvas!==!1;_n=Object.assign({},G),xn=U;var fe=ut.length>0,re=G.glowIntensity,Ge=Ei,rt=ai,Ne=rt.resolve(null,G),Fe=h?$a.resolve(null,G):null,it=!!Fe,He=!it&&h&&rt.isCubeMesh(Ne);if(!it&&xe&&(xe.visible=!1),it){Q(),V&&(V.visible=!1),go(Fe);var Pe=Ce[Fe],kt=0;Pe&&Pe.status==="ready"&&(kt=Ps(Pe,E.frameData,G.renderBaseCanvas!==!1,G.meshScale,Fe)),Is([Fe]),xe&&(xe.visible=kt>0)}else if(He)if(Q(),U&&E&&E.frameData){for(var Ie=E.frameData,nt=Ie.length,St=G.colorScheme||"warmcool",dr=64,Jt=0;Jt<nt;Jt++)if(Ie[Jt].rect&&Ie[Jt].rect.w){dr=Ie[Jt].rect.w;break}Yc(dr,nt);for(var jt=us,pi=jt.fundamentalLayerOf(E),Nr=[],Xr=0;Xr<nt;Xr++)jt.isGodraySource(Ie[Xr].layer,pi)&&Nr.push(Xr);Qr=Nr.length;for(var mr=0;mr<nt;mr++)jt.isGodraySource(Ie[mr].layer,pi)||Nr.push(mr);for(var jr=0,Mr=0;Mr<nt;Mr++){var gt=Ie[Nr[Mr]],ji=gt.fullness||0,Ur=gt.data&&gt.data.string_map,En=null;if(Ur&&Ur["render.color"]){var Qt=String(Ur["render.color"]).split(",").map(Number);Qt.length>=3&&Qt.every(function(Pi){return!isNaN(Pi)})&&(En=Qt)}var di=Ur&&Ur["render.colorScheme"]?Ur["render.colorScheme"]:St,Sn=En||Ge.getRgbBySchemeName(di,ji),Rr=gt.rect.x,Ri=gt.rect.y,Us=gt.z||0;R.makeTranslation(Rr,Ri,Us),V.setMatrixAt(jr,R),K.setRGB((Sn[0]||0)/255,(Sn[1]||0)/255,(Sn[2]||0)/255),V.setColorAt(jr,K),jr++}V.count=jr,V.instanceMatrix.needsUpdate=!0,V.instanceColor&&(V.instanceColor.needsUpdate=!0),V.visible=U&&jr>0}else V&&(V.visible=!1);else if(V&&(V.visible=!1),Q(),U&&E&&E.frameData){let Pi=function(_o,ya,xo,Ks,Ys,Js,ba,lu,wa,Qs,Oo,cu){var rn=Di[ya];rn||(rn=Di[ya]={layer:_o,additive:xo,paint:Ks,uShape:cu,list:[]}),rn.list.push({x:Ys,y:Js,z:ba,full:lu,r:wa[0]||0,g:wa[1]||0,b2:wa[2]||0,a:Qs,size:Oo})};o(Pi,"_pushTo");var kn=E.frameData,zs=kn.length,qs=Ge,nu=rt,Vs=typeof G.smoke=="number"&&G.smoke>0,au=Vs?G.smoke:0,ou=G.colorScheme||"warmcool";d=nu.toUniform(Ne);for(var Bs=typeof re=="number"&&re>0,An={},Di={},qt=0;qt<zs;qt++){var rr=kn[qt],Zr=rr.layer||0,mi=Ug.resolveRenderFamily(rr,G,h);if(mi.family==="mesh"){(An[mi.assetId]||(An[mi.assetId]=[])).push(rr);continue}var $r=rr.fullness||0,Dr=rr.data&&rr.data.string_map,Li=null;if(Dr&&Dr["render.color"]){var ga=String(Dr["render.color"]).split(",").map(Number);ga.length>=3&&ga.every(function(xo){return!isNaN(xo)})&&(Li=ga)}var su=Dr&&Dr["render.colorScheme"]?Dr["render.colorScheme"]:ou,$i=rr.z||0,Rr=rr.rect.x,Ri=rr.rect.y,bo=rr.rect&&rr.rect.w?rr.rect.w:1,en=qs.getAlphaFromIntensity($r),Tn=Li||qs.getRgbBySchemeName(su,$r),Cn=Bs?4*$r+1:bo;if(Bs)Pi(Zr,Zr+"|A",!0,"crisp",Rr,Ri,$i,$r,Tn,en,Cn);else if(Vs)Pi(Zr,Zr+"|N|soft",!1,"soft",Rr,Ri,$i,$r,Tn,en,Cn);else if(mi.family==="sphere")Pi(Zr,Zr+"|N|sphere",!1,"sphere",Rr,Ri,$i,$r,Tn,en,Cn,0);else{var Ws=mi.family==="cube"?1:mi.uShapeVariant!=null?mi.uShapeVariant:0;Pi(Zr,Zr+"|N|pts:"+Ws,!1,"crisp",Rr,Ri,$i,$r,Tn,en,Cn,Ws)}}var jn=[];for(var ei in Di)if(Di.hasOwnProperty(ei)){var Lr=Di[ei],gr=Lr.list.length;if(gr!==0){jn.push(ei);var Re=T(ei,Lr.additive,Lr.paint);j(Re,gr),Re.layer=Lr.layer;var ir=0,zr=0,qr=0;if(Re.isSphere){for(var Rn=0;Rn<gr;Rn++){var Xt=Lr.list[Rn];X.set(Xt.x,Xt.y,Xt.z),be.set(Xt.size,Xt.size,Xt.size),ee.compose(X,te,be),Re.mesh.setMatrixAt(Rn,ee),Oe.setRGB(Xt.r/255,Xt.g/255,Xt.b2/255),Re.mesh.setColorAt(Rn,Oe),ir+=Xt.x,zr+=Xt.y,qr+=Xt.z}Re.mesh.count=gr,Re.mesh.instanceMatrix.needsUpdate=!0,Re.mesh.instanceColor&&(Re.mesh.instanceColor.needsUpdate=!0)}else{for(var nr=0;nr<gr;nr++){var vr=Lr.list[nr];Re.bufs.posArr[nr*3]=vr.x,Re.bufs.posArr[nr*3+1]=vr.y,Re.bufs.posArr[nr*3+2]=vr.z,Re.bufs.fullArr[nr]=vr.full,Re.bufs.colArr[nr*3]=vr.r/255,Re.bufs.colArr[nr*3+1]=vr.g/255,Re.bufs.colArr[nr*3+2]=vr.b2/255,Re.bufs.alphaArr[nr]=vr.a,Re.bufs.sizeArr[nr]=vr.size,Re.bufs.smokeArr[nr]=Lr.paint==="soft"?1:0,ir+=vr.x,zr+=vr.y,qr+=vr.z}Re.geo.setDrawRange(0,gr),Re.geo.attributes.position.needsUpdate=!0,Re.geo.attributes.aFullness.needsUpdate=!0,Re.geo.attributes.aColor.needsUpdate=!0,Re.geo.attributes.aAlpha.needsUpdate=!0,Re.geo.attributes.aSize.needsUpdate=!0,Re.geo.attributes.aSmoke.needsUpdate=!0,Re.mat.uniforms.uPersp.value=h?1:0,Re.mat.uniforms.uShape&&(Re.mat.uniforms.uShape.value=Lr.uShape!=null?Lr.uShape:d),Lr.additive?(Re.mat.uniforms.uIntensity.value=typeof re=="number"?re:1,Re.mat.uniforms.uHeat.value=typeof G.heat=="number"?G.heat:0,Re.mat.uniforms.uSmoke.value=0):(Re.mat.uniforms.uIntensity.value=1,Re.mat.uniforms.uHeat.value=typeof G.heat=="number"?G.heat:0,Re.mat.uniforms.uSmoke.value=Lr.paint==="soft"?au:0)}Re.centroid.x=ir/gr,Re.centroid.y=zr/gr,Re.centroid.z=qr/gr,Re.mesh.visible=U}}if(h&&jn.length>1){jn.sort(function(_o,ya){return Y(x[ya].centroid)-Y(x[_o].centroid)});for(var va=0;va<jn.length;va++)x[jn[va]].mesh.renderOrder=va}var Gs=[],Hs=0;for(var tn in An)if(An.hasOwnProperty(tn)){Gs.push(tn),go(tn);var wo=Ce[tn];wo&&wo.status==="ready"&&(Hs+=Ps(wo,An[tn],U,G.meshScale,tn))}Is(Gs),xe&&(xe.visible=Hs>0)}fe&&Qc(E),ma(G,E)}}o(yo,"_renderTick");function ma(E,I){E=E||{};var z=E.godrays>0,G=ut.length>0?Wo(I):null;pr=G,z?eu(E,I):ut.length>0?Zc(ut[0],G):(l.setRenderTarget(null),l.render(c,f)),Ms()}o(ma,"_composeFinal");var iu={init:o(function(E){return tr(E),u},"init"),renderTick:o(function(E,I,z){yo(E,I,z)},"renderTick"),filter:o(function(E,I){if(E){if(E.name){for(var z=0;z<ut.length;z++)if(ut[z].name===E.name){I&&(ut[z]._perFilterOptions=I);return}}var G=E;I&&(G=Object.assign({},E),G._perFilterOptions=I),ut.push(G)}},"filter"),removeFilter:o(function(E){var I=typeof E=="string"?E:E&&E.name;ut=ut.filter(function(z){return z.name!==I}),I&&Et[I]&&(ct.remove(Et[I]),delete Et[I])},"removeFilter"),setSize:o(function(E,I){Wi("threeProvider.setSize",E,I),r=E,i=I,l?(l.setSize(E,I),h?(f.aspect=E/I,b()):(f.right=E,f.bottom=I,f.updateProjectionMatrix()),ve&&ve.setSize(E,I),Lt&&Lt.setSize(E,I),ot&&ot.setSize(E,I)):h&&b()},"setSize"),start:o(function(){},"start"),stop:o(function(){},"stop"),destroy:o(function(){l&&l.dispose(),u&&u.parentNode&&u.parentNode.removeChild(u),Yt=!1,ut=[]},"destroy"),raw:o(function(){return{renderer:l,scene:c,camera:f}},"raw"),projection:o(function(){return h?{kind:"perspective",fovY:hs}:{kind:"affine2d"}},"projection"),captureStill:o(function(){if(!Yt||!l)throw new Error("[three-provider.captureStill] no live renderer \u2014 init() has not run. (FAIL-LOUD \u2014 never a null or blank still.)");if(!hr)throw new Error("[three-provider.captureStill] nothing has been composited yet (no renderTick/repaint since init). A capture before the first draw would be a cleared framebuffer, i.e. a black still. (FAIL-LOUD.)");var E=as;ma(_n,hr);var I=l.getContext(),z=l.domElement,G=E.captureFromGl(I,z.width,z.height,{cssWidth:z.clientWidth||a(),cssHeight:z.clientHeight||s(),physicsW:a(),physicsH:s(),filtersApplied:ut.map(function(U){return U.name}),renderBaseCanvas:xn,filterTime:pr,composited:hr});return Promise.resolve(G)},"captureStill"),getCameraControl:o(function(){if(!h)return null;var E=tp;function I(){return E.cameraPresets(a(),s())}o(I,"_presets");function z(U,fe,re){if(typeof U=="number"&&isFinite(U))return U;throw new Error("three-provider camera "+re+": "+fe+" must be a finite number, got "+String(U)+" \u2014 throw-or-apply, never a silent clamp.")}o(z,"_finite");var G={presets:Object.keys(I()),poseFields:E.cameraPoseFields(a(),s()),setOrbit:o(function(U){if(U){if(U=ko(U),U.azimuth!==void 0&&(m.azimuth=z(U.azimuth,"azimuth","setOrbit")),U.elevation!==void 0&&(m.elevation=z(U.elevation,"elevation","setOrbit")),U.distance!==void 0&&(m.distance=z(U.distance,"distance","setOrbit")),U.roll!==void 0){var fe=z(U.roll,"roll","setOrbit")%360;m.roll=fe>180?fe-360:fe<=-180?fe+360:fe}if("target"in U){var re=U.target;m.target=re?{x:re.x,y:re.y,z:re.z}:null}b()}},"setOrbit"),getOrbit:o(function(){return y()},"getOrbit"),addPoseListener:o(function(U){return w||(w=Ao()),w.add(U)},"addPoseListener"),setPreset:o(function(U){var fe=I(),re=fe[U];if(!re)throw new Error('[three-provider camera] setPreset("'+U+'"): this camera offers only ['+Object.keys(fe).join(", ")+"] (ctl.presets). (FAIL-LOUD.)");G.setOrbit({azimuth:re.azimuth,elevation:re.elevation,distance:re.distance,roll:0,target:null})},"setPreset"),look:o(function(U){if(U){var fe=U.spin===void 0?0:z(U.spin,"spin","look"),re=U.pitch===void 0?0:z(U.pitch,"pitch","look");if(!(!fe&&!re)){var Ge=op(m,{spin:fe,pitch:re},a(),s());m.azimuth=Ge.azimuth,m.elevation=Ge.elevation,m.roll=Ge.roll,b()}}},"look"),move:o(function(U){if(U){var fe=U.forward===void 0?0:z(U.forward,"forward","move"),re=U.strafe===void 0?0:z(U.strafe,"strafe","move");!fe&&!re||(m.target=sp(m,a(),s(),fe,re),b())}},"move"),cameraOffsetFromWorld:o(function(U){return lp(m,a(),s(),U)},"cameraOffsetFromWorld"),worldFromCameraOffset:o(function(U){return cp(m,a(),s(),U)},"worldFromCameraOffset")};return G},"getCameraControl"),renderCapabilities:hp,screenToWorld:o(function(E,I,z,G,U){return h?up(m,a(),s(),E,I,z,G,U):null},"screenToWorld"),get initialized(){return Yt}};return iu}o(Kg,"makeThreeProvider");var ds=Object.freeze({p5:Object.freeze({makeProvider:Dg,renderCapabilities:ep}),three:Object.freeze({makeProvider:Kg,renderCapabilities:hp})});function ms(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}o(ms,"_isPlainObject");function Yg(e){if(!e||!e.camera)return null;var t=e.camera;return typeof t.preset=="string"&&t.preset.length>0?{mode:"preset",name:t.preset}:t.orbit&&typeof t.orbit=="object"?{mode:"orbit",orbit:t.orbit}:null}o(Yg,"pickCameraReplay");var pc=1,pp=Object.freeze([{key:"version",normalize:o(function(e){if(e===void 0||e===pc)return pc;throw new Error("[render-state] renderState.version "+JSON.stringify(e)+" \u2014 this owner reads version "+pc+" only. (FAIL-LOUD.)")},"normalize")},{key:"renderer",normalize:o(function(e){return typeof e=="string"&&e.length>0?e:null},"normalize")},{key:"engine",normalize:o(function(e){return typeof e=="string"&&e.length>0?e:null},"normalize")},{key:"seed",normalize:o(function(e){return e!=null&&e!==""?String(e):null},"normalize")},{key:"backdropVisible",normalize:o(function(e){return typeof e=="boolean"?e:null},"normalize")},{key:"camera",normalize:o(function(e){return ms(e)?{orbit:ms(e.orbit)?e.orbit:null,preset:typeof e.preset=="string"?e.preset:null}:null},"normalize")},{key:"render",normalize:o(function(e){return Array.isArray(e)?e.filter(function(t){return ms(t)&&typeof t.key=="string"&&t.key.length>0}):[]},"normalize")}].map(Object.freeze));function dc(e){if(e!==null&&!ms(e))throw new Error("[render-state] a renderState is a bag (a plain object) or null for none \u2014 got "+(e===void 0?"undefined":Array.isArray(e)?"an array":typeof e)+". (FAIL-LOUD.)");var t=e||{};if(Object.prototype.hasOwnProperty.call(t,"pageControls")){var r=Array.isArray(t.pageControls)?t.pageControls:[];throw new Error("[render-state] this saved project carries page controls (renderState.pageControls: "+(r.map(function(a){return ms(a)?String(a.id):"?"}).join(", ")||"an empty list")+") \u2014 page controls are declared in the sketch's own code; move them into the sketch and save again. (FAIL-LOUD.)")}var i=pp.map(function(a){return a.key});Object.keys(t).forEach(function(a){if(i.indexOf(a)===-1)throw new Error('[render-state] renderState has no key "'+a+'" \u2014 its keys (RENDER_STATE_KEYS): '+i.join(", ")+". (FAIL-LOUD.)")});var n={};return pp.forEach(function(a){n[a.key]=a.normalize(t[a.key])}),n}o(dc,"normalizeSavedRenderState");function Jg(e,t,r){if(!Array.isArray(e)||!Array.isArray(t)||!Array.isArray(r))throw new Error("[render-state] partitionRenderRows(rows, declaredNames, knownNames) takes three arrays. (FAIL-LOUD.)");for(var i={},n=[],a=0;a<e.length;a++){var s=e[a];if(t.indexOf(s.key)!==-1)i[s.key]=s.value;else if(r.indexOf(s.key)!==-1)n.push({key:s.key,value:s.value});else throw new Error('[render-state] saved render option "'+s.key+'" is declared by no registered renderer (known: ['+r.join(", ")+"]). (FAIL-LOUD: a typo or a deleted option would otherwise silently change the picture.)")}return{apply:i,retained:n}}o(Jg,"partitionRenderRows");function vx(e){var t=e&&e.largeObjects;if(!Array.isArray(t))throw new Error("[render-state] RenderState.backdropOf: runner.largeObjects is not the world's census (an array) \u2014 the backdrop is found there and nowhere else. (FAIL-LOUD.)");for(var r=0;r<t.length;r++)if(t[r]&&t[r].backdrop===!0)return t[r];return null}o(vx,"backdropOf");function Qg(e,t,r){if(!e||typeof e.renderCapabilities!="function"||typeof e.setRenderOptions!="function")throw new Error("[render-state] RenderState.apply(runner, bag, env): runner must be a booted FrqtlApp (renderCapabilities + setRenderOptions). (FAIL-LOUD.)");if(!r||!Array.isArray(r.knownNames))throw new Error("[render-state] RenderState.apply(runner, bag, env): env.knownNames must be the page's RenderCapabilitiesCommon.knownRenderCapabilityNames(providers) array. (FAIL-LOUD.)");var i=dc(t),n=Jg(i.render,e.renderCapabilities().map(function(h){return h.name}),r.knownNames),a=Yg(i),s=null,l=null,c=null;if(a){if(s=e.cameraControl,!s)throw new Error("[render-state] the bag declares a camera ("+JSON.stringify(i.camera)+") but the runner has no cameraControl \u2014 a declared view on a display with no pose control would look fine and be wrong. (FAIL-LOUD.)");if(a.mode==="preset"){if(!Array.isArray(s.presets))throw new Error("[render-state] the booted camera publishes no `presets` array \u2014 every getCameraControl() handle declares the presets it offers. (FAIL-LOUD.)");c=a.name,l=s.presets.indexOf(a.name)===-1?"retained":"preset"}else l="orbit"}var f=vx(e);e.setRenderOptions(n.apply),l==="preset"?s.setPreset(a.name):l==="orbit"&&s.setOrbit(a.orbit);var u=null;return f&&i.backdropVisible!==null&&(e.updateObjectProperty(f,"visible",i.backdropVisible),u=i.backdropVisible),{applied:n.apply,retained:n.retained,camera:l,preset:c,backdrop:u}}o(Qg,"apply");un();Va();var io=Object.freeze({SEED:"seed",RENDERER:"renderer",ENGINE:"engine"}),bx=Object.freeze([Object.freeze({key:io.SEED,reader:"lib/frqtl/experiments/empty/index.html",forward:!0}),Object.freeze({key:io.RENDERER,reader:"lib/frqtl/experiments/_shared/boot.js",forward:!0}),Object.freeze({key:io.ENGINE,reader:"lib/frqtl/experiments/_shared/boot.js",forward:!1,why:"the host's own physics-engine selector (e.g. the GYM's Benchmark/Compare engine dropdown) is the SOLE authority for this axis; forwarding an outer ?engine= would let it silently override an explicit host choice, which is exactly the engine-sniffing-from-above-the-shim class of bug this codebase forbids elsewhere"})]),Xg=Object.freeze([Object.freeze({key:"chrome",appliedBy:"lib/frqtl/experiments/_shared/boot.js",forward:!1,acceptedValues:Object.freeze(["canvas"]),why:`chrome is a HOST-COMPOSITION decision (whether the experiment's own control chrome DOM renders), never a per-experiment physics/render parameter; forwarding it from an outer host URL into an embedded iframe would reintroduce the hidden-experiment-chrome bug (the GYM must always show the experiment's own full chrome, never chrome=canvas \u2014 see the "WHEN should a host set chrome=canvas" doc above for the general criterion, not just the GYM's specific answer to it)`})]),rC=Object.freeze(bx.filter(function(e){return e.forward}).map(function(e){return e.key}));var wx=Object.freeze([{id:"modules",means:"Loading the scene objects"},{id:"engine-ready",means:"Starting the WASM engine"},{id:"renderer",means:"Loading the renderer"},{id:"sketch",means:"Building the scene"}].map(Object.freeze)),dp=Object.freeze(wx.map(e=>e.id)),mp="frqtl:boot-phase";var _x={engine:{id:"egpt-engine-error",marker:"data-egpt-engine-error",bg:"#1a0000",fg:"#ff6b6b",border:"#b6161c"},renderer:{id:"egpt-renderer-error",marker:"data-egpt-renderer-error",bg:"#000a1a",fg:"#6b9eff",border:"#1640b6"}},ta=null;function Zg(e){ta=e||null}o(Zg,"setBootOverlayHost");function ra(e,t){let r=_x[e];if(!r)throw new Error("[boot] paintBootFailure: axis must be engine | renderer (got "+JSON.stringify(e)+")");typeof console<"u"&&console.error&&console.error(t);function i(){if(ta){if(ta.querySelector&&ta.querySelector("["+r.marker+"]"))return;let a=document.createElement("div");a.setAttribute(r.marker,"1"),a.setAttribute("data-egpt-boot-error","1"),a.style.cssText="position:absolute;inset:0;z-index:9998;background:"+r.bg+";color:"+r.fg+";font:12px/1.5 ui-monospace,Menlo,Consolas,monospace;padding:14px;white-space:pre-wrap;overflow:auto;border:2px solid "+r.border+";",a.textContent=t;let s=getComputedStyle(ta);(!s||s.position==="static")&&(ta.style.position="relative"),ta.appendChild(a);return}if(document.getElementById(r.id))return;let n=document.createElement("div");n.id=r.id,n.setAttribute("data-egpt-boot-error","1"),n.style.cssText="position:fixed;inset:0;z-index:99999;background:"+r.bg+";color:"+r.fg+";font:13px/1.55 ui-monospace,Menlo,Consolas,monospace;padding:22px;white-space:pre-wrap;overflow:auto;border:2px solid "+r.border+";",n.textContent=t,(document.body||document.documentElement).appendChild(n)}o(i,"paint"),document.body?i():addEventListener("DOMContentLoaded",i)}o(ra,"paintBootFailure");bi();xt();At();var lC=Object.freeze({scene:Object.freeze({id:"scene",importedBy:"any project file (a sketch imports it)"}),"part-internal":Object.freeze({id:"part-internal",importedBy:"a part file (parts/*.js) of a project \u2014 a forked part imports its parent part's internals; never a sketch"})}),oi=Object.freeze([Object.freeze({specifier:"@descix/frqtl-web/parts",libPath:"frqtl/parts/index.js",why:"the parts barrel",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/parts/",libPath:"frqtl/parts/",why:"one part = one file",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/shim/controls/registry.js",libPath:"shim/controls/registry.js",why:"knob registration (blackbody, circuit-sat, collision-matrix-3d, dse-tunnel-rebuild)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/shim/render/sun-look.js",libPath:"shim/render/sun-look.js",why:"the one owner of the sun's FX bag (dse-tunnel-rebuild)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/compat/renderer/display-slot.js",libPath:"frqtl/compat/renderer/display-slot.js",why:"the booted display name before co-init (mirror-route, dse-tunnel-rebuild)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/compat/renderer/orbit-bag.js",libPath:"frqtl/compat/renderer/orbit-bag.js",why:"hasAngularPose, THE 3D-ness predicate (atomic-model)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/objects/setup/_collisionMatrixLanes.js",libPath:"frqtl/objects/setup/_collisionMatrixLanes.js",why:"the one lane table (collision-matrix-3d)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/compat/engine.js",libPath:"frqtl/compat/engine.js",why:"the engine accessor (atomic-model builds its frames by hand)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/kinds",libPath:"frqtl/objects/kinds-entry.js",why:"the kind registry: a composed fork registers its renamed class (registerKind, kindNamed, kindOf, registeredKinds)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/tagger.js",libPath:"frqtl/objects/objects/tagger.js",why:"imported by DetectorWall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/schema/index.js",libPath:"frqtl/objects/schema/index.js",why:"imported by DetectorWall, SlitScreen, Wall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/shim/render/heat-colormap.js",libPath:"shim/render/heat-colormap.js",why:"imported by GraphingDetectorWall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/schema/valueNormalizer.js",libPath:"frqtl/objects/schema/valueNormalizer.js",why:"imported by LiveChart, Wall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/Box.js",libPath:"frqtl/objects/objects/Box.js",why:"imported by OvenBox \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/QuantumEmitter.js",libPath:"frqtl/objects/objects/QuantumEmitter.js",why:"imported by OvenBox \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/shim/expr/ast-schema.js",libPath:"shim/expr/ast-schema.js",why:"imported by OvenBox, Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/actionCompiler.js",libPath:"frqtl/objects/objects/actionCompiler.js",why:"imported by OvenBox, Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/v1-replacements.js",libPath:"frqtl/objects/v1-replacements.js",why:"imported by SlitLightSource \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/slitLinerScatter.js",libPath:"frqtl/objects/objects/slitLinerScatter.js",why:"imported by SlitScreen, Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/setup/setupSphereEmitter3D.js",libPath:"frqtl/objects/setup/setupSphereEmitter3D.js",why:"imported by SphereEmitter \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/directedRedirectProgram.js",libPath:"frqtl/objects/objects/directedRedirectProgram.js",why:"imported by Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/compat/renderer/lo-drawn-center.js",libPath:"frqtl/compat/renderer/lo-drawn-center.js",why:"imported by Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/setup/setupTunnelPointExit.js",libPath:"frqtl/objects/setup/setupTunnelPointExit.js",why:"imported by Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/constants/WallBehaviors.js",libPath:"frqtl/objects/constants/WallBehaviors.js",why:"imported by Wall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/absorbRadiation.js",libPath:"frqtl/objects/objects/absorbRadiation.js",why:"imported by Wall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/geometry/SlabFace.js",libPath:"frqtl/objects/geometry/SlabFace.js",why:"imported by Wall \u2014 a forked copy imports it",tier:"part-internal"})]),xx=Object.freeze({specifier:"@descix/frqtl-web/boot",libPath:"frqtl/experiments/_shared/doors.js",why:"the scene doors (bootScene, bootProject)"}),cC=Object.freeze([xx,Object.freeze({specifier:"@descix/frqtl-web/registry",libPath:"shim/registry/index.js",why:"the walk-through rungs, the showcase roster, the scene list (sceneGroups), projectOf"}),Object.freeze({specifier:"@descix/frqtl-web/project",libPath:"shim/project/index.js",why:"the specifier table, the link site, sketchProject and the project identity"}),Object.freeze({specifier:"@descix/frqtl-web/host-view",libPath:"shim/host/index.js",why:"the DeSciX host-view declarer: a page declares its own view"})]),gp="@descix/frqtl-web";function ia(e){return e.specifier.endsWith("/")}o(ia,"_isPrefix");function gs(e){if(typeof e!="string")throw new TypeError("[specifiers] libPathOf(specifier): a string specifier (got "+typeof e+"). (FAIL-LOUD.)");for(let t of oi)if(!ia(t)&&t.specifier===e)return t.libPath;for(let t of oi)if(ia(t)&&e.startsWith(t.specifier)&&e.length>t.specifier.length){let r=e.slice(t.specifier.length);if(r.split("/").indexOf("..")!==-1)throw new Error('[specifiers] "'+e+'" climbs out of its prefix row ('+t.specifier+"). (FAIL-LOUD.)");return t.libPath+r}throw new Error('[specifiers] "'+e+'" is not a @descix/frqtl-web specifier \u2014 the table (lib/shim/project/specifiers.js FRQTL_WEB_SPECIFIERS) offers: '+oi.map(function(t){return t.specifier+(ia(t)?"<file>":"")}).join(", ")+". (FAIL-LOUD.)")}o(gs,"libPathOf");function Ox(e){for(let t of oi)if(!ia(t)&&t.specifier===e)return t;for(let t of oi)if(ia(t)&&e.startsWith(t.specifier)&&e.length>t.specifier.length)return t;return null}o(Ox,"_rowOf");function $g(e){return gs(e),Ox(e).tier}o($g,"tierOf");function vs(e){if(typeof e!="string"||!e)throw new TypeError("[specifiers] specifierOfLibPath(libPath): a lib-identity path (got "+JSON.stringify(e)+"). (FAIL-LOUD.)");for(let t of oi)if(!ia(t)&&t.libPath===e)return t.specifier;for(let t of oi)if(ia(t)&&e.startsWith(t.libPath)){let r=e.slice(t.libPath.length);if(r&&r.indexOf("/")===-1)return t.specifier+r}return null}o(vs,"specifierOfLibPath");var ev=oi.find(function(e){return e.libPath==="frqtl/parts/index.js"});if(!ev)throw new Error("[parts-module] FRQTL_WEB_SPECIFIERS has no row for the parts barrel (frqtl/parts/index.js). (FAIL-LOUD.)");var mc=ev.specifier,Ex=/^frqtl\/parts\/[A-Za-z_$][\w$]*\.js$/;function ys(e,t){if(typeof e!="string"||!e)throw new TypeError("[parts-module] moduleOfKind(from, urls): from is the kind row's module URL (got "+JSON.stringify(e)+"). (FAIL-LOUD.)");let r=ze();if(e.startsWith(r)&&Ex.test(e.slice(r.length)))return mc;if(t){for(let i of Object.keys(t))if(t[i]===e)return i}return null}o(ys,"moduleOfKind");function vp(e,t){if(typeof e!="string"||!e)throw new TypeError("[parts-module] importSpecifierOf(module, entry): a module specifier or project path. (FAIL-LOUD.)");if(e.startsWith("@"))return e;let r=t.split("/");r.pop();let i=e.split("/");for(;r.length&&i.length>1&&r[0]===i[0];)r.shift(),i.shift();let n=r.map(function(){return".."});return(n.length?n.join("/")+"/":"./")+i.join("/")}o(vp,"importSpecifierOf");un();Ea();Da();_r();Vt();Va();var Sx=100,kx=10,Ax=200,yp=Object.freeze(["fpsLimit","tpsLimit"]),rv=Object.freeze(["initWorld"]);function iv(e,t){if(e.RATE_LIMITS!==void 0)throw new Error("[FrqtlApp."+t+"] the RATE_LIMITS factory static is DELETED \u2014 pacing is declared where the scene is: exp.runner.setRateLimits({ fpsLimit?, tpsLimit? }) in a scene file, runner.setRateLimits(...) on a page. (FAIL-LOUD.)")}o(iv,"_refuseDeletedStatics");function tv(e,t){return t&&t[e]?t[e]:ea()[e]}o(tv,"_resolveEngineClass");function Tx(e,t){for(var r=e.get("Wall"),i=0;i<r.fields.length;i++)if(r.fields[i].name===t)return!0;return!1}o(Tx,"_isWallField");function nv(e){return e&&e.lo&&e.lo._owner===e?e:null}o(nv,"_wallFacadeOf");W._wallFacadeOf=nv;function av(e){if(typeof requestAnimationFrame!="function")throw new Error("[FrqtlApp."+e+"] no animation frame in this host \u2014 the wall-clock loop needs requestAnimationFrame. Drive the clock with `runner.step()` (one tick + render per call, any host), or boot in a browser through `@descix/frqtl-web/boot`. (FAIL-LOUD.)")}o(av,"_requireAnimationFrame");function W(e){e=e||{};var t=e.canvasW,r=e.canvasH;if(typeof t!="number"||!(t>0)||typeof r!="number"||!(r>0))throw new Error("[FrqtlApp] canvasW and canvasH are REQUIRED positive numbers (got "+JSON.stringify(t)+" x "+JSON.stringify(r)+"). There is no default world size: a scene states its world with exp.createCanvas(w, h, cfg) / exp.createScene(w, h, d, cfg); a page passes it here. (FAIL-LOUD.)");this._is3D=!!e.is3D,this._depth=e.canvasD!==void 0&&e.canvasD!==null?e.canvasD:null;var i=e.seed!==void 0?e.seed:42;this._canvasParentId=e.canvasParentId||null,this._onTick=e.onTick||null,this._onReady=e.onReady||null,this._tickListeners=[],this._drawHz=e.drawHz!==void 0&&e.drawHz>0?e.drawHz:0;var n=e.stepsPerFrame!==void 0?Math.max(1,e.stepsPerFrame):1;e.tickHz!==void 0&&e.tickHz>0?this._tickHz=e.tickHz:n>1?this._tickHz=this._drawHz>0?this._drawHz*n:60*n:this._tickHz=0,this.stepsPerFrame=n;var a=tv("Rectangle",e.engine);this.canvas_rect=new a(0,0,t,r,null,!1),this._seed=i,this._tickSuspend=0;var s=tv("EGPTUniverse",e.engine);this.universe=s.create({rect:this.canvas_rect,seed:i}),this._declared=[],this._declaredMembers=new Map,this._declaredTicks=new Map,this._setupResult=null,this._sceneReplay=null,this._designMode=!1,this._aim=null,this._selected=null,this._onObjectMoved=null,this._isLooping=!1,this._rafId=null,this._lastTickData=null,this._accumulator=0,this._lastFrame=0,this._lastDraw=0,this._lastBudgetWarn=0,this._BUDGET_WARN_INTERVAL_MS=5e3,this._rateWindowMs=1e3,this._rateWindowEnd=0,this._tickCount=0,this._drawCount=0,this._lastTps=0,this._lastFps=0,this._renderOptions={renderBaseCanvas:!0},this._stagedRenderOptions=null,this._renderer=null;var l=this;this._capture=lc.create({get lastTickData(){return l._lastTickData}},function(){return l._getRenderer()},{seed:this._seed,get rect(){return l.canvas_rect}},function(){return l._renderOptions})}o(W,"FrqtlApp");Object.defineProperty(W.prototype,"largeObjects",{configurable:!0,get:o(function(){var e=this.universe;return e&&Array.isArray(e.largeObjects)?e.largeObjects:[]},"get")});Object.defineProperty(W.prototype,"controlHost",{configurable:!0,get:o(function(){if(this._controlHost)return this._controlHost;var e=this._sceneSurface;return e&&e.parentNode?e.parentNode:null},"get"),set:o(function(e){if(!e||typeof e.appendChild!="function"||!e.ownerDocument)throw new TypeError("[FrqtlApp.controlHost] a control host is a DOM element (it carries appendChild + ownerDocument); got "+String(e)+". (FAIL-LOUD.)");this._controlHost=e;for(var t=(this._controlChrome||[]).slice(),r=0;r<t.length;r++)t[r].rehost(e)},"set")});W.prototype.addControlChrome=function(e){if(!e||typeof e.rehost!="function")throw new TypeError("[FrqtlApp.addControlChrome] chrome must expose rehost(el). (FAIL-LOUD.)");var t=this._controlChrome||(this._controlChrome=[]);return t.push(e),function(){var r=t.indexOf(e);r!==-1&&t.splice(r,1)}};W.prototype.setDesignMode=function(e){this._designMode=!!e};W.prototype._shellRenderOf=function(e){var t=e&&e.shellRender;return t==="design"||t==="run"||t==="never"?t:e&&e._designMarker===!0?"design":"run"};W.prototype._visibleLargeObjects=function(){var e=this.largeObjects;if(!e||e.length===0)return e;for(var t=this,r=!1,i=0;i<e.length;i++)if(e[i]&&!t._isShellVisible(e[i])){r=!0;break}return r?e.filter(function(n){return t._isShellVisible(n)}):e};W.prototype._isShellVisible=function(e){var t=this._shellRenderOf(e);return t==="run"?!0:t==="never"?!1:!!this._designMode};var vc="filter.";function yc(e){var t=mn,r=t.get()===e?t.name():null;return r?'renderer "'+r+'"':"the active renderer"}o(yc,"_providerLabel");function ov(e,t){if(typeof e.renderCapabilities!="function")throw new TypeError("[FrqtlApp.setRenderOption] "+yc(e)+' declares no renderCapabilities(), so it accepts no render option (tried "'+t.map(function(u){return u[0]}).join('", "')+'"). A provider declares its knobs by implementing renderCapabilities().');for(var r=e.renderCapabilities(),i={},n=0;n<r.length;n++)i[r[n].name]=r[n];for(var a=Be.normalizeValue,s=[],l=0;l<t.length;l++){var c=t[l][0];if(W.RUNNER_INJECTED_RENDER_KEYS.indexOf(c)!==-1)throw new TypeError('[FrqtlApp.setRenderOption] "'+c+'" is merged into the render bag by the runner itself (FrqtlApp.RUNNER_INJECTED_RENDER_KEYS); it is not a writable render option.');var f=Object.prototype.hasOwnProperty.call(i,c)?i[c]:null;if(!f)throw new TypeError('[FrqtlApp.setRenderOption] "'+c+'" is not a render option '+yc(e)+" declares. Declared by renderCapabilities(): ["+r.map(function(u){return u.name}).join(", ")+"]. (FAIL-LOUD: an undeclared key is read by nothing, so the picture would silently differ from the recipe.)");s.push([c,a(f,t[l][1],"render option")])}return s}o(ov,"_validateRenderWrites");W.prototype._applyRenderWrites=function(e){for(var t=0;t<e.length;t++){var r=e[t][0];r.indexOf(vc)===0?this.setFilterActive(r.slice(vc.length),!!e[t][1]):this._renderOptions[r]=e[t][1]}for(var i=(this._renderOptionsListeners||[]).slice(),n=0;n<i.length;n++)i[n](e.map(function(a){return[a[0],a[1]]}));this._isLooping||this.repaint()};W.prototype.addRenderOptionsListener=function(e){var t=this._renderOptionsListeners||(this._renderOptionsListeners=[]);return t.indexOf(e)===-1&&t.push(e),function(){var r=t.indexOf(e);r!==-1&&t.splice(r,1)}};W.prototype.setRenderOptions=function(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("[FrqtlApp.setRenderOptions] expects a plain object of { capabilityName: value }; got "+(Array.isArray(e)?"an array":String(e))+".");var t=Object.keys(e).map(function(i){return[i,e[i]]}),r=this._getRenderer();if(!r){this._stagedRenderOptions=(this._stagedRenderOptions||[]).concat(t);return}this._applyRenderWrites(ov(r,t))};W.prototype.setRenderOption=function(e,t){var r={};r[e]=t,this.setRenderOptions(r)};W.prototype.renderCapabilities=function(){var e=this._getRenderer();return!e||typeof e.renderCapabilities!="function"?[]:e.renderCapabilities()};W.prototype.getRenderOption=function(e){var t=this._getRenderer();if(!t)throw new TypeError("[FrqtlApp.getRenderOption] no display provider has attached yet, so no render option is declared. Read after the renderer boots.");if(typeof t.renderCapabilities!="function")throw new TypeError("[FrqtlApp.getRenderOption] "+yc(t)+' declares no renderCapabilities(), so "'+e+'" is not a render option it has.');for(var r=t.renderCapabilities(),i=!1,n=0;n<r.length;n++)if(r[n].name===e){i=!0;break}if(!i)throw new TypeError('[FrqtlApp.getRenderOption] "'+e+'" is not declared by '+yc(t)+" (declared: ["+r.map(function(a){return a.name}).join(", ")+"]).");return e.indexOf(vc)===0?this.isFilterActive(e.slice(vc.length)):this._renderOptions[e]};W.prototype.setFilterActive=function(e,t){var r=this._getRenderer();if(!r||typeof r.filter!="function"||typeof r.removeFilter!="function")throw new Error("[FrqtlApp.setFilterActive] no active renderer with filter()/removeFilter() (RendererProvider REQUIRED methods). (FAIL-LOUD.)");var i=Za;if(!Object.prototype.hasOwnProperty.call(i,e))throw new Error('[FrqtlApp.setFilterActive] unknown filter "'+e+'" \u2014 not a Filters.js catalog entry. (FAIL-LOUD.)');this._activeFilters||(this._activeFilters={}),t?(r.filter(i[e]),this._activeFilters[e]=!0):(r.removeFilter(e),delete this._activeFilters[e])};W.prototype.isFilterActive=function(e){return!!(this._activeFilters&&this._activeFilters[e])};W.prototype.setSourceRef=function(e){return this._capture.setSourceRef(e)};W.prototype.setSourceSha256=function(e){return this._capture.setSourceSha256(e)};W.prototype.sceneRecord=function(){return this._capture.sceneRecord()};W.prototype._assertRenderCensus=function(){var e=this.universe;if(!(!e||typeof e.unwrappedLargeObjectHandles!="function")){var t=e.unwrappedLargeObjectHandles();if(t.length!==0)throw new Error("[FrqtlApp] "+t.length+" object(s) are registered with the PHYSICS of this world but absent from its render census \u2014 handle(s) ["+t.join(", ")+"]. They collide and count correctly and CANNOT BE SEEN, which is the one outcome this surface refuses: a silently wrong picture is worse than an error, because what the eye is taught from it is wrong. Construct large objects through `new LargeObject(universe, \u2026)` (or a part that does \u2014 Wall, GraphingDetectorWall, Tunnel \u2026), which registers them for physics AND render in one act. The raw `universe.registerLargeObject(spec)` path carries no wrapper and belongs to headless harnesses only. (FAIL-LOUD.)")}};W.prototype.capture=function(e){try{this._assertRenderCensus()}catch(t){return Promise.reject(t)}return this._capture.capture(e)};W.prototype.captureStill=function(){try{this._assertRenderCensus()}catch(e){return Promise.reject(e)}return this._capture.captureStill()};W.prototype.addBackdrop=function(e,t,r){r=r||{};var i=t||{left:0,top:0,w:this.canvas_rect.w,h:this.canvas_rect.h},n=r.color||[0,0,0],a=r.visible!==void 0?r.visible:!1,s=Se,l=Ee,c=new s(this.universe,[i.left,i.top,i.w,i.h],l.NONE,[],"backdrop","closest",null,1,n);return c.backdrop=!0,c.image=e,c.visible=a,c};function bs(e){return e._declaredMembers||(e._declaredMembers=new Map)}o(bs,"_declaredMembersMap");function ws(e){return e._declaredTicks||(e._declaredTicks=new Map)}o(ws,"_declaredTicksMap");Object.defineProperty(W.prototype,"declared",{configurable:!0,get:o(function(){var e=this._declared||(this._declared=[]);if(!e.length)return e;for(var t=new Set(this.largeObjects),r=bs(this),i=0;i<e.length;i++)for(var n=r.get(e[i])||[],a=0;a<n.length;a++)if(!t.has(n[a]))throw new Error('[FrqtlApp.declared] stale declaration \u2014 "'+(e[i].name||e[i]._schemaKind)+'" lost its census LO "'+(n[a].name||"?")+'": the world was re-inited without clearing the registry (clearDeclared runs at FrqtlApp.setup and the RecipeContext co-init exp.createCanvas / exp.createScene \u2014 the world-init paths). (FAIL-LOUD.)');return e},"get")});W.prototype.declare=function(e,t,r,i){if(!e||typeof e!="object")throw new TypeError("[FrqtlApp.declare] a declared object is a handle, got "+typeof e+". (FAIL-LOUD.)");var n=this._declared||(this._declared=[]);if(n.indexOf(e)!==-1)throw new Error('[FrqtlApp.declare] "'+(e.name||e._schemaKind)+'" is already declared. (FAIL-LOUD.)');n.push(e);var a=(t||[]).slice();bs(this).set(e,a),ws(this).set(e,(r||[]).slice());for(var s=0;s<a.length;s++)if(this.declaredOf(a[s])!==e)throw n.pop(),bs(this).delete(e),ws(this).delete(e),new Error('[FrqtlApp.declare] "'+(e.name||e._schemaKind)+'" put the LO "'+(a[s].name||"?")+'" in the world without an `_owner` chain ending at it \u2014 a composer stamps ONE up-link on what it composed, so every drawn thing resolves to its declared object. (FAIL-LOUD.)');var l=i&&i.kind||e._schemaKind,c=l?Dt(l):null;return Cx(e,{inParts:!1,module:c?ys(c.from,this._projectUrls||null):null}),e};var gc=new WeakMap;function Cx(e,t){gc.set(e,t),Object.prototype.hasOwnProperty.call(e,"inParts")||(Object.defineProperty(e,"inParts",{configurable:!0,enumerable:!1,get:o(function(){var r=gc.get(this);return r?r.inParts:!1},"get")}),Object.defineProperty(e,"module",{configurable:!0,enumerable:!1,get:o(function(){var r=gc.get(this);return r?r.module:null},"get")}))}o(Cx,"_setCensusRow");function sv(e,t){var r=e._declared;if(!(!r||!r.length)){var i=e.declaredOf(t);i&&(e._handTouched||(e._handTouched=new Set)).add(i)}}o(sv,"_markHand");W.prototype._takeHandTouched=function(){var e=this._handTouched||new Set;return this._handTouched=new Set,e};W.prototype._adoptIntoParts=function(e){var t=gc.get(e);if(!t)throw new Error('[FrqtlApp] _adoptIntoParts: "'+(e&&e.name)+'" is not a declared object. (FAIL-LOUD.)');t.inParts=!0};W.prototype.beginWorld=function(){this._lastTickData=null};W.prototype.clearDeclared=function(){this._declared=[],this._declaredMembers=new Map,this._declaredTicks=new Map,this._handTouched=new Set};W.prototype.declaredOf=function(e){for(var t=this._declared||[],r=e,i=0;r&&i<64;r=r._owner,i++)if(t.indexOf(r)!==-1)return r;return null};W.prototype.membersOf=function(e){return(bs(this).get(e)||[]).slice()};W.prototype.undeclaredTickFunctions=function(){var e=this.universe&&Array.isArray(this.universe.experimentTickFunctions)?this.universe.experimentTickFunctions:[],t=new Set;return ws(this).forEach(function(r){for(var i=0;i<r.length;i++)t.add(r[i])}),e.filter(function(r){return!t.has(r)})};W.prototype.removeObject=function(e){var t=this.declared,r=t.indexOf(e);if(r===-1){var i=this.declaredOf(e);throw i?new Error('[FrqtlApp.removeObject] "'+(e&&e.name)+'" is part of the declared '+(i._schemaKind||"object")+' "'+i.name+'" \u2014 delete "'+i.name+'", not its part. (FAIL-LOUD.)'):new Error('[FrqtlApp.removeObject] "'+(e&&(e.name||e._schemaKind))+'" is not a declared object (runner.declared) \u2014 only what a declaring call (exp.addObject, a palette drop) produced is removed here; a primitive-surface object is disposed by whoever built it (obj.dispose()). (FAIL-LOUD.)')}if(typeof e.dispose!="function")throw new Error("[FrqtlApp.removeObject] the declared "+(e._schemaKind||"object")+' "'+e.name+'" has no dispose() \u2014 a part tears down what it composed. (FAIL-LOUD.)');var n=this.membersOf(e),a=(ws(this).get(e)||[]).slice();t.splice(r,1),bs(this).delete(e),ws(this).delete(e),e.dispose();var s=this.universe&&Array.isArray(this.universe.experimentTickFunctions)?this.universe.experimentTickFunctions:[],l=a.filter(function(u){return s.indexOf(u)!==-1});if(l.length)throw new Error('[FrqtlApp.removeObject] disposing "'+e.name+'" left '+l.length+" of its tick-functions running \u2014 its dispose() must tear down everything it composed. (FAIL-LOUD.)");var c=new Set(this.largeObjects),f=n.filter(function(u){return c.has(u)});if(f.length)throw new Error('[FrqtlApp.removeObject] disposing "'+e.name+'" left '+f.length+" of its LOs in the world ("+f.map(function(u){return u.name}).join(", ")+") \u2014 its dispose() must tear down everything it composed. (FAIL-LOUD.)")};W.prototype.getObjectByName=function(e,t){if(typeof e!="string"||!e)return null;for(var r=this.declared,i=0;i<r.length;i++){var n=r[i];if(n&&n.name===e&&(!t||t(n)))return n}return null};function jx(e,t,r,i){var n=e.largeObjects;if(!(!t||!n||n.length===0)){for(var a=Be,s=[],l=0;l<n.length;l++)for(var c=n[l],f=0;c&&c._owner&&f<64;c=c._owner,f++)if(c._owner===t){s.indexOf(c)===-1&&s.push(c);break}for(var u=0;u<s.length;u++){var h=s[u];if(a){var g=a.get(h._schemaKind||h.kind||"LargeObject"),d=!1;if(g){for(var m=0;m<g.fields.length;m++)if(g.fields[m].name===r){d=!0;break}}if(!d)continue}e.updateObjectProperty(h,r,i)}}}o(jx,"_fanOutRenderPropToGroup");W.prototype.updateObjectProperty=function(e,t,r){if(e){var i=t==="name"?this.declaredOf(e):null;if(i&&i.inParts)throw new TypeError('[FrqtlApp.updateObjectProperty] "name" of the parts entry "'+i.name+'": '+W.RENAME_REFUSAL+" (FAIL-LOUD.)");sv(this,e);var n=e._schemaKind||e.kind;if(!n)throw new TypeError('[FrqtlApp.updateObjectProperty] this object carries no `_schemaKind` (nor `kind`), so its descriptor cannot be resolved \u2014 property "'+t+'" was not rejected by any schema. Every shipped object class stamps `_schemaKind`; a handle without one is usually the wrong handle (e.g. a raw emitter handle rather than the palette object that wraps it).');var a=Be,s=null;if(a){var l=a.get(n);if(!l)throw new TypeError('[FrqtlApp.updateObjectProperty] Unknown object kind "'+n+'"');for(var c=0;c<l.fields.length;c++)if(l.fields[c].name===t){s=l.fields[c];break}if(!s)throw new TypeError('[FrqtlApp.updateObjectProperty] Property "'+t+'" is not in the schema for kind "'+n+'"');if(s.type==="readonly")throw new TypeError('[FrqtlApp.updateObjectProperty] Property "'+t+'" is readonly for kind "'+n+'"');r=a.normalizeValue(s,r,n);var f=nv(e);if(t==="rect"&&f){f.setRect(r),typeof this._onObjectMoved=="function"&&this._onObjectMoved(f,t);return}var u=["collisionBehavior","bounceDirection","decoherence","hooks","markTag","countFilter","capacity","orientationDeg","pitchDeg"];if(f===e&&Tx(a,t)){u.indexOf(t)!==-1?typeof e.setV2Prop=="function"&&e.setV2Prop(t,r):e.lo&&this.updateObjectProperty(e.lo,t,r),t==="rect"&&typeof this._onObjectMoved=="function"&&this._onObjectMoved(e,t);return}if(n==="Tunnel"&&typeof e.applyProp=="function"&&e.applyProp(t,r)){(t==="rect"||t==="left"||t==="top")&&typeof this._onObjectMoved=="function"&&this._onObjectMoved(e,t);return}if(n==="SphereEmitter"){typeof e.applyProp=="function"&&e.applyProp(t,r),(t==="center"||t==="rect")&&typeof this._onObjectMoved=="function"&&this._onObjectMoved(e,t);return}if(!s.engineVisible){if((n==="LargeObject"||n==="backdrop")&&(t==="collision_type"||t==="actions")&&typeof e.recompileActions=="function"){var h={};h[t==="collision_type"?"collisionType":"actions"]=r,e.recompileActions(h);return}e[t]=r,jx(this,e,t,r);return}}if(t==="rect"&&e.rect){if(typeof e.setRect!="function")throw new TypeError('[FrqtlApp.updateObjectProperty] "'+(e.name||n)+'" ('+n+") carries a rect but no setRect \u2014 its rect has no writer, so a rect write cannot land. (FAIL-LOUD.)");e.setRect(r);return}if(t!=="rect"&&t!=="source_rects")if(t==="actions"&&(n==="LargeObject"||n==="backdrop")){var g=Array.isArray(r)?r.slice():[r];e.arr_collision_actions=g,e.actions=g}else t==="layer"&&(n==="LargeObject"||n==="backdrop")?(e.layer=r??null,e.observedDimensions=r!=null?[r]:[]):e[t]=r;if(n==="PointSource"&&t==="rect"){typeof e.repositionToRect=="function"&&e.repositionToRect(r[0],r[1],r[2],r[3],this.universe);return}if(n==="QuantumEmitter"&&t==="rect"){typeof e.setSourceRect=="function"&&e.setSourceRect(r);return}this.universe&&typeof this.universe.updateObjectProperty=="function"&&this.universe.updateObjectProperty(e.handle,n,t,r)}};W.prototype._centerOf=function(e){if(!e||typeof e.getCenter!="function"||typeof e.setCenter!="function")return null;var t=e.getCenter();return Array.isArray(t)?t:null};W.prototype._rectAuthorityOf=function(e){return e&&e.rect&&typeof e.setRect=="function"?e:null};W.prototype.positionAuthorityOf=function(e){return this._centerOf(e)?"center":this._rectAuthorityOf(e)?"rect":null};W.prototype.noPositionAuthorityMessage=function(e){return'"'+(e&&e.name)+'" ('+(e&&e._schemaKind||"object")+") has no position authority \u2014 neither a centre (getCenter/setCenter) nor a rect (rect + setRect) \u2014 so it cannot be moved as a unit."};W.prototype._requireDeclared=function(e,t){if(e&&this.declaredOf(e)===e)return e;var r=e?this.declaredOf(e):null;throw new Error("[FrqtlApp."+t+"] "+(e?'"'+(e.name||e._schemaKind||"object")+'"':String(e))+" is not a declared object \u2014 only what the scene declared (runner.declared) is placed or read here"+(r?"; it belongs to the declared "+(r._schemaKind||"object")+' "'+r.name+'" \u2014 pass that handle (runner.declaredOf(x))':"; a primitive-surface object is not manipulable")+". (FAIL-LOUD.)")};W.prototype.centerOf=function(e){this._requireDeclared(e,"centerOf");var t=this._centerOf(e);if(t)return t;var r=this._rectAuthorityOf(e);if(r)return Vn(r.rect);throw new Error(this.noPositionAuthorityMessage(e))};W.prototype.kindOf=function(e){if(this._requireDeclared(e,"kindOf"),typeof e._schemaKind!="string"||!e._schemaKind)throw new Error('[FrqtlApp.kindOf] the declared object "'+e.name+'" carries no kind stamp \u2014 ObjectFactory.create stamps every declaration. (FAIL-LOUD.)');return e._schemaKind};W.prototype._placementAuthority=function(e){if(this._centerOf(e))return"center";var t=this._rectAuthorityOf(e);if(!t)throw new Error(this.noPositionAuthorityMessage(e));return typeof t.assertOwnsProgram=="function"&&t.assertOwnsProgram(),"rect"};W.prototype.placeDeclaredAt=function(e,t){if(sv(this,e),this._requireDeclared(e,"placeDeclaredAt"),!Array.isArray(t)||t.length!==2&&t.length!==3||!t.every(function(s){return typeof s=="number"&&isFinite(s)}))throw new TypeError("[FrqtlApp.placeDeclaredAt] the point is [x, y, z?] of finite numbers; got "+JSON.stringify(t)+". (FAIL-LOUD.)");var r=[t[0],t[1],t.length===3?t[2]:0],i=this.getUniverseBounds();if(r[0]<0||r[0]>i.width||r[1]<0||r[1]>i.height||r[2]<-i.zHalf||r[2]>i.zHalf)throw new RangeError("[FrqtlApp.placeDeclaredAt] "+JSON.stringify(r)+" is outside the universe cube (getUniverseBounds(): width "+i.width+", height "+i.height+", zHalf "+i.zHalf+" \u2014 x in [0, width], y in [0, height], z in [-zHalf, zHalf]). (FAIL-LOUD.)");var n=!1;if(this._placementAuthority(e)==="rect"){var a=Bi;a.hasZ(e.rect)||(n=Math.abs(r[2])>W.Z_HOLD_EPS,r=[r[0],r[1],0]),this.updateObjectProperty(e,"rect",a.snapRectPosition(a.rectAtCenter(e.rect,r)))}else this.updateObjectProperty(e,"center",nf(r));return{center:this.centerOf(e),zHeld:n}};W.prototype._orientationOf=function(e){return e&&typeof e.setOrientation=="function"?e:null};W.prototype.envelopeOf=function(e){if(e&&e.rect&&typeof e.rect.w=="number")return e.rect;for(var t=this.membersOf(e),r=1/0,i=1/0,n=-1/0,a=-1/0,s=1/0,l=-1/0,c=!1,f=0;f<t.length;f++){var u=t[f]&&t[f].rect;u&&(r=Math.min(r,u.left),i=Math.min(i,u.top),n=Math.max(n,u.left+u.w),a=Math.max(a,u.top+u.h),yi(u)&&(c=!0,s=Math.min(s,u.z),l=Math.max(l,u.z+(typeof u.d=="number"?u.d:u.w))))}if(!(r<n)||!(i<a))return null;var h={left:r,top:i,w:n-r,h:a-i};return c&&(h.z=s,h.d=l-s),h};W.prototype._objectCentroid=function(e){var t=this._centerOf(this.declaredOf(e));if(t)return t;var r=e&&e.rect;return r?Vn(r):null};W.prototype.getUniverseBounds=function(){var e=Be.worldRect(this.canvas_rect,"FrqtlApp.getUniverseBounds canvas_rect"),t=e.w,r=e.h;return{width:t,height:r,zHalf:Math.min(t,r)/2}};W.prototype._clampToUniverseCube=function(e){var t=this.getUniverseBounds(),r=Math.max(0,Math.min(t.width,e[0])),i=Math.max(0,Math.min(t.height,e[1])),n=Math.max(-t.zHalf,Math.min(t.zHalf,e[2]!=null?e[2]:0));return[r,i,n]};W.HOVER_MARGIN=6;W.HEADING_HOLD_EPS=.05;W.HEADING_WRITE_EPS_DEG=1e-6;W.Z_HOLD_EPS=1e-6;W.RENAME_REFUSAL="the key is the name \u2014 a rename is a new key in `parts` (with every reference to it, in code) or a fork of the sketch; a hand never writes a `name` into an entry.";var lv="off",Rx="roaming",Dx="grab-ready",Lx="grabbed";W.prototype.setAimArmed=function(e){if(!e){if(!this._aim)return;this._aim.unsubscribePose(),this._aim=null,this._notifyAim();return}if(!this._aim){var t=this.cameraControl;if(So(t)){if(typeof t.addPoseListener!="function"||typeof t.cameraOffsetFromWorld!="function"||typeof t.worldFromCameraOffset!="function")throw new Error("[FrqtlApp.setAimArmed] the angular camera handle lacks addPoseListener / cameraOffsetFromWorld / worldFromCameraOffset \u2014 the aim follows the camera through its pose notice and reads the ray off the offset pair (RENDERER_CONTRACT \xA71a.2). (FAIL-LOUD.)");var r=this;this._aim={cam:t,hover:null,grab:null,atEdge:!1,headingHeld:!1,zHeld:!1,error:null,last:null,unsubscribePose:null},this._aim.unsubscribePose=t.addPoseListener(function(){r._onAimPose()}),this._refreshHover(),this._notifyAim()}}};W.prototype.isAimArmed=function(){return!!this._aim};W.prototype.getAimState=function(){var e=this._aim;return e?{state:e.grab?Lx:e.hover?Dx:Rx,hover:e.hover?e.hover.name||"":null,grabbed:e.grab?e.grab.object.name||"":null,atEdge:!!(e.grab&&e.atEdge),headingHeld:!!(e.grab&&e.headingHeld),zHeld:!!(e.grab&&e.zHeld),error:e.error}:{state:lv,hover:null,grabbed:null,atEdge:!1,headingHeld:!1,zHeld:!1,error:null}};W.prototype.getGrabbedObject=function(){return this._aim&&this._aim.grab?this._aim.grab.object:null};W.prototype.addAimListener=function(e){var t=this._aimListeners||(this._aimListeners=[]);return t.indexOf(e)===-1&&t.push(e),function(){var r=t.indexOf(e);r!==-1&&t.splice(r,1)}};W.prototype._notifyAim=function(){var e=this.getAimState();this._aim&&(this._aim.last=JSON.stringify(e));for(var t=(this._aimListeners||[]).slice(),r=0;r<t.length;r++)t[r](e)};W.prototype._notifyAimIfChanged=function(){this._aim&&JSON.stringify(this.getAimState())===this._aim.last||this._notifyAim()};W.prototype.grabToggle=function(){var e=this._aim;if(!e)return lv;if(e.error=null,e.grab)this._releaseGrab();else if(this._refreshHover(),e.hover)try{e.grab=this._captureGrab(e.hover),e.atEdge=!1,e.headingHeld=!1,e.zHeld=!1}catch(t){e.grab=null,e.error="the object cannot be grabbed: "+(t&&t.message?t.message:t)}return this._notifyAim(),this.getAimState().state};W.prototype._releaseGrab=function(){this._aim&&(this._aim.grab=null,this._aim.atEdge=!1,this._aim.headingHeld=!1,this._aim.zHeld=!1)};W.prototype.setSelectHighlight=function(e){this._selected=e||null;var t=this._aim;t&&t.grab&&t.grab.object!==this._selected&&(this._releaseGrab(),t.error=null,this._notifyAim())};W.prototype._captureGrab=function(e){var t=this._aim.cam;this._placementAuthority(e);var r=this.centerOf(e),i=this._orientationOf(e),n={object:e,off:t.cameraOffsetFromWorld(r),oriTarget:i,hCam:null};if(i&&typeof i.getOrientation=="function"){var a=(i.getOrientation()||0)*Math.PI/180,s=t.cameraOffsetFromWorld([0,0,0]),l=t.cameraOffsetFromWorld([Math.cos(a),Math.sin(a),0]);n.hCam={right:l.right-s.right,up:l.up-s.up,forward:l.forward-s.forward}}return n};W.prototype._onAimPose=function(){this._aim&&this._aim.grab&&this._carryGrab(),this._refreshHover(),this._notifyAimIfChanged()};W.prototype._carryGrab=function(){var e=this._aim,t=e.grab,r=e.cam;try{var i=r.worldFromCameraOffset(t.off),n=this._clampToUniverseCube(i);e.atEdge=Math.abs(n[0]-i[0])+Math.abs(n[1]-i[1])+Math.abs(n[2]-i[2])>1e-6;var a=this.placeDeclaredAt(t.object,n);if(e.zHeld=a.zHeld,t.off=r.cameraOffsetFromWorld(a.zHeld?[n[0],n[1],0]:n),t.hCam){var s=r.worldFromCameraOffset({right:0,up:0,forward:0}),l=r.worldFromCameraOffset(t.hCam),c=l[0]-s[0],f=l[1]-s[1];if(e.headingHeld=Math.hypot(c,f)<W.HEADING_HOLD_EPS,!e.headingHeld){var u=Math.atan2(f,c)*180/Math.PI,h=typeof t.oriTarget.getOrientation=="function"?t.oriTarget.getOrientation():null,g=h===null?1/0:Math.abs(((u-h)%360+540)%360-180);g>W.HEADING_WRITE_EPS_DEG&&t.oriTarget.setOrientation(u)}}}catch(d){this._releaseGrab(),e.error="the grabbed object could not follow the camera: "+(d&&d.message?d.message:d),this._notifyAim()}};W.prototype._aimVolume=function(e,t){var r=Bi,i=this._centerOf(t===void 0?this.declaredOf(e):t);if(i){var n=e.rect?Math.max(e.rect.w||0,e.rect.h||0)/2:0;return r.drawnVolume({center:i,radius:n})}return e.rect?r.drawnVolume(e):null};W.prototype._declaredVolume=function(e){var t=this.membersOf(e);if(t.length===1||this._centerOf(e))return t.length?this._aimVolume(t[0],e):null;var r=this.envelopeOf(e);return r?tf({rect:r}):null};W.prototype._isDeclaredAimable=function(e){for(var t=this.membersOf(e),r=0;r<t.length;r++)if(this._isAimable(t[r]))return!0;return!1};W.prototype._isAimable=function(e){return!!e&&!e.backdrop&&e.visible!==!1&&this._isShellVisible(e)};W.prototype._centerRay=function(){var e=this._aim.cam,t=e.worldFromCameraOffset({right:0,up:0,forward:0}),r=e.worldFromCameraOffset({right:0,up:0,forward:1});return{origin:t,dir:[r[0]-t[0],r[1]-t[1],r[2]-t[2]]}};W.prototype._refreshHover=function(){var e=this._aim;if(e){for(var t=this.largeObjects,r=[],i=[],n=0;n<t.length;n++)if(this._isAimable(t[n])){var a=this.declaredOf(t[n]);if(a){var s=this._aimVolume(t[n],a);s&&(r.push(a),i.push(s))}}var l=this._centerRay(),c=rf(l.origin,l.dir,i,W.HOVER_MARGIN),f=c?r[c.index]:null;f!==e.hover&&(e.error=null),e.hover=f}};var cv="aimFeedback";W.RUNNER_INJECTED_RENDER_KEYS=Object.freeze([cv]);W.prototype._computeAimFeedback=function(){var e=this._aim;if(!e)return null;this._refreshHover(),this._notifyAimIfChanged();var t=this;function r(f){var u=f&&t._declaredVolume(f);return u?{name:f.name||"",volume:u}:null}o(r,"mark");var i={bounds:this.getUniverseBounds(),state:this.getAimState().state},n=r(e.grab?e.grab.object:e.hover);n&&(i.hover=n);var a=this._selected&&this._isDeclaredAimable(this._selected)?r(this._selected):null;a&&(i.selected=a),e.grab&&n&&(i.grabbed=n);var s=e.grab?e.grab.object:this._selected,l=this._orientationOf(s),c=s?this._declaredVolume(s):null;return l&&c&&typeof l.getOrientation=="function"&&(i.orientation={pivot:c.center,deg:l.getOrientation()||0}),i};W.prototype._renderOptsWithFeedback=function(){var e=this._computeAimFeedback();if(!e)return this._renderOptions;var t=Object.assign({},this._renderOptions);return t[cv]=e,t};W.prototype.screenPointOf=function(e,t,r,i){var n=this.renderer;if(!n||typeof n.screenToWorld!="function")throw new Error("[FrqtlApp.screenPointOf] the active renderer provider has no screenToWorld capability (RENDERER_CONTRACT) \u2014 world\u2192screen is its adjoint and has no other source. (FAIL-LOUD.)");for(var a=typeof e[2]=="number"?e[2]:0,s=i?i[0]:t/2,l=i?i[1]:r/2,c=0;c<8;c++){var f=n.screenToWorld(s,l,t,r,a),u=n.screenToWorld(s+1,l,t,r,a),h=n.screenToWorld(s,l+1,t,r,a);if(!f||!u||!h)return null;var g=u.x-f.x,d=h.x-f.x,m=u.y-f.y,b=h.y-f.y,y=g*b-d*m;if(!y)return null;var w=e[0]-f.x,x=e[1]-f.y,S=(b*w-d*x)/y,A=(g*x-m*w)/y;if(s+=S,l+=A,Math.abs(S)+Math.abs(A)<.05)break}var T=n.screenToWorld(s,l,t,r,a);return!T||Math.abs(T.x-e[0])+Math.abs(T.y-e[1])>.5?null:[s,l]};W.PICK_RADIUS_PX=32;W.PICK_DRIVE_PRIORITY=2;W.prototype.pickObjectAtScreen=function(e,t,r,i){var n=this.renderer;if(!n||typeof n.screenToWorld!="function")return null;for(var a=this.largeObjects,s=null,l=1/0,c=0;c<a.length;c++){var f=a[c],u=this.declaredOf(f);if(u){var h=this._objectCentroid(f);if(h){var g=this.screenPointOf(h,r,i,[e,t]);if(g){var d=typeof u.getCenter=="function",m=Math.hypot(g[0]-e,g[1]-t)/(d?W.PICK_DRIVE_PRIORITY:1);m<l&&(l=m,s=u)}}}}return l<=W.PICK_RADIUS_PX?s:null};W.prototype.setUniverseProperty=function(e,t){var r=Be;if(!r)throw new TypeError('[FrqtlApp.setUniverseProperty] ObjectSchema is unavailable \u2014 cannot validate "'+e+'" (FAIL-LOUD: never write to the universe unvalidated).');var i=r.get("Universe");if(!i)throw new TypeError('[FrqtlApp.setUniverseProperty] Unknown object kind "Universe"');for(var n=null,a=0;a<i.fields.length;a++)if(i.fields[a].name===e){n=i.fields[a];break}if(!n)throw new TypeError('[FrqtlApp.setUniverseProperty] Property "'+e+'" is not in the schema for kind "Universe". Valid properties: '+i.fields.map(function(s){return s.name}).join(", "));if(n.type==="readonly")throw new TypeError('[FrqtlApp.setUniverseProperty] Property "'+e+'" is readonly for kind "Universe"');this.universe[e]=t};W.prototype.getUniverseProperty=function(e){var t=Be;if(t){var r=t.get("Universe");if(r){for(var i=null,n=0;n<r.fields.length;n++)if(r.fields[n].name===e){i=r.fields[n];break}if(!i)throw new TypeError('[FrqtlApp.getUniverseProperty] Property "'+e+'" is not in the schema for kind "Universe". Valid properties: '+r.fields.map(function(a){return a.name}).join(", "))}}return this.universe[e]};W.prototype.moveLargeObject=function(e,t,r,i,n){if(!(!e||!e.rect)){var a=i!==void 0?i:e.rect.w,s=n!==void 0?n:e.rect.h;this.updateObjectProperty(e,"rect",[t,r,a,s])}};W.prototype.createCanvas=function(){this._createCanvasCalled=!0;var e=this._getRenderer();if(e&&e.init){var t={parentEl:this._canvasParentId,width:this.canvas_rect.w,height:this.canvas_rect.h,is3D:this._is3D};this._depth!==null&&(t.depth=this._depth);var r=Go,i=r.requireSceneSurface("FrqtlApp.createCanvas",e.init(t));return i.setAttribute(r.SCENE_SURFACE_ATTR,""),this._sceneSurface=i,this._onReady&&this._onReady(this),i}throw new Error("[FrqtlApp.createCanvas] no RendererProvider is active \u2014 one is selected by the boot module (lib/frqtl/experiments/_shared/boot.js) \u2014 a page boots through bootPage(), a programmatic host awaits bootRealm() \u2014 before calling createCanvas().")};W.prototype.setup=function(e,t){t=t||{},this._aim&&this.setAimArmed(!1),this._selected=null,this._setupResult&&typeof this._setupResult.dispose=="function"&&this._setupResult.dispose();var r=this;return this.retainSceneReplay(function(){return r.setup(e,t)}),this.clearDeclared(),iv(e,"setup"),typeof e.initWorld=="function"&&e.initWorld(this.universe,t),this._setupResult=e(this.universe,t),this._setupResult};W.prototype.retainSceneReplay=function(e){if(typeof e!="function")throw new TypeError("[FrqtlApp] retainSceneReplay(fn) takes the scene's replay function; got "+(e===null?"null":typeof e)+". (FAIL-LOUD.)");this._sceneReplay=e};W.prototype.restart=function(){if(typeof this._sceneReplay!="function")throw new Error("[FrqtlApp] restart(): nothing to replay \u2014 no scene has been built on this runner. Build one first with runner.setup(factory, opts) or RecipeContext.build(sketch). (FAIL-LOUD \u2014 a restart with nothing to replay would silently do nothing.)");this.stop();var e=this;function t(i){return e.beginWorld(),e.start(),i}o(t,"resume");var r;try{r=this._sceneReplay()}catch(i){return Promise.reject(i)}return r&&typeof r.then=="function"?r.then(t):Promise.resolve(t(r))};W.prototype._getRenderer=function(){if(!this._renderer){var e=Kh();if(e){var t=this._stagedRenderOptions?ov(e,this._stagedRenderOptions):null;this._createCanvasCalled||e.setSize(this.canvas_rect.w,this.canvas_rect.h),this._renderer=e,t&&(this._stagedRenderOptions=null,this._applyRenderWrites(t))}}return this._renderer||null};Object.defineProperty(W.prototype,"cameraControl",{configurable:!0,get:o(function(){if(!this._cameraControl){var e=this._getRenderer();e&&typeof e.getCameraControl=="function"&&(this._cameraControl=e.getCameraControl())}return this._cameraControl||null},"get")});W.prototype._failLoudMissingRenderer=function(){var e=`FrqtlApp: the DISPLAY SLOT is empty (FrqtlDisplay.get() === null).
17
+ `+String(U))})}}o(go,"_ensureMeshLoaded");function Ps(E,I,z,G,U){xe||(xe=new t.Group,xe.frustumCulled=!1,c.add(xe));for(var fe=Ve[U]||(Ve[U]=[]),re=typeof G=="number"&&G>0?G:1,Ge=z&&I?I.length:0,rt=0;rt<Ge;rt++){var Ne=I[rt],Fe=fe[rt];Fe||(Fe=E.scene.clone(!0),Fe.frustumCulled=!1,fe[rt]=Fe,xe.add(Fe));var it=Ne.data&&Ne.data.string_map,He=re;if(it&&it["render.meshScale"]!=null){var Pe=Number(it["render.meshScale"]);!isNaN(Pe)&&Pe>0&&(He=Pe)}var kt=(Ne.rect&&Ne.rect.w?Ne.rect.w:1)*E.norm*He;if(Fe.scale.setScalar(kt),Fe.position.set(Ne.rect.x,Ne.rect.y,Ne.z||0),Fe.userData.frameLayer=Ne.layer,it&&it["render.meshRotation"]!=null){var Ie=String(it["render.meshRotation"]).split(",").map(Number);Ie.length>=3&&Ie.every(function(St){return!isNaN(St)})?Fe.rotation.set(Ie[0],Ie[1],Ie[2]):Fe.rotation.set(0,0,0)}else Fe.rotation.set(0,0,0);Fe.visible=!0}for(var nt=Ge;nt<fe.length;nt++)fe[nt]&&(fe[nt].visible=!1);return Ge>0&&xe&&(xe.visible=!0),Ge}o(Ps,"_layoutMeshClones");function Is(E){for(var I in Ve)if(Ve.hasOwnProperty(I)&&!(E&&E.indexOf(I)!==-1))for(var z=Ve[I],G=0;G<z.length;G++)z[G]&&(z[G].visible=!1)}o(Is,"_hideMeshClonesExcept");function Jc(E,I){if(E){for(var z=new Set,G=0;G<E.length;G++){var U=E[G];z.add(U);var fe=fo(U,I),re=H.get(U);if(!re||re.sig!==fe){re&&re.mesh&&c.remove(re.mesh);var Ge=po(U,I);re={mesh:Ge,sig:fe,skinSig:null},H.set(U,re),c.add(Ge)}var rt=mx(U);re.skinSig!==rt&&(re.mesh&&re.mesh.material&&gx(re.mesh.material,U),re.skinSig=rt);var Ne=Vn(U.rect);re.mesh.position.set(Ne[0],Ne[1],Ne[2]);var Fe=typeof U.orientationDeg=="number"?(U.orientationDeg%360+360)%360:0,it=typeof U.pitchDeg=="number"?U.pitchDeg:0;if(U.billboard||(re.mesh.rotation.order="ZYX",re.mesh.rotation.z=Fe*Math.PI/180,re.mesh.rotation.y=it*Math.PI/180),U.billboard&&f&&re.mesh.quaternion.copy(f.quaternion),U.liveCanvas&&re.mesh&&re.mesh.material){for(var He=ua(U),Pe=re.mesh.userData||(re.mesh.userData={}),kt=Pe.liveCanvasFaces||[{index:-1,mirrorU:!1,mirrorV:!1}],Ie=0;Ie<kt.length;Ie++){var nt=kt[Ie],St=nt.index>=0&&Array.isArray(re.mesh.material)?re.mesh.material[nt.index]:re.mesh.material;if(St)if(He&&(Pe.liveCanvasSrc!==He||!St.map)){if(St.map)try{St.map.dispose()}catch{}St.map=fi(He,nt),St.color&&St.color.setRGB(1,1,1),St.transparent=!0,St.needsUpdate=!0}else He&&St.map&&(St.map.needsUpdate=!0)}He&&(Pe.liveCanvasSrc=He)}re.mesh.visible=U.visible!==!1}H.forEach(function(dr,Jt){z.has(Jt)||(dr.mesh.visible=!1)})}}o(Jc,"_syncLargeObjects");function Qc(E){if(!(!E||!E.frameData||!se)){var I=Er.buildHeightField(E.frameData,Object.assign({},Er.FIELD_OPTS,{canvasW:a(),canvasH:s()}));se.set(I),zt.needsUpdate=!0}}o(Qc,"_updateFieldTex");function Xc(E){var I=E.name||"filter";if(Et[I])return Et[I];var z=E.glsl,G=new t.ShaderMaterial({uniforms:{uScene:{value:ve.texture},uField:{value:zt},uResolution:{value:new t.Vector2(a(),s())},uTime:{value:0}},vertexShader:Gg,fragmentShader:z,transparent:!1,depthWrite:!1}),U=new t.Mesh(new t.PlaneGeometry(2,2),G);return ct.add(U),Et[I]=U,U}o(Xc,"_ensureQuadMesh");function Zc(E,I){var z=E.name||"filter",G=Xc(E);G.material.uniforms.uTime.value=I,G.material.uniforms.uResolution.value.set(a(),s()),l.setRenderTarget(ve),l.render(c,f),l.setRenderTarget(null),G.material.uniforms.uScene.value=ve.texture,G.material.uniforms.uField.value=zt,l.render(ct,Kt)}o(Zc,"_applyFilter");function $c(E){var I=us,z=I.fundamentalLayerOf(E),G=[],U=null,fe=[];function re(Pe){Pe&&Pe.visible&&(Pe.visible=!1,G.push(Pe))}o(re,"hide");for(var Ge in x)x.hasOwnProperty(Ge)&&!I.isGodraySource(x[Ge].layer,z)&&re(x[Ge].mesh);V&&V.visible&&(U=V.count,V.count=Qr);for(var rt in Ve)if(Ve.hasOwnProperty(rt))for(var Ne=Ve[rt],Fe=0;Fe<Ne.length;Fe++)Ne[Fe]&&!I.isGodraySource(Ne[Fe].userData.frameLayer,z)&&re(Ne[Fe]);H.forEach(function(Pe){Pe.mesh&&Pe.mesh.traverse(function(kt){for(var Ie=kt.material?Array.isArray(kt.material)?kt.material:[kt.material]:[],nt=0;nt<Ie.length;nt++)Ie[nt]&&Ie[nt].colorWrite!==!1&&(Ie[nt].colorWrite=!1,fe.push(Ie[nt]))})}),l.setRenderTarget(ot.rtSource),l.render(c,f);for(var it=0;it<G.length;it++)G[it].visible=!0;U!==null&&(V.count=U);for(var He=0;He<fe.length;He++)fe[He].colorWrite=!0}o($c,"_renderGodraySource");function eu(E,I){var z=us,G=z.resolveGodraySource(E.godraySource)==="leaf";ot||(ot=z.makeGodrayPasses(t,Gg,a(),s())),l.setRenderTarget(ve),l.render(c,f),G&&$c(I),ot.march(l,Kt,ve,G?ot.rtSource:ve,Lt,ot.lightUV(I,f,E.godraySource),E.godrayDensity,E.godrays)}o(eu,"_renderGodrays");var tu=16724991,ha=16755200,Fs=3407769;function On(E){var I=new t.BufferGeometry;return I.setAttribute("position",new t.BufferAttribute(new Float32Array(E),3)),I}o(On,"_lineGeo");function Zi(E,I){var z=new t.LineSegments(E,new t.LineBasicMaterial({color:I,depthTest:!1,transparent:!0,opacity:1}));return z.renderOrder=9999,z.frustumCulled=!1,z}o(Zi,"_overlayLines");function pa(E,I,z){for(var G=[],U=0;U<I;U++){var fe=U/I*Math.PI*2,re=(U+1)/I*Math.PI*2;G.push(E*Math.cos(fe),E*Math.sin(fe),z||0,E*Math.cos(re),E*Math.sin(re),z||0)}return G}o(pa,"_circlePts");function Ns(){var E=new t.BoxGeometry(1,1,1),I=o(function(){return new t.MeshBasicMaterial({color:0,transparent:!0,opacity:.38,depthTest:!1,depthWrite:!1,side:t.DoubleSide})},"dark"),z=new t.Mesh(E,I());z.add(Zi(new t.EdgesGeometry(E),ha));var G=new t.Mesh(new t.CircleGeometry(1,48),I());return G.add(Zi(On(pa(1,48)),ha)),[z,G].forEach(function(U){U.renderOrder=9997,U.frustumCulled=!1,U.visible=!1,ce.add(U)}),{box:z,disc:G}}o(Ns,"_makeSurround");function vo(E,I,z){var G=I.center;if(I.kind==="sphere"){var U=I.radius+z;return E.disc.position.set(G[0],G[1],G[2]),E.disc.quaternion.copy(f.quaternion),E.disc.scale.setScalar(U),E.disc.visible=!0,E.box.visible=!1,U}return E.box.position.set(G[0],G[1],G[2]),E.box.rotation.order="ZYX",E.box.rotation.z=(I.yawDeg||0)*Math.PI/180,E.box.rotation.y=(I.pitchDeg||0)*Math.PI/180,E.box.scale.set(2*(I.half[0]+z),2*(I.half[1]+z),2*(I.half[2]+z)),E.box.visible=!0,E.disc.visible=!1,Math.hypot(I.half[0],I.half[1],I.half[2])+z}o(vo,"_placeSurround");function da(E){E&&(E.box.visible=!1,E.disc.visible=!1)}o(da,"_hideSurround");function ru(E){var I=E&&E.aimFeedback;if(!h||!I||!I.bounds){N&&(N.visible=!1),ie&&(ie.visible=!1),oe&&(oe.visible=!1),$&&($.visible=!1),da(pe),da(ye);return}ce||(ce=new t.Scene);var z=I.bounds.width,G=I.bounds.height,U=I.bounds.zHalf,fe=z+"x"+G+"x"+U,re=Math.max(4,Math.min(z,G)*.06);if(!N||B!==fe){[N,ie,oe,$].forEach(function(ji){ji&&(ce.remove(ji),ji.geometry.dispose())});var Ge=new t.BoxGeometry(z,G,Math.max(1,2*U));N=new t.LineSegments(new t.EdgesGeometry(Ge),new t.LineBasicMaterial({color:6737151,transparent:!0,opacity:.5,depthTest:!1})),N.renderOrder=9998,N.frustumCulled=!1,ce.add(N),Ge.dispose();var rt=re*.25;ie=Zi(On([-re,0,0,-rt,0,0,rt,0,0,re,0,0,0,-re,0,0,-rt,0,0,rt,0,0,re,0].concat(pa(re*.55,32))),tu),ce.add(ie);var Ne=re*1.6,Fe=Ne*1.35,it=Ne*.22;oe=Zi(On(pa(Ne,48).concat([0,0,0,Fe,0,0,Fe,0,0,Fe-it,it*.6,0,Fe,0,0,Fe-it,-it*.6,0])),ha),ce.add(oe);for(var He=re*.45,Pe=re*.4,kt=[-He,-Pe,0,He,-Pe,0,He,-Pe,0,He,Pe*.4,0,He,Pe*.4,0,-He,Pe*.4,0,-He,Pe*.4,0,-He,-Pe,0],Ie=He*.62,nt=0;nt<12;nt++){var St=nt/12*Math.PI,dr=(nt+1)/12*Math.PI;kt.push(Ie*Math.cos(St),Pe*.4+Ie*.3+Ie*Math.sin(St),0,Ie*Math.cos(dr),Pe*.4+Ie*.3+Ie*Math.sin(dr),0)}kt.push(Ie,Pe*.4,0,Ie,Pe*.4+Ie*.3,0,-Ie,Pe*.4,0,-Ie,Pe*.4+Ie*.3,0),$=Zi(On(kt),Fs),ce.add($),pe||(pe=Ns(),ye=Ns()),B=fe}N.position.set(z/2,G/2,0),N.visible=!0;var Jt=Math.max(a(),s())*1.6,jt=Jt>0&&m.distance>0?m.distance/Jt:1,pi=ps(m,a(),s());ie.position.set(pi.x,pi.y,pi.z),ie.quaternion.copy(f.quaternion),ie.scale.setScalar(jt),ie.visible=!0;var Nr=4*jt,Xr=I.hover?vo(pe,I.hover.volume,Nr):0;if(I.hover||da(pe),I.selected&&!(I.hover&&I.hover.name===I.selected.name)?vo(ye,I.selected.volume,Nr):da(ye),I.grabbed&&I.hover){var mr=I.hover.volume.center,jr=f.up,Mr=Xr+re*.8*jt;$.position.set(mr[0]+jr.x*Mr,mr[1]+jr.y*Mr,mr[2]+jr.z*Mr),$.quaternion.copy(f.quaternion),$.scale.setScalar(jt),$.visible=!0}else $.visible=!1;var gt=I.orientation;gt&&gt.pivot&&(oe.position.set(gt.pivot[0],gt.pivot[1],gt.pivot[2]!=null?gt.pivot[2]:0),oe.rotation.z=(gt.deg||0)*Math.PI/180,oe.scale.setScalar(jt)),oe.visible=!!(gt&&gt.pivot)}o(ru,"_updateAimFeedback");function Ms(){if(!(!ce||!N||!N.visible)){var E=l.autoClear;l.autoClear=!1,l.setRenderTarget(null),l.render(ce,f),l.autoClear=E}}o(Ms,"_renderAimFeedbackPass");function yo(E,I,z){if(Yt){hr=E,ru(z||{}),Jc(I,z||{});var G=z||{},U=G.renderBaseCanvas!==!1;_n=Object.assign({},G),xn=U;var fe=ut.length>0,re=G.glowIntensity,Ge=Ei,rt=ai,Ne=rt.resolve(null,G),Fe=h?$a.resolve(null,G):null,it=!!Fe,He=!it&&h&&rt.isCubeMesh(Ne);if(!it&&xe&&(xe.visible=!1),it){Q(),V&&(V.visible=!1),go(Fe);var Pe=Ce[Fe],kt=0;Pe&&Pe.status==="ready"&&(kt=Ps(Pe,E.frameData,G.renderBaseCanvas!==!1,G.meshScale,Fe)),Is([Fe]),xe&&(xe.visible=kt>0)}else if(He)if(Q(),U&&E&&E.frameData){for(var Ie=E.frameData,nt=Ie.length,St=G.colorScheme||"warmcool",dr=64,Jt=0;Jt<nt;Jt++)if(Ie[Jt].rect&&Ie[Jt].rect.w){dr=Ie[Jt].rect.w;break}Yc(dr,nt);for(var jt=us,pi=jt.fundamentalLayerOf(E),Nr=[],Xr=0;Xr<nt;Xr++)jt.isGodraySource(Ie[Xr].layer,pi)&&Nr.push(Xr);Qr=Nr.length;for(var mr=0;mr<nt;mr++)jt.isGodraySource(Ie[mr].layer,pi)||Nr.push(mr);for(var jr=0,Mr=0;Mr<nt;Mr++){var gt=Ie[Nr[Mr]],ji=gt.fullness||0,Ur=gt.data&&gt.data.string_map,En=null;if(Ur&&Ur["render.color"]){var Qt=String(Ur["render.color"]).split(",").map(Number);Qt.length>=3&&Qt.every(function(Pi){return!isNaN(Pi)})&&(En=Qt)}var di=Ur&&Ur["render.colorScheme"]?Ur["render.colorScheme"]:St,Sn=En||Ge.getRgbBySchemeName(di,ji),Rr=gt.rect.x,Ri=gt.rect.y,Us=gt.z||0;R.makeTranslation(Rr,Ri,Us),V.setMatrixAt(jr,R),K.setRGB((Sn[0]||0)/255,(Sn[1]||0)/255,(Sn[2]||0)/255),V.setColorAt(jr,K),jr++}V.count=jr,V.instanceMatrix.needsUpdate=!0,V.instanceColor&&(V.instanceColor.needsUpdate=!0),V.visible=U&&jr>0}else V&&(V.visible=!1);else if(V&&(V.visible=!1),Q(),U&&E&&E.frameData){let Pi=function(_o,ya,xo,Ks,Ys,Js,ba,lu,wa,Qs,Oo,cu){var rn=Di[ya];rn||(rn=Di[ya]={layer:_o,additive:xo,paint:Ks,uShape:cu,list:[]}),rn.list.push({x:Ys,y:Js,z:ba,full:lu,r:wa[0]||0,g:wa[1]||0,b2:wa[2]||0,a:Qs,size:Oo})};o(Pi,"_pushTo");var kn=E.frameData,zs=kn.length,qs=Ge,nu=rt,Vs=typeof G.smoke=="number"&&G.smoke>0,au=Vs?G.smoke:0,ou=G.colorScheme||"warmcool";d=nu.toUniform(Ne);for(var Bs=typeof re=="number"&&re>0,An={},Di={},qt=0;qt<zs;qt++){var rr=kn[qt],Zr=rr.layer||0,mi=Ug.resolveRenderFamily(rr,G,h);if(mi.family==="mesh"){(An[mi.assetId]||(An[mi.assetId]=[])).push(rr);continue}var $r=rr.fullness||0,Dr=rr.data&&rr.data.string_map,Li=null;if(Dr&&Dr["render.color"]){var ga=String(Dr["render.color"]).split(",").map(Number);ga.length>=3&&ga.every(function(xo){return!isNaN(xo)})&&(Li=ga)}var su=Dr&&Dr["render.colorScheme"]?Dr["render.colorScheme"]:ou,$i=rr.z||0,Rr=rr.rect.x,Ri=rr.rect.y,bo=rr.rect&&rr.rect.w?rr.rect.w:1,en=qs.getAlphaFromIntensity($r),Tn=Li||qs.getRgbBySchemeName(su,$r),Cn=Bs?4*$r+1:bo;if(Bs)Pi(Zr,Zr+"|A",!0,"crisp",Rr,Ri,$i,$r,Tn,en,Cn);else if(Vs)Pi(Zr,Zr+"|N|soft",!1,"soft",Rr,Ri,$i,$r,Tn,en,Cn);else if(mi.family==="sphere")Pi(Zr,Zr+"|N|sphere",!1,"sphere",Rr,Ri,$i,$r,Tn,en,Cn,0);else{var Ws=mi.family==="cube"?1:mi.uShapeVariant!=null?mi.uShapeVariant:0;Pi(Zr,Zr+"|N|pts:"+Ws,!1,"crisp",Rr,Ri,$i,$r,Tn,en,Cn,Ws)}}var jn=[];for(var ei in Di)if(Di.hasOwnProperty(ei)){var Lr=Di[ei],gr=Lr.list.length;if(gr!==0){jn.push(ei);var Re=T(ei,Lr.additive,Lr.paint);j(Re,gr),Re.layer=Lr.layer;var ir=0,zr=0,qr=0;if(Re.isSphere){for(var Rn=0;Rn<gr;Rn++){var Xt=Lr.list[Rn];X.set(Xt.x,Xt.y,Xt.z),be.set(Xt.size,Xt.size,Xt.size),ee.compose(X,te,be),Re.mesh.setMatrixAt(Rn,ee),Oe.setRGB(Xt.r/255,Xt.g/255,Xt.b2/255),Re.mesh.setColorAt(Rn,Oe),ir+=Xt.x,zr+=Xt.y,qr+=Xt.z}Re.mesh.count=gr,Re.mesh.instanceMatrix.needsUpdate=!0,Re.mesh.instanceColor&&(Re.mesh.instanceColor.needsUpdate=!0)}else{for(var nr=0;nr<gr;nr++){var vr=Lr.list[nr];Re.bufs.posArr[nr*3]=vr.x,Re.bufs.posArr[nr*3+1]=vr.y,Re.bufs.posArr[nr*3+2]=vr.z,Re.bufs.fullArr[nr]=vr.full,Re.bufs.colArr[nr*3]=vr.r/255,Re.bufs.colArr[nr*3+1]=vr.g/255,Re.bufs.colArr[nr*3+2]=vr.b2/255,Re.bufs.alphaArr[nr]=vr.a,Re.bufs.sizeArr[nr]=vr.size,Re.bufs.smokeArr[nr]=Lr.paint==="soft"?1:0,ir+=vr.x,zr+=vr.y,qr+=vr.z}Re.geo.setDrawRange(0,gr),Re.geo.attributes.position.needsUpdate=!0,Re.geo.attributes.aFullness.needsUpdate=!0,Re.geo.attributes.aColor.needsUpdate=!0,Re.geo.attributes.aAlpha.needsUpdate=!0,Re.geo.attributes.aSize.needsUpdate=!0,Re.geo.attributes.aSmoke.needsUpdate=!0,Re.mat.uniforms.uPersp.value=h?1:0,Re.mat.uniforms.uShape&&(Re.mat.uniforms.uShape.value=Lr.uShape!=null?Lr.uShape:d),Lr.additive?(Re.mat.uniforms.uIntensity.value=typeof re=="number"?re:1,Re.mat.uniforms.uHeat.value=typeof G.heat=="number"?G.heat:0,Re.mat.uniforms.uSmoke.value=0):(Re.mat.uniforms.uIntensity.value=1,Re.mat.uniforms.uHeat.value=typeof G.heat=="number"?G.heat:0,Re.mat.uniforms.uSmoke.value=Lr.paint==="soft"?au:0)}Re.centroid.x=ir/gr,Re.centroid.y=zr/gr,Re.centroid.z=qr/gr,Re.mesh.visible=U}}if(h&&jn.length>1){jn.sort(function(_o,ya){return Y(x[ya].centroid)-Y(x[_o].centroid)});for(var va=0;va<jn.length;va++)x[jn[va]].mesh.renderOrder=va}var Gs=[],Hs=0;for(var tn in An)if(An.hasOwnProperty(tn)){Gs.push(tn),go(tn);var wo=Ce[tn];wo&&wo.status==="ready"&&(Hs+=Ps(wo,An[tn],U,G.meshScale,tn))}Is(Gs),xe&&(xe.visible=Hs>0)}fe&&Qc(E),ma(G,E)}}o(yo,"_renderTick");function ma(E,I){E=E||{};var z=E.godrays>0,G=ut.length>0?Wo(I):null;pr=G,z?eu(E,I):ut.length>0?Zc(ut[0],G):(l.setRenderTarget(null),l.render(c,f)),Ms()}o(ma,"_composeFinal");var iu={init:o(function(E){return tr(E),u},"init"),renderTick:o(function(E,I,z){yo(E,I,z)},"renderTick"),filter:o(function(E,I){if(E){if(E.name){for(var z=0;z<ut.length;z++)if(ut[z].name===E.name){I&&(ut[z]._perFilterOptions=I);return}}var G=E;I&&(G=Object.assign({},E),G._perFilterOptions=I),ut.push(G)}},"filter"),removeFilter:o(function(E){var I=typeof E=="string"?E:E&&E.name;ut=ut.filter(function(z){return z.name!==I}),I&&Et[I]&&(ct.remove(Et[I]),delete Et[I])},"removeFilter"),setSize:o(function(E,I){Wi("threeProvider.setSize",E,I),r=E,i=I,l?(l.setSize(E,I),h?(f.aspect=E/I,b()):(f.right=E,f.bottom=I,f.updateProjectionMatrix()),ve&&ve.setSize(E,I),Lt&&Lt.setSize(E,I),ot&&ot.setSize(E,I)):h&&b()},"setSize"),start:o(function(){},"start"),stop:o(function(){},"stop"),destroy:o(function(){l&&l.dispose(),u&&u.parentNode&&u.parentNode.removeChild(u),Yt=!1,ut=[]},"destroy"),raw:o(function(){return{renderer:l,scene:c,camera:f}},"raw"),projection:o(function(){return h?{kind:"perspective",fovY:hs}:{kind:"affine2d"}},"projection"),captureStill:o(function(){if(!Yt||!l)throw new Error("[three-provider.captureStill] no live renderer \u2014 init() has not run. (FAIL-LOUD \u2014 never a null or blank still.)");if(!hr)throw new Error("[three-provider.captureStill] nothing has been composited yet (no renderTick/repaint since init). A capture before the first draw would be a cleared framebuffer, i.e. a black still. (FAIL-LOUD.)");var E=as;ma(_n,hr);var I=l.getContext(),z=l.domElement,G=E.captureFromGl(I,z.width,z.height,{cssWidth:z.clientWidth||a(),cssHeight:z.clientHeight||s(),physicsW:a(),physicsH:s(),filtersApplied:ut.map(function(U){return U.name}),renderBaseCanvas:xn,filterTime:pr,composited:hr});return Promise.resolve(G)},"captureStill"),getCameraControl:o(function(){if(!h)return null;var E=tp;function I(){return E.cameraPresets(a(),s())}o(I,"_presets");function z(U,fe,re){if(typeof U=="number"&&isFinite(U))return U;throw new Error("three-provider camera "+re+": "+fe+" must be a finite number, got "+String(U)+" \u2014 throw-or-apply, never a silent clamp.")}o(z,"_finite");var G={presets:Object.keys(I()),poseFields:E.cameraPoseFields(a(),s()),setOrbit:o(function(U){if(U){if(U=ko(U),U.azimuth!==void 0&&(m.azimuth=z(U.azimuth,"azimuth","setOrbit")),U.elevation!==void 0&&(m.elevation=z(U.elevation,"elevation","setOrbit")),U.distance!==void 0&&(m.distance=z(U.distance,"distance","setOrbit")),U.roll!==void 0){var fe=z(U.roll,"roll","setOrbit")%360;m.roll=fe>180?fe-360:fe<=-180?fe+360:fe}if("target"in U){var re=U.target;m.target=re?{x:re.x,y:re.y,z:re.z}:null}b()}},"setOrbit"),getOrbit:o(function(){return y()},"getOrbit"),addPoseListener:o(function(U){return w||(w=Ao()),w.add(U)},"addPoseListener"),setPreset:o(function(U){var fe=I(),re=fe[U];if(!re)throw new Error('[three-provider camera] setPreset("'+U+'"): this camera offers only ['+Object.keys(fe).join(", ")+"] (ctl.presets). (FAIL-LOUD.)");G.setOrbit({azimuth:re.azimuth,elevation:re.elevation,distance:re.distance,roll:0,target:null})},"setPreset"),look:o(function(U){if(U){var fe=U.spin===void 0?0:z(U.spin,"spin","look"),re=U.pitch===void 0?0:z(U.pitch,"pitch","look");if(!(!fe&&!re)){var Ge=op(m,{spin:fe,pitch:re},a(),s());m.azimuth=Ge.azimuth,m.elevation=Ge.elevation,m.roll=Ge.roll,b()}}},"look"),move:o(function(U){if(U){var fe=U.forward===void 0?0:z(U.forward,"forward","move"),re=U.strafe===void 0?0:z(U.strafe,"strafe","move");!fe&&!re||(m.target=sp(m,a(),s(),fe,re),b())}},"move"),cameraOffsetFromWorld:o(function(U){return lp(m,a(),s(),U)},"cameraOffsetFromWorld"),worldFromCameraOffset:o(function(U){return cp(m,a(),s(),U)},"worldFromCameraOffset")};return G},"getCameraControl"),renderCapabilities:hp,screenToWorld:o(function(E,I,z,G,U){return h?up(m,a(),s(),E,I,z,G,U):null},"screenToWorld"),get initialized(){return Yt}};return iu}o(Kg,"makeThreeProvider");var ds=Object.freeze({p5:Object.freeze({makeProvider:Dg,renderCapabilities:ep}),three:Object.freeze({makeProvider:Kg,renderCapabilities:hp})});function ms(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}o(ms,"_isPlainObject");function Yg(e){if(!e||!e.camera)return null;var t=e.camera;return typeof t.preset=="string"&&t.preset.length>0?{mode:"preset",name:t.preset}:t.orbit&&typeof t.orbit=="object"?{mode:"orbit",orbit:t.orbit}:null}o(Yg,"pickCameraReplay");var pc=1,pp=Object.freeze([{key:"version",normalize:o(function(e){if(e===void 0||e===pc)return pc;throw new Error("[render-state] renderState.version "+JSON.stringify(e)+" \u2014 this owner reads version "+pc+" only. (FAIL-LOUD.)")},"normalize")},{key:"renderer",normalize:o(function(e){return typeof e=="string"&&e.length>0?e:null},"normalize")},{key:"engine",normalize:o(function(e){return typeof e=="string"&&e.length>0?e:null},"normalize")},{key:"seed",normalize:o(function(e){return e!=null&&e!==""?String(e):null},"normalize")},{key:"backdropVisible",normalize:o(function(e){return typeof e=="boolean"?e:null},"normalize")},{key:"camera",normalize:o(function(e){return ms(e)?{orbit:ms(e.orbit)?e.orbit:null,preset:typeof e.preset=="string"?e.preset:null}:null},"normalize")},{key:"render",normalize:o(function(e){return Array.isArray(e)?e.filter(function(t){return ms(t)&&typeof t.key=="string"&&t.key.length>0}):[]},"normalize")}].map(Object.freeze));function dc(e){if(e!==null&&!ms(e))throw new Error("[render-state] a renderState is a bag (a plain object) or null for none \u2014 got "+(e===void 0?"undefined":Array.isArray(e)?"an array":typeof e)+". (FAIL-LOUD.)");var t=e||{};if(Object.prototype.hasOwnProperty.call(t,"pageControls")){var r=Array.isArray(t.pageControls)?t.pageControls:[];throw new Error("[render-state] this saved project carries page controls (renderState.pageControls: "+(r.map(function(a){return ms(a)?String(a.id):"?"}).join(", ")||"an empty list")+") \u2014 page controls are declared in the sketch's own code; move them into the sketch and save again. (FAIL-LOUD.)")}var i=pp.map(function(a){return a.key});Object.keys(t).forEach(function(a){if(i.indexOf(a)===-1)throw new Error('[render-state] renderState has no key "'+a+'" \u2014 its keys (RENDER_STATE_KEYS): '+i.join(", ")+". (FAIL-LOUD.)")});var n={};return pp.forEach(function(a){n[a.key]=a.normalize(t[a.key])}),n}o(dc,"normalizeSavedRenderState");function Jg(e,t,r){if(!Array.isArray(e)||!Array.isArray(t)||!Array.isArray(r))throw new Error("[render-state] partitionRenderRows(rows, declaredNames, knownNames) takes three arrays. (FAIL-LOUD.)");for(var i={},n=[],a=0;a<e.length;a++){var s=e[a];if(t.indexOf(s.key)!==-1)i[s.key]=s.value;else if(r.indexOf(s.key)!==-1)n.push({key:s.key,value:s.value});else throw new Error('[render-state] saved render option "'+s.key+'" is declared by no registered renderer (known: ['+r.join(", ")+"]). (FAIL-LOUD: a typo or a deleted option would otherwise silently change the picture.)")}return{apply:i,retained:n}}o(Jg,"partitionRenderRows");function vx(e){var t=e&&e.largeObjects;if(!Array.isArray(t))throw new Error("[render-state] RenderState.backdropOf: runner.largeObjects is not the world's census (an array) \u2014 the backdrop is found there and nowhere else. (FAIL-LOUD.)");for(var r=0;r<t.length;r++)if(t[r]&&t[r].backdrop===!0)return t[r];return null}o(vx,"backdropOf");function Qg(e,t,r){if(!e||typeof e.renderCapabilities!="function"||typeof e.setRenderOptions!="function")throw new Error("[render-state] RenderState.apply(runner, bag, env): runner must be a booted FrqtlApp (renderCapabilities + setRenderOptions). (FAIL-LOUD.)");if(!r||!Array.isArray(r.knownNames))throw new Error("[render-state] RenderState.apply(runner, bag, env): env.knownNames must be the page's RenderCapabilitiesCommon.knownRenderCapabilityNames(providers) array. (FAIL-LOUD.)");var i=dc(t),n=Jg(i.render,e.renderCapabilities().map(function(h){return h.name}),r.knownNames),a=Yg(i),s=null,l=null,c=null;if(a){if(s=e.cameraControl,!s)throw new Error("[render-state] the bag declares a camera ("+JSON.stringify(i.camera)+") but the runner has no cameraControl \u2014 a declared view on a display with no pose control would look fine and be wrong. (FAIL-LOUD.)");if(a.mode==="preset"){if(!Array.isArray(s.presets))throw new Error("[render-state] the booted camera publishes no `presets` array \u2014 every getCameraControl() handle declares the presets it offers. (FAIL-LOUD.)");c=a.name,l=s.presets.indexOf(a.name)===-1?"retained":"preset"}else l="orbit"}var f=vx(e);e.setRenderOptions(n.apply),l==="preset"?s.setPreset(a.name):l==="orbit"&&s.setOrbit(a.orbit);var u=null;return f&&i.backdropVisible!==null&&(e.updateObjectProperty(f,"visible",i.backdropVisible),u=i.backdropVisible),{applied:n.apply,retained:n.retained,camera:l,preset:c,backdrop:u}}o(Qg,"apply");un();Va();var io=Object.freeze({SEED:"seed",RENDERER:"renderer",ENGINE:"engine"}),bx=Object.freeze([Object.freeze({key:io.SEED,reader:"lib/frqtl/experiments/empty/index.html",forward:!0}),Object.freeze({key:io.RENDERER,reader:"lib/frqtl/experiments/_shared/boot.js",forward:!0}),Object.freeze({key:io.ENGINE,reader:"lib/frqtl/experiments/_shared/boot.js",forward:!1,why:"the host's own physics-engine selector (e.g. the GYM's Benchmark/Compare engine dropdown) is the SOLE authority for this axis; forwarding an outer ?engine= would let it silently override an explicit host choice, which is exactly the engine-sniffing-from-above-the-shim class of bug this codebase forbids elsewhere"})]),Xg=Object.freeze([Object.freeze({key:"chrome",appliedBy:"lib/frqtl/experiments/_shared/boot.js",forward:!1,acceptedValues:Object.freeze(["canvas"]),why:`chrome is a HOST-COMPOSITION decision (whether the experiment's own control chrome DOM renders), never a per-experiment physics/render parameter; forwarding it from an outer host URL into an embedded iframe would reintroduce the hidden-experiment-chrome bug (the GYM must always show the experiment's own full chrome, never chrome=canvas \u2014 see the "WHEN should a host set chrome=canvas" doc above for the general criterion, not just the GYM's specific answer to it)`})]),rC=Object.freeze(bx.filter(function(e){return e.forward}).map(function(e){return e.key}));var wx=Object.freeze([{id:"modules",means:"Loading the scene objects"},{id:"engine-ready",means:"Starting the WASM engine"},{id:"renderer",means:"Loading the renderer"},{id:"sketch",means:"Building the scene"}].map(Object.freeze)),dp=Object.freeze(wx.map(e=>e.id)),mp="frqtl:boot-phase";var _x={engine:{id:"egpt-engine-error",marker:"data-egpt-engine-error",bg:"#1a0000",fg:"#ff6b6b",border:"#b6161c"},renderer:{id:"egpt-renderer-error",marker:"data-egpt-renderer-error",bg:"#000a1a",fg:"#6b9eff",border:"#1640b6"}},ta=null;function Zg(e){ta=e||null}o(Zg,"setBootOverlayHost");function ra(e,t){let r=_x[e];if(!r)throw new Error("[boot] paintBootFailure: axis must be engine | renderer (got "+JSON.stringify(e)+")");typeof console<"u"&&console.error&&console.error(t);function i(){if(ta){if(ta.querySelector&&ta.querySelector("["+r.marker+"]"))return;let a=document.createElement("div");a.setAttribute(r.marker,"1"),a.setAttribute("data-egpt-boot-error","1"),a.style.cssText="position:absolute;inset:0;z-index:9998;background:"+r.bg+";color:"+r.fg+";font:12px/1.5 ui-monospace,Menlo,Consolas,monospace;padding:14px;white-space:pre-wrap;overflow:auto;border:2px solid "+r.border+";",a.textContent=t;let s=getComputedStyle(ta);(!s||s.position==="static")&&(ta.style.position="relative"),ta.appendChild(a);return}if(document.getElementById(r.id))return;let n=document.createElement("div");n.id=r.id,n.setAttribute("data-egpt-boot-error","1"),n.style.cssText="position:fixed;inset:0;z-index:99999;background:"+r.bg+";color:"+r.fg+";font:13px/1.55 ui-monospace,Menlo,Consolas,monospace;padding:22px;white-space:pre-wrap;overflow:auto;border:2px solid "+r.border+";",n.textContent=t,(document.body||document.documentElement).appendChild(n)}o(i,"paint"),document.body?i():addEventListener("DOMContentLoaded",i)}o(ra,"paintBootFailure");bi();xt();At();var lC=Object.freeze({scene:Object.freeze({id:"scene",importedBy:"any project file (a sketch imports it)"}),"part-internal":Object.freeze({id:"part-internal",importedBy:"a part file (parts/*.js) of a project \u2014 a forked part imports its parent part's internals; never a sketch"})}),oi=Object.freeze([Object.freeze({specifier:"@descix/frqtl-web/parts",libPath:"frqtl/parts/index.js",why:"the parts barrel",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/parts/",libPath:"frqtl/parts/",why:"one part = one file",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/shim/controls/registry.js",libPath:"shim/controls/registry.js",why:"knob registration (blackbody, circuit-sat, collision-matrix-3d, dse-tunnel-rebuild)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/shim/render/sun-look.js",libPath:"shim/render/sun-look.js",why:"the one owner of the sun's FX bag (dse-tunnel-rebuild)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/compat/renderer/display-slot.js",libPath:"frqtl/compat/renderer/display-slot.js",why:"the booted display name before co-init (mirror-route, dse-tunnel-rebuild)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/compat/renderer/orbit-bag.js",libPath:"frqtl/compat/renderer/orbit-bag.js",why:"hasAngularPose, THE 3D-ness predicate (atomic-model)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/objects/setup/_collisionMatrixLanes.js",libPath:"frqtl/objects/setup/_collisionMatrixLanes.js",why:"the one lane table (collision-matrix-3d)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/compat/engine.js",libPath:"frqtl/compat/engine.js",why:"the engine accessor (atomic-model builds its frames by hand)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/kinds",libPath:"frqtl/objects/kinds-entry.js",why:"the kind registry: a composed fork registers its renamed class (registerKind, kindNamed, kindOf, registeredKinds)",tier:"scene"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/tagger.js",libPath:"frqtl/objects/objects/tagger.js",why:"imported by DetectorWall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/schema/index.js",libPath:"frqtl/objects/schema/index.js",why:"imported by DetectorWall, SlitScreen, Wall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/shim/render/heat-colormap.js",libPath:"shim/render/heat-colormap.js",why:"imported by GraphingDetectorWall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/schema/valueNormalizer.js",libPath:"frqtl/objects/schema/valueNormalizer.js",why:"imported by LiveChart, Wall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/Box.js",libPath:"frqtl/objects/objects/Box.js",why:"imported by OvenBox \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/QuantumEmitter.js",libPath:"frqtl/objects/objects/QuantumEmitter.js",why:"imported by OvenBox \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/shim/expr/ast-schema.js",libPath:"shim/expr/ast-schema.js",why:"imported by OvenBox, Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/actionCompiler.js",libPath:"frqtl/objects/objects/actionCompiler.js",why:"imported by OvenBox, Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/v1-replacements.js",libPath:"frqtl/objects/v1-replacements.js",why:"imported by SlitLightSource \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/slitLinerScatter.js",libPath:"frqtl/objects/objects/slitLinerScatter.js",why:"imported by SlitScreen, Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/setup/setupSphereEmitter3D.js",libPath:"frqtl/objects/setup/setupSphereEmitter3D.js",why:"imported by SphereEmitter \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/directedRedirectProgram.js",libPath:"frqtl/objects/objects/directedRedirectProgram.js",why:"imported by Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/compat/renderer/lo-drawn-center.js",libPath:"frqtl/compat/renderer/lo-drawn-center.js",why:"imported by Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/setup/setupTunnelPointExit.js",libPath:"frqtl/objects/setup/setupTunnelPointExit.js",why:"imported by Tunnel \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/constants/WallBehaviors.js",libPath:"frqtl/objects/constants/WallBehaviors.js",why:"imported by Wall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/objects/absorbRadiation.js",libPath:"frqtl/objects/objects/absorbRadiation.js",why:"imported by Wall \u2014 a forked copy imports it",tier:"part-internal"}),Object.freeze({specifier:"@descix/frqtl-web/objects/geometry/SlabFace.js",libPath:"frqtl/objects/geometry/SlabFace.js",why:"imported by Wall \u2014 a forked copy imports it",tier:"part-internal"})]),xx=Object.freeze({specifier:"@descix/frqtl-web/boot",libPath:"frqtl/experiments/_shared/doors.js",why:"the scene doors (bootScene, bootProject)"}),cC=Object.freeze([xx,Object.freeze({specifier:"@descix/frqtl-web/registry",libPath:"shim/registry/index.js",why:"the walk-through rungs, the showcase roster, the scene list (sceneGroups), projectOf, showcaseHref + showcaseUrl + SHOWCASE_SITE, STUDIO's deep-link landing record"}),Object.freeze({specifier:"@descix/frqtl-web/project",libPath:"shim/project/index.js",why:"the specifier table, the link site, sketchProject and the project identity"}),Object.freeze({specifier:"@descix/frqtl-web/host-view",libPath:"shim/host/index.js",why:"the DeSciX host-view declarer: a page declares its own view"}),Object.freeze({specifier:"@descix/frqtl-web/site-graph",libPath:"shim/engine/site-graph.js",why:"the static site's shape: the graph directory, the build-stamp attribute, the build id pattern, the IDE entry page, the host-provided attribute"})]),gp="@descix/frqtl-web";function ia(e){return e.specifier.endsWith("/")}o(ia,"_isPrefix");function gs(e){if(typeof e!="string")throw new TypeError("[specifiers] libPathOf(specifier): a string specifier (got "+typeof e+"). (FAIL-LOUD.)");for(let t of oi)if(!ia(t)&&t.specifier===e)return t.libPath;for(let t of oi)if(ia(t)&&e.startsWith(t.specifier)&&e.length>t.specifier.length){let r=e.slice(t.specifier.length);if(r.split("/").indexOf("..")!==-1)throw new Error('[specifiers] "'+e+'" climbs out of its prefix row ('+t.specifier+"). (FAIL-LOUD.)");return t.libPath+r}throw new Error('[specifiers] "'+e+'" is not a @descix/frqtl-web specifier \u2014 the table (lib/shim/project/specifiers.js FRQTL_WEB_SPECIFIERS) offers: '+oi.map(function(t){return t.specifier+(ia(t)?"<file>":"")}).join(", ")+". (FAIL-LOUD.)")}o(gs,"libPathOf");function Ox(e){for(let t of oi)if(!ia(t)&&t.specifier===e)return t;for(let t of oi)if(ia(t)&&e.startsWith(t.specifier)&&e.length>t.specifier.length)return t;return null}o(Ox,"_rowOf");function $g(e){return gs(e),Ox(e).tier}o($g,"tierOf");function vs(e){if(typeof e!="string"||!e)throw new TypeError("[specifiers] specifierOfLibPath(libPath): a lib-identity path (got "+JSON.stringify(e)+"). (FAIL-LOUD.)");for(let t of oi)if(!ia(t)&&t.libPath===e)return t.specifier;for(let t of oi)if(ia(t)&&e.startsWith(t.libPath)){let r=e.slice(t.libPath.length);if(r&&r.indexOf("/")===-1)return t.specifier+r}return null}o(vs,"specifierOfLibPath");var ev=oi.find(function(e){return e.libPath==="frqtl/parts/index.js"});if(!ev)throw new Error("[parts-module] FRQTL_WEB_SPECIFIERS has no row for the parts barrel (frqtl/parts/index.js). (FAIL-LOUD.)");var mc=ev.specifier,Ex=/^frqtl\/parts\/[A-Za-z_$][\w$]*\.js$/;function ys(e,t){if(typeof e!="string"||!e)throw new TypeError("[parts-module] moduleOfKind(from, urls): from is the kind row's module URL (got "+JSON.stringify(e)+"). (FAIL-LOUD.)");let r=ze();if(e.startsWith(r)&&Ex.test(e.slice(r.length)))return mc;if(t){for(let i of Object.keys(t))if(t[i]===e)return i}return null}o(ys,"moduleOfKind");function vp(e,t){if(typeof e!="string"||!e)throw new TypeError("[parts-module] importSpecifierOf(module, entry): a module specifier or project path. (FAIL-LOUD.)");if(e.startsWith("@"))return e;let r=t.split("/");r.pop();let i=e.split("/");for(;r.length&&i.length>1&&r[0]===i[0];)r.shift(),i.shift();let n=r.map(function(){return".."});return(n.length?n.join("/")+"/":"./")+i.join("/")}o(vp,"importSpecifierOf");un();Ea();Da();_r();Vt();Va();var Sx=100,kx=10,Ax=200,yp=Object.freeze(["fpsLimit","tpsLimit"]),rv=Object.freeze(["initWorld"]);function iv(e,t){if(e.RATE_LIMITS!==void 0)throw new Error("[FrqtlApp."+t+"] the RATE_LIMITS factory static is DELETED \u2014 pacing is declared where the scene is: exp.runner.setRateLimits({ fpsLimit?, tpsLimit? }) in a scene file, runner.setRateLimits(...) on a page. (FAIL-LOUD.)")}o(iv,"_refuseDeletedStatics");function tv(e,t){return t&&t[e]?t[e]:ea()[e]}o(tv,"_resolveEngineClass");function Tx(e,t){for(var r=e.get("Wall"),i=0;i<r.fields.length;i++)if(r.fields[i].name===t)return!0;return!1}o(Tx,"_isWallField");function nv(e){return e&&e.lo&&e.lo._owner===e?e:null}o(nv,"_wallFacadeOf");W._wallFacadeOf=nv;function av(e){if(typeof requestAnimationFrame!="function")throw new Error("[FrqtlApp."+e+"] no animation frame in this host \u2014 the wall-clock loop needs requestAnimationFrame. Drive the clock with `runner.step()` (one tick + render per call, any host), or boot in a browser through `@descix/frqtl-web/boot`. (FAIL-LOUD.)")}o(av,"_requireAnimationFrame");function W(e){e=e||{};var t=e.canvasW,r=e.canvasH;if(typeof t!="number"||!(t>0)||typeof r!="number"||!(r>0))throw new Error("[FrqtlApp] canvasW and canvasH are REQUIRED positive numbers (got "+JSON.stringify(t)+" x "+JSON.stringify(r)+"). There is no default world size: a scene states its world with exp.createCanvas(w, h, cfg) / exp.createScene(w, h, d, cfg); a page passes it here. (FAIL-LOUD.)");this._is3D=!!e.is3D,this._depth=e.canvasD!==void 0&&e.canvasD!==null?e.canvasD:null;var i=e.seed!==void 0?e.seed:42;this._canvasParentId=e.canvasParentId||null,this._onTick=e.onTick||null,this._onReady=e.onReady||null,this._tickListeners=[],this._drawHz=e.drawHz!==void 0&&e.drawHz>0?e.drawHz:0;var n=e.stepsPerFrame!==void 0?Math.max(1,e.stepsPerFrame):1;e.tickHz!==void 0&&e.tickHz>0?this._tickHz=e.tickHz:n>1?this._tickHz=this._drawHz>0?this._drawHz*n:60*n:this._tickHz=0,this.stepsPerFrame=n;var a=tv("Rectangle",e.engine);this.canvas_rect=new a(0,0,t,r,null,!1),this._seed=i,this._tickSuspend=0;var s=tv("EGPTUniverse",e.engine);this.universe=s.create({rect:this.canvas_rect,seed:i}),this._declared=[],this._declaredMembers=new Map,this._declaredTicks=new Map,this._setupResult=null,this._sceneReplay=null,this._designMode=!1,this._aim=null,this._selected=null,this._onObjectMoved=null,this._isLooping=!1,this._rafId=null,this._lastTickData=null,this._accumulator=0,this._lastFrame=0,this._lastDraw=0,this._lastBudgetWarn=0,this._BUDGET_WARN_INTERVAL_MS=5e3,this._rateWindowMs=1e3,this._rateWindowEnd=0,this._tickCount=0,this._drawCount=0,this._lastTps=0,this._lastFps=0,this._renderOptions={renderBaseCanvas:!0},this._stagedRenderOptions=null,this._renderer=null;var l=this;this._capture=lc.create({get lastTickData(){return l._lastTickData}},function(){return l._getRenderer()},{seed:this._seed,get rect(){return l.canvas_rect}},function(){return l._renderOptions})}o(W,"FrqtlApp");Object.defineProperty(W.prototype,"largeObjects",{configurable:!0,get:o(function(){var e=this.universe;return e&&Array.isArray(e.largeObjects)?e.largeObjects:[]},"get")});Object.defineProperty(W.prototype,"controlHost",{configurable:!0,get:o(function(){if(this._controlHost)return this._controlHost;var e=this._sceneSurface;return e&&e.parentNode?e.parentNode:null},"get"),set:o(function(e){if(!e||typeof e.appendChild!="function"||!e.ownerDocument)throw new TypeError("[FrqtlApp.controlHost] a control host is a DOM element (it carries appendChild + ownerDocument); got "+String(e)+". (FAIL-LOUD.)");this._controlHost=e;for(var t=(this._controlChrome||[]).slice(),r=0;r<t.length;r++)t[r].rehost(e)},"set")});W.prototype.addControlChrome=function(e){if(!e||typeof e.rehost!="function")throw new TypeError("[FrqtlApp.addControlChrome] chrome must expose rehost(el). (FAIL-LOUD.)");var t=this._controlChrome||(this._controlChrome=[]);return t.push(e),function(){var r=t.indexOf(e);r!==-1&&t.splice(r,1)}};W.prototype.setDesignMode=function(e){this._designMode=!!e};W.prototype._shellRenderOf=function(e){var t=e&&e.shellRender;return t==="design"||t==="run"||t==="never"?t:e&&e._designMarker===!0?"design":"run"};W.prototype._visibleLargeObjects=function(){var e=this.largeObjects;if(!e||e.length===0)return e;for(var t=this,r=!1,i=0;i<e.length;i++)if(e[i]&&!t._isShellVisible(e[i])){r=!0;break}return r?e.filter(function(n){return t._isShellVisible(n)}):e};W.prototype._isShellVisible=function(e){var t=this._shellRenderOf(e);return t==="run"?!0:t==="never"?!1:!!this._designMode};var vc="filter.";function yc(e){var t=mn,r=t.get()===e?t.name():null;return r?'renderer "'+r+'"':"the active renderer"}o(yc,"_providerLabel");function ov(e,t){if(typeof e.renderCapabilities!="function")throw new TypeError("[FrqtlApp.setRenderOption] "+yc(e)+' declares no renderCapabilities(), so it accepts no render option (tried "'+t.map(function(u){return u[0]}).join('", "')+'"). A provider declares its knobs by implementing renderCapabilities().');for(var r=e.renderCapabilities(),i={},n=0;n<r.length;n++)i[r[n].name]=r[n];for(var a=Be.normalizeValue,s=[],l=0;l<t.length;l++){var c=t[l][0];if(W.RUNNER_INJECTED_RENDER_KEYS.indexOf(c)!==-1)throw new TypeError('[FrqtlApp.setRenderOption] "'+c+'" is merged into the render bag by the runner itself (FrqtlApp.RUNNER_INJECTED_RENDER_KEYS); it is not a writable render option.');var f=Object.prototype.hasOwnProperty.call(i,c)?i[c]:null;if(!f)throw new TypeError('[FrqtlApp.setRenderOption] "'+c+'" is not a render option '+yc(e)+" declares. Declared by renderCapabilities(): ["+r.map(function(u){return u.name}).join(", ")+"]. (FAIL-LOUD: an undeclared key is read by nothing, so the picture would silently differ from the recipe.)");s.push([c,a(f,t[l][1],"render option")])}return s}o(ov,"_validateRenderWrites");W.prototype._applyRenderWrites=function(e){for(var t=0;t<e.length;t++){var r=e[t][0];r.indexOf(vc)===0?this.setFilterActive(r.slice(vc.length),!!e[t][1]):this._renderOptions[r]=e[t][1]}for(var i=(this._renderOptionsListeners||[]).slice(),n=0;n<i.length;n++)i[n](e.map(function(a){return[a[0],a[1]]}));this._isLooping||this.repaint()};W.prototype.addRenderOptionsListener=function(e){var t=this._renderOptionsListeners||(this._renderOptionsListeners=[]);return t.indexOf(e)===-1&&t.push(e),function(){var r=t.indexOf(e);r!==-1&&t.splice(r,1)}};W.prototype.setRenderOptions=function(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError("[FrqtlApp.setRenderOptions] expects a plain object of { capabilityName: value }; got "+(Array.isArray(e)?"an array":String(e))+".");var t=Object.keys(e).map(function(i){return[i,e[i]]}),r=this._getRenderer();if(!r){this._stagedRenderOptions=(this._stagedRenderOptions||[]).concat(t);return}this._applyRenderWrites(ov(r,t))};W.prototype.setRenderOption=function(e,t){var r={};r[e]=t,this.setRenderOptions(r)};W.prototype.renderCapabilities=function(){var e=this._getRenderer();return!e||typeof e.renderCapabilities!="function"?[]:e.renderCapabilities()};W.prototype.getRenderOption=function(e){var t=this._getRenderer();if(!t)throw new TypeError("[FrqtlApp.getRenderOption] no display provider has attached yet, so no render option is declared. Read after the renderer boots.");if(typeof t.renderCapabilities!="function")throw new TypeError("[FrqtlApp.getRenderOption] "+yc(t)+' declares no renderCapabilities(), so "'+e+'" is not a render option it has.');for(var r=t.renderCapabilities(),i=!1,n=0;n<r.length;n++)if(r[n].name===e){i=!0;break}if(!i)throw new TypeError('[FrqtlApp.getRenderOption] "'+e+'" is not declared by '+yc(t)+" (declared: ["+r.map(function(a){return a.name}).join(", ")+"]).");return e.indexOf(vc)===0?this.isFilterActive(e.slice(vc.length)):this._renderOptions[e]};W.prototype.setFilterActive=function(e,t){var r=this._getRenderer();if(!r||typeof r.filter!="function"||typeof r.removeFilter!="function")throw new Error("[FrqtlApp.setFilterActive] no active renderer with filter()/removeFilter() (RendererProvider REQUIRED methods). (FAIL-LOUD.)");var i=Za;if(!Object.prototype.hasOwnProperty.call(i,e))throw new Error('[FrqtlApp.setFilterActive] unknown filter "'+e+'" \u2014 not a Filters.js catalog entry. (FAIL-LOUD.)');this._activeFilters||(this._activeFilters={}),t?(r.filter(i[e]),this._activeFilters[e]=!0):(r.removeFilter(e),delete this._activeFilters[e])};W.prototype.isFilterActive=function(e){return!!(this._activeFilters&&this._activeFilters[e])};W.prototype.setSourceRef=function(e){return this._capture.setSourceRef(e)};W.prototype.setSourceSha256=function(e){return this._capture.setSourceSha256(e)};W.prototype.sceneRecord=function(){return this._capture.sceneRecord()};W.prototype._assertRenderCensus=function(){var e=this.universe;if(!(!e||typeof e.unwrappedLargeObjectHandles!="function")){var t=e.unwrappedLargeObjectHandles();if(t.length!==0)throw new Error("[FrqtlApp] "+t.length+" object(s) are registered with the PHYSICS of this world but absent from its render census \u2014 handle(s) ["+t.join(", ")+"]. They collide and count correctly and CANNOT BE SEEN, which is the one outcome this surface refuses: a silently wrong picture is worse than an error, because what the eye is taught from it is wrong. Construct large objects through `new LargeObject(universe, \u2026)` (or a part that does \u2014 Wall, GraphingDetectorWall, Tunnel \u2026), which registers them for physics AND render in one act. The raw `universe.registerLargeObject(spec)` path carries no wrapper and belongs to headless harnesses only. (FAIL-LOUD.)")}};W.prototype.capture=function(e){try{this._assertRenderCensus()}catch(t){return Promise.reject(t)}return this._capture.capture(e)};W.prototype.captureStill=function(){try{this._assertRenderCensus()}catch(e){return Promise.reject(e)}return this._capture.captureStill()};W.prototype.addBackdrop=function(e,t,r){r=r||{};var i=t||{left:0,top:0,w:this.canvas_rect.w,h:this.canvas_rect.h},n=r.color||[0,0,0],a=r.visible!==void 0?r.visible:!1,s=Se,l=Ee,c=new s(this.universe,[i.left,i.top,i.w,i.h],l.NONE,[],"backdrop","closest",null,1,n);return c.backdrop=!0,c.image=e,c.visible=a,c};function bs(e){return e._declaredMembers||(e._declaredMembers=new Map)}o(bs,"_declaredMembersMap");function ws(e){return e._declaredTicks||(e._declaredTicks=new Map)}o(ws,"_declaredTicksMap");Object.defineProperty(W.prototype,"declared",{configurable:!0,get:o(function(){var e=this._declared||(this._declared=[]);if(!e.length)return e;for(var t=new Set(this.largeObjects),r=bs(this),i=0;i<e.length;i++)for(var n=r.get(e[i])||[],a=0;a<n.length;a++)if(!t.has(n[a]))throw new Error('[FrqtlApp.declared] stale declaration \u2014 "'+(e[i].name||e[i]._schemaKind)+'" lost its census LO "'+(n[a].name||"?")+'": the world was re-inited without clearing the registry (clearDeclared runs at FrqtlApp.setup and the RecipeContext co-init exp.createCanvas / exp.createScene \u2014 the world-init paths). (FAIL-LOUD.)');return e},"get")});W.prototype.declare=function(e,t,r,i){if(!e||typeof e!="object")throw new TypeError("[FrqtlApp.declare] a declared object is a handle, got "+typeof e+". (FAIL-LOUD.)");var n=this._declared||(this._declared=[]);if(n.indexOf(e)!==-1)throw new Error('[FrqtlApp.declare] "'+(e.name||e._schemaKind)+'" is already declared. (FAIL-LOUD.)');n.push(e);var a=(t||[]).slice();bs(this).set(e,a),ws(this).set(e,(r||[]).slice());for(var s=0;s<a.length;s++)if(this.declaredOf(a[s])!==e)throw n.pop(),bs(this).delete(e),ws(this).delete(e),new Error('[FrqtlApp.declare] "'+(e.name||e._schemaKind)+'" put the LO "'+(a[s].name||"?")+'" in the world without an `_owner` chain ending at it \u2014 a composer stamps ONE up-link on what it composed, so every drawn thing resolves to its declared object. (FAIL-LOUD.)');var l=i&&i.kind||e._schemaKind,c=l?Dt(l):null;return Cx(e,{inParts:!1,module:c?ys(c.from,this._projectUrls||null):null}),e};var gc=new WeakMap;function Cx(e,t){gc.set(e,t),Object.prototype.hasOwnProperty.call(e,"inParts")||(Object.defineProperty(e,"inParts",{configurable:!0,enumerable:!1,get:o(function(){var r=gc.get(this);return r?r.inParts:!1},"get")}),Object.defineProperty(e,"module",{configurable:!0,enumerable:!1,get:o(function(){var r=gc.get(this);return r?r.module:null},"get")}))}o(Cx,"_setCensusRow");function sv(e,t){var r=e._declared;if(!(!r||!r.length)){var i=e.declaredOf(t);i&&(e._handTouched||(e._handTouched=new Set)).add(i)}}o(sv,"_markHand");W.prototype._takeHandTouched=function(){var e=this._handTouched||new Set;return this._handTouched=new Set,e};W.prototype._adoptIntoParts=function(e){var t=gc.get(e);if(!t)throw new Error('[FrqtlApp] _adoptIntoParts: "'+(e&&e.name)+'" is not a declared object. (FAIL-LOUD.)');t.inParts=!0};W.prototype.beginWorld=function(){this._lastTickData=null};W.prototype.clearDeclared=function(){this._declared=[],this._declaredMembers=new Map,this._declaredTicks=new Map,this._handTouched=new Set};W.prototype.declaredOf=function(e){for(var t=this._declared||[],r=e,i=0;r&&i<64;r=r._owner,i++)if(t.indexOf(r)!==-1)return r;return null};W.prototype.membersOf=function(e){return(bs(this).get(e)||[]).slice()};W.prototype.undeclaredTickFunctions=function(){var e=this.universe&&Array.isArray(this.universe.experimentTickFunctions)?this.universe.experimentTickFunctions:[],t=new Set;return ws(this).forEach(function(r){for(var i=0;i<r.length;i++)t.add(r[i])}),e.filter(function(r){return!t.has(r)})};W.prototype.removeObject=function(e){var t=this.declared,r=t.indexOf(e);if(r===-1){var i=this.declaredOf(e);throw i?new Error('[FrqtlApp.removeObject] "'+(e&&e.name)+'" is part of the declared '+(i._schemaKind||"object")+' "'+i.name+'" \u2014 delete "'+i.name+'", not its part. (FAIL-LOUD.)'):new Error('[FrqtlApp.removeObject] "'+(e&&(e.name||e._schemaKind))+'" is not a declared object (runner.declared) \u2014 only what a declaring call (exp.addObject, a palette drop) produced is removed here; a primitive-surface object is disposed by whoever built it (obj.dispose()). (FAIL-LOUD.)')}if(typeof e.dispose!="function")throw new Error("[FrqtlApp.removeObject] the declared "+(e._schemaKind||"object")+' "'+e.name+'" has no dispose() \u2014 a part tears down what it composed. (FAIL-LOUD.)');var n=this.membersOf(e),a=(ws(this).get(e)||[]).slice();t.splice(r,1),bs(this).delete(e),ws(this).delete(e),e.dispose();var s=this.universe&&Array.isArray(this.universe.experimentTickFunctions)?this.universe.experimentTickFunctions:[],l=a.filter(function(u){return s.indexOf(u)!==-1});if(l.length)throw new Error('[FrqtlApp.removeObject] disposing "'+e.name+'" left '+l.length+" of its tick-functions running \u2014 its dispose() must tear down everything it composed. (FAIL-LOUD.)");var c=new Set(this.largeObjects),f=n.filter(function(u){return c.has(u)});if(f.length)throw new Error('[FrqtlApp.removeObject] disposing "'+e.name+'" left '+f.length+" of its LOs in the world ("+f.map(function(u){return u.name}).join(", ")+") \u2014 its dispose() must tear down everything it composed. (FAIL-LOUD.)")};W.prototype.getObjectByName=function(e,t){if(typeof e!="string"||!e)return null;for(var r=this.declared,i=0;i<r.length;i++){var n=r[i];if(n&&n.name===e&&(!t||t(n)))return n}return null};function jx(e,t,r,i){var n=e.largeObjects;if(!(!t||!n||n.length===0)){for(var a=Be,s=[],l=0;l<n.length;l++)for(var c=n[l],f=0;c&&c._owner&&f<64;c=c._owner,f++)if(c._owner===t){s.indexOf(c)===-1&&s.push(c);break}for(var u=0;u<s.length;u++){var h=s[u];if(a){var g=a.get(h._schemaKind||h.kind||"LargeObject"),d=!1;if(g){for(var m=0;m<g.fields.length;m++)if(g.fields[m].name===r){d=!0;break}}if(!d)continue}e.updateObjectProperty(h,r,i)}}}o(jx,"_fanOutRenderPropToGroup");W.prototype.updateObjectProperty=function(e,t,r){if(e){var i=t==="name"?this.declaredOf(e):null;if(i&&i.inParts)throw new TypeError('[FrqtlApp.updateObjectProperty] "name" of the parts entry "'+i.name+'": '+W.RENAME_REFUSAL+" (FAIL-LOUD.)");sv(this,e);var n=e._schemaKind||e.kind;if(!n)throw new TypeError('[FrqtlApp.updateObjectProperty] this object carries no `_schemaKind` (nor `kind`), so its descriptor cannot be resolved \u2014 property "'+t+'" was not rejected by any schema. Every shipped object class stamps `_schemaKind`; a handle without one is usually the wrong handle (e.g. a raw emitter handle rather than the palette object that wraps it).');var a=Be,s=null;if(a){var l=a.get(n);if(!l)throw new TypeError('[FrqtlApp.updateObjectProperty] Unknown object kind "'+n+'"');for(var c=0;c<l.fields.length;c++)if(l.fields[c].name===t){s=l.fields[c];break}if(!s)throw new TypeError('[FrqtlApp.updateObjectProperty] Property "'+t+'" is not in the schema for kind "'+n+'"');if(s.type==="readonly")throw new TypeError('[FrqtlApp.updateObjectProperty] Property "'+t+'" is readonly for kind "'+n+'"');r=a.normalizeValue(s,r,n);var f=nv(e);if(t==="rect"&&f){f.setRect(r),typeof this._onObjectMoved=="function"&&this._onObjectMoved(f,t);return}var u=["collisionBehavior","bounceDirection","decoherence","hooks","markTag","countFilter","capacity","orientationDeg","pitchDeg"];if(f===e&&Tx(a,t)){u.indexOf(t)!==-1?typeof e.setV2Prop=="function"&&e.setV2Prop(t,r):e.lo&&this.updateObjectProperty(e.lo,t,r),t==="rect"&&typeof this._onObjectMoved=="function"&&this._onObjectMoved(e,t);return}if(n==="Tunnel"&&typeof e.applyProp=="function"&&e.applyProp(t,r)){(t==="rect"||t==="left"||t==="top")&&typeof this._onObjectMoved=="function"&&this._onObjectMoved(e,t);return}if(n==="SphereEmitter"){typeof e.applyProp=="function"&&e.applyProp(t,r),(t==="center"||t==="rect")&&typeof this._onObjectMoved=="function"&&this._onObjectMoved(e,t);return}if(!s.engineVisible){if((n==="LargeObject"||n==="backdrop")&&(t==="collision_type"||t==="actions")&&typeof e.recompileActions=="function"){var h={};h[t==="collision_type"?"collisionType":"actions"]=r,e.recompileActions(h);return}e[t]=r,jx(this,e,t,r);return}}if(t==="rect"&&e.rect){if(typeof e.setRect!="function")throw new TypeError('[FrqtlApp.updateObjectProperty] "'+(e.name||n)+'" ('+n+") carries a rect but no setRect \u2014 its rect has no writer, so a rect write cannot land. (FAIL-LOUD.)");e.setRect(r);return}if(t!=="rect"&&t!=="source_rects")if(t==="actions"&&(n==="LargeObject"||n==="backdrop")){var g=Array.isArray(r)?r.slice():[r];e.arr_collision_actions=g,e.actions=g}else t==="layer"&&(n==="LargeObject"||n==="backdrop")?(e.layer=r??null,e.observedDimensions=r!=null?[r]:[]):e[t]=r;if(n==="PointSource"&&t==="rect"){typeof e.repositionToRect=="function"&&e.repositionToRect(r[0],r[1],r[2],r[3],this.universe);return}if(n==="QuantumEmitter"&&t==="rect"){typeof e.setSourceRect=="function"&&e.setSourceRect(r);return}this.universe&&typeof this.universe.updateObjectProperty=="function"&&this.universe.updateObjectProperty(e.handle,n,t,r)}};W.prototype._centerOf=function(e){if(!e||typeof e.getCenter!="function"||typeof e.setCenter!="function")return null;var t=e.getCenter();return Array.isArray(t)?t:null};W.prototype._rectAuthorityOf=function(e){return e&&e.rect&&typeof e.setRect=="function"?e:null};W.prototype.positionAuthorityOf=function(e){return this._centerOf(e)?"center":this._rectAuthorityOf(e)?"rect":null};W.prototype.noPositionAuthorityMessage=function(e){return'"'+(e&&e.name)+'" ('+(e&&e._schemaKind||"object")+") has no position authority \u2014 neither a centre (getCenter/setCenter) nor a rect (rect + setRect) \u2014 so it cannot be moved as a unit."};W.prototype._requireDeclared=function(e,t){if(e&&this.declaredOf(e)===e)return e;var r=e?this.declaredOf(e):null;throw new Error("[FrqtlApp."+t+"] "+(e?'"'+(e.name||e._schemaKind||"object")+'"':String(e))+" is not a declared object \u2014 only what the scene declared (runner.declared) is placed or read here"+(r?"; it belongs to the declared "+(r._schemaKind||"object")+' "'+r.name+'" \u2014 pass that handle (runner.declaredOf(x))':"; a primitive-surface object is not manipulable")+". (FAIL-LOUD.)")};W.prototype.centerOf=function(e){this._requireDeclared(e,"centerOf");var t=this._centerOf(e);if(t)return t;var r=this._rectAuthorityOf(e);if(r)return Vn(r.rect);throw new Error(this.noPositionAuthorityMessage(e))};W.prototype.kindOf=function(e){if(this._requireDeclared(e,"kindOf"),typeof e._schemaKind!="string"||!e._schemaKind)throw new Error('[FrqtlApp.kindOf] the declared object "'+e.name+'" carries no kind stamp \u2014 ObjectFactory.create stamps every declaration. (FAIL-LOUD.)');return e._schemaKind};W.prototype._placementAuthority=function(e){if(this._centerOf(e))return"center";var t=this._rectAuthorityOf(e);if(!t)throw new Error(this.noPositionAuthorityMessage(e));return typeof t.assertOwnsProgram=="function"&&t.assertOwnsProgram(),"rect"};W.prototype.placeDeclaredAt=function(e,t){if(sv(this,e),this._requireDeclared(e,"placeDeclaredAt"),!Array.isArray(t)||t.length!==2&&t.length!==3||!t.every(function(s){return typeof s=="number"&&isFinite(s)}))throw new TypeError("[FrqtlApp.placeDeclaredAt] the point is [x, y, z?] of finite numbers; got "+JSON.stringify(t)+". (FAIL-LOUD.)");var r=[t[0],t[1],t.length===3?t[2]:0],i=this.getUniverseBounds();if(r[0]<0||r[0]>i.width||r[1]<0||r[1]>i.height||r[2]<-i.zHalf||r[2]>i.zHalf)throw new RangeError("[FrqtlApp.placeDeclaredAt] "+JSON.stringify(r)+" is outside the universe cube (getUniverseBounds(): width "+i.width+", height "+i.height+", zHalf "+i.zHalf+" \u2014 x in [0, width], y in [0, height], z in [-zHalf, zHalf]). (FAIL-LOUD.)");var n=!1;if(this._placementAuthority(e)==="rect"){var a=Bi;a.hasZ(e.rect)||(n=Math.abs(r[2])>W.Z_HOLD_EPS,r=[r[0],r[1],0]),this.updateObjectProperty(e,"rect",a.snapRectPosition(a.rectAtCenter(e.rect,r)))}else this.updateObjectProperty(e,"center",nf(r));return{center:this.centerOf(e),zHeld:n}};W.prototype._orientationOf=function(e){return e&&typeof e.setOrientation=="function"?e:null};W.prototype.envelopeOf=function(e){if(e&&e.rect&&typeof e.rect.w=="number")return e.rect;for(var t=this.membersOf(e),r=1/0,i=1/0,n=-1/0,a=-1/0,s=1/0,l=-1/0,c=!1,f=0;f<t.length;f++){var u=t[f]&&t[f].rect;u&&(r=Math.min(r,u.left),i=Math.min(i,u.top),n=Math.max(n,u.left+u.w),a=Math.max(a,u.top+u.h),yi(u)&&(c=!0,s=Math.min(s,u.z),l=Math.max(l,u.z+(typeof u.d=="number"?u.d:u.w))))}if(!(r<n)||!(i<a))return null;var h={left:r,top:i,w:n-r,h:a-i};return c&&(h.z=s,h.d=l-s),h};W.prototype._objectCentroid=function(e){var t=this._centerOf(this.declaredOf(e));if(t)return t;var r=e&&e.rect;return r?Vn(r):null};W.prototype.getUniverseBounds=function(){var e=Be.worldRect(this.canvas_rect,"FrqtlApp.getUniverseBounds canvas_rect"),t=e.w,r=e.h;return{width:t,height:r,zHalf:Math.min(t,r)/2}};W.prototype._clampToUniverseCube=function(e){var t=this.getUniverseBounds(),r=Math.max(0,Math.min(t.width,e[0])),i=Math.max(0,Math.min(t.height,e[1])),n=Math.max(-t.zHalf,Math.min(t.zHalf,e[2]!=null?e[2]:0));return[r,i,n]};W.HOVER_MARGIN=6;W.HEADING_HOLD_EPS=.05;W.HEADING_WRITE_EPS_DEG=1e-6;W.Z_HOLD_EPS=1e-6;W.RENAME_REFUSAL="the key is the name \u2014 a rename is a new key in `parts` (with every reference to it, in code) or a fork of the sketch; a hand never writes a `name` into an entry.";var lv="off",Rx="roaming",Dx="grab-ready",Lx="grabbed";W.prototype.setAimArmed=function(e){if(!e){if(!this._aim)return;this._aim.unsubscribePose(),this._aim=null,this._notifyAim();return}if(!this._aim){var t=this.cameraControl;if(So(t)){if(typeof t.addPoseListener!="function"||typeof t.cameraOffsetFromWorld!="function"||typeof t.worldFromCameraOffset!="function")throw new Error("[FrqtlApp.setAimArmed] the angular camera handle lacks addPoseListener / cameraOffsetFromWorld / worldFromCameraOffset \u2014 the aim follows the camera through its pose notice and reads the ray off the offset pair (RENDERER_CONTRACT \xA71a.2). (FAIL-LOUD.)");var r=this;this._aim={cam:t,hover:null,grab:null,atEdge:!1,headingHeld:!1,zHeld:!1,error:null,last:null,unsubscribePose:null},this._aim.unsubscribePose=t.addPoseListener(function(){r._onAimPose()}),this._refreshHover(),this._notifyAim()}}};W.prototype.isAimArmed=function(){return!!this._aim};W.prototype.getAimState=function(){var e=this._aim;return e?{state:e.grab?Lx:e.hover?Dx:Rx,hover:e.hover?e.hover.name||"":null,grabbed:e.grab?e.grab.object.name||"":null,atEdge:!!(e.grab&&e.atEdge),headingHeld:!!(e.grab&&e.headingHeld),zHeld:!!(e.grab&&e.zHeld),error:e.error}:{state:lv,hover:null,grabbed:null,atEdge:!1,headingHeld:!1,zHeld:!1,error:null}};W.prototype.getGrabbedObject=function(){return this._aim&&this._aim.grab?this._aim.grab.object:null};W.prototype.addAimListener=function(e){var t=this._aimListeners||(this._aimListeners=[]);return t.indexOf(e)===-1&&t.push(e),function(){var r=t.indexOf(e);r!==-1&&t.splice(r,1)}};W.prototype._notifyAim=function(){var e=this.getAimState();this._aim&&(this._aim.last=JSON.stringify(e));for(var t=(this._aimListeners||[]).slice(),r=0;r<t.length;r++)t[r](e)};W.prototype._notifyAimIfChanged=function(){this._aim&&JSON.stringify(this.getAimState())===this._aim.last||this._notifyAim()};W.prototype.grabToggle=function(){var e=this._aim;if(!e)return lv;if(e.error=null,e.grab)this._releaseGrab();else if(this._refreshHover(),e.hover)try{e.grab=this._captureGrab(e.hover),e.atEdge=!1,e.headingHeld=!1,e.zHeld=!1}catch(t){e.grab=null,e.error="the object cannot be grabbed: "+(t&&t.message?t.message:t)}return this._notifyAim(),this.getAimState().state};W.prototype._releaseGrab=function(){this._aim&&(this._aim.grab=null,this._aim.atEdge=!1,this._aim.headingHeld=!1,this._aim.zHeld=!1)};W.prototype.setSelectHighlight=function(e){this._selected=e||null;var t=this._aim;t&&t.grab&&t.grab.object!==this._selected&&(this._releaseGrab(),t.error=null,this._notifyAim())};W.prototype._captureGrab=function(e){var t=this._aim.cam;this._placementAuthority(e);var r=this.centerOf(e),i=this._orientationOf(e),n={object:e,off:t.cameraOffsetFromWorld(r),oriTarget:i,hCam:null};if(i&&typeof i.getOrientation=="function"){var a=(i.getOrientation()||0)*Math.PI/180,s=t.cameraOffsetFromWorld([0,0,0]),l=t.cameraOffsetFromWorld([Math.cos(a),Math.sin(a),0]);n.hCam={right:l.right-s.right,up:l.up-s.up,forward:l.forward-s.forward}}return n};W.prototype._onAimPose=function(){this._aim&&this._aim.grab&&this._carryGrab(),this._refreshHover(),this._notifyAimIfChanged()};W.prototype._carryGrab=function(){var e=this._aim,t=e.grab,r=e.cam;try{var i=r.worldFromCameraOffset(t.off),n=this._clampToUniverseCube(i);e.atEdge=Math.abs(n[0]-i[0])+Math.abs(n[1]-i[1])+Math.abs(n[2]-i[2])>1e-6;var a=this.placeDeclaredAt(t.object,n);if(e.zHeld=a.zHeld,t.off=r.cameraOffsetFromWorld(a.zHeld?[n[0],n[1],0]:n),t.hCam){var s=r.worldFromCameraOffset({right:0,up:0,forward:0}),l=r.worldFromCameraOffset(t.hCam),c=l[0]-s[0],f=l[1]-s[1];if(e.headingHeld=Math.hypot(c,f)<W.HEADING_HOLD_EPS,!e.headingHeld){var u=Math.atan2(f,c)*180/Math.PI,h=typeof t.oriTarget.getOrientation=="function"?t.oriTarget.getOrientation():null,g=h===null?1/0:Math.abs(((u-h)%360+540)%360-180);g>W.HEADING_WRITE_EPS_DEG&&t.oriTarget.setOrientation(u)}}}catch(d){this._releaseGrab(),e.error="the grabbed object could not follow the camera: "+(d&&d.message?d.message:d),this._notifyAim()}};W.prototype._aimVolume=function(e,t){var r=Bi,i=this._centerOf(t===void 0?this.declaredOf(e):t);if(i){var n=e.rect?Math.max(e.rect.w||0,e.rect.h||0)/2:0;return r.drawnVolume({center:i,radius:n})}return e.rect?r.drawnVolume(e):null};W.prototype._declaredVolume=function(e){var t=this.membersOf(e);if(t.length===1||this._centerOf(e))return t.length?this._aimVolume(t[0],e):null;var r=this.envelopeOf(e);return r?tf({rect:r}):null};W.prototype._isDeclaredAimable=function(e){for(var t=this.membersOf(e),r=0;r<t.length;r++)if(this._isAimable(t[r]))return!0;return!1};W.prototype._isAimable=function(e){return!!e&&!e.backdrop&&e.visible!==!1&&this._isShellVisible(e)};W.prototype._centerRay=function(){var e=this._aim.cam,t=e.worldFromCameraOffset({right:0,up:0,forward:0}),r=e.worldFromCameraOffset({right:0,up:0,forward:1});return{origin:t,dir:[r[0]-t[0],r[1]-t[1],r[2]-t[2]]}};W.prototype._refreshHover=function(){var e=this._aim;if(e){for(var t=this.largeObjects,r=[],i=[],n=0;n<t.length;n++)if(this._isAimable(t[n])){var a=this.declaredOf(t[n]);if(a){var s=this._aimVolume(t[n],a);s&&(r.push(a),i.push(s))}}var l=this._centerRay(),c=rf(l.origin,l.dir,i,W.HOVER_MARGIN),f=c?r[c.index]:null;f!==e.hover&&(e.error=null),e.hover=f}};var cv="aimFeedback";W.RUNNER_INJECTED_RENDER_KEYS=Object.freeze([cv]);W.prototype._computeAimFeedback=function(){var e=this._aim;if(!e)return null;this._refreshHover(),this._notifyAimIfChanged();var t=this;function r(f){var u=f&&t._declaredVolume(f);return u?{name:f.name||"",volume:u}:null}o(r,"mark");var i={bounds:this.getUniverseBounds(),state:this.getAimState().state},n=r(e.grab?e.grab.object:e.hover);n&&(i.hover=n);var a=this._selected&&this._isDeclaredAimable(this._selected)?r(this._selected):null;a&&(i.selected=a),e.grab&&n&&(i.grabbed=n);var s=e.grab?e.grab.object:this._selected,l=this._orientationOf(s),c=s?this._declaredVolume(s):null;return l&&c&&typeof l.getOrientation=="function"&&(i.orientation={pivot:c.center,deg:l.getOrientation()||0}),i};W.prototype._renderOptsWithFeedback=function(){var e=this._computeAimFeedback();if(!e)return this._renderOptions;var t=Object.assign({},this._renderOptions);return t[cv]=e,t};W.prototype.screenPointOf=function(e,t,r,i){var n=this.renderer;if(!n||typeof n.screenToWorld!="function")throw new Error("[FrqtlApp.screenPointOf] the active renderer provider has no screenToWorld capability (RENDERER_CONTRACT) \u2014 world\u2192screen is its adjoint and has no other source. (FAIL-LOUD.)");for(var a=typeof e[2]=="number"?e[2]:0,s=i?i[0]:t/2,l=i?i[1]:r/2,c=0;c<8;c++){var f=n.screenToWorld(s,l,t,r,a),u=n.screenToWorld(s+1,l,t,r,a),h=n.screenToWorld(s,l+1,t,r,a);if(!f||!u||!h)return null;var g=u.x-f.x,d=h.x-f.x,m=u.y-f.y,b=h.y-f.y,y=g*b-d*m;if(!y)return null;var w=e[0]-f.x,x=e[1]-f.y,S=(b*w-d*x)/y,A=(g*x-m*w)/y;if(s+=S,l+=A,Math.abs(S)+Math.abs(A)<.05)break}var T=n.screenToWorld(s,l,t,r,a);return!T||Math.abs(T.x-e[0])+Math.abs(T.y-e[1])>.5?null:[s,l]};W.PICK_RADIUS_PX=32;W.PICK_DRIVE_PRIORITY=2;W.prototype.pickObjectAtScreen=function(e,t,r,i){var n=this.renderer;if(!n||typeof n.screenToWorld!="function")return null;for(var a=this.largeObjects,s=null,l=1/0,c=0;c<a.length;c++){var f=a[c],u=this.declaredOf(f);if(u){var h=this._objectCentroid(f);if(h){var g=this.screenPointOf(h,r,i,[e,t]);if(g){var d=typeof u.getCenter=="function",m=Math.hypot(g[0]-e,g[1]-t)/(d?W.PICK_DRIVE_PRIORITY:1);m<l&&(l=m,s=u)}}}}return l<=W.PICK_RADIUS_PX?s:null};W.prototype.setUniverseProperty=function(e,t){var r=Be;if(!r)throw new TypeError('[FrqtlApp.setUniverseProperty] ObjectSchema is unavailable \u2014 cannot validate "'+e+'" (FAIL-LOUD: never write to the universe unvalidated).');var i=r.get("Universe");if(!i)throw new TypeError('[FrqtlApp.setUniverseProperty] Unknown object kind "Universe"');for(var n=null,a=0;a<i.fields.length;a++)if(i.fields[a].name===e){n=i.fields[a];break}if(!n)throw new TypeError('[FrqtlApp.setUniverseProperty] Property "'+e+'" is not in the schema for kind "Universe". Valid properties: '+i.fields.map(function(s){return s.name}).join(", "));if(n.type==="readonly")throw new TypeError('[FrqtlApp.setUniverseProperty] Property "'+e+'" is readonly for kind "Universe"');this.universe[e]=t};W.prototype.getUniverseProperty=function(e){var t=Be;if(t){var r=t.get("Universe");if(r){for(var i=null,n=0;n<r.fields.length;n++)if(r.fields[n].name===e){i=r.fields[n];break}if(!i)throw new TypeError('[FrqtlApp.getUniverseProperty] Property "'+e+'" is not in the schema for kind "Universe". Valid properties: '+r.fields.map(function(a){return a.name}).join(", "))}}return this.universe[e]};W.prototype.moveLargeObject=function(e,t,r,i,n){if(!(!e||!e.rect)){var a=i!==void 0?i:e.rect.w,s=n!==void 0?n:e.rect.h;this.updateObjectProperty(e,"rect",[t,r,a,s])}};W.prototype.createCanvas=function(){this._createCanvasCalled=!0;var e=this._getRenderer();if(e&&e.init){var t={parentEl:this._canvasParentId,width:this.canvas_rect.w,height:this.canvas_rect.h,is3D:this._is3D};this._depth!==null&&(t.depth=this._depth);var r=Go,i=r.requireSceneSurface("FrqtlApp.createCanvas",e.init(t));return i.setAttribute(r.SCENE_SURFACE_ATTR,""),this._sceneSurface=i,this._onReady&&this._onReady(this),i}throw new Error("[FrqtlApp.createCanvas] no RendererProvider is active \u2014 one is selected by the boot module (lib/frqtl/experiments/_shared/boot.js) \u2014 a page boots through bootPage(), a programmatic host awaits bootRealm() \u2014 before calling createCanvas().")};W.prototype.setup=function(e,t){t=t||{},this._aim&&this.setAimArmed(!1),this._selected=null,this._setupResult&&typeof this._setupResult.dispose=="function"&&this._setupResult.dispose();var r=this;return this.retainSceneReplay(function(){return r.setup(e,t)}),this.clearDeclared(),iv(e,"setup"),typeof e.initWorld=="function"&&e.initWorld(this.universe,t),this._setupResult=e(this.universe,t),this._setupResult};W.prototype.retainSceneReplay=function(e){if(typeof e!="function")throw new TypeError("[FrqtlApp] retainSceneReplay(fn) takes the scene's replay function; got "+(e===null?"null":typeof e)+". (FAIL-LOUD.)");this._sceneReplay=e};W.prototype.restart=function(){if(typeof this._sceneReplay!="function")throw new Error("[FrqtlApp] restart(): nothing to replay \u2014 no scene has been built on this runner. Build one first with runner.setup(factory, opts) or RecipeContext.build(sketch). (FAIL-LOUD \u2014 a restart with nothing to replay would silently do nothing.)");this.stop();var e=this;function t(i){return e.beginWorld(),e.start(),i}o(t,"resume");var r;try{r=this._sceneReplay()}catch(i){return Promise.reject(i)}return r&&typeof r.then=="function"?r.then(t):Promise.resolve(t(r))};W.prototype._getRenderer=function(){if(!this._renderer){var e=Kh();if(e){var t=this._stagedRenderOptions?ov(e,this._stagedRenderOptions):null;this._createCanvasCalled||e.setSize(this.canvas_rect.w,this.canvas_rect.h),this._renderer=e,t&&(this._stagedRenderOptions=null,this._applyRenderWrites(t))}}return this._renderer||null};Object.defineProperty(W.prototype,"cameraControl",{configurable:!0,get:o(function(){if(!this._cameraControl){var e=this._getRenderer();e&&typeof e.getCameraControl=="function"&&(this._cameraControl=e.getCameraControl())}return this._cameraControl||null},"get")});W.prototype._failLoudMissingRenderer=function(){var e=`FrqtlApp: the DISPLAY SLOT is empty (FrqtlDisplay.get() === null).
18
18
 
19
19
  The boot module (lib/frqtl/experiments/_shared/boot.js) must select a renderer
20
20
  BEFORE the draw loop fires. This is a page configuration error.
package/dist/sdk.html CHANGED
@@ -132,7 +132,7 @@ universe.experimentTickFunctions.push(<span class="keyword">function</span> (u)
132
132
 
133
133
  <p>In the browser (<code>@descix/frqtl-web</code>), <code>bootScene(mount, sketch)</code> boots the engine and the renderer and runs a sketch — a <code>buildExperiment(exp)</code> function whose first statement creates the world. Import the parts the sketch uses from the same dist the doors come from:</p>
134
134
 
135
- <pre><code><span class="keyword">const</span> DIST = <span class="string">'https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0/dist'</span>;
135
+ <pre><code><span class="keyword">const</span> DIST = <span class="string">'https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-p2.1/dist'</span>;
136
136
  <span class="keyword">const</span> { bootScene } = <span class="keyword">await</span> import(DIST + <span class="string">'/frqtl/experiments/_shared/doors.js'</span>);
137
137
  <span class="keyword">const</span> { SphereEmitter } = <span class="keyword">await</span> import(DIST + <span class="string">'/frqtl/parts/index.js'</span>);
138
138