@needle-tools/engine 5.1.0-experimental.ab2b091 → 5.1.0-experimental.e1fca8a

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 (44) hide show
  1. package/dist/{needle-engine.bundle-BCYyOY9H.min.js → needle-engine.bundle-BVMcIQlw.min.js} +2 -2
  2. package/dist/{needle-engine.bundle-CqUYvUIH.umd.cjs → needle-engine.bundle-DN5GLt_w.umd.cjs} +3 -3
  3. package/dist/{needle-engine.bundle-DM0ePqto.js → needle-engine.bundle-h-83OjVL.js} +9 -9
  4. package/dist/needle-engine.d.ts +6 -6
  5. package/dist/needle-engine.js +226 -226
  6. package/dist/needle-engine.min.js +1 -1
  7. package/dist/needle-engine.umd.cjs +1 -1
  8. package/lib/engine/api.d.ts +1 -1
  9. package/lib/engine/api.js +1 -1
  10. package/lib/engine/api.js.map +1 -1
  11. package/lib/engine/engine_init.js +2 -2
  12. package/lib/engine/engine_init.js.map +1 -1
  13. package/lib/engine/engine_license.d.ts +7 -7
  14. package/lib/engine/engine_license.js +49 -49
  15. package/lib/engine/engine_license.js.map +1 -1
  16. package/lib/engine/engine_networking_blob.js +3 -3
  17. package/lib/engine/engine_networking_blob.js.map +1 -1
  18. package/lib/engine/engine_utils_qrcode.js +2 -2
  19. package/lib/engine/engine_utils_qrcode.js.map +1 -1
  20. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
  21. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
  22. package/lib/engine/webcomponents/needle menu/needle-menu.js +5 -5
  23. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  24. package/lib/engine/webcomponents/needle-engine.js +2 -2
  25. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  26. package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
  27. package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
  28. package/lib/engine/xr/TempXRContext.js +2 -2
  29. package/lib/engine/xr/TempXRContext.js.map +1 -1
  30. package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
  31. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  32. package/package.json +1 -1
  33. package/src/engine/api.ts +1 -1
  34. package/src/engine/engine_init.ts +2 -2
  35. package/src/engine/engine_license.ts +47 -47
  36. package/src/engine/engine_networking_blob.ts +3 -3
  37. package/src/engine/engine_utils_qrcode.ts +2 -2
  38. package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
  39. package/src/engine/webcomponents/needle menu/needle-menu.ts +5 -5
  40. package/src/engine/webcomponents/needle-engine.loading.ts +6 -6
  41. package/src/engine/webcomponents/needle-engine.ts +2 -2
  42. package/src/engine/xr/TempXRContext.ts +2 -2
  43. package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
  44. package/src/vite-env.d.ts +0 -16
@@ -9,7 +9,7 @@ import { getParam } from "./engine_utils.js";
9
9
 
10
10
  const debug = getParam("__debuglic__");
11
11
 
12
- const /* OBFUSCATE */ _licenseCheckResultChangedCallbacks: ((result: boolean) => void)[] = [];
12
+ const $HofjjC: ((result: boolean) => void)[] = [];
13
13
 
14
14
  // These are modified by a bundler (e.g. vite)
15
15
  // Do not edit manually
@@ -32,7 +32,7 @@ if (debug) {
32
32
  }
33
33
 
34
34
  /** @internal */
