@2112-lab/central-plant 0.1.3 → 0.1.4

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 (115) hide show
  1. package/dist/bundle/index.js +1 -1
  2. package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -1
  3. package/dist/cjs/node_modules/three/examples/jsm/controls/OrbitControls.js +1 -1
  4. package/dist/cjs/node_modules/three/examples/jsm/exporters/GLTFExporter.js +1 -0
  5. package/dist/cjs/node_modules/three/examples/jsm/exporters/OBJExporter.js +1 -0
  6. package/dist/cjs/node_modules/three/examples/jsm/exporters/PLYExporter.js +1 -0
  7. package/dist/cjs/node_modules/three/examples/jsm/exporters/STLExporter.js +1 -0
  8. package/dist/cjs/node_modules/three/examples/jsm/loaders/DRACOLoader.js +1 -0
  9. package/dist/cjs/node_modules/three/examples/jsm/loaders/GLTFLoader.js +1 -1
  10. package/dist/cjs/node_modules/three/examples/jsm/loaders/RGBELoader.js +1 -1
  11. package/dist/cjs/node_modules/three/examples/jsm/renderers/CSS2DRenderer.js +1 -0
  12. package/dist/cjs/src/analysis/analysis.js +1 -0
  13. package/dist/cjs/src/analysis/testing.js +1 -0
  14. package/dist/cjs/src/core/centralPlant.js +1 -0
  15. package/dist/cjs/src/core/debugLogger.js +1 -0
  16. package/dist/cjs/src/core/mathUtils.js +1 -0
  17. package/dist/cjs/src/core/nameUtils.js +1 -0
  18. package/dist/cjs/src/data/export.js +1 -0
  19. package/dist/cjs/src/data/import.js +1 -0
  20. package/dist/cjs/src/data/numerics.js +1 -0
  21. package/dist/cjs/src/helpers/sceneHelper.js +1 -0
  22. package/dist/cjs/src/index.js +1 -1
  23. package/dist/cjs/src/managers/components/animationManager.js +1 -0
  24. package/dist/cjs/src/managers/components/componentManager.js +1 -0
  25. package/dist/cjs/src/managers/components/pathfindingManager.js +1 -0
  26. package/dist/cjs/src/managers/controls/TransformControls.js +1 -0
  27. package/dist/cjs/src/managers/controls/cameraControlsManager.js +1 -0
  28. package/dist/cjs/src/managers/controls/dragDropManager.js +1 -0
  29. package/dist/cjs/src/managers/controls/keyboardControlsManager.js +1 -0
  30. package/dist/cjs/src/managers/controls/transformControlsManager.js +1 -0
  31. package/dist/cjs/src/managers/environment/environmentManager.js +1 -0
  32. package/dist/cjs/src/managers/environment/textureConfig.js +1 -0
  33. package/dist/cjs/src/managers/scene/sceneExportManager.js +1 -0
  34. package/dist/cjs/src/managers/scene/sceneInitializationManager.js +1 -0
  35. package/dist/cjs/src/managers/scene/sceneOperationsManager.js +1 -0
  36. package/dist/cjs/src/managers/scene/sceneTooltipsManager.js +1 -0
  37. package/dist/cjs/src/managers/system/disposalManager.js +1 -0
  38. package/dist/cjs/src/managers/system/hotReloadManager.js +1 -0
  39. package/dist/cjs/src/managers/system/performanceMonitor.js +1 -0
  40. package/dist/cjs/src/rendering/modelPreloader.js +1 -0
  41. package/dist/cjs/src/rendering/rendering2D.js +1 -0
  42. package/dist/cjs/src/rendering/rendering3D.js +1 -0
  43. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +1 -1
  44. package/dist/esm/node_modules/three/examples/jsm/controls/OrbitControls.js +1 -1
  45. package/dist/esm/node_modules/three/examples/jsm/exporters/GLTFExporter.js +1 -0
  46. package/dist/esm/node_modules/three/examples/jsm/exporters/OBJExporter.js +1 -0
  47. package/dist/esm/node_modules/three/examples/jsm/exporters/PLYExporter.js +1 -0
  48. package/dist/esm/node_modules/three/examples/jsm/exporters/STLExporter.js +1 -0
  49. package/dist/esm/node_modules/three/examples/jsm/loaders/DRACOLoader.js +1 -0
  50. package/dist/esm/node_modules/three/examples/jsm/loaders/GLTFLoader.js +1 -1
  51. package/dist/esm/node_modules/three/examples/jsm/loaders/RGBELoader.js +1 -1
  52. package/dist/esm/node_modules/three/examples/jsm/renderers/CSS2DRenderer.js +1 -0
  53. package/dist/esm/src/analysis/analysis.js +1 -0
  54. package/dist/esm/src/analysis/testing.js +1 -0
  55. package/dist/esm/src/core/centralPlant.js +1 -0
  56. package/dist/esm/src/core/debugLogger.js +1 -0
  57. package/dist/esm/src/core/mathUtils.js +1 -0
  58. package/dist/esm/src/core/nameUtils.js +1 -0
  59. package/dist/esm/src/data/export.js +1 -0
  60. package/dist/esm/src/data/import.js +1 -0
  61. package/dist/esm/src/data/numerics.js +1 -0
  62. package/dist/esm/src/helpers/sceneHelper.js +1 -0
  63. package/dist/esm/src/index.js +1 -1
  64. package/dist/esm/src/managers/components/animationManager.js +1 -0
  65. package/dist/esm/src/managers/components/componentManager.js +1 -0
  66. package/dist/esm/src/managers/components/pathfindingManager.js +1 -0
  67. package/dist/esm/src/managers/controls/TransformControls.js +1 -0
  68. package/dist/esm/src/managers/controls/cameraControlsManager.js +1 -0
  69. package/dist/esm/src/managers/controls/dragDropManager.js +1 -0
  70. package/dist/esm/src/managers/controls/keyboardControlsManager.js +1 -0
  71. package/dist/esm/src/managers/controls/transformControlsManager.js +1 -0
  72. package/dist/esm/src/managers/environment/environmentManager.js +1 -0
  73. package/dist/esm/src/managers/environment/textureConfig.js +1 -0
  74. package/dist/esm/src/managers/scene/sceneExportManager.js +1 -0
  75. package/dist/esm/src/managers/scene/sceneInitializationManager.js +1 -0
  76. package/dist/esm/src/managers/scene/sceneOperationsManager.js +1 -0
  77. package/dist/esm/src/managers/scene/sceneTooltipsManager.js +1 -0
  78. package/dist/esm/src/managers/system/disposalManager.js +1 -0
  79. package/dist/esm/src/managers/system/hotReloadManager.js +1 -0
  80. package/dist/esm/src/managers/system/performanceMonitor.js +1 -0
  81. package/dist/esm/src/rendering/modelPreloader.js +1 -0
  82. package/dist/esm/src/rendering/rendering2D.js +1 -0
  83. package/dist/esm/src/rendering/rendering3D.js +1 -0
  84. package/dist/index.d.ts +52 -255
  85. package/package.json +3 -6
  86. package/dist/cjs/node_modules/three/examples/jsm/controls/TransformControls.js +0 -1
  87. package/dist/cjs/src/animationManager.js +0 -1
  88. package/dist/cjs/src/componentManager.js +0 -1
  89. package/dist/cjs/src/debugLogger.js +0 -1
  90. package/dist/cjs/src/disposalManager.js +0 -1
  91. package/dist/cjs/src/environmentManager.js +0 -1
  92. package/dist/cjs/src/hotReloadManager.js +0 -1
  93. package/dist/cjs/src/keyboardControlsManager.js +0 -1
  94. package/dist/cjs/src/nameUtils.js +0 -1
  95. package/dist/cjs/src/pathfindingManager.js +0 -1
  96. package/dist/cjs/src/performanceMonitor.js +0 -1
  97. package/dist/cjs/src/sceneExportManager.js +0 -1
  98. package/dist/cjs/src/sceneInitializationManager.js +0 -1
  99. package/dist/cjs/src/textureConfig.js +0 -1
  100. package/dist/cjs/src/transformControlsManager.js +0 -1
  101. package/dist/esm/node_modules/three/examples/jsm/controls/TransformControls.js +0 -1
  102. package/dist/esm/src/animationManager.js +0 -1
  103. package/dist/esm/src/componentManager.js +0 -1
  104. package/dist/esm/src/debugLogger.js +0 -1
  105. package/dist/esm/src/disposalManager.js +0 -1
  106. package/dist/esm/src/environmentManager.js +0 -1
  107. package/dist/esm/src/hotReloadManager.js +0 -1
  108. package/dist/esm/src/keyboardControlsManager.js +0 -1
  109. package/dist/esm/src/nameUtils.js +0 -1
  110. package/dist/esm/src/pathfindingManager.js +0 -1
  111. package/dist/esm/src/performanceMonitor.js +0 -1
  112. package/dist/esm/src/sceneExportManager.js +0 -1
  113. package/dist/esm/src/sceneInitializationManager.js +0 -1
  114. package/dist/esm/src/textureConfig.js +0 -1
  115. package/dist/esm/src/transformControlsManager.js +0 -1
