@needle-tools/engine 5.1.10 → 5.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/SKILL.md +2 -0
  3. package/components.needle.json +1 -1
  4. package/dist/{needle-engine.bundle-DZD-GG7l.min.js → needle-engine.bundle-d-dLyN3s.min.js} +127 -127
  5. package/dist/{needle-engine.bundle-Dv5TidOk.umd.cjs → needle-engine.bundle-n5YALNtc.umd.cjs} +113 -113
  6. package/dist/{needle-engine.bundle-DP--RGAU.js → needle-engine.bundle-ue2Lw4bF.js} +3798 -3755
  7. package/dist/needle-engine.d.ts +52 -13
  8. package/dist/needle-engine.js +534 -534
  9. package/dist/needle-engine.min.js +1 -1
  10. package/dist/needle-engine.umd.cjs +1 -1
  11. package/lib/engine/api.d.ts +1 -1
  12. package/lib/engine/api.js +1 -1
  13. package/lib/engine/api.js.map +1 -1
  14. package/lib/engine/engine_init.js +2 -2
  15. package/lib/engine/engine_license.d.ts +7 -7
  16. package/lib/engine/engine_license.js +71 -71
  17. package/lib/engine/engine_license.js.map +1 -1
  18. package/lib/engine/engine_math.d.ts +13 -0
  19. package/lib/engine/engine_math.js +17 -0
  20. package/lib/engine/engine_math.js.map +1 -1
  21. package/lib/engine/engine_networking_blob.js +3 -3
  22. package/lib/engine/engine_utils_qrcode.js +2 -2
  23. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
  24. package/lib/engine/webcomponents/needle menu/needle-menu.js +5 -5
  25. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  26. package/lib/engine/webcomponents/needle-engine.js +2 -2
  27. package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
  28. package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
  29. package/lib/engine/xr/TempXRContext.js +2 -2
  30. package/lib/engine-components/DragControls.d.ts +0 -5
  31. package/lib/engine-components/DragControls.js +0 -8
  32. package/lib/engine-components/DragControls.js.map +1 -1
  33. package/lib/engine-components/RendererInstancing.d.ts +34 -3
  34. package/lib/engine-components/RendererInstancing.js +92 -11
  35. package/lib/engine-components/RendererInstancing.js.map +1 -1
  36. package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
  37. package/lib/engine-components/splines/SplineWalker.js +9 -3
  38. package/lib/engine-components/splines/SplineWalker.js.map +1 -1
  39. package/package.json +1 -1
  40. package/plugins/common/license.js +4 -4
  41. package/plugins/vite/license.js +4 -4
  42. package/src/engine/api.ts +1 -1
  43. package/src/engine/engine_init.ts +2 -2
  44. package/src/engine/engine_license.ts +68 -68
  45. package/src/engine/engine_math.ts +17 -0
  46. package/src/engine/engine_networking_blob.ts +3 -3
  47. package/src/engine/engine_utils_qrcode.ts +2 -2
  48. package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
  49. package/src/engine/webcomponents/needle menu/needle-menu.ts +5 -5
  50. package/src/engine/webcomponents/needle-engine.loading.ts +6 -6
  51. package/src/engine/webcomponents/needle-engine.ts +2 -2
  52. package/src/engine/xr/TempXRContext.ts +2 -2
  53. package/src/engine-components/DragControls.ts +0 -7
  54. package/src/engine-components/RendererInstancing.ts +92 -11
  55. package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
  56. package/src/engine-components/splines/SplineWalker.ts +9 -3
@@ -8,7 +8,7 @@ import { initBuiltinTypes } from "./codegen/register_types.js";
8
8
  import { initSpatialConsole } from "./debug/debug_spatial_console.js";
9
9
  import { initAddressableSerializers } from "./engine_addressables.js";
10
10
  import { ensureAudioContextIsResumed } from "./engine_audio.js";
11
- import { _$AtfmW } from "./engine_license.js";
11
+ import { FcQBwfj } from "./engine_license.js";
12
12
  import { initNeedleLoader } from "./engine_loaders.js";
13
13
  import { initPhysics } from "./engine_physics_rapier.js";
14
14
  import { initBuiltinSerializers } from "./engine_serialization_builtin_serializer.js";