35
- export function /* OBFUSCATE */ hasProLicense() {
35
+ export function __tmUDtSjM() {
36
36
  switch (NEEDLE_ENGINE_LICENSE_TYPE) {
37
37
  case "pro":
38
38
  case "enterprise":
@@ -42,7 +42,7 @@ export function /* OBFUSCATE */ hasProLicense() {
42
42
  }
43
43
 
44
44
  /** @internal */
45
- export function /* OBFUSCATE */ hasIndieLicense() {
45
+ export function sLAk() {
46
46
  switch (NEEDLE_ENGINE_LICENSE_TYPE) {
47
47
  case "indie":
48
48
  return true;
@@ -51,7 +51,7 @@ export function /* OBFUSCATE */ hasIndieLicense() {
51
51
  }
52
52
 
53
53
  /** @internal */
54
- export function /* OBFUSCATE */ hasEduLicense() {
54
+ export function $REX() {
55
55
  switch (NEEDLE_ENGINE_LICENSE_TYPE) {
56
56
  case "edu":
57
57
  return true;
@@ -60,20 +60,20 @@ export function /* OBFUSCATE */ hasEduLicense() {
60
60
  }
61
61
 
62
62
  /** @internal */
63
- export function /* OBFUSCATE */ hasCommercialLicense() {
64
- return hasProLicense() || hasIndieLicense() || hasEduLicense();
63
+ export function __RsyLK() {
64
+ return __tmUDtSjM() || sLAk() || $REX();
65
65
  }
66
66
 
67
67
 
68
68
  /** @internal */
69
- export function /* OBFUSCATE */ onLicenseCheckResultChanged(cb: (result: boolean) => void) {
70
- if (hasProLicense() || hasIndieLicense() || hasEduLicense())
69
+ export function bEDKz(cb: (result: boolean) => void) {
70
+ if (__tmUDtSjM() || sLAk() || $REX())
71
71
  return cb(true);
72
- _licenseCheckResultChangedCallbacks.push(cb);
72
+ $HofjjC.push(cb);
73
73
  }
74
74
 
75
- function /* OBFUSCATE */ invokeLicenseCheckResultChanged(result: boolean) {
76
- for (const cb of _licenseCheckResultChangedCallbacks) {
75
+ function _Txp(result: boolean) {
76
+ for (const cb of $HofjjC) {
77
77
  try {
78
78
  cb(result);
79
79
  }
@@ -88,7 +88,7 @@ function /* OBFUSCATE */ invokeLicenseCheckResultChanged(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 /* OBFUSCATE */ LICENSE_JWT_PUBLIC_KEY_JWK = {
91
+ const $hlpYaMIu = {
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 /* OBFUSCATE */ verifyLicenseJwt(jwt: string): Promise<string | null> {
115
+ async function _iKhwe(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 /* OBFUSCATE */ verifyLicenseJwt(jwt: string): Promise<string | n
122
122
 
123
123
  const key = await crypto.subtle.importKey(
124
124
  "jwk",
125
- LICENSE_JWT_PUBLIC_KEY_JWK,
125
+ $hlpYaMIu,
126
126
  { name: "ECDSA", namedCurve: "P-256" },
127
127
  false,
128
128
  ["verify"]
@@ -184,17 +184,17 @@ async function /* OBFUSCATE */ verifyLicenseJwt(jwt: string): Promise<string | n
184
184
  /** Verify the injected JWT and update the license type if valid.
185
185
  * The engine ONLY trusts the JWT — the plain NEEDLE_ENGINE_LICENSE_TYPE string is ignored. */
186
186
  let _jwtVerificationPromise: Promise<void> | undefined = undefined;
187
- async function /* OBFUSCATE */ verifyJwtLicense(): Promise<void> {
187
+ async function _CRfDpw(): Promise<void> {
188
188
  if (!NEEDLE_ENGINE_LICENSE_JWT) {
189
189
  // No JWT present: license stays "basic" regardless of what NEEDLE_ENGINE_LICENSE_TYPE says
190
190
  NEEDLE_ENGINE_LICENSE_TYPE = "basic";
191
191
  return;
192
192
  }
193
- const verifiedType = await verifyLicenseJwt(NEEDLE_ENGINE_LICENSE_JWT);
193
+ const verifiedType = await _iKhwe(NEEDLE_ENGINE_LICENSE_JWT);
194
194
  if (verifiedType) {
195
195
  NEEDLE_ENGINE_LICENSE_TYPE = verifiedType;
196
196
  if (debug) console.log("License type set from verified JWT: " + verifiedType);
197
- invokeLicenseCheckResultChanged(hasCommercialLicense());
197
+ _Txp(__RsyLK());
198
198
  }
199
199
  else {
200
200
  // JWT present but invalid: reset to basic
@@ -377,24 +377,24 @@ export namespace Telemetry {
377
377
  }
378
378
 
379
379
 
380
- export function /* OBFUSCATE */ initLicense() {
380
+ export function $ibdpNCdD() {
381
381
  // Start JWT verification — must be here (not top-level) to avoid tree-shaking
382
- _jwtVerificationPromise = verifyJwtLicense();
382
+ _jwtVerificationPromise = _CRfDpw();
383
383
 
384
384
  Telemetry.init();
385
385
  ContextRegistry.registerCallback(ContextEvent.ContextRegistered, evt => {
386
- showLicenseInfo(evt.context);
387
- handleForbidden(evt.context);
388
- setTimeout(() => sendUsageMessageToAnalyticsBackend(evt.context), 2000);
386
+ _LVR(evt.context);
387
+ _OVfQTxO(evt.context);
388
+ setTimeout(() => __mGFlyHJ(evt.context), 2000);
389
389
  });
390
390
  }
391
391
 
392
- export let /* OBFUSCATE */ runtimeLicenseCheckPromise: Promise<void> | undefined = undefined;
392
+ export let $pWRQ: Promise<void> | undefined = undefined;
393
393
  let applicationIsForbidden = false;
394
394
  let applicationForbiddenText = "";
395
- async function /* OBFUSCATE */ checkLicense() {
395
+ async function __pnA() {
396
396
  // Only perform the runtime license check once
397
- if (runtimeLicenseCheckPromise) return runtimeLicenseCheckPromise;
397
+ if ($pWRQ) return $pWRQ;
398
398
  // Wait for JWT verification to complete first (if running)
399
399
  if (_jwtVerificationPromise) {
400
400
  await _jwtVerificationPromise;
@@ -412,28 +412,28 @@ async function /* OBFUSCATE */ checkLicense() {
412
412
  applicationIsForbidden = false;
413
413
  if (debug) console.log("License check succeeded");
414
414
  NEEDLE_ENGINE_LICENSE_TYPE = "pro";
415
- invokeLicenseCheckResultChanged(true);
415
+ _Txp(true);
416
416
  }
417
417
  else if (res?.status === 403) {
418
- invokeLicenseCheckResultChanged(false);
418
+ _Txp(false);
419
419
  applicationIsForbidden = true;
420
420
  applicationForbiddenText = await res.text();
421
421
  }
422
422
  else {
423
- invokeLicenseCheckResultChanged(false);
423
+ _Txp(false);
424
424
  if (debug) console.log("License check failed with status " + res?.status);
425
425
  }
426
426
  }
427
427
  catch (err) {
428
- invokeLicenseCheckResultChanged(false);
428
+ _Txp(false);
429
429
  if (debug) console.error("License check failed", err);
430
430
  }
431
431
  }
432
432
  else if (debug) console.log("Runtime license check is skipped because license is already applied as \"" + NEEDLE_ENGINE_LICENSE_TYPE + "\"");
433
433
  }
434
- runtimeLicenseCheckPromise = checkLicense();
434
+ $pWRQ = __pnA();
435
435
 
436
- async function /* OBFUSCATE */ handleForbidden(ctx: IContext) {
436
+ async function _OVfQTxO(ctx: IContext) {
437
437
  function createForbiddenElement() {
438
438
  const div = document.createElement("div");
439
439
  div.className = "needle-forbidden";
@@ -498,40 +498,40 @@ async function /* OBFUSCATE */ handleForbidden(ctx: IContext) {
498
498
  }, 500)
499
499
  }
500
500
 
501
- async function /* OBFUSCATE */ showLicenseInfo(ctx: IContext) {
501
+ async function _LVR(ctx: IContext) {
502
502
  try {
503
- if (!hasProLicense() && !hasIndieLicense()) {
504
- return onNonCommercialVersionDetected(ctx);
503
+ if (!__tmUDtSjM() && !sLAk()) {
504
+ return $KTijQXsQ(ctx);
505
505
  }
506
506
  }
507
507
  catch (err) {
508
508
  if (debug) console.log("License check failed", err)
509
- return onNonCommercialVersionDetected(ctx)
509
+ return $KTijQXsQ(ctx)
510
510
  }
511
- if (debug) onNonCommercialVersionDetected(ctx)
511
+ if (debug) $KTijQXsQ(ctx)
512
512
  }
513
513
 
514
514
 
515
515
 
516
- async function /* OBFUSCATE */ onNonCommercialVersionDetected(ctx: IContext) {
516
+ async function $KTijQXsQ(ctx: IContext) {
517
517
 
518
518
  // if the engine loads faster than the license check, we need to capture the ready event here
519
519
  let isReady = false;
520
520
  ctx.domElement.addEventListener("ready", () => isReady = true);
521
521
 
522
- await runtimeLicenseCheckPromise?.catch(() => { });
522
+ await $pWRQ?.catch(() => { });
523
523
 
524
524
 
525
- if (hasProLicense() || hasIndieLicense()) return;
526
- if (hasCommercialLicense() === false) logNonCommercialUse();
525
+ if (__tmUDtSjM() || sLAk()) return;
526
+ if (__RsyLK() === false) AUFks();
527
527
 
528
528
  // check if the engine is already ready (meaning has finished loading)
529
529
  if (isReady) {
530
- insertNonCommercialUseHint(ctx);
530
+ $cjg(ctx);
531
531
  }
532
532
  else {
533
533
  ctx.domElement.addEventListener("ready", () => {
534
- insertNonCommercialUseHint(ctx);
534
+ $cjg(ctx);
535
535
  });
536
536
  }
537
537
  }
@@ -539,7 +539,7 @@ async function /* OBFUSCATE */ onNonCommercialVersionDetected(ctx: IContext) {
539
539
  // const licenseElementIdentifier = "needle-license-element";
540
540
  // const licenseDuration = 10000;
541
541
  // const licenseDelay = 1200;
542
- function /* OBFUSCATE */ insertNonCommercialUseHint(ctx: IContext) {
542
+ function $cjg(ctx: IContext) {
543
543
 
544
544
  const style = `
545
545
  position: relative;
@@ -609,7 +609,7 @@ function /* OBFUSCATE */ insertNonCommercialUseHint(ctx: IContext) {
609
609
  }
610
610
  }, 1000);
611
611
 
612
- if (hasEduLicense()) {
612
+ if ($REX()) {
613
613
  const removeDelay = 20_000;
614
614
  setTimeout(() => {
615
615
  clearInterval(interval);
@@ -618,7 +618,7 @@ function /* OBFUSCATE */ insertNonCommercialUseHint(ctx: IContext) {
618
618
  const intervalInMinutes = 5;
619
619
  setTimeout(() => {
620
620
  if (ctx.domElement.parentNode)
621
- insertNonCommercialUseHint(ctx);
621
+ $cjg(ctx);
622
622
  }, 1000 * 60 * intervalInMinutes)
623
623
  }, removeDelay);
624
624
  }
@@ -629,7 +629,7 @@ function /* OBFUSCATE */ insertNonCommercialUseHint(ctx: IContext) {
629
629
  const base64Logo = "data:image/webp;base64,UklGRrABAABXRUJQVlA4WAoAAAAQAAAAHwAAHwAAQUxQSKEAAAARN6CmbSM4WR7vdARON11EBDq3fLiNbVtVzpMCPlKAEzsx0Y/x+Ovuv4dn0EFE/ydAvz6YggXzgh5sVgXM/zOC/4sii7qgGvB5N7hmuQYwkvazWAu1JPW41FXSHq6pnaQWvqYH18Fc0j1hO/BFTtIeSBlJi5w6qIIO7IOrwhFsB2Yxukif0FTRLpXswHR8MxbslKe9VZsn/Ub5C7YFOpqSTABWUDgg6AAAAFAGAJ0BKiAAIAA+7VyoTqmkpCI3+qgBMB2JbACdMt69DwMIQBLhkTO6XwY00UEDK6cNIDnuNibPf0EgAP7Y1myuiQHLDsF/0h5unrGh6WAbv7aegg2ZMd3uRKfT/3SJztcaujYfTvMXspfCTmYcoO6a+vhC3ss4M8uM58t4siiu59I4aOl59e9Sr6xoxYlHf2v+NnBNpJYeJf8jABQAId/PXuBkLEFkiCucgSGEcfhvajql/j3reCGl0M5/9gQWy7ayNPs+wlvIxFnNfSlfuND4CZOCyxOHhRqOmHN4ULHo3tCSrUNvgAA=";
630
630
 
631
631
  let lastLogTime = 0;
632
- async function /* OBFUSCATE */ logNonCommercialUse(_logo?: string) {
632
+ async function AUFks(_logo?: string) {
633
633
  const now = Date.now();
634
634
  if (now - lastLogTime < 2000) return;
635
635
  lastLogTime = now;
@@ -662,7 +662,7 @@ async function /* OBFUSCATE */ logNonCommercialUse(_logo?: string) {
662
662
  }
663
663
 
664
664
 
665
- async function /* OBFUSCATE */ sendUsageMessageToAnalyticsBackend(context: IContext) {
665
+ async function __mGFlyHJ(context: IContext) {
666
666
  // We can't send beacons from cross-origin isolated pages
667
667
  if (window.crossOriginIsolated) return;
668
668
 
@@ -1,7 +1,7 @@
1
1
  import { FileLoader } from "three";
2
2
 
3
3
  import { showBalloonWarning } from "./debug/index.js";
4
- import { hasCommercialLicense } from "./engine_license.js";
4
+ import { __RsyLK } 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 (hasCommercialLicense()) {
48
+ if (__RsyLK()) {
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 (!hasCommercialLicense() && filesizeInMB > maxFreeSizeInMB) {
103
+ else if (!__RsyLK() && 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 { hasCommercialLicense } from "./engine_license.js";
7
+ import { __RsyLK } 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 = hasCommercialLicense();
138
+ const canUseCustomLogo = __RsyLK();
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 { hasProLicense } from "../../engine_license.js";
5
+ import { __tmUDtSjM } 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 && hasProLicense()) {
324
+ if (!this._showNeedleLogo && __tmUDtSjM()) {
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 { hasCommercialLicense, onLicenseCheckResultChanged, Telemetry } from "../../engine_license.js";
3
+ import { __RsyLK, bEDKz, 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";
@@ -778,8 +778,8 @@ export class NeedleMenuElement extends HTMLElementBase {
778
778
  try {
779
779
  // if the user has a license then we CAN hide the needle logo
780
780
  // calling this method immediately will cause an issue with vite bundling tho
781
- window.requestAnimationFrame(() => onLicenseCheckResultChanged(res => {
782
- if (res == true && hasCommercialLicense() && !debugNonCommercial) {
781
+ window.requestAnimationFrame(() => bEDKz(res => {
782
+ if (res == true && __RsyLK() && !debugNonCommercial) {
783
783
  let visible = this._userRequestedLogoVisible;
784
784
  if (visible === undefined) visible = false;
785
785
  this.___onSetLogoVisible(visible);
@@ -830,7 +830,7 @@ export class NeedleMenuElement extends HTMLElementBase {
830
830
  // ensure the menu is not hidden or removed
831
831
  const requiredParent = this?.parentNode;
832
832
  if (this.style.display != "flex" || this.style.visibility != "visible" || this.style.opacity != "1" || requiredParent != this._domElement?.shadowRoot) {
833
- if (!hasCommercialLicense()) {
833
+ if (!__RsyLK()) {
834
834
  const change = changeEventCounter++;
835
835
  // if a user doesn't have a local pro license *but* for development the menu is hidden then we show a warning
836
836
  if (isLocalNetwork() && this._userRequestedMenuVisible === false) {
@@ -918,7 +918,7 @@ export class NeedleMenuElement extends HTMLElementBase {
918
918
  showNeedleLogo(visible: boolean) {
919
919
  this._userRequestedLogoVisible = visible;
920
920
  if (!visible) {
921
- if (!hasCommercialLicense() || debugNonCommercial) {
921
+ if (!__RsyLK() || debugNonCommercial) {
922
922
  console.warn("[Needle Engine] You need a PRO license to hide the Needle Engine logo in production.");
923
923
  const localNetwork = isLocalNetwork()
924
924
  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 { hasCommercialLicense, hasProLicense, runtimeLicenseCheckPromise } from "../engine_license.js";
3
+ import { __RsyLK, __tmUDtSjM, $pWRQ } 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 = hasProLicense();
208
+ const hasLicense = __tmUDtSjM();
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 = hasCommercialLicense();
376
+ // let commercialLicense = __RsyLK();
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() && runtimeLicenseCheckPromise) {
396
+ // if (!isDevEnvironment() && $pWRQ) {
397
397
  // if (debugLicense) console.log("Waiting for runtime license check");
398
- // await runtimeLicenseCheckPromise;
399
- // commercialLicense = hasCommercialLicense();
398
+ // await $pWRQ;
399
+ // commercialLicense = __RsyLK();
400
400
  // }
401
401
  // if (commercialLicense) return;
402
402
  // nonCommercialContainer.style.transition = "opacity .5s ease-in-out";
@@ -1,7 +1,7 @@
1
1
  import { isDevEnvironment, showBalloonWarning } from "../debug/index.js";
2
2
  import { PUBLIC_KEY, VERSION } from "../engine_constants.js";
3
3
  import { ContextEvent, ContextRegistry } from "../engine_context_registry.js";
4
- import { hasCommercialLicense } from "../engine_license.js";
4
+ import { __RsyLK } from "../engine_license.js";
5
5
  import { onStart } from "../engine_lifecycle_api.js";
6
6
  import { setDracoDecoderPath, setDracoDecoderType, setKtx2TranscoderPath } from "../engine_loaders.gltf.js";
7
7
  import { Context, ContextCreateArgs } from "../engine_setup.js";
@@ -546,7 +546,7 @@ export class NeedleEngineWebComponent extends HTMLElementBase implements INeedle
546
546
 
547
547
 
548
548
  // Loading start events
549
- const allowOverridingDefaultLoading = hasCommercialLicense();
549
+ const allowOverridingDefaultLoading = __RsyLK();
550
550
  // default loading can be overriden by calling preventDefault in the onload start event
551
551
  this.ensureLoadStartIsRegistered();
552
552
  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 { hasCommercialLicense } from "../engine_license.js";
6
+ import { __RsyLK } 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 (hasCommercialLicense()) {
218
+ if (__RsyLK()) {
219
219
  const htmlComponent = document.querySelector("needle-engine");
220
220
  if (htmlComponent) {
221
221
  const licenseLogo = htmlComponent.getAttribute("logo-src");
@@ -3,7 +3,7 @@ import { Euler, Material, Matrix4, Mesh, Object3D, Quaternion, Vector3 } from "t
3
3
 
4
4
  import { isDevEnvironment, showBalloonMessage, showBalloonWarning } from "../../../engine/debug/index.js";
5
5
  import { findObjectOfType } from "../../../engine/engine_components.js";
6
- import { hasProLicense } from "../../../engine/engine_license.js";
6
+ import { __tmUDtSjM } from "../../../engine/engine_license.js";
7
7
  import { serializable } from "../../../engine/engine_serialization.js";
8
8
  import { getFormattedDate, Progress } from "../../../engine/engine_time_utils.js";
9
9
  import { DeviceUtilities, getParam } from "../../../engine/engine_utils.js";
@@ -277,7 +277,7 @@ export class USDZExporter extends Behaviour {
277
277
  let name = this.exportFileName ?? this.objectToExport?.name ?? this.name;
278
278
  name += "-" + getFormattedDate(); // seems iOS caches the file in some cases, this ensures we always have a fresh file
279
279
 
280
- if (!hasProLicense()) {
280
+ if (!__tmUDtSjM()) {
281
281
  if (name !== "") name += "-";
282
282
  name += "MadeWithNeedle";
283
283
  }
@@ -682,7 +682,7 @@ export class USDZExporter extends Behaviour {
682
682
  if (debug)
683
683
  showBalloonMessage("Quicklook url: " + callToActionURL);
684
684
  if (callToActionURL) {
685
- if (!hasProLicense()) {
685
+ if (!__tmUDtSjM()) {
686
686
  console.warn("Quicklook closed: custom redirects require a Needle Engine Pro license: https://needle.tools/pricing", callToActionURL)
687
687
  }
688
688
  else {
@@ -697,7 +697,7 @@ export class USDZExporter extends Behaviour {
697
697
  private buildQuicklookOverlay(): CustomBranding {
698
698
  const obj: CustomBranding = {};
699
699
  if (this.customBranding) Object.assign(obj, this.customBranding);
700
- if (!hasProLicense()) {
700
+ if (!__tmUDtSjM()) {
701
701
  console.log("Custom Quicklook banner text requires pro license: https://needle.tools/pricing");
702
702
  obj.callToAction = "Close";
703
703
  obj.checkoutTitle = "🌵 Made with Needle";
package/src/vite-env.d.ts DELETED
@@ -1,16 +0,0 @@
1
- // Vite global defines — see plugins/vite/defines.js
2
- // declare const entries here are picked up globally (ambient, no import/export).
3
- // Vite sets these as globals in dev and statically replaces them at build time.
4
- // Webpack DefinePlugin replaces them at build time too.
5
- // The globalThis fallbacks for vanilla JS are in engine_constants.ts.
6
-
7
- declare const NEEDLE_ENGINE_VERSION: string;
8
- declare const NEEDLE_ENGINE_GENERATOR: string;
9
- declare const NEEDLE_PROJECT_BUILD_TIME: string;
10
- declare const NEEDLE_PUBLIC_KEY: string;
11
-
12
- // #region treeshake flags
13
- // declare var (not const) so globalThis["NEEDLE_USE_*"] access is also type-safe
14
- declare var NEEDLE_USE_RAPIER: boolean;
15
- declare var NEEDLE_USE_POSTPROCESSING: boolean;
16
- // #endregion treeshake flags