package/dist/index.d.ts CHANGED
@@ -1,255 +1,52 @@
1
- import * as THREE from 'three';
2
-
3
- // Common types
4
- export interface CentralPlantComponent {
5
- scene?: THREE.Scene;
6
- renderer?: THREE.WebGLRenderer;
7
- camera?: THREE.Camera;
8
- controls?: any;
9
- textureLoader?: THREE.TextureLoader;
10
- transformManager?: any;
11
- currentSceneData?: any;
12
- selectedObjectForTransform?: THREE.Object3D;
13
- pathfindingManager?: any;
14
- modelPreloader?: any;
15
- [key: string]: any;
16
- }
17
-
18
- // ==============================
19
- // Debug Logger
20
- // ==============================
21
- export interface Logger {
22
- info(message: string, ...args: any[]): void;
23
- warn(message: string, ...args: any[]): void;
24
- error(message: string, ...args: any[]): void;
25
- success(message: string, ...args: any[]): void;
26
- debug(message: string, ...args: any[]): void;
27
- trace(message: string, ...args: any[]): void;
28
- }
29
-
30
- export const logger: Logger;
31
- export const transformLogger: Logger;
32
- export const pathfinderLogger: Logger;
33
- export const modelLogger: Logger;
34
-
35
- // ==============================
36
- // Name Utils
37
- // ==============================
38
- export function generateUuidFromName(name: string): string;
39
- export function getHardcodedUuid(object: any): string;
40
- export function findObjectByHardcodedUuid(root: THREE.Object3D, uuid: string): THREE.Object3D | null;
41
-
42
- // ==============================
43
- // Model Preloader
44
- // ==============================
45
- export interface CacheStats {
46
- totalModels: number;
47
- memoryUsage: number;
48
- cached: string[];
49
- }
50
-
51
- export interface ModelPreloader {
52
- preloadAllModels(componentDictionary: Record<string, string>): Promise<void>;
53
- preloadModel(modelKey: string, modelUrl: string): Promise<THREE.Object3D>;
54
- getModel(modelKey: string): THREE.Object3D | null;
55
- clearCache(): void;
56
- getCacheStats(): CacheStats;
57
- }
58
-
59
- export const modelPreloader: ModelPreloader;
60
-
61
- // ==============================
62
- // Pathfinding Manager
63
- // ==============================
64
- export class PathfindingManager {
65
- constructor(component: CentralPlantComponent);
66
- getPathfinderVersionInfo(): Promise<{ version: string; detectionMethod: string; timestamp: string }>;
67
- logPathfinderVersion(context?: string): Promise<void>;
68
- getPathColor(index: number): string;
69
- initializePathfinder(data: any, crosscubeTextureSet: any): Promise<THREE.Object3D[]>;
70
- removeAllPaths(): void;
71
- createPipeMaterial(crosscubeTextureSet: any, pathIndex: number): THREE.Material;
72
- createPipePaths(paths: any[], crosscubeTextureSet: any): THREE.Object3D[];
73
- }
74
-
75
- export function getPathfindingManager(component?: CentralPlantComponent): PathfindingManager;
76
-
77
- // ==============================
78
- // Hot Reload Manager
79
- // ==============================
80
- export class HotReloadManager {
81
- constructor(componentInstance: any);
82
- setupHotReloadHandling(): void;
83
- cleanupHotReloadHandlers(): void;
84
- trackTimeout(timeoutId: number): number;
85
- trackInterval(intervalId: number): number;
86
- clearTrackedTimeout(timeoutId: number): boolean;
87
- clearTrackedInterval(intervalId: number): boolean;
88
- clearAllTrackedTimers(): void;
89
- }
90
-
91
- export function handleHotReload(instanceId: string, cleanupMethod: () => void): void;
92
- export function isHotReloading(): boolean;
93
- export function cleanupForHotReload(instanceId: string): void;
94
-
95
- // ==============================
96
- // Environment Manager
97
- // ==============================
98
- export class EnvironmentManager {
99
- constructor(component: CentralPlantComponent);
100
- createSkybox(): Promise<void>;
101
- setupLighting(): void;
102
- createGround(): THREE.Mesh | null;
103
- createWalls(): THREE.Mesh[];
104
- setFog(color?: number, density?: number): void;
105
- initializeEnvironment(): Promise<void>;
106
- }
107
-
108
- export function getEnvironmentManager(component?: CentralPlantComponent): EnvironmentManager;
109
- export function initializeEnvironment(component: CentralPlantComponent): Promise<EnvironmentManager>;
110
-
111
- // ==============================
112
- // Texture Config
113
- // ==============================
114
- export interface TextureSet {
115
- path: string;
116
- files: Record<string, string>;
117
- repeat?: { x: number; y: number };
118
- materialProps?: Record<string, any>;
119
- }
120
-
121
- export const TEXTURE_SETS: Record<string, TextureSet>;
122
-
123
- export function createTexture(
124
- textureLoader: THREE.TextureLoader,
125
- url: string,
126
- repeat?: { x: number; y: number }
127
- ): THREE.Texture | null;
128
-
129
- export function loadTextureSetAndCreateMaterial(
130
- component: CentralPlantComponent,
131
- textureSetName: string
132
- ): Promise<THREE.Material>;
133
-
134
- // ==============================
135
- // Scene Export Manager
136
- // ==============================
137
- export class SceneExportManager {
138
- constructor(componentInstance: CentralPlantComponent);
139
- exportSceneData(): any | null;
140
- downloadSceneExport(filename?: string | null): boolean;
141
- exportSceneDataAsString(pretty?: boolean): string | null;
142
- getExportMetadata(): {
143
- totalObjects: number;
144
- hasCurrentSceneData: boolean;
145
- connectionsCount: number;
146
- exportTimestamp: string;
147
- } | null;
148
- }
149
-
150
- export function getSceneExportManager(component?: CentralPlantComponent): SceneExportManager;
151
-
152
- // ==============================
153
- // Scene Operations Manager
154
- // ==============================
155
- export class SceneOperationsManager {
156
- constructor(component: CentralPlantComponent);
157
- clearSceneObjects(): void;
158
- ensureTransformControlsAttached(attachToSelected?: boolean): void;
159
- deselectObject(): void;
160
- loadSceneData(sceneData: any | string): boolean;
161
- findObjectByName(name: string): THREE.Object3D | null;
162
- findObjectByUuid(uuid: string): THREE.Object3D | null;
163
- removeObject(object: THREE.Object3D): boolean;
164
- duplicateObject(sourceObject: THREE.Object3D, options?: {
165
- positionOffset?: THREE.Vector3
166
- }): THREE.Object3D | null;
167
- }
168
-
169
- export function getSceneOperationsManager(component?: CentralPlantComponent): SceneOperationsManager;
170
-
171
- // ==============================
172
- // Transform Controls Manager
173
- // ==============================
174
- export interface TransformControlsConfig {
175
- size?: number;
176
- enabled?: boolean;
177
- showX?: boolean;
178
- showY?: boolean;
179
- showZ?: boolean;
180
- snap?: number | null;
181
- translationSnap?: number | null;
182
- rotationSnap?: number | null;
183
- scaleSnap?: number | null;
184
- showBoundingBox?: boolean;
185
- boundingBoxColor?: number;
186
- useBoundingBoxSelection?: boolean;
187
- }
188
-
189
- export interface TransformCallbacks {
190
- onObjectSelect?: (object: THREE.Object3D | null, selected: boolean) => void;
191
- onTransformStart?: (object: THREE.Object3D, transform: any) => void;
192
- onTransform?: (object: THREE.Object3D, currentTransform: any, initialTransform: any) => void;
193
- onTransformEnd?: (object: THREE.Object3D, finalTransform: any, initialTransform: any) => void;
194
- onModeChange?: (mode: 'translate' | 'rotate' | 'scale') => void;
195
- }
196
-
197
- export class TransformControlsManager {
198
- constructor(scene: THREE.Scene, camera: THREE.Camera, renderer: THREE.WebGLRenderer, orbitControls?: any);
199
- init(): Promise<void>;
200
- on(callbacks: TransformCallbacks): void;
201
- createTransformControls(): void;
202
- setupEventListeners(): void;
203
- setupKeyboardControls(): void;
204
- removeEventListeners(): void;
205
- selectObject(object: THREE.Object3D): THREE.Object3D | null;
206
- deselectObject(): THREE.Object3D | null;
207
- setMode(mode: 'translate' | 'rotate' | 'scale'): void;
208
- toggleSpace(): void;
209
- toggleVisibility(): void;
210
- setEnabled(enabled: boolean): void;
211
- updateAxisVisibility(): void;
212
- showBoundingBox(object: THREE.Object3D): void;
213
- hideBoundingBox(): void;
214
- updateBoundingBox(): void;
215
- captureObjectTransform(object: THREE.Object3D): any | null;
216
- setSnapValues(options: {
217
- translation?: number;
218
- rotation?: number;
219
- scale?: number;
220
- }): void;
221
- setSize(size: number): void;
222
- dispose(): void;
223
- }
224
-
225
- export function getTransformControlsManager(
226
- scene: THREE.Scene,
227
- camera: THREE.Camera,
228
- renderer: THREE.WebGLRenderer,
229
- orbitControls?: any
230
- ): TransformControlsManager;
231
-
232
- // ==============================
233
- // Main Module
234
- // ==============================
235
- export interface CentralPlantUtils {
236
- animation: any;
237
- component: any;
238
- debug: typeof import('./debugLogger');
239
- disposal: any;
240
- environment: typeof import('./environmentManager');
241
- hotReload: typeof import('./hotReloadManager');
242
- keyboardControls: any;
243
- modelPreloader: typeof import('./modelPreloader');
244
- name: typeof import('./nameUtils');
245
- pathfinding: typeof import('./pathfindingManager');
246
- performance: any;
247
- sceneExport: any;
248
- sceneInitialization: any;
249
- sceneOperations: any;
250
- texture: typeof import('./textureConfig');
251
- transformControls: any;
252
- }
253
-
254
- declare const CentralPlantUtils: CentralPlantUtils;
255
- export default CentralPlantUtils;
1
+ /**
2
+ * Central Plant Utils - Type Declarations
3
+ *
4
+ * This file provides TypeScript type definitions for all utility modules
5
+ * organized by their functional categories.
6
+ */
7
+
8
+ // Core utilities
9
+ export { CentralPlant } from './core/centralPlant.js';
10
+ export { DebugLogger, logger, transformLogger, pathfinderLogger, modelLogger } from './core/debugLogger.js';
11
+ export { generateUuidFromName, getHardcodedUuid, findObjectByHardcodedUuid } from './core/nameUtils.js';
12
+ export { MathUtils } from './core/mathUtils.js';
13
+
14
+ // Scene management
15
+ export { SceneInitializationManager } from './managers/scene/sceneInitializationManager.js';
16
+ export { SceneOperationsManager } from './managers/scene/sceneOperationsManager.js';
17
+ export { SceneExportManager } from './managers/scene/sceneExportManager.js';
18
+ export { SceneTooltipsManager } from './managers/scene/sceneTooltipsManager.js';
19
+
20
+ // Component management
21
+ export { ComponentManager } from './managers/components/componentManager.js';
22
+ export { AnimationManager } from './managers/components/animationManager.js';
23
+ export { PathfindingManager } from './managers/components/pathfindingManager.js';
24
+
25
+ // Controls management
26
+ export { createTransformControls } from './managers/controls/transformControlsManager.js';
27
+ export { KeyboardControlsManager } from './managers/controls/keyboardControlsManager.js';
28
+ export { CameraControlsManager } from './managers/controls/cameraControlsManager.js';
29
+ export { default as DragDropManager } from './managers/controls/dragDropManager.js';
30
+
31
+ // Environment management
32
+ export { EnvironmentManager } from './managers/environment/environmentManager.js';
33
+ export { loadTextureSetAndCreateMaterial } from './managers/environment/textureConfig.js';
34
+
35
+ // System management
36
+ export { HotReloadManager } from './managers/system/hotReloadManager.js';
37
+ export { DisposalManager } from './managers/system/disposalManager.js';
38
+ export { PerformanceMonitor } from './managers/system/performanceMonitor.js';
39
+
40
+ // Rendering utilities
41
+ export { default as modelPreloader } from './rendering/modelPreloader.js';
42
+ export * as Rendering2D from './rendering/rendering2D.js';
43
+ export * as Rendering3D from './rendering/rendering3D.js';
44
+
45
+ // Data handling
46
+ export * as ImportUtils from './data/import.js';
47
+ export * as ExportUtils from './data/export.js';
48
+ export * as Numerics from './data/numerics.js';
49
+
50
+ // Analysis utilities
51
+ export * as Analysis from './analysis/analysis.js';
52
+ export * as Testing from './analysis/testing.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2112-lab/central-plant",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Utility modules for the Central Plant Application",
5
5
  "main": "dist/bundle/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -30,7 +30,7 @@
30
30
  "license": "MIT",
31
31
  "dependencies": {
32
32
  "@2112-lab/pathfinder": "^1.0.15",
33
- "three": ">=0.137.0"
33
+ "three": "^0.177.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.23.3",
@@ -45,8 +45,5 @@
45
45
  "rollup-plugin-typescript2": "^0.34.0",
46
46
  "tslib": "^2.5.0",
47
47
  "typescript": "^5.0.0"
48
- },
49
- "peerDependencies": {
50
- "three": ">=0.137.0"
51
48
  }
