dsh-ccx 0.0.0-stage → 0.9.0
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/LICENSE +21 -0
- package/NOTICE +23 -0
- package/README.md +151 -3
- package/assets/icon.svg +27 -0
- package/assets/preview-home.png +0 -0
- package/assets/preview-market.png +0 -0
- package/assets/preview-milkyway.png +0 -0
- package/assets/preview-mountain.png +0 -0
- package/assets/preview-settings.png +0 -0
- package/assets/preview-surface.png +0 -0
- package/assets/scene-aurora-ionosphere.png +0 -0
- package/assets/scene-black-hole.png +0 -0
- package/assets/scene-blinking-squares.png +0 -0
- package/assets/scene-cloud-train.png +0 -0
- package/assets/scene-glow-horizon.png +0 -0
- package/assets/scene-heavenly-cloud.png +0 -0
- package/assets/scene-milky-way.png +0 -0
- package/assets/scene-mountain.png +0 -0
- package/assets/scene-particle-image.png +0 -0
- package/assets/scene-pixel-sculpt.png +0 -0
- package/cordis.patch.yml +16 -0
- package/lib/client.js +1481 -0
- package/lib/index.js +779 -0
- package/lib/vendor/code-codex/ascii-tiles.js +145 -0
- package/lib/vendor/code-codex/aurora-ionosphere.js +442 -0
- package/lib/vendor/code-codex/black-hole.js +643 -0
- package/lib/vendor/code-codex/blinking-squares.js +401 -0
- package/lib/vendor/code-codex/cloud-train.js +627 -0
- package/lib/vendor/code-codex/galleries.json +101 -0
- package/lib/vendor/code-codex/glow-horizon.js +260 -0
- package/lib/vendor/code-codex/heavenly-cloud.js +359 -0
- package/lib/vendor/code-codex/milky-way.js +304 -0
- package/lib/vendor/code-codex/mountain.js +336 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-image-098c5fbaa5c415ec.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-image-39894de0da1fa952.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-image-6447780fc6368ce2.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-image-746ff537a0eca39e.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-image-89d064cef83721eb.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-image-e1c658aa459cfcef.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-thumbnail-098c5fbaa5c415ec.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-thumbnail-39894de0da1fa952.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-thumbnail-6447780fc6368ce2.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-thumbnail-746ff537a0eca39e.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-thumbnail-89d064cef83721eb.png +0 -0
- package/lib/vendor/code-codex/particle-image/media/CodeCodex-background-particle-image-thumbnail-e1c658aa459cfcef.png +0 -0
- package/lib/vendor/code-codex/particle-image.js +1099 -0
- package/lib/vendor/code-codex/pixel-sculpt/media/CodeCodex-background-pixel-sculpt-image-079ae375628c240b.png +0 -0
- package/lib/vendor/code-codex/pixel-sculpt/media/CodeCodex-background-pixel-sculpt-image-0e0ec1222ff7a1bc.png +0 -0
- package/lib/vendor/code-codex/pixel-sculpt/media/CodeCodex-background-pixel-sculpt-image-3fde0595509bc4d5.png +0 -0
- package/lib/vendor/code-codex/pixel-sculpt.js +438 -0
- package/lib/vendor/code-codex/scene-defaults.json +308 -0
- package/lib/vendor/code-codex/scene-schemas.json +2965 -0
- package/lib/vendor/code-codex/shallow-ocean-thumbnails.json +12 -0
- package/lib/vendor/code-codex/shallow-ocean.js +5094 -0
- package/lib/vendor/code-codex/spectral-drape.js +172 -0
- package/package.json +70 -6
- package/src/client/api.ts +90 -0
- package/src/client/background/layer.ts +187 -0
- package/src/client/background/pixel-sculpt.ts +167 -0
- package/src/client/background/scene-runner.ts +317 -0
- package/src/client/background/shallow-ocean.ts +344 -0
- package/src/client/background/vendor-loader.ts +297 -0
- package/src/client/background/wallpaper.ts +87 -0
- package/src/client/index.ts +247 -0
- package/src/client/surfaces/corner-patch.ts +100 -0
- package/src/client/surfaces/surface-css.ts +155 -0
- package/src/client/ui/draft.ts +105 -0
- package/src/client/ui/icons.ts +47 -0
- package/src/client/ui/panel.ts +1524 -0
- package/src/client/ui/shallow-ocean-panel.ts +376 -0
- package/src/client/ui/styles.ts +1471 -0
- package/src/host/fence.ts +78 -0
- package/src/host/index.ts +26 -0
- package/src/host/routes.ts +367 -0
- package/src/host/storage.ts +109 -0
- package/src/host/window-chrome.ts +53 -0
- package/src/shared/constants.ts +239 -0
- package/src/shared/sanitize.ts +110 -0
- package/src/shared/types.ts +145 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
/*! Code-Codex first-party background package.
|
|
2
|
+
Source: https://github.com/Rice-dog/code-codex
|
|
3
|
+
# Third-Party Notices
|
|
4
|
+
|
|
5
|
+
Code-Codex contains independently authored code together with visual effects that may be adapted from, reconstructed from, or inspired by third-party works.
|
|
6
|
+
|
|
7
|
+
The MIT License in the root of the Code-Codex repository applies only to material independently authored for Code-Codex. It does not relicense any third-party work, copied fragment, adapted shader, image, asset, name, or other protected material identified below.
|
|
8
|
+
|
|
9
|
+
This document records provenance and the current verification status of the relevant material. It does not create a license. If this notice conflicts with an original license or an author's terms, the original terms control.
|
|
10
|
+
|
|
11
|
+
**Last updated:** September 19, 2026
|
|
12
|
+
|
|
13
|
+
Dependency licenses generated for packaged software are documented separately in `THIRD_PARTY_LICENSES.txt`. This document focuses on visual-effect provenance.
|
|
14
|
+
|
|
15
|
+
## Status Definitions
|
|
16
|
+
|
|
17
|
+
- **Confirmed:** the applicable license or permission has been preserved with verifiable source evidence.
|
|
18
|
+
- **Conditional:** a platform-default license may apply, but the work-specific page and the applicable platform terms still need to be retained as evidence.
|
|
19
|
+
- **Unverified:** attribution is known or suspected, but redistribution permission has not been established. Attribution alone is not permission.
|
|
20
|
+
- **Reference only:** Code-Codex was independently implemented from a publicly visible concept, screenshot, or prompt, and no third-party source file or asset is intentionally included.
|
|
21
|
+
|
|
22
|
+
## Modifications and Ownership Boundaries
|
|
23
|
+
|
|
24
|
+
- Code-Codex contributors claim copyright only in their independently authored modifications, integrations, controls, interfaces, lifecycle code, performance work, and other original additions.
|
|
25
|
+
- No ownership is claimed over an original third-party work or over portions derived from it. A separable Code-Codex addition may use the repository's MIT License, but that does not change the license of any underlying or inseparable third-party material.
|
|
26
|
+
- References to authors, projects, products, platforms, and trademarks are for identification and attribution only. They do not imply sponsorship, affiliation, approval, or endorsement of Code-Codex.
|
|
27
|
+
- Each adapted or reconstructed effect is an unofficial modified implementation. It must not be presented as the original author's official version.
|
|
28
|
+
- Attribution and a notice of modifications do not cure missing permission. Material marked **Unverified** should not be publicly or commercially redistributed until an applicable license or written permission is retained, or the relevant material is replaced with a demonstrably independent implementation.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 1. Heavenly Cloud Background
|
|
33
|
+
|
|
34
|
+
**Recorded reference work:** Heavenly [252]
|
|
35
|
+
**Recorded author:** XorDev (@XorDev)
|
|
36
|
+
**Recorded source:** https://www.shadertoy.com/view/W3BSzy
|
|
37
|
+
**Status:** Conditional; source and license evidence must still be retained
|
|
38
|
+
|
|
39
|
+
The local project is documented as a WebGL reconstruction made from supplied reference material. No complete third-party source file or work-specific license header is currently preserved with the local source.
|
|
40
|
+
|
|
41
|
+
If the source page had no work-specific license override and the ShaderToy default license applicable when the material was obtained was Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported, any portions that are legally adaptations of the original shader must be distributed under that license:
|
|
42
|
+
|
|
43
|
+
**CC BY-NC-SA 3.0**
|
|
44
|
+
https://creativecommons.org/licenses/by-nc-sa/3.0/
|
|
45
|
+
Legal code: https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
|
|
46
|
+
|
|
47
|
+
That license requires attribution, a link to the license, identification of changes, noncommercial use, and ShareAlike licensing of adaptations. This notice does not by itself prove that the platform default applied to this specific work.
|
|
48
|
+
|
|
49
|
+
**Code-Codex modifications:** the effect was reworked for the Code-Codex WebGL runtime; adjustable rendering controls, a bilingual settings interface, animation and lifecycle handling, application-theme coordination, and performance safeguards were added.
|
|
50
|
+
|
|
51
|
+
This is an unofficial modified or reconstructed implementation. XorDev has not been represented as endorsing Code-Codex.
|
|
52
|
+
|
|
53
|
+
The Code-Codex MIT License does not apply to any portion determined to be derived from the original shader.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 2. Aurora Ionosphere Background
|
|
58
|
+
|
|
59
|
+
**Original work:** Auroras
|
|
60
|
+
**Author:** nimitz (@stormoid)
|
|
61
|
+
**Source:** https://www.shadertoy.com/view/XtGGRt
|
|
62
|
+
**Status:** Conditional; source and license evidence must still be retained
|
|
63
|
+
|
|
64
|
+
The Code-Codex implementation adapts the shader algorithm for its WebGL background system. The original-author credit and ShaderToy identifier are preserved in the source and interface.
|
|
65
|
+
|
|
66
|
+
No work-specific license notice overriding the platform default is currently preserved in the local project. If the ShaderToy default license applicable when the source was obtained was CC BY-NC-SA 3.0, derived portions must be distributed under that license:
|
|
67
|
+
|
|
68
|
+
**CC BY-NC-SA 3.0**
|
|
69
|
+
https://creativecommons.org/licenses/by-nc-sa/3.0/
|
|
70
|
+
Legal code: https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode
|
|
71
|
+
|
|
72
|
+
That license requires attribution, a link to the license, identification of changes, noncommercial use, and ShareAlike licensing of adaptations. This notice does not by itself prove that the platform default applied to this specific work.
|
|
73
|
+
|
|
74
|
+
**Code-Codex modifications:** the shader was adapted to the Code-Codex WebGL background runtime; configurable motion, rendering and color parameters, bilingual controls, lifecycle and context handling, theme coordination, and application UI integration were added.
|
|
75
|
+
|
|
76
|
+
This is an unofficial modified implementation. nimitz has not been represented as endorsing Code-Codex.
|
|
77
|
+
|
|
78
|
+
The Code-Codex MIT License does not apply to portions derived from the original shader.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 3. Cloud Train Background
|
|
83
|
+
|
|
84
|
+
**Credited author in the supplied material:** mdb
|
|
85
|
+
**Original source:** Not yet verified
|
|
86
|
+
**Original license or permission:** Not yet verified
|
|
87
|
+
**Status:** Unverified
|
|
88
|
+
|
|
89
|
+
The supplied shader retained by the project credits **mdb**, but it does not contain a license header and no authoritative source URL or separate permission record is currently preserved.
|
|
90
|
+
|
|
91
|
+
An earlier draft associated this effect with “Up in the Cloud Sea” by Tianxiu (Tyson) Zhou and ShaderToy ID `Ndc3zl`. That association has not yet been verified against the shader preserved in the project and is therefore not relied upon in this notice. The CC BY 4.0 license of a different or unverified work must not be used to authorize this shader without a documented source comparison.
|
|
92
|
+
|
|
93
|
+
**Code-Codex modifications:** the supplied effect was integrated into the Code-Codex WebGL background system; bilingual parameter controls, plugin lifecycle and theme handling, performance controls, and a new sequential layered-emergence opening animation were added.
|
|
94
|
+
|
|
95
|
+
This is an unofficial modified implementation. Neither mdb nor any possible source author has been represented as endorsing Code-Codex.
|
|
96
|
+
|
|
97
|
+
Until an authoritative source license or direct permission from the relevant copyright holder is retained, this notice does not represent that public redistribution rights for the supplied shader have been established. Attribution alone is not permission.
|
|
98
|
+
|
|
99
|
+
The Code-Codex MIT License does not apply to the supplied shader or portions derived from it.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 4. Milky Way Background
|
|
104
|
+
|
|
105
|
+
**Reference work:** Milky way
|
|
106
|
+
**Author:** Almina (@Code4_11)
|
|
107
|
+
**Original publication:** NEORT, July 8, 2019
|
|
108
|
+
**Reference:** https://neort.io/en/art/bkho2v43p9f188g4t290
|
|
109
|
+
**Status:** Unverified / partial reconstruction
|
|
110
|
+
|
|
111
|
+
The Code-Codex implementation was reconstructed from an incomplete screenshot or shader excerpt attributed to the work above. It is not represented as a verified copy of the complete original shader. Missing stages and application integration were independently implemented for Code-Codex.
|
|
112
|
+
|
|
113
|
+
No explicit open-source license or permission for the original work has been preserved or verified. Copyright in the original work remains with its author. If any protectable original code fragment is included in the implementation, permission or an applicable license is required for its redistribution.
|
|
114
|
+
|
|
115
|
+
**Code-Codex modifications:** missing stages were reconstructed; configurable visual and motion parameters, a bilingual settings interface, WebGL and application integration, rendering lifecycle management, animation behavior, theme coordination, and performance work were added.
|
|
116
|
+
|
|
117
|
+
This is an unofficial partial reconstruction. Almina has not been represented as endorsing Code-Codex.
|
|
118
|
+
|
|
119
|
+
The attribution in this notice does not place the original work under the Code-Codex MIT License and does not itself grant redistribution permission.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 5. Layered Mountain Background
|
|
124
|
+
|
|
125
|
+
**Visual reference attribution:** Yohei Nishitsuji (西辻陽平 / @YoheiNishitsuji)
|
|
126
|
+
**Author website:** https://yoheinishitsuji.com/
|
|
127
|
+
**Status:** Reference only; exact original post and license not verified
|
|
128
|
+
|
|
129
|
+
The supplied reference identified a layered-mountain effect with Yohei Nishitsuji. The Code-Codex renderer was independently reconstructed from a partial visual reference and is not represented as a verbatim recovery of the author's source code.
|
|
130
|
+
|
|
131
|
+
No exact source-code post or work-specific license record is currently preserved. A previous draft stated that the relevant code was MIT licensed, but that statement has been removed until the exact post and its license can be documented.
|
|
132
|
+
|
|
133
|
+
Attribution is retained as acknowledgement of the visual reference. It does not imply that the original work has been relicensed under Code-Codex's MIT License.
|
|
134
|
+
|
|
135
|
+
**Code-Codex modifications:** an original two-pass WebGL2 renderer, generated ridge data, adjustable movement, landscape, lighting, atmosphere and output controls, a bilingual settings interface, lifecycle and theme integration, performance limits, and an opening animation were implemented for Code-Codex.
|
|
136
|
+
|
|
137
|
+
This is an unofficial independent reconstruction from a partial reference. Yohei Nishitsuji has not been represented as endorsing Code-Codex.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
# Visual Inspiration Only
|
|
142
|
+
|
|
143
|
+
The following effects were independently implemented for Code-Codex from publicly visible concepts or prompts. No source code or assets from the referenced works are intentionally included. This classification must be updated if a later audit identifies copied code or assets.
|
|
144
|
+
|
|
145
|
+
## Pixel Sculpt Background
|
|
146
|
+
|
|
147
|
+
**Visual reference:** Pixel Sculpt — React Bits Pro
|
|
148
|
+
|
|
149
|
+
**Reference:** https://pro.reactbits.dev/docs/components/pixel-sculpt
|
|
150
|
+
|
|
151
|
+
**Status:** Reference only
|
|
152
|
+
|
|
153
|
+
The visual effect and interaction concept of Pixel Sculpt Background were inspired by the publicly presented React Bits Pro Pixel Sculpt showcase. Code-Codex does not copy, extract, modify, or redistribute React Bits Pro source code, components, preview assets, or other Product files. The program code, WebGL rendering pipeline, prism geometry, interface integration, and extended functionality were independently implemented for Code-Codex.
|
|
154
|
+
|
|
155
|
+
**Code-Codex original work:** image sampling and relief generation, instanced prism rendering, pointer and click interactions, local image-library management, ordered autoplay and morph transitions, bilingual controls, full-window rendering and input forwarding, native Dark appearance and restoration, settings persistence, bounded uploads, lifecycle handling, and resource cleanup.
|
|
156
|
+
|
|
157
|
+
This notice identifies visual inspiration only and does not imply endorsement, sponsorship, or affiliation with React Bits Pro.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Blinking Squares Background
|
|
162
|
+
|
|
163
|
+
**Adapted from:** The user's local `blinking-squares-background-effect` project, an independently constructed React/WebGL2 implementation.
|
|
164
|
+
|
|
165
|
+
**Visual reference:** Blinking Squares — React Bits Pro
|
|
166
|
+
**Reference:** https://pro.reactbits.dev/docs/components/blinking-squares
|
|
167
|
+
|
|
168
|
+
Code-Codex adapts the supplied local implementation for its full-window background and settings lifecycle. No React Bits Pro source code, components, or assets are included. The visual reference does not imply endorsement or affiliation.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Particle Image Background
|
|
173
|
+
|
|
174
|
+
**Visual reference:** Particle Image — React Bits Pro
|
|
175
|
+
**Creator:** React Bits / David Haz
|
|
176
|
+
**Reference:** https://pro.reactbits.dev/docs/components/particle-image
|
|
177
|
+
**Status:** Reference only
|
|
178
|
+
|
|
179
|
+
The Code-Codex implementation was independently written from the publicly presented visual and interaction concept. No React Bits Pro source code or assets are intentionally included.
|
|
180
|
+
|
|
181
|
+
**Code-Codex original work:** image sampling and monochrome processing, particle generation, gas-like cursor interaction, continuous renewal, image-library management, per-image positioning, particle morphing with editable curves and keyframes, WebGL optimization, bilingual controls, and application integration.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Black Hole Background
|
|
186
|
+
|
|
187
|
+
**Visual reference:** Black Hole Hero Section
|
|
188
|
+
**Creator:** @yura
|
|
189
|
+
**Platform:** 21st.dev
|
|
190
|
+
**Reference:** https://21st.dev/community/components?preview=%2F%40yura%2Fcomponents%2Fblackhole-hero-section
|
|
191
|
+
**Status:** Reference only
|
|
192
|
+
|
|
193
|
+
The Code-Codex implementation was independently created from the publicly presented visual concept or prompt. No source code or assets from the referenced component are intentionally included.
|
|
194
|
+
|
|
195
|
+
**Code-Codex original work:** the WebGL renderer, animation and interaction logic, application-theme and lifecycle integration, bilingual parameter controls, and rendering optimizations including bounded pixel density and off-region early exits.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Glow Horizon Background
|
|
200
|
+
|
|
201
|
+
**Visual reference:** Glow Horizon
|
|
202
|
+
**Creator:** Bashar ahammed (@ahammed.bashar9)
|
|
203
|
+
**Platform:** 21st.dev
|
|
204
|
+
**Reference:** https://21st.dev/community/components?q=hero&preview=%2F%40ahammed.bashar9%2Fcomponents%2Fglow-horizon
|
|
205
|
+
**Status:** Reference only
|
|
206
|
+
|
|
207
|
+
The Code-Codex implementation was independently created from the publicly presented visual concept or prompt. No source code or assets from the referenced component are intentionally included.
|
|
208
|
+
|
|
209
|
+
**Code-Codex original work:** the WebGL rendering implementation, animation and interaction behavior, application-theme and lifecycle integration, bilingual controls, and performance work including merged wheel-driven updates.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
# Code-Codex Original Components
|
|
214
|
+
|
|
215
|
+
To the extent that they were independently authored and do not incorporate third-party material, the following Code-Codex components are licensed under the repository's MIT License:
|
|
216
|
+
|
|
217
|
+
- Transparent Background
|
|
218
|
+
- Original integration and application code
|
|
219
|
+
- UI and settings systems
|
|
220
|
+
- Plugin lifecycle management
|
|
221
|
+
- Independently authored WebGL integration code
|
|
222
|
+
- Other original Code-Codex code not identified above as third-party material
|
|
223
|
+
|
|
224
|
+
This list does not override the license status of any third-party shader, algorithm expression, code fragment, image, asset, or adapted portion embedded in those components.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
# Distribution and Record-Keeping
|
|
229
|
+
|
|
230
|
+
When Code-Codex source or binary packages include any material listed in this document:
|
|
231
|
+
|
|
232
|
+
1. Include this notice and all applicable original license texts with the distribution.
|
|
233
|
+
2. Preserve author names, work titles, source links, and notices in source files where practical.
|
|
234
|
+
3. Identify material changed by Code-Codex.
|
|
235
|
+
4. Do not describe unverified material as MIT licensed.
|
|
236
|
+
5. Before public distribution, retain an authoritative source-page snapshot, license text, or written permission for every adapted work whose permission is currently unverified.
|
|
237
|
+
6. For CC BY-NC-SA material, do not use it commercially and license adaptations under the same or a compatible ShareAlike license.
|
|
238
|
+
7. Keep a dated provenance record for every effect, including the retrieved source URL, author name, source snapshot or hash, applicable license text, and a concise description of Code-Codex modifications.
|
|
239
|
+
8. Remove or disable an affected effect from public builds if its source or permission cannot be verified; a disclaimer or takedown invitation is not a substitute for permission.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
# Repository License Scope
|
|
244
|
+
|
|
245
|
+
The MIT License in the root of the repository applies only to original Code-Codex material. Third-party shaders, adapted portions, and referenced works remain subject to their applicable licenses, copyright terms, or permissions.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
# Contact
|
|
250
|
+
|
|
251
|
+
If you are a copyright holder of a work identified above and believe that an attribution, source reference, classification, or license statement should be corrected, please open an issue in the Code-Codex repository or contact the project maintainer.
|
|
252
|
+
|
|
253
|
+
This notice is a provenance and license-scope record, not legal advice.
|
|
254
|
+
|
|
255
|
+
Nothing in this notice limits rights granted directly by an applicable license, applicable statutory exceptions, or written permission from a rights holder. No warranty is made that the information is complete; the maintainer should obtain qualified legal advice before commercial distribution or whenever the provenance of a material component remains uncertain.
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
*/
|
|
260
|
+
(()=>{var S=class{constructor(e){this.report=e;this.signal=this.#e.signal}#s=!1;#a=new Set;signal;#e=new AbortController;get disposed(){return this.#s}own(e){let t=!0,r=()=>{t&&(t=!1,this.#a.delete(r),e())};return this.#s?r():this.#a.add(r),r}listen(e,t,r,n){return this.#s?()=>{}:(e.addEventListener(t,r,n),this.own(()=>e.removeEventListener(t,r,n)))}dispose(){if(!this.#s){this.#s=!0,this.#e.abort();for(let e of[...this.#a].reverse())try{e()}catch(t){try{this.report(t)}catch{}}}}};function F(o){let e=0,t=0,r=0,n=(a,c)=>{if(++t>8192||c>10)throw Error("BG_ASSET_SHAPE: Visual asset structure exceeds its budget.");if(ArrayBuffer.isView(a)){if((a instanceof Float32Array||a instanceof Float64Array)&&!a.every(Number.isFinite))throw Error("BG_ASSET_NUMBER: Prepared visual numbers must be finite.");if(e+=a.byteLength,e>32*1024*1024)throw Error("BG_ASSET_SIZE: Prepared visual assets exceed 32 MiB.");return a}if(Array.isArray(a))return a.map(d=>n(d,c+1));if(a&&typeof a=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(a))){let d={};for(let[f,x]of Object.entries(a)){if(b({[f]:null}),r+=new TextEncoder().encode(f).length+4,r>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");d[f]=n(x,c+1)}return d}let l=b(a);if(r+=new TextEncoder().encode(JSON.stringify(l)).length,r>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");return l};return n(o,0)}function b(o){let e=0,t=(n,a)=>{if(++e>4096||a>8)throw Error("BG_STATE_LIMIT: Visual state exceeds the bounded schema.");if(n===null||typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n))throw Error("BG_STATE_NUMBER: Visual numbers must be finite.");return n}if(typeof n=="string"){if(n.length>1024)throw Error("BG_STATE_STRING: Visual strings must be bounded.");return n}if(Array.isArray(n))return n.map(c=>t(c,a+1));if(n&&typeof n=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(n))){let c={};for(let[l,d]of Object.entries(n)){if(/^(?:__proto__|constructor|prototype|token|accessToken|refreshToken|authorization|cookie|bridge|conversation|history|source|url|path)$/i.test(l))throw Error("BG_STATE_FIELD: Visual state contains an unsupported field.");d!==void 0&&(c[l]=t(d,a+1))}return c}throw Error("BG_STATE_TYPE: Visual state must contain serializable visual values.")},r=t(o,0);if(new TextEncoder().encode(JSON.stringify(r)).length>65536)throw Error("BG_STATE_SIZE: Visual state exceeds the message budget.");return r}function _(o,e){if(![o.width,o.height,o.left,o.top,e].every(Number.isFinite)||o.width<0||o.height<0)throw Error("BG_VIEWPORT_INVALID: Invalid visual dimensions.");let t=Math.max(1,Math.min(8192,o.width)),r=Math.max(1,Math.min(8192,o.height)),n=Math.min(3,Math.max(.5,e),Math.sqrt(16777216/(t*r)));return{width:t,height:r,left:o.left,top:o.top,dpr:n}}var H=/(token|cookie|password|secret|credential|authorization|apikey)/i,G=/^(content|text|body|prompt|messages|title|filename|name|raw|data|database64|commandline|sessionid|accountid|threadid|projectid)$|(?:path|url|uri)$/i;function m(o){return o.slice(0,8e3).replace(/\b[A-Za-z][A-Za-z0-9+.-]*:\/\/[^\s"'<>]+/g,t=>{try{let r=new URL(t);if(["127.0.0.1","localhost","[::1]"].includes(r.hostname)&&!r.username&&!r.password&&["/json/version","/json/list","/"].includes(r.pathname))return`${r.origin}${r.pathname}`}catch{}return"[url]"}).replace(/(?:\b[A-Za-z]:[\\/]|\\\\|\/(?:Users|home|tmp|var|etc|opt|mnt)\/|~\/)[^\r\n"'<>]*/g,"[path]").replace(/\b(?:Bearer\s+\S+|(?:authorization|password|secret|(?:access[_-]?|refresh[_-]?)?token|api[_-]?key|cookie)\s*[:=]\s*[^,;\r\n]+)/gi,"[credential]").replace(/\bsk-[A-Za-z0-9_-]{8,}|\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,"[credential]").replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,"[email]").slice(0,4e3)+(o.length>8e3?" [truncated]":"")}function P(o){let e=256,t=new WeakSet,r=(n,a)=>{if(--e<0||a>6)return"[truncated]";if(typeof n=="string")return m(n);if(n===null||typeof n=="boolean"||typeof n=="number")return n;if(typeof n!="object")return"[unsupported]";if(t.has(n))return"[circular]";if(t.add(n),n instanceof Error)return{name:m(n.name),message:m(n.message)};if(Array.isArray(n))return n.slice(0,128).map(l=>r(l,a+1));let c=Object.create(null);for(let[l,d]of Object.entries(n).slice(0,128)){let f=l.replace(/[^a-z0-9]/gi,"");c[m(l).slice(0,160)]=H.test(f)||G.test(f)?"[redacted]":r(d,a+1)}return c};try{return r(o,0)}catch{return{redactionFailed:!0}}}var W=Symbol.for("code-codex:runtime-events:v1"),X=window,T=X[W]??={events:[],dropped:0};function v(o,e,t,r={}){let n={source:m(o).slice(0,160),action:m(e).slice(0,160),outcome:m(t).slice(0,160),details:{...P(r),observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}},a=new TextEncoder().encode(JSON.stringify(n)).length;a>7e3&&(n.details={truncated:!0,originalBytes:a,observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}),T.events.push(n),T.events.length>1e3&&(T.events.splice(0,200),T.dropped+=200)}var q=Symbol.for("code-codex:background-startup-hold:v1");function V(){let o=window;return o[q]??={active:!1,layers:new Set,next:-1,pending:new Map,painted:new WeakSet,openings:new WeakMap}}function Y(o){return o.closest("[data-code-codex-particle-layer]")}function w(o){return!!Y(o)&&V().active}var M=()=>{let o=window;return o[Symbol.for("code-codex:background-isolation:v1")]??=new Map},A=class{constructor(e,t,r,n,a,c=()=>{},l={}){this.host=r;this.onError=c;if(typeof Worker!="function"||typeof n.transferControlToOffscreen!="function")throw Error("BG_BACKEND_UNAVAILABLE: Independent background rendering is unavailable.");let d=b(a),f=_(r.getBoundingClientRect(),devicePixelRatio||1);this.#t={id:e,mode:"worker",phase:"preparing",frames:0,pending:0},M().set(this,this.#t),this.#e=new S(i=>v("background","resource release","failed",{id:e,error:String(i)})),this.ready=this.firstFrame=new Promise((i,s)=>{this.#s=i,this.#a=s}),this.ready.catch(()=>{}),this.#h=f;let x=URL.createObjectURL(new Blob([t],{type:"text/javascript"}));this.#e.own(()=>URL.revokeObjectURL(x));try{this.#p=new Worker(x,{name:"code-codex-background-"+e})}catch(i){throw this.#e.dispose(),M().delete(this),i}let E=this.#p,D=setTimeout(()=>this.#o("BG_FIRST_FRAME_TIMEOUT: The background did not produce a first frame within 15 seconds."),15e3);this.#e.own(()=>clearTimeout(D)),this.#e.listen(n,"webglcontextlost",i=>{i.preventDefault(),this.#o("BG_WORKER_CONTEXT_LOST: The transferred background graphics context was lost. Enable the background again to retry.")}),this.#e.listen(E,"error",i=>this.#o("BG_WORKER_ERROR: "+i.message)),this.#e.listen(E,"messageerror",()=>this.#o("BG_WORKER_PROTOCOL: The background response could not be decoded.")),this.#e.listen(E,"message",i=>{let s=i.data;if(!(this.#i||s?.v!==1||s.session!==this.#c)){if(s.type==="failed"){this.#o("BG_WORKER_RENDER_FAILED: "+String(s.message).slice(0,1500));return}if(s.type==="first-frame"&&!this.#d&&(this.#d=!0,this.#t.frames=s.frames??1,clearTimeout(D),this.#t.phase="running",this.#s(),this.#v(),v("background","isolated first frame","ready",{id:e,backend:"worker"})),s.type==="sample"&&Number.isSafeInteger(s.frames)&&(this.#t.frames=s.frames),s.type==="event"&&typeof s.event=="string"&&this.kernelEvent(s.event,s.value),s.type==="result"&&Number.isSafeInteger(s.callId)){let u=this.#l.get(s.callId);u&&(clearTimeout(u.timer),this.#l.delete(s.callId),s.error?u.reject(Error("BG_KERNEL_FAILED: "+String(s.error))):u.resolve(s.value))}s.type==="ack"&&s.seq===this.#u&&(clearTimeout(this.#g),this.#g=void 0,this.#u=0,this.#t.pending=0,this.#m())}});let I=new ResizeObserver(()=>{let i=_(this.host.getBoundingClientRect(),devicePixelRatio||1);JSON.stringify(i)!==JSON.stringify(this.#h)&&(this.#h=i,this.#f({viewport:i}))});I.observe(r),this.#e.own(()=>I.disconnect());let L=new IntersectionObserver(i=>{this.#b=i[0]?.isIntersecting??!0,this.#v()});L.observe(r),this.#e.own(()=>L.disconnect());let k=matchMedia("(prefers-reduced-motion: reduce)");this.#e.listen(k,"change",()=>this.#f({reduced:k.matches})),this.#e.listen(document,"visibilitychange",()=>this.#v()),this.#e.listen(window,"code-codex:background-hold-changed",()=>this.#v()),this.#e.listen(window,"pagehide",()=>this.dispose());let N=i=>{if(!this.#d||this.#i||l.interactive===!1||!["pointerup","pointercancel"].includes(i.type)&&i.composedPath().some(y=>y instanceof Element&&y.matches('button,a,input,textarea,select,[contenteditable],dialog,[role="menu"],[role="menubar"],[popover]')))return;let s=i,u=this.#h;if(i instanceof PointerEvent&&!["pointermove","pointerleave","pointerup","pointercancel"].includes(i.type)&&(s.clientX<u.left||s.clientX>u.left+u.width||s.clientY<u.top||s.clientY>u.top+u.height))return;let g={type:i.type};if(i instanceof PointerEvent)Object.assign(g,{clientX:s.clientX,clientY:s.clientY,pointerId:s.pointerId,button:s.button,buttons:s.buttons,isPrimary:s.isPrimary,pointerType:s.pointerType});else if(i instanceof WheelEvent){let y=this.#r.find(p=>p.type==="state"&&p.input?.type==="wheel");if(y){let p=y.input;p.deltaX=Math.max(-1e4,Math.min(1e4,p.deltaX+i.deltaX)),p.deltaY=Math.max(-1e4,Math.min(1e4,p.deltaY+i.deltaY));return}Object.assign(g,{deltaX:i.deltaX,deltaY:i.deltaY,deltaMode:i.deltaMode,clientX:i.clientX,clientY:i.clientY})}else i instanceof KeyboardEvent&&Object.assign(g,{repeat:i.repeat,isComposing:i.isComposing,altKey:i.altKey,ctrlKey:i.ctrlKey,metaKey:i.metaKey,shiftKey:i.shiftKey,key:"",code:""});i.type==="pointermove"?((s.clientX<u.left||s.clientX>u.left+u.width||s.clientY<u.top||s.clientY>u.top+u.height)&&(g.type="pointerleave"),this.#f({input:g})):this.#r.length<8?(this.#r.push({type:"state",input:g}),this.#m()):this.#o("BG_INPUT_QUEUE_FULL: Background input exceeded the bounded discrete-event queue.")};for(let i of["pointermove","pointerleave","pointerdown","pointerup","pointercancel","wheel","keydown"])this.#e.listen(window,i,N,{passive:!0});try{let i=n.transferControlToOffscreen();E.postMessage({v:1,session:this.#c,type:"init",canvas:i,settings:d,viewport:this.#h,reduced:k.matches,held:w(r)},[i])}catch(i){this.#o("BG_CANVAS_TRANSFER: "+String(i))}}ready;firstFrame;#s;#a;#e;#p;#c=crypto.randomUUID();#y=0;#u=0;#n;#r=[];#l=new Map;#x=0;#d=!1;#i=!1;#b=!0;#h;#g;#t;get diagnostics(){return{...this.#t}}setSettings(e){this.#f({settings:b(e)})}updateSettings(e){this.setSettings(e)}replay(){if(!this.#i){if(this.#r.length>=8)throw Error("BG_COMMAND_QUEUE_FULL: Wait for the pending visual command.");this.#r.push({type:"replay"}),this.#m()}}kernelEvent(e,t){}activityChanged(e){}call(e,t=[],r=3e4){if(this.#i)return Promise.reject(Error("BG_KERNEL_DISPOSED: The visual worker has been retired."));if(this.#l.size>=8||this.#r.length>=8)return Promise.reject(Error("BG_COMMAND_QUEUE_FULL: Wait for the pending visual command."));let n=F(t),a=++this.#x,c=new Promise((l,d)=>{let f=setTimeout(()=>{this.#l.delete(a),d(Error("BG_KERNEL_TIMEOUT: The visual command did not confirm completion. It was not replayed."))},r);this.#l.set(a,{resolve:l,reject:d,timer:f})});return this.#r.push({type:"call",method:e,args:n,callId:a}),this.#m(),c}resumeOpening(){this.replay()}#v=()=>{let e=!document.hidden&&this.#b&&(!this.#d||!w(this.host));this.#f({visible:e}),this.activityChanged(e)};#f(e){this.#i||(this.#n={...this.#n,...e},this.#m())}#m(){if(this.#i||this.#u)return;let e;if(this.#n&&["settings","viewport","visible","reduced"].some(t=>t in this.#n)){let{input:t,...r}=this.#n;e={type:"state",...r},this.#n=t?{input:t}:void 0}else if(this.#r.length)e=this.#r.shift();else if(this.#n)e={type:"state",...this.#n},this.#n=void 0;else return;this.#u=++this.#y,this.#t.pending=1;try{this.#p.postMessage({v:1,session:this.#c,seq:this.#u,...e})}catch(t){this.#o("BG_WORKER_SEND_FAILED: "+String(t));return}this.#g=setTimeout(()=>this.#o("BG_WORKER_ACK_TIMEOUT: The visual worker stopped acknowledging bounded updates."),5e3)}#o(e){if(!this.#i){this.#t.phase="failed",this.#t.error=e,this.#a(Error(e)),v("background","visual worker","failed",{id:this.#t.id,session:this.#c,sequence:this.#y,pending:this.#u,message:e});try{this.onError(e)}finally{this.dispose()}}}dispose(){if(this.#i)return;this.#i=!0,this.#e.dispose(),clearTimeout(this.#g),this.#n=void 0,this.#r=[],this.#d||this.#a(new DOMException("Background preparation was cancelled.","AbortError"));for(let l of this.#l.values())clearTimeout(l.timer),l.reject(new DOMException("Background command was cancelled.","AbortError"));this.#l.clear();let e=this.#p,t=this.#c,r=++this.#y;this.#t.phase="disposing";let n=!1,a=()=>{n||(n=!0,clearTimeout(c),e.terminate(),M().delete(this))},c=setTimeout(()=>{v("background","worker disposal","unconfirmed",{id:this.#t.id,timeoutMs:1500}),a()},1500);e.addEventListener("message",l=>{l.data?.session===t&&l.data?.type==="disposed"&&a()});try{e.postMessage({v:1,session:t,seq:r,type:"dispose"})}catch{a()}}};var j="code-codex:aurora-ionosphere-background:v1";var be=Object.freeze({distance:24,elevation:-5.5,azimuth:0,orbitSpeed:0,roll:-20,fov:42,diskInner:3,diskOuter:15,diskThickness:.26,diskDensity:1,brightness:1,spinSpeed:.06,grain:.48,doppler:.35,hotColor:"#FFF3DE",midColor:"#FF9838",coolColor:"#8E3A0B",starBrightness:0,glow:1,exposure:.9,vignette:.28,steps:200,resolution:.4,maxDpr:1,paused:!1}),xe=Object.freeze({variant:"bottom",inertialWheel:!0,openingDuration:2,wheelSensitivity:1,wheelDownIntensity:.4,wheelUpIntensity:.8,wheelTravelScale:1,wheelDownDistance:100,wheelUpDistance:20,wheelUpTrailDistance:18,wheelUpTrailStrength:1.15,wheelUpStiffness:180,wheelUpDamping:48,wheelReleaseDelay:70,wheelUpReleaseDelay:80,maxReleaseVelocity:2.4,returnStiffness:180,returnDamping:14,initialStretch:1.8,initialBlur:0,rimColor:"#FFFFFF",violetColor:"#A558FB",blueColor:"#4922E5",shadowColor:"#000000"}),Ee=Object.freeze({low:Object.freeze({steps:56,resolutionScale:.56,maxDpr:1}),medium:Object.freeze({steps:76,resolutionScale:.72,maxDpr:1.25}),high:Object.freeze({steps:100,resolutionScale:.86,maxDpr:1.5})}),Se=Object.freeze({quality:"high",speed:.72,intensity:1.15,turbulence:1,radius:3,colorShift:0,pointerInfluence:.45,introDuration:2.2,introFeather:.22,paused:!1}),Te=Object.freeze({low:Object.freeze({steps:32,rayScale:.72,maxDpr:1.1,minAdaptiveScale:.92,noiseAtlasSize:512}),medium:Object.freeze({steps:50,rayScale:.76,maxDpr:1.25,minAdaptiveScale:.9,noiseAtlasSize:768}),high:Object.freeze({steps:72,rayScale:.82,maxDpr:1.4,minAdaptiveScale:.9,noiseAtlasSize:1024})}),U=Object.freeze({hue:0,saturation:1,quality:"medium",speed:1,intensity:1,curtainScale:.5,turbulence:.58,glow:.72,starDensity:.56,introDuration:2.4,introFeather:.16,introStart:-.22,introEnd:1.32,introSkyEnd:.48,introStarStart:.34,paused:!1});function h(o,e,t,r){let n=typeof o=="number"?o:Number(o);return Number.isFinite(n)?Math.min(t,Math.max(e,n)):r}function K(o){let e=Z(o)?o:{},t=U,r=e.quality==="low"||e.quality==="medium"||e.quality==="high"?e.quality:t.quality;return{hue:h(e.hue,-180,180,t.hue),saturation:h(e.saturation,0,2,t.saturation),quality:r,speed:h(e.speed,0,3,t.speed),intensity:h(e.intensity,0,3,t.intensity),curtainScale:h(e.curtainScale,.05,2,t.curtainScale),turbulence:h(e.turbulence,0,1.8,t.turbulence),glow:h(e.glow,0,2.4,t.glow),starDensity:h(e.starDensity,0,1.5,t.starDensity),introDuration:h(e.introDuration,.6,6,t.introDuration),introFeather:h(e.introFeather,.03,.4,t.introFeather),introStart:h(e.introStart,-.5,.25,t.introStart),introEnd:h(e.introEnd,.8,1.8,t.introEnd),introSkyEnd:h(e.introSkyEnd,.1,.9,t.introSkyEnd),introStarStart:h(e.introStarStart,0,.8,t.introStarStart),paused:typeof e.paused=="boolean"?e.paused:t.paused}}function B(){try{return K(JSON.parse(localStorage.getItem(j)||"{}"))}catch{return{...U}}}function Z(o){return o!==null&&typeof o=="object"}var we=Object.freeze({top:{axis:"y",enter:-100,rest:-50},bottom:{axis:"y",enter:100,rest:50},left:{axis:"x",enter:100,rest:50},right:{axis:"x",enter:-100,rest:-50}});var Re=Object.freeze({quality:"medium",speed:.35,amplitude:1,frequency:1,zoom:1,rotation:0,exposure:1,timeOffset:5.07,introDuration:2.8,introFeather:.18,introAngle:32,introZoom:.16,introEnabled:!0,paused:!1,colors:Object.freeze(["#d81159","#8f2d56","#218380","#fbb13c","#73d2de"])});var Ae=Object.freeze([.72,.46]),ke=Math.PI/180;var C=class extends A{constructor(o,e,t,r){super("aurora-ionosphere",`"use strict";(()=>{globalThis.window=globalThis;function K(i,e,t){let n=globalThis,r=e,a=!0,d=!1,o=new Set,s=new Set,f=new EventTarget,u=Object.assign(new EventTarget,{matches:!1,media:"(prefers-reduced-motion: reduce)"}),h=()=>({...r,x:r.left,y:r.top,right:r.left+r.width,bottom:r.top+r.height,toJSON(){return this}}),m=Object.assign(new EventTarget,{getBoundingClientRect:h,closest:()=>null,style:{setProperty(){},removeProperty(){}},dataset:{},contains:()=>!1}),b=new Map,I={},A=new Proxy(i,{get(l,c){if(c==="getBoundingClientRect")return h;if(c==="clientWidth"||c==="offsetWidth")return r.width;if(c==="clientHeight"||c==="offsetHeight")return r.height;if(c==="closest")return()=>null;if(c==="parentElement")return m;if(c==="setPointerCapture"||c==="releasePointerCapture"||c==="replaceWith")return()=>{};if(c==="style")return m.style;if(c==="dataset")return I;if(c==="getContext")return(E,w)=>{if(b.has(E))return b.get(E);let _=l.getContext(E,w);if(!_)return null;let M=null,N=new Map,Y=new Proxy(_,{get(D,x){let G=Reflect.get(D,x,D);return typeof G!="function"?G:(N.has(x)||N.set(x,(...P)=>{let ce=Reflect.apply(G,D,P);return x==="bindFramebuffer"&&(P[0]===D.FRAMEBUFFER||P[0]===D.DRAW_FRAMEBUFFER)&&(M=P[1]),(x==="drawArrays"||x==="drawElements"||x==="drawArraysInstanced"||x==="drawElementsInstanced")&&M===null&&t(),ce}),N.get(x))}});return b.set(E,Y),Y};let g=Reflect.get(l,c,l);return typeof g=="function"?g.bind(l):g},set(l,c,g){return Reflect.set(l,c,g,l)}});Object.defineProperties(m,{clientWidth:{get:()=>r.width},clientHeight:{get:()=>r.height}});let F=Object.assign(f,{get hidden(){return!a},get visibilityState(){return a?"visible":"hidden"}});Object.defineProperties(F,{hidden:{get:()=>!a},visibilityState:{get:()=>a?"visible":"hidden"}}),n.window=n,n.document=F,n.matchMedia=()=>u,n.Element=class extends EventTarget{},Object.defineProperties(n,{innerWidth:{configurable:!0,get:()=>r.width},innerHeight:{configurable:!0,get:()=>r.height},devicePixelRatio:{configurable:!0,get:()=>r.dpr}}),n.ResizeObserver=class{constructor(l){this.callback=l;o.add(this)}observe(){this.callback([{target:m,contentRect:h()}])}disconnect(){o.delete(this)}},n.IntersectionObserver=class{constructor(l){this.callback=l;s.add(this)}observe(){this.callback([{target:m,isIntersecting:a,intersectionRatio:a?1:0}])}disconnect(){s.delete(this)}};let k=(l,c)=>{let g=new Event(l);for(let[E,w]of Object.entries(c))Object.defineProperty(g,E,{value:w});return g};return{host:m,canvas:A,viewport(l){r=l;for(let c of o)c.callback([{target:m,contentRect:h()}]);n.dispatchEvent(new Event("resize"))},visibility(l){if(a!==l){a=l,f.dispatchEvent(new Event("visibilitychange"));for(let c of s)c.callback([{target:m,isIntersecting:l,intersectionRatio:l?1:0}])}},motion(l){d!==l&&(d=l,u.matches=l,u.dispatchEvent(new Event("change")))},input(l,c){n.dispatchEvent(k(l,c)),m.dispatchEvent(k(l,c)),i.dispatchEvent(k(l,c))},dispose(){o.clear(),s.clear();for(let l of b.values())try{l.getExtension("WEBGL_lose_context")?.loseContext()}catch{}b.clear()}}}function C(i){let e=0,t=0,n=0,r=(a,d)=>{if(++t>8192||d>10)throw Error("BG_ASSET_SHAPE: Visual asset structure exceeds its budget.");if(ArrayBuffer.isView(a)){if((a instanceof Float32Array||a instanceof Float64Array)&&!a.every(Number.isFinite))throw Error("BG_ASSET_NUMBER: Prepared visual numbers must be finite.");if(e+=a.byteLength,e>32*1024*1024)throw Error("BG_ASSET_SIZE: Prepared visual assets exceed 32 MiB.");return a}if(Array.isArray(a))return a.map(s=>r(s,d+1));if(a&&typeof a=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(a))){let s={};for(let[f,u]of Object.entries(a)){if(R({[f]:null}),n+=new TextEncoder().encode(f).length+4,n>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");s[f]=r(u,d+1)}return s}let o=R(a);if(n+=new TextEncoder().encode(JSON.stringify(o)).length,n>65536)throw Error("BG_ASSET_METADATA: Visual asset metadata exceeds 64 KiB.");return o};return r(i,0)}function R(i){let e=0,t=(r,a)=>{if(++e>4096||a>8)throw Error("BG_STATE_LIMIT: Visual state exceeds the bounded schema.");if(r===null||typeof r=="boolean")return r;if(typeof r=="number"){if(!Number.isFinite(r))throw Error("BG_STATE_NUMBER: Visual numbers must be finite.");return r}if(typeof r=="string"){if(r.length>1024)throw Error("BG_STATE_STRING: Visual strings must be bounded.");return r}if(Array.isArray(r))return r.map(d=>t(d,a+1));if(r&&typeof r=="object"&&[Object.prototype,null].includes(Object.getPrototypeOf(r))){let d={};for(let[o,s]of Object.entries(r)){if(/^(?:__proto__|constructor|prototype|token|accessToken|refreshToken|authorization|cookie|bridge|conversation|history|source|url|path)$/i.test(o))throw Error("BG_STATE_FIELD: Visual state contains an unsupported field.");s!==void 0&&(d[o]=t(s,a+1))}return d}throw Error("BG_STATE_TYPE: Visual state must contain serializable visual values.")},n=t(i,0);if(new TextEncoder().encode(JSON.stringify(n)).length>65536)throw Error("BG_STATE_SIZE: Visual state exceeds the message budget.");return n}function W(i,e){if(![i.width,i.height,i.left,i.top,e].every(Number.isFinite)||i.width<0||i.height<0)throw Error("BG_VIEWPORT_INVALID: Invalid visual dimensions.");let t=Math.max(1,Math.min(8192,i.width)),n=Math.max(1,Math.min(8192,i.height)),r=Math.min(3,Math.max(.5,e),Math.sqrt(16777216/(t*n)));return{width:t,height:n,left:i.left,top:i.top,dpr:r}}var de=()=>{};function j(i){de=i}var fe=/(token|cookie|password|secret|credential|authorization|apikey)/i,he=/^(content|text|body|prompt|messages|title|filename|name|raw|data|database64|commandline|sessionid|accountid|threadid|projectid)$|(?:path|url|uri)$/i;function S(i){return i.slice(0,8e3).replace(/\\b[A-Za-z][A-Za-z0-9+.-]*:\\/\\/[^\\s"'<>]+/g,t=>{try{let n=new URL(t);if(["127.0.0.1","localhost","[::1]"].includes(n.hostname)&&!n.username&&!n.password&&["/json/version","/json/list","/"].includes(n.pathname))return\`\${n.origin}\${n.pathname}\`}catch{}return"[url]"}).replace(/(?:\\b[A-Za-z]:[\\\\/]|\\\\\\\\|\\/(?:Users|home|tmp|var|etc|opt|mnt)\\/|~\\/)[^\\r\\n"'<>]*/g,"[path]").replace(/\\b(?:Bearer\\s+\\S+|(?:authorization|password|secret|(?:access[_-]?|refresh[_-]?)?token|api[_-]?key|cookie)\\s*[:=]\\s*[^,;\\r\\n]+)/gi,"[credential]").replace(/\\bsk-[A-Za-z0-9_-]{8,}|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+/g,"[credential]").replace(/\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}\\b/g,"[email]").slice(0,4e3)+(i.length>8e3?" [truncated]":"")}function Z(i){let e=256,t=new WeakSet,n=(r,a)=>{if(--e<0||a>6)return"[truncated]";if(typeof r=="string")return S(r);if(r===null||typeof r=="boolean"||typeof r=="number")return r;if(typeof r!="object")return"[unsupported]";if(t.has(r))return"[circular]";if(t.add(r),r instanceof Error)return{name:S(r.name),message:S(r.message)};if(Array.isArray(r))return r.slice(0,128).map(o=>n(o,a+1));let d=Object.create(null);for(let[o,s]of Object.entries(r).slice(0,128)){let f=o.replace(/[^a-z0-9]/gi,"");d[S(o).slice(0,160)]=fe.test(f)||he.test(f)?"[redacted]":n(s,a+1)}return d};try{return n(i,0)}catch{return{redactionFailed:!0}}}var me=Symbol.for("code-codex:runtime-events:v1"),pe=window,B=pe[me]??={events:[],dropped:0};function $(i,e,t,n={}){let r={source:S(i).slice(0,160),action:S(e).slice(0,160),outcome:S(t).slice(0,160),details:{...Z(n),observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}},a=new TextEncoder().encode(JSON.stringify(r)).length;a>7e3&&(r.details={truncated:!0,originalBytes:a,observedAt:Date.now(),documentElapsedMs:Math.round(performance.now())}),B.events.push(r),B.events.length>1e3&&(B.events.splice(0,200),B.dropped+=200)}var ge=Symbol.for("code-codex:background-startup-hold:v1");function X(){let i=window;return i[ge]??={active:!1,layers:new Set,next:-1,pending:new Map,painted:new WeakSet,openings:new WeakMap}}function ve(i){return i.closest("[data-code-codex-particle-layer]")}function ye(i,e){e.native=requestAnimationFrame(t=>{let n=X();e.native=void 0,n.pending.has(i)&&(n.active&&n.painted.has(e.layer)||(n.pending.delete(i),n.active&&(n.painted.add(e.layer),n.layers.add(e.layer),$("background-opening","initial frame","prepared")),e.callback(t)))})}function J(i,e){let t=ve(i);if(!t)return requestAnimationFrame(e);let n=X(),r=n.next--,a={layer:t,callback:e};return n.pending.set(r,a),ye(r,a),r}function Q(i){if(i>=0){cancelAnimationFrame(i);return}let e=X(),t=e.pending.get(i);t?.native!==void 0&&cancelAnimationFrame(t.native),e.pending.delete(i)}var Xe=Object.freeze({distance:24,elevation:-5.5,azimuth:0,orbitSpeed:0,roll:-20,fov:42,diskInner:3,diskOuter:15,diskThickness:.26,diskDensity:1,brightness:1,spinSpeed:.06,grain:.48,doppler:.35,hotColor:"#FFF3DE",midColor:"#FF9838",coolColor:"#8E3A0B",starBrightness:0,glow:1,exposure:.9,vignette:.28,steps:200,resolution:.4,maxDpr:1,paused:!1}),qe=Object.freeze({variant:"bottom",inertialWheel:!0,openingDuration:2,wheelSensitivity:1,wheelDownIntensity:.4,wheelUpIntensity:.8,wheelTravelScale:1,wheelDownDistance:100,wheelUpDistance:20,wheelUpTrailDistance:18,wheelUpTrailStrength:1.15,wheelUpStiffness:180,wheelUpDamping:48,wheelReleaseDelay:70,wheelUpReleaseDelay:80,maxReleaseVelocity:2.4,returnStiffness:180,returnDamping:14,initialStretch:1.8,initialBlur:0,rimColor:"#FFFFFF",violetColor:"#A558FB",blueColor:"#4922E5",shadowColor:"#000000"}),Ve=Object.freeze({low:Object.freeze({steps:56,resolutionScale:.56,maxDpr:1}),medium:Object.freeze({steps:76,resolutionScale:.72,maxDpr:1.25}),high:Object.freeze({steps:100,resolutionScale:.86,maxDpr:1.5})}),Ye=Object.freeze({quality:"high",speed:.72,intensity:1.15,turbulence:1,radius:3,colorShift:0,pointerInfluence:.45,introDuration:2.2,introFeather:.22,paused:!1}),U=Object.freeze({low:Object.freeze({steps:32,rayScale:.72,maxDpr:1.1,minAdaptiveScale:.92,noiseAtlasSize:512}),medium:Object.freeze({steps:50,rayScale:.76,maxDpr:1.25,minAdaptiveScale:.9,noiseAtlasSize:768}),high:Object.freeze({steps:72,rayScale:.82,maxDpr:1.4,minAdaptiveScale:.9,noiseAtlasSize:1024})}),be=Object.freeze({hue:0,saturation:1,quality:"medium",speed:1,intensity:1,curtainScale:.5,turbulence:.58,glow:.72,starDensity:.56,introDuration:2.4,introFeather:.16,introStart:-.22,introEnd:1.32,introSkyEnd:.48,introStarStart:.34,paused:!1});function p(i,e,t,n){let r=typeof i=="number"?i:Number(i);return Number.isFinite(r)?Math.min(t,Math.max(e,r)):n}function ee(i){let e=xe(i)?i:{},t=be,n=e.quality==="low"||e.quality==="medium"||e.quality==="high"?e.quality:t.quality;return{hue:p(e.hue,-180,180,t.hue),saturation:p(e.saturation,0,2,t.saturation),quality:n,speed:p(e.speed,0,3,t.speed),intensity:p(e.intensity,0,3,t.intensity),curtainScale:p(e.curtainScale,.05,2,t.curtainScale),turbulence:p(e.turbulence,0,1.8,t.turbulence),glow:p(e.glow,0,2.4,t.glow),starDensity:p(e.starDensity,0,1.5,t.starDensity),introDuration:p(e.introDuration,.6,6,t.introDuration),introFeather:p(e.introFeather,.03,.4,t.introFeather),introStart:p(e.introStart,-.5,.25,t.introStart),introEnd:p(e.introEnd,.8,1.8,t.introEnd),introSkyEnd:p(e.introSkyEnd,.1,.9,t.introSkyEnd),introStarStart:p(e.introStarStart,0,.8,t.introStarStart),paused:typeof e.paused=="boolean"?e.paused:t.paused}}function xe(i){return i!==null&&typeof i=="object"}var Ke=Object.freeze({top:{axis:"y",enter:-100,rest:-50},bottom:{axis:"y",enter:100,rest:50},left:{axis:"x",enter:100,rest:50},right:{axis:"x",enter:-100,rest:-50}});var Ee=\`
|
|
261
|
+
attribute vec2 aPosition;
|
|
262
|
+
void main() { gl_Position = vec4(aPosition, 0.0, 1.0); }
|
|
263
|
+
\`,Se=\`
|
|
264
|
+
precision highp float;
|
|
265
|
+
uniform vec2 uResolution;
|
|
266
|
+
uniform vec2 uNoiseDomainMin;
|
|
267
|
+
uniform vec2 uNoiseDomainSize;
|
|
268
|
+
uniform vec2 uFlowRotation;
|
|
269
|
+
uniform float uNoiseScale;
|
|
270
|
+
uniform float uNoiseTurbulence;
|
|
271
|
+
|
|
272
|
+
mat2 rotateNoiseDomain(float angle) {
|
|
273
|
+
float angle2 = angle * angle;
|
|
274
|
+
float c = 1.0 - angle2 * (0.5 - angle2 * 0.041666667);
|
|
275
|
+
float s = angle * (1.0 - angle2 * (0.166666667 - angle2 * 0.008333333));
|
|
276
|
+
return mat2(c, s, -s, c);
|
|
277
|
+
}
|
|
278
|
+
float tri(float x) { return clamp(abs(fract(x) - 0.5), 0.01, 0.49); }
|
|
279
|
+
vec2 tri2(vec2 p) { return vec2(tri(p.x) + tri(p.y), tri(p.y + tri(p.x))); }
|
|
280
|
+
float triNoise2d(vec2 p, mat2 flowRotation) {
|
|
281
|
+
float rz = 0.0;
|
|
282
|
+
p *= uNoiseScale;
|
|
283
|
+
p = p * rotateNoiseDomain(p.x * 0.06);
|
|
284
|
+
vec2 bp = p;
|
|
285
|
+
vec2 dg = tri2(bp * 1.85) * 0.75 * flowRotation;
|
|
286
|
+
p -= dg * 0.4 * uNoiseTurbulence;
|
|
287
|
+
p *= 1.21 + (rz - 1.0) * 0.02;
|
|
288
|
+
rz += tri(p.x + tri(p.y)) * 0.756;
|
|
289
|
+
p = p * mat2(-1.0, 0.0, 0.0, -1.0);
|
|
290
|
+
dg = tri2(bp * 2.405) * 0.75 * flowRotation;
|
|
291
|
+
p -= dg * 0.888888889 * uNoiseTurbulence;
|
|
292
|
+
p *= 1.21 + (rz - 1.0) * 0.02;
|
|
293
|
+
rz += tri(p.x + tri(p.y)) * 0.31752;
|
|
294
|
+
p = p * mat2(0.757322769, -0.653040752, 0.653040752, 0.757322769);
|
|
295
|
+
dg = tri2(bp * 3.1265) * 0.75 * flowRotation;
|
|
296
|
+
p -= dg * 1.97530864 * uNoiseTurbulence;
|
|
297
|
+
p *= 1.21 + (rz - 1.0) * 0.02;
|
|
298
|
+
rz += tri(p.x + tri(p.y)) * 0.1333584;
|
|
299
|
+
p = p * mat2(-0.147075554, 0.989125261, -0.989125261, -0.147075554);
|
|
300
|
+
dg = tri2(bp * 4.06445) * 0.75 * flowRotation;
|
|
301
|
+
p -= dg * 4.38957476 * uNoiseTurbulence;
|
|
302
|
+
p *= 1.21 + (rz - 1.0) * 0.02;
|
|
303
|
+
rz += tri(p.x + tri(p.y)) * 0.056010528;
|
|
304
|
+
p = p * mat2(-0.534555438, -0.845133412, 0.845133412, -0.534555438);
|
|
305
|
+
dg = tri2(bp * 5.283785) * 0.75 * flowRotation;
|
|
306
|
+
p -= dg * 9.75461058 * uNoiseTurbulence;
|
|
307
|
+
p *= 1.21 + (rz - 1.0) * 0.02;
|
|
308
|
+
rz += tri(p.x + tri(p.y)) * 0.0235244218;
|
|
309
|
+
return clamp(1.0 / pow(max(rz * 29.0, 0.0001), 1.3), 0.0, 0.55);
|
|
310
|
+
}
|
|
311
|
+
void main() {
|
|
312
|
+
vec2 atlasUv = gl_FragCoord.xy / uResolution;
|
|
313
|
+
vec2 worldPosition = uNoiseDomainMin + atlasUv * uNoiseDomainSize;
|
|
314
|
+
mat2 flowRotation = mat2(uFlowRotation.x, uFlowRotation.y, -uFlowRotation.y, uFlowRotation.x);
|
|
315
|
+
float density = triNoise2d(worldPosition, flowRotation);
|
|
316
|
+
gl_FragColor = vec4(density, density, density, 1.0);
|
|
317
|
+
}
|
|
318
|
+
\`;function Te(i){return\`
|
|
319
|
+
precision highp float;
|
|
320
|
+
#define AURORA_STEPS \${i}
|
|
321
|
+
uniform vec2 uResolution;
|
|
322
|
+
uniform float uIntensity;
|
|
323
|
+
uniform float uGlow;
|
|
324
|
+
uniform float uIntro;
|
|
325
|
+
uniform float uIntroFeather;
|
|
326
|
+
uniform float uIntroStart;
|
|
327
|
+
uniform float uIntroEnd;
|
|
328
|
+
uniform sampler2D uLayerLut;
|
|
329
|
+
uniform float uLayerLutStep;
|
|
330
|
+
uniform sampler2D uNoiseAtlas;
|
|
331
|
+
uniform vec2 uNoiseDomainMin;
|
|
332
|
+
uniform vec2 uNoiseDomainInverseSize;
|
|
333
|
+
float hash21(vec2 p) { return fract(sin(dot(p, vec2(12.9898, 4.1414))) * 43758.5453); }
|
|
334
|
+
float decode16(vec2 encoded) { return dot(encoded, vec2(65280.0, 255.0)) / 65535.0; }
|
|
335
|
+
void sampleAuroraLayer(vec3 ro, vec3 rd, float inverseRayHeight, float pixelJitter,
|
|
336
|
+
float planeHeight, float jitterAmount, vec3 spectralColor, float layerWeight,
|
|
337
|
+
inout vec4 color, inout vec4 averageColor) {
|
|
338
|
+
float planeDistance = (planeHeight - ro.y) * inverseRayHeight - pixelJitter * jitterAmount;
|
|
339
|
+
vec3 position = ro + planeDistance * rd;
|
|
340
|
+
vec2 noiseUv = (position.zx - uNoiseDomainMin) * uNoiseDomainInverseSize;
|
|
341
|
+
float density = texture2D(uNoiseAtlas, noiseUv).r;
|
|
342
|
+
vec4 layerColor = vec4(spectralColor * density, density);
|
|
343
|
+
averageColor = mix(averageColor, layerColor, 0.5);
|
|
344
|
+
color += averageColor * layerWeight;
|
|
345
|
+
}
|
|
346
|
+
vec4 aurora(vec3 ro, vec3 rd) {
|
|
347
|
+
vec4 color = vec4(0.0);
|
|
348
|
+
vec4 averageColor = vec4(0.0);
|
|
349
|
+
float pixelJitter = 0.006 * hash21(gl_FragCoord.xy);
|
|
350
|
+
float inverseRayHeight = 1.0 / (rd.y * 2.0 + 0.4);
|
|
351
|
+
for (int index = 0; index < AURORA_STEPS; index++) {
|
|
352
|
+
float lookupX = (float(index) + 0.5) * uLayerLutStep;
|
|
353
|
+
vec4 spectralAndWeightHigh = texture2D(uLayerLut, vec2(lookupX, 0.25));
|
|
354
|
+
vec4 geometryAndWeightLow = texture2D(uLayerLut, vec2(lookupX, 0.75));
|
|
355
|
+
sampleAuroraLayer(ro, rd, inverseRayHeight, pixelJitter,
|
|
356
|
+
decode16(geometryAndWeightLow.rg) * 1.6, geometryAndWeightLow.b,
|
|
357
|
+
spectralAndWeightHigh.rgb,
|
|
358
|
+
decode16(vec2(spectralAndWeightHigh.a, geometryAndWeightLow.a)) * 0.15,
|
|
359
|
+
color, averageColor);
|
|
360
|
+
}
|
|
361
|
+
color *= clamp(rd.y * 15.0 + 0.4, 0.0, 1.0);
|
|
362
|
+
color.rgb *= uIntensity * mix(0.55, 1.175, uGlow);
|
|
363
|
+
color.a *= clamp(uIntensity, 0.0, 2.0);
|
|
364
|
+
return color * 1.8;
|
|
365
|
+
}
|
|
366
|
+
void main() {
|
|
367
|
+
vec2 screenUv = gl_FragCoord.xy / uResolution;
|
|
368
|
+
vec2 p = vec2(screenUv.x - 0.5, screenUv.y * 0.55 + 0.015);
|
|
369
|
+
p.x *= uResolution.x / uResolution.y;
|
|
370
|
+
vec3 ro = vec3(0.0, 0.0, -6.7);
|
|
371
|
+
vec3 rd = normalize(vec3(p, 1.3));
|
|
372
|
+
float curtainProgress = smoothstep(0.06, 0.94, uIntro);
|
|
373
|
+
float revealEdge = mix(uIntroStart, uIntroEnd, curtainProgress);
|
|
374
|
+
float revealFeather = max(0.001, uIntroFeather);
|
|
375
|
+
float curtainReveal = 1.0 - smoothstep(revealEdge - revealFeather, revealEdge + revealFeather, screenUv.y);
|
|
376
|
+
curtainReveal = mix(curtainReveal, 1.0, smoothstep(0.92, 1.0, uIntro));
|
|
377
|
+
float curtainIgnition = smoothstep(0.02, 0.22, uIntro);
|
|
378
|
+
float horizonFade = smoothstep(0.0, 0.01, abs(rd.y)) * 0.1 + 0.9;
|
|
379
|
+
vec4 field = smoothstep(vec4(0.0), vec4(1.5), aurora(ro, rd))
|
|
380
|
+
* horizonFade * curtainReveal * curtainIgnition;
|
|
381
|
+
gl_FragColor = field;
|
|
382
|
+
}
|
|
383
|
+
\`}var we=\`
|
|
384
|
+
precision highp float;
|
|
385
|
+
#define STAR_LAYERS 4
|
|
386
|
+
uniform vec2 uResolution;
|
|
387
|
+
uniform float uStarResolution;
|
|
388
|
+
uniform float uStarDensity;
|
|
389
|
+
uniform float uIntro;
|
|
390
|
+
uniform float uIntroSkyEnd;
|
|
391
|
+
uniform float uIntroStarStart;
|
|
392
|
+
uniform sampler2D uAuroraTexture;
|
|
393
|
+
uniform mat3 uAuroraColor;
|
|
394
|
+
uniform vec2 uAuroraUvScale;
|
|
395
|
+
uniform vec2 uAuroraUvOffset;
|
|
396
|
+
vec3 hash33(vec3 p) {
|
|
397
|
+
p = fract(p * vec3(443.8975, 397.2973, 491.1871));
|
|
398
|
+
p += dot(p.zxy, p.yxz + 19.27);
|
|
399
|
+
return fract(vec3(p.x * p.y, p.z * p.x, p.y * p.z));
|
|
400
|
+
}
|
|
401
|
+
vec3 stars(vec3 p) {
|
|
402
|
+
if (uStarDensity <= 0.0) return vec3(0.0);
|
|
403
|
+
vec3 color = vec3(0.0);
|
|
404
|
+
float densityScale = 1.51 * uStarDensity;
|
|
405
|
+
vec3 starPoint = p * (0.15 * uStarResolution);
|
|
406
|
+
for (int index = 0; index < STAR_LAYERS; index++) {
|
|
407
|
+
float fi = float(index);
|
|
408
|
+
vec3 q = fract(starPoint) - 0.5;
|
|
409
|
+
vec3 id = floor(starPoint);
|
|
410
|
+
vec2 random = hash33(id).xy;
|
|
411
|
+
float star = 1.0 - smoothstep(0.0, 0.6, length(q));
|
|
412
|
+
star *= step(random.x, (0.0005 + fi * fi * 0.001) * densityScale);
|
|
413
|
+
vec3 tint = mix(vec3(1.0, 0.49, 0.1), vec3(0.75, 0.9, 1.0), random.y);
|
|
414
|
+
color += star * (tint * 0.1 + 0.9);
|
|
415
|
+
starPoint *= 1.3;
|
|
416
|
+
}
|
|
417
|
+
return color * color * 0.8;
|
|
418
|
+
}
|
|
419
|
+
vec3 sky(vec3 rd) {
|
|
420
|
+
float sunDisk = dot(normalize(vec3(-0.5, -0.6, 0.9)), rd) * 0.5 + 0.5;
|
|
421
|
+
float sunDisk2 = sunDisk * sunDisk;
|
|
422
|
+
sunDisk = sunDisk2 * sunDisk2 * sunDisk;
|
|
423
|
+
vec3 color = mix(vec3(0.05, 0.1, 0.2), vec3(0.1, 0.05, 0.2), rd.y * 0.5 + 0.5);
|
|
424
|
+
color += sunDisk * vec3(1.0, 0.9, 0.7) * 0.63;
|
|
425
|
+
return color * 0.63;
|
|
426
|
+
}
|
|
427
|
+
void main() {
|
|
428
|
+
vec2 screenUv = gl_FragCoord.xy / uResolution;
|
|
429
|
+
vec2 p = vec2(screenUv.x - 0.5, screenUv.y * 0.55 + 0.015);
|
|
430
|
+
p.x *= uResolution.x / uResolution.y;
|
|
431
|
+
vec3 rd = normalize(vec3(p, 1.3));
|
|
432
|
+
float horizonFade = smoothstep(0.0, 0.01, abs(rd.y)) * 0.1 + 0.9;
|
|
433
|
+
float skyIntro = smoothstep(0.0, max(0.001, uIntroSkyEnd), uIntro);
|
|
434
|
+
float starIntro = smoothstep(uIntroStarStart, min(1.0, uIntroStarStart + 0.56), uIntro);
|
|
435
|
+
vec3 color = sky(rd) * horizonFade * skyIntro;
|
|
436
|
+
vec4 field = texture2D(uAuroraTexture, uAuroraUvOffset + screenUv * uAuroraUvScale);
|
|
437
|
+
color += stars(rd) * starIntro;
|
|
438
|
+
color = color * (1.0 - field.a) + max(vec3(0.0), uAuroraColor * field.rgb);
|
|
439
|
+
gl_FragColor = vec4(color, 1.0);
|
|
440
|
+
}
|
|
441
|
+
\`;function q(i,e,t){let n=Math.min(1,Math.max(0,(t-i)/Math.max(1e-6,e-i)));return n*n*(3-2*n)}function te(i,e,t,n){let r=Math.round(Math.min(1,Math.max(0,n))*65535);i[e]=r>>8,i[t]=r&255}function ne(i,e,t){let n=i/Math.max(1,e),r=[.8,.8+Math.pow(t-1,1.4)*.002],a=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(let h=0;h<=16;h+=1){let m=h/16*.55+.015;for(let b=0;b<=16;b+=1){let I=(b/16-.5)*n,A=Math.hypot(I,m,1.3),F=I/A,k=m/A,l=1.3/A,c=1/(k*2+.4);for(let g of r)for(let E of[0,.006]){let w=g*c-E,_=w*F,M=-6.7+w*l;a=Math.min(a,M),d=Math.max(d,M),o=Math.min(o,_),s=Math.max(s,_)}}}let f=Math.max(.08,(d-a)*.035),u=Math.max(.08,(s-o)*.035);return{minX:a-f,minY:o-u,sizeX:d-a+f*2,sizeY:s-o+u*2}}var H=class{#c;#e;#V;#a;#R;#s;#n;#r;#A;#k;#p;#g;#_;#M;#h;#i;#l;#v=0;#D=!0;#E=!0;#L=!document.hidden;#y=!0;#m=!0;#H=0;#S=0;#d=0;#I;#b=1;#x=1;#F=1;#P=1;#T=1;#w=1;#Y=1;#o;#u=1;#O=0;#C=0;#B={x:0,y:0};#U={x:.5,y:.5};#z=window.matchMedia("(prefers-reduced-motion: reduce)");#N;constructor(e,t,n,r){this.#V=e,this.#a=t,this.#c=ee(n),this.#R=r,this.#I=e.getBoundingClientRect(),this.#o=ne(1,1,U[this.#c.quality].steps);let a=t.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,powerPreference:"high-performance",preserveDrawingBuffer:!1});if(!a)throw new Error("WebGL is unavailable for Aurora Ionosphere Background");this.#e=a,this.#X(),this.#N=new ResizeObserver(()=>{this.#I=this.#V.getBoundingClientRect(),this.#y=!0,this.#f()}),this.#N.observe(e),document.addEventListener("visibilitychange",this.#$),t.addEventListener("webglcontextlost",this.#J),t.addEventListener("webglcontextrestored",this.#Q),this.#z.addEventListener("change",this.#ee),this.#f()}setSettings(e){let t=ee(e);t.quality!==this.#c.quality?(this.#c=t,this.#X(),this.#u=1,this.#y=!0):(this.#c=t,this.#m=!0),this.#f()}replay(){this.#S=0,this.#H=0,this.#d=0,this.#f()}dispose(){this.#D&&(this.#D=!1,this.#q(),this.#N.disconnect(),document.removeEventListener("visibilitychange",this.#$),this.#a.removeEventListener("webglcontextlost",this.#J),this.#a.removeEventListener("webglcontextrestored",this.#Q),this.#z.removeEventListener("change",this.#ee),this.#Z())}#K(e,t){let n=this.#e.createShader(e);if(!n)throw new Error("The Aurora Ionosphere shader could not be allocated");if(this.#e.shaderSource(n,t),this.#e.compileShader(n),!this.#e.getShaderParameter(n,this.#e.COMPILE_STATUS)){let r=this.#e.getShaderInfoLog(n)||"Aurora Ionosphere shader compilation failed";throw this.#e.deleteShader(n),new Error(r)}return n}#G(e){let t=this.#K(this.#e.VERTEX_SHADER,Ee),n=this.#K(this.#e.FRAGMENT_SHADER,e),r=this.#e.createProgram();if(!r)throw new Error("The Aurora Ionosphere shader program could not be allocated");if(this.#e.attachShader(r,t),this.#e.attachShader(r,n),this.#e.linkProgram(r),this.#e.deleteShader(t),this.#e.deleteShader(n),!this.#e.getProgramParameter(r,this.#e.LINK_STATUS)){let a=this.#e.getProgramInfoLog(r)||"Aurora Ionosphere shader linking failed";throw this.#e.deleteProgram(r),new Error(a)}return r}#t(e,t){let n=this.#e.getUniformLocation(e,t);if(n===null)throw new Error(\`Missing Aurora Ionosphere shader uniform: \${t}\`);return n}#W(e,t){let n=this.#e.createTexture();if(!n)throw new Error("The Aurora Ionosphere texture could not be allocated");return this.#e.activeTexture(this.#e.TEXTURE0+e),this.#e.bindTexture(this.#e.TEXTURE_2D,n),this.#e.texParameteri(this.#e.TEXTURE_2D,this.#e.TEXTURE_MIN_FILTER,t),this.#e.texParameteri(this.#e.TEXTURE_2D,this.#e.TEXTURE_MAG_FILTER,t),this.#e.texParameteri(this.#e.TEXTURE_2D,this.#e.TEXTURE_WRAP_S,this.#e.CLAMP_TO_EDGE),this.#e.texParameteri(this.#e.TEXTURE_2D,this.#e.TEXTURE_WRAP_T,this.#e.CLAMP_TO_EDGE),this.#e.texImage2D(this.#e.TEXTURE_2D,0,this.#e.RGBA,1,1,0,this.#e.RGBA,this.#e.UNSIGNED_BYTE,null),n}#j(e){let t=this.#e.createFramebuffer();if(!t)throw new Error("The Aurora Ionosphere framebuffer could not be allocated");return this.#e.bindFramebuffer(this.#e.FRAMEBUFFER,t),this.#e.framebufferTexture2D(this.#e.FRAMEBUFFER,this.#e.COLOR_ATTACHMENT0,this.#e.TEXTURE_2D,e,0),t}#te(e){let t=new Uint8Array(e*2*4);for(let r=0;r<e;r+=1){let a=r*.043,d=.8+Math.pow(r,1.4)*.002,o=q(0,15,r),s=[-1.15,1.5,-.2].map(m=>Math.sin(m+a)*.5+.5),f=Math.pow(2,-r*.065-2.5)*q(0,5,r),u=r*4,h=(e+r)*4;t[u]=Math.round((s[0]??0)*255),t[u+1]=Math.round((s[1]??0)*255),t[u+2]=Math.round((s[2]??0)*255),te(t,h,h+1,d/1.6),t[h+2]=Math.round(o*255),te(t,u+3,h+3,f/.15)}let n=this.#W(0,this.#e.NEAREST);return this.#e.texImage2D(this.#e.TEXTURE_2D,0,this.#e.RGBA,e,2,0,this.#e.RGBA,this.#e.UNSIGNED_BYTE,t),n}#Z(){this.#A&&this.#e.deleteBuffer(this.#A),this.#s&&this.#e.deleteProgram(this.#s),this.#n&&this.#e.deleteProgram(this.#n),this.#r&&this.#e.deleteProgram(this.#r),this.#k&&this.#e.deleteTexture(this.#k),this.#p&&this.#e.deleteTexture(this.#p),this.#g&&this.#e.deleteTexture(this.#g),this.#_&&this.#e.deleteFramebuffer(this.#_),this.#M&&this.#e.deleteFramebuffer(this.#M)}#X(){this.#Z();let e=U[this.#c.quality];this.#s=this.#G(Se),this.#n=this.#G(Te(e.steps)),this.#r=this.#G(we),this.#A=this.#e.createBuffer()??(()=>{throw new Error("The Aurora Ionosphere geometry buffer could not be allocated")})(),this.#e.bindBuffer(this.#e.ARRAY_BUFFER,this.#A),this.#e.bufferData(this.#e.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),this.#e.STATIC_DRAW);for(let t of[this.#s,this.#n,this.#r]){this.#e.useProgram(t);let n=this.#e.getAttribLocation(t,"aPosition");if(n<0)throw new Error("The Aurora Ionosphere position attribute is unavailable");this.#e.enableVertexAttribArray(n),this.#e.vertexAttribPointer(n,2,this.#e.FLOAT,!1,0,0)}this.#k=this.#te(e.steps),this.#p=this.#W(2,this.#e.LINEAR),this.#_=this.#j(this.#p),this.#g=this.#W(1,this.#e.LINEAR),this.#M=this.#j(this.#g),this.#e.bindFramebuffer(this.#e.FRAMEBUFFER,null),this.#h={resolution:this.#t(this.#s,"uResolution"),domainMin:this.#t(this.#s,"uNoiseDomainMin"),domainSize:this.#t(this.#s,"uNoiseDomainSize"),flowRotation:this.#t(this.#s,"uFlowRotation"),scale:this.#t(this.#s,"uNoiseScale"),turbulence:this.#t(this.#s,"uNoiseTurbulence")},this.#i={resolution:this.#t(this.#n,"uResolution"),intensity:this.#t(this.#n,"uIntensity"),glow:this.#t(this.#n,"uGlow"),intro:this.#t(this.#n,"uIntro"),introFeather:this.#t(this.#n,"uIntroFeather"),introStart:this.#t(this.#n,"uIntroStart"),introEnd:this.#t(this.#n,"uIntroEnd"),layerLut:this.#t(this.#n,"uLayerLut"),layerLutStep:this.#t(this.#n,"uLayerLutStep"),noiseAtlas:this.#t(this.#n,"uNoiseAtlas"),domainMin:this.#t(this.#n,"uNoiseDomainMin"),inverseDomainSize:this.#t(this.#n,"uNoiseDomainInverseSize")},this.#l={resolution:this.#t(this.#r,"uResolution"),starResolution:this.#t(this.#r,"uStarResolution"),starDensity:this.#t(this.#r,"uStarDensity"),intro:this.#t(this.#r,"uIntro"),introSkyEnd:this.#t(this.#r,"uIntroSkyEnd"),introStarStart:this.#t(this.#r,"uIntroStarStart"),fieldTexture:this.#t(this.#r,"uAuroraTexture"),color:this.#t(this.#r,"uAuroraColor"),uvScale:this.#t(this.#r,"uAuroraUvScale"),uvOffset:this.#t(this.#r,"uAuroraUvOffset")},this.#e.useProgram(this.#n),this.#e.uniform1i(this.#i.layerLut,0),this.#e.uniform1i(this.#i.noiseAtlas,2),this.#e.uniform1f(this.#i.layerLutStep,1/e.steps),this.#e.useProgram(this.#r),this.#e.uniform1i(this.#l.fieldTexture,1),this.#m=!0,this.#y=!0,this.#R(void 0)}#ne(){this.#y=!1;let e=U[this.#c.quality],t=Math.min(window.devicePixelRatio||1,e.maxDpr),n=Math.max(1,Math.floor(this.#I.width*t)),r=Math.max(1,Math.floor(this.#I.height*t));(this.#a.width!==n||this.#a.height!==r)&&(this.#a.width=n,this.#a.height=r),this.#Y=Math.max(1,n);let a=Math.max(1,Math.floor(n*e.rayScale)),d=Math.max(1,Math.floor(r*e.rayScale));(a!==this.#b||d!==this.#x)&&(this.#b=a,this.#x=d,this.#e.activeTexture(this.#e.TEXTURE1),this.#e.bindTexture(this.#e.TEXTURE_2D,this.#g),this.#e.texImage2D(this.#e.TEXTURE_2D,0,this.#e.RGBA,this.#b,this.#x,0,this.#e.RGBA,this.#e.UNSIGNED_BYTE,null)),this.#o=ne(n,r,e.steps);let o=Math.max(this.#o.sizeX,this.#o.sizeY),s=Math.min(e.noiseAtlasSize,this.#e.getParameter(this.#e.MAX_TEXTURE_SIZE)),f=Math.max(256,Math.round(s*this.#o.sizeX/o)),u=Math.max(256,Math.round(s*this.#o.sizeY/o));(f!==this.#T||u!==this.#w)&&(this.#T=f,this.#w=u,this.#e.activeTexture(this.#e.TEXTURE2),this.#e.bindTexture(this.#e.TEXTURE_2D,this.#p),this.#e.texImage2D(this.#e.TEXTURE_2D,0,this.#e.RGBA,this.#T,this.#w,0,this.#e.RGBA,this.#e.UNSIGNED_BYTE,null)),this.#F=Math.max(1,Math.floor(this.#b*this.#u)),this.#P=Math.max(1,Math.floor(this.#x*this.#u)),this.#B.x=Math.max(0,this.#F-1)/this.#b,this.#B.y=Math.max(0,this.#P-1)/this.#x,this.#U.x=.5/this.#b,this.#U.y=.5/this.#x}#q(){this.#v&&Q(this.#v),this.#v=0}#f(){!this.#v&&this.#D&&this.#E&&this.#L&&(this.#v=J(this.#a,this.#re))}#re=e=>{if(this.#v=0,!this.#D||!this.#E||!this.#L)return;this.#y&&this.#ne();let t=this.#c,n=this.#z.matches,r=this.#d?Math.min((e-this.#d)/1e3,.05):0;if(this.#d=e,t.paused||(this.#H+=r*(n?.16:1)),this.#S=n?1:Math.min(1,this.#S+r/Math.max(.1,t.introDuration)),!t.paused&&!n&&(this.#O+=r,this.#C+=1,this.#C>=30)){let s=U[t.quality],f=this.#O/this.#C,u=this.#u;f>1/52?this.#u=Math.max(s.minAdaptiveScale,this.#u-.04):f<1/58&&(this.#u=Math.min(1,this.#u+.02)),this.#O=0,this.#C=0,this.#u!==u&&(this.#y=!0)}let a=q(0,1,this.#S),d=this.#H*.06*t.speed,o=this.#e;if(o.bindFramebuffer(o.FRAMEBUFFER,this.#_),o.viewport(0,0,this.#T,this.#w),o.useProgram(this.#s),o.uniform2f(this.#h.resolution,this.#T,this.#w),o.uniform2f(this.#h.domainMin,this.#o.minX,this.#o.minY),o.uniform2f(this.#h.domainSize,this.#o.sizeX,this.#o.sizeY),o.uniform2f(this.#h.flowRotation,Math.cos(d),Math.sin(d)),this.#m&&(o.uniform1f(this.#h.scale,.6+.8*t.curtainScale),o.uniform1f(this.#h.turbulence,.3+1.2*t.turbulence)),o.drawArrays(o.TRIANGLES,0,3),o.bindFramebuffer(o.FRAMEBUFFER,this.#M),o.viewport(0,0,this.#F,this.#P),o.useProgram(this.#n),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.#k),o.activeTexture(o.TEXTURE2),o.bindTexture(o.TEXTURE_2D,this.#p),o.uniform2f(this.#i.resolution,this.#F,this.#P),o.uniform2f(this.#i.domainMin,this.#o.minX,this.#o.minY),o.uniform2f(this.#i.inverseDomainSize,1/this.#o.sizeX,1/this.#o.sizeY),o.uniform1f(this.#i.intro,a),this.#m&&(o.uniform1f(this.#i.intensity,t.intensity),o.uniform1f(this.#i.glow,t.glow),o.uniform1f(this.#i.introFeather,t.introFeather),o.uniform1f(this.#i.introStart,t.introStart),o.uniform1f(this.#i.introEnd,t.introEnd)),o.drawArrays(o.TRIANGLES,0,3),o.bindFramebuffer(o.FRAMEBUFFER,null),o.viewport(0,0,this.#a.width,this.#a.height),o.useProgram(this.#r),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,this.#g),o.uniform2f(this.#l.resolution,this.#a.width,this.#a.height),o.uniform1f(this.#l.starResolution,this.#Y),o.uniform1f(this.#l.intro,a),o.uniform2f(this.#l.uvScale,this.#B.x,this.#B.y),o.uniform2f(this.#l.uvOffset,this.#U.x,this.#U.y),this.#m){o.uniform1f(this.#l.starDensity,t.starDensity);let s=t.hue*Math.PI/180,f=Math.cos(s)*t.saturation,u=(1-f)/3,h=Math.sin(s)*t.saturation/Math.sqrt(3);o.uniformMatrix3fv(this.#l.color,!1,new Float32Array([f+u,u+h,u-h,u-h,f+u,u+h,u+h,u-h,f+u])),o.uniform1f(this.#l.introSkyEnd,t.introSkyEnd),o.uniform1f(this.#l.introStarStart,t.introStarStart),this.#m=!1}o.drawArrays(o.TRIANGLES,0,3),!t.paused||this.#S<1?this.#f():this.#d=0};#$=()=>{this.#L=!document.hidden,this.#d=0,this.#L?this.#f():this.#q()};#J=e=>{e.preventDefault(),this.#E=!1,this.#q(),this.#R("The Aurora Ionosphere graphics context was lost; waiting for recovery.")};#Q=()=>{try{this.#E=!0,this.#X(),this.#u=1,this.#d=0,this.#f()}catch(e){this.#E=!1,this.#R(e instanceof Error?e.message:"The Aurora Ionosphere graphics context could not be restored")}};#ee=()=>{this.#m=!0,this.#d=0,this.#f()}},je=Object.freeze({quality:"medium",speed:.35,amplitude:1,frequency:1,zoom:1,rotation:0,exposure:1,timeOffset:5.07,introDuration:2.8,introFeather:.18,introAngle:32,introZoom:.16,introEnabled:!0,paused:!1,colors:Object.freeze(["#d81159","#8f2d56","#218380","#fbb13c","#73d2de"])});var Ze=Object.freeze([.72,.46]),$e=Math.PI/180;var re=[];function oe(i,e,t,n){return new H(i,e,t,n)}var L=globalThis,O="",ie=0,ae=!1,T,v,V=0,se=!1,le=0,y=(i,e={})=>L.postMessage({v:1,session:O,type:i,...e}),z=i=>y("failed",{code:"BG_WORKER_RENDER_FAILED",message:String(i instanceof Error?i.message:i).slice(0,1500)});L.addEventListener("error",i=>z(i.error??i.message));L.addEventListener("unhandledrejection",i=>z(i.reason));L.addEventListener("message",i=>{let e=i.data;if(!(ae||!e||e.v!==1||typeof e.session!="string"))try{if(e.type==="init"){if(O||!(e.canvas instanceof OffscreenCanvas)||e.session.length>100)throw Error("BG_INIT_INVALID: Invalid or duplicate background initialization.");O=e.session,j((n,r)=>y("event",{event:n,value:C(r)}));let t=W(e.viewport,e.viewport.dpr);v=K(e.canvas,t,()=>{V++,se||(se=!0,y("first-frame",{frames:V}),e.held===!0&&queueMicrotask(()=>v?.visibility(!1)));let n=performance.now();n-le>=1e3&&(le=n,y("sample",{frames:V,at:n}))}),v.motion(e.reduced===!0),T=oe(v.host,v.canvas,R(e.settings),n=>{n&&z(n)});return}if(e.session!==O||!Number.isSafeInteger(e.seq)||e.seq<=ie)return;if(ie=e.seq,e.type==="state"){if(e.settings!==void 0){let t=R(e.settings);T.setSettings?T.setSettings(t):T.updateSettings?.(t)}if(e.viewport&&v?.viewport(W(e.viewport,e.viewport.dpr)),typeof e.reduced=="boolean"&&v?.motion(e.reduced),typeof e.visible=="boolean"&&v?.visibility(e.visible),e.input){let{type:t,...n}=e.input;if(!["pointermove","pointerdown","pointerup","pointercancel","pointerleave","wheel","keydown"].includes(t))throw Error("BG_INPUT_METHOD: Unsupported background input.");v?.input(t,R(n))}y("ack",{seq:e.seq});return}if(e.type==="replay"){T.replay?.(),y("ack",{seq:e.seq});return}if(e.type==="call"){if(typeof e.method!="string"||!re.includes(e.method)||!Array.isArray(e.args)||e.args.length>8||!Number.isSafeInteger(e.callId))throw Error("BG_KERNEL_COMMAND: The visual kernel command is not supported.");let t=C(e.args);y("ack",{seq:e.seq}),Promise.resolve().then(()=>T[e.method](...t)).then(n=>y("result",{callId:e.callId,value:C(n??null)}),n=>y("result",{callId:e.callId,error:String(n).slice(0,1500)}));return}if(e.type==="dispose"){ae=!0;try{T?.dispose()}finally{v?.dispose(),y("disposed"),setTimeout(()=>L.close(),0)}return}throw Error("BG_WORKER_METHOD: Unsupported background command.")}catch(t){z(t)}});})();
|
|
442
|
+
`,o,e,t,r)}},z=window,O=Symbol.for("code-codex:background-modules:v1"),$=z[O]??(z[O]=new Map);$.set("aurora-ionosphere",{id:"aurora-ionosphere",api:1,version:"1.0.1",exports:{AuroraIonosphereRenderer:C},startup(o,e){let t=document.createElement("canvas");return t.style.cssText="width:100%;height:100%;display:block",o.append(t),new C(o,t,{...B(),paused:!1},e)}});})();
|