@@ -59,7 +59,7 @@ export function initEngine() {
59
59
  initPhysics();
60
60
  initXR();
61
61
  initSpatialConsole();
62
- _$AtfmW();
62
+ FcQBwfj();
63
63
 
64
64
  // Must be last. customElements.define() upgrades existing <needle-engine>
65
65
  // elements synchronously, which can trigger context.create() and dispatch
@@ -9,19 +9,19 @@ import { DeviceUtilities, getParam } from "./engine_utils.js";
9
9
 
10
10
  const debug = getParam("__debuglic__");
11
11
 
12
- const __DChk: ((result: boolean) => void)[] = [];
12
+ const _$QkzFPY: ((result: boolean) => void)[] = [];
13
13
 
14
14
  // DO NOT EDIT MANUALLY
15
- let __ZrI: string = "";
15
+ let _YNAWxLD: string = "";
16
16
  // eslint-disable-next-line prefer-const
17
- let _AXD: string = "";
17
+ let _$dGYOn: string = "";
18
18
 
19
19
  if (debug) {
20
- console.log("License Type: " + __ZrI);
21
- if (_AXD) {
22
- console.log("License JWT: " + _AXD);
20
+ console.log("License Type: " + _YNAWxLD);
21
+ if (_$dGYOn) {
22
+ console.log("License JWT: " + _$dGYOn);
23
23
  try {
24
- const payload = JSON.parse(atob(_AXD.split(".")[1].replace(/-/g, '+').replace(/_/g, '/')));
24
+ const payload = JSON.parse(atob(_$dGYOn.split(".")[1].replace(/-/g, '+').replace(/_/g, '/')));
25
25
  console.log("License JWT payload:", payload);
26
26
  }
27
27
  catch { console.log("License JWT payload: (failed to decode)"); }
@@ -32,8 +32,8 @@ if (debug) {
32
32
  }
33
33
 
34
34
  /** @internal */
35
- export function $Ljyi() {
36
- switch (__ZrI) {
35
+ export function oMxKl() {
36
+ switch (_YNAWxLD) {
37
37
  case "pro":
38
38
  case "enterprise":
39
39
  return true;
@@ -42,8 +42,8 @@ export function $Ljyi() {
42
42
  }
43
43
 
44
44
  /** @internal */
45
- export function $fHATZ() {
46
- switch (__ZrI) {
45
+ export function __nlZsk() {
46
+ switch (_YNAWxLD) {
47
47
  case "indie":
48
48
  return true;
49
49
  }
@@ -51,8 +51,8 @@ export function $fHATZ() {
51
51
  }
52
52
 
53
53
  /** @internal */
54
- export function rdc() {
55
- switch (__ZrI) {
54
+ export function _VRCiX() {
55
+ switch (_YNAWxLD) {
56
56
  case "edu":
57
57
  return true;
58
58
  }
@@ -60,20 +60,20 @@ export function rdc() {
60
60
  }
61
61
 
62
62
  /** @internal */
63
- export function __KODK() {
64
- return $Ljyi() || $fHATZ() || rdc();
63
+ export function __zrAx() {
64
+ return oMxKl() || __nlZsk() || _VRCiX();
65
65
  }
66
66
 
67
67
 
68
68
  /** @internal */
69
- export function __spV(cb: (result: boolean) => void) {
70
- if ($Ljyi() || $fHATZ() || rdc())
69
+ export function $onQdBrJB(cb: (result: boolean) => void) {
70
+ if (oMxKl() || __nlZsk() || _VRCiX())
71
71
  return cb(true);
72
- __DChk.push(cb);
72
+ _$QkzFPY.push(cb);
73
73
  }
74
74
 
75
- function __qmrKg(result: boolean) {
76
- for (const cb of __DChk) {
75
+ function $AeqIgsC(result: boolean) {
76
+ for (const cb of _$QkzFPY) {
77
77
  try {
78
78
  cb(result);
79
79
  }
@@ -88,7 +88,7 @@ function __qmrKg(result: boolean) {
88
88
 
89
89
  // ECDSA P-256 public key for verifying license JWTs (verification-only, safe to ship)
90
90
  /* eslint-disable no-secrets/no-secrets -- public key, not a secret */
91
- const _Utd = {
91
+ const $oyXrf = {
92
92
  kty: "EC",
93
93
  crv: "P-256",
94
94
  x: "A34nyKMjhQYVgzeE4tyLUYdx34TAKogDa7v7PRaO9Lg",
@@ -112,7 +112,7 @@ function base64urlDecode(str: string): Uint8Array {
112
112
  * Verify a JWT license token and return the `type` claim if valid.
113
113
  * Returns null if the JWT is missing, malformed, or has an invalid signature.
114
114
  */
115
- async function _KhFK(jwt: string): Promise<string | null> {
115
+ async function $lFHtXwo(jwt: string): Promise<string | null> {
116
116
  if (!jwt) return null;
117
117
  try {
118
118
  const parts = jwt.split(".");
@@ -122,7 +122,7 @@ async function _KhFK(jwt: string): Promise<string | null> {
122
122
 
123
123
  const key = await crypto.subtle.importKey(
124
124
  "jwk",
125
- _Utd,
125
+ $oyXrf,
126
126
  { name: "ECDSA", namedCurve: "P-256" },
127
127
  false,
128
128
  ["verify"]
@@ -182,24 +182,24 @@ async function _KhFK(jwt: string): Promise<string | null> {
182
182
  }
183
183
 
184
184
  /** Verify the injected JWT and update the license type if valid.
185
- * The engine ONLY trusts the JWT — the plain __ZrI string is ignored. */
185
+ * The engine ONLY trusts the JWT — the plain _YNAWxLD string is ignored. */
186
186
  let _jwtVerificationPromise: Promise<void> | undefined = undefined;
187
- async function __FiHbIAo(): Promise<void> {
188
- // NOTE: do NOT add an `if (!_AXD) return` guard here.
187
+ async function _BmnYkq(): Promise<void> {
188
+ // NOTE: do NOT add an `if (!_$dGYOn) return` guard here.
189
189
  // esbuild (Vite dependency pre-bundling) would see the variable as constant ""
190
190
  // and tree-shake the entire JWT verification code path.
191
- const jwt = _AXD;
191
+ const jwt = _$dGYOn;
192
192
  // Clear after reading — this reassignment also prevents esbuild from
193
193
  // constant-folding the variable (it now has multiple assignment sites).
194
- _AXD = "";
195
- const verifiedType = await _KhFK(jwt);
194
+ _$dGYOn = "";
195
+ const verifiedType = await $lFHtXwo(jwt);
196
196
  if (verifiedType) {
197
- __ZrI = verifiedType;
197
+ _YNAWxLD = verifiedType;
198
198
  if (debug) console.log("License type set from verified JWT: " + verifiedType);
199
- __qmrKg(__KODK());
199
+ $AeqIgsC(__zrAx());
200
200
  }
201
201
  else {
202
- __ZrI = "basic";
202
+ _YNAWxLD = "basic";
203
203
  if (debug && jwt) console.warn("JWT verification failed — license reset to basic");
204
204
  }
205
205
  }
@@ -650,18 +650,18 @@ export namespace Telemetry {
650
650
  }
651
651
 
652
652
 
653
- export function _$AtfmW() {
653
+ export function FcQBwfj() {
654
654
 
655
- if(__ZrI === "") __ZrI = "basic";
655
+ if(_YNAWxLD === "") _YNAWxLD = "basic";
656
656
 
657
657
  // Start JWT verification — must be here (not top-level) to avoid tree-shaking
658
- _jwtVerificationPromise = __FiHbIAo();
658
+ _jwtVerificationPromise = _BmnYkq();
659
659
 
660
660
  Telemetry.init();
661
661
  ContextRegistry.registerCallback(ContextEvent.ContextRegistered, evt => {
662
- LwcCAK(evt.context);
663
- _lsnP(evt.context);
664
- setTimeout(() => _Fprjh(evt.context), 2000);
662
+ __hrYHVSsM(evt.context);
663
+ $bbnhzdRV(evt.context);
664
+ setTimeout(() => _SUkw(evt.context), 2000);
665
665
  });
666
666
  // ContextCreated fires after the renderer exists, so the canvas is available for context-loss monitoring
667
667
  ContextRegistry.registerCallback(ContextEvent.ContextCreated, evt => {
@@ -670,17 +670,17 @@ export function _$AtfmW() {
670
670
  });
671
671
  }
672
672
 
673
- export let $AHhz: Promise<void> | undefined = undefined;
673
+ export let $StfvQ: Promise<void> | undefined = undefined;
674
674
  let applicationIsForbidden = false;
675
675
  let applicationForbiddenText = "";
676
- async function $OoEIwAqC() {
676
+ async function lyWzt() {
677
677
  // Only perform the runtime license check once
678
- if ($AHhz) return $AHhz;
678
+ if ($StfvQ) return $StfvQ;
679
679
  // Wait for JWT verification to complete first (if running)
680
680
  if (_jwtVerificationPromise) {
681
681
  await _jwtVerificationPromise;
682
682
  }
683
- if (__ZrI === "basic") {
683
+ if (_YNAWxLD === "basic") {
684
684
  try {
685
685
  const licenseUrl = "https://needle.tools/api/v1/needle-engine/check?location=" + encodeURIComponent(window.location.href) + "&version=" + VERSION + "&generator=" + encodeURIComponent(GENERATOR);
686
686
  const res = await fetch(licenseUrl, {
@@ -692,29 +692,29 @@ async function $OoEIwAqC() {
692
692
  if (res?.status === 200) {
693
693
  applicationIsForbidden = false;
694
694
  if (debug) console.log("License check succeeded");
695
- __ZrI = "pro";
696
- __qmrKg(true);
695
+ _YNAWxLD = "pro";
696
+ $AeqIgsC(true);
697
697
  }
698
698
  else if (res?.status === 403) {
699
- __qmrKg(false);
699
+ $AeqIgsC(false);
700
700
  applicationIsForbidden = true;
701
701
  applicationForbiddenText = await res.text();
702
702
  }
703
703
  else {
704
- __qmrKg(false);
704
+ $AeqIgsC(false);
705
705
  if (debug) console.log("License check failed with status " + res?.status);
706
706
  }
707
707
  }
708
708
  catch (err) {
709
- __qmrKg(false);
709
+ $AeqIgsC(false);
710
710
  if (debug) console.error("License check failed", err);
711
711
  }
712
712
  }
713
- else if (debug) console.log("Runtime license check is skipped because license is already applied as \"" + __ZrI + "\"");
713
+ else if (debug) console.log("Runtime license check is skipped because license is already applied as \"" + _YNAWxLD + "\"");
714
714
  }
715
- $AHhz = $OoEIwAqC();
715
+ $StfvQ = lyWzt();
716
716
 
717
- async function _lsnP(ctx: IContext) {
717
+ async function $bbnhzdRV(ctx: IContext) {
718
718
  function createForbiddenElement() {
719
719
  const div = document.createElement("div");
720
720
  div.className = "needle-forbidden";
@@ -779,40 +779,40 @@ async function _lsnP(ctx: IContext) {
779
779
  }, 500)
780
780
  }
781
781
 
782
- async function LwcCAK(ctx: IContext) {
782
+ async function __hrYHVSsM(ctx: IContext) {
783
783
  try {
784
- if (!$Ljyi() && !$fHATZ()) {
785
- return Xwnxe(ctx);
784
+ if (!oMxKl() && !__nlZsk()) {
785
+ return __gHN(ctx);
786
786
  }
787
787
  }
788
788
  catch (err) {
789
789
  if (debug) console.log("License check failed", err)
790
- return Xwnxe(ctx)
790
+ return __gHN(ctx)
791
791
  }
792
- if (debug) Xwnxe(ctx)
792
+ if (debug) __gHN(ctx)
793
793
  }
794
794
 
795
795
 
796
796
 
797
- async function Xwnxe(ctx: IContext) {
797
+ async function __gHN(ctx: IContext) {
798
798
 
799
799
  // if the engine loads faster than the license check, we need to capture the ready event here
800
800
  let isReady = false;
801
801
  ctx.domElement.addEventListener("ready", () => isReady = true);
802
802
 
803
- await $AHhz?.catch(() => { });
803
+ await $StfvQ?.catch(() => { });
804
804
 
805
805
 
806
- if ($Ljyi() || $fHATZ()) return;
807
- if (__KODK() === false) CSTks();
806
+ if (oMxKl() || __nlZsk()) return;
807
+ if (__zrAx() === false) __bdHHYrc();
808
808
 
809
809
  // check if the engine is already ready (meaning has finished loading)
810
810
  if (isReady) {
811
- $jGjxKSJM(ctx);
811
+ iJbqLNi(ctx);
812
812
  }
813
813
  else {
814
814
  ctx.domElement.addEventListener("ready", () => {
815
- $jGjxKSJM(ctx);
815
+ iJbqLNi(ctx);
816
816
  });
817
817
  }
818
818
  }
@@ -820,7 +820,7 @@ async function Xwnxe(ctx: IContext) {
820
820
  // const licenseElementIdentifier = "needle-license-element";
821
821
  // const licenseDuration = 10000;
822
822
  // const licenseDelay = 1200;
823
- function $jGjxKSJM(ctx: IContext) {
823
+ function iJbqLNi(ctx: IContext) {
824
824
 
825
825
  const style = `
826
826
  position: relative;
@@ -833,7 +833,7 @@ function $jGjxKSJM(ctx: IContext) {
833
833
  padding: 10px;
834
834
  padding-left: 30px;
835
835
  `;
836
- if (__ZrI === "edu") {
836
+ if (_YNAWxLD === "edu") {
837
837
  if (navigator.webdriver) {
838
838
  console.log("This project is supported by Needle for Education – https://needle.tools");
839
839
  }
@@ -890,7 +890,7 @@ function $jGjxKSJM(ctx: IContext) {
890
890
  }
891
891
  }, 1000);
892
892
 
893
- if (rdc()) {
893
+ if (_VRCiX()) {
894
894
  const removeDelay = 20_000;
895
895
  setTimeout(() => {
896
896
  clearInterval(interval);
@@ -899,7 +899,7 @@ function $jGjxKSJM(ctx: IContext) {
899
899
  const intervalInMinutes = 5;
900
900
  setTimeout(() => {
901
901
  if (ctx.domElement.parentNode)
902
- $jGjxKSJM(ctx);
902
+ iJbqLNi(ctx);
903
903
  }, 1000 * 60 * intervalInMinutes)
904
904
  }, removeDelay);
905
905
  }
@@ -910,7 +910,7 @@ function $jGjxKSJM(ctx: IContext) {
910
910
  const base64Logo = "data:image/webp;base64,UklGRrABAABXRUJQVlA4WAoAAAAQAAAAHwAAHwAAQUxQSKEAAAARN6CmbSM4WR7vdARON11EBDq3fLiNbVtVzpMCPlKAEzsx0Y/x+Ovuv4dn0EFE/ydAvz6YggXzgh5sVgXM/zOC/4sii7qgGvB5N7hmuQYwkvazWAu1JPW41FXSHq6pnaQWvqYH18Fc0j1hO/BFTtIeSBlJi5w6qIIO7IOrwhFsB2Yxukif0FTRLpXswHR8MxbslKe9VZsn/Ub5C7YFOpqSTABWUDgg6AAAAFAGAJ0BKiAAIAA+7VyoTqmkpCI3+qgBMB2JbACdMt69DwMIQBLhkTO6XwY00UEDK6cNIDnuNibPf0EgAP7Y1myuiQHLDsF/0h5unrGh6WAbv7aegg2ZMd3uRKfT/3SJztcaujYfTvMXspfCTmYcoO6a+vhC3ss4M8uM58t4siiu59I4aOl59e9Sr6xoxYlHf2v+NnBNpJYeJf8jABQAId/PXuBkLEFkiCucgSGEcfhvajql/j3reCGl0M5/9gQWy7ayNPs+wlvIxFnNfSlfuND4CZOCyxOHhRqOmHN4ULHo3tCSrUNvgAA=";
911
911
 
912
912
  let lastLogTime = 0;
913
- async function CSTks(_logo?: string) {
913
+ async function __bdHHYrc(_logo?: string) {
914
914
  const now = Date.now();
915
915
  if (now - lastLogTime < 2000) return;
916
916
  lastLogTime = now;
@@ -943,7 +943,7 @@ async function CSTks(_logo?: string) {
943
943
  }
944
944
 
945
945
 
946
- async function _Fprjh(context: IContext) {
946
+ async function _SUkw(context: IContext) {
947
947
  // isAllowed() now also covers cross-origin-isolated pages (where beacons can't be sent)
948
948
  // and Do Not Track / GPC.
949
949
  if (!Telemetry.isAllowed(context)) {
@@ -957,7 +957,7 @@ async function _Fprjh(context: IContext) {
957
957
 
958
958
  // current url without query parameters
959
959
  const currentUrl = window.location.href.split("?")[0];
960
- const license = __ZrI;
960
+ const license = _YNAWxLD;
961
961
 
962
962
  const beaconData = {
963
963
  license,
@@ -92,6 +92,23 @@ class MathHelper {
92
92
  return this.clamp(value, 0, 1);
93
93
  }
94
94
 
95
+ /**
96
+ * Loops a value so that it never exceeds `length` and never goes below 0 — the modulo you
97
+ * usually want for wrapping. Note that JavaScript's `%` operator is a *remainder*: it keeps the
98
+ * sign of the dividend, so `-0.25 % 1` is `-0.25`, not `0.75`. This returns `0.75`.
99
+ * @param value Value to wrap
100
+ * @param length Length of the range to wrap into (defaults to 1)
101
+ * @returns Value wrapped into [0, length)
102
+ * @example ```javascript
103
+ * Mathf.repeat(1.5, 1); // 0.5
104
+ * Mathf.repeat(-0.25, 1); // 0.75
105
+ * ```
106
+ */
107
+ repeat(value: number, length: number = 1) {
108
+ if (length === 0) return 0;
109
+ return ((value % length) + length) % length;
110
+ }
111
+
95
112
  /**
96
113
  * Linearly interpolates between two values.
97
114
  * @param value1 Start value (returned when t=0)
@@ -1,7 +1,7 @@
1
1
  import { FileLoader } from "three";
2
2
 
3
3
  import { showBalloonWarning } from "./debug/index.js";
4
- import { __KODK } from "./engine_license.js";
4
+ import { __zrAx } from "./engine_license.js";
5
5
  import { delay } from "./engine_utils.js";
6
6
  import { md5AsBytes, md5Hex, sha256Base64 } from "./engine_utils_hash.js";
7
7
 
@@ -45,7 +45,7 @@ export namespace BlobStorage {
45
45
  */
46
46
  export function canUpload(info: { filesize: number }) {
47
47
  const sizeInMB = info.filesize / 1024 / 1024;
48
- if (__KODK()) {
48
+ if (__zrAx()) {
49
49
  return sizeInMB < maxSizeInMB;
50
50
  }
51
51
  return sizeInMB < maxFreeSizeInMB;
@@ -100,7 +100,7 @@ export namespace BlobStorage {
100
100
  console.warn(`Your file is too large for uploading (${filesizeInMB.toFixed(1)}MB). Max allowed size is ${maxSizeInMB}MB`);
101
101
  return null;
102
102
  }
103
- else if (!__KODK() && filesizeInMB > maxFreeSizeInMB) {
103
+ else if (!__zrAx() && filesizeInMB > maxFreeSizeInMB) {
104
104
  if (opts?.silent !== true) showBalloonWarning(`File is too large for uploading. Please get a <a href=\"https://needle.tools/pricing\" target=\"_blank\">commercial license</a> to upload files larger than 5MB`);
105
105
  console.warn(`Your file is too large for uploading (${filesizeInMB.toFixed(1)}MB). Max size is 5MB for non-commercial users. Please get a commercial license at https://needle.tools/pricing for larger files (up to 50MB)`);
106
106
  return null;
@@ -4,7 +4,7 @@ import { Quaternion, Vector2, Vector3, Vector4 } from "three";
4
4
 
5
5
  import { needleLogoOnlySVG } from "./assets/index.js";
6
6
  import { isDevEnvironment } from "./debug/debug.js";
7
- import { __KODK } from "./engine_license.js";
7
+ import { __zrAx } from "./engine_license.js";
8
8
  import { InternalAttributeUtils } from "./engine_utils_attributes.js";
9
9
  import type { NeedleEngineWebComponent } from "./webcomponents/needle-engine.js";
10
10
 
@@ -135,7 +135,7 @@ async function internalRenderQRCodeOverlays(canvas: HTMLCanvasElement, args: { s
135
135
  console.debug("[QR Code] No web component found")
136
136
  }
137
137
 
138
- const canUseCustomLogo = __KODK();
138
+ const canUseCustomLogo = __zrAx();
139
139
 
140
140
  // Query logo src from needle-engine attribute.
141
141
  // For any supported attribute it's possible to use "falsey" values (e.g. "0" or "false" to disable the logo in the QR code)
@@ -2,7 +2,7 @@ import { Mesh, Object3D, TextureLoader, Vector4 } from "three";
2
2
  import ThreeMeshUI from "three-mesh-ui";
3
3
 
4
4
  import { addNewComponent } from "../../engine_components.js";
5
- import { __KODK } from "../../engine_license.js";
5
+ import { __zrAx } from "../../engine_license.js";
6
6
  import { OneEuroFilterXYZ } from "../../engine_math.js";
7
7
  import type { Context } from "../../engine_setup.js";
8
8
  import { lookAtObject } from "../../engine_three_utils.js";
@@ -321,7 +321,7 @@ export class NeedleSpatialMenu {
321
321
  }
322
322
  if (this.menu) {
323
323
  const index = this.menu.children.indexOf(this._poweredByNeedleElement as any);
324
- if (!this._showNeedleLogo && __KODK()) {
324
+ if (!this._showNeedleLogo && __zrAx()) {
325
325
  if (index >= 0) {
326
326
  this._poweredByNeedleElement.removeFromParent();
327
327
  this.markDirty();
@@ -1,6 +1,6 @@
1
1
  import { showBalloonMessage } from "../../debug/debug.js";
2
2
  import type { Context } from "../../engine_context.js";
3
- import { __KODK, __spV, Telemetry } from "../../engine_license.js";
3
+ import { __zrAx, $onQdBrJB, Telemetry } from "../../engine_license.js";
4
4
  import { isLocalNetwork } from "../../engine_networking_utils.js";
5
5
  import { HTMLElementBase } from "../../engine_ssr.js";
6
6
  import { DeviceUtilities, getParam } from "../../engine_utils.js";
@@ -784,8 +784,8 @@ export class NeedleMenuElement extends HTMLElementBase {
784
784
  try {
785
785
  // if the user has a license then we CAN hide the needle logo
786
786
  // calling this method immediately will cause an issue with vite bundling tho
787
- window.requestAnimationFrame(() => __spV(res => {
788
- if (res == true && __KODK() && !debugNonCommercial) {
787
+ window.requestAnimationFrame(() => $onQdBrJB(res => {
788
+ if (res == true && __zrAx() && !debugNonCommercial) {
789
789
  let visible = this._userRequestedLogoVisible;
790
790
  if (visible === undefined) visible = false;
791
791
  this.___onSetLogoVisible(visible);
@@ -836,7 +836,7 @@ export class NeedleMenuElement extends HTMLElementBase {
836
836
  // ensure the menu is not hidden or removed
837
837
  const requiredParent = this?.parentNode;
838
838
  if (this.style.display != "flex" || this.style.visibility != "visible" || this.style.opacity != "1" || requiredParent != this._domElement?.shadowRoot) {
839
- if (!__KODK()) {
839
+ if (!__zrAx()) {
840
840
  const change = changeEventCounter++;
841
841
  // if a user doesn't have a local pro license *but* for development the menu is hidden then we show a warning
842
842
  if (isLocalNetwork() && this._userRequestedMenuVisible === false) {
@@ -932,7 +932,7 @@ export class NeedleMenuElement extends HTMLElementBase {
932
932
  showNeedleLogo(visible: boolean) {
933
933
  this._userRequestedLogoVisible = visible;
934
934
  if (!visible) {
935
- if (!__KODK() || debugNonCommercial) {
935
+ if (!__zrAx() || debugNonCommercial) {
936
936
  console.warn("[Needle Engine] You need a commercial license to hide the Needle Engine logo in production.");
937
937
  const localNetwork = isLocalNetwork()
938
938
  if (!localNetwork) return;
@@ -1,6 +1,6 @@
1
1
  import { needleLogoOnlySVG } from "../assets/index.js"
2
2
  import { isDevEnvironment, showBalloonWarning } from "../debug/index.js";
3
- import { __KODK, $Ljyi, $AHhz } from "../engine_license.js";
3
+ import { __zrAx, oMxKl, $StfvQ } from "../engine_license.js";
4
4
  import { Mathf } from "../engine_math.js";
5
5
  import { LoadingProgressArgs } from "../engine_setup.js";
6
6
  import { getParam } from "../engine_utils.js";
@@ -205,7 +205,7 @@ export class EngineLoadingView implements ILoadingViewHandler {
205
205
  }
206
206
 
207
207
 
208
- const hasLicense = $Ljyi();
208
+ const hasLicense = oMxKl();
209
209
  if (!existing) {
210
210
  this._loadingElement.style.position = "absolute";
211
211
  this._loadingElement.style.width = "100%";
@@ -373,7 +373,7 @@ export class EngineLoadingView implements ILoadingViewHandler {
373
373
 
374
374
  // private async handleRuntimeLicense(loadingElement: HTMLElement) {
375
375
  // // First check if we have a commercial license
376
- // let commercialLicense = __KODK();
376
+ // let commercialLicense = __zrAx();
377
377
  // // if it's the case then we don't need to perform a runtime check
378
378
  // if (commercialLicense) return;
379
379
 
@@ -393,10 +393,10 @@ export class EngineLoadingView implements ILoadingViewHandler {
393
393
  // loadingElement.appendChild(nonCommercialContainer);
394
394
 
395
395
  // // Use the runtime license check
396
- // if (!isDevEnvironment() && $AHhz) {
396
+ // if (!isDevEnvironment() && $StfvQ) {
397
397
  // if (debugLicense) console.log("Waiting for runtime license check");
398
- // await $AHhz;
399
- // commercialLicense = __KODK();
398
+ // await $StfvQ;
399
+ // commercialLicense = __zrAx();
400
400
  // }
401
401
  // if (commercialLicense) return;
402
402
  // nonCommercialContainer.style.transition = "opacity .5s ease-in-out";
@@ -3,7 +3,7 @@ import type { Texture } from "three";
3
3
  import { isDevEnvironment, showBalloonWarning } from "../debug/index.js";
4
4
  import { PUBLIC_KEY, VERSION } from "../engine_constants.js";
5
5
  import { ContextEvent, ContextRegistry } from "../engine_context_registry.js";
6
- import { __KODK, Telemetry } from "../engine_license.js";
6
+ import { __zrAx, Telemetry } from "../engine_license.js";
7
7
  import { onStart } from "../engine_lifecycle_api.js";
8
8
  import { setDracoDecoderPath, setDracoDecoderType, setKtx2TranscoderPath } from "../engine_loaders.gltf.js";
9
9
  import { Context, ContextCreateArgs } from "../engine_setup.js";
@@ -579,7 +579,7 @@ export class NeedleEngineWebComponent extends HTMLElementBase implements INeedle
579
579
 
580
580
 
581
581
  // Loading start events
582
- const allowOverridingDefaultLoading = __KODK();
582
+ const allowOverridingDefaultLoading = __zrAx();
583
583
  // default loading can be overriden by calling preventDefault in the onload start event
584
584
  this.ensureLoadStartIsRegistered();
585
585
  let useDefaultLoading = this.dispatchEvent(new CustomEvent("loadstart", {
@@ -3,7 +3,7 @@ import { ArrayCamera, AxesHelper, Camera, Color, DirectionalLight, Fog, GridHelp
3
3
  import { needleLogoOnlySVG } from "../assets/index.js";
4
4
  import { isDevEnvironment } from "../debug/index.js";
5
5
  import { ObjectUtils, PrimitiveType } from "../engine_create_objects.js";
6
- import { __KODK } from "../engine_license.js";
6
+ import { __zrAx } from "../engine_license.js";
7
7
  import { Mathf } from "../engine_math.js";
8
8
  import { delay, DeviceUtilities } from "../engine_utils.js";
9
9
 
@@ -215,7 +215,7 @@ export class TemporaryXRContext {
215
215
  this._scene.background = new Color(0x000000);
216
216
 
217
217
  let logoSrc = needleLogoOnlySVG;
218
- if (__KODK()) {
218
+ if (__zrAx()) {
219
219
  const htmlComponent = document.querySelector("needle-engine");
220
220
  if (htmlComponent) {
221
221
  const licenseLogo = htmlComponent.getAttribute("logo-src");
@@ -197,13 +197,6 @@ export class DragControls extends Behaviour implements IPointerEventHandler {
197
197
  @serializable()
198
198
  public xrDistanceDragFactor: number = 1;
199
199
 
200
- /**
201
- * When enabled, draws a visual line from the dragged object downwards to the next raycast hit,
202
- * providing visual feedback about the object's position relative to surfaces below it.
203
- */
204
- @serializable()
205
- public showGizmo: boolean = false;
206
-
207
200
  /** Drag profile for screen / touch / mouse input. Reads live from the flat serialized fields. */
208
201
  readonly screenProfile: DragProfile = new DragProfile(this, false);
209
202
  /** Drag profile for XR tracked-pointer and transient-pointer input. Reads live from the flat `xr*` serialized fields. */