52
- }
49
+ }
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var t=require("three");const s=new t.Raycaster,h=new t.Vector3,i=new t.Vector3,e=new t.Quaternion,n={X:new t.Vector3(1,0,0),Y:new t.Vector3(0,1,0),Z:new t.Vector3(0,0,1)},a={type:"change"},o={type:"mouseDown"},w={type:"mouseUp",mode:null},l={type:"objectChange"};class r extends t.Object3D{constructor(s,h){super(),void 0===h&&(h=document),this.isTransformControls=!0,this.visible=!1,this.domElement=h,this.domElement.style.touchAction="none";const i=new D;this.h=i,this.add(i);const e=new W;this.i=e,this.add(e);const n=this;function o(t,s){let h=s;Object.defineProperty(n,t,{get:function(){return void 0!==h?h:s},set:function(s){h!==s&&(h=s,e[t]=s,i[t]=s,n.dispatchEvent({type:t+"-changed",value:s}),n.dispatchEvent(a))}}),n[t]=s,e[t]=s,i[t]=s}o("camera",s),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const w=new t.Vector3,l=new t.Vector3,r=new t.Quaternion,d=new t.Quaternion,Y=new t.Vector3,Z=new t.Quaternion,f=new t.Vector3,E=new t.Vector3,m=new t.Vector3,v=new t.Vector3;o("worldPosition",w),o("worldPositionStart",l),o("worldQuaternion",r),o("worldQuaternionStart",d),o("cameraPosition",Y),o("cameraQuaternion",Z),o("pointStart",f),o("pointEnd",E),o("rotationAxis",m),o("rotationAngle",0),o("eye",v),this.o=new t.Vector3,this.l=new t.Vector3,this.u=new t.Vector3,this.M=new t.Vector3,this.p=new t.Vector3,this.m=new t.Quaternion,this.v=new t.Quaternion,this.S=new t.Vector3,this.T=new t.Vector3,this.A=new t.Quaternion,this.k=new t.Vector3,this.D=new t.Vector3,this.W=new t.Quaternion,this.j=new t.Vector3,this.P=c.bind(this),this.R=M.bind(this),this.C=u.bind(this),this.I=p.bind(this),this.L=X.bind(this),this.domElement.addEventListener("pointerdown",this.R),this.domElement.addEventListener("pointermove",this.C),this.domElement.addEventListener("pointerup",this.L)}updateMatrixWorld(){void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent||this.object.parent.matrixWorld.decompose(this.p,this.m,this.S),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.k),this.v.copy(this.m).invert(),this.A.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.M),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(t){if(void 0===this.object||!0===this.dragging)return;s.setFromCamera(t,this.camera);const h=d(this.h.picker[this.mode],s);this.axis=h?h.object.name:null}pointerDown(t){if(void 0!==this.object&&!0!==this.dragging&&0===t.button&&null!==this.axis){s.setFromCamera(t,this.camera);const h=d(this.i,s,!0);h&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this.D.copy(this.object.position),this.W.copy(this.object.quaternion),this.j.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.T),this.pointStart.copy(h.point).sub(this.worldPositionStart)),this.dragging=!0,o.mode=this.mode,this.dispatchEvent(o)}}pointerMove(t){const o=this.axis,w=this.mode,r=this.object;let c=this.space;if("scale"===w?c="local":"E"!==o&&"XYZE"!==o&&"XYZ"!==o||(c="world"),void 0===r||null===o||!1===this.dragging||-1!==t.button)return;s.setFromCamera(t,this.camera);const u=d(this.i,s,!0);if(u){if(this.pointEnd.copy(u.point).sub(this.worldPositionStart),"translate"===w)this.o.copy(this.pointEnd).sub(this.pointStart),"local"===c&&"XYZ"!==o&&this.o.applyQuaternion(this.A),-1===o.indexOf("X")&&(this.o.x=0),-1===o.indexOf("Y")&&(this.o.y=0),-1===o.indexOf("Z")&&(this.o.z=0),"local"===c&&"XYZ"!==o?this.o.applyQuaternion(this.W).divide(this.S):this.o.applyQuaternion(this.v).divide(this.S),r.position.copy(this.o).add(this.D),this.translationSnap&&("local"===c&&(r.position.applyQuaternion(e.copy(this.W).invert()),-1!==o.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==o.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==o.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this.W)),"world"===c&&(r.parent&&r.position.add(h.setFromMatrixPosition(r.parent.matrixWorld)),-1!==o.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==o.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==o.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(h.setFromMatrixPosition(r.parent.matrixWorld))));else if("scale"===w){if(-1!==o.search("XYZ")){let t=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(t*=-1),i.set(t,t,t)}else h.copy(this.pointStart),i.copy(this.pointEnd),h.applyQuaternion(this.A),i.applyQuaternion(this.A),i.divide(h),-1===o.search("X")&&(i.x=1),-1===o.search("Y")&&(i.y=1),-1===o.search("Z")&&(i.z=1);r.scale.copy(this.j).multiply(i),this.scaleSnap&&(-1!==o.search("X")&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==o.search("Y")&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==o.search("Z")&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===w){this.o.copy(this.pointEnd).sub(this.pointStart);const t=20/this.worldPosition.distanceTo(h.setFromMatrixPosition(this.camera.matrixWorld));"E"===o?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.l.copy(this.pointStart).normalize(),this.u.copy(this.pointEnd).normalize(),this.rotationAngle*=this.u.cross(this.l).dot(this.eye)<0?1:-1):"XYZE"===o?(this.rotationAxis.copy(this.o).cross(this.eye).normalize(),this.rotationAngle=this.o.dot(h.copy(this.rotationAxis).cross(this.eye))*t):"X"!==o&&"Y"!==o&&"Z"!==o||(this.rotationAxis.copy(n[o]),h.copy(n[o]),"local"===c&&h.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.o.dot(h.cross(this.eye).normalize())*t),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===c&&"E"!==o&&"XYZE"!==o?(r.quaternion.copy(this.W),r.quaternion.multiply(e.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.v),r.quaternion.copy(e.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this.W).normalize())}this.dispatchEvent(a),this.dispatchEvent(l)}}pointerUp(t){0===t.button&&(this.dragging&&null!==this.axis&&(w.mode=this.mode,this.dispatchEvent(w)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this.R),this.domElement.removeEventListener("pointermove",this.C),this.domElement.removeEventListener("pointermove",this.I),this.domElement.removeEventListener("pointerup",this.L),this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}attach(t){return this.object=t,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this.D),this.object.quaternion.copy(this.W),this.object.scale.copy(this.j),this.dispatchEvent(a),this.dispatchEvent(l),this.pointStart.copy(this.pointEnd))}getRaycaster(){return s}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function c(t){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:t.button};{const s=this.domElement.getBoundingClientRect();return{x:(t.clientX-s.left)/s.width*2-1,y:-(t.clientY-s.top)/s.height*2+1,button:t.button}}}function u(t){if(this.enabled)switch(t.pointerType){case"mouse":case"pen":this.pointerHover(this.P(t))}}function M(t){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this.I),this.pointerHover(this.P(t)),this.pointerDown(this.P(t)))}function p(t){this.enabled&&this.pointerMove(this.P(t))}function X(t){this.enabled&&(this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this.I),this.pointerUp(this.P(t)))}function d(t,s,h){const i=s.intersectObject(t,!0);for(let t=0;t<i.length;t++)if(i[t].object.visible||h)return i[t];return!1}const Y=new t.Euler,Z=new t.Vector3(0,1,0),f=new t.Vector3(0,0,0),E=new t.Matrix4,m=new t.Quaternion,v=new t.Quaternion,S=new t.Vector3,b=new t.Matrix4,x=new t.Vector3(1,0,0),g=new t.Vector3(0,1,0),T=new t.Vector3(0,0,1),y=new t.Vector3,A=new t.Vector3,k=new t.Vector3;class D extends t.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const s=new t.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),h=new t.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),i=s.clone();i.opacity=.15;const e=h.clone();e.opacity=.5;const n=s.clone();n.color.setHex(16711680);const a=s.clone();a.color.setHex(65280);const o=s.clone();o.color.setHex(255);const w=s.clone();w.color.setHex(16711680),w.opacity=.5;const l=s.clone();l.color.setHex(65280),l.opacity=.5;const r=s.clone();r.color.setHex(255),r.opacity=.5;const c=s.clone();c.opacity=.25;const u=s.clone();u.color.setHex(16776960),u.opacity=.25;s.clone().color.setHex(16776960);const M=s.clone();M.color.setHex(7895160);const p=new t.CylinderGeometry(0,.04,.1,12);p.translate(0,.05,0);const X=new t.BoxGeometry(.08,.08,.08);X.translate(0,.04,0);const d=new t.BufferGeometry;d.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,0,0],3));const Y=new t.CylinderGeometry(.0075,.0075,.5,3);function Z(s,h){const i=new t.TorusGeometry(s,.0075,3,64,h*Math.PI*2);return i.rotateY(Math.PI/2),i.rotateX(Math.PI/2),i}Y.translate(0,.25,0);const f={X:[[new t.Mesh(p,n),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(p,n),[-.5,0,0],[0,0,Math.PI/2]],[new t.Mesh(Y,n),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new t.Mesh(p,a),[0,.5,0]],[new t.Mesh(p,a),[0,-.5,0],[Math.PI,0,0]],[new t.Mesh(Y,a)]],Z:[[new t.Mesh(p,o),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(p,o),[0,0,-.5],[-Math.PI/2,0,0]],[new t.Mesh(Y,o),null,[Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.1,0),c.clone()),[0,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),r.clone()),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),w.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},E={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.OctahedronGeometry(.2,0),i)]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]]},m={START:[[new t.Mesh(new t.OctahedronGeometry(.01,2),e),null,null,null,"helper"]],END:[[new t.Mesh(new t.OctahedronGeometry(.01,2),e),null,null,null,"helper"]],DELTA:[[new t.Line(function(){const s=new t.BufferGeometry;return s.setAttribute("position",new t.Float32BufferAttribute([0,0,0,1,1,1],3)),s}(),e),null,null,null,"helper"]],X:[[new t.Line(d,e.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(d,e.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(d,e.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},v={XYZE:[[new t.Mesh(Z(.5,1),M),null,[0,Math.PI/2,0]]],X:[[new t.Mesh(Z(.5,.5),n)]],Y:[[new t.Mesh(Z(.5,.5),a),null,[0,0,-Math.PI/2]]],Z:[[new t.Mesh(Z(.5,.5),o),null,[0,Math.PI/2,0]]],E:[[new t.Mesh(Z(.75,1),u),null,[0,Math.PI/2,0]]]},S={AXIS:[[new t.Line(d,e.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},b={XYZE:[[new t.Mesh(new t.SphereGeometry(.25,10,8),i)]],X:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new t.Mesh(new t.TorusGeometry(.5,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new t.Mesh(new t.TorusGeometry(.75,.1,2,24),i)]]},x={X:[[new t.Mesh(X,n),[.5,0,0],[0,0,-Math.PI/2]],[new t.Mesh(Y,n),[0,0,0],[0,0,-Math.PI/2]],[new t.Mesh(X,n),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(X,a),[0,.5,0]],[new t.Mesh(Y,a)],[new t.Mesh(X,a),[0,-.5,0],[0,0,Math.PI]]],Z:[[new t.Mesh(X,o),[0,0,.5],[Math.PI/2,0,0]],[new t.Mesh(Y,o),[0,0,0],[Math.PI/2,0,0]],[new t.Mesh(X,o),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),r),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),w),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.1,.1,.1),c.clone())]]},g={X:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[.3,0,0],[0,0,-Math.PI/2]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[0,.3,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[0,-.3,0],[0,0,Math.PI]]],Z:[[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[0,0,.3],[Math.PI/2,0,0]],[new t.Mesh(new t.CylinderGeometry(.2,0,.6,4),i),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),i),[.15,.15,0]]],YZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),i),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.01),i),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new t.Mesh(new t.BoxGeometry(.2,.2,.2),i),[0,0,0]]]},T={X:[[new t.Line(d,e.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new t.Line(d,e.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new t.Line(d,e.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function y(s){const h=new t.Object3D;for(const t in s)for(let i=s[t].length;i--;){const e=s[t][i][0].clone(),n=s[t][i][1],a=s[t][i][2],o=s[t][i][3],w=s[t][i][4];e.name=t,e.tag=w,n&&e.position.set(n[0],n[1],n[2]),a&&e.rotation.set(a[0],a[1],a[2]),o&&e.scale.set(o[0],o[1],o[2]),e.updateMatrix();const l=e.geometry.clone();l.applyMatrix4(e.matrix),e.geometry=l,e.renderOrder=1/0,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1),h.add(e)}return h}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=y(f)),this.add(this.gizmo.rotate=y(v)),this.add(this.gizmo.scale=y(x)),this.add(this.picker.translate=y(E)),this.add(this.picker.rotate=y(b)),this.add(this.picker.scale=y(g)),this.add(this.helper.translate=y(m)),this.add(this.helper.rotate=y(S)),this.add(this.helper.scale=y(T)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const s="local"===("scale"===this.mode?"local":this.space)?this.worldQuaternion:v;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let t=0;t<i.length;t++){const n=i[t];let a;if(n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition),a=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(a*this.size/4),"helper"!==n.tag){if(n.quaternion.copy(s),"translate"===this.mode||"scale"===this.mode){const t=.99,h=.2;"X"===n.name&&Math.abs(Z.copy(x).applyQuaternion(s).dot(this.eye))>t&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"Y"===n.name&&Math.abs(Z.copy(g).applyQuaternion(s).dot(this.eye))>t&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"Z"===n.name&&Math.abs(Z.copy(T).applyQuaternion(s).dot(this.eye))>t&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"XY"===n.name&&Math.abs(Z.copy(T).applyQuaternion(s).dot(this.eye))<h&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"YZ"===n.name&&Math.abs(Z.copy(x).applyQuaternion(s).dot(this.eye))<h&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),"XZ"===n.name&&Math.abs(Z.copy(g).applyQuaternion(s).dot(this.eye))<h&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)}else"rotate"===this.mode&&(m.copy(s),Z.copy(this.eye).applyQuaternion(e.copy(s).invert()),-1!==n.name.search("E")&&n.quaternion.setFromRotationMatrix(E.lookAt(this.eye,f,g)),"X"===n.name&&(e.setFromAxisAngle(x,Math.atan2(-Z.y,Z.z)),e.multiplyQuaternions(m,e),n.quaternion.copy(e)),"Y"===n.name&&(e.setFromAxisAngle(g,Math.atan2(Z.x,Z.z)),e.multiplyQuaternions(m,e),n.quaternion.copy(e)),"Z"===n.name&&(e.setFromAxisAngle(T,Math.atan2(Z.y,Z.x)),e.multiplyQuaternions(m,e),n.quaternion.copy(e)));n.visible=n.visible&&(-1===n.name.indexOf("X")||this.showX),n.visible=n.visible&&(-1===n.name.indexOf("Y")||this.showY),n.visible=n.visible&&(-1===n.name.indexOf("Z")||this.showZ),n.visible=n.visible&&(-1===n.name.indexOf("E")||this.showX&&this.showY&&this.showZ),n.material.N=n.material.N||n.material.color.clone(),n.material.O=n.material.O||n.material.opacity,n.material.color.copy(n.material.N),n.material.opacity=n.material.O,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(t){return n.name===t}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}else n.visible=!1,"AXIS"===n.name?(n.visible=!!this.axis,"X"===this.axis&&(e.setFromEuler(Y.set(0,0,0)),n.quaternion.copy(s).multiply(e),Math.abs(Z.copy(x).applyQuaternion(s).dot(this.eye))>.9&&(n.visible=!1)),"Y"===this.axis&&(e.setFromEuler(Y.set(0,0,Math.PI/2)),n.quaternion.copy(s).multiply(e),Math.abs(Z.copy(g).applyQuaternion(s).dot(this.eye))>.9&&(n.visible=!1)),"Z"===this.axis&&(e.setFromEuler(Y.set(0,Math.PI/2,0)),n.quaternion.copy(s).multiply(e),Math.abs(Z.copy(T).applyQuaternion(s).dot(this.eye))>.9&&(n.visible=!1)),"XYZE"===this.axis&&(e.setFromEuler(Y.set(0,Math.PI/2,0)),Z.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(E.lookAt(f,Z,g)),n.quaternion.multiply(e),n.visible=this.dragging),"E"===this.axis&&(n.visible=!1)):"START"===n.name?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):"END"===n.name?(n.position.copy(this.worldPosition),n.visible=this.dragging):"DELTA"===n.name?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),h.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),h.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(h),n.visible=this.dragging):(n.quaternion.copy(s),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=-1!==this.axis.search(n.name)))}super.updateMatrixWorld(t)}}class W extends t.Mesh{constructor(){super(new t.PlaneGeometry(1e5,1e5,2,2),new t.MeshBasicMaterial({visible:!1,wireframe:!0,side:t.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let s=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(s="local"),y.copy(x).applyQuaternion("local"===s?this.worldQuaternion:v),A.copy(g).applyQuaternion("local"===s?this.worldQuaternion:v),k.copy(T).applyQuaternion("local"===s?this.worldQuaternion:v),Z.copy(A),this.mode){case"translate":case"scale":switch(this.axis){case"X":Z.copy(this.eye).cross(y),S.copy(y).cross(Z);break;case"Y":Z.copy(this.eye).cross(A),S.copy(A).cross(Z);break;case"Z":Z.copy(this.eye).cross(k),S.copy(k).cross(Z);break;case"XY":S.copy(k);break;case"YZ":S.copy(y);break;case"XZ":Z.copy(k),S.copy(A);break;case"XYZ":case"E":S.set(0,0,0)}break;default:S.set(0,0,0)}0===S.length()?this.quaternion.copy(this.cameraQuaternion):(b.lookAt(h.set(0,0,0),S,Z),this.quaternion.setFromRotationMatrix(b)),super.updateMatrixWorld(t)}}exports.TransformControls=r,exports.TransformControlsGizmo=D,exports.TransformControlsPlane=W;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var n=require("./debugLogger.js"),t=null,i=!1,o=0,a=[];function r(r){if(!i){i=!0,o=performance.now();var e=function(u){if(i){var c=(u-o)/1e3;o=u,function(t,i){a.forEach(function(o){try{o(t,i)}catch(t){n.logger.error("Error in animation callback:",t)}})}(u,c),r&&r.renderer&&r.scene&&r.camera&&r.renderer.render(r.scene,r.camera),r&&r.controls&&r.controls.update&&r.controls.update(),t=requestAnimationFrame(e)}};t=requestAnimationFrame(e),n.logger.info("Animation loop started")}}function e(){i&&(null!==t&&(cancelAnimationFrame(t),t=null),i=!1,n.logger.info("Animation loop stopped"))}function u(t){if("function"==typeof t)return a.push(t),t;n.logger.warn("Invalid animation callback")}function c(n){var t=a.indexOf(n);return-1!==t&&(a.splice(t,1),!0)}function l(){return i}var s={startAnimation:r,stopAnimation:e,addAnimationCallback:u,removeAnimationCallback:c,isAnimationRunning:l};exports.addAnimationCallback=u,exports.default=s,exports.isAnimationRunning=l,exports.removeAnimationCallback=c,exports.startAnimation=r,exports.stopAnimation=e;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var n=require("../_virtual/_rollupPluginBabelHelpers.js"),e=require("three"),t=require("./debugLogger.js");function o(n){if(n&&n.t)return n;var e=Object.create(null);return n&&Object.keys(n).forEach(function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:function(){return n[t]}})}}),e.default=n,Object.freeze(e)}var r=o(e);function u(n){return i.apply(this,arguments)}function i(){return(i=n.asyncToGenerator(n.regenerator().m(function e(o){var u;return n.regenerator().w(function(n){for(;;)if(0===n.n)return t.logger.info("Loading component: ".concat(o.id||"Unknown")),u={id:o.id||"unknown-component",type:o.type||"generic",data:o,object:new r.Group,position:o.position||{x:0,y:0,z:0},rotation:o.rotation||{x:0,y:0,z:0},scale:o.scale||{x:1,y:1,z:1}},n.a(2,u)},e)}))).apply(this,arguments)}function c(n,e,o,r){return n&&n.object?(e&&n.object.position.set(e.x||0,e.y||0,e.z||0),o&&n.object.rotation.set(o.x||0,o.y||0,o.z||0),r&&r.add&&r.add(n.object),n):(t.logger.error("Cannot place component: invalid component object"),null)}function p(n,e){if(!e)return t.logger.error("Cannot remove component: scene not provided"),!1;var o=null;return e.traverse(function(e){e.userData&&e.userData.id===n&&(o=e)}),o&&o.parent?(o.parent.remove(o),t.logger.info("Component removed: ".concat(n)),!0):(t.logger.warn("Component not found: ".concat(n)),!1)}function a(n,e){if(!e)return t.logger.error("Cannot get component: scene not provided"),null;var o=null;return e.traverse(function(e){e.userData&&e.userData.id===n&&(o=e)}),o}var l={loadComponent:u,placeComponent:c,removeComponent:p,getComponentById:a};exports.default=l,exports.getComponentById=a,exports.loadComponent=u,exports.placeComponent=c,exports.removeComponent=p;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"i",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),r=function(){return e.createClass(function r(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"SceneViewer",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";e.classCallCheck(this,r),this.namespace=i,this.debugLevel=t,this.isProduction="undefined"!=typeof process&&"production"===process.env.NODE_ENV,this.enabled=!this.isProduction,this.levels={error:0,warn:1,info:2,debug:3,verbose:4},this.currentLevel=this.levels[t]||this.levels.info},[{key:"setLevel",value:function(e){return this.currentLevel=this.levels[e]||this.levels.info,this}},{key:"enable",value:function(){return this.enabled=!0,this}},{key:"disable",value:function(){return this.enabled=!1,this}},{key:"_shouldLog",value:function(e){return this.enabled&&this.levels[e]<=this.currentLevel}},{key:"_formatMessage",value:function(e,r){for(var i="[".concat(this.namespace,":").concat(e.toUpperCase(),"]"),t=arguments.length,n=new Array(t>2?t-2:0),s=2;s<t;s++)n[s-2]=arguments[s];return[i,r].concat(n)}},{key:"error",value:function(r){if(this.t("error")){for(var i,t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];(i=console).error.apply(i,e.toConsumableArray(this.o.apply(this,["error",r].concat(n))))}}},{key:"warn",value:function(r){if(this.t("warn")){for(var i,t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];(i=console).warn.apply(i,e.toConsumableArray(this.o.apply(this,["warn",r].concat(n))))}}},{key:"info",value:function(r){if(this.t("info")){for(var i,t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];(i=console).log.apply(i,e.toConsumableArray(this.o.apply(this,["info",r].concat(n))))}}},{key:"debug",value:function(r){if(this.t("debug")){for(var i,t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];(i=console).debug.apply(i,e.toConsumableArray(this.o.apply(this,["debug",r].concat(n))))}}},{key:"verbose",value:function(r){if(this.t("verbose")){for(var i,t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];(i=console).debug.apply(i,e.toConsumableArray(this.o.apply(this,["verbose",r].concat(n))))}}},{key:"phase",value:function(e,r){for(var i=arguments.length,t=new Array(i>2?i-2:0),n=2;n<i;n++)t[n-2]=arguments[n];this.info.apply(this,["🔍 PHASE ".concat(e,": ").concat(r)].concat(t))}},{key:"success",value:function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),t=1;t<r;t++)i[t-1]=arguments[t];this.info.apply(this,["✅ ".concat(e)].concat(i))}},{key:"failure",value:function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),t=1;t<r;t++)i[t-1]=arguments[t];this.error.apply(this,["❌ ".concat(e)].concat(i))}},{key:"loading",value:function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),t=1;t<r;t++)i[t-1]=arguments[t];this.debug.apply(this,["🔄 ".concat(e)].concat(i))}},{key:"timing",value:function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),t=1;t<r;t++)i[t-1]=arguments[t];this.debug.apply(this,["⏱️ ".concat(e)].concat(i))}}])}(),i=new r("SceneViewer","info"),t=new r("Transform","warn"),n=new r("Pathfinder","info"),s=new r("Models","info"),o=new r("Materials","warn");exports.DebugLogger=r,exports.logger=i,exports.materialLogger=o,exports.modelLogger=s,exports.pathfinderLogger=n,exports.transformLogger=t;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),n=require("three"),r=require("./debugLogger.js");function t(e){if(e&&e.t)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:function(){return e[r]}})}}),n.default=e,Object.freeze(n)}var u=t(n);function o(n){n&&(n.geometry&&n.geometry.dispose(),n.material&&(Array.isArray(n.material)?n.material.forEach(function(e){return l(e)}):l(n.material)),n.children&&n.children.length>0&&e.toConsumableArray(n.children).forEach(function(e){return o(e)}))}function l(e){e&&(Object.keys(e).forEach(function(n){var r=e[n];r&&r instanceof u.Texture&&r.dispose()}),e.dispose())}function c(e){if(e){for(;e.children.length>0;){var n=e.children[0];e.remove(n),o(n)}r.logger.info("Scene cleared and disposed")}else r.logger.warn("Cannot cleanup: scene not provided")}function i(e){if(e){e.dispose();var n=e.domElement;n&&n.parentNode&&n.parentNode.removeChild(n),r.logger.info("Renderer disposed")}else r.logger.warn("Cannot cleanup: renderer not provided")}function s(){"undefined"!=typeof window&&window.$nuxt&&window.$nuxt.$off&&r.logger.info("Nuxt event listeners cleaned up")}function a(e){e&&(e.stopAnimation&&e.stopAnimation(),e.controls&&(e.controls.dispose&&e.controls.dispose(),e.controls=null),e.scene&&(c(e.scene),e.scene=null),e.renderer&&(i(e.renderer),e.renderer=null),e.camera=null,e.textureLoader=null,e.gltfLoader=null,r.logger.info("All Three.js resources cleaned up"))}var d={disposeObject:o,disposeMaterial:l,cleanupScene:c,cleanupRenderer:i,cleanupNuxtEventListeners:s,cleanupThreeJsResources:a};exports.cleanupNuxtEventListeners=s,exports.cleanupRenderer=i,exports.cleanupScene=c,exports.cleanupThreeJsResources=a,exports.default=d,exports.disposeMaterial=l,exports.disposeObject=o;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),n=require("three"),r=require("./debugLogger.js");function t(e){if(e&&e.t)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,t.get?t:{enumerable:!0,get:function(){return e[r]}})}}),n.default=e,Object.freeze(n)}var a,i=t(n);function o(e){if(e.startsWith("/")&&(e=e.substring(1)),"undefined"!=typeof window){var n="undefined"!=typeof CentralPlantUtils;if("localhost"===window.location.hostname&&("3000"===window.location.port||"3001"===window.location.port))return"/".concat(e);if(n){var r="undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("src/environmentManager.js",document.baseURI).href;return new URL("./assets/".concat(e),r).href}var t="undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("src/environmentManager.js",document.baseURI).href;return new URL("../assets/".concat(e),t).href}return"assets/".concat(e)}function u(){return c.apply(this,arguments)}function c(){return(c=e.asyncToGenerator(e.regenerator().m(function n(){var r;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if("undefined"==typeof window){e.n=4;break}return e.p=1,e.n=2,Promise.resolve().then(function(){return require("../node_modules/three/examples/jsm/loaders/RGBELoader.js")});case 2:return r=e.v,a=r.RGBELoader,e.a(2,!0);case 3:throw e.p=3,e.v,new Error("Failed to load Three.js loaders");case 4:return e.a(2,!1)}},n,null,[[1,3]])}))).apply(this,arguments)}var s={loadTextureSetAndCreateMaterial:null,checkThreeJSCompatibility:null,forceUpdateMaterials:null};function l(){return f.apply(this,arguments)}function f(){return(f=e.asyncToGenerator(e.regenerator().m(function n(){var r;return e.regenerator().w(function(n){for(;;)switch(n.n){case 0:if("undefined"==typeof window){n.n=4;break}return n.p=1,n.n=2,Promise.resolve().then(function(){return require("./textureConfig.js")});case 2:return r=n.v,s.loadTextureSetAndCreateMaterial=r.loadTextureSetAndCreateMaterial,s.checkThreeJSCompatibility=r.checkThreeJSCompatibility,s.forceUpdateMaterials=r.forceUpdateMaterials,Object.entries(s).filter(function(n){var r=e.slicedToArray(n,2);return r[0],"function"==typeof r[1]}).map(function(n){return e.slicedToArray(n,1)[0]}),"function"==typeof s.checkThreeJSCompatibility&&s.checkThreeJSCompatibility(),n.a(2,!0);case 3:return n.p=3,n.v,n.a(2,!1);case 4:return n.a(2,!1)}},n,null,[[1,3]])}))).apply(this,arguments)}var d=function(){return e.createClass(function n(r){e.classCallCheck(this,n),this.component=r,this.loadersInitialized=!1,this.initLoaders()},[{key:"initLoaders",value:(v=e.asyncToGenerator(e.regenerator().m(function n(){return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.p=1,e.n=2,Promise.all([u(),l()]);case 2:this.loadersInitialized=!0,e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2)}},n,this,[[1,3]])})),function(){return v.apply(this,arguments)})},{key:"createSkybox",value:(d=e.asyncToGenerator(e.regenerator().m(function n(){var t,c,s,l,f,d,v,w,h,m,p,b,k,y,g=this;return e.regenerator().w(function(n){for(;;)switch(n.n){case 0:if((t=this.component)&&t.renderer&&t.scene){n.n=1;break}return r.logger.warn("Cannot create skybox: component, renderer or scene not available"),n.a(2);case 1:if(a){n.n=5;break}return n.p=2,n.n=3,u();case 3:n.n=5;break;case 4:return n.p=4,n.v,this.createFallbackEnvironment(),n.a(2);case 5:if(n.p=5,c=!(!t.renderer.context||"function"!=typeof t.renderer.context.isContextLost)&&t.renderer.context.isContextLost(),t.renderer.capabilities&&!c){n.n=6;break}return r.logger.warn("WebGL context is lost or invalid, using fallback environment"),this.createFallbackEnvironment(),n.a(2);case 6:if(n.p=6,s=new i.PMREMGenerator(t.renderer)){n.n=7;break}throw new Error("PMREMGenerator could not be created");case 7:s.compileEquirectangularShader(),n.n=9;break;case 8:return n.p=8,k=n.v,r.logger.warn("Failed to initialize PMREMGenerator:",k),this.createFallbackEnvironment(),n.a(2);case 9:l=o("skyboxes/kloofendal_48d_partly_cloudy_puresky_2k.hdr"),f=o("skyboxes/kloofendal_48d_partly_cloudy_puresky_1k.hdr"),d=o("skyboxes/sky_fallback.jpg"),(v=[{type:"hdr",loader:new a,paths:[l,f]},{type:"jpeg",loader:t.textureLoader||new i.TextureLoader,paths:[d]}]).forEach(function(e){var n=e.loader;n&&"function"==typeof n.setCrossOrigin&&n.setCrossOrigin("anonymous")}),w=function(e,n){try{var a,o;e.mapping=i.EquirectangularReflectionMapping,void 0!==e.colorSpace?e.colorSpace=t.renderer.outputColorSpace||i.SRGBColorSpace:void 0!==e.encoding&&(e.encoding=t.renderer.outputEncoding||i.sRGBEncoding);var u=s.fromEquirectangular(e).texture;return r.logger.info("Generating environment map:\n - Type: ".concat(n,"\n - Texture valid: ").concat(null!==e,"\n - Processed map valid: ").concat(null!==u,"\n - Renderer encoding: ").concat(t.renderer.outputEncoding||t.renderer.outputColorSpace,"\n - Texture encoding: ").concat(e.encoding||e.colorSpace)),null!==(a=t.scene.environment)&&void 0!==a&&a.dispose&&t.scene.environment.dispose(),null!==(o=t.scene.background)&&void 0!==o&&o.dispose&&t.scene.background.dispose(),t.scene.environment=u,t.scene.background=u,e.dispose(),t.renderer&&(t.renderer.toneMappingExposure=1,t.renderer.render(t.scene,t.camera)),r.logger.info("Environment map (".concat(n,") applied successfully")),!0}catch(e){return r.logger.warn("Failed to apply ".concat(n," environment map:"),e),!1}},h=e.regenerator().m(function n(){var t,a,i,o,u,c,l,f,d;return e.regenerator().w(function(n){for(;;)switch(n.n){case 0:t=b[p],a=t.type,i=t.loader,o=t.paths,u=e.createForOfIteratorHelper(o),n.p=1,l=e.regenerator().m(function n(){var t,o,u;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(t=c.value,e.p=1,!t.startsWith("/")||t.includes("://")){e.n=3;break}return e.n=2,g.checkLocalTextureExists(t);case 2:if(e.v){e.n=3;break}return e.a(2,0);case 3:return r.logger.info("Attempting to load ".concat(a," texture: ").concat(t)),e.n=4,new Promise(function(e,n){var r=setTimeout(function(){return n(new Error("Timeout loading ".concat(t)))},1e4);i.load(t,function(n){clearTimeout(r),e(n)},function(e){e.lengthComputable&&(e.loaded,e.total)},function(e){clearTimeout(r),n(e)})});case 4:if(o=e.v,!w(o,a)){e.n=5;break}return s.dispose(),e.a(2,{v:{v:void 0}});case 5:e.n=7;break;case 6:e.p=6,u=e.v,r.logger.warn("Failed to load ".concat(t,":"),u.message);case 7:return e.a(2)}},n,null,[[1,6]])}),u.s();case 2:if((c=u.n()).done){n.n=6;break}return n.d(e.regeneratorValues(l()),3);case 3:if(0!==(f=n.v)){n.n=4;break}return n.a(3,5);case 4:if(!f){n.n=5;break}return n.a(2,f.v);case 5:n.n=2;break;case 6:n.n=8;break;case 7:n.p=7,d=n.v,u.e(d);case 8:return n.p=8,u.f(),n.f(8);case 9:return n.a(2)}},n,null,[[1,7,8,9]])}),p=0,b=v;case 10:if(!(p<b.length)){n.n=13;break}return n.d(e.regeneratorValues(h()),11);case 11:if(!(m=n.v)){n.n=12;break}return n.a(2,m.v);case 12:p++,n.n=10;break;case 13:this.createProceduralSky(s),n.n=15;break;case 14:n.p=14,y=n.v,r.logger.error("Error creating skybox:",y),this.createFallbackEnvironment();case 15:return n.a(2)}},n,this,[[6,8],[5,14],[2,4]])})),function(){return d.apply(this,arguments)})},{key:"createFallbackEnvironment",value:function(){var e=this.component;if(e&&e.scene){r.logger.info("Creating basic fallback environment");var n=new i.AmbientLight(16777215,.6);e.scene.add(n);var t=new i.DirectionalLight(16777215,.8);t.position.set(1,2,3),e.scene.add(t),e.scene.background=new i.Color(8900331)}}},{key:"createProceduralSky",value:function(e){var n=this.component;if(n&&n.scene){r.logger.info("Using procedural sky fallback");var t=new i.AmbientLight(16777215,.6);n.scene.add(t);var a=new i.DirectionalLight(16777215,.8);a.position.set(1,1,1),n.scene.add(a);try{if(e&&"function"==typeof e.fromScene){var o=new i.Scene;o.add(new i.HemisphereLight(8900331,4473975,1));var u=e.fromScene(o);u&&u.texture&&(n.scene.environment=u.texture)}n.scene.background=new i.Color(8900331)}catch(e){r.logger.warn("Failed to create procedural sky, using simple background",e),n.scene.background=new i.Color(8900331)}finally{e&&"function"==typeof e.dispose&&e.dispose()}}}},{key:"setupLighting",value:function(){var e=this.component;if(e&&e.scene){var n=[];e.scene.traverse(function(e){e instanceof i.Light&&n.push(e)}),n.forEach(function(n){e.scene.remove(n)});var t=new i.DirectionalLight(16777215,.8);t.position.set(5,10,7),t.castShadow=!0,t.shadow.mapSize.width=1024,t.shadow.mapSize.height=1024,t.shadow.camera.near=1,t.shadow.camera.far=30,t.shadow.camera.left=-10,t.shadow.camera.right=10,t.shadow.camera.top=10,t.shadow.camera.bottom=-10,t.shadow.bias=-.001,e.scene.add(t);var a=new i.AmbientLight(16777215,.3);e.scene.add(a);var o=new i.HemisphereLight(16777215,4473975,.3);e.scene.add(o),r.logger.info("Scene lighting setup complete")}else r.logger.warn("Cannot setup lighting: component or scene not available")}},{key:"createGround",value:function(){var e=this.component;if(!e||!e.scene)return r.logger.warn("Cannot create ground: component or scene not available"),null;var n=new i.PlaneGeometry(100,100),t=new i.MeshStandardMaterial({color:13421772,roughness:.8,metalness:.2,side:i.DoubleSide}),a=new i.Mesh(n,t);return a.rotation.x=-Math.PI/2,a.position.y=-.01,a.receiveShadow=!0,a.userData={isEnvironmentObject:!0,type:"ground"},e.scene.add(a),r.logger.info("Ground plane created"),a}},{key:"createWalls",value:function(){var n=this.component;if(!n||!n.scene)return r.logger.warn("Cannot create walls: component or scene not available"),[];for(var t=[],a=20,o=50,u=new i.MeshStandardMaterial({color:14540253,roughness:.9,metalness:.1,side:i.DoubleSide}),c=[new i.BoxGeometry(o,a,1),new i.BoxGeometry(1,a,o),new i.BoxGeometry(o,a,1),new i.BoxGeometry(1,a,o)],s=[[0,10,-25],[25,10,0],[0,10,25],[-25,10,0]],l=["north-wall","east-wall","south-wall","west-wall"],f=0;f<4;f++){var d,v=new i.Mesh(c[f],u);(d=v.position).set.apply(d,e.toConsumableArray(s[f])),v.receiveShadow=!0,v.castShadow=!0,v.userData={isEnvironmentObject:!0,type:"wall",name:l[f]},n.scene.add(v),t.push(v)}return r.logger.info("Environment walls created"),t}},{key:"setFog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:13421772,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.01,t=this.component;t&&t.scene?(t.scene.fog=new i.FogExp2(e,n),r.logger.info("Scene fog applied")):r.logger.warn("Cannot set fog: component or scene not available")}},{key:"initializeEnvironment",value:(f=e.asyncToGenerator(e.regenerator().m(function n(){var t,a,o=this;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return t=this.component,e.p=1,e.n=2,u();case 2:return e.v,e.n=3,l();case 3:e.v,e.n=5;break;case 4:e.p=4,e.v;case 5:if(t){e.n=6;break}return r.logger.error("❌ Cannot initialize environment: component is null"),e.a(2);case 6:if(t.renderer){e.n=7;break}return r.logger.error("❌ Cannot initialize environment: renderer is null"),e.a(2);case 7:return t.renderer.toneMapping||(t.renderer.toneMapping=i.ACESFilmicToneMapping),t.renderer.toneMappingExposure=1,void 0!==t.renderer.outputColorSpace?t.renderer.outputColorSpace=i.SRGBColorSpace:void 0!==t.renderer.outputEncoding&&(t.renderer.outputEncoding=i.sRGBEncoding),r.logger.info("Renderer configured for HDR:\n - Tone mapping: ".concat(t.renderer.toneMapping,"\n - Color space: ").concat(t.renderer.outputColorSpace||t.renderer.outputEncoding)),e.n=8,this.createSkybox();case 8:return this.setupLighting(),e.n=9,this.addTexturedGround();case 9:return e.v?r.logger.info("✅ Ground created successfully"):r.logger.error("❌ Failed to create textured ground"),e.n=10,this.addBrickWalls();case 10:(a=e.v)&&0!==a.length?r.logger.info("✅ Created ".concat(a.length," walls")):r.logger.warn("⚠️ No walls were created"),this.addHorizonFog(),r.logger.info("Environment initialization complete"),this.forceRefreshMaterials(),t.renderer&&t.scene&&t.camera&&(t.renderer.render(t.scene,t.camera),setTimeout(function(){t.renderer&&!t.isDestroyed&&(o.forceRefreshMaterials(),t.renderer.render(t.scene,t.camera))},1e3));case 11:return e.a(2)}},n,this,[[1,4]])})),function(){return f.apply(this,arguments)})},{key:"addTexturedGround",value:(c=e.asyncToGenerator(e.regenerator().m(function n(){var t,a,o,u,c,f,d,v,w,h;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(s.loadTextureSetAndCreateMaterial){e.n=2;break}return e.n=1,l();case 1:if(s.loadTextureSetAndCreateMaterial){e.n=2;break}return e.a(2,this.createGround());case 2:if((t=this.component)&&t.scene){e.n=3;break}return r.logger.warn("Cannot create textured ground: component or scene not available"),e.a(2,null);case 3:return t.textureLoader||(t.textureLoader=new i.TextureLoader,t.textureLoader.setCrossOrigin("anonymous")),t.scene.traverse(function(e){e.userData&&"ground"===e.userData.type&&t.scene.remove(e)}),e.p=4,e.n=5,s.loadTextureSetAndCreateMaterial(t,"gravel_embedded_concrete");case 5:if(a=e.v){e.n=6;break}throw new Error("Failed to create ground material");case 6:return o=new i.MeshBasicMaterial({color:2293538,wireframe:!1,side:i.DoubleSide}),u=new i.PlaneGeometry(100,100),(c=new i.Mesh(u,a)).rotation.x=-Math.PI/2,c.position.y=-.01,c.receiveShadow=!0,(f=new i.Mesh(u,o)).rotation.x=-Math.PI/2,f.position.y=-.02,f.visible=!1,c.userData={isEnvironmentObject:!0,isBaseGround:!0,type:"ground"},f.userData={isEnvironmentObject:!0,type:"ground-debug"},t.scene.add(c),t.scene.add(f),r.logger.info("Textured ground created"),e.a(2,c);case 7:return e.p=7,h=e.v,r.logger.error("Error creating textured ground:",h),d=new i.PlaneGeometry(100,100),v=new i.MeshBasicMaterial({color:16711680,wireframe:!0,side:i.DoubleSide}),(w=new i.Mesh(d,v)).rotation.x=-Math.PI/2,w.position.y=-.01,w.userData={isEnvironmentObject:!0,isBaseGround:!0,type:"ground-error"},t.scene.add(w),e.a(2,w)}},n,this,[[4,7]])})),function(){return c.apply(this,arguments)})},{key:"addBrickWalls",value:(t=e.asyncToGenerator(e.regenerator().m(function n(){var t,a,o,u,c,f,d,v,w,h,m,p;return e.regenerator().w(function(n){for(;;)switch(n.n){case 0:if(s.loadTextureSetAndCreateMaterial){n.n=2;break}return n.n=1,l();case 1:if(s.loadTextureSetAndCreateMaterial){n.n=2;break}return n.a(2,this.createWalls());case 2:if((t=this.component)&&t.scene){n.n=3;break}return r.logger.warn("Cannot create brick walls: component or scene not available"),n.a(2,[]);case 3:return t.scene.traverse(function(e){e.userData&&"wall"===e.userData.type&&t.scene.remove(e)}),n.p=4,n.n=5,s.loadTextureSetAndCreateMaterial(t,"brick");case 5:for(a=n.v,o=[],u=20,c=50,f=[new i.BoxGeometry(c,u,1),new i.BoxGeometry(1,u,c),new i.BoxGeometry(c,u,1),new i.BoxGeometry(1,u,c)],d=[[0,10,-25],[25,10,0],[0,10,25],[-25,10,0]],v=["north-wall","east-wall","south-wall","west-wall"],w=0;w<4;w++)m=new i.Mesh(f[w],a),(h=m.position).set.apply(h,e.toConsumableArray(d[w])),m.receiveShadow=!0,m.castShadow=!0,m.userData={isEnvironmentObject:!0,type:"wall",name:v[w]},t.scene.add(m),o.push(m);return r.logger.info("Textured environment walls created"),n.a(2,o);case 6:return n.p=6,p=n.v,r.logger.error("Error creating brick walls:",p),n.a(2,this.createWalls())}},n,this,[[4,6]])})),function(){return t.apply(this,arguments)})},{key:"addHorizonFog",value:function(){var e=this.component;if(e&&e.scene){e.scene.fog=new i.FogExp2(14213375,.005),r.logger.info("Horizon fog applied")}else r.logger.warn("Cannot set horizon fog: component or scene not available")}},{key:"checkLocalTextureExists",value:(n=e.asyncToGenerator(e.regenerator().m(function n(r){return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(r.startsWith("/")&&(r=r.substring(1)),"undefined"==typeof window){e.n=1;break}return e.a(2,new Promise(function(e){var n=new Image;n.onload=function(){return e(!0)},n.onerror=function(){return e(!1)},n.src=r,setTimeout(function(){return e(!1)},2e3)}));case 1:return e.a(2,!1)}},n)})),function(e){return n.apply(this,arguments)})},{key:"forceRefreshMaterials",value:function(){var e=this.component;if(e&&e.scene){var n=s.hasValidImageData||function(e){return e&&e.image},t=s.createPlaceholderTexture||function(){return null};e.scene.traverse(function(e){e.isMesh&&e.material&&(Array.isArray(e.material)?e.material:[e.material]).forEach(function(e){if(e){e.needsUpdate=!0,e.color&&"function"==typeof e.color.convertSRGBToLinear&&e.color.convertSRGBToLinear();["map","normalMap","roughnessMap","metalnessMap","aoMap","bumpMap"].forEach(function(r){var a=e[r];if(a)if(n(a))a.needsUpdate=!0,"map"===r&&void 0!==a.colorSpace?a.colorSpace=i.SRGBColorSpace:"map"===r&&void 0!==a.encoding&&(a.encoding=i.sRGBEncoding);else if(t){var o=t("normalMap"===r?8421631:13421772);o&&(e[r]=o)}})}})}),s.forceUpdateMaterials&&s.forceUpdateMaterials(e.scene),e.renderer&&e.camera&&e.renderer.render(e.scene,e.camera)}else r.logger.warn("Cannot refresh materials: component or scene not available")}}]);var n,t,c,f,d,v}(),v=null;function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(!v||e&&v.component!==e)&&(v=new d(e)),v}var h,m={EnvironmentManager:d,getEnvironmentManager:w,initializeEnvironment:(h=e.asyncToGenerator(e.regenerator().m(function n(r){var t;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return t=w(r),e.n=1,t.initializeEnvironment();case 1:return e.a(2,t)}},n)})),function(e){return h.apply(this,arguments)})};exports.EnvironmentManager=d,exports.default=m,exports.getEnvironmentManager=w;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var t=require("../_virtual/_rollupPluginBabelHelpers.js"),i="undefined"!=typeof window,e=i&&"development"===process.env.NODE_ENV,n=function(){return t.createClass(function i(n){t.classCallCheck(this,i),this.component=n,this.isDev=e,this.instanceId=Date.now()+Math.random(),this.hotReloadCleanupHandler=null,this.visibilityChangeHandler=null,this.nuxtHotReloadHandler=null,this.memoryCheckInterval=null,this.timeoutIds=new Set,this.intervalIds=new Set},[{key:"setupHotReloadHandling",value:function(){var t=this;i&&this.isDev&&(window._sceneViewerInstances||(window._sceneViewerInstances=new Set),window._sceneViewerInstances.add(this.component),this.hotReloadCleanupHandler=function(){t.component&&"function"==typeof t.component.enhancedDisposal&&t.component.enhancedDisposal(),window._sceneViewerInstances&&window._sceneViewerInstances.delete(t.component)},window.addEventListener("beforeunload",this.hotReloadCleanupHandler),window.addEventListener("pagehide",this.hotReloadCleanupHandler))}},{key:"cleanupHotReloadHandlers",value:function(){i&&this.isDev&&(this.hotReloadCleanupHandler&&(window.removeEventListener("beforeunload",this.hotReloadCleanupHandler),window.removeEventListener("pagehide",this.hotReloadCleanupHandler),this.hotReloadCleanupHandler=null),this.visibilityChangeHandler&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null),this.nuxtHotReloadHandler&&window.$nuxt&&window.$nuxt.$off&&(window.$nuxt.$off("routeChanged",this.nuxtHotReloadHandler),window.$nuxt.$off("$nuxtReady",this.nuxtHotReloadHandler),this.nuxtHotReloadHandler=null),this.memoryCheckInterval&&(clearInterval(this.memoryCheckInterval),this.memoryCheckInterval=null),window._sceneViewerInstances&&window._sceneViewerInstances.delete(this.component))}},{key:"trackTimeout",value:function(t){return t&&this.timeoutIds.add(t),t}},{key:"trackInterval",value:function(t){return t&&this.intervalIds.add(t),t}},{key:"clearTrackedTimeout",value:function(t){return!!this.timeoutIds.has(t)&&(clearTimeout(t),this.timeoutIds.delete(t),!0)}},{key:"clearTrackedInterval",value:function(t){return!!this.intervalIds.has(t)&&(clearInterval(t),this.intervalIds.delete(t),!0)}},{key:"clearAllTrackedTimers",value:function(){this.timeoutIds.forEach(function(t){clearTimeout(t)}),this.timeoutIds.clear(),this.intervalIds.forEach(function(t){clearInterval(t)}),this.intervalIds.clear()}}])}();function o(t,n){if(i&&e){window._hotReloadRegistry||(window._hotReloadRegistry=new Map);var o=window._hotReloadRegistry.get(t);o&&"function"==typeof o.cleanup&&o.cleanup(),window._hotReloadRegistry.set(t,{timestamp:Date.now(),cleanup:n})}}function l(){return e&&i&&window._hotReloadRegistry&&window._hotReloadRegistry.size>0}function s(t){if(i&&e&&window._hotReloadRegistry){var n=window._hotReloadRegistry.get(t);n&&"function"==typeof n.cleanup&&(n.cleanup(),window._hotReloadRegistry.delete(t))}}var u={HotReloadManager:n,handleHotReload:o,isHotReloading:l,cleanupForHotReload:s};exports.HotReloadManager=n,exports.cleanupForHotReload=s,exports.default=u,exports.handleHotReload=o,exports.isHotReloading=l;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"o",{value:!0});var e=require("./debugLogger.js"),n=new Map,o=!1;function r(){"undefined"!=typeof window?o||(window.addEventListener("keydown",i),window.addEventListener("keyup",d),o=!0,e.logger.info("Keyboard controls initialized")):e.logger.warn("Cannot initialize keyboard controls: window is not defined")}function t(){"undefined"!=typeof window&&o&&(window.removeEventListener("keydown",i),window.removeEventListener("keyup",d),n.clear(),o=!1,e.logger.info("Keyboard controls cleaned up"))}function i(e){var o=f(e),r=n.get(o);r&&(e.preventDefault(),r.callback(e))}function d(e){var o=f(e),r=n.get(o);r&&r.onKeyUp&&(e.preventDefault(),r.onKeyUp(e))}function a(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=c(e);return n.set(d,{callback:t,onKeyUp:i.onKeyUp||null,description:i.description||""}),o||r(),d}function u(e){var o=c(e);return n.delete(o)}function s(){var e=[];return n.forEach(function(n,o){e.push({key:o,description:n.description})}),e}function c(e){return e.toLowerCase()}function f(e){var n="";return e.ctrlKey&&(n+="ctrl+"),e.altKey&&(n+="alt+"),e.shiftKey&&(n+="shift+"),e.metaKey&&(n+="meta+"),n+=e.key.toLowerCase()}function l(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a("r",function(){n.camera&&n.controls&&(n.camera.position.set(-10,10,10),n.controls.target.set(0,0,0),n.controls.update(),e.logger.info("Camera reset"))},{description:"Reset camera view"}),a("w",function(){if(n.scene){var r=!o.wireframeEnabled;o.wireframeEnabled=r,n.scene.traverse(function(e){e.isMesh&&e.material&&(Array.isArray(e.material)?e.material.forEach(function(e){e.wireframe=r}):e.material.wireframe=r)}),e.logger.info("Wireframe mode: ".concat(r?"enabled":"disabled"))}},{description:"Toggle wireframe mode"}),a("p",function(){n.performanceUI&&n.performanceUI.toggle()},{description:"Toggle performance monitor"}),e.logger.info("Common keyboard controls setup")}var p={initKeyboardControls:r,cleanupKeyboardControls:t,registerKeyHandler:a,unregisterKeyHandler:u,getRegisteredKeyHandlers:s,setupCommonControls:l};exports.cleanupKeyboardControls=t,exports.default=p,exports.getRegisteredKeyHandlers=s,exports.initKeyboardControls=r,exports.registerKeyHandler=a,exports.setupCommonControls=l,exports.unregisterKeyHandler=u;
@@ -1 +0,0 @@
1
- "use strict";function r(r){if(!r)return null;var n=r.toUpperCase().replace(/\s+COMPONENT$/i,"").replace(/\s+/g,"-").replace(/[^A-Z0-9\-]/g,"");return n=n.replace(/-COMPONENT$/,"")}Object.defineProperty(exports,"u",{value:!0}),exports.findObjectByHardcodedUuid=function(n,u){if(!n||!u)return null;var e=null;return n.traverse(function(n){var t;if(!e)if(n.uuid!==u)if((null===(t=n.userData)||void 0===t?void 0:t.originalUuid)!==u){if(n.name&&r(n.name)===u)return void(e=n)}else e=n;else e=n}),e},exports.generateUuidFromName=r,exports.getHardcodedUuid=function(n){var u;return n?null!==(u=n.userData)&&void 0!==u&&u.originalUuid?n.userData.originalUuid:n.uuid&&!n.uuid.includes("-")&&n.uuid.length>10?n.uuid:n.name?r(n.name):null:null},exports.namesGenerateSameUuid=function(n,u){var e=r(n),t=r(u);return e&&t&&e===t};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("three"),n=require("../node_modules/@2112-lab/pathfinder/dist/index.esm.js"),i=require("./debugLogger.js"),r=require("./nameUtils.js");function a(e){if(e&&e.t)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var s=a(t),u=function(){return e.createClass(function t(n){e.classCallCheck(this,t),this.component=n,this.pathfinder=null,this.crosscubeTextureSet=null,this.pathfinderVersionInfo=null},[{key:"getPathfinderVersionInfo",value:(c=e.asyncToGenerator(e.regenerator().m(function t(){var n;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(!this.pathfinderVersionInfo){e.n=1;break}return e.a(2,this.pathfinderVersionInfo);case 1:return n={version:"1.0.15",detectionMethod:"hardcoded-fallback",timestamp:(new Date).toISOString()},this.pathfinderVersionInfo=n,e.a(2,n)}},t,this)})),function(){return c.apply(this,arguments)})},{key:"logPathfinderVersion",value:(o=e.asyncToGenerator(e.regenerator().m(function t(){var n,r,a,s=arguments;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return n=s.length>0&&void 0!==s[0]?s[0]:"Unknown Context",e.p=1,e.n=2,this.getPathfinderVersionInfo();case 2:r=e.v,i.pathfinderLogger.info("[".concat(n,"] Pathfinder Module Information:"),{version:r.version,detectionMethod:r.detectionMethod,context:n,timestamp:r.timestamp,pathfinderInstance:!!this.pathfinder}),e.n=4;break;case 3:e.p=3,a=e.v,i.pathfinderLogger.error("[".concat(n,"] Failed to get pathfinder version:"),a);case 4:return e.a(2)}},t,this,[[1,3]])})),function(){return o.apply(this,arguments)})},{key:"getPathColor",value:function(e){var t=["#468e49","#245e29","#2e80d2","#1d51a1"];return t[e%t.length]}},{key:"initializePathfinder",value:(u=e.asyncToGenerator(e.regenerator().m(function t(i,r){var a,s;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return a=this.component,this.crosscubeTextureSet=r,e.n=1,this.logPathfinderVersion("Scene Loading");case 1:this.pathfinder=new n.Pathfinder(i),a.pathfinder=this.pathfinder,s=this.pathfinder.findPaths(),this.createPipePaths(s,r);case 2:return e.a(2)}},t,this)})),function(e,t){return u.apply(this,arguments)})},{key:"removeAllPaths",value:function(){var e=this.component,t=[];e.scene.traverse(function(e){e.name&&e.name.includes("Polyline")&&t.push(e)});for(var n=0,i=t;n<i.length;n++){var r=i[n];e.scene.remove(r),r.geometry&&r.geometry.dispose(),r.material&&(Array.isArray(r.material)?r.material.forEach(function(e){return e.dispose()}):r.material.dispose())}}},{key:"createPipeMaterial",value:function(t,n){if(t){var i=e.objectSpread2(e.objectSpread2({},t.config.materialProps),{},{color:this.getPathColor(n),map:t.textures.diffuse,normalMap:t.textures.normal,roughnessMap:t.textures.roughness,metalness:.2,roughness:.9,clearcoat:.2,clearcoatRoughness:.2,envMapIntensity:.6,reflectivity:.4});i.normalScale&&Array.isArray(i.normalScale)&&(i.normalScale=e.construct(s.Vector2,e.toConsumableArray(i.normalScale)));var r=new s.MeshPhysicalMaterial(i);return[r.map,r.normalMap,r.roughnessMap].filter(Boolean).forEach(function(e){e.wrapS=e.wrapT=s.RepeatWrapping,e.repeat.set(2*t.config.repeat.x,2*t.config.repeat.y)}),r}return new s.MeshPhysicalMaterial({color:this.getPathColor(n),metalness:.9,roughness:.7,clearcoat:.1,clearcoatRoughness:.3,envMapIntensity:1.5,reflectivity:.3})}},{key:"createPipePaths",value:function(e,t){var n=this,i=this.component;e.forEach(function(e,r){if(e.path){var a=new s.Object3D;a.name="Polyline ".concat(e.from,"-").concat(e.to);for(var u=n.createPipeMaterial(t,r),o=0;o<e.path.length-1;o++){var c=e.path[o],h=e.path[o+1],l=(new s.Vector3).subVectors(h,c),f=l.length(),v=new s.CylinderGeometry(.1,.1,f,8,1,!1),d=new s.Mesh(v,u);d.position.copy(c).add(h).multiplyScalar(.5);var p=new s.Quaternion,w=new s.Vector3(0,1,0);if(p.setFromUnitVectors(w,l.normalize()),d.quaternion.copy(p),d.castShadow=!0,d.receiveShadow=!0,a.add(d),o<e.path.length-2){var y=e.path[o+1],g=e.path[o+2],m=l.normalize(),k=(new s.Vector3).subVectors(g,y).normalize(),P=Math.acos(m.dot(k));if(Math.abs(P-Math.PI/2)<.1){var b=new s.SphereGeometry(.1,16,16),M=new s.Mesh(b,u);M.position.copy(h),M.castShadow=!0,M.receiveShadow=!0,a.add(M)}}}a.name="Polyline",i.scene.add(a)}})}},{key:"recomputeWorldBoundingBoxes",value:function(t){this.component.scene.traverse(function(n){if(n.isMesh){var i=null,a=function(t){var i,s=e.createForOfIteratorHelper(t);try{for(s.s();!(i=s.n()).done;){var u,o,c=i.value;if(c.uuid===n.uuid||c.uuid===(null===(u=n.userData)||void 0===u?void 0:u.originalUuid)||n.uuid===(null===(o=c.userData)||void 0===o?void 0:o.originalUuid))return c;if(n.name&&c.name){var h=r.generateUuidFromName(n.name),l=r.generateUuidFromName(c.name);if(h===l||h===c.uuid||l===n.uuid)return c}if(n.name&&c.name&&n.name===c.name)return c;if(c.children){var f=a(c.children);if(f)return f}}}catch(e){s.e(e)}finally{s.f()}return null};if(i=a(t.scene.object.children)){var u=(new s.Box3).setFromObject(n);i.userData||(i.userData={}),i.userData.worldBoundingBox={min:u.min.toArray(),max:u.max.toArray()}}}})}},{key:"updatePathfindingWithConnections",value:(a=e.asyncToGenerator(e.regenerator().m(function t(i){var r,a,s;return e.regenerator().w(function(t){for(;;)switch(t.n){case 0:if((r=this.component).currentSceneData){t.n=1;break}return t.a(2,!1);case 1:return this.removeAllPaths(),(a=JSON.parse(JSON.stringify(r.currentSceneData))).connections=e.toConsumableArray(i),t.n=2,this.logPathfinderVersion("Connections Update");case 2:return this.pathfinder=new n.Pathfinder(a),r.pathfinder=this.pathfinder,s=this.pathfinder.findPaths(),this.createPipePaths(s,this.crosscubeTextureSet),r.currentSceneData=a,t.a(2,!0)}},t,this)})),function(e){return a.apply(this,arguments)})},{key:"updatePathfindingAfterTransform",value:(t=e.asyncToGenerator(e.regenerator().m(function t(i){var r;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return this.removeAllPaths(),e.n=1,this.logPathfinderVersion("Transform Update");case 1:this.pathfinder=new n.Pathfinder(i),this.component.pathfinder=this.pathfinder,r=this.pathfinder.findPaths(),this.createPipePaths(r,this.crosscubeTextureSet);case 2:return e.a(2)}},t,this)})),function(e){return t.apply(this,arguments)})},{key:"dispose",value:function(){this.removeAllPaths(),this.pathfinder=null,this.crosscubeTextureSet=null,this.pathfinderVersionInfo=null,i.logger.info("PathfindingManager disposed")}}]);var t,a,u,o,c}();exports.PathfindingManager=u;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var t=require("../_virtual/_rollupPluginBabelHelpers.js");require("three");var i=require("./debugLogger.js"),e=function(){return t.createClass(function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t.classCallCheck(this,i),this.renderer=e,this.stats={fps:{current:0,average:0,min:1/0,max:0,history:[]},frameTime:{current:0,average:0,min:1/0,max:0,history:[]},memory:{geometries:0,textures:0,programs:0,heapUsed:0,heapTotal:0},drawCalls:{current:0,average:0,triangles:0,points:0,lines:0},gpu:{memoryUsage:0,extensions:[]},scene:{objects:0,lights:0,meshes:0,materials:0,visible:0}},this.frameCount=0,this.historySize=120,this.isRunning=!1,this.lastUpdateTime=0,this.warningThresholds={fps:30,frameTime:16,drawCalls:1e3,triangles:1e6,geometries:1e3,textures:100},this.callbacks={update:[],warning:[]},this.i=this.i.bind(this)},[{key:"start",value:function(){this.isRunning||(this.isRunning=!0,this.lastUpdateTime=performance.now(),this.h(),requestAnimationFrame(this.i),i.logger.info("Performance monitoring started"))}},{key:"stop",value:function(){this.isRunning=!1,i.logger.info("Performance monitoring stopped")}},{key:"reset",value:function(){this.stats.fps={current:0,average:0,min:1/0,max:0,history:[]},this.stats.frameTime={current:0,average:0,min:1/0,max:0,history:[]},this.frameCount=0,i.logger.info("Performance statistics reset")}},{key:"_update",value:function(){if(this.isRunning){var t=performance.now(),i=t-this.lastUpdateTime;this.lastUpdateTime=t;var e=1e3/i;this.o("frameTime",i),this.o("fps",e),this.renderer&&this.u(),this.l(),this.frameCount++,this.v(),this.m("update",this.stats),requestAnimationFrame(this.i)}}},{key:"_updateStat",value:function(t,i){if(this.stats[t]){var e=this.stats[t];e.current=i,e.min=Math.min(e.min,i),e.max=Math.max(e.max,i),e.history.push(i),e.history.length>this.historySize&&e.history.shift(),e.average=e.history.reduce(function(t,i){return t+i},0)/e.history.length}}},{key:"_getWebGLInfo",value:function(){var t,i,e,s,h;if(this.renderer){var r=this.renderer.info;this.stats.drawCalls.current=(null===(t=r.render)||void 0===t?void 0:t.calls)||0,this.stats.drawCalls.triangles=(null===(i=r.render)||void 0===i?void 0:i.triangles)||0,this.stats.drawCalls.history||(this.stats.drawCalls.history=[]),this.stats.drawCalls.history.push(this.stats.drawCalls.current),this.stats.drawCalls.history.length>this.historySize&&this.stats.drawCalls.history.shift(),this.stats.drawCalls.average=this.stats.drawCalls.history.reduce(function(t,i){return t+i},0)/this.stats.drawCalls.history.length,this.stats.memory.geometries=(null===(e=r.memory)||void 0===e?void 0:e.geometries)||0,this.stats.memory.textures=(null===(s=r.memory)||void 0===s?void 0:s.textures)||0,this.stats.memory.programs=(null===(h=r.programs)||void 0===h?void 0:h.length)||0}}},{key:"_getMemoryInfo",value:function(){"undefined"!=typeof window&&window.performance&&window.performance.memory?(this.stats.memory.heapUsed=window.performance.memory.usedJSHeapSize,this.stats.memory.heapTotal=window.performance.memory.totalJSHeapSize):"undefined"!=typeof navigator&&navigator.deviceMemory&&(this.stats.memory.deviceMemory=navigator.deviceMemory)}},{key:"_getGPUInfo",value:function(){if(this.renderer){var t=this.renderer.getContext(),i=t.getExtension("WEBGL_debug_renderer_info");i?(this.stats.gpu.vendor=t.getParameter(i.UNMASKED_VENDOR_WEBGL),this.stats.gpu.renderer=t.getParameter(i.UNMASKED_RENDERER_WEBGL)):(this.stats.gpu.vendor=t.getParameter(t.VENDOR),this.stats.gpu.renderer=t.getParameter(t.RENDERER)),this.stats.gpu.extensions=t.getSupportedExtensions()}}},{key:"_checkWarnings",value:function(){var t=[];this.stats.fps.average<this.warningThresholds.fps&&t.push({type:"fps",message:"Low FPS: ".concat(this.stats.fps.average.toFixed(1)," (threshold: ").concat(this.warningThresholds.fps,")"),value:this.stats.fps.average,threshold:this.warningThresholds.fps}),this.stats.frameTime.average>this.warningThresholds.frameTime&&t.push({type:"frameTime",message:"High frame time: ".concat(this.stats.frameTime.average.toFixed(1),"ms (threshold: ").concat(this.warningThresholds.frameTime,"ms)"),value:this.stats.frameTime.average,threshold:this.warningThresholds.frameTime}),this.stats.drawCalls.average>this.warningThresholds.drawCalls&&t.push({type:"drawCalls",message:"High draw calls: ".concat(this.stats.drawCalls.average.toFixed(0)," (threshold: ").concat(this.warningThresholds.drawCalls,")"),value:this.stats.drawCalls.average,threshold:this.warningThresholds.drawCalls}),this.stats.drawCalls.triangles>this.warningThresholds.triangles&&t.push({type:"triangles",message:"High triangle count: ".concat(this.stats.drawCalls.triangles.toFixed(0)," (threshold: ").concat(this.warningThresholds.triangles,")"),value:this.stats.drawCalls.triangles,threshold:this.warningThresholds.triangles}),this.stats.memory.geometries>this.warningThresholds.geometries&&t.push({type:"geometries",message:"High geometry count: ".concat(this.stats.memory.geometries," (threshold: ").concat(this.warningThresholds.geometries,")"),value:this.stats.memory.geometries,threshold:this.warningThresholds.geometries}),this.stats.memory.textures>this.warningThresholds.textures&&t.push({type:"textures",message:"High texture count: ".concat(this.stats.memory.textures," (threshold: ").concat(this.warningThresholds.textures,")"),value:this.stats.memory.textures,threshold:this.warningThresholds.textures}),t.length>0&&this.m("warning",t)}},{key:"on",value:function(t,i){this.callbacks[t]&&this.callbacks[t].push(i)}},{key:"off",value:function(t,i){if(this.callbacks[t]){var e=this.callbacks[t].indexOf(i);-1!==e&&this.callbacks[t].splice(e,1)}}},{key:"_triggerCallbacks",value:function(t,i){this.callbacks[t]&&this.callbacks[t].forEach(function(t){try{t(i)}catch(t){}})}},{key:"logSummary",value:function(){return this.stats.gpu.renderer,this.stats}},{key:"exportData",value:function(){return{timestamp:(new Date).toISOString(),frameCount:this.frameCount,stats:JSON.parse(JSON.stringify(this.stats)),gpu:this.stats.gpu,warnings:this.p()}}},{key:"_getActiveWarnings",value:function(){var t=[];return this.stats.fps.average<this.warningThresholds.fps&&t.push({type:"fps",value:this.stats.fps.average}),this.stats.frameTime.average>this.warningThresholds.frameTime&&t.push({type:"frameTime",value:this.stats.frameTime.average}),this.stats.drawCalls.average>this.warningThresholds.drawCalls&&t.push({type:"drawCalls",value:this.stats.drawCalls.average}),this.stats.drawCalls.triangles>this.warningThresholds.triangles&&t.push({type:"triangles",value:this.stats.drawCalls.triangles}),this.stats.memory.geometries>this.warningThresholds.geometries&&t.push({type:"geometries",value:this.stats.memory.geometries}),this.stats.memory.textures>this.warningThresholds.textures&&t.push({type:"textures",value:this.stats.memory.textures}),t}},{key:"setWarningThresholds",value:function(t){Object.assign(this.warningThresholds,t)}}])}(),s=function(){return t.createClass(function i(e,s){var h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"dark";t.classCallCheck(this,i),this.monitor=e,this.container=s,this.theme=h,this.isVisible=!1,this.element=null,this.graphs={},this.k(),this._()},[{key:"_createUI",value:function(){var t=this;this.element=document.createElement("div"),this.element.className="performance-monitor",this.element.style.position="absolute",this.element.style.top="10px",this.element.style.right="10px",this.element.style.zIndex="1000",this.element.style.padding="10px",this.element.style.borderRadius="5px",this.element.style.fontFamily="monospace",this.element.style.fontSize="12px",this.element.style.lineHeight="1.2",this.element.style.transition="opacity 0.3s ease",this.element.style.userSelect="none",this.setTheme(this.theme);var i=document.createElement("div");i.style.display="flex",i.style.justifyContent="space-between",i.style.marginBottom="5px";var e=document.createElement("div");e.textContent="Performance Monitor",e.style.fontWeight="bold";var s=document.createElement("div");s.textContent="×",s.style.cursor="pointer",s.style.paddingLeft="10px",s.onclick=function(){return t.hide()},i.appendChild(e),i.appendChild(s),this.element.appendChild(i);var h=document.createElement("div");this.statsElement=h,this.element.appendChild(h),this.element.style.opacity="0",this.element.style.pointerEvents="none"}},{key:"setTheme",value:function(t){this.theme=t,"dark"===t?(this.element.style.backgroundColor="rgba(0, 0, 0, 0.7)",this.element.style.color="white",this.element.style.boxShadow="0 0 10px rgba(0, 0, 0, 0.5)"):(this.element.style.backgroundColor="rgba(255, 255, 255, 0.85)",this.element.style.color="black",this.element.style.boxShadow="0 0 10px rgba(0, 0, 0, 0.1)")}},{key:"_setupUpdateLoop",value:function(){var t=this;setInterval(function(){if(t.isVisible&&t.monitor){var i="",e=t.M(t.monitor.stats.fps.current,60,30);i+='<div>FPS: <span style="color: '.concat(e,'">').concat(t.monitor.stats.fps.current.toFixed(1),"</span> "),i+="(avg: ".concat(t.monitor.stats.fps.average.toFixed(1),")</div>");var s=t.M(16-t.monitor.stats.frameTime.current,0,16,!0);i+='<div>Frame: <span style="color: '.concat(s,'">').concat(t.monitor.stats.frameTime.current.toFixed(1),"ms</span></div>");var h=t.M(1e3-t.monitor.stats.drawCalls.current,0,1e3,!0);i+='<div>Calls: <span style="color: '.concat(h,'">').concat(t.monitor.stats.drawCalls.current,"</span> "),i+="Tris: ".concat(t.P(t.monitor.stats.drawCalls.triangles),"</div>"),i+="<div>Geo: ".concat(t.monitor.stats.memory.geometries," "),i+="Tex: ".concat(t.monitor.stats.memory.textures,"</div>"),t.statsElement.innerHTML=i}},500)}},{key:"_getMetricColor",value:function(t,i,e){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],h=(t-e)/(i-e);h=Math.max(0,Math.min(1,h)),s&&(h=1-h);var r=h<.5?255:Math.floor(255*(1-h)*2),a=h>.5?255:Math.floor(255*h*2);return"rgb(".concat(r,", ").concat(a,", ").concat(0,")")}},{key:"_formatNumber",value:function(t){return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":t.toString()}},{key:"show",value:function(){this.isVisible||(this.isVisible=!0,this.element.style.opacity="1",this.element.style.pointerEvents="auto",this.element.parentElement||this.container.appendChild(this.element))}},{key:"hide",value:function(){this.isVisible&&(this.isVisible=!1,this.element.style.opacity="0",this.element.style.pointerEvents="none")}},{key:"toggle",value:function(){this.isVisible?this.hide():this.show()}},{key:"dispose",value:function(){this.element.parentElement&&this.element.parentElement.removeChild(this.element)}}])}(),h={PerformanceMonitor:e,PerformanceUI:s};exports.PerformanceMonitor=e,exports.PerformanceUI=s,exports.default=h;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),n=require("./nameUtils.js"),t=function(){return e.createClass(function n(t){e.classCallCheck(this,n),this.component=t},[{key:"exportSceneData",value:function(){var t=this;if(!this.component.scene)return null;var r=function(e){var t,o,l,i,u,a,s,c,d=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e||null!==(t=e.name)&&void 0!==t&&t.includes("Polyline")||null!==(o=e.userData)&&void 0!==o&&o.isBrickWall||null!==(l=e.userData)&&void 0!==l&&l.isBaseGround||null!==(i=e.userData)&&void 0!==i&&i.isBaseGrid||e.isLight||null!==(u=e.userData)&&void 0!==u&&u.isTransformControls||e.isTransformControls||e.type&&e.type.includes("TransformControls"))return null;if(!(d||null!==(a=e.userData)&&void 0!==a&&a.componentType))return null;if(d&&(null===(s=e.userData)||void 0===s||!s.forExport))return null;if(d&&null!==(c=e.userData)&&void 0!==c&&c.forExport);var v,p,f,h={uuid:n.getHardcodedUuid(e),name:e.name||"Unnamed Object",type:e.type||"Object3D"};(e.userData&&Object.keys(e.userData).length>0&&(h.userData={},Object.keys(e.userData).forEach(function(n){"worldBoundingBox"!==n&&"isBaseGround"!==n&&"isBrickWall"!==n&&"isBaseGrid"!==n&&"isTransformControls"!==n&&(h.userData[n]=e.userData[n])}),0===Object.keys(h.userData).length&&delete h.userData),h.position={x:parseFloat(e.position.x.toFixed(6)),y:parseFloat(e.position.y.toFixed(6)),z:parseFloat(e.position.z.toFixed(6))},h.rotation={x:parseFloat((e.rotation.x*(180/Math.PI)).toFixed(6)),y:parseFloat((e.rotation.y*(180/Math.PI)).toFixed(6)),z:parseFloat((e.rotation.z*(180/Math.PI)).toFixed(6))},h.scale={x:parseFloat(e.scale.x.toFixed(6)),y:parseFloat(e.scale.y.toFixed(6)),z:parseFloat(e.scale.z.toFixed(6))},e.geometry)&&(null!==(v=e.name)&&void 0!==v&&v.toLowerCase().includes("connector")?h.geometry="CONNECTOR-GEO":null!==(p=e.name)&&void 0!==p&&p.toLowerCase().includes("gateway")?h.geometry="GATEWAY-GEO":null!==(f=e.userData)&&void 0!==f&&f.libraryId&&(h.geometry="".concat(e.userData.libraryId,"-GEO")));if(e.children&&e.children.length>0){var x=[];e.children.forEach(function(e){var n=r(e,!0);n&&x.push(n)}),x.length>0&&(h.children=x)}return h},o=[];this.component.scene.children.forEach(function(e){var n=r(e);n&&o.push(n)});var l,i,u={connections:(i=[],null!==(l=t.component.currentSceneData)&&void 0!==l&&l.connections&&i.push.apply(i,e.toConsumableArray(t.component.currentSceneData.connections)),i),scene:{object:{uuid:"PLANT-SCENE",name:"Scene",type:"Scene",children:o}}};return u.o={exportedAt:(new Date).toISOString(),exportedFrom:"SceneViewerEnhanced",version:"1.0.0",objectCount:o.length},u}},{key:"downloadSceneExport",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=this.exportSceneData();if(!n)return!1;e||(e="cp-export.json");try{var t=JSON.stringify(n,null,2);if("undefined"!=typeof window&&"undefined"!=typeof document){var r=new Blob([t],{type:"application/json"}),o=URL.createObjectURL(r),l=document.createElement("a");return l.href=o,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(o),!0}return!1}catch(e){return!1}}},{key:"exportSceneDataAsString",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.exportSceneData();return n?e?JSON.stringify(n,null,2):JSON.stringify(n):null}},{key:"getExportMetadata",value:function(){var e;if(!this.component.scene)return null;var n=0;return this.component.scene.traverse(function(){return n++}),{totalObjects:n,hasCurrentSceneData:!!this.component.currentSceneData,connectionsCount:(null===(e=this.component.currentSceneData)||void 0===e||null===(e=e.connections)||void 0===e?void 0:e.length)||0,exportTimestamp:(new Date).toISOString()}}}])}();exports.SceneExportManager=t,exports.default=t,exports.getSceneExportManager=function(e){return new t(e)};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"i",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),n=require("three"),r=require("./debugLogger.js");function i(e){if(e&&e.i)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}}),n.default=e,Object.freeze(n)}var t,o,a,u,s=i(n);function l(){return c.apply(this,arguments)}function c(){return(c=e.asyncToGenerator(e.regenerator().m(function n(){var r,s,l,c;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if("undefined"==typeof window){e.n=15;break}return e.p=1,e.p=2,e.n=3,Promise.resolve().then(function(){return require("../node_modules/three/examples/jsm/controls/OrbitControls.js")});case 3:r=e.v,t=r.OrbitControls,e.n=9;break;case 4:if(e.p=4,e.v,e.p=5,"string"!=typeof window.__orbitControlsCustomPath){e.n=7;break}return e.n=6,function(e){return Promise.resolve().then(function(){return i(require(e))})}(window.__orbitControlsCustomPath);case 6:s=e.v,t=s.OrbitControls;case 7:e.n=9;break;case 8:e.p=8,e.v;case 9:return e.p=9,e.n=10,Promise.resolve().then(function(){return require("../node_modules/three/examples/jsm/loaders/GLTFLoader.js")});case 10:l=e.v,o=l.GLTFLoader,e.n=12;break;case 11:e.p=11,e.v;case 12:return e.n=13,Promise.resolve().then(function(){return require("./performanceMonitor.js")});case 13:c=e.v,a=c.PerformanceMonitor,u=c.PerformanceUI,e.n=15;break;case 14:e.p=14,e.v;case 15:return e.a(2)}},n,null,[[9,11],[5,8],[2,4],[1,14]])}))).apply(this,arguments)}var f=function(){return e.createClass(function n(r){e.classCallCheck(this,n),this.component=r,this.textureLoader=null,this.gltfLoader=null,l()},[{key:"initializeScene",value:(c=e.asyncToGenerator(e.regenerator().m(function n(){var i,t,o,a,u,l;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(o=this.component){e.n=1;break}return r.logger.error("Cannot initialize scene: component not available"),e.a(2);case 1:if(o.scene=new s.Scene,a=(null===(i=o.$refs)||void 0===i||null===(i=i.container)||void 0===i?void 0:i.getBoundingClientRect())||{width:800,height:600},u=a.width,l=a.height,o.camera=new s.PerspectiveCamera(50,u/l,.01,1e3),o.camera.position.set(-8,4,9),null===(t=o.$refs)||void 0===t||!t.container){e.n=2;break}return e.n=2,this.setupRenderer(o.$refs.container,u,l);case 2:return r.logger.info("Scene and camera initialized"),e.a(2,{scene:o.scene,camera:o.camera})}},n,this)})),function(){return c.apply(this,arguments)})},{key:"setupRenderer",value:(i=e.asyncToGenerator(e.regenerator().m(function n(i,t,a){var u,c;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(u=this.component){e.n=1;break}return r.logger.error("Cannot setup renderer: component not available"),e.a(2,null);case 1:if(t&&a||(c=i.getBoundingClientRect(),t=c.width,a=c.height),u.renderer=new s.WebGLRenderer({antialias:!0}),u.renderer.setSize(t,a),u.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),u.renderer.shadowMap.enabled=!0,u.renderer.shadowMap.type=s.PCFSoftShadowMap,u.renderer.physicallyCorrectLights=!0,u.renderer.outputColorSpace=s.SRGBColorSpace,u.renderer.toneMapping=s.LinearToneMapping,u.renderer.toneMappingExposure=1.5,i.appendChild(u.renderer.domElement),this.setupResizeHandler(),u.textureLoader=new s.TextureLoader,this.textureLoader=u.textureLoader,!o){e.n=2;break}u.gltfLoader=new o,this.gltfLoader=u.gltfLoader,e.n=4;break;case 2:return e.n=3,l();case 3:o&&(u.gltfLoader=new o,this.gltfLoader=u.gltfLoader);case 4:return r.logger.info("Renderer initialized"),e.a(2,u.renderer)}},n,this)})),function(e,n,r){return i.apply(this,arguments)})},{key:"setupControls",value:function(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.component;return o&&o.camera&&o.renderer?t?this.setupControlsInternal(e,i):(r.logger.info("OrbitControls not available, will try to import"),l().then(function(){t&&n.setupControlsInternal(e,i)}),null):(r.logger.error("Cannot setup controls: camera or renderer not available"),null)}},{key:"setupControlsInternal",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.component,o=e||i.renderer.domElement;return i.controls=new t(i.camera,o),i.controls.enableDamping=!1!==n.enableDamping,i.controls.dampingFactor=n.dampingFactor||.05,i.controls.screenSpacePanning=!1!==n.screenSpacePanning,i.controls.maxPolarAngle=n.maxPolarAngle||Math.PI/1.5,i.controls.minDistance=n.minDistance||2,i.controls.maxDistance=n.maxDistance||50,n.target&&i.controls.target.copy(n.target),n.autoRotate&&(i.controls.autoRotate=!0,i.controls.autoRotateSpeed=n.autoRotateSpeed||1),r.logger.info("Orbit controls initialized"),i.controls}},{key:"initializePerformanceMonitoring",value:(n=e.asyncToGenerator(e.regenerator().m(function n(){var i,t;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if((t=this.component)&&t.renderer){e.n=1;break}return r.logger.error("Cannot initialize performance monitoring: renderer not available"),e.a(2);case 1:if(a){e.n=3;break}return e.n=2,l();case 2:if(a){e.n=3;break}return r.logger.error("Performance monitoring not available"),e.a(2);case 3:return t.performanceMonitor=new a(t.renderer),null!==(i=t.$refs)&&void 0!==i&&i.container&&(t.performanceUI=new u(t.performanceMonitor,t.$refs.container,"light")),t.performanceMonitor.on("warning",function(e){}),t.performanceMonitor.start(),t.performanceUI&&t.performanceUI.show(),this.exposePerformanceMonitoringGlobally(),r.logger.info("Performance monitoring initialized"),e.a(2,{monitor:t.performanceMonitor,ui:t.performanceUI})}},n,this)})),function(){return n.apply(this,arguments)})},{key:"exposePerformanceMonitoringGlobally",value:function(){var e=this.component;e&&e.performanceMonitor&&"undefined"!=typeof window&&(window._performanceMonitor=e.performanceMonitor,window._performanceUI=e.performanceUI,window.performance3D={show:function(){var n;return null===(n=e.performanceUI)||void 0===n?void 0:n.show()},hide:function(){var n;return null===(n=e.performanceUI)||void 0===n?void 0:n.hide()},toggle:function(){var n,r,i;return null!==(n=e.performanceUI)&&void 0!==n&&n.isVisible?null===(r=e.performanceUI)||void 0===r?void 0:r.hide():null===(i=e.performanceUI)||void 0===i?void 0:i.show()},setTheme:function(n){var r;return null===(r=e.performanceUI)||void 0===r?void 0:r.setTheme(n)},log:function(){var n;return null===(n=e.performanceMonitor)||void 0===n?void 0:n.logSummary()},reset:function(){var n;return null===(n=e.performanceMonitor)||void 0===n?void 0:n.reset()},export:function(){var n;return null===(n=e.performanceMonitor)||void 0===n?void 0:n.exportData()},help:function(){}},r.logger.info("Performance monitoring exposed to global scope"))}},{key:"setupResizeHandler",value:function(){var e,n=this.component;if(n&&null!==(e=n.$refs)&&void 0!==e&&e.container){var i=function(){if(n.renderer&&n.camera){var e=n.$refs.container,r=e.clientWidth,i=e.clientHeight;n.camera.aspect=r/i,n.camera.updateProjectionMatrix(),n.renderer.setSize(r,i),n.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2))}};i(),window.addEventListener("resize",i),this.t=i,r.logger.info("Resize handler initialized")}}},{key:"cleanupResizeHandler",value:function(){this.t&&(window.removeEventListener("resize",this.t),this.t=null)}}]);var n,i,c}(),v=null;function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(!v||e&&v.component!==e)&&(v=new f(e)),v}function h(e,n){return w.apply(this,arguments)}function w(){return(w=e.asyncToGenerator(e.regenerator().m(function n(r,i){var t;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return t=d(r),e.n=1,t.initializeScene();case 1:if(!i){e.n=3;break}return e.n=2,t.setupRenderer(i);case 2:t.setupControls(i);case 3:return e.a(2,t)}},n)}))).apply(this,arguments)}var b={SceneInitializationManager:f,getSceneInitializationManager:d,setupScene:h};exports.SceneInitializationManager=f,exports.default=b,exports.getSceneInitializationManager=d,exports.setupScene=h;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"t",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js");function n(e){if(e&&e.t)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,Object.freeze(n)}var t=n(require("three"));function r(e){if(e.startsWith("/")&&(e=e.substring(1)),"undefined"!=typeof window){var n="undefined"!=typeof CentralPlantUtils;if("localhost"===window.location.hostname&&("3000"===window.location.port||"3001"===window.location.port))return"/".concat(e);if(n){var t="undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("src/textureConfig.js",document.baseURI).href;return new URL("./assets/".concat(e),t).href}var r="undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||new URL("src/textureConfig.js",document.baseURI).href;return new URL("../assets/".concat(e),r).href}return"assets/".concat(e)}var a={light_metal:{localPath:"textures/gravel_embedded_concrete_1k",path:"https://central-plant-assets.s3.us-east-1.amazonaws.com/textures/gravel_embedded_concrete_1k",files:{diffuse:"diffuse.jpg",normal:"normal.jpg",roughness:"rough.jpg"},repeat:{x:2,y:2},materialProps:{color:12105912,metalness:.3,roughness:.3,normalScale:[.4,.4],clearcoat:.3,clearcoatRoughness:.2,envMapIntensity:1.6,reflectivity:.5}},brick:{localPath:"textures/pavement_03_1k",path:"https://central-plant-assets.s3.us-east-1.amazonaws.com/textures/pavement_03_1k",files:{diffuse:"diffuse.jpg",normal:"normal.jpg",roughness:"rough.jpg"},repeat:{x:7.5,y:.75},materialProps:{color:10061960,roughness:.9,metalness:.1,normalScale:[1.5,1.5],bumpScale:.05,clearcoat:.05,clearcoatRoughness:.4}},gravel_embedded_concrete:{localPath:"textures/gravel_embedded_concrete_1k",path:"https://central-plant-assets.s3.us-east-1.amazonaws.com/textures/gravel_embedded_concrete_1k",files:{diffuse:"diffuse.jpg",normal:"normal.jpg",roughness:"rough.jpg"},repeat:{x:3,y:3},materialProps:{color:16777215,roughness:.9,metalness:.1,normalScale:[1,1],bumpScale:.1}}};function o(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:1,y:1};e||(e=new t.TextureLoader);try{var a=i(13421772),o=new Promise(function(a,o){e.load(n,function(e){!e.image||!(e.image instanceof HTMLImageElement&&e.image.complete)&&e.image instanceof HTMLImageElement?o(new Error("Texture loaded but image data not ready")):(void 0!==e.colorSpace?e.colorSpace=t.SRGBColorSpace:void 0!==e.encoding&&(e.encoding=t.sRGBEncoding),e.wrapS=t.RepeatWrapping,e.wrapT=t.RepeatWrapping,e.repeat.set(r.x,r.y),e.needsUpdate=!0,a(e))},function(e){if(e.lengthComputable)e.loaded,e.total},function(e){o(e)})});return a.wrapS=t.RepeatWrapping,a.wrapT=t.RepeatWrapping,a.repeat.set(r.x,r.y),a.loadPromise=o,a.url=n,o.then(function(e){Object.keys(e).forEach(function(n){["uuid","id","version","isTexture"].includes(n)||(a[n]=e[n])}),a.image=e.image,a.source=e.source,a.needsUpdate=!0}).catch(function(){}),a}catch(e){return i(14496563)}}function u(e,n){return c.apply(this,arguments)}function c(){return c=e.asyncToGenerator(e.regenerator().m(function n(u,c){var i,f,l,d,m,p,v,h,g,w,b,_,x,j,y,k,T,P;return e.regenerator().w(function(n){for(;;)switch(n.n){case 0:if(u){n.n=1;break}return n.a(2,new t.MeshStandardMaterial({color:11184810}));case 1:if(f=a[c]){n.n=2;break}return n.a(2,new t.MeshStandardMaterial({color:11184810}));case 2:return"function"==typeof(l=u.textureLoader||new t.TextureLoader).setCrossOrigin&&l.setCrossOrigin("anonymous"),d=f.repeat||{x:1,y:1},m={},p=function(){var n=e.asyncToGenerator(e.regenerator().m(function n(t){return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if("undefined"==typeof window){e.n=1;break}return e.a(2,new Promise(function(e){var n=new Image;n.onload=function(){return e(!0)},n.onerror=function(){return e(!1)},n.src=t,setTimeout(function(){return e(!1)},2e3)}));case 1:return e.a(2,!1)}},n)}));return function(e){return n.apply(this,arguments)}}(),v=function(){var n=e.asyncToGenerator(e.regenerator().m(function n(t){var a,u,s,i;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(f.files[t]){e.n=1;break}return e.a(2,null);case 1:a=[],f.localPath&&a.push(r("".concat(f.localPath,"/").concat(f.files[t]))),a.push("/textures/".concat(c,"_1k/").concat(f.files[t])),f.path&&a.push("".concat(f.path,"/").concat(f.files[t])),u=0,s=a;case 2:if(!(u<s.length)){e.n=6;break}return i=s[u],e.n=3,p(i);case 3:if(!e.v){e.n=4;break}return e.a(2,o(l,i,d));case 4:case 5:u++,e.n=2;break;case 6:return e.a(2,null)}},n)}));return function(e){return n.apply(this,arguments)}}(),h=Object.keys(f.files).map(function(){var n=e.asyncToGenerator(e.regenerator().m(function n(t){return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,v(t);case 1:return m[t]=e.v,e.a(2,{type:t,texture:m[t]})}},n)}));return function(e){return n.apply(this,arguments)}}()),n.n=3,Promise.all(h);case 3:if(Object.entries(m).forEach(function(n){var t=e.slicedToArray(n,2);t[0],t[1]}),g=Object.values(m).some(function(e){return null!==e}),g){n.n=4;break}return b=(null===(w=f.materialProps)||void 0===w?void 0:w.color)||11184810,n.a(2,new t.MeshStandardMaterial({color:b,roughness:.8,metalness:.2,side:t.DoubleSide}));case 4:for(_={},x=0,j=Object.entries(m);x<j.length;x++)y=e.slicedToArray(j[x],2),k=y[0],((T=y[1])&&s(T)||T)&&(_[k]=T);return(P=new t.MeshStandardMaterial(e.objectSpread2(e.objectSpread2({map:_.diffuse,normalMap:_.normal,roughnessMap:_.roughness,metalnessMap:_.metalness,aoMap:_.ao,displacementMap:_.displacement},f.materialProps),{},{side:t.DoubleSide}))).map&&s(P.map)||null===(i=f.materialProps)||void 0===i||!i.color||(P.color=new t.Color(f.materialProps.color)),P.needsUpdate=!0,u.scene&&u.scene.environment&&(P.envMap=u.scene.environment),Object.entries(_).forEach(function(n){var t=e.slicedToArray(n,2),r=(t[0],t[1]);r&&r.loadPromise&&r.loadPromise.then(function(){P.needsUpdate=!0}).catch(function(e){})}),n.a(2,P)}},n)})),c.apply(this,arguments)}function s(e){return!!e&&(!!e.image&&(e.image instanceof HTMLImageElement||e.image instanceof HTMLCanvasElement?e.image.width>0&&e.image.height>0:!(!e.image.data||!Array.isArray(e.image.data))&&e.image.data.length>0))}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:13421772,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,r=document.createElement("canvas");r.width=n,r.height=n;var a=r.getContext("2d");if(a){var o="#"+e.toString(16).padStart(6,"0");a.fillStyle=o,a.fillRect(0,0,n,n),a.fillStyle="#"+(e+2236962&16777215).toString(16),a.fillRect(0,0,n/2,n/2),a.fillRect(n/2,n/2,n/2,n/2)}var u=new t.CanvasTexture(r);return u.needsUpdate=!0,void 0!==u.colorSpace?u.colorSpace=t.SRGBColorSpace:void 0!==u.encoding&&(u.encoding=t.sRGBEncoding),u}function f(){return{version:t.REVISION,hasNewColorSpace:void 0!==t.SRGBColorSpace,hasOldEncoding:void 0!==t.sRGBEncoding,hasTextureLoader:"function"==typeof t.TextureLoader}}function l(e){if(e){e.traverse(function(e){e.isMesh&&e.material&&(Array.isArray(e.material)?e.material:[e.material]).forEach(function(e){e&&(e.needsUpdate=!0,e.map&&(e.map.needsUpdate=!0),e.normalMap&&(e.normalMap.needsUpdate=!0),e.roughnessMap&&(e.roughnessMap.needsUpdate=!0))})})}}var d={TEXTURE_SETS:a,createTexture:o,loadTextureSetAndCreateMaterial:u,checkThreeJSCompatibility:f,forceUpdateMaterials:l,hasValidImageData:s,createPlaceholderTexture:i};exports.TEXTURE_SETS=a,exports.checkThreeJSCompatibility=f,exports.createTexture=o,exports.default=d,exports.forceUpdateMaterials=l,exports.loadTextureSetAndCreateMaterial=u;