diff --git a/examples/robot_trajectory_scrubber.py b/examples/robot_trajectory_scrubber.py new file mode 100644 index 0000000..69e0bc7 --- /dev/null +++ b/examples/robot_trajectory_scrubber.py @@ -0,0 +1,466 @@ +from compas.geometry import Transformation, Scale, Box, Cylinder, Frame, Translation, Polyline +from compas.datastructures import Mesh as CompasMesh +from compas_fab.robots import RigidBody, RigidBodyState, JointTrajectory, JointTrajectoryPoint, ToolState +from compas_robots import Configuration, ToolModel +from compas_fab.robots.robot_library import RobotCellLibrary +from compas_threejs.materials import LineMaterial, Material, PhysicalMaterial +from compas.colors import Color + +from compas_threejs.viewer import Viewer +from compas_threejs.ui import Slider +from compas_threejs.ui import Timeline + +# 1. Setup Viewer +viewer = Viewer() + +# 2. Load the UR10e Robot Cell +robot_cell, cell_state = RobotCellLibrary.ur10e() +model = robot_cell.robot_model + +# 3. Create a Dummy Trajectory +trajectory_points = [] +joint_names = model.get_configurable_joint_names() +for i in range(101): + angle = (i / 100.0) * -1.57 # 0 to 90 degrees + trajectory_points.append(JointTrajectoryPoint( + joint_values=[angle, angle, angle, angle, angle, angle], + joint_types=[0, 0, 0, 0, 0, 0] + )) +trajectory = JointTrajectory(trajectory_points=trajectory_points, joint_names=joint_names) + +# ====================================================================== +# 3.5 [NEW] DEFINING DYNAMIC PICK AND PLACE DATA +# ====================================================================== +# Here we define exactly where the workpiece is at any given frame. +# - Frames 0 to 30: Rests on table +# - Frames 31 to 70: Attached to gripper +# - Frames 71+: Rests at assembly destination + +table_drop_frame = Frame([0.5, 0.0, 0.05], [1, 0, 0], [0, 1, 0]) +assembly_drop_frame = Frame([0.0, 0.6, 0.05], [1, 0, 0], [0, 1, 0]) +grasp_offset_frame = Frame([0, 0, 0.25], [1, 0, 0], [0, 1, 0]) # Offset relative to TCP + +pnp_data = { + "workpieces": { + "dynamic_brick": { + "states": [ + { + "start_frame": 0, + "end_frame": 30, # Exclusive (up to 29) + "parent": "world", + "transform": Transformation.from_frame(table_drop_frame) + }, + { + "start_frame": 30, + "end_frame": 70, + "parent": "my_gripper", # Attached to tool + "transform": Transformation.from_frame(grasp_offset_frame) + }, + { + "start_frame": 70, + "end_frame": 9999, # Arbitrary large number + "parent": "world", + "transform": Transformation.from_frame(assembly_drop_frame) + } + ] + } + } +} + +# ====================================================================== +# 4. INJECTING SCENE OBJECTS INTO CELL (Table & Tool) +# ====================================================================== +print("Injecting Table and Tool into RobotCell...") + +# A. The Table (RigidBody) +table_box = Box(1.0, 1.0, 0.5) +table_mesh = CompasMesh.from_shape(table_box) +table_rb = RigidBody.from_mesh(table_mesh) +table_rb.name = "main_table" + +table_frame = Frame([0, 0, -0.25], [1, 0, 0], [0, 1, 0]) + +robot_cell.rigid_body_models["main_table"] = table_rb +cell_state.rigid_body_states["main_table"] = RigidBodyState(frame=table_frame) + +# B. The Tool (ToolModel) +tool_mesh = CompasMesh.from_shape(Cylinder(0.025, 0.2)) +for v in tool_mesh.vertices(): + tool_mesh.vertex_attribute(v, 'z', tool_mesh.vertex_attribute(v, 'z') + 0.1) + +flange_name = model.get_end_effector_link_name() +tool_model = ToolModel( + tool_mesh, + Frame.worldXY(), + name="my_gripper", + connected_to=flange_name +) + +robot_cell.tool_models[tool_model.name] = tool_model +cell_state.tool_states[tool_model.name] = ToolState( + frame=None, + attached_to_group=robot_cell.main_group_name, + attachment_frame=Frame.worldXY() +) + +# ====================================================================== +# 5. EXTRACTING MESHES TO VIEWER +# ====================================================================== +link_id_map = {} + +def add_model_to_viewer(model_to_parse, name_prefix=""): + for link in model_to_parse.iter_links(): + unique_name = f"{name_prefix}{link.name}" + link_id_map[unique_name] = [] + for visual in link.visual: + shape = visual.geometry.shape + + T_scale = Scale.from_factors(shape.scale) if hasattr(shape, 'scale') and shape.scale else Transformation() + + # --- FIX 1: The Safe Origin Extraction (Stops the exploding robot!) --- + T_origin = Transformation() + frame = getattr(visual, 'init_frame', None) + if not frame: + origin = getattr(visual, 'origin', None) + if origin: + frame = getattr(origin, 'frame', origin) + if frame: + try: T_origin = Transformation.from_frame(frame) # noqa: E701 + except Exception: pass + # ---------------------------------------------------------------------- + + T_local = T_origin * T_scale + meshes_to_add = shape.meshes if hasattr(shape, 'meshes') else [shape] + for item in meshes_to_add: + if item is not None: + viewer.add_geometry(item) + link_id_map[unique_name].append({"geometry": item, "T_local": T_local}) + +# A. Extract Robot +add_model_to_viewer(model, name_prefix="") + +# B. Extract ALL Tools +for tool_id, tool_mod in robot_cell.tool_models.items(): + add_model_to_viewer(tool_mod, name_prefix=f"{tool_id}_") + +# C. Extract ALL RigidBodies +print("--- EXTRACTING RIGID BODIES ---") +for rb_name, rb_model in robot_cell.rigid_body_models.items(): + link_id_map[rb_name] = [] + rb_state = cell_state.rigid_body_states[rb_name] + + meshes_to_add = [] + + # 1. Strictly extract the Visual Meshes for rendering + if hasattr(rb_model, 'visual_meshes') and rb_model.visual_meshes: + for wrapped_item in rb_model.visual_meshes: + if hasattr(wrapped_item, 'mesh'): + meshes_to_add.append(wrapped_item.mesh) + elif hasattr(wrapped_item, 'geometry'): + meshes_to_add.append(wrapped_item.geometry) + else: + meshes_to_add.append(wrapped_item) + # Fallback just in case a simpler object only has the base '.mesh' property + elif hasattr(rb_model, 'mesh') and rb_model.mesh: + meshes_to_add.append(rb_model.mesh) + + # 2. Deduplicate and send to viewer + seen_guids = set() + for item in meshes_to_add: + if item is not None and hasattr(item, 'guid'): + guid_str = str(item.guid) + + if guid_str in seen_guids: + continue + seen_guids.add(guid_str) + + viewer.add_geometry(item) + link_id_map[rb_name].append({"geometry": item, "T_local": Transformation()}) + print(f"✅ Mapped RigidBody (Visual): {rb_name} (GUID: {guid_str})") + + if rb_state.frame: + T_world = Transformation.from_frame(rb_state.frame) + viewer.transform(item, T_world) + +# D. [NEW] Inject Dynamic Workpieces directly into the viewer +workpiece_box = Box(0.1, 0.1, 0.1) +workpiece_mesh = CompasMesh.from_shape(workpiece_box) +viewer.add_geometry(workpiece_mesh, PhysicalMaterial(color=Color(1.0, 0.5, 0.0))) + +# Add to the map so our callback can grab it easily +link_id_map["dynamic_brick"] = [{"geometry": workpiece_mesh, "T_local": Transformation()}] + +# ====================================================================== +# 6. STATIC TRACE & TCP TRIAD +# ====================================================================== +print("Calculating Tool Path Trace and Triad...") +tcp_points = [] +end_effector_name = model.get_end_effector_link_name() + +for point in trajectory.points: + cfg = Configuration( + joint_values=point.joint_values, + joint_types=point.joint_types, + joint_names=trajectory.joint_names + ) + frame = model.forward_kinematics(cfg, link_name=end_effector_name) + tip_point = frame.point + frame.zaxis.scaled(0.2) + tcp_points.append(tip_point) + +# --- A. Static Trace (Zero Lag, Native Geometry) --- +trace_line = Polyline(tcp_points) +# line_material = LineMaterial(color=Color(0.1, 0.1, 0.1), opacity=0.5) +# line_mat = LineMaterial() +# viewer.add_geometry(trace_line, line_material) +lines = trace_line.lines +num_lines = len(lines) + +# Break the polyline into segments to color them individually +for i, line in enumerate(lines): + # Calculate a simple gradient: Blue (Start) -> Purple -> Red (End) + r = i / num_lines + g = 0.0 + b = 1.0 - (i / num_lines) + + # Create a specific material for this segment + grad_material = LineMaterial(color=Color(r, g, b), opacity=0.5) + + # Add it statically to the viewer (Do NOT save the GUID, do NOT update in callback) + viewer.add_geometry(line, material=grad_material) + +# viewer.add_geometry(trace_line, PhysicalMaterial(color=Color(0.1, 0.1, 0.1))) + +# --- B. The TCP Triad ("Lines" built as 1mm Meshes so they can move!) --- +triad_objects = [] + +# 1mm radius makes them visually identical to lines, but WebGL can move them! +base_cyl = Cylinder(0.001, 0.15) + +# X-Axis (Points along X) -> Red +x_mesh = CompasMesh.from_shape(base_cyl) +T_x = Transformation.from_frame(Frame([0,0,0], [0,1,0], [0,0,1])) * Translation.from_vector([0, 0, 0.075]) +x_mesh.transform(T_x) + +# Y-Axis (Points along Y) -> Green +y_mesh = CompasMesh.from_shape(base_cyl) +T_y = Transformation.from_frame(Frame([0,0,0], [0,0,1], [1,0,0])) * Translation.from_vector([0, 0, 0.075]) +y_mesh.transform(T_y) + +# Z-Axis (Points along Z) -> Blue +z_mesh = CompasMesh.from_shape(base_cyl) +T_z = Translation.from_vector([0, 0, 0.075]) +z_mesh.transform(T_z) + +# Add to viewer with bright colors +viewer.add_geometry(x_mesh, PhysicalMaterial(color=Color(1.0, 0.0, 0.0))) +viewer.add_geometry(y_mesh, PhysicalMaterial(color=Color(0.0, 1.0, 0.0))) +viewer.add_geometry(z_mesh, PhysicalMaterial(color=Color(0.0, 0.0, 1.0))) + +# Save their GUIDs so the callback can move them +for mesh in [x_mesh, y_mesh, z_mesh]: + if hasattr(mesh, 'guid') and mesh.guid: + triad_objects.append(mesh) + +# ====================================================================== +# 6.5 THE GHOST ROBOT & TOOL (Target Configuration) +# ====================================================================== +print("Spawning Ghost Robot and Tool at target state...") + +# 1. Create a transparent material +ghost_mat = Material(color=Color(0.5, 0.7, 0.9), opacity = 0.2) + +# 2. Get the very last point in the trajectory +final_point = trajectory.points[-1] +final_cfg = Configuration( + joint_values=final_point.joint_values, + joint_types=final_point.joint_types, + joint_names=trajectory.joint_names +) + +# --- A. Ghost Robot Links --- +for link in model.iter_links(): + link_frame = model.forward_kinematics(final_cfg, link_name=link.name) + T_link = Transformation.from_frame(link_frame) + + for visual in link.visual: + shape = visual.geometry.shape + + T_scale = Scale.from_factors(shape.scale) if hasattr(shape, 'scale') and shape.scale else Transformation() + T_origin = Transformation() + frame = getattr(visual, 'init_frame', None) + if not frame: + origin = getattr(visual, 'origin', None) + if origin: + frame = getattr(origin, 'frame', origin) + if frame: + try: T_origin = Transformation.from_frame(frame) + except Exception: pass + + T_local = T_origin * T_scale + meshes_to_add = shape.meshes if hasattr(shape, 'meshes') else [shape] + + for item in meshes_to_add: + if item is not None: + ghost_mesh = item.copy() + ghost_mesh.transform(T_link * T_local) + viewer.add_geometry(ghost_mesh, material=ghost_mat) + +# --- B. Ghost Tool Links --- +for tool_name, t_state in cell_state.tool_states.items(): + t_model = robot_cell.tool_models[tool_name] + parent_link = t_model.connected_to + + parent_frame = model.forward_kinematics(final_cfg, link_name=parent_link) + T_parent = Transformation.from_frame(parent_frame) + T_attach = Transformation.from_frame(t_state.attachment_frame) if t_state.attachment_frame else Transformation() + + for t_link in t_model.iter_links(): + for visual in t_link.visual: + shape = visual.geometry.shape + + T_scale = Scale.from_factors(shape.scale) if hasattr(shape, 'scale') and shape.scale else Transformation() + T_origin = Transformation() + frame = getattr(visual, 'init_frame', None) + if not frame: + origin = getattr(visual, 'origin', None) + if origin: + frame = getattr(origin, 'frame', origin) + if frame: + try: T_origin = Transformation.from_frame(frame) + except Exception: pass + + T_local = T_origin * T_scale + meshes_to_add = shape.meshes if hasattr(shape, 'meshes') else [shape] + + for item in meshes_to_add: + if item is not None: + ghost_tool_mesh = item.copy() + # Final Pos = Final Flange * Mounting Offset * Local Mesh Offset + ghost_tool_mesh.transform(T_parent * T_attach * T_local) + viewer.add_geometry(ghost_tool_mesh, material=ghost_mat) + +# ====================================================================== +# 7. THE CALLBACK +# ====================================================================== +def scrub_robot(value): + val = value[0] if isinstance(value, list) else value + frame_index = int(val) + point = trajectory.points[frame_index] + + + + config = Configuration( + joint_values=point.joint_values, + joint_types=point.joint_types, + joint_names=trajectory.joint_names + ) + + full_config = cell_state.robot_configuration.merged(config) + + # A. Update Robot Links + for link in model.iter_links(): + link_name = link.name + if link_name in link_id_map and link_id_map[link_name]: + link_frame = model.forward_kinematics(full_config, link_name=link_name) + T_link = Transformation.from_frame(link_frame) + for mesh_data in link_id_map[link_name]: + viewer.transform(mesh_data['geometry'], T_link * mesh_data['T_local']) + + # B. Update Tool Links based on Cell State + for tool_name, t_state in cell_state.tool_states.items(): + t_model = robot_cell.tool_models[tool_name] + parent_link = t_model.connected_to + + parent_frame = model.forward_kinematics(config, link_name=parent_link) + T_parent = Transformation.from_frame(parent_frame) + T_attach = Transformation.from_frame(t_state.attachment_frame) if t_state.attachment_frame else Transformation() + + for t_link in t_model.iter_links(): + unique_name = f"{tool_name}_{t_link.name}" + if unique_name in link_id_map: + for mesh_data in link_id_map[unique_name]: + T_final = T_parent * T_attach * mesh_data['T_local'] + viewer.transform(mesh_data['geometry'], T_final) + + # C. Update RigidBody Links + for rb_name, rb_state in cell_state.rigid_body_states.items(): + if rb_name not in link_id_map: + continue + + # Is it picked up by a tool? (Dynamic Pick-and-Place!) + if getattr(rb_state, 'attached_to_tool', None): + tool_name = rb_state.attached_to_tool + t_model = robot_cell.tool_models[tool_name] + + flange_frame = model.forward_kinematics(config, link_name=t_model.connected_to) + T_flange = Transformation.from_frame(flange_frame) + + T_attach = Transformation.from_frame(rb_state.attachment_frame) if rb_state.attachment_frame else Transformation() + for mesh_data in link_id_map[rb_name]: + viewer.transform(mesh_data['geometry'], T_flange * T_attach) + + # D. [NEW] Update Dynamic Workpieces + for wp_name, data in pnp_data["workpieces"].items(): + if wp_name not in link_id_map: + continue + + # 1. Find the active state for the current frame + current_state = None + for state in data["states"]: + if state["start_frame"] <= frame_index < state["end_frame"]: + current_state = state + break + + if not current_state: + continue + + T_state = current_state["transform"] + + # 2. Determine the parent matrix + if current_state["parent"] == "world": + # If resting on a table, the final transform is just its state transform + T_final = T_state + else: + # If attached to a tool, multiply TCP * ToolAttachOffset * StateTransform + tool_name = current_state["parent"] + t_model = robot_cell.tool_models[tool_name] + + # Get robot flange matrix + flange_frame = model.forward_kinematics(full_config, link_name=t_model.connected_to) + T_flange = Transformation.from_frame(flange_frame) + + # Get tool mounting offset + t_state = cell_state.tool_states[tool_name] + T_tool_attach = Transformation.from_frame(t_state.attachment_frame) if t_state.attachment_frame else Transformation() + + T_final = T_flange * T_tool_attach * T_state + + # 3. Apply the matrix override + for mesh_data in link_id_map[wp_name]: + viewer.transform(mesh_data['geometry'], T_final * mesh_data['T_local']) + + # E. Update TCP Triad (Only 3 updates per frame!) + flange_frame = model.forward_kinematics(config, link_name=end_effector_name) + T_flange = Transformation.from_frame(flange_frame) + T_tcp = T_flange * Translation.from_vector([0, 0, 0.2]) + for guid in triad_objects: + viewer.transform(guid, T_tcp) + +# ====================================================================== +# 8. Add UI and Launch +# ====================================================================== +slider = Slider( + label="Scrub Trajectory", min=0, max=len(trajectory.points) - 1, step=1, + default_value=0, action=scrub_robot +) +timeline = Timeline( + total_time=len(trajectory.points) * 0.1, # Assuming each point is 0.1s apart + step=0.1, + value=0.0, + action= scrub_robot) # Convert time back to frame index + +# viewer.add_ui_element(slider) +viewer.add_ui_element(timeline) +scrub_robot([0]) + +viewer.start(show=True) diff --git a/frontend/compas_threejs/package-lock.json b/frontend/compas_threejs/package-lock.json index 07f31b5..066fb0b 100644 --- a/frontend/compas_threejs/package-lock.json +++ b/frontend/compas_threejs/package-lock.json @@ -4021,9 +4021,9 @@ } }, "node_modules/tailwind-merge": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.4.0.tgz", - "integrity": "sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.5.0.tgz", + "integrity": "sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A==", "license": "MIT", "funding": { "type": "github", diff --git a/frontend/compas_threejs/src/App.vue b/frontend/compas_threejs/src/App.vue index 4ca019b..4708361 100644 --- a/frontend/compas_threejs/src/App.vue +++ b/frontend/compas_threejs/src/App.vue @@ -6,6 +6,8 @@
+ + \ No newline at end of file diff --git a/frontend/compas_threejs/src/store/store.ts b/frontend/compas_threejs/src/store/store.ts index 6cb8820..48501ea 100644 --- a/frontend/compas_threejs/src/store/store.ts +++ b/frontend/compas_threejs/src/store/store.ts @@ -17,3 +17,16 @@ export const pickerEnabled = reactive({ value: true }); export const pickerMode = reactive({ value: "translate" }); export const showEdges = reactive({ value: false }); + +export const trajectoryState = reactive({ + id: "", + isVisible: false, + currentTime: [0.0], + totalTime: 10.0, + step: 0.01, + data: null as any, + isPlaying: false, + isLooping: false, + speedMultiplier: 1.0, + cameraMode: 'free', // Options: 'free', 'look', 'follow' +}); \ No newline at end of file diff --git a/frontend/compas_threejs/src/viewer/geometry_manager.ts b/frontend/compas_threejs/src/viewer/geometry_manager.ts index 40b6508..7f8b8d2 100644 --- a/frontend/compas_threejs/src/viewer/geometry_manager.ts +++ b/frontend/compas_threejs/src/viewer/geometry_manager.ts @@ -67,6 +67,7 @@ export function geometryManager(obj: any) { // INITIAL CREATION // Since it's already a Mesh, we can just add it + newMesh.name = guid; scene.add(newMesh); SCENE_GEOMETRIES[guid] = newMesh; @@ -99,15 +100,15 @@ function abstractGeometryManager(obj: any) { return; } - // GEOMETRY - if (geometry instanceof THREE.Line || geometry instanceof THREE.Points) { - geometry.material = material; - } else if ( - geometry instanceof THREE.ArrowHelper || - geometry instanceof THREE.PlaneHelpers - ) { - geometry.setColor(material.color); - } + // GEOMETRY + if (geometry instanceof THREE.Line || geometry instanceof THREE.Points) { + geometry.material = material; + } else if ( + geometry instanceof THREE.ArrowHelper || + geometry instanceof THREE.PlaneHelper + ) { + geometry.setColor(material.color); + } scene.add(geometry); SCENE_GEOMETRIES[guid] = geometry; @@ -128,10 +129,10 @@ export function updateMaterial( return; } - if ( - object instanceof THREE.ArrowHelper || - object instanceof THREE.PlaneHelpers - ) { - object.setColor(material.color); - } + if ( + object instanceof THREE.ArrowHelper || + object instanceof THREE.PlaneHelper + ) { + object.setColor(material.color); + } } diff --git a/frontend/compas_threejs/src/viewer/material_manager.ts b/frontend/compas_threejs/src/viewer/material_manager.ts index e5216a6..f99e37d 100644 --- a/frontend/compas_threejs/src/viewer/material_manager.ts +++ b/frontend/compas_threejs/src/viewer/material_manager.ts @@ -44,6 +44,9 @@ function buildStandardMaterial(data: { [key: string]: any }) { emissive: parseInt(emissive), emissiveIntensity: data.emissive_intensity.value, flatShading: data.flat_shading.value, + opacity: data.opacity.value, + transparent: data.opacity.value < 1.0, + depthWrite: data.opacity.value >= 1.0, wireframe: data.wireframe.value, side: THREE.DoubleSide, }); @@ -58,6 +61,9 @@ function buildLineMaterial(data: { const material = new THREE.LineBasicMaterial({ color: parseInt(color), + opacity: data.opacity.value, + transparent: data.opacity.value < 1.0, + depthWrite: data.opacity.value >= 1.0, }); return material; } @@ -112,6 +118,9 @@ function buildPhysicalMaterial(data: { data.iridescence_thickness_start.value, data.iridescence_thickness_end.value, ], + opacity: data.opacity.value, + transparent: data.opacity.value < 1.0, + depthWrite: data.opacity.value >= 1.0, reflectivity: data.reflectivity.value, sheen: data.sheen.value, sheenColor: parseInt(sheenColor), diff --git a/frontend/compas_threejs/src/viewer/scene_manager.ts b/frontend/compas_threejs/src/viewer/scene_manager.ts index 68d3786..c65f958 100644 --- a/frontend/compas_threejs/src/viewer/scene_manager.ts +++ b/frontend/compas_threejs/src/viewer/scene_manager.ts @@ -1,7 +1,7 @@ import * as THREE from "three"; import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js"; import { initializePicker, PickHelper } from "./picker"; -import { pickerEnabled } from "@/store/store"; +import { pickerEnabled, trajectoryState } from "@/store/store"; import { SCENE_GEOMETRIES } from "./geometry_manager"; import { GEOMETRY_MATERIALS } from "./material_manager"; import { showEdges } from "@/store/store"; @@ -89,11 +89,57 @@ scene.add(axesHelper); const picker = new PickHelper(); initializePicker(picker); -// The Loop +// ========================================== +// --- DYNAMIC CAMERA ENGINE --- +// ========================================== +let trackingTarget: THREE.Object3D | null = null; +let followOffset: THREE.Vector3 | null = null; +let previousMode: string = 'free'; + function animate() { - requestAnimationFrame(animate); - controls.update(); - renderer.render(scene, camera); + requestAnimationFrame(animate); + + const currentMode = trajectoryState.cameraMode; + + if (currentMode !== 'free') { + // 1. Find the TCP Triad (Red Cylinder) if we haven't already + if (!trackingTarget) { + scene.traverse((child) => { + if (child instanceof THREE.Mesh && child.material && child.material.color) { + if (child.material.color.r === 1 && child.material.color.g === 0 && child.material.color.b === 0) { + trackingTarget = child; + } + } + }); + } + + if (trackingTarget) { + const targetPos = new THREE.Vector3(); + trackingTarget.getWorldPosition(targetPos); + + if (currentMode === 'look') { + controls.target.lerp(targetPos, 0.08); + followOffset = null; + } + + else if (currentMode === 'follow') { + if (previousMode !== 'follow' || !followOffset) { + followOffset = new THREE.Vector3().subVectors(camera.position, controls.target); + } + controls.target.lerp(targetPos, 0.08); + const desiredCameraPos = new THREE.Vector3().addVectors(controls.target, followOffset); + camera.position.lerp(desiredCameraPos, 0.08); + } + } + } else { + trackingTarget = null; + followOffset = null; + } + + previousMode = currentMode; + + controls.update(); + renderer.render(scene, camera); } animate(); diff --git a/frontend/compas_threejs/src/viewer/transform_manager.ts b/frontend/compas_threejs/src/viewer/transform_manager.ts new file mode 100644 index 0000000..a3b91af --- /dev/null +++ b/frontend/compas_threejs/src/viewer/transform_manager.ts @@ -0,0 +1,84 @@ +import * as THREE from "three"; +import { scene } from "./scene_manager"; + +const DEBUG_TRANSFORMS = false; + +/** + * Robust matrix extraction that handles both JSON arrays + * and Protobuf-encoded Uint8Arrays. + */ +function extractMatrix(data: any): number[] | null { + // 1. Safety check: if data itself is missing, stop here + if (!data) return null; + + // 2. Case: Already a flat array (JSON fallback) + if (Array.isArray(data) && data.length === 16) return data; + + // 3. Case: Protobuf structure (find the 16 numbers) + if (typeof data === 'object') { + + // If data.message doesn't exist, 'value' becomes undefined instead of crashing + const message = data?.message || data; + const value = message?.value; + + if (value instanceof Uint8Array) { + const matrix: number[] = []; + const view = new DataView(value.buffer, value.byteOffset, value.byteLength); + + try { + for (let i = 0; i < 16; i++) { + matrix.push(view.getFloat64(5 + (i * 13), true)); + } + return matrix; + } catch (e) { + } + } + + // 4. Final attempt: Recursively search nested properties + for (const key in data) { + if (Object.prototype.hasOwnProperty.call(data, key)) { + if (data[key] !== null && typeof data[key] === 'object') { + const result = extractMatrix(data[key]); + if (result) return result; + } + } + } + } + return null; +} + +export function transformManager(data: { [key: string]: any }) { + const targetGuid = String(data.guid?.value || data.guid || "").trim(); + const matrixArray = extractMatrix(data.matrix); + + let targetObject: THREE.Object3D | undefined; + scene.traverse((child) => { + if (child.name && String(child.name).trim() === targetGuid) { + targetObject = child; + } + }); + + if (targetObject && matrixArray && matrixArray.length === 16) { + const matrix = new THREE.Matrix4(); + + /** + * COMPAS to Three.js mapping. + * COMPAS: Row-Major [m00, m01, m02, m03, ...] + * Three.js .set(): Takes Row-Major arguments. + */ + matrix.set( + matrixArray[0], matrixArray[1], matrixArray[2], matrixArray[3], + matrixArray[4], matrixArray[5], matrixArray[6], matrixArray[7], + matrixArray[8], matrixArray[9], matrixArray[10], matrixArray[11], + matrixArray[12], matrixArray[13], matrixArray[14], matrixArray[15] + ); + + targetObject.matrixAutoUpdate = false; + targetObject.matrix.copy(matrix); + targetObject.updateMatrixWorld(true); + + if (DEBUG_TRANSFORMS) { + console.log(`✅ Successfully transformed ${targetGuid}`); + } + } +} \ No newline at end of file diff --git a/src/compas_threejs/materials/line_material.py b/src/compas_threejs/materials/line_material.py index 449c352..a28ab20 100644 --- a/src/compas_threejs/materials/line_material.py +++ b/src/compas_threejs/materials/line_material.py @@ -15,8 +15,9 @@ class LineMaterial(GenericMaterial): The color of the line. Default is blue. """ - def __init__(self, color: Color = Color.blue(), linewidth: int = 2): + def __init__(self, color: Color = Color.blue(), linewidth: int = 2, opacity: float = 1.0): self.color = color + self.opacity = opacity self._geometry_guid = "" self.guid = str(uuid4()) @@ -26,5 +27,6 @@ def as_dict(self) -> dict: "type": "line_material", "geometry_guid": self._geometry_guid, "color": self.color.hex, + "opacity": self.opacity, "guid": self.guid, } diff --git a/src/compas_threejs/materials/material.py b/src/compas_threejs/materials/material.py index fe668f2..f77572a 100644 --- a/src/compas_threejs/materials/material.py +++ b/src/compas_threejs/materials/material.py @@ -35,6 +35,7 @@ def __init__( emissive: Color = Color.black(), emissive_intensity: float = 0, flat_shading: bool = False, + opacity: float = 1, wireframe: bool = False, **kwargs, ): @@ -46,6 +47,7 @@ def __init__( self.emissive_intensity = emissive_intensity self.flat_shading = flat_shading self.wireframe = wireframe + self.opacity = opacity self._geometry_guid = "" self.guid = str(uuid4()) @@ -60,6 +62,7 @@ def as_dict(self) -> dict: "emissive": self.emissive.hex, "emissive_intensity": self.emissive_intensity, "flat_shading": self.flat_shading, + "opacity": self.opacity, "wireframe": self.wireframe, "guid": self.guid, } @@ -124,6 +127,16 @@ def flat_shading(self, value: bool): raise TypeError("flat_shading must be a boolean") self._flat_shading = value + @property + def opacity(self) -> float: + return self._opacity + + @opacity.setter + def opacity(self, value: float): + if not (0.0 <= value <= 1.0): + raise ValueError("Opacity must be between 0 and 1") + self._opacity = value + @property def wireframe(self) -> bool: return self._wireframe diff --git a/src/compas_threejs/materials/physical_material.py b/src/compas_threejs/materials/physical_material.py index 33bf48e..23f0950 100644 --- a/src/compas_threejs/materials/physical_material.py +++ b/src/compas_threejs/materials/physical_material.py @@ -15,6 +15,7 @@ def __init__( emissive: Color = Color.black(), emissive_intensity: float = 0, flat_shading: bool = False, + opacity: float = 1.0, wireframe: bool = False, anisotropy: float = 0.0, anisotropy_rotation: float = 0.0, @@ -44,6 +45,7 @@ def __init__( self.emissive = emissive self.emissive_intensity = emissive_intensity self.flat_shading = flat_shading + self.opacity = opacity self.wireframe = wireframe self.anisotropy = anisotropy self.anisotropy_rotation = anisotropy_rotation @@ -79,6 +81,7 @@ def as_dict(self) -> dict: "emissive": self.emissive.hex, "emissive_intensity": self.emissive_intensity, "flat_shading": self.flat_shading, + "opacity": self.opacity, "wireframe": self.wireframe, "anisotropy": self.anisotropy, "anisotropy_rotation": self.anisotropy_rotation, @@ -247,7 +250,7 @@ def iridescence_thickness_range(self, value: list): "iridescence_thickness_range minimum value must not exceed maximum value" ) self._iridescence_thickness_range = value - + @property def reflectivity(self) -> float: """Degree of reflectivity, from 0.0 to 1.0. Default is 0.5, which corresponds to an index-of-refraction of 1.5. diff --git a/src/compas_threejs/ui/__init__.py b/src/compas_threejs/ui/__init__.py index a7f5e10..9a0d069 100644 --- a/src/compas_threejs/ui/__init__.py +++ b/src/compas_threejs/ui/__init__.py @@ -1,5 +1,6 @@ from .button import Button from .number_field import NumberField from .slider import Slider +from .timeline import Timeline -__all__ = ["Button", "Slider", "NumberField"] +__all__ = ["Button", "Slider", "Timeline", "NumberField"] diff --git a/src/compas_threejs/ui/timeline.py b/src/compas_threejs/ui/timeline.py new file mode 100644 index 0000000..7ce203c --- /dev/null +++ b/src/compas_threejs/ui/timeline.py @@ -0,0 +1,49 @@ +import uuid +from typing import Optional + +from .ui_element import UIElement + + +class Timeline(UIElement): + """A dedicated timeline component for scrubbing through time-based data. + + Parameters + ---------- + total_time : float + The maximum time (in seconds) of the trajectory. + step : float, optional + The scrub increment step size. Default is 0.01. + value : float, optional + The initial time value. Default is 0.0. + action : callable, optional + The callback function to execute when the timeline is scrubbed. + """ + + def __init__( + self, + total_time: float, + step: float = 0.01, + value: float = 0.0, + action = None, + label: Optional[str] = None, + **kwargs + ): + super().__init__(**kwargs) + + self.guid = str(uuid.uuid4()) + self.total_time = total_time + self.step = step + self.value = value + self.action = action + self.label = label + + def as_dict(self): + return { + "dispatch": "ui", + "type": "timeline", + "guid": self.guid, + "total_time": self.total_time, + "step": self.step, + "value": self.value, + "label": self.label + } \ No newline at end of file diff --git a/src/compas_threejs/viewer/frontend/assets/index.css b/src/compas_threejs/viewer/frontend/assets/index.css index 97d6a61..fb22e43 100644 --- a/src/compas_threejs/viewer/frontend/assets/index.css +++ b/src/compas_threejs/viewer/frontend/assets/index.css @@ -1 +1 @@ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-bold:700;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.top-1\/2{top:50%}.right-0{right:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.z-50{z-index:50}.z-1000{z-index:1000}.z-\[4000\]{z-index:4000}.z-\[4100\]{z-index:4100}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-full{height:100%}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-8{width:calc(var(--spacing)*8)}.w-72{width:calc(var(--spacing)*72)}.w-84{width:calc(var(--spacing)*84)}.w-\[80\%\]{width:80%}.w-fit{width:fit-content}.w-full{width:100%}.min-w-5{min-width:calc(var(--spacing)*5)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-input{border-color:var(--input)}.border-primary{border-color:var(--primary)}.bg-background{background-color:var(--background)}.bg-destructive{background-color:var(--destructive)}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-5{padding:calc(var(--spacing)*5)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.text-center{text-align:center}.font-sans{font-family:var(--font-sans)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.whitespace-nowrap{white-space:nowrap}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.underline-offset-4{text-underline-offset:4px}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\]{transition-property:background-color,color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media(hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}.hover\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-20:disabled{opacity:.2}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[orientation\=horizontal\]\:h-1\.5[data-orientation=horizontal]{height:calc(var(--spacing)*1.5)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing)*44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing)*1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}@media(hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\:not\(\[class\*\=\\\'size-\\\'\]\)\]\:size-3 svg:not([class*="'size-'"]){width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=decrement\]\]\:pl-5>[data-slot=input]:has([data-slot=decrement]){padding-left:calc(var(--spacing)*5)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=increment\]\]\:pr-5>[data-slot=input]:has([data-slot=increment]){padding-right:calc(var(--spacing)*5)}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:color-mix(in oklab,var(--background)20%,transparent)}}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:text-background{color:var(--background)}[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:color-mix(in oklab,var(--background)10%,transparent)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--button-hover:oklch(100% 0 0/0)}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}:root{font-feature-settings:"liga" 1,"calt" 1;font-family:Inter,sans-serif}@supports (font-variation-settings:normal){:root{font-family:InterVariable,sans-serif}}div#app{margin:0;padding:0}body,html{margin:0;padding:0;font-family:Inter,sans-serif;overflow:hidden}.theme{-webkit-backdrop-filter:blur(25px)saturate(180%);backdrop-filter:blur(25px)saturate(180%);background:linear-gradient(135deg,#ffffff26,#fff3);border-top:1px solid #fff3;border-bottom:-3px solid #dcdcdc66;border-left:1px solid #fff3;border-right:-3px solid #e1e1e14d;box-shadow:0 8px 32px #0000004d,inset 4px 4px 10px 2px #ffffffb3,inset -4px -4px 10px 2px #0000001a}*{scrollbar-width:thin;scrollbar-color:#888 transparent}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}div.right-bar[data-v-97adc036]{position:fixed;top:0;right:0;height:100vh;display:flex;flex-direction:column;padding:20px;width:30vw;max-width:300px;min-width:250px}div.object-info[data-v-97adc036]{z-index:1000;padding:20px;max-width:400px;border-radius:10px;height:100%;margin:0;right:0%;transition:transform .4s cubic-bezier(.4,0,.2,1);display:flex;flex-direction:column}div.is-hidden[data-v-97adc036]{transform:translate(+150%)}div#data-container[data-v-97adc036]{position:relative;display:flex;flex-direction:column;overflow-y:auto;gap:30px}div.item[data-v-97adc036]{display:flex;flex-direction:column;align-items:left}h1.section-title[data-v-97adc036]{margin-bottom:10px;background:#ffffff1a;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);padding:5px 5px 5px 10px;border-radius:10px;box-shadow:1px 1px 3px #03030333 inset,-1px -1px 3px #ffffffe6 inset}div.data-entry[data-v-97adc036]{margin-bottom:8px;padding:0 0 0 10px}Button#closeObjectBar[data-v-97adc036]{position:relative;align-self:flex-end;margin-top:auto}Button#openObjectBar[data-v-97adc036]{position:fixed;bottom:40px;right:40px;z-index:1;display:flex;visibility:hidden;transition:visibility 1s}Button#openObjectBar.is-hidden[data-v-97adc036]{opacity:1;visibility:visible}.save-view-icon[data-v-49e45054]{position:relative;width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center}.save-view-overlay[data-v-49e45054]{position:absolute;right:-4px;bottom:-2px;width:11px;height:11px;border-radius:999px;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--secondary-foreground) 92%,white);color:var(--secondary);border:1px solid color-mix(in srgb,var(--secondary) 65%,white)}.save-view-overlay-icon[data-v-49e45054]{display:inline-flex;width:5px;height:5px;min-width:5px;min-height:5px;stroke-width:5;transform:translateY(-.1px)}.saved-view-delete-pressed[data-v-95b0c23f]{color:#fff;background:color-mix(in srgb,var(--destructive) 85%,black);box-shadow:2px 2px 2px #00000059 inset,-1px -1px 1px #fff3 inset}.toolbar[data-v-8f0a01f7]{position:relative;display:flex;flex-direction:column;gap:12px;z-index:1001;border-radius:10px;padding:12px;margin:0;height:auto;width:100%}[data-v-8f0a01f7] .toolbar-group{display:grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:6px;padding-right:6px}[data-v-8f0a01f7] .button-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1;transform-origin:center}[data-v-8f0a01f7] .button-icon.front-icon{transform:scale(.75)}[data-v-8f0a01f7] .display-tools-wrapper{display:contents}[data-v-8f0a01f7] Button:hover{box-shadow:3px 3px 10px #0000004d}[data-v-8f0a01f7] Button.active{box-shadow:3px 3px 2px 1px #00000080 inset,-3px -3px 2px 2px #fff inset}div#openbar[data-v-2776f440]{position:relative;z-index:1000;width:100%;margin:0;height:auto;border-radius:10px;padding:20px;display:flex;flex-direction:column;gap:15px;align-items:left;height:100%;transition:transform .4s cubic-bezier(.4,0,.2,1);will-change:transform;overflow-y:auto}div#openbar.is-hidden[data-v-2776f440]{transform:translate(-150%)}.slider-container[data-v-2776f440]{display:flex;align-items:center;gap:10px}.dynamic-item[data-v-2776f440]{width:100%;display:flex;flex-direction:column;align-items:left;gap:8px}.dynamic-label[data-v-2776f440]{font-weight:500;font-size:15px;color:#333;padding:0}Button.mb-4[data-v-2776f440]{position:relative;margin:auto 0 0}Button.mb-5[data-v-2776f440]{margin:0;position:fixed;bottom:40px;left:40px;z-index:1;opacity:0;display:flex;visibility:hidden;transition:visibility 1s}Button.mb-5.is-hidden[data-v-2776f440]{opacity:1;visibility:visible}div#sidebar[data-v-ad216085]{position:fixed;top:0;left:0;height:100vh;display:flex;flex-direction:column;padding:20px;z-index:1000;row-gap:30px;width:30vw;max-width:300px;min-width:250px}div.app-container[data-v-13e012f1]{padding:0;margin:0;display:inline-flex;height:100vh;width:100%;overflow:hidden}div.three-container[data-v-13e012f1]{flex:1;position:fixed;overflow:hidden} +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-50:oklch(97% .014 254.604);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-900:oklch(37.9% .146 265.522);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.top-1\/2{top:50%}.right-0{right:calc(var(--spacing)*0)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.z-50{z-index:50}.z-1000{z-index:1000}.z-\[4000\]{z-index:4000}.z-\[4100\]{z-index:4100}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-full{height:100%}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-72{width:calc(var(--spacing)*72)}.w-84{width:calc(var(--spacing)*84)}.w-\[80\%\]{width:80%}.w-fit{width:fit-content}.w-full{width:100%}.min-w-5{min-width:calc(var(--spacing)*5)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-input{border-color:var(--input)}.border-primary{border-color:var(--primary)}.bg-background{background-color:var(--background)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-destructive{background-color:var(--destructive)}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/80{background-color:#fffc}@supports (color:color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white)80%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-5{padding:calc(var(--spacing)*5)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-4{padding-block:calc(var(--spacing)*4)}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-nowrap{white-space:nowrap}.text-blue-600{color:var(--color-blue-600)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.underline-offset-4{text-underline-offset:4px}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-ring\/50{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.ring-ring\/50{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[background-color\,color\,box-shadow\]{transition-property:background-color,color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media(hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:bg-zinc-200:hover{background-color:var(--color-zinc-200)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-zinc-900:hover{color:var(--color-zinc-900)}.hover\:underline:hover{text-decoration-line:underline}.hover\:ring-4:hover{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(4px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style:none;outline-style:none}@media(forced-colors:active){.focus-visible\:outline-hidden:focus-visible{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-20:disabled{opacity:.2}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[orientation\=horizontal\]\:h-1\.5[data-orientation=horizontal]{height:calc(var(--spacing)*1.5)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing)*44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing)*1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-blue-900\/20:is(.dark *){background-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-900\/20:is(.dark *){background-color:color-mix(in oklab,var(--color-blue-900)20%,transparent)}}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}.dark\:bg-white:is(.dark *){background-color:var(--color-white)}.dark\:bg-zinc-950\/80:is(.dark *){background-color:#09090bcc}@supports (color:color-mix(in lab,red,red)){.dark\:bg-zinc-950\/80:is(.dark *){background-color:color-mix(in oklab,var(--color-zinc-950)80%,transparent)}}.dark\:text-blue-400:is(.dark *){color:var(--color-blue-400)}.dark\:text-zinc-300:is(.dark *){color:var(--color-zinc-300)}.dark\:text-zinc-900:is(.dark *){color:var(--color-zinc-900)}@media(hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}.dark\:hover\:bg-zinc-800:is(.dark *):hover{background-color:var(--color-zinc-800)}.dark\:hover\:text-white:is(.dark *):hover{color:var(--color-white)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_svg\:not\(\[class\*\=\\\'size-\\\'\]\)\]\:size-3 svg:not([class*="'size-'"]){width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=decrement\]\]\:pl-5>[data-slot=input]:has([data-slot=decrement]){padding-left:calc(var(--spacing)*5)}.\[\&\>\[data-slot\=input\]\]\:has-\[\[data-slot\=increment\]\]\:pr-5>[data-slot=input]:has([data-slot=increment]){padding-right:calc(var(--spacing)*5)}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/20{background-color:color-mix(in oklab,var(--background)20%,transparent)}}[data-slot=tooltip-content] .\[\[data-slot\=tooltip-content\]_\&\]\:text-background{color:var(--background)}[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){[data-slot=tooltip-content] .dark\:\[\[data-slot\=tooltip-content\]_\&\]\:bg-background\/10:is(.dark *){background-color:color-mix(in oklab,var(--background)10%,transparent)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:oklch(20.5% 0 0);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(55.6% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:oklch(20.5% 0 0);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0);--button-hover:oklch(100% 0 0/0)}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(92.2% 0 0);--primary-foreground:oklch(20.5% 0 0);--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}:root{font-feature-settings:"liga" 1,"calt" 1;font-family:Inter,sans-serif}@supports (font-variation-settings:normal){:root{font-family:InterVariable,sans-serif}}div#app{margin:0;padding:0}body,html{margin:0;padding:0;font-family:Inter,sans-serif;overflow:hidden}.theme{-webkit-backdrop-filter:blur(25px)saturate(180%);backdrop-filter:blur(25px)saturate(180%);background:linear-gradient(135deg,#ffffff26,#fff3);border-top:1px solid #fff3;border-bottom:-3px solid #dcdcdc66;border-left:1px solid #fff3;border-right:-3px solid #e1e1e14d;box-shadow:0 8px 32px #0000004d,inset 4px 4px 10px 2px #ffffffb3,inset -4px -4px 10px 2px #0000001a}*{scrollbar-width:thin;scrollbar-color:#888 transparent}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}div.right-bar[data-v-97adc036]{position:fixed;top:0;right:0;height:100vh;display:flex;flex-direction:column;padding:20px;width:30vw;max-width:300px;min-width:250px}div.object-info[data-v-97adc036]{z-index:1000;padding:20px;max-width:400px;border-radius:10px;height:100%;margin:0;right:0%;transition:transform .4s cubic-bezier(.4,0,.2,1);display:flex;flex-direction:column}div.is-hidden[data-v-97adc036]{transform:translate(+150%)}div#data-container[data-v-97adc036]{position:relative;display:flex;flex-direction:column;overflow-y:auto;gap:30px}div.item[data-v-97adc036]{display:flex;flex-direction:column;align-items:left}h1.section-title[data-v-97adc036]{margin-bottom:10px;background:#ffffff1a;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);padding:5px 5px 5px 10px;border-radius:10px;box-shadow:1px 1px 3px #03030333 inset,-1px -1px 3px #ffffffe6 inset}div.data-entry[data-v-97adc036]{margin-bottom:8px;padding:0 0 0 10px}Button#closeObjectBar[data-v-97adc036]{position:relative;align-self:flex-end;margin-top:auto}Button#openObjectBar[data-v-97adc036]{position:fixed;bottom:40px;right:40px;z-index:1;display:flex;visibility:hidden;transition:visibility 1s}Button#openObjectBar.is-hidden[data-v-97adc036]{opacity:1;visibility:visible}.save-view-icon[data-v-49e45054]{position:relative;width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center}.save-view-overlay[data-v-49e45054]{position:absolute;right:-4px;bottom:-2px;width:11px;height:11px;border-radius:999px;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--secondary-foreground) 92%,white);color:var(--secondary);border:1px solid color-mix(in srgb,var(--secondary) 65%,white)}.save-view-overlay-icon[data-v-49e45054]{display:inline-flex;width:5px;height:5px;min-width:5px;min-height:5px;stroke-width:5;transform:translateY(-.1px)}.saved-view-delete-pressed[data-v-95b0c23f]{color:#fff;background:color-mix(in srgb,var(--destructive) 85%,black);box-shadow:2px 2px 2px #00000059 inset,-1px -1px 1px #fff3 inset}.toolbar[data-v-8f0a01f7]{position:relative;display:flex;flex-direction:column;gap:12px;z-index:1001;border-radius:10px;padding:12px;margin:0;height:auto;width:100%}[data-v-8f0a01f7] .toolbar-group{display:grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:6px;padding-right:6px}[data-v-8f0a01f7] .button-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1;transform-origin:center}[data-v-8f0a01f7] .button-icon.front-icon{transform:scale(.75)}[data-v-8f0a01f7] .display-tools-wrapper{display:contents}[data-v-8f0a01f7] Button:hover{box-shadow:3px 3px 10px #0000004d}[data-v-8f0a01f7] Button.active{box-shadow:3px 3px 2px 1px #00000080 inset,-3px -3px 2px 2px #fff inset}div#openbar[data-v-2776f440]{position:relative;z-index:1000;width:100%;margin:0;height:auto;border-radius:10px;padding:20px;display:flex;flex-direction:column;gap:15px;align-items:left;height:100%;transition:transform .4s cubic-bezier(.4,0,.2,1);will-change:transform;overflow-y:auto}div#openbar.is-hidden[data-v-2776f440]{transform:translate(-150%)}.slider-container[data-v-2776f440]{display:flex;align-items:center;gap:10px}.dynamic-item[data-v-2776f440]{width:100%;display:flex;flex-direction:column;align-items:left;gap:8px}.dynamic-label[data-v-2776f440]{font-weight:500;font-size:15px;color:#333;padding:0}Button.mb-4[data-v-2776f440]{position:relative;margin:auto 0 0}Button.mb-5[data-v-2776f440]{margin:0;position:fixed;bottom:40px;left:40px;z-index:1;opacity:0;display:flex;visibility:hidden;transition:visibility 1s}Button.mb-5.is-hidden[data-v-2776f440]{opacity:1;visibility:visible}div#sidebar[data-v-ad216085]{position:fixed;top:0;left:0;height:100vh;display:flex;flex-direction:column;padding:20px;z-index:1000;row-gap:30px;width:30vw;max-width:300px;min-width:250px}div.app-container[data-v-be99da2e]{padding:0;margin:0;display:inline-flex;height:100vh;width:100%;overflow:hidden}div.three-container[data-v-be99da2e]{flex:1;position:fixed;overflow:hidden} diff --git a/src/compas_threejs/viewer/frontend/assets/index.js b/src/compas_threejs/viewer/frontend/assets/index.js index ebd302c..f6ca71b 100644 --- a/src/compas_threejs/viewer/frontend/assets/index.js +++ b/src/compas_threejs/viewer/frontend/assets/index.js @@ -1,10 +1,10 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function yh(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Ut={},Do=[],Xi=()=>{},$v=()=>!1,Qc=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),bh=t=>t.startsWith("onUpdate:"),_n=Object.assign,Sh=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Db=Object.prototype.hasOwnProperty,Et=(t,e)=>Db.call(t,e),nt=Array.isArray,Io=t=>el(t)==="[object Map]",eu=t=>el(t)==="[object Set]",cm=t=>el(t)==="[object Date]",at=t=>typeof t=="function",$t=t=>typeof t=="string",wi=t=>typeof t=="symbol",Tt=t=>t!==null&&typeof t=="object",Yv=t=>(Tt(t)||at(t))&&at(t.then)&&at(t.catch),Jv=Object.prototype.toString,el=t=>Jv.call(t),Ib=t=>el(t).slice(8,-1),Kv=t=>el(t)==="[object Object]",tu=t=>$t(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Pa=yh(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),nu=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},Nb=/-\w/g,Xn=nu(t=>t.replace(Nb,e=>e.slice(1).toUpperCase())),Lb=/\B([A-Z])/g,ps=nu(t=>t.replace(Lb,"-$1").toLowerCase()),iu=nu(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ra=nu(t=>t?`on${iu(t)}`:""),ls=(t,e)=>!Object.is(t,e),fc=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},ru=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let um;const su=()=>um||(um=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Fr(t){if(nt(t)){const e={};for(let n=0;n{if(n){const i=n.split(Fb);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function xn(t){let e="";if($t(t))e=t;else if(nt(t))for(let n=0;ntl(n,e))}const Qv=t=>!!(t&&t.__v_isRef===!0),cs=t=>$t(t)?t:t==null?"":nt(t)||Tt(t)&&(t.toString===Jv||!at(t.toString))?Qv(t)?cs(t.value):JSON.stringify(t,e_,2):String(t),e_=(t,e)=>Qv(e)?e_(t,e.value):Io(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[i,r],s)=>(n[Ou(i,s)+" =>"]=r,n),{})}:eu(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Ou(n))}:wi(e)?Ou(e):Tt(e)&&!nt(e)&&!Kv(e)?String(e):e,Ou=(t,e="")=>{var n;return wi(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};let Tn;class t_{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Tn,!e&&Tn&&(this.index=(Tn.scopes||(Tn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e0&&--this._on===0&&(Tn=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(Ia){let e=Ia;for(Ia=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Da;){let e=Da;for(Da=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){t||(t=i)}e=n}}if(t)throw t}function a_(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function l_(t){let e,n=t.depsTail,i=n;for(;i;){const r=i.prevDep;i.version===-1?(i===n&&(n=r),Th(i),Gb(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}t.deps=e,t.depsTail=n}function Kd(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(c_(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function c_(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===za)||(t.globalVersion=za,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Kd(t))))return;t.flags|=2;const e=t.dep,n=Vt,i=Mi;Vt=t,Mi=!0;try{a_(t);const r=t.fn(t._value);(e.version===0||ls(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{Vt=n,Mi=i,l_(t),t.flags&=-3}}function Th(t,e=!1){const{dep:n,prevSub:i,nextSub:r}=t;if(i&&(i.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=i,t.nextSub=void 0),n.subs===t&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Th(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function Gb(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let Mi=!0;const u_=[];function Tr(){u_.push(Mi),Mi=!1}function Ar(){const t=u_.pop();Mi=t===void 0?!0:t}function dm(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Vt;Vt=void 0;try{e()}finally{Vt=n}}}let za=0;class Wb{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ou{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Vt||!Mi||Vt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Vt)n=this.activeLink=new Wb(Vt,this),Vt.deps?(n.prevDep=Vt.depsTail,Vt.depsTail.nextDep=n,Vt.depsTail=n):Vt.deps=Vt.depsTail=n,d_(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=Vt.depsTail,n.nextDep=void 0,Vt.depsTail.nextDep=n,Vt.depsTail=n,Vt.deps===n&&(Vt.deps=i)}return n}trigger(e){this.version++,za++,this.notify(e)}notify(e){wh();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Eh()}}}function d_(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)d_(i)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Cc=new WeakMap,Hs=Symbol(""),Zd=Symbol(""),Va=Symbol("");function An(t,e,n){if(Mi&&Vt){let i=Cc.get(t);i||Cc.set(t,i=new Map);let r=i.get(n);r||(i.set(n,r=new ou),r.map=i,r.key=n),r.track()}}function vr(t,e,n,i,r,s){const o=Cc.get(t);if(!o){za++;return}const a=l=>{l&&l.trigger()};if(wh(),e==="clear")o.forEach(a);else{const l=nt(t),c=l&&tu(n);if(l&&n==="length"){const u=Number(i);o.forEach((d,f)=>{(f==="length"||f===Va||!wi(f)&&f>=u)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(Va)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Hs)),Io(t)&&a(o.get(Zd)));break;case"delete":l||(a(o.get(Hs)),Io(t)&&a(o.get(Zd)));break;case"set":Io(t)&&a(o.get(Hs));break}}Eh()}function qb(t,e){const n=Cc.get(t);return n&&n.get(e)}function so(t){const e=wt(t);return e===t?e:(An(e,"iterate",Va),ni(t)?e:e.map(Ei))}function au(t){return An(t=wt(t),"iterate",Va),t}function Zr(t,e){return Cr(t)?Wo(Gs(t)?Ei(e):e):Ei(e)}const Xb={__proto__:null,[Symbol.iterator](){return Uu(this,Symbol.iterator,t=>Zr(this,t))},concat(...t){return so(this).concat(...t.map(e=>nt(e)?so(e):e))},entries(){return Uu(this,"entries",t=>(t[1]=Zr(this,t[1]),t))},every(t,e){return sr(this,"every",t,e,void 0,arguments)},filter(t,e){return sr(this,"filter",t,e,n=>n.map(i=>Zr(this,i)),arguments)},find(t,e){return sr(this,"find",t,e,n=>Zr(this,n),arguments)},findIndex(t,e){return sr(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return sr(this,"findLast",t,e,n=>Zr(this,n),arguments)},findLastIndex(t,e){return sr(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return sr(this,"forEach",t,e,void 0,arguments)},includes(...t){return ku(this,"includes",t)},indexOf(...t){return ku(this,"indexOf",t)},join(t){return so(this).join(t)},lastIndexOf(...t){return ku(this,"lastIndexOf",t)},map(t,e){return sr(this,"map",t,e,void 0,arguments)},pop(){return la(this,"pop")},push(...t){return la(this,"push",t)},reduce(t,...e){return fm(this,"reduce",t,e)},reduceRight(t,...e){return fm(this,"reduceRight",t,e)},shift(){return la(this,"shift")},some(t,e){return sr(this,"some",t,e,void 0,arguments)},splice(...t){return la(this,"splice",t)},toReversed(){return so(this).toReversed()},toSorted(t){return so(this).toSorted(t)},toSpliced(...t){return so(this).toSpliced(...t)},unshift(...t){return la(this,"unshift",t)},values(){return Uu(this,"values",t=>Zr(this,t))}};function Uu(t,e,n){const i=au(t),r=i[e]();return i!==t&&!ni(t)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=n(s.value)),s}),r}const $b=Array.prototype;function sr(t,e,n,i,r,s){const o=au(t),a=o!==t&&!ni(t),l=o[e];if(l!==$b[e]){const d=l.apply(t,s);return a?Ei(d):d}let c=n;o!==t&&(a?c=function(d,f){return n.call(this,Zr(t,d),f,t)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,t)}));const u=l.call(o,c,i);return a&&r?r(u):u}function fm(t,e,n,i){const r=au(t);let s=n;return r!==t&&(ni(t)?n.length>3&&(s=function(o,a,l){return n.call(this,o,a,l,t)}):s=function(o,a,l){return n.call(this,o,Zr(t,a),l,t)}),r[e](s,...i)}function ku(t,e,n){const i=wt(t);An(i,"iterate",Va);const r=i[e](...n);return(r===-1||r===!1)&&uu(n[0])?(n[0]=wt(n[0]),i[e](...n)):r}function la(t,e,n=[]){Tr(),wh();const i=wt(t)[e].apply(t,n);return Eh(),Ar(),i}const Yb=yh("__proto__,__v_isRef,__isVue"),f_=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(wi));function Jb(t){wi(t)||(t=String(t));const e=wt(this);return An(e,"has",t),e.hasOwnProperty(t)}class h_{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,i){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(r?s?x_:__:s?v_:g_).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=nt(e);if(!r){let l;if(o&&(l=Xb[n]))return l;if(n==="hasOwnProperty")return Jb}const a=Reflect.get(e,n,jt(e)?e:i);if((wi(n)?f_.has(n):Yb(n))||(r||An(e,"get",n),s))return a;if(jt(a)){const l=o&&tu(n)?a:a.value;return r&&Tt(l)?Pc(l):l}return Tt(a)?r?Pc(a):ri(a):a}}class p_ extends h_{constructor(e=!1){super(!1,e)}set(e,n,i,r){let s=e[n];const o=nt(e)&&tu(n);if(!this._isShallow){const c=Cr(s);if(!ni(i)&&!Cr(i)&&(s=wt(s),i=wt(i)),!o&&jt(s)&&!jt(i))return c||(s.value=i),!0}const a=o?Number(n)t,_l=t=>Reflect.getPrototypeOf(t);function eS(t,e,n){return function(...i){const r=this.__v_raw,s=wt(r),o=Io(s),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=r[t](...i),u=n?jd:e?Wo:Ei;return!e&&An(s,"iterate",l?Zd:Hs),_n(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function xl(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function tS(t,e){const n={get(r){const s=this.__v_raw,o=wt(s),a=wt(r);t||(ls(r,a)&&An(o,"get",r),An(o,"get",a));const{has:l}=_l(o),c=e?jd:t?Wo:Ei;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!t&&An(wt(r),"iterate",Hs),r.size},has(r){const s=this.__v_raw,o=wt(s),a=wt(r);return t||(ls(r,a)&&An(o,"has",r),An(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=wt(a),c=e?jd:t?Wo:Ei;return!t&&An(l,"iterate",Hs),a.forEach((u,d)=>r.call(s,c(u),c(d),o))}};return _n(n,t?{add:xl("add"),set:xl("set"),delete:xl("delete"),clear:xl("clear")}:{add(r){!e&&!ni(r)&&!Cr(r)&&(r=wt(r));const s=wt(this);return _l(s).has.call(s,r)||(s.add(r),vr(s,"add",r,r)),this},set(r,s){!e&&!ni(s)&&!Cr(s)&&(s=wt(s));const o=wt(this),{has:a,get:l}=_l(o);let c=a.call(o,r);c||(r=wt(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?ls(s,u)&&vr(o,"set",r,s):vr(o,"add",r,s),this},delete(r){const s=wt(this),{has:o,get:a}=_l(s);let l=o.call(s,r);l||(r=wt(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&vr(s,"delete",r,void 0),c},clear(){const r=wt(this),s=r.size!==0,o=r.clear();return s&&vr(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=eS(r,t,e)}),n}function lu(t,e){const n=tS(t,e);return(i,r,s)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?i:Reflect.get(Et(n,r)&&r in i?n:i,r,s)}const nS={get:lu(!1,!1)},iS={get:lu(!1,!0)},rS={get:lu(!0,!1)},sS={get:lu(!0,!0)},g_=new WeakMap,v_=new WeakMap,__=new WeakMap,x_=new WeakMap;function oS(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function aS(t){return t.__v_skip||!Object.isExtensible(t)?0:oS(Ib(t))}function ri(t){return Cr(t)?t:cu(t,!1,Kb,nS,g_)}function lS(t){return cu(t,!1,jb,iS,v_)}function Pc(t){return cu(t,!0,Zb,rS,__)}function Ns(t){return cu(t,!0,Qb,sS,x_)}function cu(t,e,n,i,r){if(!Tt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=aS(t);if(s===0)return t;const o=r.get(t);if(o)return o;const a=new Proxy(t,s===2?i:n);return r.set(t,a),a}function Gs(t){return Cr(t)?Gs(t.__v_raw):!!(t&&t.__v_isReactive)}function Cr(t){return!!(t&&t.__v_isReadonly)}function ni(t){return!!(t&&t.__v_isShallow)}function uu(t){return t?!!t.__v_raw:!1}function wt(t){const e=t&&t.__v_raw;return e?wt(e):t}function y_(t){return!Et(t,"__v_skip")&&Object.isExtensible(t)&&Zv(t,"__v_skip",!0),t}const Ei=t=>Tt(t)?ri(t):t,Wo=t=>Tt(t)?Pc(t):t;function jt(t){return t?t.__v_isRef===!0:!1}function Ve(t){return b_(t,!1)}function du(t){return b_(t,!0)}function b_(t,e){return jt(t)?t:new cS(t,e)}class cS{constructor(e,n){this.dep=new ou,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:wt(e),this._value=n?e:Ei(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,i=this.__v_isShallow||ni(e)||Cr(e);e=i?e:wt(e),ls(e,n)&&(this._rawValue=e,this._value=i?e:Ei(e),this.dep.trigger())}}function uS(t){t.dep&&t.dep.trigger()}function T(t){return jt(t)?t.value:t}function Dn(t){return at(t)?t():T(t)}const dS={get:(t,e,n)=>e==="__v_raw"?t:T(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return jt(r)&&!jt(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function S_(t){return Gs(t)?t:new Proxy(t,dS)}class fS{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ou,{get:i,set:r}=e(n.track.bind(n),n.trigger.bind(n));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function hS(t){return new fS(t)}function Pr(t){const e=nt(t)?new Array(t.length):{};for(const n in t)e[n]=M_(t,n);return e}class pS{constructor(e,n,i){this._object=e,this._key=n,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._raw=wt(e);let r=!0,s=e;if(!nt(e)||!tu(String(n)))do r=!uu(s)||ni(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=T(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&jt(this._raw[this._key])){const n=this._object[this._key];if(jt(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return qb(this._raw,this._key)}}class mS{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function gS(t,e,n){return jt(t)?t:at(t)?new mS(t):Tt(t)&&arguments.length>1?M_(t,e,n):Ve(t)}function M_(t,e,n){return new pS(t,e,n)}class vS{constructor(e,n,i){this.fn=e,this.setter=n,this._value=void 0,this.dep=new ou(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=za-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Vt!==this)return o_(this,!0),!0}get value(){const e=this.dep.track();return c_(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function _S(t,e,n=!1){let i,r;return at(t)?i=t:(i=t.get,r=t.set),new vS(i,r,n)}const yl={},Rc=new WeakMap;let Ls;function xS(t,e=!1,n=Ls){if(n){let i=Rc.get(n);i||Rc.set(n,i=[]),i.push(t)}}function yS(t,e,n=Ut){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,c=y=>r?y:ni(y)||r===!1||r===0?_r(y,1):_r(y);let u,d,f,h,g=!1,v=!1;if(jt(t)?(d=()=>t.value,g=ni(t)):Gs(t)?(d=()=>c(t),g=!0):nt(t)?(v=!0,g=t.some(y=>Gs(y)||ni(y)),d=()=>t.map(y=>{if(jt(y))return y.value;if(Gs(y))return c(y);if(at(y))return l?l(y,2):y()})):at(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){Tr();try{f()}finally{Ar()}}const y=Ls;Ls=u;try{return l?l(t,3,[h]):t(h)}finally{Ls=y}}:d=Xi,e&&r){const y=d,w=r===!0?1/0:r;d=()=>_r(y(),w)}const m=Mh(),p=()=>{u.stop(),m&&m.active&&Sh(m.effects,u)};if(s&&e){const y=e;e=(...w)=>{y(...w),p()}}let _=v?new Array(t.length).fill(yl):yl;const x=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(e){const w=u.run();if(r||g||(v?w.some((A,P)=>ls(A,_[P])):ls(w,_))){f&&f();const A=Ls;Ls=u;try{const P=[w,_===yl?void 0:v&&_[0]===yl?[]:_,h];_=w,l?l(e,3,P):e(...P)}finally{Ls=A}}}else u.run()};return a&&a(x),u=new r_(d),u.scheduler=o?()=>o(x,!1):x,h=y=>xS(y,!1,u),f=u.onStop=()=>{const y=Rc.get(u);if(y){if(l)l(y,4);else for(const w of y)w();Rc.delete(u)}},e?i?x(!0):_=u.run():o?o(x.bind(null,!0),!0):u.run(),p.pause=u.pause.bind(u),p.resume=u.resume.bind(u),p.stop=p,p}function _r(t,e=1/0,n){if(e<=0||!Tt(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,jt(t))_r(t.value,e,n);else if(nt(t))for(let i=0;i{_r(i,e,n)});else if(Kv(t)){for(const i in t)_r(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&_r(t[i],e,n)}return t}function nl(t,e,n,i){try{return i?t(...i):t()}catch(r){fu(r,e,n)}}function Ki(t,e,n,i){if(at(t)){const r=nl(t,e,n,i);return r&&Yv(r)&&r.catch(s=>{fu(s,e,n)}),r}if(nt(t)){const r=[];for(let s=0;s>>1,r=kn[i],s=Ha(r);s=Ha(n)?kn.push(t):kn.splice(SS(e),0,t),t.flags|=1,E_()}}function E_(){Dc||(Dc=w_.then(A_))}function MS(t){nt(t)?No.push(...t):jr&&t.id===-1?jr.splice(wo+1,0,t):t.flags&1||(No.push(t),t.flags|=1),E_()}function hm(t,e,n=ki+1){for(;nHa(n)-Ha(i));if(No.length=0,jr){jr.push(...e);return}for(jr=e,wo=0;wot.id==null?t.flags&2?-1:1/0:t.id;function A_(t){try{for(ki=0;ki{i._d&&Oc(-1);const s=Ic(e);let o;try{o=t(...r)}finally{Ic(s),i._d&&Oc(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function hc(t,e){if(gn===null)return t;const n=_u(gn),i=t.dirs||(t.dirs=[]);for(let r=0;r1)return n&&at(e)?e.call(i&&i.proxy):e}}const wS=Symbol.for("v-scx"),ES=()=>Lo(wS);function fi(t,e){return hu(t,null,e)}function P_(t,e){return hu(t,null,{flush:"post"})}function sn(t,e,n){return hu(t,e,n)}function hu(t,e,n=Ut){const{immediate:i,deep:r,flush:s,once:o}=n,a=_n({},n),l=e&&i||!e&&s!=="post";let c;if(qa){if(s==="sync"){const h=ES();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=Xi,h.resume=Xi,h.pause=Xi,h}}const u=Cn;a.call=(h,g,v)=>Ki(h,u,g,v);let d=!1;s==="post"?a.scheduler=h=>{wn(h,u&&u.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(h,g)=>{g?h():Ah(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=yS(t,e,a);return qa&&(c?c.push(f):l&&f()),f}function TS(t,e,n){const i=this.proxy,r=$t(t)?t.includes(".")?R_(i,t):()=>i[t]:t.bind(i,i);let s;at(e)?s=e:(s=e.handler,n=e);const o=sl(this),a=hu(r,s.bind(i),n);return o(),a}function R_(t,e){const n=e.split(".");return()=>{let i=t;for(let r=0;rt.__isTeleport,Na=t=>t&&(t.disabled||t.disabled===""),pm=t=>t&&(t.defer||t.defer===""),mm=t=>typeof SVGElement<"u"&&t instanceof SVGElement,gm=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Qd=(t,e)=>{const n=t&&t.to;return $t(n)?e?e(n):null:n},I_={name:"Teleport",__isTeleport:!0,process(t,e,n,i,r,s,o,a,l,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:g,createText:v,createComment:m}}=c,p=Na(e.props);let{shapeFlag:_,children:x,dynamicChildren:y}=e;if(t==null){const w=e.el=v(""),A=e.anchor=v("");h(w,n,i),h(A,n,i);const P=(S,M)=>{_&16&&u(x,S,M,r,s,o,a,l)},D=()=>{const S=e.target=Qd(e.props,g),M=ef(S,e,v,h);S&&(o!=="svg"&&mm(S)?o="svg":o!=="mathml"&&gm(S)&&(o="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(S),p||(P(S,M),pc(e,!1)))};p&&(P(n,A),pc(e,!0)),pm(e.props)?(e.el.__isMounted=!1,wn(()=>{D(),delete e.el.__isMounted},s)):D()}else{if(pm(e.props)&&t.el.__isMounted===!1){wn(()=>{I_.process(t,e,n,i,r,s,o,a,l,c)},s);return}e.el=t.el,e.targetStart=t.targetStart;const w=e.anchor=t.anchor,A=e.target=t.target,P=e.targetAnchor=t.targetAnchor,D=Na(t.props),S=D?n:A,M=D?w:P;if(o==="svg"||mm(A)?o="svg":(o==="mathml"||gm(A))&&(o="mathml"),y?(f(t.dynamicChildren,y,S,r,s,o,a),Nh(t,e,!0)):l||d(t,e,S,M,r,s,o,a,!1),p)D?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):bl(e,n,w,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const N=e.target=Qd(e.props,g);N&&bl(e,N,null,c,0)}else D&&bl(e,A,P,c,1);pc(e,p)}},remove(t,e,n,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:f}=t;if(d&&(r(c),r(u)),s&&r(l),o&16){const h=s||!Na(f);for(let g=0;gLa(v,e&&(nt(e)?e[m]:e),n,i,r));return}if(Oo(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&La(t,e,n,i.component.subTree);return}const s=i.shapeFlag&4?_u(i.component):i.el,o=r?null:s,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Ut?a.refs={}:a.refs,d=a.setupState,f=wt(d),h=d===Ut?$v:v=>vm(u,v)?!1:Et(f,v),g=(v,m)=>!(m&&vm(u,m));if(c!=null&&c!==l){if(_m(e),$t(c))u[c]=null,h(c)&&(d[c]=null);else if(jt(c)){const v=e;g(c,v.k)&&(c.value=null),v.k&&(u[v.k]=null)}}if(at(l))nl(l,a,12,[o,u]);else{const v=$t(l),m=jt(l);if(v||m){const p=()=>{if(t.f){const _=v?h(l)?d[l]:u[l]:g()||!t.k?l.value:u[t.k];if(r)nt(_)&&Sh(_,s);else if(nt(_))_.includes(s)||_.push(s);else if(v)u[l]=[s],h(l)&&(d[l]=u[l]);else{const x=[s];g(l,t.k)&&(l.value=x),t.k&&(u[t.k]=x)}}else v?(u[l]=o,h(l)&&(d[l]=o)):m&&(g(l,t.k)&&(l.value=o),t.k&&(u[t.k]=o))};if(o){const _=()=>{p(),Nc.delete(t)};_.id=-1,Nc.set(t,_),wn(_,n)}else _m(t),p()}}}function _m(t){const e=Nc.get(t);e&&(e.flags|=8,Nc.delete(t))}su().requestIdleCallback;su().cancelIdleCallback;const Oo=t=>!!t.type.__asyncLoader,L_=t=>t.type.__isKeepAlive;function IS(t,e){O_(t,"a",e)}function NS(t,e){O_(t,"da",e)}function O_(t,e,n=Cn){const i=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(pu(e,i,n),n){let r=n.parent;for(;r&&r.parent;)L_(r.parent.vnode)&&LS(i,e,n,r),r=r.parent}}function LS(t,e,n,i){const r=pu(e,t,i,!0);il(()=>{Sh(i[e],r)},n)}function pu(t,e,n=Cn,i=!1){if(n){const r=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{Tr();const a=sl(n),l=Ki(e,n,t,o);return a(),Ar(),l});return i?r.unshift(s):r.push(s),s}}const Ur=t=>(e,n=Cn)=>{(!qa||t==="sp")&&pu(t,(...i)=>e(...i),n)},OS=Ur("bm"),Ri=Ur("m"),FS=Ur("bu"),F_=Ur("u"),mu=Ur("bum"),il=Ur("um"),US=Ur("sp"),kS=Ur("rtg"),BS=Ur("rtc");function zS(t,e=Cn){pu("ec",t,e)}const VS="components",U_=Symbol.for("v-ndc");function Rh(t){return $t(t)?HS(VS,t,!1)||t:t||U_}function HS(t,e,n=!0,i=!1){const r=gn||Cn;if(r){const s=r.type;{const a=TM(s,!1);if(a&&(a===e||a===Xn(e)||a===iu(Xn(e))))return s}const o=xm(r[t]||s[t],e)||xm(r.appContext[t],e);return!o&&i?s:o}}function xm(t,e){return t&&(t[e]||t[Xn(e)]||t[iu(Xn(e))])}function rl(t,e,n,i){let r;const s=n,o=nt(t);if(o||$t(t)){const a=o&&Gs(t);let l=!1,c=!1;a&&(l=!ni(t),c=Cr(t),t=au(t)),r=new Array(t.length);for(let u=0,d=t.length;ue(a,l,void 0,s));else{const a=Object.keys(t);r=new Array(a.length);for(let l=0,c=a.length;l0;return ge(),ke(rn,null,[re("slot",n,i&&i())],c?-2:64)}let s=t[e];s&&s._c&&(s._d=!1),ge();const o=s&&k_(s(n)),a=n.key||o&&o.key,l=ke(rn,{key:(a&&!wi(a)?a:`_${e}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&t._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function k_(t){return t.some(e=>Wa(e)?!(e.type===Zi||e.type===rn&&!k_(e.children)):!0)?t:null}function GS(t,e){const n={};for(const i in t)n[Ra(i)]=t[i];return n}const tf=t=>t?ix(t)?_u(t):tf(t.parent):null,Oa=_n(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>tf(t.parent),$root:t=>tf(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>z_(t),$forceUpdate:t=>t.f||(t.f=()=>{Ah(t.update)}),$nextTick:t=>t.n||(t.n=Rr.bind(t.proxy)),$watch:t=>TS.bind(t)}),Bu=(t,e)=>t!==Ut&&!t.__isScriptSetup&&Et(t,e),WS={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=t;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return r[e];case 4:return n[e];case 3:return s[e]}else{if(Bu(i,e))return o[e]=1,i[e];if(r!==Ut&&Et(r,e))return o[e]=2,r[e];if(Et(s,e))return o[e]=3,s[e];if(n!==Ut&&Et(n,e))return o[e]=4,n[e];rf&&(o[e]=0)}}const c=Oa[e];let u,d;if(c)return e==="$attrs"&&An(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==Ut&&Et(n,e))return o[e]=4,n[e];if(d=l.config.globalProperties,Et(d,e))return d[e]},set({_:t},e,n){const{data:i,setupState:r,ctx:s}=t;return Bu(r,e)?(r[e]=n,!0):i!==Ut&&Et(i,e)?(i[e]=n,!0):Et(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:r,props:s,type:o}},a){let l;return!!(n[a]||t!==Ut&&a[0]!=="$"&&Et(t,a)||Bu(e,a)||Et(s,a)||Et(i,a)||Et(Oa,a)||Et(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Et(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function nf(t){return nt(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function qS(t,e){const n=nf(t);for(const i in e){if(i.startsWith("__skip"))continue;let r=n[i];r?nt(r)||at(r)?r=n[i]={type:r,default:e[i]}:r.default=e[i]:r===null&&(r=n[i]={default:e[i]}),r&&e[`__skip_${i}`]&&(r.skipFactory=!0)}return n}let rf=!0;function XS(t){const e=z_(t),n=t.proxy,i=t.ctx;rf=!1,e.beforeCreate&&ym(e.beforeCreate,t,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:g,activated:v,deactivated:m,beforeDestroy:p,beforeUnmount:_,destroyed:x,unmounted:y,render:w,renderTracked:A,renderTriggered:P,errorCaptured:D,serverPrefetch:S,expose:M,inheritAttrs:N,components:B,directives:q,filters:K}=e;if(c&&$S(c,i,null),o)for(const k in o){const z=o[k];at(z)&&(i[k]=z.bind(n))}if(r){const k=r.call(n,n);Tt(k)&&(t.data=ri(k))}if(rf=!0,s)for(const k in s){const z=s[k],de=at(z)?z.bind(n,n):at(z.get)?z.get.bind(n,n):Xi,le=!at(z)&&at(z.set)?z.set.bind(n):Xi,pe=Te({get:de,set:le});Object.defineProperty(i,k,{enumerable:!0,configurable:!0,get:()=>pe.value,set:He=>pe.value=He})}if(a)for(const k in a)B_(a[k],i,n,k);if(l){const k=at(l)?l.call(n):l;Reflect.ownKeys(k).forEach(z=>{Ch(z,k[z])})}u&&ym(u,t,"c");function W(k,z){nt(z)?z.forEach(de=>k(de.bind(n))):z&&k(z.bind(n))}if(W(OS,d),W(Ri,f),W(FS,h),W(F_,g),W(IS,v),W(NS,m),W(zS,D),W(BS,A),W(kS,P),W(mu,_),W(il,y),W(US,S),nt(M))if(M.length){const k=t.exposed||(t.exposed={});M.forEach(z=>{Object.defineProperty(k,z,{get:()=>n[z],set:de=>n[z]=de,enumerable:!0})})}else t.exposed||(t.exposed={});w&&t.render===Xi&&(t.render=w),N!=null&&(t.inheritAttrs=N),B&&(t.components=B),q&&(t.directives=q),S&&N_(t)}function $S(t,e,n=Xi){nt(t)&&(t=sf(t));for(const i in t){const r=t[i];let s;Tt(r)?"default"in r?s=Lo(r.from||i,r.default,!0):s=Lo(r.from||i):s=Lo(r),jt(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function ym(t,e,n){Ki(nt(t)?t.map(i=>i.bind(e.proxy)):t.bind(e.proxy),e,n)}function B_(t,e,n,i){let r=i.includes(".")?R_(n,i):()=>n[i];if($t(t)){const s=e[t];at(s)&&sn(r,s)}else if(at(t))sn(r,t.bind(n));else if(Tt(t))if(nt(t))t.forEach(s=>B_(s,e,n,i));else{const s=at(t.handler)?t.handler.bind(n):e[t.handler];at(s)&&sn(r,s,t)}}function z_(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!n&&!i?l=e:(l={},r.length&&r.forEach(c=>Lc(l,c,o,!0)),Lc(l,e,o)),Tt(e)&&s.set(e,l),l}function Lc(t,e,n,i=!1){const{mixins:r,extends:s}=e;s&&Lc(t,s,n,!0),r&&r.forEach(o=>Lc(t,o,n,!0));for(const o in e)if(!(i&&o==="expose")){const a=YS[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const YS={data:bm,props:Sm,emits:Sm,methods:ba,computed:ba,beforeCreate:On,created:On,beforeMount:On,mounted:On,beforeUpdate:On,updated:On,beforeDestroy:On,beforeUnmount:On,destroyed:On,unmounted:On,activated:On,deactivated:On,errorCaptured:On,serverPrefetch:On,components:ba,directives:ba,watch:KS,provide:bm,inject:JS};function bm(t,e){return e?t?function(){return _n(at(t)?t.call(this,this):t,at(e)?e.call(this,this):e)}:e:t}function JS(t,e){return ba(sf(t),sf(e))}function sf(t){if(nt(t)){const e={};for(let n=0;ne==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Xn(e)}Modifiers`]||t[`${ps(e)}Modifiers`];function eM(t,e,...n){if(t.isUnmounted)return;const i=t.vnode.props||Ut;let r=n;const s=e.startsWith("update:"),o=s&&QS(i,e.slice(7));o&&(o.trim&&(r=n.map(u=>$t(u)?u.trim():u)),o.number&&(r=n.map(ru)));let a,l=i[a=Ra(e)]||i[a=Ra(Xn(e))];!l&&s&&(l=i[a=Ra(ps(e))]),l&&Ki(l,t,6,r);const c=i[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,Ki(c,t,6,r)}}const tM=new WeakMap;function H_(t,e,n=!1){const i=n?tM:e.emitsCache,r=i.get(t);if(r!==void 0)return r;const s=t.emits;let o={},a=!1;if(!at(t)){const l=c=>{const u=H_(c,e,!0);u&&(a=!0,_n(o,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(Tt(t)&&i.set(t,null),null):(nt(s)?s.forEach(l=>o[l]=null):_n(o,s),Tt(t)&&i.set(t,o),o)}function gu(t,e){return!t||!Qc(e)?!1:(e=e.slice(2).replace(/Once$/,""),Et(t,e[0].toLowerCase()+e.slice(1))||Et(t,ps(e))||Et(t,e))}function Mm(t){const{type:e,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:g,inheritAttrs:v}=t,m=Ic(t);let p,_;try{if(n.shapeFlag&4){const y=r||i,w=y;p=zi(c.call(w,y,u,d,h,f,g)),_=a}else{const y=e;p=zi(y.length>1?y(d,{attrs:a,slots:o,emit:l}):y(d,null)),_=e.props?a:nM(a)}}catch(y){Fa.length=0,fu(y,t,1),p=re(Zi)}let x=p;if(_&&v!==!1){const y=Object.keys(_),{shapeFlag:w}=x;y.length&&w&7&&(s&&y.some(bh)&&(_=iM(_,s)),x=$s(x,_,!1,!0))}return n.dirs&&(x=$s(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(n.dirs):n.dirs),n.transition&&Ph(x,n.transition),p=x,Ic(m),p}const nM=t=>{let e;for(const n in t)(n==="class"||n==="style"||Qc(n))&&((e||(e={}))[n]=t[n]);return e},iM=(t,e)=>{const n={};for(const i in t)(!bh(i)||!(i.slice(9)in e))&&(n[i]=t[i]);return n};function rM(t,e,n){const{props:i,children:r,component:s}=t,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?wm(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;dObject.create(W_),X_=t=>Object.getPrototypeOf(t)===W_;function oM(t,e,n,i=!1){const r={},s=q_();t.propsDefaults=Object.create(null),$_(t,e,r,s);for(const o in t.propsOptions[0])o in r||(r[o]=void 0);n?t.props=i?r:lS(r):t.type.props?t.props=r:t.props=s,t.attrs=s}function aM(t,e,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=t,a=wt(r),[l]=t.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d{l=!0;const[f,h]=Y_(d,e,!0);_n(o,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!s&&!l)return Tt(t)&&i.set(t,Do),Do;if(nt(s))for(let u=0;ut==="_"||t==="_ctx"||t==="$stable",Ih=t=>nt(t)?t.map(zi):[zi(t)],cM=(t,e,n)=>{if(e._n)return e;const i=ne((...r)=>Ih(e(...r)),n);return i._c=!1,i},J_=(t,e,n)=>{const i=t._ctx;for(const r in t){if(Dh(r))continue;const s=t[r];if(at(s))e[r]=cM(r,s,i);else if(s!=null){const o=Ih(s);e[r]=()=>o}}},K_=(t,e)=>{const n=Ih(e);t.slots.default=()=>n},Z_=(t,e,n)=>{for(const i in e)(n||!Dh(i))&&(t[i]=e[i])},uM=(t,e,n)=>{const i=t.slots=q_();if(t.vnode.shapeFlag&32){const r=e._;r?(Z_(i,e,n),n&&Zv(i,"_",r,!0)):J_(e,i)}else e&&K_(t,e)},dM=(t,e,n)=>{const{vnode:i,slots:r}=t;let s=!0,o=Ut;if(i.shapeFlag&32){const a=e._;a?n&&a===1?s=!1:Z_(r,e,n):(s=!e.$stable,J_(e,r)),o=e}else e&&(K_(t,e),o={default:1});if(s)for(const a in r)!Dh(a)&&o[a]==null&&delete r[a]},wn=gM;function fM(t){return hM(t)}function hM(t,e){const n=su();n.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Xi,insertStaticContent:g}=t,v=(L,U,F,G=null,V=null,Y=null,C=void 0,ae=null,Q=!!U.dynamicChildren)=>{if(L===U)return;L&&!ca(L,U)&&(G=ue(L),He(L,V,Y,!0),L=null),U.patchFlag===-2&&(Q=!1,U.dynamicChildren=null);const{type:ee,ref:oe,shapeFlag:E}=U;switch(ee){case vu:m(L,U,F,G);break;case Zi:p(L,U,F,G);break;case Vu:L==null&&_(U,F,G,C);break;case rn:B(L,U,F,G,V,Y,C,ae,Q);break;default:E&1?w(L,U,F,G,V,Y,C,ae,Q):E&6?q(L,U,F,G,V,Y,C,ae,Q):(E&64||E&128)&&ee.process(L,U,F,G,V,Y,C,ae,Q,Ae)}oe!=null&&V?La(oe,L&&L.ref,Y,U||L,!U):oe==null&&L&&L.ref!=null&&La(L.ref,null,Y,L,!0)},m=(L,U,F,G)=>{if(L==null)i(U.el=a(U.children),F,G);else{const V=U.el=L.el;U.children!==L.children&&c(V,U.children)}},p=(L,U,F,G)=>{L==null?i(U.el=l(U.children||""),F,G):U.el=L.el},_=(L,U,F,G)=>{[L.el,L.anchor]=g(L.children,U,F,G,L.el,L.anchor)},x=({el:L,anchor:U},F,G)=>{let V;for(;L&&L!==U;)V=f(L),i(L,F,G),L=V;i(U,F,G)},y=({el:L,anchor:U})=>{let F;for(;L&&L!==U;)F=f(L),r(L),L=F;r(U)},w=(L,U,F,G,V,Y,C,ae,Q)=>{if(U.type==="svg"?C="svg":U.type==="math"&&(C="mathml"),L==null)A(U,F,G,V,Y,C,ae,Q);else{const ee=L.el&&L.el._isVueCE?L.el:null;try{ee&&ee._beginPatch(),S(L,U,V,Y,C,ae,Q)}finally{ee&&ee._endPatch()}}},A=(L,U,F,G,V,Y,C,ae)=>{let Q,ee;const{props:oe,shapeFlag:E,transition:b,dirs:O}=L;if(Q=L.el=o(L.type,Y,oe&&oe.is,oe),E&8?u(Q,L.children):E&16&&D(L.children,Q,null,G,V,zu(L,Y),C,ae),O&&bs(L,null,G,"created"),P(Q,L,L.scopeId,C,G),oe){for(const se in oe)se!=="value"&&!Pa(se)&&s(Q,se,null,oe[se],Y,G);"value"in oe&&s(Q,"value",null,oe.value,Y),(ee=oe.onVnodeBeforeMount)&&Oi(ee,G,L)}O&&bs(L,null,G,"beforeMount");const J=pM(V,b);J&&b.beforeEnter(Q),i(Q,U,F),((ee=oe&&oe.onVnodeMounted)||J||O)&&wn(()=>{ee&&Oi(ee,G,L),J&&b.enter(Q),O&&bs(L,null,G,"mounted")},V)},P=(L,U,F,G,V)=>{if(F&&h(L,F),G)for(let Y=0;Y{for(let ee=Q;ee{const ae=U.el=L.el;let{patchFlag:Q,dynamicChildren:ee,dirs:oe}=U;Q|=L.patchFlag&16;const E=L.props||Ut,b=U.props||Ut;let O;if(F&&Ss(F,!1),(O=b.onVnodeBeforeUpdate)&&Oi(O,F,U,L),oe&&bs(U,L,F,"beforeUpdate"),F&&Ss(F,!0),(E.innerHTML&&b.innerHTML==null||E.textContent&&b.textContent==null)&&u(ae,""),ee?M(L.dynamicChildren,ee,ae,F,G,zu(U,V),Y):C||z(L,U,ae,null,F,G,zu(U,V),Y,!1),Q>0){if(Q&16)N(ae,E,b,F,V);else if(Q&2&&E.class!==b.class&&s(ae,"class",null,b.class,V),Q&4&&s(ae,"style",E.style,b.style,V),Q&8){const J=U.dynamicProps;for(let se=0;se{O&&Oi(O,F,U,L),oe&&bs(U,L,F,"updated")},G)},M=(L,U,F,G,V,Y,C)=>{for(let ae=0;ae{if(U!==F){if(U!==Ut)for(const Y in U)!Pa(Y)&&!(Y in F)&&s(L,Y,U[Y],null,V,G);for(const Y in F){if(Pa(Y))continue;const C=F[Y],ae=U[Y];C!==ae&&Y!=="value"&&s(L,Y,ae,C,V,G)}"value"in F&&s(L,"value",U.value,F.value,V)}},B=(L,U,F,G,V,Y,C,ae,Q)=>{const ee=U.el=L?L.el:a(""),oe=U.anchor=L?L.anchor:a("");let{patchFlag:E,dynamicChildren:b,slotScopeIds:O}=U;O&&(ae=ae?ae.concat(O):O),L==null?(i(ee,F,G),i(oe,F,G),D(U.children||[],F,oe,V,Y,C,ae,Q)):E>0&&E&64&&b&&L.dynamicChildren&&L.dynamicChildren.length===b.length?(M(L.dynamicChildren,b,F,V,Y,C,ae),(U.key!=null||V&&U===V.subTree)&&Nh(L,U,!0)):z(L,U,F,oe,V,Y,C,ae,Q)},q=(L,U,F,G,V,Y,C,ae,Q)=>{U.slotScopeIds=ae,L==null?U.shapeFlag&512?V.ctx.activate(U,F,G,C,Q):K(U,F,G,V,Y,C,Q):$(L,U,Q)},K=(L,U,F,G,V,Y,C)=>{const ae=L.component=bM(L,G,V);if(L_(L)&&(ae.ctx.renderer=Ae),SM(ae,!1,C),ae.asyncDep){if(V&&V.registerDep(ae,W,C),!L.el){const Q=ae.subTree=re(Zi);p(null,Q,U,F),L.placeholder=Q.el}}else W(ae,L,U,F,V,Y,C)},$=(L,U,F)=>{const G=U.component=L.component;if(rM(L,U,F))if(G.asyncDep&&!G.asyncResolved){k(G,U,F);return}else G.next=U,G.update();else U.el=L.el,G.vnode=U},W=(L,U,F,G,V,Y,C)=>{const ae=()=>{if(L.isMounted){let{next:E,bu:b,u:O,parent:J,vnode:se}=L;{const $e=j_(L);if($e){E&&(E.el=se.el,k(L,E,C)),$e.asyncDep.then(()=>{wn(()=>{L.isUnmounted||ee()},V)});return}}let Z=E,Ce;Ss(L,!1),E?(E.el=se.el,k(L,E,C)):E=se,b&&fc(b),(Ce=E.props&&E.props.onVnodeBeforeUpdate)&&Oi(Ce,J,E,se),Ss(L,!0);const ve=Mm(L),Ne=L.subTree;L.subTree=ve,v(Ne,ve,d(Ne.el),ue(Ne),L,V,Y),E.el=ve.el,Z===null&&sM(L,ve.el),O&&wn(O,V),(Ce=E.props&&E.props.onVnodeUpdated)&&wn(()=>Oi(Ce,J,E,se),V)}else{let E;const{el:b,props:O}=U,{bm:J,m:se,parent:Z,root:Ce,type:ve}=L,Ne=Oo(U);Ss(L,!1),J&&fc(J),!Ne&&(E=O&&O.onVnodeBeforeMount)&&Oi(E,Z,U),Ss(L,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(ve);const $e=L.subTree=Mm(L);v(null,$e,F,G,L,V,Y),U.el=$e.el}if(se&&wn(se,V),!Ne&&(E=O&&O.onVnodeMounted)){const $e=U;wn(()=>Oi(E,Z,$e),V)}(U.shapeFlag&256||Z&&Oo(Z.vnode)&&Z.vnode.shapeFlag&256)&&L.a&&wn(L.a,V),L.isMounted=!0,U=F=G=null}};L.scope.on();const Q=L.effect=new r_(ae);L.scope.off();const ee=L.update=Q.run.bind(Q),oe=L.job=Q.runIfDirty.bind(Q);oe.i=L,oe.id=L.uid,Q.scheduler=()=>Ah(oe),Ss(L,!0),ee()},k=(L,U,F)=>{U.component=L;const G=L.vnode.props;L.vnode=U,L.next=null,aM(L,U.props,G,F),dM(L,U.children,F),Tr(),hm(L),Ar()},z=(L,U,F,G,V,Y,C,ae,Q=!1)=>{const ee=L&&L.children,oe=L?L.shapeFlag:0,E=U.children,{patchFlag:b,shapeFlag:O}=U;if(b>0){if(b&128){le(ee,E,F,G,V,Y,C,ae,Q);return}else if(b&256){de(ee,E,F,G,V,Y,C,ae,Q);return}}O&8?(oe&16&&ce(ee,V,Y),E!==ee&&u(F,E)):oe&16?O&16?le(ee,E,F,G,V,Y,C,ae,Q):ce(ee,V,Y,!0):(oe&8&&u(F,""),O&16&&D(E,F,G,V,Y,C,ae,Q))},de=(L,U,F,G,V,Y,C,ae,Q)=>{L=L||Do,U=U||Do;const ee=L.length,oe=U.length,E=Math.min(ee,oe);let b;for(b=0;boe?ce(L,V,Y,!0,!1,E):D(U,F,G,V,Y,C,ae,Q,E)},le=(L,U,F,G,V,Y,C,ae,Q)=>{let ee=0;const oe=U.length;let E=L.length-1,b=oe-1;for(;ee<=E&&ee<=b;){const O=L[ee],J=U[ee]=Q?pr(U[ee]):zi(U[ee]);if(ca(O,J))v(O,J,F,null,V,Y,C,ae,Q);else break;ee++}for(;ee<=E&&ee<=b;){const O=L[E],J=U[b]=Q?pr(U[b]):zi(U[b]);if(ca(O,J))v(O,J,F,null,V,Y,C,ae,Q);else break;E--,b--}if(ee>E){if(ee<=b){const O=b+1,J=Ob)for(;ee<=E;)He(L[ee],V,Y,!0),ee++;else{const O=ee,J=ee,se=new Map;for(ee=J;ee<=b;ee++){const Pe=U[ee]=Q?pr(U[ee]):zi(U[ee]);Pe.key!=null&&se.set(Pe.key,ee)}let Z,Ce=0;const ve=b-J+1;let Ne=!1,$e=0;const me=new Array(ve);for(ee=0;ee=ve){He(Pe,V,Y,!0);continue}let Ue;if(Pe.key!=null)Ue=se.get(Pe.key);else for(Z=J;Z<=b;Z++)if(me[Z-J]===0&&ca(Pe,U[Z])){Ue=Z;break}Ue===void 0?He(Pe,V,Y,!0):(me[Ue-J]=ee+1,Ue>=$e?$e=Ue:Ne=!0,v(Pe,U[Ue],F,null,V,Y,C,ae,Q),Ce++)}const we=Ne?mM(me):Do;for(Z=we.length-1,ee=ve-1;ee>=0;ee--){const Pe=J+ee,Ue=U[Pe],Me=U[Pe+1],ut=Pe+1{const{el:Y,type:C,transition:ae,children:Q,shapeFlag:ee}=L;if(ee&6){pe(L.component.subTree,U,F,G);return}if(ee&128){L.suspense.move(U,F,G);return}if(ee&64){C.move(L,U,F,Ae);return}if(C===rn){i(Y,U,F);for(let E=0;Eae.enter(Y),V);else{const{leave:E,delayLeave:b,afterLeave:O}=ae,J=()=>{L.ctx.isUnmounted?r(Y):i(Y,U,F)},se=()=>{Y._isLeaving&&Y[RS](!0),E(Y,()=>{J(),O&&O()})};b?b(Y,J,se):se()}else i(Y,U,F)},He=(L,U,F,G=!1,V=!1)=>{const{type:Y,props:C,ref:ae,children:Q,dynamicChildren:ee,shapeFlag:oe,patchFlag:E,dirs:b,cacheIndex:O}=L;if(E===-2&&(V=!1),ae!=null&&(Tr(),La(ae,null,F,L,!0),Ar()),O!=null&&(U.renderCache[O]=void 0),oe&256){U.ctx.deactivate(L);return}const J=oe&1&&b,se=!Oo(L);let Z;if(se&&(Z=C&&C.onVnodeBeforeUnmount)&&Oi(Z,U,L),oe&6)xt(L.component,F,G);else{if(oe&128){L.suspense.unmount(F,G);return}J&&bs(L,null,U,"beforeUnmount"),oe&64?L.type.remove(L,U,F,Ae,G):ee&&!ee.hasOnce&&(Y!==rn||E>0&&E&64)?ce(ee,U,F,!1,!0):(Y===rn&&E&384||!V&&oe&16)&&ce(Q,U,F),G&&Be(L)}(se&&(Z=C&&C.onVnodeUnmounted)||J)&&wn(()=>{Z&&Oi(Z,U,L),J&&bs(L,null,U,"unmounted")},F)},Be=L=>{const{type:U,el:F,anchor:G,transition:V}=L;if(U===rn){st(F,G);return}if(U===Vu){y(L);return}const Y=()=>{r(F),V&&!V.persisted&&V.afterLeave&&V.afterLeave()};if(L.shapeFlag&1&&V&&!V.persisted){const{leave:C,delayLeave:ae}=V,Q=()=>C(F,Y);ae?ae(L.el,Y,Q):Q()}else Y()},st=(L,U)=>{let F;for(;L!==U;)F=f(L),r(L),L=F;r(U)},xt=(L,U,F)=>{const{bum:G,scope:V,job:Y,subTree:C,um:ae,m:Q,a:ee}=L;Tm(Q),Tm(ee),G&&fc(G),V.stop(),Y&&(Y.flags|=8,He(C,L,U,F)),ae&&wn(ae,U),wn(()=>{L.isUnmounted=!0},U)},ce=(L,U,F,G=!1,V=!1,Y=0)=>{for(let C=Y;C{if(L.shapeFlag&6)return ue(L.component.subTree);if(L.shapeFlag&128)return L.suspense.next();const U=f(L.anchor||L.el),F=U&&U[D_];return F?f(F):U};let Ie=!1;const Ye=(L,U,F)=>{let G;L==null?U._vnode&&(He(U._vnode,null,null,!0),G=U._vnode.component):v(U._vnode||null,L,U,null,null,null,F),U._vnode=L,Ie||(Ie=!0,hm(G),T_(),Ie=!1)},Ae={p:v,um:He,m:pe,r:Be,mt:K,mc:D,pc:z,pbc:M,n:ue,o:t};return{render:Ye,hydrate:void 0,createApp:jS(Ye)}}function zu({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Ss({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function pM(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Nh(t,e,n=!1){const i=t.children,r=e.children;if(nt(i)&&nt(r))for(let s=0;s>1,t[n[a]]0&&(e[i]=n[s-1]),n[s]=i)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=e[o];return n}function j_(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:j_(e)}function Tm(t){if(t)for(let e=0;et.__isSuspense;function gM(t,e){e&&e.pendingBranch?nt(t)?e.effects.push(...t):e.effects.push(t):MS(t)}const rn=Symbol.for("v-fgt"),vu=Symbol.for("v-txt"),Zi=Symbol.for("v-cmt"),Vu=Symbol.for("v-stc"),Fa=[];let ei=null;function ge(t=!1){Fa.push(ei=t?null:[])}function vM(){Fa.pop(),ei=Fa[Fa.length-1]||null}let Ga=1;function Oc(t,e=!1){Ga+=t,t<0&&ei&&e&&(ei.hasOnce=!0)}function tx(t){return t.dynamicChildren=Ga>0?ei||Do:null,vM(),Ga>0&&ei&&ei.push(t),t}function kt(t,e,n,i,r,s){return tx(et(t,e,n,i,r,s,!0))}function ke(t,e,n,i,r){return tx(re(t,e,n,i,r,!0))}function Wa(t){return t?t.__v_isVNode===!0:!1}function ca(t,e){return t.type===e.type&&t.key===e.key}const nx=({key:t})=>t??null,mc=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?$t(t)||jt(t)||at(t)?{i:gn,r:t,k:e,f:!!n}:t:null);function et(t,e=null,n=null,i=0,r=null,s=t===rn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&nx(e),ref:e&&mc(e),scopeId:C_,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:gn};return a?(Lh(l,n),s&128&&t.normalize(l)):n&&(l.shapeFlag|=$t(n)?8:16),Ga>0&&!o&&ei&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&ei.push(l),l}const re=_M;function _M(t,e=null,n=null,i=0,r=null,s=!1){if((!t||t===U_)&&(t=Zi),Wa(t)){const a=$s(t,e,!0);return n&&Lh(a,n),Ga>0&&!s&&ei&&(a.shapeFlag&6?ei[ei.indexOf(t)]=a:ei.push(a)),a.patchFlag=-2,a}if(AM(t)&&(t=t.__vccOpts),e){e=kr(e);let{class:a,style:l}=e;a&&!$t(a)&&(e.class=xn(a)),Tt(l)&&(uu(l)&&!nt(l)&&(l=_n({},l)),e.style=Fr(l))}const o=$t(t)?1:ex(t)?128:AS(t)?64:Tt(t)?4:at(t)?2:0;return et(t,e,n,i,r,o,s,!0)}function kr(t){return t?uu(t)||X_(t)?_n({},t):t:null}function $s(t,e,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=t,c=e?Dt(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&nx(c),ref:e&&e.ref?n&&s?nt(s)?s.concat(mc(e)):[s,mc(e)]:mc(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==rn?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&$s(t.ssContent),ssFallback:t.ssFallback&&$s(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&i&&Ph(u,l.clone(u)),u}function Gt(t=" ",e=0){return re(vu,null,t,e)}function yr(t="",e=!1){return e?(ge(),ke(Zi,null,t)):re(Zi,null,t)}function zi(t){return t==null||typeof t=="boolean"?re(Zi):nt(t)?re(rn,null,t.slice()):Wa(t)?pr(t):re(vu,null,String(t))}function pr(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:$s(t)}function Lh(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(nt(e))n=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),Lh(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!X_(e)?e._ctx=gn:r===3&&gn&&(gn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else at(e)?(e={default:e,_ctx:gn},n=32):(e=String(e),i&64?(n=16,e=[Gt(e)]):n=8);t.children=e,t.shapeFlag|=n}function Dt(...t){const e={};for(let n=0;nCn||gn;let Fc,af;{const t=su(),e=(n,i)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Fc=e("__VUE_INSTANCE_SETTERS__",n=>Cn=n),af=e("__VUE_SSR_SETTERS__",n=>qa=n)}const sl=t=>{const e=Cn;return Fc(t),t.scope.on(),()=>{t.scope.off(),Fc(e)}},Am=()=>{Cn&&Cn.scope.off(),Fc(null)};function ix(t){return t.vnode.shapeFlag&4}let qa=!1;function SM(t,e=!1,n=!1){e&&af(e);const{props:i,children:r}=t.vnode,s=ix(t);oM(t,i,s,e),uM(t,r,n||e);const o=s?MM(t,e):void 0;return e&&af(!1),o}function MM(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,WS);const{setup:i}=n;if(i){Tr();const r=t.setupContext=i.length>1?EM(t):null,s=sl(t),o=nl(i,t,0,[t.props,r]),a=Yv(o);if(Ar(),s(),(a||t.sp)&&!Oo(t)&&N_(t),a){if(o.then(Am,Am),e)return o.then(l=>{Cm(t,l)}).catch(l=>{fu(l,t,0)});t.asyncDep=o}else Cm(t,o)}else rx(t)}function Cm(t,e,n){at(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Tt(e)&&(t.setupState=S_(e)),rx(t)}function rx(t,e,n){const i=t.type;t.render||(t.render=i.render||Xi);{const r=sl(t);Tr();try{XS(t)}finally{Ar(),r()}}}const wM={get(t,e){return An(t,"get",""),t[e]}};function EM(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,wM),slots:t.slots,emit:t.emit,expose:e}}function _u(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(S_(y_(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Oa)return Oa[n](t)},has(e,n){return n in e||n in Oa}})):t.proxy}function TM(t,e=!0){return at(t)?t.displayName||t.name:t.name||e&&t.__name}function AM(t){return at(t)&&"__vccOpts"in t}const Te=(t,e)=>_S(t,e,qa);function br(t,e,n){try{Oc(-1);const i=arguments.length;return i===2?Tt(e)&&!nt(e)?Wa(e)?re(t,null,[e]):re(t,e):re(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&Wa(n)&&(n=[n]),re(t,e,n))}finally{Oc(1)}}const CM="3.5.28";let lf;const Pm=typeof window<"u"&&window.trustedTypes;if(Pm)try{lf=Pm.createPolicy("vue",{createHTML:t=>t})}catch{}const sx=lf?t=>lf.createHTML(t):t=>t,PM="http://www.w3.org/2000/svg",RM="http://www.w3.org/1998/Math/MathML",hr=typeof document<"u"?document:null,Rm=hr&&hr.createElement("template"),DM={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,i)=>{const r=e==="svg"?hr.createElementNS(PM,t):e==="mathml"?hr.createElementNS(RM,t):n?hr.createElement(t,{is:n}):hr.createElement(t);return t==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:t=>hr.createTextNode(t),createComment:t=>hr.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>hr.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,i,r,s){const o=n?n.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{Rm.innerHTML=sx(i==="svg"?`${t}`:i==="mathml"?`${t}`:t);const a=Rm.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},IM=Symbol("_vtc");function NM(t,e,n){const i=t[IM];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Dm=Symbol("_vod"),LM=Symbol("_vsh"),OM=Symbol(""),FM=/(?:^|;)\s*display\s*:/;function UM(t,e,n){const i=t.style,r=$t(n);let s=!1;if(n&&!r){if(e)if($t(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&gc(i,a,"")}else for(const o in e)n[o]==null&&gc(i,o,"");for(const o in n)o==="display"&&(s=!0),gc(i,o,n[o])}else if(r){if(e!==n){const o=i[OM];o&&(n+=";"+o),i.cssText=n,s=FM.test(n)}}else e&&t.removeAttribute("style");Dm in t&&(t[Dm]=s?i.display:"",t[LM]&&(i.display="none"))}const Im=/\s*!important$/;function gc(t,e,n){if(nt(n))n.forEach(i=>gc(t,e,i));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const i=kM(t,e);Im.test(n)?t.setProperty(ps(i),n.replace(Im,""),"important"):t[i]=n}}const Nm=["Webkit","Moz","ms"],Hu={};function kM(t,e){const n=Hu[e];if(n)return n;let i=Xn(e);if(i!=="filter"&&i in t)return Hu[e]=i;i=iu(i);for(let r=0;rGu||(HM.then(()=>Gu=0),Gu=Date.now());function WM(t,e){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;Ki(qM(i,n.value),e,5,[i])};return n.value=t,n.attached=GM(),n}function qM(t,e){if(nt(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const Bm=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,XM=(t,e,n,i,r,s)=>{const o=r==="svg";e==="class"?NM(t,i,o):e==="style"?UM(t,n,i):Qc(e)?bh(e)||zM(t,e,n,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):$M(t,e,i,o))?(Fm(t,e,i),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Om(t,e,i,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!$t(i))?Fm(t,Xn(e),i,s,e):(e==="true-value"?t._trueValue=i:e==="false-value"&&(t._falseValue=i),Om(t,e,i,o))};function $M(t,e,n,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in t&&Bm(e)&&at(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Bm(e)&&$t(n)?!1:e in t}const Uc=t=>{const e=t.props["onUpdate:modelValue"]||!1;return nt(e)?n=>fc(e,n):e};function YM(t){t.target.composing=!0}function zm(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Uo=Symbol("_assign");function Vm(t,e,n){return e&&(t=t.trim()),n&&(t=ru(t)),t}const Hm={created(t,{modifiers:{lazy:e,trim:n,number:i}},r){t[Uo]=Uc(r);const s=i||r.props&&r.props.type==="number";Fs(t,e?"change":"input",o=>{o.target.composing||t[Uo](Vm(t.value,n,s))}),(n||s)&&Fs(t,"change",()=>{t.value=Vm(t.value,n,s)}),e||(Fs(t,"compositionstart",YM),Fs(t,"compositionend",zm),Fs(t,"change",zm))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(t[Uo]=Uc(o),t.composing)return;const a=(s||t.type==="number")&&!/^0\d/.test(t.value)?ru(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(i&&e===n||r&&t.value.trim()===l)||(t.value=l))}},ox={deep:!0,created(t,{value:e,modifiers:{number:n}},i){const r=eu(e);Fs(t,"change",()=>{const s=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?ru(kc(o)):kc(o));t[Uo](t.multiple?r?new Set(s):s:s[0]),t._assigning=!0,Rr(()=>{t._assigning=!1})}),t[Uo]=Uc(i)},mounted(t,{value:e}){Gm(t,e)},beforeUpdate(t,e,n){t[Uo]=Uc(n)},updated(t,{value:e}){t._assigning||Gm(t,e)}};function Gm(t,e){const n=t.multiple,i=nt(e);if(!(n&&!i&&!eu(e))){for(let r=0,s=t.options.length;rString(c)===String(a)):o.selected=Hb(e,a)>-1}else o.selected=e.has(a);else if(tl(kc(o),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function kc(t){return"_value"in t?t._value:t.value}const JM=["ctrl","shift","alt","meta"],KM={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>JM.some(n=>t[`${n}Key`]&&!e.includes(n))},li=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),i=e.join(".");return n[i]||(n[i]=((r,...s)=>{for(let o=0;o{const n=t._withKeys||(t._withKeys={}),i=e.join(".");return n[i]||(n[i]=(r=>{if(!("key"in r))return;const s=ps(r.key);if(e.some(o=>o===s||ZM[o]===s))return t(r)}))},jM=_n({patchProp:XM},DM);let Wm;function QM(){return Wm||(Wm=fM(jM))}const ew=((...t)=>{const e=QM().createApp(...t),{mount:n}=e;return e.mount=i=>{const r=nw(i);if(!r)return;const s=e._component;!at(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,tw(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e});function tw(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function nw(t){return $t(t)?document.querySelector(t):t}const bi=ri({title:"Object Infos",isVisible:!1,data:null}),vc=ri({title:"Sidebar Infos",isVisible:!1,data:null}),mn=ri({value:!0}),Sr=ri({value:"translate"}),ax=ri({value:!1});function lx(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;etypeof t=="boolean"?`${t}`:t===0?"0":t,Xm=cx,iw=(t,e)=>n=>{var i;if(e?.variants==null)return Xm(t,n?.class,n?.className);const{variants:r,defaultVariants:s}=e,o=Object.keys(r).map(c=>{const u=n?.[c],d=s?.[c];if(u===null)return null;const f=qm(u)||qm(d);return r[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(g=>{let[v,m]=g;return Array.isArray(m)?m.includes({...s,...a}[v]):{...s,...a}[v]===m})?[...c,d,f]:c},[]);return Xm(t,o,l,n?.class,n?.className)};function Oh(t,e=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(e,t))}function Sl(t,e){let n=t;const i=e.toString(),r=i.indexOf("."),s=r>=0?i.length-r:0;if(s>0){const o=10**s;n=Math.round(n*o)/o}return n}function rw(t,e,n,i){e=Number(e),n=Number(n);const r=(t-(Number.isNaN(e)?0:e))%i;let s=Sl(Math.abs(r)*2>=i?t+Math.sign(r)*(i-Math.abs(r)):t-r,i);return Number.isNaN(e)?!Number.isNaN(n)&&s>n&&(s=Math.floor(Sl(n/i,i))*i):sn&&(s=e+Math.floor(Sl((n-e)/i,i))*i),s=Sl(s,i),s}function zr(t,e){const n=typeof t=="string"&&!e?`${t}Context`:e,i=Symbol(n);return[o=>{const a=Lo(i,o);if(a||a===null)return a;throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},o=>(Ch(i,o),o)]}function Ws(){let t=document.activeElement;if(t==null)return null;for(;t!=null&&t.shadowRoot!=null&&t.shadowRoot.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ux(t,e,n){const i=n.originalEvent.target,r=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),i.dispatchEvent(r)}function _c(t){return t==null}function sw(t,e){var n;const i=du();return fi(()=>{i.value=t()},{...e,flush:(n=e?.flush)!==null&&n!==void 0?n:"sync"}),Pc(i)}function ol(t,e){return Mh()?(i_(t,e),!0):!1}function dx(){const t=new Set,e=s=>{t.delete(s)};return{on:s=>{t.add(s);const o=()=>e(s);return ol(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(t).map(o=>o(...s))),clear:()=>{t.clear()}}}function ow(t){let e=!1,n;const i=n_(!0);return((...r)=>(e||(n=i.run(()=>t(...r)),e=!0),n))}const Di=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const aw=t=>typeof t<"u",lw=Object.prototype.toString,cw=t=>lw.call(t)==="[object Object]",$m=uw();function uw(){var t,e,n;return Di&&!!(!((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0)&&t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)===null||n===void 0?void 0:n.navigator.userAgent))}function Wu(t){return Array.isArray(t)?t:[t]}function dw(t){return Br()}function fw(t){if(!Di)return t;let e=0,n,i;const r=()=>{e-=1,i&&e<=0&&(i.stop(),n=void 0,i=void 0)};return((...s)=>(e+=1,i||(i=n_(!0),n=i.run(()=>t(...s))),ol(r),n))}function hw(t){return ri(jt(t)?new Proxy({},{get(e,n,i){return T(Reflect.get(t.value,n,i))},set(e,n,i){return jt(t.value[n])&&!jt(i)?t.value[n].value=i:t.value[n]=i,!0},deleteProperty(e,n){return Reflect.deleteProperty(t.value,n)},has(e,n){return Reflect.has(t.value,n)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):t)}function Fh(t){return hw(Te(t))}function js(t,...e){const n=e.flat(),i=n[0];return Fh(()=>Object.fromEntries(typeof i=="function"?Object.entries(Pr(t)).filter(([r,s])=>!i(Dn(s),r)):Object.entries(Pr(t)).filter(r=>!n.includes(r[0]))))}function pw(t,e=1e4){return hS((n,i)=>{let r=Dn(t),s;const o=()=>setTimeout(()=>{r=Dn(t),i()},Dn(e));return ol(()=>{clearTimeout(s)}),{get(){return n(),r},set(a){r=a,i(),clearTimeout(s),s=o()}}})}function mw(t,e){dw()&&mu(t,e)}function fx(t,e,n={}){const{immediate:i=!0,immediateCallback:r=!1}=n,s=du(!1);let o;function a(){o&&(clearTimeout(o),o=void 0)}function l(){s.value=!1,a()}function c(...u){r&&t(),a(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=void 0,t(...u)},Dn(e))}return i&&(s.value=!0,Di&&c()),ol(l),{isPending:Ns(s),start:c,stop:l}}function gw(t,e,n){return sn(t,e,{...n,immediate:!0})}const Uh=Di?window:void 0;function gs(t){var e;const n=Dn(t);return(e=n?.$el)!==null&&e!==void 0?e:n}function qs(...t){const e=(i,r,s,o)=>(i.addEventListener(r,s,o),()=>i.removeEventListener(r,s,o)),n=Te(()=>{const i=Wu(Dn(t[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return gw(()=>{var i,r;return[(i=(r=n.value)===null||r===void 0?void 0:r.map(s=>gs(s)))!==null&&i!==void 0?i:[Uh].filter(s=>s!=null),Wu(Dn(n.value?t[1]:t[0])),Wu(T(n.value?t[2]:t[1])),Dn(n.value?t[3]:t[2])]},([i,r,s,o],a,l)=>{if(!i?.length||!r?.length||!s?.length)return;const c=cw(o)?{...o}:o,u=i.flatMap(d=>r.flatMap(f=>s.map(h=>e(d,f,h,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function hx(){const t=du(!1),e=Br();return e&&Ri(()=>{t.value=!0},e),t}function vw(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function _w(...t){let e,n,i={};t.length===3?(e=t[0],n=t[1],i=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],i=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:r=Uh,eventName:s="keydown",passive:o=!1,dedupe:a=!1}=i,l=vw(e);return qs(r,s,u=>{u.repeat&&Dn(a)||l(u)&&n(u)},o)}function xw(t){return JSON.parse(JSON.stringify(t))}function xu(t,e,n,i={}){var r,s;const{clone:o=!1,passive:a=!1,eventName:l,deep:c=!1,defaultValue:u,shouldEmit:d}=i,f=Br(),h=n||f?.emit||(f==null||(r=f.$emit)===null||r===void 0?void 0:r.bind(f))||(f==null||(s=f.proxy)===null||s===void 0||(s=s.$emit)===null||s===void 0?void 0:s.bind(f?.proxy));let g=l;e||(e="modelValue"),g=g||`update:${e.toString()}`;const v=_=>o?typeof o=="function"?o(_):xw(_):_,m=()=>aw(t[e])?v(t[e]):u,p=_=>{d?d(_)&&h(g,_):h(g,_)};if(a){const _=Ve(m());let x=!1;return sn(()=>t[e],y=>{x||(x=!0,_.value=v(y),Rr(()=>x=!1))}),sn(_,y=>{!x&&(y!==t[e]||c)&&p(y)},{deep:c}),_}else return Te({get(){return m()},set(_){p(_)}})}function kh(t){return t?t.flatMap(e=>e.type===rn?kh(e.children):[e]):[]}const[Bh]=zr("ConfigProvider");function qu(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function cf(t,e,n=".",i){if(!qu(e))return cf(t,{},n,i);const r={...e};for(const s of Object.keys(t)){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(i&&i(r,s,o,n)||(Array.isArray(o)&&Array.isArray(r[s])?r[s]=[...o,...r[s]]:qu(o)&&qu(r[s])?r[s]=cf(o,r[s],(n?`${n}.`:"")+s.toString(),i):r[s]=o))}return r}function yw(t){return(...e)=>e.reduce((n,i)=>cf(n,i,"",t),{})}const px=yw(),bw=fw(()=>{const t=Ve(new Map),e=Ve(),n=Te(()=>{for(const o of t.value.values())if(o)return!0;return!1}),i=Bh({scrollBody:Ve(!0)});let r=null;const s=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",$m&&r?.(),e.value=void 0};return sn(n,(o,a)=>{if(!Di)return;if(!o){a&&s();return}e.value===void 0&&(e.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,c={padding:l,margin:0},u=i.scrollBody?.value?typeof i.scrollBody.value=="object"?px({padding:i.scrollBody.value.padding===!0?l:i.scrollBody.value.padding,margin:i.scrollBody.value.margin===!0?l:i.scrollBody.value.margin},c):c:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),$m&&(r=qs(document,"touchmove",d=>Mw(d),{passive:!1})),Rr(()=>{n.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),t});function Sw(t){const e=Math.random().toString(36).substring(2,7),n=bw();n.value.set(e,t);const i=Te({get:()=>n.value.get(e)??!1,set:r=>n.value.set(e,r)});return mw(()=>{n.value.delete(e)}),i}function mx(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}function ww(t){const e=Bh({dir:Ve("ltr")});return Te(()=>t?.value||e.dir?.value||"ltr")}function Ew(t){const e=Br(),n=e?.type.emits,i={};return n?.length||console.warn(`No emitted event found. Please check component: ${e?.type.__name}`),n?.forEach(r=>{i[Ra(Xn(r))]=(...s)=>t(r,...s)}),i}let Xu=0;function Tw(){fi(t=>{if(!Di)return;const e=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",e[0]??Ym()),document.body.insertAdjacentElement("beforeend",e[1]??Ym()),Xu++,t(()=>{Xu===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),Xu--})})}function Ym(){const t=document.createElement("span");return t.setAttribute("data-reka-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}function gx(t){return Te(()=>Dn(t)?!!gs(t)?.closest("form"):!0)}function tn(){const t=Br(),e=Ve(),n=Te(()=>i());F_(()=>{n.value!==i()&&uS(e)});function i(){return e.value&&"$el"in e.value&&["#text","#comment"].includes(e.value.$el.nodeName)?e.value.$el.nextElementSibling:gs(e)}const r=Object.assign({},t.exposed),s={};for(const a in t.props)Object.defineProperty(s,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(r).length>0)for(const a in r)Object.defineProperty(s,a,{enumerable:!0,configurable:!0,get:()=>r[a]});Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=s;function o(a){if(e.value=a,!!a&&(Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const l=a.$.exposed,c=Object.assign({},s);for(const u in l)Object.defineProperty(c,u,{enumerable:!0,configurable:!0,get:()=>l[u]});t.exposed=c}}return{forwardRef:o,currentRef:e,currentElement:n}}function al(t){const e=Br(),n=Object.keys(e?.type.props??{}).reduce((r,s)=>{const o=(e?.type.props[s]).default;return o!==void 0&&(r[s]=o),r},{}),i=gS(t);return Te(()=>{const r={},s=e?.vnode.props??{};return Object.keys(s).forEach(o=>{r[Xn(o)]=s[o]}),Object.keys({...n,...r}).reduce((o,a)=>(i.value[a]!==void 0&&(o[a]=i.value[a]),o),{})})}function Qi(t,e){const n=al(t),i=e?Ew(e):{};return Te(()=>({...n.value,...i}))}function Aw(t,e){const n=pw(!1,300);ol(()=>{n.value=!1});const i=Ve(null),r=dx();function s(){i.value=null,n.value=!1}function o(a,l){if(!l)return;const c=a.currentTarget,u={x:a.clientX,y:a.clientY},d=Cw(u,c.getBoundingClientRect()),f=Pw(u,d,1),h=Rw(l.getBoundingClientRect()),g=Iw([...f,...h]);i.value=g,n.value=!0}return fi(a=>{if(t.value&&e.value){const l=u=>o(u,e.value),c=u=>o(u,t.value);t.value.addEventListener("pointerleave",l),e.value.addEventListener("pointerleave",c),a(()=>{t.value?.removeEventListener("pointerleave",l),e.value?.removeEventListener("pointerleave",c)})}}),fi(a=>{if(i.value){const l=c=>{if(!i.value||!(c.target instanceof Element))return;const u=c.target,d={x:c.clientX,y:c.clientY},f=t.value?.contains(u)||e.value?.contains(u),h=!Dw(d,i.value),g=!!u.closest("[data-grace-area-trigger]");f?s():(h||g)&&(s(),r.trigger())};t.value?.ownerDocument.addEventListener("pointermove",l),a(()=>t.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:r.on}}function Cw(t,e){const n=Math.abs(e.top-t.y),i=Math.abs(e.bottom-t.y),r=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function Pw(t,e,n=5){const i=[];switch(e){case"top":i.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":i.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":i.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":i.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return i}function Rw(t){const{top:e,right:n,bottom:i,left:r}=t;return[{x:r,y:e},{x:n,y:e},{x:n,y:i},{x:r,y:i}]}function Dw(t,e){const{x:n,y:i}=t;let r=!1;for(let s=0,o=e.length-1;si!=u>i&&n<(c-a)*(i-l)/(u-l)+a&&(r=!r)}return r}function Iw(t){const e=t.slice();return e.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),Nw(e)}function Nw(t){if(t.length<=1)return t.slice();const e=[];for(let i=0;i=2;){const s=e.at(-1),o=e[e.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))e.pop();else break}e.push(r)}e.pop();const n=[];for(let i=t.length-1;i>=0;i--){const r=t[i];for(;n.length>=2;){const s=n.at(-1),o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var Lw=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},oo=new WeakMap,Ml=new WeakMap,wl={},$u=0,vx=function(t){return t&&(t.host||vx(t.parentNode))},Ow=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=vx(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Fw=function(t,e,n,i){var r=Ow(e,Array.isArray(t)?t:[t]);wl[n]||(wl[n]=new WeakMap);var s=wl[n],o=[],a=new Set,l=new Set(r),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};r.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(i),g=h!==null&&h!=="false",v=(oo.get(f)||0)+1,m=(s.get(f)||0)+1;oo.set(f,v),s.set(f,m),o.push(f),v===1&&g&&Ml.set(f,!0),m===1&&f.setAttribute(n,"true"),g||f.setAttribute(i,"true")}catch(p){console.error("aria-hidden: cannot operate on ",f,p)}})};return u(e),a.clear(),$u++,function(){o.forEach(function(d){var f=oo.get(d)-1,h=s.get(d)-1;oo.set(d,f),s.set(d,h),f||(Ml.has(d)||d.removeAttribute(i),Ml.delete(d)),h||d.removeAttribute(n)}),$u--,$u||(oo=new WeakMap,oo=new WeakMap,Ml=new WeakMap,wl={})}},Uw=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=Lw(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Fw(i,r,n,"aria-hidden")):function(){return null}};function kw(t){let e;sn(()=>gs(t),n=>{let i=!1;try{i=!!n?.closest("[popover]:not(:popover-open)")}catch{}n&&!i?e=Uw(n):e&&e()}),il(()=>{e&&e()})}function zh(t,e="reka"){let n;return n=DS?.(),e?`${e}-${n}`:n}function Bw(t){const e=Bh({locale:Ve("en")});return Te(()=>t?.value||e.locale?.value||"en")}function _x(t){const e=Ve(),n=Te(()=>e.value?.width??0),i=Te(()=>e.value?.height??0);return Ri(()=>{const r=gs(t);if(r){e.value={width:r.offsetWidth,height:r.offsetHeight};const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let l,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;l=d.inlineSize,c=d.blockSize}else l=r.offsetWidth,c=r.offsetHeight;e.value={width:l,height:c}});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else e.value=void 0}),{width:n,height:i}}function zw(t,e){const n=Ve(t);function i(s){return e[n.value][s]??n.value}return{state:n,dispatch:s=>{n.value=i(s)}}}function Vw(t,e){const n=Ve({}),i=Ve("none"),r=Ve(t),s=t.value?"mounted":"unmounted";let o;const a=e.value?.ownerDocument.defaultView??Uh,{state:l,dispatch:c}=zw(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{if(Di){const p=new CustomEvent(m,{bubbles:!1,cancelable:!1});e.value?.dispatchEvent(p)}};sn(t,async(m,p)=>{const _=p!==m;if(await Rr(),_){const x=i.value,y=El(e.value);m?(c("MOUNT"),u("enter"),y==="none"&&u("after-enter")):y==="none"||y==="undefined"||n.value?.display==="none"?(c("UNMOUNT"),u("leave"),u("after-leave")):p&&x!==y?(c("ANIMATION_OUT"),u("leave")):(c("UNMOUNT"),u("after-leave"))}},{immediate:!0});const d=m=>{const p=El(e.value),_=p.includes(CSS.escape(m.animationName)),x=l.value==="mounted"?"enter":"leave";if(m.target===e.value&&_&&(u(`after-${x}`),c("ANIMATION_END"),!r.value)){const y=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",o=a?.setTimeout(()=>{e.value?.style.animationFillMode==="forwards"&&(e.value.style.animationFillMode=y)})}m.target===e.value&&p==="none"&&c("ANIMATION_END")},f=m=>{m.target===e.value&&(i.value=El(e.value))},h=sn(e,(m,p)=>{m?(n.value=getComputedStyle(m),m.addEventListener("animationstart",f),m.addEventListener("animationcancel",d),m.addEventListener("animationend",d)):(c("ANIMATION_END"),o!==void 0&&a?.clearTimeout(o),p?.removeEventListener("animationstart",f),p?.removeEventListener("animationcancel",d),p?.removeEventListener("animationend",d))},{immediate:!0}),g=sn(l,()=>{const m=El(e.value);i.value=l.value==="mounted"?m:"none"});return il(()=>{h(),g()}),{isPresent:Te(()=>["mounted","unmountSuspended"].includes(l.value))}}function El(t){return t&&getComputedStyle(t).animationName||"none"}var xx=Fe({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:e,expose:n}){const{present:i,forceMount:r}=Pr(t),s=Ve(),{isPresent:o}=Vw(i,s);n({present:o});let a=e.default({present:o.value});a=kh(a||[]);const l=Br();if(a&&a?.length>1){const c=l?.parent?.type.name?`<${l.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();function Sh(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const zt={},Lo=[],Ji=()=>{},e_=()=>!1,ru=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),wh=t=>t.startsWith("onUpdate:"),bn=Object.assign,Mh=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Hb=Object.prototype.hasOwnProperty,At=(t,e)=>Hb.call(t,e),it=Array.isArray,Oo=t=>sl(t)==="[object Map]",su=t=>sl(t)==="[object Set]",hm=t=>sl(t)==="[object Date]",lt=t=>typeof t=="function",Yt=t=>typeof t=="string",Ai=t=>typeof t=="symbol",Ct=t=>t!==null&&typeof t=="object",t_=t=>(Ct(t)||lt(t))&<(t.then)&<(t.catch),n_=Object.prototype.toString,sl=t=>n_.call(t),Gb=t=>sl(t).slice(8,-1),i_=t=>sl(t)==="[object Object]",ou=t=>Yt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Na=Sh(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),au=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},Wb=/-\w/g,$n=au(t=>t.replace(Wb,e=>e.slice(1).toUpperCase())),qb=/\B([A-Z])/g,gs=au(t=>t.replace(qb,"-$1").toLowerCase()),lu=au(t=>t.charAt(0).toUpperCase()+t.slice(1)),La=au(t=>t?`on${lu(t)}`:""),ds=(t,e)=>!Object.is(t,e),gc=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},cu=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let pm;const uu=()=>pm||(pm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function kr(t){if(it(t)){const e={};for(let n=0;n{if(n){const i=n.split($b);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function dn(t){let e="";if(Yt(t))e=t;else if(it(t))for(let n=0;nol(n,e))}const o_=t=>!!(t&&t.__v_isRef===!0),Ei=t=>Yt(t)?t:t==null?"":it(t)||Ct(t)&&(t.toString===n_||!lt(t.toString))?o_(t)?Ei(t.value):JSON.stringify(t,a_,2):String(t),a_=(t,e)=>o_(e)?a_(t,e.value):Oo(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[i,r],s)=>(n[zu(i,s)+" =>"]=r,n),{})}:su(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>zu(n))}:Ai(e)?zu(e):Ct(e)&&!it(e)&&!i_(e)?String(e):e,zu=(t,e="")=>{var n;return Ai(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};let Cn;class l_{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Cn,!e&&Cn&&(this.index=(Cn.scopes||(Cn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e0&&--this._on===0&&(Cn=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(Fa){let e=Fa;for(Fa=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Oa;){let e=Oa;for(Oa=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){t||(t=i)}e=n}}if(t)throw t}function p_(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function m_(t){let e,n=t.depsTail,i=n;for(;i;){const r=i.prevDep;i.version===-1?(i===n&&(n=r),Ch(i),eS(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}t.deps=e,t.depsTail=n}function jd(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(g_(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function g_(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===qa)||(t.globalVersion=qa,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!jd(t))))return;t.flags|=2;const e=t.dep,n=qt,i=Ti;qt=t,Ti=!0;try{p_(t);const r=t.fn(t._value);(e.version===0||ds(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{qt=n,Ti=i,m_(t),t.flags&=-3}}function Ch(t,e=!1){const{dep:n,prevSub:i,nextSub:r}=t;if(i&&(i.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=i,t.nextSub=void 0),n.subs===t&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Ch(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function eS(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let Ti=!0;const v_=[];function Cr(){v_.push(Ti),Ti=!1}function Pr(){const t=v_.pop();Ti=t===void 0?!0:t}function mm(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=qt;qt=void 0;try{e()}finally{qt=n}}}let qa=0;class tS{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class du{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!qt||!Ti||qt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==qt)n=this.activeLink=new tS(qt,this),qt.deps?(n.prevDep=qt.depsTail,qt.depsTail.nextDep=n,qt.depsTail=n):qt.deps=qt.depsTail=n,__(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=qt.depsTail,n.nextDep=void 0,qt.depsTail.nextDep=n,qt.depsTail=n,qt.deps===n&&(qt.deps=i)}return n}trigger(e){this.version++,qa++,this.notify(e)}notify(e){Th();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ah()}}}function __(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)__(i)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Nc=new WeakMap,qs=Symbol(""),Qd=Symbol(""),Xa=Symbol("");function Pn(t,e,n){if(Ti&&qt){let i=Nc.get(t);i||Nc.set(t,i=new Map);let r=i.get(n);r||(i.set(n,r=new du),r.map=i,r.key=n),r.track()}}function yr(t,e,n,i,r,s){const o=Nc.get(t);if(!o){qa++;return}const a=l=>{l&&l.trigger()};if(Th(),e==="clear")o.forEach(a);else{const l=it(t),c=l&&ou(n);if(l&&n==="length"){const u=Number(i);o.forEach((d,f)=>{(f==="length"||f===Xa||!Ai(f)&&f>=u)&&a(d)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),c&&a(o.get(Xa)),e){case"add":l?c&&a(o.get("length")):(a(o.get(qs)),Oo(t)&&a(o.get(Qd)));break;case"delete":l||(a(o.get(qs)),Oo(t)&&a(o.get(Qd)));break;case"set":Oo(t)&&a(o.get(qs));break}}Ah()}function nS(t,e){const n=Nc.get(t);return n&&n.get(e)}function co(t){const e=Tt(t);return e===t?e:(Pn(e,"iterate",Xa),oi(t)?e:e.map(Ci))}function fu(t){return Pn(t=Tt(t),"iterate",Xa),t}function es(t,e){return Rr(t)?$o(Xs(t)?Ci(e):e):Ci(e)}const iS={__proto__:null,[Symbol.iterator](){return Hu(this,Symbol.iterator,t=>es(this,t))},concat(...t){return co(this).concat(...t.map(e=>it(e)?co(e):e))},entries(){return Hu(this,"entries",t=>(t[1]=es(this,t[1]),t))},every(t,e){return lr(this,"every",t,e,void 0,arguments)},filter(t,e){return lr(this,"filter",t,e,n=>n.map(i=>es(this,i)),arguments)},find(t,e){return lr(this,"find",t,e,n=>es(this,n),arguments)},findIndex(t,e){return lr(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return lr(this,"findLast",t,e,n=>es(this,n),arguments)},findLastIndex(t,e){return lr(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return lr(this,"forEach",t,e,void 0,arguments)},includes(...t){return Gu(this,"includes",t)},indexOf(...t){return Gu(this,"indexOf",t)},join(t){return co(this).join(t)},lastIndexOf(...t){return Gu(this,"lastIndexOf",t)},map(t,e){return lr(this,"map",t,e,void 0,arguments)},pop(){return ua(this,"pop")},push(...t){return ua(this,"push",t)},reduce(t,...e){return gm(this,"reduce",t,e)},reduceRight(t,...e){return gm(this,"reduceRight",t,e)},shift(){return ua(this,"shift")},some(t,e){return lr(this,"some",t,e,void 0,arguments)},splice(...t){return ua(this,"splice",t)},toReversed(){return co(this).toReversed()},toSorted(t){return co(this).toSorted(t)},toSpliced(...t){return co(this).toSpliced(...t)},unshift(...t){return ua(this,"unshift",t)},values(){return Hu(this,"values",t=>es(this,t))}};function Hu(t,e,n){const i=fu(t),r=i[e]();return i!==t&&!oi(t)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=n(s.value)),s}),r}const rS=Array.prototype;function lr(t,e,n,i,r,s){const o=fu(t),a=o!==t&&!oi(t),l=o[e];if(l!==rS[e]){const d=l.apply(t,s);return a?Ci(d):d}let c=n;o!==t&&(a?c=function(d,f){return n.call(this,es(t,d),f,t)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,t)}));const u=l.call(o,c,i);return a&&r?r(u):u}function gm(t,e,n,i){const r=fu(t);let s=n;return r!==t&&(oi(t)?n.length>3&&(s=function(o,a,l){return n.call(this,o,a,l,t)}):s=function(o,a,l){return n.call(this,o,es(t,a),l,t)}),r[e](s,...i)}function Gu(t,e,n){const i=Tt(t);Pn(i,"iterate",Xa);const r=i[e](...n);return(r===-1||r===!1)&&mu(n[0])?(n[0]=Tt(n[0]),i[e](...n)):r}function ua(t,e,n=[]){Cr(),Th();const i=Tt(t)[e].apply(t,n);return Ah(),Pr(),i}const sS=Sh("__proto__,__v_isRef,__isVue"),x_=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ai));function oS(t){Ai(t)||(t=String(t));const e=Tt(this);return Pn(e,"has",t),e.hasOwnProperty(t)}class y_{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,i){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(r?s?T_:E_:s?M_:w_).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=it(e);if(!r){let l;if(o&&(l=iS[n]))return l;if(n==="hasOwnProperty")return oS}const a=Reflect.get(e,n,Qt(e)?e:i);if((Ai(n)?x_.has(n):sS(n))||(r||Pn(e,"get",n),s))return a;if(Qt(a)){const l=o&&ou(n)?a:a.value;return r&&Ct(l)?Lc(l):l}return Ct(a)?r?Lc(a):Yn(a):a}}class b_ extends y_{constructor(e=!1){super(!1,e)}set(e,n,i,r){let s=e[n];const o=it(e)&&ou(n);if(!this._isShallow){const c=Rr(s);if(!oi(i)&&!Rr(i)&&(s=Tt(s),i=Tt(i)),!o&&Qt(s)&&!Qt(i))return c||(s.value=i),!0}const a=o?Number(n)t,Sl=t=>Reflect.getPrototypeOf(t);function dS(t,e,n){return function(...i){const r=this.__v_raw,s=Tt(r),o=Oo(s),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,c=r[t](...i),u=n?ef:e?$o:Ci;return!e&&Pn(s,"iterate",l?Qd:qs),bn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function wl(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function fS(t,e){const n={get(r){const s=this.__v_raw,o=Tt(s),a=Tt(r);t||(ds(r,a)&&Pn(o,"get",r),Pn(o,"get",a));const{has:l}=Sl(o),c=e?ef:t?$o:Ci;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!t&&Pn(Tt(r),"iterate",qs),r.size},has(r){const s=this.__v_raw,o=Tt(s),a=Tt(r);return t||(ds(r,a)&&Pn(o,"has",r),Pn(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=Tt(a),c=e?ef:t?$o:Ci;return!t&&Pn(l,"iterate",qs),a.forEach((u,d)=>r.call(s,c(u),c(d),o))}};return bn(n,t?{add:wl("add"),set:wl("set"),delete:wl("delete"),clear:wl("clear")}:{add(r){!e&&!oi(r)&&!Rr(r)&&(r=Tt(r));const s=Tt(this);return Sl(s).has.call(s,r)||(s.add(r),yr(s,"add",r,r)),this},set(r,s){!e&&!oi(s)&&!Rr(s)&&(s=Tt(s));const o=Tt(this),{has:a,get:l}=Sl(o);let c=a.call(o,r);c||(r=Tt(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?ds(s,u)&&yr(o,"set",r,s):yr(o,"add",r,s),this},delete(r){const s=Tt(this),{has:o,get:a}=Sl(s);let l=o.call(s,r);l||(r=Tt(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&yr(s,"delete",r,void 0),c},clear(){const r=Tt(this),s=r.size!==0,o=r.clear();return s&&yr(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=dS(r,t,e)}),n}function hu(t,e){const n=fS(t,e);return(i,r,s)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?i:Reflect.get(At(n,r)&&r in i?n:i,r,s)}const hS={get:hu(!1,!1)},pS={get:hu(!1,!0)},mS={get:hu(!0,!1)},gS={get:hu(!0,!0)},w_=new WeakMap,M_=new WeakMap,E_=new WeakMap,T_=new WeakMap;function vS(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function _S(t){return t.__v_skip||!Object.isExtensible(t)?0:vS(Gb(t))}function Yn(t){return Rr(t)?t:pu(t,!1,aS,hS,w_)}function xS(t){return pu(t,!1,cS,pS,M_)}function Lc(t){return pu(t,!0,lS,mS,E_)}function Fs(t){return pu(t,!0,uS,gS,T_)}function pu(t,e,n,i,r){if(!Ct(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=_S(t);if(s===0)return t;const o=r.get(t);if(o)return o;const a=new Proxy(t,s===2?i:n);return r.set(t,a),a}function Xs(t){return Rr(t)?Xs(t.__v_raw):!!(t&&t.__v_isReactive)}function Rr(t){return!!(t&&t.__v_isReadonly)}function oi(t){return!!(t&&t.__v_isShallow)}function mu(t){return t?!!t.__v_raw:!1}function Tt(t){const e=t&&t.__v_raw;return e?Tt(e):t}function A_(t){return!At(t,"__v_skip")&&Object.isExtensible(t)&&r_(t,"__v_skip",!0),t}const Ci=t=>Ct(t)?Yn(t):t,$o=t=>Ct(t)?Lc(t):t;function Qt(t){return t?t.__v_isRef===!0:!1}function Ve(t){return C_(t,!1)}function gu(t){return C_(t,!0)}function C_(t,e){return Qt(t)?t:new yS(t,e)}class yS{constructor(e,n){this.dep=new du,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Tt(e),this._value=n?e:Ci(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,i=this.__v_isShallow||oi(e)||Rr(e);e=i?e:Tt(e),ds(e,n)&&(this._rawValue=e,this._value=i?e:Ci(e),this.dep.trigger())}}function bS(t){t.dep&&t.dep.trigger()}function M(t){return Qt(t)?t.value:t}function In(t){return lt(t)?t():M(t)}const SS={get:(t,e,n)=>e==="__v_raw"?t:M(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return Qt(r)&&!Qt(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function P_(t){return Xs(t)?t:new Proxy(t,SS)}class wS{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new du,{get:i,set:r}=e(n.track.bind(n),n.trigger.bind(n));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function MS(t){return new wS(t)}function Dr(t){const e=it(t)?new Array(t.length):{};for(const n in t)e[n]=R_(t,n);return e}class ES{constructor(e,n,i){this._object=e,this._key=n,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._raw=Tt(e);let r=!0,s=e;if(!it(e)||!ou(String(n)))do r=!mu(s)||oi(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=M(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Qt(this._raw[this._key])){const n=this._object[this._key];if(Qt(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return nS(this._raw,this._key)}}class TS{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function AS(t,e,n){return Qt(t)?t:lt(t)?new TS(t):Ct(t)&&arguments.length>1?R_(t,e,n):Ve(t)}function R_(t,e,n){return new ES(t,e,n)}class CS{constructor(e,n,i){this.fn=e,this.setter=n,this._value=void 0,this.dep=new du(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=qa-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&qt!==this)return h_(this,!0),!0}get value(){const e=this.dep.track();return g_(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function PS(t,e,n=!1){let i,r;return lt(t)?i=t:(i=t.get,r=t.set),new CS(i,r,n)}const Ml={},Oc=new WeakMap;let Us;function RS(t,e=!1,n=Us){if(n){let i=Oc.get(n);i||Oc.set(n,i=[]),i.push(t)}}function DS(t,e,n=zt){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,c=y=>r?y:oi(y)||r===!1||r===0?br(y,1):br(y);let u,d,f,h,g=!1,v=!1;if(Qt(t)?(d=()=>t.value,g=oi(t)):Xs(t)?(d=()=>c(t),g=!0):it(t)?(v=!0,g=t.some(y=>Xs(y)||oi(y)),d=()=>t.map(y=>{if(Qt(y))return y.value;if(Xs(y))return c(y);if(lt(y))return l?l(y,2):y()})):lt(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){Cr();try{f()}finally{Pr()}}const y=Us;Us=u;try{return l?l(t,3,[h]):t(h)}finally{Us=y}}:d=Ji,e&&r){const y=d,E=r===!0?1/0:r;d=()=>br(y(),E)}const m=Eh(),p=()=>{u.stop(),m&&m.active&&Mh(m.effects,u)};if(s&&e){const y=e;e=(...E)=>{y(...E),p()}}let _=v?new Array(t.length).fill(Ml):Ml;const x=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(e){const E=u.run();if(r||g||(v?E.some((A,P)=>ds(A,_[P])):ds(E,_))){f&&f();const A=Us;Us=u;try{const P=[E,_===Ml?void 0:v&&_[0]===Ml?[]:_,h];_=E,l?l(e,3,P):e(...P)}finally{Us=A}}}else u.run()};return a&&a(x),u=new d_(d),u.scheduler=o?()=>o(x,!1):x,h=y=>RS(y,!1,u),f=u.onStop=()=>{const y=Oc.get(u);if(y){if(l)l(y,4);else for(const E of y)E();Oc.delete(u)}},e?i?x(!0):_=u.run():o?o(x.bind(null,!0),!0):u.run(),p.pause=u.pause.bind(u),p.resume=u.resume.bind(u),p.stop=p,p}function br(t,e=1/0,n){if(e<=0||!Ct(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Qt(t))br(t.value,e,n);else if(it(t))for(let i=0;i{br(i,e,n)});else if(i_(t)){for(const i in t)br(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&br(t[i],e,n)}return t}function al(t,e,n,i){try{return i?t(...i):t()}catch(r){vu(r,e,n)}}function Qi(t,e,n,i){if(lt(t)){const r=al(t,e,n,i);return r&&t_(r)&&r.catch(s=>{vu(s,e,n)}),r}if(it(t)){const r=[];for(let s=0;s>>1,r=Bn[i],s=$a(r);s=$a(n)?Bn.push(t):Bn.splice(NS(e),0,t),t.flags|=1,I_()}}function I_(){Fc||(Fc=D_.then(L_))}function LS(t){it(t)?Fo.push(...t):ts&&t.id===-1?ts.splice(Ao+1,0,t):t.flags&1||(Fo.push(t),t.flags|=1),I_()}function vm(t,e,n=Vi+1){for(;n$a(n)-$a(i));if(Fo.length=0,ts){ts.push(...e);return}for(ts=e,Ao=0;Aot.id==null?t.flags&2?-1:1/0:t.id;function L_(t){try{for(Vi=0;Vi{i._d&&zc(-1);const s=Uc(e);let o;try{o=t(...r)}finally{Uc(s),i._d&&zc(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function vc(t,e){if(xn===null)return t;const n=wu(xn),i=t.dirs||(t.dirs=[]);for(let r=0;r1)return n&<(e)?e.call(i&&i.proxy):e}}const OS=Symbol.for("v-scx"),FS=()=>Uo(OS);function pi(t,e){return _u(t,null,e)}function F_(t,e){return _u(t,null,{flush:"post"})}function en(t,e,n){return _u(t,e,n)}function _u(t,e,n=zt){const{immediate:i,deep:r,flush:s,once:o}=n,a=bn({},n),l=e&&i||!e&&s!=="post";let c;if(Ka){if(s==="sync"){const h=FS();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=Ji,h.resume=Ji,h.pause=Ji,h}}const u=Rn;a.call=(h,g,v)=>Qi(h,u,g,v);let d=!1;s==="post"?a.scheduler=h=>{Tn(h,u&&u.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(h,g)=>{g?h():Ph(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=DS(t,e,a);return Ka&&(c?c.push(f):l&&f()),f}function US(t,e,n){const i=this.proxy,r=Yt(t)?t.includes(".")?U_(i,t):()=>i[t]:t.bind(i,i);let s;lt(e)?s=e:(s=e.handler,n=e);const o=cl(this),a=_u(r,s.bind(i),n);return o(),a}function U_(t,e){const n=e.split(".");return()=>{let i=t;for(let r=0;rt.__isTeleport,Ua=t=>t&&(t.disabled||t.disabled===""),_m=t=>t&&(t.defer||t.defer===""),xm=t=>typeof SVGElement<"u"&&t instanceof SVGElement,ym=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,tf=(t,e)=>{const n=t&&t.to;return Yt(n)?e?e(n):null:n},B_={name:"Teleport",__isTeleport:!0,process(t,e,n,i,r,s,o,a,l,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:g,createText:v,createComment:m}}=c,p=Ua(e.props);let{shapeFlag:_,children:x,dynamicChildren:y}=e;if(t==null){const E=e.el=v(""),A=e.anchor=v("");h(E,n,i),h(A,n,i);const P=(S,w)=>{_&16&&u(x,S,w,r,s,o,a,l)},D=()=>{const S=e.target=tf(e.props,g),w=nf(S,e,v,h);S&&(o!=="svg"&&xm(S)?o="svg":o!=="mathml"&&ym(S)&&(o="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(S),p||(P(S,w),_c(e,!1)))};p&&(P(n,A),_c(e,!0)),_m(e.props)?(e.el.__isMounted=!1,Tn(()=>{D(),delete e.el.__isMounted},s)):D()}else{if(_m(e.props)&&t.el.__isMounted===!1){Tn(()=>{B_.process(t,e,n,i,r,s,o,a,l,c)},s);return}e.el=t.el,e.targetStart=t.targetStart;const E=e.anchor=t.anchor,A=e.target=t.target,P=e.targetAnchor=t.targetAnchor,D=Ua(t.props),S=D?n:A,w=D?E:P;if(o==="svg"||xm(A)?o="svg":(o==="mathml"||ym(A))&&(o="mathml"),y?(f(t.dynamicChildren,y,S,r,s,o,a),Oh(t,e,!0)):l||d(t,e,S,w,r,s,o,a,!1),p)D?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):El(e,n,E,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const N=e.target=tf(e.props,g);N&&El(e,N,null,c,0)}else D&&El(e,A,P,c,1);_c(e,p)}},remove(t,e,n,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:f}=t;if(d&&(r(c),r(u)),s&&r(l),o&16){const h=s||!Ua(f);for(let g=0;gka(v,e&&(it(e)?e[m]:e),n,i,r));return}if(ko(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&ka(t,e,n,i.component.subTree);return}const s=i.shapeFlag&4?wu(i.component):i.el,o=r?null:s,{i:a,r:l}=t,c=e&&e.r,u=a.refs===zt?a.refs={}:a.refs,d=a.setupState,f=Tt(d),h=d===zt?e_:v=>bm(u,v)?!1:At(f,v),g=(v,m)=>!(m&&bm(u,m));if(c!=null&&c!==l){if(Sm(e),Yt(c))u[c]=null,h(c)&&(d[c]=null);else if(Qt(c)){const v=e;g(c,v.k)&&(c.value=null),v.k&&(u[v.k]=null)}}if(lt(l))al(l,a,12,[o,u]);else{const v=Yt(l),m=Qt(l);if(v||m){const p=()=>{if(t.f){const _=v?h(l)?d[l]:u[l]:g()||!t.k?l.value:u[t.k];if(r)it(_)&&Mh(_,s);else if(it(_))_.includes(s)||_.push(s);else if(v)u[l]=[s],h(l)&&(d[l]=u[l]);else{const x=[s];g(l,t.k)&&(l.value=x),t.k&&(u[t.k]=x)}}else v?(u[l]=o,h(l)&&(d[l]=o)):m&&(g(l,t.k)&&(l.value=o),t.k&&(u[t.k]=o))};if(o){const _=()=>{p(),kc.delete(t)};_.id=-1,kc.set(t,_),Tn(_,n)}else Sm(t),p()}}}function Sm(t){const e=kc.get(t);e&&(e.flags|=8,kc.delete(t))}uu().requestIdleCallback;uu().cancelIdleCallback;const ko=t=>!!t.type.__asyncLoader,V_=t=>t.type.__isKeepAlive;function GS(t,e){H_(t,"a",e)}function WS(t,e){H_(t,"da",e)}function H_(t,e,n=Rn){const i=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(xu(e,i,n),n){let r=n.parent;for(;r&&r.parent;)V_(r.parent.vnode)&&qS(i,e,n,r),r=r.parent}}function qS(t,e,n,i){const r=xu(e,t,i,!0);ra(()=>{Mh(i[e],r)},n)}function xu(t,e,n=Rn,i=!1){if(n){const r=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{Cr();const a=cl(n),l=Qi(e,n,t,o);return a(),Pr(),l});return i?r.unshift(s):r.push(s),s}}const Br=t=>(e,n=Rn)=>{(!Ka||t==="sp")&&xu(t,(...i)=>e(...i),n)},XS=Br("bm"),Ni=Br("m"),$S=Br("bu"),G_=Br("u"),yu=Br("bum"),ra=Br("um"),YS=Br("sp"),JS=Br("rtg"),KS=Br("rtc");function ZS(t,e=Rn){xu("ec",t,e)}const jS="components",W_=Symbol.for("v-ndc");function Ih(t){return Yt(t)?QS(jS,t,!1)||t:t||W_}function QS(t,e,n=!0,i=!1){const r=xn||Rn;if(r){const s=r.type;{const a=kw(s,!1);if(a&&(a===e||a===$n(e)||a===lu($n(e))))return s}const o=wm(r[t]||s[t],e)||wm(r.appContext[t],e);return!o&&i?s:o}}function wm(t,e){return t&&(t[e]||t[$n(e)]||t[lu($n(e))])}function ll(t,e,n,i){let r;const s=n,o=it(t);if(o||Yt(t)){const a=o&&Xs(t);let l=!1,c=!1;a&&(l=!oi(t),c=Rr(t),t=fu(t)),r=new Array(t.length);for(let u=0,d=t.length;ue(a,l,void 0,s));else{const a=Object.keys(t);r=new Array(a.length);for(let l=0,c=a.length;l0;return me(),Be(nn,null,[ie("slot",n,i&&i())],c?-2:64)}let s=t[e];s&&s._c&&(s._d=!1),me();const o=s&&q_(s(n)),a=n.key||o&&o.key,l=Be(nn,{key:(a&&!Ai(a)?a:`_${e}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&t._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function q_(t){return t.some(e=>Ja(e)?!(e.type===er||e.type===nn&&!q_(e.children)):!0)?t:null}function ew(t,e){const n={};for(const i in t)n[La(i)]=t[i];return n}const rf=t=>t?ux(t)?wu(t):rf(t.parent):null,Ba=bn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>rf(t.parent),$root:t=>rf(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>$_(t),$forceUpdate:t=>t.f||(t.f=()=>{Ph(t.update)}),$nextTick:t=>t.n||(t.n=Ir.bind(t.proxy)),$watch:t=>US.bind(t)}),Wu=(t,e)=>t!==zt&&!t.__isScriptSetup&&At(t,e),tw={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=t;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return r[e];case 4:return n[e];case 3:return s[e]}else{if(Wu(i,e))return o[e]=1,i[e];if(r!==zt&&At(r,e))return o[e]=2,r[e];if(At(s,e))return o[e]=3,s[e];if(n!==zt&&At(n,e))return o[e]=4,n[e];of&&(o[e]=0)}}const c=Ba[e];let u,d;if(c)return e==="$attrs"&&Pn(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==zt&&At(n,e))return o[e]=4,n[e];if(d=l.config.globalProperties,At(d,e))return d[e]},set({_:t},e,n){const{data:i,setupState:r,ctx:s}=t;return Wu(r,e)?(r[e]=n,!0):i!==zt&&At(i,e)?(i[e]=n,!0):At(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:r,props:s,type:o}},a){let l;return!!(n[a]||t!==zt&&a[0]!=="$"&&At(t,a)||Wu(e,a)||At(s,a)||At(i,a)||At(Ba,a)||At(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:At(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function sf(t){return it(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function nw(t,e){const n=sf(t);for(const i in e){if(i.startsWith("__skip"))continue;let r=n[i];r?it(r)||lt(r)?r=n[i]={type:r,default:e[i]}:r.default=e[i]:r===null&&(r=n[i]={default:e[i]}),r&&e[`__skip_${i}`]&&(r.skipFactory=!0)}return n}let of=!0;function iw(t){const e=$_(t),n=t.proxy,i=t.ctx;of=!1,e.beforeCreate&&Mm(e.beforeCreate,t,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:g,activated:v,deactivated:m,beforeDestroy:p,beforeUnmount:_,destroyed:x,unmounted:y,render:E,renderTracked:A,renderTriggered:P,errorCaptured:D,serverPrefetch:S,expose:w,inheritAttrs:N,components:B,directives:W,filters:Z}=e;if(c&&rw(c,i,null),o)for(const k in o){const J=o[k];lt(J)&&(i[k]=J.bind(n))}if(r){const k=r.call(n,n);Ct(k)&&(t.data=Yn(k))}if(of=!0,s)for(const k in s){const J=s[k],ue=lt(J)?J.bind(n,n):lt(J.get)?J.get.bind(n,n):Ji,Y=!lt(J)&<(J.set)?J.set.bind(n):Ji,pe=Te({get:ue,set:Y});Object.defineProperty(i,k,{enumerable:!0,configurable:!0,get:()=>pe.value,set:Ge=>pe.value=Ge})}if(a)for(const k in a)X_(a[k],i,n,k);if(l){const k=lt(l)?l.call(n):l;Reflect.ownKeys(k).forEach(J=>{Rh(J,k[J])})}u&&Mm(u,t,"c");function H(k,J){it(J)?J.forEach(ue=>k(ue.bind(n))):J&&k(J.bind(n))}if(H(XS,d),H(Ni,f),H($S,h),H(G_,g),H(GS,v),H(WS,m),H(ZS,D),H(KS,A),H(JS,P),H(yu,_),H(ra,y),H(YS,S),it(w))if(w.length){const k=t.exposed||(t.exposed={});w.forEach(J=>{Object.defineProperty(k,J,{get:()=>n[J],set:ue=>n[J]=ue,enumerable:!0})})}else t.exposed||(t.exposed={});E&&t.render===Ji&&(t.render=E),N!=null&&(t.inheritAttrs=N),B&&(t.components=B),W&&(t.directives=W),S&&z_(t)}function rw(t,e,n=Ji){it(t)&&(t=af(t));for(const i in t){const r=t[i];let s;Ct(r)?"default"in r?s=Uo(r.from||i,r.default,!0):s=Uo(r.from||i):s=Uo(r),Qt(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function Mm(t,e,n){Qi(it(t)?t.map(i=>i.bind(e.proxy)):t.bind(e.proxy),e,n)}function X_(t,e,n,i){let r=i.includes(".")?U_(n,i):()=>n[i];if(Yt(t)){const s=e[t];lt(s)&&en(r,s)}else if(lt(t))en(r,t.bind(n));else if(Ct(t))if(it(t))t.forEach(s=>X_(s,e,n,i));else{const s=lt(t.handler)?t.handler.bind(n):e[t.handler];lt(s)&&en(r,s,t)}}function $_(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!n&&!i?l=e:(l={},r.length&&r.forEach(c=>Bc(l,c,o,!0)),Bc(l,e,o)),Ct(e)&&s.set(e,l),l}function Bc(t,e,n,i=!1){const{mixins:r,extends:s}=e;s&&Bc(t,s,n,!0),r&&r.forEach(o=>Bc(t,o,n,!0));for(const o in e)if(!(i&&o==="expose")){const a=sw[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const sw={data:Em,props:Tm,emits:Tm,methods:Ea,computed:Ea,beforeCreate:Fn,created:Fn,beforeMount:Fn,mounted:Fn,beforeUpdate:Fn,updated:Fn,beforeDestroy:Fn,beforeUnmount:Fn,destroyed:Fn,unmounted:Fn,activated:Fn,deactivated:Fn,errorCaptured:Fn,serverPrefetch:Fn,components:Ea,directives:Ea,watch:aw,provide:Em,inject:ow};function Em(t,e){return e?t?function(){return bn(lt(t)?t.call(this,this):t,lt(e)?e.call(this,this):e)}:e:t}function ow(t,e){return Ea(af(t),af(e))}function af(t){if(it(t)){const e={};for(let n=0;ne==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${$n(e)}Modifiers`]||t[`${gs(e)}Modifiers`];function dw(t,e,...n){if(t.isUnmounted)return;const i=t.vnode.props||zt;let r=n;const s=e.startsWith("update:"),o=s&&uw(i,e.slice(7));o&&(o.trim&&(r=n.map(u=>Yt(u)?u.trim():u)),o.number&&(r=n.map(cu)));let a,l=i[a=La(e)]||i[a=La($n(e))];!l&&s&&(l=i[a=La(gs(e))]),l&&Qi(l,t,6,r);const c=i[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,Qi(c,t,6,r)}}const fw=new WeakMap;function J_(t,e,n=!1){const i=n?fw:e.emitsCache,r=i.get(t);if(r!==void 0)return r;const s=t.emits;let o={},a=!1;if(!lt(t)){const l=c=>{const u=J_(c,e,!0);u&&(a=!0,bn(o,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(Ct(t)&&i.set(t,null),null):(it(s)?s.forEach(l=>o[l]=null):bn(o,s),Ct(t)&&i.set(t,o),o)}function bu(t,e){return!t||!ru(e)?!1:(e=e.slice(2).replace(/Once$/,""),At(t,e[0].toLowerCase()+e.slice(1))||At(t,gs(e))||At(t,e))}function Am(t){const{type:e,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:g,inheritAttrs:v}=t,m=Uc(t);let p,_;try{if(n.shapeFlag&4){const y=r||i,E=y;p=Gi(c.call(E,y,u,d,h,f,g)),_=a}else{const y=e;p=Gi(y.length>1?y(d,{attrs:a,slots:o,emit:l}):y(d,null)),_=e.props?a:hw(a)}}catch(y){za.length=0,vu(y,t,1),p=ie(er)}let x=p;if(_&&v!==!1){const y=Object.keys(_),{shapeFlag:E}=x;y.length&&E&7&&(s&&y.some(wh)&&(_=pw(_,s)),x=Ks(x,_,!1,!0))}return n.dirs&&(x=Ks(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(n.dirs):n.dirs),n.transition&&Dh(x,n.transition),p=x,Uc(m),p}const hw=t=>{let e;for(const n in t)(n==="class"||n==="style"||ru(n))&&((e||(e={}))[n]=t[n]);return e},pw=(t,e)=>{const n={};for(const i in t)(!wh(i)||!(i.slice(9)in e))&&(n[i]=t[i]);return n};function mw(t,e,n){const{props:i,children:r,component:s}=t,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?Cm(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let d=0;dObject.create(Z_),Q_=t=>Object.getPrototypeOf(t)===Z_;function vw(t,e,n,i=!1){const r={},s=j_();t.propsDefaults=Object.create(null),ex(t,e,r,s);for(const o in t.propsOptions[0])o in r||(r[o]=void 0);n?t.props=i?r:xS(r):t.type.props?t.props=r:t.props=s,t.attrs=s}function _w(t,e,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=t,a=Tt(r),[l]=t.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let d=0;d{l=!0;const[f,h]=tx(d,e,!0);bn(o,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!s&&!l)return Ct(t)&&i.set(t,Lo),Lo;if(it(s))for(let u=0;ut==="_"||t==="_ctx"||t==="$stable",Lh=t=>it(t)?t.map(Gi):[Gi(t)],yw=(t,e,n)=>{if(e._n)return e;const i=re((...r)=>Lh(e(...r)),n);return i._c=!1,i},nx=(t,e,n)=>{const i=t._ctx;for(const r in t){if(Nh(r))continue;const s=t[r];if(lt(s))e[r]=yw(r,s,i);else if(s!=null){const o=Lh(s);e[r]=()=>o}}},ix=(t,e)=>{const n=Lh(e);t.slots.default=()=>n},rx=(t,e,n)=>{for(const i in e)(n||!Nh(i))&&(t[i]=e[i])},bw=(t,e,n)=>{const i=t.slots=j_();if(t.vnode.shapeFlag&32){const r=e._;r?(rx(i,e,n),n&&r_(i,"_",r,!0)):nx(e,i)}else e&&ix(t,e)},Sw=(t,e,n)=>{const{vnode:i,slots:r}=t;let s=!0,o=zt;if(i.shapeFlag&32){const a=e._;a?n&&a===1?s=!1:rx(r,e,n):(s=!e.$stable,nx(e,r)),o=e}else e&&(ix(t,e),o={default:1});if(s)for(const a in r)!Nh(a)&&o[a]==null&&delete r[a]},Tn=Aw;function ww(t){return Mw(t)}function Mw(t,e){const n=uu();n.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=Ji,insertStaticContent:g}=t,v=(L,U,O,G=null,z=null,$=null,C=void 0,ce=null,ee=!!U.dynamicChildren)=>{if(L===U)return;L&&!da(L,U)&&(G=fe(L),Ge(L,z,$,!0),L=null),U.patchFlag===-2&&(ee=!1,U.dynamicChildren=null);const{type:te,ref:le,shapeFlag:T}=U;switch(te){case Su:m(L,U,O,G);break;case er:p(L,U,O,G);break;case xc:L==null&&_(U,O,G,C);break;case nn:B(L,U,O,G,z,$,C,ce,ee);break;default:T&1?E(L,U,O,G,z,$,C,ce,ee):T&6?W(L,U,O,G,z,$,C,ce,ee):(T&64||T&128)&&te.process(L,U,O,G,z,$,C,ce,ee,De)}le!=null&&z?ka(le,L&&L.ref,$,U||L,!U):le==null&&L&&L.ref!=null&&ka(L.ref,null,$,L,!0)},m=(L,U,O,G)=>{if(L==null)i(U.el=a(U.children),O,G);else{const z=U.el=L.el;U.children!==L.children&&c(z,U.children)}},p=(L,U,O,G)=>{L==null?i(U.el=l(U.children||""),O,G):U.el=L.el},_=(L,U,O,G)=>{[L.el,L.anchor]=g(L.children,U,O,G,L.el,L.anchor)},x=({el:L,anchor:U},O,G)=>{let z;for(;L&&L!==U;)z=f(L),i(L,O,G),L=z;i(U,O,G)},y=({el:L,anchor:U})=>{let O;for(;L&&L!==U;)O=f(L),r(L),L=O;r(U)},E=(L,U,O,G,z,$,C,ce,ee)=>{if(U.type==="svg"?C="svg":U.type==="math"&&(C="mathml"),L==null)A(U,O,G,z,$,C,ce,ee);else{const te=L.el&&L.el._isVueCE?L.el:null;try{te&&te._beginPatch(),S(L,U,z,$,C,ce,ee)}finally{te&&te._endPatch()}}},A=(L,U,O,G,z,$,C,ce)=>{let ee,te;const{props:le,shapeFlag:T,transition:b,dirs:F}=L;if(ee=L.el=o(L.type,$,le&&le.is,le),T&8?u(ee,L.children):T&16&&D(L.children,ee,null,G,z,qu(L,$),C,ce),F&&Ms(L,null,G,"created"),P(ee,L,L.scopeId,C,G),le){for(const ae in le)ae!=="value"&&!Na(ae)&&s(ee,ae,null,le[ae],$,G);"value"in le&&s(ee,"value",null,le.value,$),(te=le.onVnodeBeforeMount)&&ki(te,G,L)}F&&Ms(L,null,G,"beforeMount");const K=Ew(z,b);K&&b.beforeEnter(ee),i(ee,U,O),((te=le&&le.onVnodeMounted)||K||F)&&Tn(()=>{te&&ki(te,G,L),K&&b.enter(ee),F&&Ms(L,null,G,"mounted")},z)},P=(L,U,O,G,z)=>{if(O&&h(L,O),G)for(let $=0;${for(let te=ee;te{const ce=U.el=L.el;let{patchFlag:ee,dynamicChildren:te,dirs:le}=U;ee|=L.patchFlag&16;const T=L.props||zt,b=U.props||zt;let F;if(O&&Es(O,!1),(F=b.onVnodeBeforeUpdate)&&ki(F,O,U,L),le&&Ms(U,L,O,"beforeUpdate"),O&&Es(O,!0),(T.innerHTML&&b.innerHTML==null||T.textContent&&b.textContent==null)&&u(ce,""),te?w(L.dynamicChildren,te,ce,O,G,qu(U,z),$):C||J(L,U,ce,null,O,G,qu(U,z),$,!1),ee>0){if(ee&16)N(ce,T,b,O,z);else if(ee&2&&T.class!==b.class&&s(ce,"class",null,b.class,z),ee&4&&s(ce,"style",T.style,b.style,z),ee&8){const K=U.dynamicProps;for(let ae=0;ae{F&&ki(F,O,U,L),le&&Ms(U,L,O,"updated")},G)},w=(L,U,O,G,z,$,C)=>{for(let ce=0;ce{if(U!==O){if(U!==zt)for(const $ in U)!Na($)&&!($ in O)&&s(L,$,U[$],null,z,G);for(const $ in O){if(Na($))continue;const C=O[$],ce=U[$];C!==ce&&$!=="value"&&s(L,$,ce,C,z,G)}"value"in O&&s(L,"value",U.value,O.value,z)}},B=(L,U,O,G,z,$,C,ce,ee)=>{const te=U.el=L?L.el:a(""),le=U.anchor=L?L.anchor:a("");let{patchFlag:T,dynamicChildren:b,slotScopeIds:F}=U;F&&(ce=ce?ce.concat(F):F),L==null?(i(te,O,G),i(le,O,G),D(U.children||[],O,le,z,$,C,ce,ee)):T>0&&T&64&&b&&L.dynamicChildren&&L.dynamicChildren.length===b.length?(w(L.dynamicChildren,b,O,z,$,C,ce),(U.key!=null||z&&U===z.subTree)&&Oh(L,U,!0)):J(L,U,O,le,z,$,C,ce,ee)},W=(L,U,O,G,z,$,C,ce,ee)=>{U.slotScopeIds=ce,L==null?U.shapeFlag&512?z.ctx.activate(U,O,G,C,ee):Z(U,O,G,z,$,C,ee):X(L,U,ee)},Z=(L,U,O,G,z,$,C)=>{const ce=L.component=Nw(L,G,z);if(V_(L)&&(ce.ctx.renderer=De),Lw(ce,!1,C),ce.asyncDep){if(z&&z.registerDep(ce,H,C),!L.el){const ee=ce.subTree=ie(er);p(null,ee,U,O),L.placeholder=ee.el}}else H(ce,L,U,O,z,$,C)},X=(L,U,O)=>{const G=U.component=L.component;if(mw(L,U,O))if(G.asyncDep&&!G.asyncResolved){k(G,U,O);return}else G.next=U,G.update();else U.el=L.el,G.vnode=U},H=(L,U,O,G,z,$,C)=>{const ce=()=>{if(L.isMounted){let{next:T,bu:b,u:F,parent:K,vnode:ae}=L;{const Ye=sx(L);if(Ye){T&&(T.el=ae.el,k(L,T,C)),Ye.asyncDep.then(()=>{Tn(()=>{L.isUnmounted||te()},z)});return}}let j=T,Ae;Es(L,!1),T?(T.el=ae.el,k(L,T,C)):T=ae,b&&gc(b),(Ae=T.props&&T.props.onVnodeBeforeUpdate)&&ki(Ae,K,T,ae),Es(L,!0);const ve=Am(L),Le=L.subTree;L.subTree=ve,v(Le,ve,d(Le.el),fe(Le),L,z,$),T.el=ve.el,j===null&&gw(L,ve.el),F&&Tn(F,z),(Ae=T.props&&T.props.onVnodeUpdated)&&Tn(()=>ki(Ae,K,T,ae),z)}else{let T;const{el:b,props:F}=U,{bm:K,m:ae,parent:j,root:Ae,type:ve}=L,Le=ko(U);Es(L,!1),K&&gc(K),!Le&&(T=F&&F.onVnodeBeforeMount)&&ki(T,j,U),Es(L,!0);{Ae.ce&&Ae.ce._hasShadowRoot()&&Ae.ce._injectChildStyle(ve);const Ye=L.subTree=Am(L);v(null,Ye,O,G,L,z,$),U.el=Ye.el}if(ae&&Tn(ae,z),!Le&&(T=F&&F.onVnodeMounted)){const Ye=U;Tn(()=>ki(T,j,Ye),z)}(U.shapeFlag&256||j&&ko(j.vnode)&&j.vnode.shapeFlag&256)&&L.a&&Tn(L.a,z),L.isMounted=!0,U=O=G=null}};L.scope.on();const ee=L.effect=new d_(ce);L.scope.off();const te=L.update=ee.run.bind(ee),le=L.job=ee.runIfDirty.bind(ee);le.i=L,le.id=L.uid,ee.scheduler=()=>Ph(le),Es(L,!0),te()},k=(L,U,O)=>{U.component=L;const G=L.vnode.props;L.vnode=U,L.next=null,_w(L,U.props,G,O),Sw(L,U.children,O),Cr(),vm(L),Pr()},J=(L,U,O,G,z,$,C,ce,ee=!1)=>{const te=L&&L.children,le=L?L.shapeFlag:0,T=U.children,{patchFlag:b,shapeFlag:F}=U;if(b>0){if(b&128){Y(te,T,O,G,z,$,C,ce,ee);return}else if(b&256){ue(te,T,O,G,z,$,C,ce,ee);return}}F&8?(le&16&&oe(te,z,$),T!==te&&u(O,T)):le&16?F&16?Y(te,T,O,G,z,$,C,ce,ee):oe(te,z,$,!0):(le&8&&u(O,""),F&16&&D(T,O,G,z,$,C,ce,ee))},ue=(L,U,O,G,z,$,C,ce,ee)=>{L=L||Lo,U=U||Lo;const te=L.length,le=U.length,T=Math.min(te,le);let b;for(b=0;ble?oe(L,z,$,!0,!1,T):D(U,O,G,z,$,C,ce,ee,T)},Y=(L,U,O,G,z,$,C,ce,ee)=>{let te=0;const le=U.length;let T=L.length-1,b=le-1;for(;te<=T&&te<=b;){const F=L[te],K=U[te]=ee?vr(U[te]):Gi(U[te]);if(da(F,K))v(F,K,O,null,z,$,C,ce,ee);else break;te++}for(;te<=T&&te<=b;){const F=L[T],K=U[b]=ee?vr(U[b]):Gi(U[b]);if(da(F,K))v(F,K,O,null,z,$,C,ce,ee);else break;T--,b--}if(te>T){if(te<=b){const F=b+1,K=Fb)for(;te<=T;)Ge(L[te],z,$,!0),te++;else{const F=te,K=te,ae=new Map;for(te=K;te<=b;te++){const Ce=U[te]=ee?vr(U[te]):Gi(U[te]);Ce.key!=null&&ae.set(Ce.key,te)}let j,Ae=0;const ve=b-K+1;let Le=!1,Ye=0;const ge=new Array(ve);for(te=0;te=ve){Ge(Ce,z,$,!0);continue}let ke;if(Ce.key!=null)ke=ae.get(Ce.key);else for(j=K;j<=b;j++)if(ge[j-K]===0&&da(Ce,U[j])){ke=j;break}ke===void 0?Ge(Ce,z,$,!0):(ge[ke-K]=te+1,ke>=Ye?Ye=ke:Le=!0,v(Ce,U[ke],O,null,z,$,C,ce,ee),Ae++)}const Me=Le?Tw(ge):Lo;for(j=Me.length-1,te=ve-1;te>=0;te--){const Ce=K+te,ke=U[Ce],we=U[Ce+1],dt=Ce+1{const{el:$,type:C,transition:ce,children:ee,shapeFlag:te}=L;if(te&6){pe(L.component.subTree,U,O,G);return}if(te&128){L.suspense.move(U,O,G);return}if(te&64){C.move(L,U,O,De);return}if(C===nn){i($,U,O);for(let T=0;Tce.enter($),z);else{const{leave:T,delayLeave:b,afterLeave:F}=ce,K=()=>{L.ctx.isUnmounted?r($):i($,U,O)},ae=()=>{$._isLeaving&&$[VS](!0),T($,()=>{K(),F&&F()})};b?b($,K,ae):ae()}else i($,U,O)},Ge=(L,U,O,G=!1,z=!1)=>{const{type:$,props:C,ref:ce,children:ee,dynamicChildren:te,shapeFlag:le,patchFlag:T,dirs:b,cacheIndex:F}=L;if(T===-2&&(z=!1),ce!=null&&(Cr(),ka(ce,null,O,L,!0),Pr()),F!=null&&(U.renderCache[F]=void 0),le&256){U.ctx.deactivate(L);return}const K=le&1&&b,ae=!ko(L);let j;if(ae&&(j=C&&C.onVnodeBeforeUnmount)&&ki(j,U,L),le&6)at(L.component,O,G);else{if(le&128){L.suspense.unmount(O,G);return}K&&Ms(L,null,U,"beforeUnmount"),le&64?L.type.remove(L,U,O,De,G):te&&!te.hasOnce&&($!==nn||T>0&&T&64)?oe(te,U,O,!1,!0):($===nn&&T&384||!z&&le&16)&&oe(ee,U,O),G&&Ze(L)}(ae&&(j=C&&C.onVnodeUnmounted)||K)&&Tn(()=>{j&&ki(j,U,L),K&&Ms(L,null,U,"unmounted")},O)},Ze=L=>{const{type:U,el:O,anchor:G,transition:z}=L;if(U===nn){xt(O,G);return}if(U===xc){y(L);return}const $=()=>{r(O),z&&!z.persisted&&z.afterLeave&&z.afterLeave()};if(L.shapeFlag&1&&z&&!z.persisted){const{leave:C,delayLeave:ce}=z,ee=()=>C(O,$);ce?ce(L.el,$,ee):ee()}else $()},xt=(L,U)=>{let O;for(;L!==U;)O=f(L),r(L),L=O;r(U)},at=(L,U,O)=>{const{bum:G,scope:z,job:$,subTree:C,um:ce,m:ee,a:te}=L;Rm(ee),Rm(te),G&&gc(G),z.stop(),$&&($.flags|=8,Ge(C,L,U,O)),ce&&Tn(ce,U),Tn(()=>{L.isUnmounted=!0},U)},oe=(L,U,O,G=!1,z=!1,$=0)=>{for(let C=$;C{if(L.shapeFlag&6)return fe(L.component.subTree);if(L.shapeFlag&128)return L.suspense.next();const U=f(L.anchor||L.el),O=U&&U[k_];return O?f(O):U};let Ie=!1;const Ne=(L,U,O)=>{let G;L==null?U._vnode&&(Ge(U._vnode,null,null,!0),G=U._vnode.component):v(U._vnode||null,L,U,null,null,null,O),U._vnode=L,Ie||(Ie=!0,vm(G),N_(),Ie=!1)},De={p:v,um:Ge,m:pe,r:Ze,mt:Z,mc:D,pc:J,pbc:w,n:fe,o:t};return{render:Ne,hydrate:void 0,createApp:cw(Ne)}}function qu({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Es({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Ew(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Oh(t,e,n=!1){const i=t.children,r=e.children;if(it(i)&&it(r))for(let s=0;s>1,t[n[a]]0&&(e[i]=n[s-1]),n[s]=i)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=e[o];return n}function sx(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:sx(e)}function Rm(t){if(t)for(let e=0;et.__isSuspense;function Aw(t,e){e&&e.pendingBranch?it(t)?e.effects.push(...t):e.effects.push(t):LS(t)}const nn=Symbol.for("v-fgt"),Su=Symbol.for("v-txt"),er=Symbol.for("v-cmt"),xc=Symbol.for("v-stc"),za=[];let ii=null;function me(t=!1){za.push(ii=t?null:[])}function Cw(){za.pop(),ii=za[za.length-1]||null}let Ya=1;function zc(t,e=!1){Ya+=t,t<0&&ii&&e&&(ii.hasOnce=!0)}function lx(t){return t.dynamicChildren=Ya>0?ii||Lo:null,Cw(),Ya>0&&ii&&ii.push(t),t}function Mt(t,e,n,i,r,s){return lx(He(t,e,n,i,r,s,!0))}function Be(t,e,n,i,r){return lx(ie(t,e,n,i,r,!0))}function Ja(t){return t?t.__v_isVNode===!0:!1}function da(t,e){return t.type===e.type&&t.key===e.key}const cx=({key:t})=>t??null,yc=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Yt(t)||Qt(t)||lt(t)?{i:xn,r:t,k:e,f:!!n}:t:null);function He(t,e=null,n=null,i=0,r=null,s=t===nn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&cx(e),ref:e&&yc(e),scopeId:O_,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:xn};return a?(Fh(l,n),s&128&&t.normalize(l)):n&&(l.shapeFlag|=Yt(n)?8:16),Ya>0&&!o&&ii&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&ii.push(l),l}const ie=Pw;function Pw(t,e=null,n=null,i=0,r=null,s=!1){if((!t||t===W_)&&(t=er),Ja(t)){const a=Ks(t,e,!0);return n&&Fh(a,n),Ya>0&&!s&&ii&&(a.shapeFlag&6?ii[ii.indexOf(t)]=a:ii.push(a)),a.patchFlag=-2,a}if(Bw(t)&&(t=t.__vccOpts),e){e=zr(e);let{class:a,style:l}=e;a&&!Yt(a)&&(e.class=dn(a)),Ct(l)&&(mu(l)&&!it(l)&&(l=bn({},l)),e.style=kr(l))}const o=Yt(t)?1:ax(t)?128:kS(t)?64:Ct(t)?4:lt(t)?2:0;return He(t,e,n,i,r,o,s,!0)}function zr(t){return t?mu(t)||Q_(t)?bn({},t):t:null}function Ks(t,e,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=t,c=e?Nt(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&cx(c),ref:e&&e.ref?n&&s?it(s)?s.concat(yc(e)):[s,yc(e)]:yc(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==nn?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ks(t.ssContent),ssFallback:t.ssFallback&&Ks(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&i&&Dh(u,l.clone(u)),u}function Ht(t=" ",e=0){return ie(Su,null,t,e)}function Rw(t,e){const n=ie(xc,null,t);return n.staticCount=e,n}function ri(t="",e=!1){return e?(me(),Be(er,null,t)):ie(er,null,t)}function Gi(t){return t==null||typeof t=="boolean"?ie(er):it(t)?ie(nn,null,t.slice()):Ja(t)?vr(t):ie(Su,null,String(t))}function vr(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Ks(t)}function Fh(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(it(e))n=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),Fh(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!Q_(e)?e._ctx=xn:r===3&&xn&&(xn.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else lt(e)?(e={default:e,_ctx:xn},n=32):(e=String(e),i&64?(n=16,e=[Ht(e)]):n=8);t.children=e,t.shapeFlag|=n}function Nt(...t){const e={};for(let n=0;nRn||xn;let Vc,cf;{const t=uu(),e=(n,i)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Vc=e("__VUE_INSTANCE_SETTERS__",n=>Rn=n),cf=e("__VUE_SSR_SETTERS__",n=>Ka=n)}const cl=t=>{const e=Rn;return Vc(t),t.scope.on(),()=>{t.scope.off(),Vc(e)}},Dm=()=>{Rn&&Rn.scope.off(),Vc(null)};function ux(t){return t.vnode.shapeFlag&4}let Ka=!1;function Lw(t,e=!1,n=!1){e&&cf(e);const{props:i,children:r}=t.vnode,s=ux(t);vw(t,i,s,e),bw(t,r,n||e);const o=s?Ow(t,e):void 0;return e&&cf(!1),o}function Ow(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,tw);const{setup:i}=n;if(i){Cr();const r=t.setupContext=i.length>1?Uw(t):null,s=cl(t),o=al(i,t,0,[t.props,r]),a=t_(o);if(Pr(),s(),(a||t.sp)&&!ko(t)&&z_(t),a){if(o.then(Dm,Dm),e)return o.then(l=>{Im(t,l)}).catch(l=>{vu(l,t,0)});t.asyncDep=o}else Im(t,o)}else dx(t)}function Im(t,e,n){lt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Ct(e)&&(t.setupState=P_(e)),dx(t)}function dx(t,e,n){const i=t.type;t.render||(t.render=i.render||Ji);{const r=cl(t);Cr();try{iw(t)}finally{Pr(),r()}}}const Fw={get(t,e){return Pn(t,"get",""),t[e]}};function Uw(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,Fw),slots:t.slots,emit:t.emit,expose:e}}function wu(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(P_(A_(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Ba)return Ba[n](t)},has(e,n){return n in e||n in Ba}})):t.proxy}function kw(t,e=!0){return lt(t)?t.displayName||t.name:t.name||e&&t.__name}function Bw(t){return lt(t)&&"__vccOpts"in t}const Te=(t,e)=>PS(t,e,Ka);function wr(t,e,n){try{zc(-1);const i=arguments.length;return i===2?Ct(e)&&!it(e)?Ja(e)?ie(t,null,[e]):ie(t,e):ie(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&Ja(n)&&(n=[n]),ie(t,e,n))}finally{zc(1)}}const zw="3.5.28";let uf;const Nm=typeof window<"u"&&window.trustedTypes;if(Nm)try{uf=Nm.createPolicy("vue",{createHTML:t=>t})}catch{}const fx=uf?t=>uf.createHTML(t):t=>t,Vw="http://www.w3.org/2000/svg",Hw="http://www.w3.org/1998/Math/MathML",gr=typeof document<"u"?document:null,Lm=gr&&gr.createElement("template"),Gw={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,i)=>{const r=e==="svg"?gr.createElementNS(Vw,t):e==="mathml"?gr.createElementNS(Hw,t):n?gr.createElement(t,{is:n}):gr.createElement(t);return t==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:t=>gr.createTextNode(t),createComment:t=>gr.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>gr.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,i,r,s){const o=n?n.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{Lm.innerHTML=fx(i==="svg"?`${t}`:i==="mathml"?`${t}`:t);const a=Lm.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Ww=Symbol("_vtc");function qw(t,e,n){const i=t[Ww];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Om=Symbol("_vod"),Xw=Symbol("_vsh"),$w=Symbol(""),Yw=/(?:^|;)\s*display\s*:/;function Jw(t,e,n){const i=t.style,r=Yt(n);let s=!1;if(n&&!r){if(e)if(Yt(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&bc(i,a,"")}else for(const o in e)n[o]==null&&bc(i,o,"");for(const o in n)o==="display"&&(s=!0),bc(i,o,n[o])}else if(r){if(e!==n){const o=i[$w];o&&(n+=";"+o),i.cssText=n,s=Yw.test(n)}}else e&&t.removeAttribute("style");Om in t&&(t[Om]=s?i.display:"",t[Xw]&&(i.display="none"))}const Fm=/\s*!important$/;function bc(t,e,n){if(it(n))n.forEach(i=>bc(t,e,i));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const i=Kw(t,e);Fm.test(n)?t.setProperty(gs(i),n.replace(Fm,""),"important"):t[i]=n}}const Um=["Webkit","Moz","ms"],Xu={};function Kw(t,e){const n=Xu[e];if(n)return n;let i=$n(e);if(i!=="filter"&&i in t)return Xu[e]=i;i=lu(i);for(let r=0;r$u||(eM.then(()=>$u=0),$u=Date.now());function nM(t,e){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;Qi(iM(i,n.value),e,5,[i])};return n.value=t,n.attached=tM(),n}function iM(t,e){if(it(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const Gm=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,rM=(t,e,n,i,r,s)=>{const o=r==="svg";e==="class"?qw(t,i,o):e==="style"?Jw(t,n,i):ru(e)?wh(e)||jw(t,e,n,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):sM(t,e,i,o))?(zm(t,e,i),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Bm(t,e,i,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Yt(i))?zm(t,$n(e),i,s,e):(e==="true-value"?t._trueValue=i:e==="false-value"&&(t._falseValue=i),Bm(t,e,i,o))};function sM(t,e,n,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in t&&Gm(e)&<(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Gm(e)&&Yt(n)?!1:e in t}const Hc=t=>{const e=t.props["onUpdate:modelValue"]||!1;return it(e)?n=>gc(e,n):e};function oM(t){t.target.composing=!0}function Wm(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const zo=Symbol("_assign");function qm(t,e,n){return e&&(t=t.trim()),n&&(t=cu(t)),t}const Xm={created(t,{modifiers:{lazy:e,trim:n,number:i}},r){t[zo]=Hc(r);const s=i||r.props&&r.props.type==="number";Bs(t,e?"change":"input",o=>{o.target.composing||t[zo](qm(t.value,n,s))}),(n||s)&&Bs(t,"change",()=>{t.value=qm(t.value,n,s)}),e||(Bs(t,"compositionstart",oM),Bs(t,"compositionend",Wm),Bs(t,"change",Wm))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(t[zo]=Hc(o),t.composing)return;const a=(s||t.type==="number")&&!/^0\d/.test(t.value)?cu(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(i&&e===n||r&&t.value.trim()===l)||(t.value=l))}},hx={deep:!0,created(t,{value:e,modifiers:{number:n}},i){const r=su(e);Bs(t,"change",()=>{const s=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?cu(Gc(o)):Gc(o));t[zo](t.multiple?r?new Set(s):s:s[0]),t._assigning=!0,Ir(()=>{t._assigning=!1})}),t[zo]=Hc(i)},mounted(t,{value:e}){$m(t,e)},beforeUpdate(t,e,n){t[zo]=Hc(n)},updated(t,{value:e}){t._assigning||$m(t,e)}};function $m(t,e){const n=t.multiple,i=it(e);if(!(n&&!i&&!su(e))){for(let r=0,s=t.options.length;rString(c)===String(a)):o.selected=Qb(e,a)>-1}else o.selected=e.has(a);else if(ol(Gc(o),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Gc(t){return"_value"in t?t._value:t.value}const aM=["ctrl","shift","alt","meta"],lM={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>aM.some(n=>t[`${n}Key`]&&!e.includes(n))},ei=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),i=e.join(".");return n[i]||(n[i]=((r,...s)=>{for(let o=0;o{const n=t._withKeys||(t._withKeys={}),i=e.join(".");return n[i]||(n[i]=(r=>{if(!("key"in r))return;const s=gs(r.key);if(e.some(o=>o===s||cM[o]===s))return t(r)}))},uM=bn({patchProp:rM},Gw);let Ym;function dM(){return Ym||(Ym=ww(uM))}const fM=((...t)=>{const e=dM().createApp(...t),{mount:n}=e;return e.mount=i=>{const r=pM(i);if(!r)return;const s=e._component;!lt(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=n(r,!1,hM(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e});function hM(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function pM(t){return Yt(t)?document.querySelector(t):t}function mM(t,e){var n;const i=gu();return pi(()=>{i.value=t()},{...e,flush:(n=e?.flush)!==null&&n!==void 0?n:"sync"}),Lc(i)}function ul(t,e){return Eh()?(u_(t,e),!0):!1}function px(){const t=new Set,e=s=>{t.delete(s)};return{on:s=>{t.add(s);const o=()=>e(s);return ul(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(t).map(o=>o(...s))),clear:()=>{t.clear()}}}function gM(t){let e=!1,n;const i=c_(!0);return((...r)=>(e||(n=i.run(()=>t(...r)),e=!0),n))}const Li=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vM=t=>typeof t<"u",_M=Object.prototype.toString,xM=t=>_M.call(t)==="[object Object]",Jm=yM();function yM(){var t,e,n;return Li&&!!(!((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0)&&t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test((n=window)===null||n===void 0?void 0:n.navigator.userAgent))}function Yu(t){return Array.isArray(t)?t:[t]}function bM(t){return Vr()}function SM(t){if(!Li)return t;let e=0,n,i;const r=()=>{e-=1,i&&e<=0&&(i.stop(),n=void 0,i=void 0)};return((...s)=>(e+=1,i||(i=c_(!0),n=i.run(()=>t(...s))),ul(r),n))}function wM(t){return Yn(Qt(t)?new Proxy({},{get(e,n,i){return M(Reflect.get(t.value,n,i))},set(e,n,i){return Qt(t.value[n])&&!Qt(i)?t.value[n].value=i:t.value[n]=i,!0},deleteProperty(e,n){return Reflect.deleteProperty(t.value,n)},has(e,n){return Reflect.has(t.value,n)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):t)}function Uh(t){return wM(Te(t))}function to(t,...e){const n=e.flat(),i=n[0];return Uh(()=>Object.fromEntries(typeof i=="function"?Object.entries(Dr(t)).filter(([r,s])=>!i(In(s),r)):Object.entries(Dr(t)).filter(r=>!n.includes(r[0]))))}function MM(t,e=1e4){return MS((n,i)=>{let r=In(t),s;const o=()=>setTimeout(()=>{r=In(t),i()},In(e));return ul(()=>{clearTimeout(s)}),{get(){return n(),r},set(a){r=a,i(),clearTimeout(s),s=o()}}})}function EM(t,e){bM()&&yu(t,e)}function mx(t,e,n={}){const{immediate:i=!0,immediateCallback:r=!1}=n,s=gu(!1);let o;function a(){o&&(clearTimeout(o),o=void 0)}function l(){s.value=!1,a()}function c(...u){r&&t(),a(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=void 0,t(...u)},In(e))}return i&&(s.value=!0,Li&&c()),ul(l),{isPending:Fs(s),start:c,stop:l}}function TM(t,e,n){return en(t,e,{...n,immediate:!0})}const kh=Li?window:void 0;function _s(t){var e;const n=In(t);return(e=n?.$el)!==null&&e!==void 0?e:n}function $s(...t){const e=(i,r,s,o)=>(i.addEventListener(r,s,o),()=>i.removeEventListener(r,s,o)),n=Te(()=>{const i=Yu(In(t[0])).filter(r=>r!=null);return i.every(r=>typeof r!="string")?i:void 0});return TM(()=>{var i,r;return[(i=(r=n.value)===null||r===void 0?void 0:r.map(s=>_s(s)))!==null&&i!==void 0?i:[kh].filter(s=>s!=null),Yu(In(n.value?t[1]:t[0])),Yu(M(n.value?t[2]:t[1])),In(n.value?t[3]:t[2])]},([i,r,s,o],a,l)=>{if(!i?.length||!r?.length||!s?.length)return;const c=xM(o)?{...o}:o,u=i.flatMap(d=>r.flatMap(f=>s.map(h=>e(d,f,h,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function gx(){const t=gu(!1),e=Vr();return e&&Ni(()=>{t.value=!0},e),t}function AM(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function CM(...t){let e,n,i={};t.length===3?(e=t[0],n=t[1],i=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],i=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:r=kh,eventName:s="keydown",passive:o=!1,dedupe:a=!1}=i,l=AM(e);return $s(r,s,u=>{u.repeat&&In(a)||l(u)&&n(u)},o)}function PM(t){return JSON.parse(JSON.stringify(t))}function Mu(t,e,n,i={}){var r,s;const{clone:o=!1,passive:a=!1,eventName:l,deep:c=!1,defaultValue:u,shouldEmit:d}=i,f=Vr(),h=n||f?.emit||(f==null||(r=f.$emit)===null||r===void 0?void 0:r.bind(f))||(f==null||(s=f.proxy)===null||s===void 0||(s=s.$emit)===null||s===void 0?void 0:s.bind(f?.proxy));let g=l;e||(e="modelValue"),g=g||`update:${e.toString()}`;const v=_=>o?typeof o=="function"?o(_):PM(_):_,m=()=>vM(t[e])?v(t[e]):u,p=_=>{d?d(_)&&h(g,_):h(g,_)};if(a){const _=Ve(m());let x=!1;return en(()=>t[e],y=>{x||(x=!0,_.value=v(y),Ir(()=>x=!1))}),en(_,y=>{!x&&(y!==t[e]||c)&&p(y)},{deep:c}),_}else return Te({get(){return m()},set(_){p(_)}})}function Bh(t,e=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY){return Math.min(n,Math.max(e,t))}function Tl(t,e){let n=t;const i=e.toString(),r=i.indexOf("."),s=r>=0?i.length-r:0;if(s>0){const o=10**s;n=Math.round(n*o)/o}return n}function RM(t,e,n,i){e=Number(e),n=Number(n);const r=(t-(Number.isNaN(e)?0:e))%i;let s=Tl(Math.abs(r)*2>=i?t+Math.sign(r)*(i-Math.abs(r)):t-r,i);return Number.isNaN(e)?!Number.isNaN(n)&&s>n&&(s=Math.floor(Tl(n/i,i))*i):sn&&(s=e+Math.floor(Tl((n-e)/i,i))*i),s=Tl(s,i),s}function Hr(t,e){const n=typeof t=="string"&&!e?`${t}Context`:e,i=Symbol(n);return[o=>{const a=Uo(i,o);if(a||a===null)return a;throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},o=>(Rh(i,o),o)]}function Ys(){let t=document.activeElement;if(t==null)return null;for(;t!=null&&t.shadowRoot!=null&&t.shadowRoot.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function vx(t,e,n){const i=n.originalEvent.target,r=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),i.dispatchEvent(r)}function Sc(t){return t==null}function zh(t){return t?t.flatMap(e=>e.type===nn?zh(e.children):[e]):[]}const[Vh]=Hr("ConfigProvider");function Ju(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function df(t,e,n=".",i){if(!Ju(e))return df(t,{},n,i);const r={...e};for(const s of Object.keys(t)){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(i&&i(r,s,o,n)||(Array.isArray(o)&&Array.isArray(r[s])?r[s]=[...o,...r[s]]:Ju(o)&&Ju(r[s])?r[s]=df(o,r[s],(n?`${n}.`:"")+s.toString(),i):r[s]=o))}return r}function DM(t){return(...e)=>e.reduce((n,i)=>df(n,i,"",t),{})}const _x=DM(),IM=SM(()=>{const t=Ve(new Map),e=Ve(),n=Te(()=>{for(const o of t.value.values())if(o)return!0;return!1}),i=Vh({scrollBody:Ve(!0)});let r=null;const s=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",Jm&&r?.(),e.value=void 0};return en(n,(o,a)=>{if(!Li)return;if(!o){a&&s();return}e.value===void 0&&(e.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,c={padding:l,margin:0},u=i.scrollBody?.value?typeof i.scrollBody.value=="object"?_x({padding:i.scrollBody.value.padding===!0?l:i.scrollBody.value.padding,margin:i.scrollBody.value.margin===!0?l:i.scrollBody.value.margin},c):c:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),Jm&&(r=$s(document,"touchmove",d=>LM(d),{passive:!1})),Ir(()=>{n.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),t});function NM(t){const e=Math.random().toString(36).substring(2,7),n=IM();n.value.set(e,t);const i=Te({get:()=>n.value.get(e)??!1,set:r=>n.value.set(e,r)});return EM(()=>{n.value.delete(e)}),i}function xx(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}function OM(t){const e=Vh({dir:Ve("ltr")});return Te(()=>t?.value||e.dir?.value||"ltr")}function FM(t){const e=Vr(),n=e?.type.emits,i={};return n?.length||console.warn(`No emitted event found. Please check component: ${e?.type.__name}`),n?.forEach(r=>{i[La($n(r))]=(...s)=>t(r,...s)}),i}let Ku=0;function UM(){pi(t=>{if(!Li)return;const e=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",e[0]??Km()),document.body.insertAdjacentElement("beforeend",e[1]??Km()),Ku++,t(()=>{Ku===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),Ku--})})}function Km(){const t=document.createElement("span");return t.setAttribute("data-reka-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}function yx(t){return Te(()=>In(t)?!!_s(t)?.closest("form"):!0)}function sn(){const t=Vr(),e=Ve(),n=Te(()=>i());G_(()=>{n.value!==i()&&bS(e)});function i(){return e.value&&"$el"in e.value&&["#text","#comment"].includes(e.value.$el.nodeName)?e.value.$el.nextElementSibling:_s(e)}const r=Object.assign({},t.exposed),s={};for(const a in t.props)Object.defineProperty(s,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(r).length>0)for(const a in r)Object.defineProperty(s,a,{enumerable:!0,configurable:!0,get:()=>r[a]});Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=s;function o(a){if(e.value=a,!!a&&(Object.defineProperty(s,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),!(a instanceof Element)&&!Object.hasOwn(a,"$el"))){const l=a.$.exposed,c=Object.assign({},s);for(const u in l)Object.defineProperty(c,u,{enumerable:!0,configurable:!0,get:()=>l[u]});t.exposed=c}}return{forwardRef:o,currentRef:e,currentElement:n}}function dl(t){const e=Vr(),n=Object.keys(e?.type.props??{}).reduce((r,s)=>{const o=(e?.type.props[s]).default;return o!==void 0&&(r[s]=o),r},{}),i=AS(t);return Te(()=>{const r={},s=e?.vnode.props??{};return Object.keys(s).forEach(o=>{r[$n(o)]=s[o]}),Object.keys({...n,...r}).reduce((o,a)=>(i.value[a]!==void 0&&(o[a]=i.value[a]),o),{})})}function nr(t,e){const n=dl(t),i=e?FM(e):{};return Te(()=>({...n.value,...i}))}function kM(t,e){const n=MM(!1,300);ul(()=>{n.value=!1});const i=Ve(null),r=px();function s(){i.value=null,n.value=!1}function o(a,l){if(!l)return;const c=a.currentTarget,u={x:a.clientX,y:a.clientY},d=BM(u,c.getBoundingClientRect()),f=zM(u,d,1),h=VM(l.getBoundingClientRect()),g=GM([...f,...h]);i.value=g,n.value=!0}return pi(a=>{if(t.value&&e.value){const l=u=>o(u,e.value),c=u=>o(u,t.value);t.value.addEventListener("pointerleave",l),e.value.addEventListener("pointerleave",c),a(()=>{t.value?.removeEventListener("pointerleave",l),e.value?.removeEventListener("pointerleave",c)})}}),pi(a=>{if(i.value){const l=c=>{if(!i.value||!(c.target instanceof Element))return;const u=c.target,d={x:c.clientX,y:c.clientY},f=t.value?.contains(u)||e.value?.contains(u),h=!HM(d,i.value),g=!!u.closest("[data-grace-area-trigger]");f?s():(h||g)&&(s(),r.trigger())};t.value?.ownerDocument.addEventListener("pointermove",l),a(()=>t.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:r.on}}function BM(t,e){const n=Math.abs(e.top-t.y),i=Math.abs(e.bottom-t.y),r=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,i,r,s)){case s:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function zM(t,e,n=5){const i=[];switch(e){case"top":i.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":i.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":i.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":i.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return i}function VM(t){const{top:e,right:n,bottom:i,left:r}=t;return[{x:r,y:e},{x:n,y:e},{x:n,y:i},{x:r,y:i}]}function HM(t,e){const{x:n,y:i}=t;let r=!1;for(let s=0,o=e.length-1;si!=u>i&&n<(c-a)*(i-l)/(u-l)+a&&(r=!r)}return r}function GM(t){const e=t.slice();return e.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),WM(e)}function WM(t){if(t.length<=1)return t.slice();const e=[];for(let i=0;i=2;){const s=e.at(-1),o=e[e.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))e.pop();else break}e.push(r)}e.pop();const n=[];for(let i=t.length-1;i>=0;i--){const r=t[i];for(;n.length>=2;){const s=n.at(-1),o=n[n.length-2];if((s.x-o.x)*(r.y-o.y)>=(s.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var qM=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},uo=new WeakMap,Al=new WeakMap,Cl={},Zu=0,bx=function(t){return t&&(t.host||bx(t.parentNode))},XM=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=bx(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},$M=function(t,e,n,i){var r=XM(e,Array.isArray(t)?t:[t]);Cl[n]||(Cl[n]=new WeakMap);var s=Cl[n],o=[],a=new Set,l=new Set(r),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};r.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(i),g=h!==null&&h!=="false",v=(uo.get(f)||0)+1,m=(s.get(f)||0)+1;uo.set(f,v),s.set(f,m),o.push(f),v===1&&g&&Al.set(f,!0),m===1&&f.setAttribute(n,"true"),g||f.setAttribute(i,"true")}catch(p){console.error("aria-hidden: cannot operate on ",f,p)}})};return u(e),a.clear(),Zu++,function(){o.forEach(function(d){var f=uo.get(d)-1,h=s.get(d)-1;uo.set(d,f),s.set(d,h),f||(Al.has(d)||d.removeAttribute(i),Al.delete(d)),h||d.removeAttribute(n)}),Zu--,Zu||(uo=new WeakMap,uo=new WeakMap,Al=new WeakMap,Cl={})}},YM=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=qM(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),$M(i,r,n,"aria-hidden")):function(){return null}};function JM(t){let e;en(()=>_s(t),n=>{let i=!1;try{i=!!n?.closest("[popover]:not(:popover-open)")}catch{}n&&!i?e=YM(n):e&&e()}),ra(()=>{e&&e()})}function Hh(t,e="reka"){let n;return n=HS?.(),e?`${e}-${n}`:n}function KM(t){const e=Vh({locale:Ve("en")});return Te(()=>t?.value||e.locale?.value||"en")}function Sx(t){const e=Ve(),n=Te(()=>e.value?.width??0),i=Te(()=>e.value?.height??0);return Ni(()=>{const r=_s(t);if(r){e.value={width:r.offsetWidth,height:r.offsetHeight};const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let l,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;l=d.inlineSize,c=d.blockSize}else l=r.offsetWidth,c=r.offsetHeight;e.value={width:l,height:c}});return s.observe(r,{box:"border-box"}),()=>s.unobserve(r)}else e.value=void 0}),{width:n,height:i}}function ZM(t,e){const n=Ve(t);function i(s){return e[n.value][s]??n.value}return{state:n,dispatch:s=>{n.value=i(s)}}}function jM(t,e){const n=Ve({}),i=Ve("none"),r=Ve(t),s=t.value?"mounted":"unmounted";let o;const a=e.value?.ownerDocument.defaultView??kh,{state:l,dispatch:c}=ZM(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{if(Li){const p=new CustomEvent(m,{bubbles:!1,cancelable:!1});e.value?.dispatchEvent(p)}};en(t,async(m,p)=>{const _=p!==m;if(await Ir(),_){const x=i.value,y=Pl(e.value);m?(c("MOUNT"),u("enter"),y==="none"&&u("after-enter")):y==="none"||y==="undefined"||n.value?.display==="none"?(c("UNMOUNT"),u("leave"),u("after-leave")):p&&x!==y?(c("ANIMATION_OUT"),u("leave")):(c("UNMOUNT"),u("after-leave"))}},{immediate:!0});const d=m=>{const p=Pl(e.value),_=p.includes(CSS.escape(m.animationName)),x=l.value==="mounted"?"enter":"leave";if(m.target===e.value&&_&&(u(`after-${x}`),c("ANIMATION_END"),!r.value)){const y=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",o=a?.setTimeout(()=>{e.value?.style.animationFillMode==="forwards"&&(e.value.style.animationFillMode=y)})}m.target===e.value&&p==="none"&&c("ANIMATION_END")},f=m=>{m.target===e.value&&(i.value=Pl(e.value))},h=en(e,(m,p)=>{m?(n.value=getComputedStyle(m),m.addEventListener("animationstart",f),m.addEventListener("animationcancel",d),m.addEventListener("animationend",d)):(c("ANIMATION_END"),o!==void 0&&a?.clearTimeout(o),p?.removeEventListener("animationstart",f),p?.removeEventListener("animationcancel",d),p?.removeEventListener("animationend",d))},{immediate:!0}),g=en(l,()=>{const m=Pl(e.value);i.value=l.value==="mounted"?m:"none"});return ra(()=>{h(),g()}),{isPresent:Te(()=>["mounted","unmountSuspended"].includes(l.value))}}function Pl(t){return t&&getComputedStyle(t).animationName||"none"}var wx=Fe({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:e,expose:n}){const{present:i,forceMount:r}=Dr(t),s=Ve(),{isPresent:o}=jM(i,s);n({present:o});let a=e.default({present:o.value});a=zh(a||[]);const l=Vr();if(a&&a?.length>1){const c=l?.parent?.type.name?`<${l.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` `)].join(` -`))}return()=>r.value||i.value||o.value?br(e.default({present:o.value})[0],{ref:c=>{const u=gs(c);return typeof u?.hasAttribute>"u"||(u?.hasAttribute("data-reka-popper-content-wrapper")?s.value=u.firstElementChild:s.value=u),u}}):null}});const uf=Fe({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{if(!n.default)return null;const i=kh(n.default()),r=i.findIndex(l=>l.type!==Zi);if(r===-1)return i;const s=i[r];delete s.props?.ref;const o=s.props?Dt(e,s.props):e,a=$s({...s,props:{}},o);return i.length===1?a:(i[r]=a,i)}}}),Hw=["area","img","input"],yn=Fe({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const i=t.asChild?"template":t.as;return typeof i=="string"&&Hw.includes(i)?()=>br(i,e):i!=="template"?()=>br(t.as,e,{default:n.default}):()=>br(uf,e,{default:n.default})}});function Ys(){const t=Ve(),e=Te(()=>["#text","#comment"].includes(t.value?.$el.nodeName)?t.value?.$el.nextElementSibling:gs(t));return{primitiveElement:t,currentElement:e}}const Gw="dismissableLayer.pointerDownOutside",Ww="dismissableLayer.focusOutside";function yx(t,e){if(!(e instanceof Element))return!1;const n=e.closest("[data-dismissable-layer]"),i=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),r=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(i===n||r.indexOf(i){});return fi(o=>{if(!Di||!Dn(n))return;const a=async c=>{const u=c.target;if(!(!e?.value||!u)){if(yx(e.value,u)){r.value=!1;return}if(c.target&&!r.value){let h=function(){ux(Gw,t,f)};var d=h;const f={originalEvent:c};c.pointerType==="touch"?(i.removeEventListener("click",s.value),s.value=h,i.addEventListener("click",s.value,{once:!0})):h()}else i.removeEventListener("click",s.value);r.value=!1}},l=window.setTimeout(()=>{i.addEventListener("pointerdown",a)},0);o(()=>{window.clearTimeout(l),i.removeEventListener("pointerdown",a),i.removeEventListener("click",s.value)})}),{onPointerDownCapture:()=>{Dn(n)&&(r.value=!0)}}}function Xw(t,e,n=!0){const i=e?.value?.ownerDocument??globalThis?.document,r=Ve(!1);return fi(s=>{if(!Di||!Dn(n))return;const o=async a=>{if(!e?.value)return;await Rr(),await Rr();const l=a.target;!e.value||!l||yx(e.value,l)||a.target&&!r.value&&ux(Ww,t,{originalEvent:a})};i.addEventListener("focusin",o),s(()=>i.removeEventListener("focusin",o))}),{onFocusCapture:()=>{Dn(n)&&(r.value=!0)},onBlurCapture:()=>{Dn(n)&&(r.value=!1)}}}const oi=ri({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var $w=Fe({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(t,{emit:e}){const n=t,i=e,{forwardRef:r,currentElement:s}=tn(),o=Te(()=>s.value?.ownerDocument??globalThis.document),a=Te(()=>oi.layersRoot),l=Te(()=>s.value?Array.from(a.value).indexOf(s.value):-1),c=Te(()=>oi.layersWithOutsidePointerEventsDisabled.size>0),u=Te(()=>{const h=Array.from(a.value),[g]=[...oi.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g);return l.value>=v}),d=qw(async h=>{const g=[...oi.branches].some(v=>v?.contains(h.target));!u.value||g||(i("pointerDownOutside",h),i("interactOutside",h),await Rr(),h.defaultPrevented||i("dismiss"))},s),f=Xw(h=>{[...oi.branches].some(v=>v?.contains(h.target))||(i("focusOutside",h),i("interactOutside",h),h.defaultPrevented||i("dismiss"))},s);return _w("Escape",h=>{l.value===a.value.size-1&&(i("escapeKeyDown",h),h.defaultPrevented||i("dismiss"))}),fi(h=>{s.value&&(n.disableOutsidePointerEvents&&(oi.layersWithOutsidePointerEventsDisabled.size===0&&(oi.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents="none"),oi.layersWithOutsidePointerEventsDisabled.add(s.value)),a.value.add(s.value),h(()=>{n.disableOutsidePointerEvents&&oi.layersWithOutsidePointerEventsDisabled.size===1&&!_c(oi.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=oi.originalBodyPointerEvents)}))}),fi(h=>{h(()=>{s.value&&(a.value.delete(s.value),oi.layersWithOutsidePointerEventsDisabled.delete(s.value))})}),(h,g)=>(ge(),ke(T(yn),{ref:T(r),"as-child":h.asChild,as:h.as,"data-dismissable-layer":"",style:Fr({pointerEvents:c.value?u.value?"auto":"none":void 0}),onFocusCapture:T(f).onFocusCapture,onBlurCapture:T(f).onBlurCapture,onPointerdownCapture:T(d).onPointerDownCapture},{default:ne(()=>[ot(h.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),bx=$w;const Yw=ow(()=>Ve([]));function Jw(){const t=Yw();return{add(e){const n=t.value[0];e!==n&&n?.pause(),t.value=Jm(t.value,e),t.value.unshift(e)},remove(e){t.value=Jm(t.value,e),t.value[0]?.resume()}}}function Jm(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}const Yu="focusScope.autoFocusOnMount",Ju="focusScope.autoFocusOnUnmount",Km={bubbles:!1,cancelable:!0};function Kw(t,{select:e=!1}={}){const n=Ws();for(const i of t)if(Kr(i,{select:e}),Ws()!==n)return!0}function Zw(t){const e=Sx(t),n=Zm(e,t),i=Zm(e.reverse(),t);return[n,i]}function Sx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Zm(t,e){for(const n of t)if(!jw(n,{upTo:e}))return n}function jw(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Qw(t){return t instanceof HTMLInputElement&&"select"in t}function Kr(t,{select:e=!1}={}){if(t&&t.focus){const n=Ws();t.focus({preventScroll:!0}),t!==n&&Qw(t)&&e&&t.select()}}var e1=Fe({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:e}){const n=t,i=e,{currentRef:r,currentElement:s}=tn(),o=Ve(null),a=Jw(),l=ri({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});fi(u=>{if(!Di)return;const d=s.value;if(!n.trapped)return;function f(m){if(l.paused||!d)return;const p=m.target;d.contains(p)?o.value=p:Kr(o.value,{select:!0})}function h(m){if(l.paused||!d)return;const p=m.relatedTarget;p!==null&&(d.contains(p)||Kr(o.value,{select:!0}))}function g(m){const p=o.value;if(p===null||!m.some(y=>y.removedNodes.length>0))return;d.contains(p)||Kr(d)}document.addEventListener("focusin",f),document.addEventListener("focusout",h);const v=new MutationObserver(g);d&&v.observe(d,{childList:!0,subtree:!0}),u(()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),v.disconnect()})}),fi(async u=>{const d=s.value;if(await Rr(),!d)return;a.add(l);const f=Ws();if(!d.contains(f)){const g=new CustomEvent(Yu,Km);d.addEventListener(Yu,v=>i("mountAutoFocus",v)),d.dispatchEvent(g),g.defaultPrevented||(Kw(Sx(d),{select:!0}),Ws()===f&&Kr(d))}u(()=>{d.removeEventListener(Yu,m=>i("mountAutoFocus",m));const g=new CustomEvent(Ju,Km),v=m=>{i("unmountAutoFocus",m)};d.addEventListener(Ju,v),d.dispatchEvent(g),setTimeout(()=>{g.defaultPrevented||Kr(f??document.body,{select:!0}),d.removeEventListener(Ju,v),a.remove(l)},0)})});function c(u){if(!n.loop&&!n.trapped||l.paused)return;const d=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,f=Ws();if(d&&f){const h=u.currentTarget,[g,v]=Zw(h);g&&v?!u.shiftKey&&f===v?(u.preventDefault(),n.loop&&Kr(g,{select:!0})):u.shiftKey&&f===g&&(u.preventDefault(),n.loop&&Kr(v,{select:!0})):f===h&&u.preventDefault()}}return(u,d)=>(ge(),ke(T(yn),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":u.asChild,as:u.as,onKeydown:c},{default:ne(()=>[ot(u.$slots,"default")]),_:3},8,["as-child","as"]))}}),t1=e1,n1=Fe({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=hx();return(n,i)=>T(e)||n.forceMount?(ge(),ke(PS,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[ot(n.$slots,"default")],8,["to","disabled","defer"])):yr("v-if",!0)}}),Mx=n1;const jm="data-reka-collection-item";function Vh(t={}){const{key:e="",isProvider:n=!1}=t,i=`${e}CollectionProvider`;let r;n?(r={collectionRef:Ve(),itemMap:Ve(new Map)},Ch(i,r)):r=Lo(i);const s=(u=!1)=>{const d=r.collectionRef.value;if(!d)return[];const f=Array.from(d.querySelectorAll(`[${jm}]`)),g=Array.from(r.itemMap.value.values()).sort((v,m)=>f.indexOf(v.ref)-f.indexOf(m.ref));return u?g:g.filter(v=>v.ref.dataset.disabled!=="")},o=Fe({name:"CollectionSlot",inheritAttrs:!1,setup(u,{slots:d,attrs:f}){const{primitiveElement:h,currentElement:g}=Ys();return sn(g,()=>{r.collectionRef.value=g.value}),()=>br(uf,{ref:h,...f},d)}}),a=Fe({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(u,{slots:d,attrs:f}){const{primitiveElement:h,currentElement:g}=Ys();return fi(v=>{if(g.value){const m=y_(g.value);r.itemMap.value.set(m,{ref:g.value,value:u.value}),v(()=>r.itemMap.value.delete(m))}}),()=>br(uf,{...f,[jm]:"",ref:h},d)}}),l=Te(()=>Array.from(r.itemMap.value.values())),c=Te(()=>r.itemMap.value.size);return{getItems:s,reactiveItems:l,itemMapSize:c,CollectionSlot:o,CollectionItem:a}}var i1=Fe({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){return(e,n)=>(ge(),ke(T(yn),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:ne(()=>[ot(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),wx=i1,r1=Fe({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(t){const e=t,{primitiveElement:n,currentElement:i}=Ys(),r=Te(()=>e.checked??e.value);return sn(r,(s,o)=>{if(!i.value)return;const a=i.value,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(u&&s!==o){const d=new Event("input",{bubbles:!0}),f=new Event("change",{bubbles:!0});u.call(a,s),a.dispatchEvent(d),a.dispatchEvent(f)}}),(s,o)=>(ge(),ke(wx,Dt({ref_key:"primitiveElement",ref:n},{...e,...s.$attrs},{as:"input"}),null,16))}}),Qm=r1,s1=Fe({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(t){const e=t,n=Te(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),i=Te(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((r,s)=>typeof r=="object"?Object.entries(r).map(([o,a])=>({name:`${e.name}[${s}][${o}]`,value:a})):{name:`${e.name}[${s}]`,value:r}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([r,s])=>({name:`${e.name}[${r}]`,value:s})):[]);return(r,s)=>(ge(),kt(rn,null,[yr(" We render single input if it's required "),n.value?(ge(),ke(Qm,Dt({key:r.name},{...e,...r.$attrs},{name:r.name,value:r.value}),null,16,["name","value"])):(ge(!0),kt(rn,{key:1},rl(i.value,o=>(ge(),ke(Qm,Dt({key:o.name},{ref_for:!0},{...e,...r.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))],2112))}}),Ex=s1;const[Tx,o1]=zr("PopperRoot");var a1=Fe({inheritAttrs:!1,__name:"PopperRoot",setup(t){const e=Ve();return o1({anchor:e,onAnchorChange:n=>e.value=n}),(n,i)=>ot(n.$slots,"default")}}),Ax=a1,l1=Fe({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{forwardRef:n,currentElement:i}=tn(),r=Tx();return P_(()=>{r.onAnchorChange(e.reference??i.value)}),(s,o)=>(ge(),ke(T(yn),{ref:T(n),as:s.as,"as-child":s.asChild},{default:ne(()=>[ot(s.$slots,"default")]),_:3},8,["as","as-child"]))}}),Cx=l1;function c1(t){return t!==null}function u1(t){return{name:"transformOrigin",options:t,fn(e){const{placement:n,rects:i,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,u]=df(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(r.arrow?.x??0)+a/2,h=(r.arrow?.y??0)+l/2;let g="",v="";return c==="bottom"?(g=o?d:`${f}px`,v=`${-l}px`):c==="top"?(g=o?d:`${f}px`,v=`${i.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=o?d:`${h}px`):c==="left"&&(g=`${i.floating.width+l}px`,v=o?d:`${h}px`),{data:{x:g,y:v}}}}}function df(t){const[e,n="center"]=t.split("-");return[e,n]}const d1=["top","right","bottom","left"],ds=Math.min,jn=Math.max,Bc=Math.round,Tl=Math.floor,$i=t=>({x:t,y:t}),f1={left:"right",right:"left",bottom:"top",top:"bottom"};function ff(t,e,n){return jn(t,ds(e,n))}function Dr(t,e){return typeof t=="function"?t(e):t}function Ir(t){return t.split("-")[0]}function ta(t){return t.split("-")[1]}function Hh(t){return t==="x"?"y":"x"}function Gh(t){return t==="y"?"height":"width"}function Gi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Wh(t){return Hh(Gi(t))}function h1(t,e,n){n===void 0&&(n=!1);const i=ta(t),r=Wh(t),s=Gh(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=zc(o)),[o,zc(o)]}function p1(t){const e=zc(t);return[hf(t),e,hf(e)]}function hf(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const eg=["left","right"],tg=["right","left"],m1=["top","bottom"],g1=["bottom","top"];function v1(t,e,n){switch(t){case"top":case"bottom":return n?e?tg:eg:e?eg:tg;case"left":case"right":return e?m1:g1;default:return[]}}function _1(t,e,n,i){const r=ta(t);let s=v1(Ir(t),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),e&&(s=s.concat(s.map(hf)))),s}function zc(t){const e=Ir(t);return f1[e]+t.slice(e.length)}function x1(t){return{top:0,right:0,bottom:0,left:0,...t}}function Px(t){return typeof t!="number"?x1(t):{top:t,right:t,bottom:t,left:t}}function Vc(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function ng(t,e,n){let{reference:i,floating:r}=t;const s=Gi(e),o=Wh(e),a=Gh(o),l=Ir(e),c=s==="y",u=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,f=i[a]/2-r[a]/2;let h;switch(l){case"top":h={x:u,y:i.y-r.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-r.width,y:d};break;default:h={x:i.x,y:i.y}}switch(ta(e)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}async function y1(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Dr(e,t),g=Px(h),m=a[f?d==="floating"?"reference":"floating":d],p=Vc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),y=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},w=Vc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:x,strategy:l}):_);return{top:(p.top-w.top+g.top)/y.y,bottom:(w.bottom-p.bottom+g.bottom)/y.y,left:(p.left-w.left+g.left)/y.x,right:(w.right-p.right+g.right)/y.x}}const b1=50,S1=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:y1},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=ng(c,i,l),f=i,h=0;const g={};for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Dr(t,e)||{};if(c==null)return{};const d=Px(u),f={x:n,y:i},h=Wh(r),g=Gh(h),v=await o.getDimensions(c),m=h==="y",p=m?"top":"left",_=m?"bottom":"right",x=m?"clientHeight":"clientWidth",y=s.reference[g]+s.reference[h]-f[h]-s.floating[g],w=f[h]-s.reference[h],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let P=A?A[x]:0;(!P||!await(o.isElement==null?void 0:o.isElement(A)))&&(P=a.floating[x]||s.floating[g]);const D=y/2-w/2,S=P/2-v[g]/2-1,M=ds(d[p],S),N=ds(d[_],S),B=M,q=P-v[g]-N,K=P/2-v[g]/2+D,$=ff(B,K,q),W=!l.arrow&&ta(r)!=null&&K!==$&&s.reference[g]/2-(KK<=0)){var N,B;const K=(((N=s.flip)==null?void 0:N.index)||0)+1,$=P[K];if($&&(!(d==="alignment"?_!==Gi($):!1)||M.every(z=>Gi(z.placement)===_?z.overflows[0]>0:!0)))return{data:{index:K,overflows:M},reset:{placement:$}};let W=(B=M.filter(k=>k.overflows[0]<=0).sort((k,z)=>k.overflows[1]-z.overflows[1])[0])==null?void 0:B.placement;if(!W)switch(h){case"bestFit":{var q;const k=(q=M.filter(z=>{if(A){const de=Gi(z.placement);return de===_||de==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(de=>de>0).reduce((de,le)=>de+le,0)]).sort((z,de)=>z[1]-de[1])[0])==null?void 0:q[0];k&&(W=k);break}case"initialPlacement":W=a;break}if(r!==W)return{reset:{placement:W}}}return{}}}};function ig(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function rg(t){return d1.some(e=>t[e]>=0)}const E1=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:i}=e,{strategy:r="referenceHidden",...s}=Dr(t,e);switch(r){case"referenceHidden":{const o=await i.detectOverflow(e,{...s,elementContext:"reference"}),a=ig(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:rg(a)}}}case"escaped":{const o=await i.detectOverflow(e,{...s,altBoundary:!0}),a=ig(o,n.floating);return{data:{escapedOffsets:a,escaped:rg(a)}}}default:return{}}}}},Rx=new Set(["left","top"]);async function T1(t,e){const{placement:n,platform:i,elements:r}=t,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=Ir(n),a=ta(n),l=Gi(n)==="y",c=Rx.has(o)?-1:1,u=s&&l?-1:1,d=Dr(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const A1=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:s,placement:o,middlewareData:a}=e,l=await T1(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:o}}}}},C1=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:p=>{let{x:_,y:x}=p;return{x:_,y:x}}},...c}=Dr(t,e),u={x:n,y:i},d=await s.detectOverflow(e,c),f=Gi(Ir(r)),h=Hh(f);let g=u[h],v=u[f];if(o){const p=h==="y"?"top":"left",_=h==="y"?"bottom":"right",x=g+d[p],y=g-d[_];g=ff(x,g,y)}if(a){const p=f==="y"?"top":"left",_=f==="y"?"bottom":"right",x=v+d[p],y=v-d[_];v=ff(x,v,y)}const m=l.fn({...e,[h]:g,[f]:v});return{...m,data:{x:m.x-n,y:m.y-i,enabled:{[h]:o,[f]:a}}}}}},P1=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Dr(t,e),u={x:n,y:i},d=Gi(r),f=Hh(d);let h=u[f],g=u[d];const v=Dr(a,e),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const x=f==="y"?"height":"width",y=s.reference[f]-s.floating[x]+m.mainAxis,w=s.reference[f]+s.reference[x]-m.mainAxis;hw&&(h=w)}if(c){var p,_;const x=f==="y"?"width":"height",y=Rx.has(Ir(r)),w=s.reference[d]-s.floating[x]+(y&&((p=o.offset)==null?void 0:p[d])||0)+(y?0:m.crossAxis),A=s.reference[d]+s.reference[x]+(y?0:((_=o.offset)==null?void 0:_[d])||0)-(y?m.crossAxis:0);gA&&(g=A)}return{[f]:h,[d]:g}}}},R1=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=Dr(t,e),u=await o.detectOverflow(e,c),d=Ir(r),f=ta(r),h=Gi(r)==="y",{width:g,height:v}=s.floating;let m,p;d==="top"||d==="bottom"?(m=d,p=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(p=d,m=f==="end"?"top":"bottom");const _=v-u.top-u.bottom,x=g-u.left-u.right,y=ds(v-u[m],_),w=ds(g-u[p],x),A=!e.middlewareData.shift;let P=y,D=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(P=_),A&&!f){const M=jn(u.left,0),N=jn(u.right,0),B=jn(u.top,0),q=jn(u.bottom,0);h?D=g-2*(M!==0||N!==0?M+N:jn(u.left,u.right)):P=v-2*(B!==0||q!==0?B+q:jn(u.top,u.bottom))}await l({...e,availableWidth:D,availableHeight:P});const S=await o.getDimensions(a.floating);return g!==S.width||v!==S.height?{reset:{rects:!0}}:{}}}};function yu(){return typeof window<"u"}function Qs(t){return qh(t)?(t.nodeName||"").toLowerCase():"#document"}function ii(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function er(t){var e;return(e=(qh(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qh(t){return yu()?t instanceof Node||t instanceof ii(t).Node:!1}function Ti(t){return yu()?t instanceof Element||t instanceof ii(t).Element:!1}function Vr(t){return yu()?t instanceof HTMLElement||t instanceof ii(t).HTMLElement:!1}function sg(t){return!yu()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ii(t).ShadowRoot}function ll(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=Ai(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}function D1(t){return/^(table|td|th)$/.test(Qs(t))}function bu(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const I1=/transform|translate|scale|rotate|perspective|filter/,N1=/paint|layout|strict|content/,ws=t=>!!t&&t!=="none";let Ku;function Xh(t){const e=Ti(t)?Ai(t):t;return ws(e.transform)||ws(e.translate)||ws(e.scale)||ws(e.rotate)||ws(e.perspective)||!$h()&&(ws(e.backdropFilter)||ws(e.filter))||I1.test(e.willChange||"")||N1.test(e.contain||"")}function L1(t){let e=fs(t);for(;Vr(e)&&!qo(e);){if(Xh(e))return e;if(bu(e))return null;e=fs(e)}return null}function $h(){return Ku==null&&(Ku=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ku}function qo(t){return/^(html|body|#document)$/.test(Qs(t))}function Ai(t){return ii(t).getComputedStyle(t)}function Su(t){return Ti(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function fs(t){if(Qs(t)==="html")return t;const e=t.assignedSlot||t.parentNode||sg(t)&&t.host||er(t);return sg(e)?e.host:e}function Dx(t){const e=fs(t);return qo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Vr(e)&&ll(e)?e:Dx(e)}function Xa(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Dx(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=ii(r);if(s){const a=pf(o);return e.concat(o,o.visualViewport||[],ll(r)?r:[],a&&n?Xa(a):[])}else return e.concat(r,Xa(r,[],n))}function pf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ix(t){const e=Ai(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Vr(t),s=r?t.offsetWidth:n,o=r?t.offsetHeight:i,a=Bc(n)!==s||Bc(i)!==o;return a&&(n=s,i=o),{width:n,height:i,$:a}}function Yh(t){return Ti(t)?t:t.contextElement}function ko(t){const e=Yh(t);if(!Vr(e))return $i(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=Ix(e);let o=(s?Bc(n.width):n.width)/i,a=(s?Bc(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const O1=$i(0);function Nx(t){const e=ii(t);return!$h()||!e.visualViewport?O1:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function F1(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ii(t)?!1:e}function Js(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=Yh(t);let o=$i(1);e&&(i?Ti(i)&&(o=ko(i)):o=ko(t));const a=F1(s,n,i)?Nx(s):$i(0);let l=(r.left+a.x)/o.x,c=(r.top+a.y)/o.y,u=r.width/o.x,d=r.height/o.y;if(s){const f=ii(s),h=i&&Ti(i)?ii(i):i;let g=f,v=pf(g);for(;v&&i&&h!==g;){const m=ko(v),p=v.getBoundingClientRect(),_=Ai(v),x=p.left+(v.clientLeft+parseFloat(_.paddingLeft))*m.x,y=p.top+(v.clientTop+parseFloat(_.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=x,c+=y,g=ii(v),v=pf(g)}}return Vc({width:u,height:d,x:l,y:c})}function Mu(t,e){const n=Su(t).scrollLeft;return e?e.left+n:Js(er(t)).left+n}function Lx(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Mu(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function U1(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const s=r==="fixed",o=er(i),a=e?bu(e.floating):!1;if(i===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=$i(1);const u=$i(0),d=Vr(i);if((d||!d&&!s)&&((Qs(i)!=="body"||ll(o))&&(l=Su(i)),d)){const h=Js(i);c=ko(i),u.x=h.x+i.clientLeft,u.y=h.y+i.clientTop}const f=o&&!d&&!s?Lx(o,l):$i(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function k1(t){return Array.from(t.getClientRects())}function B1(t){const e=er(t),n=Su(t),i=t.ownerDocument.body,r=jn(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=jn(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+Mu(t);const a=-n.scrollTop;return Ai(i).direction==="rtl"&&(o+=jn(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:o,y:a}}const og=25;function z1(t,e){const n=ii(t),i=er(t),r=n.visualViewport;let s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;const u=$h();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=Mu(i);if(c<=0){const u=i.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(i.clientWidth-d.clientWidth-h);g<=og&&(s-=g)}else c<=og&&(s+=c);return{width:s,height:o,x:a,y:l}}function V1(t,e){const n=Js(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=Vr(t)?ko(t):$i(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=r*s.x,c=i*s.y;return{width:o,height:a,x:l,y:c}}function ag(t,e,n){let i;if(e==="viewport")i=z1(t,n);else if(e==="document")i=B1(er(t));else if(Ti(e))i=V1(e,n);else{const r=Nx(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Vc(i)}function Ox(t,e){const n=fs(t);return n===e||!Ti(n)||qo(n)?!1:Ai(n).position==="fixed"||Ox(n,e)}function H1(t,e){const n=e.get(t);if(n)return n;let i=Xa(t,[],!1).filter(a=>Ti(a)&&Qs(a)!=="body"),r=null;const s=Ai(t).position==="fixed";let o=s?fs(t):t;for(;Ti(o)&&!qo(o);){const a=Ai(o),l=Xh(o);!l&&a.position==="fixed"&&(r=null),(s?!l&&!r:!l&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||ll(o)&&!l&&Ox(t,o))?i=i.filter(u=>u!==o):r=a,o=fs(o)}return e.set(t,i),i}function G1(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o=[...n==="clippingAncestors"?bu(e)?[]:H1(e,this._c):[].concat(n),i],a=ag(e,o[0],r);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}P===1&&!Ux(c,t.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(w,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,x)}n.observe(t)}return o(!0),s}function K1(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Yh(t),u=r||s?[...c?Xa(c):[],...e?Xa(e):[]]:[];u.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const d=c&&a?J1(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(p=>{let[_]=p;_&&_.target===c&&h&&e&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),n()}),c&&!l&&h.observe(c),e&&h.observe(e));let g,v=l?Js(t):null;l&&m();function m(){const p=Js(t);v&&!Ux(v,p)&&n(),v=p,g=requestAnimationFrame(m)}return n(),()=>{var p;u.forEach(_=>{r&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),d?.(),(p=h)==null||p.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const Z1=A1,j1=C1,cg=w1,Q1=R1,eE=E1,tE=M1,nE=P1,iE=(t,e,n)=>{const i=new Map,r={platform:Y1,...n},s={...r.platform,_c:i};return S1(t,e,{...r,platform:s})};function rE(t){return t!=null&&typeof t=="object"&&"$el"in t}function mf(t){if(rE(t)){const e=t.$el;return qh(e)&&Qs(e)==="#comment"?null:e}return t}function Eo(t){return typeof t=="function"?t():T(t)}function sE(t){return{name:"arrow",options:t,fn(e){const n=mf(Eo(t.element));return n==null?{}:tE({element:n,padding:t.padding}).fn(e)}}}function kx(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ug(t,e){const n=kx(t);return Math.round(e*n)/n}function oE(t,e,n){n===void 0&&(n={});const i=n.whileElementsMounted,r=Te(()=>{var P;return(P=Eo(n.open))!=null?P:!0}),s=Te(()=>Eo(n.middleware)),o=Te(()=>{var P;return(P=Eo(n.placement))!=null?P:"bottom"}),a=Te(()=>{var P;return(P=Eo(n.strategy))!=null?P:"absolute"}),l=Te(()=>{var P;return(P=Eo(n.transform))!=null?P:!0}),c=Te(()=>mf(t.value)),u=Te(()=>mf(e.value)),d=Ve(0),f=Ve(0),h=Ve(a.value),g=Ve(o.value),v=du({}),m=Ve(!1),p=Te(()=>{const P={position:h.value,left:"0",top:"0"};if(!u.value)return P;const D=ug(u.value,d.value),S=ug(u.value,f.value);return l.value?{...P,transform:"translate("+D+"px, "+S+"px)",...kx(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:D+"px",top:S+"px"}});let _;function x(){if(c.value==null||u.value==null)return;const P=r.value;iE(c.value,u.value,{middleware:s.value,placement:o.value,strategy:a.value}).then(D=>{d.value=D.x,f.value=D.y,h.value=D.strategy,g.value=D.placement,v.value=D.middlewareData,m.value=P!==!1})}function y(){typeof _=="function"&&(_(),_=void 0)}function w(){if(y(),i===void 0){x();return}if(c.value!=null&&u.value!=null){_=i(c.value,u.value,x);return}}function A(){r.value||(m.value=!1)}return sn([s,o,a,r],x,{flush:"sync"}),sn([c,u],w,{flush:"sync"}),sn(r,A,{flush:"sync"}),Mh()&&i_(y),{x:Ns(d),y:Ns(f),strategy:Ns(h),placement:Ns(g),middlewareData:Ns(v),isPositioned:Ns(m),floatingStyles:p,update:x}}const aE={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[UU,lE]=zr("PopperContent");var cE=Fe({inheritAttrs:!1,__name:"PopperContent",props:qS({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...aE}),emits:["placed"],setup(t,{emit:e}){const n=t,i=e,r=Tx(),{forwardRef:s,currentElement:o}=tn(),a=Ve(),l=Ve(),{width:c,height:u}=_x(l),d=Te(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),f=Te(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),h=Te(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),g=Te(()=>({padding:f.value,boundary:h.value.filter(c1),altBoundary:h.value.length>0})),v=Te(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),m=sw(()=>[Z1({mainAxis:n.sideOffset+u.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&cg({...g.value,...v.value}),n.avoidCollisions&&j1({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?nE():void 0,...g.value}),!n.prioritizePosition&&n.avoidCollisions&&cg({...g.value,...v.value}),Q1({...g.value,apply:({elements:B,rects:q,availableWidth:K,availableHeight:$})=>{const{width:W,height:k}=q.reference,z=B.floating.style;z.setProperty("--reka-popper-available-width",`${K}px`),z.setProperty("--reka-popper-available-height",`${$}px`),z.setProperty("--reka-popper-anchor-width",`${W}px`),z.setProperty("--reka-popper-anchor-height",`${k}px`)}}),l.value&&sE({element:l.value,padding:n.arrowPadding}),u1({arrowWidth:c.value,arrowHeight:u.value}),n.hideWhenDetached&&eE({strategy:"referenceHidden",...g.value})]),p=Te(()=>n.reference??r.anchor.value),{floatingStyles:_,placement:x,isPositioned:y,middlewareData:w}=oE(p,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...B)=>K1(...B,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:m}),A=Te(()=>df(x.value)[0]),P=Te(()=>df(x.value)[1]);P_(()=>{y.value&&i("placed")});const D=Te(()=>{const B=w.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&B}),S=Ve("");fi(()=>{o.value&&(S.value=window.getComputedStyle(o.value).zIndex)});const M=Te(()=>w.value.arrow?.x??0),N=Te(()=>w.value.arrow?.y??0);return lE({placedSide:A,onArrowChange:B=>l.value=B,arrowX:M,arrowY:N,shouldHideArrow:D}),(B,q)=>(ge(),kt("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:Fr({...T(_),transform:T(y)?T(_).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:S.value,"--reka-popper-transform-origin":[T(w).transformOrigin?.x,T(w).transformOrigin?.y].join(" "),...T(w).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[re(T(yn),Dt({ref:T(s)},B.$attrs,{"as-child":n.asChild,as:B.as,"data-side":A.value,"data-align":P.value,style:{animation:T(y)?void 0:"none"}}),{default:ne(()=>[ot(B.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Bx=cE;function uE(t=[],e,n){const i=[...t];return i[n]=e,i.sort((r,s)=>r-s)}function zx(t,e,n){const s=100/(n-e)*(t-e);return Oh(s,0,100)}function dE(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function fE(t,e){if(t.length===1)return 0;const n=t.map(r=>Math.abs(r-e)),i=Math.min(...n);return n.indexOf(i)}function hE(t,e,n){const i=t/2,s=Jh([0,50],[0,i]);return(i-s(e)*n)*n}function pE(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function mE(t,e){if(e>0){const n=pE(t);return Math.min(...n)>=e}return!0}function Jh(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function gE(t){return(String(t).split(".")[1]||"").length}function vE(t,e){const n=10**e;return Math.round(t*n)/n}const Vx=["PageUp","PageDown"],Hx=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Gx={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageUp","ArrowUp","ArrowLeft"]},[Wx,qx]=zr(["SliderVertical","SliderHorizontal"]);var _E=Fe({__name:"SliderHorizontal",props:{dir:{type:String,required:!1},min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:["slideEnd","slideStart","slideMove","homeKeyDown","endKeyDown","stepKeyDown"],setup(t,{emit:e}){const n=t,i=e,{max:r,min:s,dir:o,inverted:a}=Pr(n),{forwardRef:l,currentElement:c}=tn(),u=na(),d=Ve(),f=Ve(),h=Te(()=>o?.value!=="rtl"&&!a.value||o?.value!=="ltr"&&a.value);function g(_,x){const y=f.value||c.value.getBoundingClientRect(),w=[...u.thumbElements.value][u.valueIndexToChangeRef.value],A=u.thumbAlignment.value==="contain"?w.clientWidth:0;!d.value&&!x&&u.thumbAlignment.value==="contain"&&(d.value=_.clientX-w.getBoundingClientRect().left);const P=[0,y.width-A],D=h.value?[s.value,r.value]:[r.value,s.value],S=Jh(P,D);f.value=y;const M=x?_.clientX-y.left-A/2:_.clientX-y.left-(d.value??0);return S(M)}const v=Te(()=>h.value?"left":"right"),m=Te(()=>h.value?"right":"left"),p=Te(()=>h.value?1:-1);return qx({startEdge:v,endEdge:m,direction:p,size:"width"}),(_,x)=>(ge(),ke(Xx,{ref:T(l),dir:T(o),"data-orientation":"horizontal",style:Fr({"--reka-slider-thumb-transform":!h.value&&T(u).thumbAlignment.value==="overflow"?"translateX(50%)":"translateX(-50%)"}),onSlideStart:x[0]||(x[0]=y=>{const w=g(y,!0);i("slideStart",w)}),onSlideMove:x[1]||(x[1]=y=>{const w=g(y);i("slideMove",w)}),onSlideEnd:x[2]||(x[2]=()=>{f.value=void 0,d.value=void 0,i("slideEnd")}),onStepKeyDown:x[3]||(x[3]=y=>{const w=h.value?"from-left":"from-right",A=T(Gx)[w].includes(y.key);i("stepKeyDown",y,A?-1:1)}),onEndKeyDown:x[4]||(x[4]=y=>i("endKeyDown",y)),onHomeKeyDown:x[5]||(x[5]=y=>i("homeKeyDown",y))},{default:ne(()=>[ot(_.$slots,"default")]),_:3},8,["dir","style"]))}}),xE=_E,yE=Fe({__name:"SliderVertical",props:{min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:["slideEnd","slideStart","slideMove","homeKeyDown","endKeyDown","stepKeyDown"],setup(t,{emit:e}){const n=t,i=e,{max:r,min:s,inverted:o}=Pr(n),a=na(),{forwardRef:l,currentElement:c}=tn(),u=Ve(),d=Ve(),f=Te(()=>!o.value);function h(p,_){const x=d.value||c.value.getBoundingClientRect(),y=[...a.thumbElements.value][a.valueIndexToChangeRef.value],w=a.thumbAlignment.value==="contain"?y.clientHeight:0;!u.value&&!_&&a.thumbAlignment.value==="contain"&&(u.value=p.clientY-y.getBoundingClientRect().top);const A=[0,x.height-w],P=f.value?[r.value,s.value]:[s.value,r.value],D=Jh(A,P),S=_?p.clientY-x.top-w/2:p.clientY-x.top-(u.value??0);return d.value=x,D(S)}const g=Te(()=>f.value?"bottom":"top"),v=Te(()=>f.value?"top":"bottom"),m=Te(()=>f.value?1:-1);return qx({startEdge:g,endEdge:v,direction:m,size:"height"}),(p,_)=>(ge(),ke(Xx,{ref:T(l),"data-orientation":"vertical",style:Fr({"--reka-slider-thumb-transform":!f.value&&T(a).thumbAlignment.value==="overflow"?"translateY(-50%)":"translateY(50%)"}),onSlideStart:_[0]||(_[0]=x=>{const y=h(x,!0);i("slideStart",y)}),onSlideMove:_[1]||(_[1]=x=>{const y=h(x);i("slideMove",y)}),onSlideEnd:_[2]||(_[2]=()=>{d.value=void 0,u.value=void 0,i("slideEnd")}),onStepKeyDown:_[3]||(_[3]=x=>{const y=f.value?"from-bottom":"from-top",w=T(Gx)[y].includes(x.key);i("stepKeyDown",x,w?-1:1)}),onEndKeyDown:_[4]||(_[4]=x=>i("endKeyDown",x)),onHomeKeyDown:_[5]||(_[5]=x=>i("homeKeyDown",x))},{default:ne(()=>[ot(p.$slots,"default")]),_:3},8,["style"]))}}),bE=yE;const[na,SE]=zr("SliderRoot");var ME=Fe({inheritAttrs:!1,__name:"SliderRoot",props:{defaultValue:{type:Array,required:!1,default:()=>[0]},modelValue:{type:[Array,null],required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},inverted:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},minStepsBetweenThumbs:{type:Number,required:!1,default:0},thumbAlignment:{type:String,required:!1,default:"contain"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","valueCommit"],setup(t,{emit:e}){const n=t,i=e,{min:r,max:s,step:o,minStepsBetweenThumbs:a,orientation:l,disabled:c,thumbAlignment:u,dir:d}=Pr(n),f=ww(d),{forwardRef:h,currentElement:g}=tn(),v=gx(g),{CollectionSlot:m}=Vh({isProvider:!0}),p=xu(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),_=Te(()=>Array.isArray(p.value)?[...p.value]:[]),x=Ve(0),y=Ve(_.value);function w(M){const N=fE(_.value,M);D(M,N)}function A(M){D(M,x.value)}function P(){const M=y.value[x.value];_.value[x.value]!==M&&i("valueCommit",wt(_.value))}function D(M,N,{commit:B}={commit:!1}){const q=gE(o.value),K=vE(Math.round((M-r.value)/o.value)*o.value+r.value,q),$=Oh(K,r.value,s.value),W=uE(_.value,$,N);if(mE(W,a.value*o.value)){x.value=W.indexOf($);const k=String(W)!==String(p.value);k&&B&&i("valueCommit",W),k&&(S.value[x.value]?.focus(),p.value=W)}}const S=Ve([]);return SE({modelValue:p,currentModelValue:_,valueIndexToChangeRef:x,thumbElements:S,orientation:l,min:r,max:s,disabled:c,thumbAlignment:u}),(M,N)=>(ge(),ke(T(m),null,{default:ne(()=>[(ge(),ke(Rh(T(l)==="horizontal"?xE:bE),Dt(M.$attrs,{ref:T(h),"as-child":M.asChild,as:M.as,min:T(r),max:T(s),dir:T(f),inverted:M.inverted,"aria-disabled":T(c),"data-disabled":T(c)?"":void 0,onPointerdown:N[0]||(N[0]=()=>{T(c)||(y.value=_.value)}),onSlideStart:N[1]||(N[1]=B=>!T(c)&&w(B)),onSlideMove:N[2]||(N[2]=B=>!T(c)&&A(B)),onSlideEnd:N[3]||(N[3]=B=>!T(c)&&P()),onHomeKeyDown:N[4]||(N[4]=B=>!T(c)&&D(T(r),0,{commit:!0})),onEndKeyDown:N[5]||(N[5]=B=>!T(c)&&D(T(s),_.value.length-1,{commit:!0})),onStepKeyDown:N[6]||(N[6]=(B,q)=>{if(!T(c)){const W=T(Vx).includes(B.key)||B.shiftKey&&T(Hx).includes(B.key)?10:1,k=x.value,z=_.value[k],de=T(o)*W*q;D(z+de,k,{commit:!0})}})}),{default:ne(()=>[ot(M.$slots,"default",{modelValue:T(p)}),T(v)&&M.name?(ge(),ke(T(Ex),{key:0,type:"number",value:T(p),name:M.name,required:M.required,disabled:T(c),step:T(o)},null,8,["value","name","required","disabled","step"])):yr("v-if",!0)]),_:3},16,["as-child","as","min","max","dir","inverted","aria-disabled","data-disabled"]))]),_:3}))}}),wE=ME,EE=Fe({__name:"SliderImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},emits:["slideStart","slideMove","slideEnd","homeKeyDown","endKeyDown","stepKeyDown"],setup(t,{emit:e}){const n=t,i=e,r=na();return(s,o)=>(ge(),ke(T(yn),Dt({"data-slider-impl":""},n,{onKeydown:o[0]||(o[0]=a=>{a.key==="Home"?(i("homeKeyDown",a),a.preventDefault()):a.key==="End"?(i("endKeyDown",a),a.preventDefault()):T(Vx).concat(T(Hx)).includes(a.key)&&(i("stepKeyDown",a),a.preventDefault())}),onPointerdown:o[1]||(o[1]=a=>{const l=a.target;l.setPointerCapture(a.pointerId),a.preventDefault(),T(r).thumbElements.value.includes(l)?l.focus():i("slideStart",a)}),onPointermove:o[2]||(o[2]=a=>{a.target.hasPointerCapture(a.pointerId)&&i("slideMove",a)}),onPointerup:o[3]||(o[3]=a=>{const l=a.target;l.hasPointerCapture(a.pointerId)&&(l.releasePointerCapture(a.pointerId),i("slideEnd",a))})}),{default:ne(()=>[ot(s.$slots,"default")]),_:3},16))}}),Xx=EE,TE=Fe({__name:"SliderRange",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=na(),n=Wx();tn();const i=Te(()=>e.currentModelValue.value.map(o=>zx(o,e.min.value,e.max.value))),r=Te(()=>e.currentModelValue.value.length>1?Math.min(...i.value):0),s=Te(()=>100-Math.max(...i.value,0));return(o,a)=>(ge(),ke(T(yn),{"data-disabled":T(e).disabled.value?"":void 0,"data-orientation":T(e).orientation.value,"as-child":o.asChild,as:o.as,style:Fr({[T(n).startEdge.value]:`${r.value}%`,[T(n).endEdge.value]:`${s.value}%`})},{default:ne(()=>[ot(o.$slots,"default")]),_:3},8,["data-disabled","data-orientation","as-child","as","style"]))}}),AE=TE,CE=Fe({inheritAttrs:!1,__name:"SliderThumbImpl",props:{index:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=na(),i=Wx(),{forwardRef:r,currentElement:s}=tn(),{CollectionItem:o}=Vh(),a=Te(()=>n.modelValue?.value?.[e.index]),l=Te(()=>a.value===void 0?0:zx(a.value,n.min.value??0,n.max.value??100)),c=Te(()=>dE(e.index,n.modelValue?.value?.length??0)),u=_x(s),d=Te(()=>u[i.size].value),f=Te(()=>n.thumbAlignment.value==="overflow"||!d.value?0:hE(d.value,l.value,i.direction.value)),h=hx();return Ri(()=>{n.thumbElements.value.push(s.value)}),il(()=>{const g=n.thumbElements.value.findIndex(v=>v===s.value)??-1;n.thumbElements.value.splice(g,1)}),(g,v)=>(ge(),ke(T(o),null,{default:ne(()=>[re(T(yn),Dt(g.$attrs,{ref:T(r),role:"slider",tabindex:T(n).disabled.value?void 0:0,"aria-label":g.$attrs["aria-label"]||c.value,"data-disabled":T(n).disabled.value?"":void 0,"data-orientation":T(n).orientation.value,"aria-valuenow":a.value,"aria-valuemin":T(n).min.value,"aria-valuemax":T(n).max.value,"aria-orientation":T(n).orientation.value,"as-child":g.asChild,as:g.as,style:{transform:"var(--reka-slider-thumb-transform)",position:"absolute",[T(i).startEdge.value]:`calc(${l.value}% + ${f.value}px)`,display:!T(h)&&a.value===void 0?"none":void 0},onFocus:v[0]||(v[0]=()=>{T(n).valueIndexToChangeRef.value=g.index})}),{default:ne(()=>[ot(g.$slots,"default")]),_:3},16,["tabindex","aria-label","data-disabled","data-orientation","aria-valuenow","aria-valuemin","aria-valuemax","aria-orientation","as-child","as","style"])]),_:3}))}}),PE=CE,RE=Fe({__name:"SliderThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=t,{getItems:n}=Vh(),{forwardRef:i,currentElement:r}=tn(),s=Te(()=>r.value?n(!0).findIndex(o=>o.ref===r.value):-1);return(o,a)=>(ge(),ke(PE,Dt({ref:T(i)},e,{index:s.value}),{default:ne(()=>[ot(o.$slots,"default")]),_:3},16,["index"]))}}),DE=RE,IE=Fe({__name:"SliderTrack",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=na();return tn(),(n,i)=>(ge(),ke(T(yn),{"as-child":n.asChild,as:n.as,"data-disabled":T(e).disabled.value?"":void 0,"data-orientation":T(e).orientation.value},{default:ne(()=>[ot(n.$slots,"default")]),_:3},8,["as-child","as","data-disabled","data-orientation"]))}}),NE=IE;const[cl,LE]=zr("PopoverRoot");var OE=Fe({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(t,{emit:e}){const n=t,i=e,{modal:r}=Pr(n),s=xu(n,"open",i,{defaultValue:n.defaultOpen,passive:n.open===void 0});return LE({contentId:"",triggerId:"",modal:r,open:s,onOpenChange:l=>{s.value=l},onOpenToggle:()=>{s.value=!s.value},triggerElement:Ve(),hasCustomAnchor:Ve(!1)}),(l,c)=>(ge(),ke(T(Ax),null,{default:ne(()=>[ot(l.$slots,"default",{open:T(s),close:()=>s.value=!1})]),_:3}))}}),FE=OE,UE=Fe({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=al(js(n,"trapFocus","disableOutsidePointerEvents")),{forwardRef:s}=tn(),o=cl();return Tw(),(a,l)=>(ge(),ke(T(t1),{"as-child":"",loop:"",trapped:a.trapFocus,onMountAutoFocus:l[5]||(l[5]=c=>i("openAutoFocus",c)),onUnmountAutoFocus:l[6]||(l[6]=c=>i("closeAutoFocus",c))},{default:ne(()=>[re(T(bx),{"as-child":"","disable-outside-pointer-events":a.disableOutsidePointerEvents,onPointerDownOutside:l[0]||(l[0]=c=>i("pointerDownOutside",c)),onInteractOutside:l[1]||(l[1]=c=>i("interactOutside",c)),onEscapeKeyDown:l[2]||(l[2]=c=>i("escapeKeyDown",c)),onFocusOutside:l[3]||(l[3]=c=>i("focusOutside",c)),onDismiss:l[4]||(l[4]=c=>T(o).onOpenChange(!1))},{default:ne(()=>[re(T(Bx),Dt(T(r),{id:T(o).contentId,ref:T(s),"data-state":T(o).open.value?"open":"closed","aria-labelledby":T(o).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:ne(()=>[ot(a.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),$x=UE,kE=Fe({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=cl(),s=Ve(!1);Sw(!0);const o=Qi(n,i),{forwardRef:a,currentElement:l}=tn();return kw(l),(c,u)=>(ge(),ke($x,Dt(T(o),{ref:T(a),"trap-focus":T(r).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:u[0]||(u[0]=li(d=>{i("closeAutoFocus",d),s.value||T(r).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:u[1]||(u[1]=d=>{i("pointerDownOutside",d);const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,g=f.button===2||h;s.value=g}),onFocusOutside:u[2]||(u[2]=li(()=>{},["prevent"]))}),{default:ne(()=>[ot(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),BE=kE,zE=Fe({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=cl(),s=Ve(!1),o=Ve(!1),a=Qi(n,i);return(l,c)=>(ge(),ke($x,Dt(T(a),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=u=>{i("closeAutoFocus",u),u.defaultPrevented||(s.value||T(r).triggerElement.value?.focus(),u.preventDefault()),s.value=!1,o.value=!1}),onInteractOutside:c[1]||(c[1]=async u=>{i("interactOutside",u),u.defaultPrevented||(s.value=!0,u.detail.originalEvent.type==="pointerdown"&&(o.value=!0));const d=u.target;T(r).triggerElement.value?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.value&&u.preventDefault()})}),{default:ne(()=>[ot(l.$slots,"default")]),_:3},16))}}),VE=zE,HE=Fe({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=cl(),s=Qi(n,i),{forwardRef:o}=tn();return r.contentId||=zh(void 0,"reka-popover-content"),(a,l)=>(ge(),ke(T(xx),{present:a.forceMount||T(r).open.value},{default:ne(()=>[T(r).modal.value?(ge(),ke(BE,Dt({key:0},T(s),{ref:T(o)}),{default:ne(()=>[ot(a.$slots,"default")]),_:3},16)):(ge(),ke(VE,Dt({key:1},T(s),{ref:T(o)}),{default:ne(()=>[ot(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),GE=HE,WE=Fe({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,i)=>(ge(),ke(T(Mx),ms(kr(e)),{default:ne(()=>[ot(n.$slots,"default")]),_:3},16))}}),qE=WE,XE=Fe({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=cl(),{forwardRef:i,currentElement:r}=tn();return n.triggerId||=zh(void 0,"reka-popover-trigger"),Ri(()=>{n.triggerElement.value=r.value}),(s,o)=>(ge(),ke(Rh(T(n).hasCustomAnchor.value?T(yn):T(Cx)),{"as-child":""},{default:ne(()=>[re(T(yn),{id:T(n).triggerId,ref:T(i),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":T(n).open.value,"aria-controls":T(n).contentId,"data-state":T(n).open.value?"open":"closed",as:s.as,"as-child":e.asChild,onClick:T(n).onOpenToggle},{default:ne(()=>[ot(s.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),$E=XE;let ju=new Map,gf=!1;try{gf=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let Hc=!1;try{Hc=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const Yx={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class Jx{format(e){let n="";if(!gf&&this.options.signDisplay!=null?n=JE(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!Hc){var i;let{unit:r,unitDisplay:s="short",locale:o}=this.resolvedOptions();if(!r)return n;let a=(i=Yx[r])===null||i===void 0?void 0:i[s];n+=a[o]||a.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n= start date");return`${this.format(e)} – ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n= start date");let i=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(n);return[...i.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!gf&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!Hc&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,n={}){this.numberFormatter=YE(e,n),this.options=n}}function YE(t,e={}){let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!Hc){var i;let{unit:o,unitDisplay:a="short"}=e;if(!o)throw new Error('unit option must be provided with style: "unit"');if(!(!((i=Yx[o])===null||i===void 0)&&i[a]))throw new Error(`Unsupported unit ${o} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let r=t+(e?Object.entries(e).sort((o,a)=>o[0]0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):i=n>0),i){let r=t.format(-n),s=t.format(n),o=r.replace(s,"").replace(/\u200e|\u061C/,"");return[...o].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),r.replace(s,"!!!").replace(o,"+").replace("!!!",s)}else return t.format(n)}}const KE=new RegExp("^.*\\(.*\\).*$"),ZE=["latn","arab","hanidec","deva","beng","fullwide"];class Kx{parse(e){return Qu(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,n,i){return Qu(this.locale,this.options,e).isValidPartialNumber(e,n,i)}getNumberingSystem(e){return Qu(this.locale,this.options,e).options.numberingSystem}constructor(e,n={}){this.locale=e,this.options=n}}const dg=new Map;function Qu(t,e,n){let i=fg(t,e);if(!t.includes("-nu-")&&!i.isValidPartialNumber(n)){for(let r of ZE)if(r!==i.options.numberingSystem){let s=fg(t+(t.includes("-u-")?"-nu-":"-u-nu-")+r,e);if(s.isValidPartialNumber(n))return s}}return i}function fg(t,e){let n=t+(e?Object.entries(e).sort((r,s)=>r[0]-1&&(n=`-${n}`)}let i=n?+n:NaN;if(isNaN(i))return NaN;if(this.options.style==="percent"){var r,s;let o={...this.options,style:"decimal",minimumFractionDigits:Math.min(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)+2,20),maximumFractionDigits:Math.min(((s=this.options.maximumFractionDigits)!==null&&s!==void 0?s:0)+2,20)};return new Kx(this.locale,o).parse(new Jx(this.locale,o).format(i))}return this.options.currencySign==="accounting"&&KE.test(e)&&(i=-1*i),i}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=ao(e,".",this.symbols.group))),this.symbols.group==="’"&&e.includes("'")&&(e=ao(e,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(e=ao(e," ",this.symbols.group),e=ao(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,n=-1/0,i=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&n<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&i>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=ao(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,n={}){this.locale=e,n.roundingIncrement!==1&&n.roundingIncrement!=null&&(n.maximumFractionDigits==null&&n.minimumFractionDigits==null?(n.maximumFractionDigits=0,n.minimumFractionDigits=0):n.maximumFractionDigits==null?n.maximumFractionDigits=n.minimumFractionDigits:n.minimumFractionDigits==null&&(n.minimumFractionDigits=n.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,n),this.options=this.formatter.resolvedOptions(),this.symbols=eT(e,this.formatter,this.options,n);var i,r;this.options.style==="percent"&&(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)>18||((r=this.options.maximumFractionDigits)!==null&&r!==void 0?r:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const hg=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),QE=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function eT(t,e,n,i){var r,s,o,a;let l=new Intl.NumberFormat(t,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),d=QE.map(M=>l.formatToParts(M));var f;let h=(f=(r=c.find(M=>M.type==="minusSign"))===null||r===void 0?void 0:r.value)!==null&&f!==void 0?f:"-",g=(s=u.find(M=>M.type==="plusSign"))===null||s===void 0?void 0:s.value;!g&&(i?.signDisplay==="exceptZero"||i?.signDisplay==="always")&&(g="+");let m=(o=new Intl.NumberFormat(t,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(M=>M.type==="decimal"))===null||o===void 0?void 0:o.value,p=(a=c.find(M=>M.type==="group"))===null||a===void 0?void 0:a.value,_=c.filter(M=>!hg.has(M.type)).map(M=>pg(M.value)),x=d.flatMap(M=>M.filter(N=>!hg.has(N.type)).map(N=>pg(N.value))),y=[...new Set([..._,...x])].sort((M,N)=>N.length-M.length),w=y.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${y.join("|")}|[\\p{White_Space}]`,"gu"),A=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),P=new Map(A.map((M,N)=>[M,N])),D=new RegExp(`[${A.join("")}]`,"g");return{minusSign:h,plusSign:g,decimal:m,group:p,literals:w,numeral:D,index:M=>String(P.get(M))}}function ao(t,e,n){return t.replaceAll?t.replaceAll(e,n):t.split(e).join(n)}function pg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zx(t){const{disabled:e}=t,n=Ve(),i=dx(),r=()=>window.clearTimeout(n.value),s=f=>{r(),!e.value&&(i.trigger(),n.value=window.setTimeout(()=>{s(60)},f))},o=()=>{s(400)},a=()=>{r()},l=Ve(!1),c=Te(()=>gs(t.target)),u=f=>{f.button!==0||l.value||(f.preventDefault(),l.value=!0,o())},d=()=>{l.value=!1,a()};return Di&&(qs(c||window,"pointerdown",u),qs(window,"pointerup",d),qs(window,"pointercancel",d)),{isPressed:l,onTrigger:i.on}}function mg(t,e=Ve({})){return Fh(()=>new Jx(t.value,e.value))}function tT(t,e=Ve({})){return Fh(()=>new Kx(t.value,e.value))}function gg(t,e,n){let i=t==="+"?e+n:e-n;if(e%1!==0||n%1!==0){const r=e.toString().split("."),s=n.toString().split("."),o=r[1]&&r[1].length||0,a=s[1]&&s[1].length||0,l=10**Math.max(o,a);e=Math.round(e*l),n=Math.round(n*l),i=t==="+"?e+n:e-n,i/=l}return i}const[Kh,nT]=zr("NumberFieldRoot");var iT=Fe({inheritAttrs:!1,__name:"NumberFieldRoot",props:{defaultValue:{type:Number,required:!1,default:void 0},modelValue:{type:[Number,null],required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1,default:1},stepSnapping:{type:Boolean,required:!1,default:!0},focusOnChange:{type:Boolean,required:!1,default:!0},formatOptions:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,{disabled:r,readonly:s,disableWheelChange:o,invertWheelChange:a,min:l,max:c,step:u,stepSnapping:d,formatOptions:f,id:h,locale:g}=Pr(n),v=xu(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{primitiveElement:m,currentElement:p}=Ys(),_=Bw(g),x=gx(p),y=Ve(),w=Te(()=>!_c(v.value)&&(z(v.value)===l.value||l.value&&!isNaN(v.value)?gg("-",v.value,u.value)!_c(v.value)&&(z(v.value)===c.value||c.value&&!isNaN(v.value)?gg("+",v.value,u.value)>c.value:!1));function P(le,pe=1){if(n.focusOnChange&&y.value?.focus(),n.disabled||n.readonly)return;const He=B.parse(y.value?.value??"");isNaN(He)?v.value=l.value??0:le==="increase"?v.value=z(He+(u.value??1)*pe):v.value=z(He-(u.value??1)*pe)}function D(le=1){P("increase",le)}function S(le=1){P("decrease",le)}function M(le){le==="min"&&l.value!==void 0?v.value=z(l.value):le==="max"&&c.value!==void 0&&(v.value=z(c.value))}const N=mg(_,f),B=tT(_,f),q=Te(()=>N.resolvedOptions().maximumFractionDigits>0?"decimal":"numeric"),K=mg(_,f),$=Te(()=>_c(v.value)||isNaN(v.value)?"":K.format(v.value));function W(le){return B.isValidPartialNumber(le,l.value,c.value)}function k(le){y.value&&(y.value.value=le)}function z(le){let pe;return u.value===void 0||isNaN(u.value)||!d.value?pe=Oh(le,l.value,c.value):pe=rw(le,l.value,c.value,u.value),pe=B.parse(N.format(pe)),pe}function de(le){const pe=B.parse(le);return v.value=isNaN(pe)?void 0:z(pe),le.length?(isNaN(pe),k($.value)):k(le)}return nT({modelValue:v,handleDecrease:S,handleIncrease:D,handleMinMaxValue:M,inputMode:q,inputEl:y,onInputElement:le=>y.value=le,textValue:$,readonly:s,validate:W,applyInputValue:de,disabled:r,disableWheelChange:o,invertWheelChange:a,max:c,min:l,isDecreaseDisabled:w,isIncreaseDisabled:A,id:h}),(le,pe)=>(ge(),ke(T(yn),Dt(le.$attrs,{ref_key:"primitiveElement",ref:m,role:"group",as:le.as,"as-child":le.asChild,"data-disabled":T(r)?"":void 0,"data-readonly":T(s)?"":void 0}),{default:ne(()=>[ot(le.$slots,"default",{modelValue:T(v),textValue:$.value,readonly:T(s)}),T(x)&&le.name?(ge(),ke(T(Ex),{key:0,type:"text",value:T(v),name:le.name,disabled:T(r),readonly:T(s),required:le.required},null,8,["value","name","disabled","readonly","required"])):yr("v-if",!0)]),_:3},16,["as","as-child","data-disabled","data-readonly"]))}}),rT=iT,sT=Fe({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Kh(),i=Te(()=>n.disabled?.value||n.readonly.value||e.disabled||n.isDecreaseDisabled.value),{primitiveElement:r,currentElement:s}=Ys(),{isPressed:o,onTrigger:a}=Zx({target:s,disabled:i});return a(()=>{n.handleDecrease()}),(l,c)=>(ge(),ke(T(yn),Dt(e,{ref_key:"primitiveElement",ref:r,tabindex:"-1","aria-label":"Decrease",type:l.as==="button"?"button":void 0,style:{userSelect:T(o)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":T(o)?"true":void 0,onContextmenu:c[0]||(c[0]=li(()=>{},["prevent"]))}),{default:ne(()=>[ot(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),oT=sT,aT=Fe({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Kh(),i=Te(()=>n.disabled?.value||n.readonly.value||e.disabled||n.isIncreaseDisabled.value),{primitiveElement:r,currentElement:s}=Ys(),{isPressed:o,onTrigger:a}=Zx({target:s,disabled:i});return a(()=>{n.handleIncrease()}),(l,c)=>(ge(),ke(T(yn),Dt(e,{ref_key:"primitiveElement",ref:r,tabindex:"-1","aria-label":"Increase",type:l.as==="button"?"button":void 0,style:{userSelect:T(o)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":T(o)?"true":void 0,onContextmenu:c[0]||(c[0]=li(()=>{},["prevent"]))}),{default:ne(()=>[ot(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),lT=aT,cT=Fe({__name:"NumberFieldInput",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},setup(t){const e=t,{primitiveElement:n,currentElement:i}=Ys(),r=Kh();function s(l){r.disableWheelChange.value||l.target===Ws()&&(Math.abs(l.deltaY)<=Math.abs(l.deltaX)||(l.preventDefault(),l.deltaY>0?r.invertWheelChange.value?r.handleDecrease():r.handleIncrease():l.deltaY<0&&(r.invertWheelChange.value?r.handleIncrease():r.handleDecrease())))}Ri(()=>{r.onInputElement(i.value)});const o=Ve(r.textValue.value);sn(()=>r.textValue.value,()=>{o.value=r.textValue.value},{immediate:!0,deep:!0});function a(){requestAnimationFrame(()=>{o.value=r.textValue.value})}return(l,c)=>(ge(),ke(T(yn),Dt(e,{id:T(r).id.value,ref_key:"primitiveElement",ref:n,value:o.value,role:"spinbutton",type:"text",tabindex:"0",inputmode:T(r).inputMode.value,disabled:T(r).disabled.value?"":void 0,"data-disabled":T(r).disabled.value?"":void 0,readonly:T(r).readonly.value?"":void 0,"data-readonly":T(r).readonly.value?"":void 0,autocomplete:"off",autocorrect:"off",spellcheck:"false","aria-roledescription":"Number field","aria-valuenow":T(r).modelValue.value,"aria-valuemin":T(r).min.value,"aria-valuemax":T(r).max.value,onKeydown:[c[0]||(c[0]=Ms(li(u=>T(r).handleIncrease(),["prevent"]),["up"])),c[1]||(c[1]=Ms(li(u=>T(r).handleDecrease(),["prevent"]),["down"])),c[2]||(c[2]=Ms(li(u=>T(r).handleIncrease(10),["prevent"]),["page-up"])),c[3]||(c[3]=Ms(li(u=>T(r).handleDecrease(10),["prevent"]),["page-down"])),c[4]||(c[4]=Ms(li(u=>T(r).handleMinMaxValue("min"),["prevent"]),["home"])),c[5]||(c[5]=Ms(li(u=>T(r).handleMinMaxValue("max"),["prevent"]),["end"])),c[8]||(c[8]=Ms(u=>T(r).applyInputValue(u.target?.value),["enter"]))],onWheel:s,onBeforeinput:c[6]||(c[6]=u=>{const d=u.target;let f=d.value.slice(0,d.selectionStart??void 0)+(u.data??"")+d.value.slice(d.selectionEnd??void 0);T(r).validate(f)||u.preventDefault()}),onInput:c[7]||(c[7]=u=>{const d=u.target;o.value=d.value}),onChange:a,onBlur:c[9]||(c[9]=u=>T(r).applyInputValue(u.target?.value))}),{default:ne(()=>[ot(l.$slots,"default")]),_:3},16,["id","value","inputmode","disabled","data-disabled","readonly","data-readonly","aria-valuenow","aria-valuemin","aria-valuemax"]))}}),uT=cT;const[wu,dT]=zr("TooltipProvider");var fT=Fe({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(t){const e=t,{delayDuration:n,skipDelayDuration:i,disableHoverableContent:r,disableClosingTrigger:s,ignoreNonKeyboardFocus:o,disabled:a,content:l}=Pr(e);tn();const c=Ve(!0),u=Ve(!1),{start:d,stop:f}=fx(()=>{c.value=!0},i,{immediate:!1});return dT({isOpenDelayed:c,delayDuration:n,onOpen(){f(),c.value=!1},onClose(){d()},isPointerInTransitRef:u,disableHoverableContent:r,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:o,content:l}),(h,g)=>ot(h.$slots,"default")}}),hT=fT;const jx="tooltip.open",[Eu,pT]=zr("TooltipRoot");var mT=Fe({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(t,{emit:e}){const n=t,i=e;tn();const r=wu(),s=Te(()=>n.disableHoverableContent??r.disableHoverableContent.value),o=Te(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),a=Te(()=>n.disabled??r.disabled.value),l=Te(()=>n.delayDuration??r.delayDuration.value),c=Te(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),u=xu(n,"open",i,{defaultValue:n.defaultOpen,passive:n.open===void 0});sn(u,x=>{r.onClose&&(x?(r.onOpen(),document.dispatchEvent(new CustomEvent(jx))):r.onClose())});const d=Ve(!1),f=Ve(),h=Te(()=>u.value?d.value?"delayed-open":"instant-open":"closed"),{start:g,stop:v}=fx(()=>{d.value=!0,u.value=!0},l,{immediate:!1});function m(){v(),d.value=!1,u.value=!0}function p(){v(),u.value=!1}function _(){g()}return pT({contentId:"",open:u,stateAttribute:h,trigger:f,onTriggerChange(x){f.value=x},onTriggerEnter(){r.isOpenDelayed.value?_():m()},onTriggerLeave(){s.value?p():v()},onOpen:m,onClose:p,disableHoverableContent:s,disableClosingTrigger:o,disabled:a,ignoreNonKeyboardFocus:c}),(x,y)=>(ge(),ke(T(Ax),null,{default:ne(()=>[ot(x.$slots,"default",{open:T(u)})]),_:3}))}}),gT=mT,vT=Fe({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=Eu(),s=wu(),{forwardRef:o,currentElement:a}=tn(),l=Te(()=>n.ariaLabel||a.value?.textContent),c=Te(()=>{const{ariaLabel:u,...d}=n;return px(d,s.content.value??{},{side:"top",sideOffset:0,align:"center",avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:"partial",hideWhenDetached:!1})});return Ri(()=>{qs(window,"scroll",u=>{u.target?.contains(r.trigger.value)&&r.onClose()},{capture:!0}),qs(window,jx,r.onClose)}),(u,d)=>(ge(),ke(T(bx),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:d[0]||(d[0]=f=>i("escapeKeyDown",f)),onPointerDownOutside:d[1]||(d[1]=f=>{T(r).disableClosingTrigger.value&&T(r).trigger.value?.contains(f.target)&&f.preventDefault(),i("pointerDownOutside",f)}),onFocusOutside:d[2]||(d[2]=li(()=>{},["prevent"])),onDismiss:d[3]||(d[3]=f=>T(r).onClose())},{default:ne(()=>[re(T(Bx),Dt({ref:T(o),"data-state":T(r).stateAttribute.value},{...u.$attrs,...c.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:ne(()=>[ot(u.$slots,"default"),re(T(wx),{id:T(r).contentId,role:"tooltip"},{default:ne(()=>[Gt(cs(l.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),Qx=vT,_T=Fe({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(t){const n=al(t),{forwardRef:i,currentElement:r}=tn(),{trigger:s,onClose:o}=Eu(),a=wu(),{isPointerInTransit:l,onPointerExit:c}=Aw(s,r);return a.isPointerInTransitRef=l,c(()=>{o()}),(u,d)=>(ge(),ke(Qx,Dt({ref:T(i)},T(n)),{default:ne(()=>[ot(u.$slots,"default")]),_:3},16))}}),xT=_T,yT=Fe({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=Eu(),s=Qi(n,i),{forwardRef:o}=tn();return(a,l)=>(ge(),ke(T(xx),{present:a.forceMount||T(r).open.value},{default:ne(()=>[(ge(),ke(Rh(T(r).disableHoverableContent.value?Qx:xT),Dt({ref:T(o)},T(s)),{default:ne(()=>[ot(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),bT=yT,ST=Fe({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,i)=>(ge(),ke(T(Mx),ms(kr(e)),{default:ne(()=>[ot(n.$slots,"default")]),_:3},16))}}),MT=ST,wT=Fe({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Eu(),i=wu();n.contentId||=zh(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:s}=tn(),o=Ve(!1),a=Ve(!1),l=Te(()=>n.disabled.value?{}:{click:v,focus:h,pointermove:d,pointerleave:f,pointerdown:u,blur:g});Ri(()=>{n.onTriggerChange(s.value)});function c(){setTimeout(()=>{o.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),o.value=!0,document.addEventListener("pointerup",c,{once:!0})}function d(m){m.pointerType!=="touch"&&!a.value&&!i.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function f(){n.onTriggerLeave(),a.value=!1}function h(m){o.value||n.ignoreNonKeyboardFocus.value&&!m.target.matches?.(":focus-visible")||n.onOpen()}function g(){n.onClose()}function v(){n.disableClosingTrigger.value||n.onClose()}return(m,p)=>(ge(),ke(T(Cx),{"as-child":"",reference:m.reference},{default:ne(()=>[re(T(yn),Dt({ref:T(r),"aria-describedby":T(n).open.value?T(n).contentId:void 0,"data-state":T(n).stateAttribute.value,as:m.as,"as-child":e.asChild,"data-grace-area-trigger":""},GS(l.value)),{default:ne(()=>[ot(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),ET=wT;const TT=(t,e)=>{const n=new Array(t.length+e.length);for(let i=0;i({classGroupId:t,validator:e}),ey=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Gc="-",vg=[],CT="arbitrary..",PT=t=>{const e=DT(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return RT(o);const a=o.split(Gc),l=a[0]===""&&a.length>1?1:0;return ty(a,l,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=i[o],c=n[o];return l?c?TT(c,l):l:c||vg}return n[o]||vg}}},ty=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const c=ty(t,e+1,s);if(c)return c}const o=n.validators;if(o===null)return;const a=e===0?t.join(Gc):t.slice(e).join(Gc),l=o.length;for(let c=0;ct.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?CT+i:void 0})(),DT=t=>{const{theme:e,classGroups:n}=t;return IT(n,e)},IT=(t,e)=>{const n=ey();for(const i in t){const r=t[i];Zh(r,n,i,e)}return n},Zh=(t,e,n,i)=>{const r=t.length;for(let s=0;s{if(typeof t=="string"){LT(t,e,n);return}if(typeof t=="function"){OT(t,e,n,i);return}FT(t,e,n,i)},LT=(t,e,n)=>{const i=t===""?e:ny(e,t);i.classGroupId=n},OT=(t,e,n,i)=>{if(UT(t)){Zh(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(AT(n,t))},FT=(t,e,n,i)=>{const r=Object.entries(t),s=r.length;for(let o=0;o{let n=t;const i=e.split(Gc),r=i.length;for(let s=0;s"isThemeGetter"in t&&t.isThemeGetter===!0,kT=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,e++,e>t&&(e=0,i=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return r(s,o),o},set(s,o){s in n?n[s]=o:r(s,o)}}},vf="!",_g=":",BT=[],xg=(t,e,n,i,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),zT=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=r=>{const s=[];let o=0,a=0,l=0,c;const u=r.length;for(let v=0;vl?c-l:void 0;return xg(s,h,f,g)};if(e){const r=e+_g,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):xg(BT,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},VT=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let s=0;s0&&(r.sort(),i.push(...r),r=[]),i.push(o)):r.push(o)}return r.length>0&&(r.sort(),i.push(...r)),i}},HT=t=>({cache:kT(t.cacheSize),parseClassName:zT(t),sortModifiers:VT(t),...PT(t)}),GT=/\s+/,WT=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],a=t.trim().split(GT);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let m=!!v,p=i(m?g.substring(0,v):g);if(!p){if(!m){l=u+(l.length>0?" "+l:l);continue}if(p=i(g),!p){l=u+(l.length>0?" "+l:l);continue}m=!1}const _=f.length===0?"":f.length===1?f[0]:s(f).join(":"),x=h?_+vf:_,y=x+p;if(o.indexOf(y)>-1)continue;o.push(y);const w=r(p,m);for(let A=0;A0?" "+l:l)}return l},qT=(...t)=>{let e=0,n,i,r="";for(;e{if(typeof t=="string")return t;let e,n="";for(let i=0;i{let n,i,r,s;const o=l=>{const c=e.reduce((u,d)=>d(u),t());return n=HT(c),i=n.cache.get,r=n.cache.set,s=a,a(l)},a=l=>{const c=i(l);if(c)return c;const u=WT(l,n);return r(l,u),u};return s=o,(...l)=>s(qT(...l))},$T=[],on=t=>{const e=n=>n[t]||$T;return e.isThemeGetter=!0,e},ry=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YT=/^\d+\/\d+$/,JT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ZT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lo=t=>YT.test(t),gt=t=>!!t&&!Number.isNaN(Number(t)),Hr=t=>!!t&&Number.isInteger(Number(t)),ed=t=>t.endsWith("%")&>(t.slice(0,-1)),or=t=>JT.test(t),eA=()=>!0,tA=t=>KT.test(t)&&!ZT.test(t),oy=()=>!1,nA=t=>jT.test(t),iA=t=>QT.test(t),rA=t=>!We(t)&&!qe(t),sA=t=>ia(t,cy,oy),We=t=>ry.test(t),Es=t=>ia(t,uy,tA),td=t=>ia(t,uA,gt),yg=t=>ia(t,ay,oy),oA=t=>ia(t,ly,iA),Al=t=>ia(t,dy,nA),qe=t=>sy.test(t),ua=t=>ra(t,uy),aA=t=>ra(t,dA),bg=t=>ra(t,ay),lA=t=>ra(t,cy),cA=t=>ra(t,ly),Cl=t=>ra(t,dy,!0),ia=(t,e,n)=>{const i=ry.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},ra=(t,e,n=!1)=>{const i=sy.exec(t);return i?i[1]?e(i[1]):n:!1},ay=t=>t==="position"||t==="percentage",ly=t=>t==="image"||t==="url",cy=t=>t==="length"||t==="size"||t==="bg-size",uy=t=>t==="length",uA=t=>t==="number",dA=t=>t==="family-name",dy=t=>t==="shadow",fA=()=>{const t=on("color"),e=on("font"),n=on("text"),i=on("font-weight"),r=on("tracking"),s=on("leading"),o=on("breakpoint"),a=on("container"),l=on("spacing"),c=on("radius"),u=on("shadow"),d=on("inset-shadow"),f=on("text-shadow"),h=on("drop-shadow"),g=on("blur"),v=on("perspective"),m=on("aspect"),p=on("ease"),_=on("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...y(),qe,We],A=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],D=()=>[qe,We,l],S=()=>[lo,"full","auto",...D()],M=()=>[Hr,"none","subgrid",qe,We],N=()=>["auto",{span:["full",Hr,qe,We]},Hr,qe,We],B=()=>[Hr,"auto",qe,We],q=()=>["auto","min","max","fr",qe,We],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...D()],k=()=>[lo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],z=()=>[t,qe,We],de=()=>[...y(),bg,yg,{position:[qe,We]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],pe=()=>["auto","cover","contain",lA,sA,{size:[qe,We]}],He=()=>[ed,ua,Es],Be=()=>["","none","full",c,qe,We],st=()=>["",gt,ua,Es],xt=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[gt,ed,bg,yg],Ie=()=>["","none",g,qe,We],Ye=()=>["none",gt,qe,We],Ae=()=>["none",gt,qe,We],mt=()=>[gt,qe,We],L=()=>[lo,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[or],breakpoint:[or],color:[eA],container:[or],"drop-shadow":[or],ease:["in","out","in-out"],font:[rA],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[or],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[or],shadow:[or],spacing:["px",gt],text:[or],"text-shadow":[or],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",lo,We,qe,m]}],container:["container"],columns:[{columns:[gt,We,qe,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{start:S()}],end:[{end:S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[Hr,"auto",qe,We]}],basis:[{basis:[lo,"full","auto",a,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gt,lo,"auto","initial","none",We]}],grow:[{grow:["",gt,qe,We]}],shrink:[{shrink:["",gt,qe,We]}],order:[{order:[Hr,"first","last","none",qe,We]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],w:[{w:[a,"screen",...k()]}],"min-w":[{"min-w":[a,"screen","none",...k()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...k()]}],h:[{h:["screen","lh",...k()]}],"min-h":[{"min-h":["screen","lh","none",...k()]}],"max-h":[{"max-h":["screen","lh",...k()]}],"font-size":[{text:["base",n,ua,Es]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,qe,td]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ed,We]}],"font-family":[{font:[aA,We,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,qe,We]}],"line-clamp":[{"line-clamp":[gt,"none",qe,td]}],leading:[{leading:[s,...D()]}],"list-image":[{"list-image":["none",qe,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",qe,We]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xt(),"wavy"]}],"text-decoration-thickness":[{decoration:[gt,"from-font","auto",qe,Es]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[gt,"auto",qe,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe,We]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hr,qe,We],radial:["",qe,We],conic:[Hr,qe,We]},cA,oA]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:He()}],"gradient-via-pos":[{via:He()}],"gradient-to-pos":[{to:He()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:Be()}],"rounded-s":[{"rounded-s":Be()}],"rounded-e":[{"rounded-e":Be()}],"rounded-t":[{"rounded-t":Be()}],"rounded-r":[{"rounded-r":Be()}],"rounded-b":[{"rounded-b":Be()}],"rounded-l":[{"rounded-l":Be()}],"rounded-ss":[{"rounded-ss":Be()}],"rounded-se":[{"rounded-se":Be()}],"rounded-ee":[{"rounded-ee":Be()}],"rounded-es":[{"rounded-es":Be()}],"rounded-tl":[{"rounded-tl":Be()}],"rounded-tr":[{"rounded-tr":Be()}],"rounded-br":[{"rounded-br":Be()}],"rounded-bl":[{"rounded-bl":Be()}],"border-w":[{border:st()}],"border-w-x":[{"border-x":st()}],"border-w-y":[{"border-y":st()}],"border-w-s":[{"border-s":st()}],"border-w-e":[{"border-e":st()}],"border-w-t":[{"border-t":st()}],"border-w-r":[{"border-r":st()}],"border-w-b":[{"border-b":st()}],"border-w-l":[{"border-l":st()}],"divide-x":[{"divide-x":st()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":st()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xt(),"hidden","none"]}],"divide-style":[{divide:[...xt(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...xt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gt,qe,We]}],"outline-w":[{outline:["",gt,ua,Es]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,Cl,Al]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,Cl,Al]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:st()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[gt,Es]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":st()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,Cl,Al]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[gt,qe,We]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[gt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[qe,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[gt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",qe,We]}],filter:[{filter:["","none",qe,We]}],blur:[{blur:Ie()}],brightness:[{brightness:[gt,qe,We]}],contrast:[{contrast:[gt,qe,We]}],"drop-shadow":[{"drop-shadow":["","none",h,Cl,Al]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",gt,qe,We]}],"hue-rotate":[{"hue-rotate":[gt,qe,We]}],invert:[{invert:["",gt,qe,We]}],saturate:[{saturate:[gt,qe,We]}],sepia:[{sepia:["",gt,qe,We]}],"backdrop-filter":[{"backdrop-filter":["","none",qe,We]}],"backdrop-blur":[{"backdrop-blur":Ie()}],"backdrop-brightness":[{"backdrop-brightness":[gt,qe,We]}],"backdrop-contrast":[{"backdrop-contrast":[gt,qe,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gt,qe,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gt,qe,We]}],"backdrop-invert":[{"backdrop-invert":["",gt,qe,We]}],"backdrop-opacity":[{"backdrop-opacity":[gt,qe,We]}],"backdrop-saturate":[{"backdrop-saturate":[gt,qe,We]}],"backdrop-sepia":[{"backdrop-sepia":["",gt,qe,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",qe,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gt,"initial",qe,We]}],ease:[{ease:["linear","initial",p,qe,We]}],delay:[{delay:[gt,qe,We]}],animate:[{animate:["none",_,qe,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,qe,We]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:Ye()}],"rotate-x":[{"rotate-x":Ye()}],"rotate-y":[{"rotate-y":Ye()}],"rotate-z":[{"rotate-z":Ye()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:mt()}],"skew-x":[{"skew-x":mt()}],"skew-y":[{"skew-y":mt()}],transform:[{transform:[qe,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:L()}],"translate-x":[{"translate-x":L()}],"translate-y":[{"translate-y":L()}],"translate-z":[{"translate-z":L()}],"translate-none":["translate-none"],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe,We]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe,We]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[gt,ua,Es,td]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hA=XT(fA);function tr(...t){return hA(cx(t))}const ln=Fe({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t;return(n,i)=>(ge(),ke(T(yn),{"data-slot":"button",as:t.as,"as-child":t.asChild,class:xn(T(tr)(T(pA)({variant:t.variant,size:t.size}),e.class))},{default:ne(()=>[ot(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),pA=iw("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function mA(){bi.isVisible=!0}function gA(){bi.isVisible=!1}function Wc(t){delete t.dispatch,t!=null&&(bi.data=t)}document.addEventListener("keydown",t=>{(t.key==="I"||t.key==="i")&&(bi.isVisible?gA():mA())});const vA=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const Sg=t=>t==="";const _A=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim();const Mg=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const xA=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase());const yA=t=>{const e=xA(t);return e.charAt(0).toUpperCase()+e.slice(1)};var da={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const bA=({name:t,iconNode:e,absoluteStrokeWidth:n,"absolute-stroke-width":i,strokeWidth:r,"stroke-width":s,size:o=da.width,color:a=da.stroke,...l},{slots:c})=>br("svg",{...da,...l,width:o,height:o,stroke:a,"stroke-width":Sg(n)||Sg(i)||n===!0||i===!0?Number(r||s||da["stroke-width"])*24/Number(o):r||s||da["stroke-width"],class:_A("lucide",l.class,...t?[`lucide-${Mg(yA(t))}-icon`,`lucide-${Mg(t)}`]:["lucide-icon"]),...!c.default&&!vA(l)&&{"aria-hidden":"true"}},[...e.map(u=>br(...u)),...c.default?[c.default()]:[]]);const bn=(t,e)=>(n,{slots:i,attrs:r})=>br(bA,{...r,...n,iconNode:e,name:t},i);const fy=bn("arrow-big-left-dash",[["path",{d:"M13 9a1 1 0 0 1-1-1V5.061a1 1 0 0 0-1.811-.75l-6.835 6.836a1.207 1.207 0 0 0 0 1.707l6.835 6.835a1 1 0 0 0 1.811-.75V16a1 1 0 0 1 1-1h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1z",key:"p8w4w5"}],["path",{d:"M20 9v6",key:"14roy0"}]]);const hy=bn("arrow-big-right-dash",[["path",{d:"M11 9a1 1 0 0 0 1-1V5.061a1 1 0 0 1 1.811-.75l6.836 6.836a1.207 1.207 0 0 1 0 1.707l-6.836 6.835a1 1 0 0 1-1.811-.75V16a1 1 0 0 0-1-1H9a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z",key:"67vhrh"}],["path",{d:"M4 9v6",key:"bns7oa"}]]);const SA=bn("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);const MA=bn("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const wA=bn("cuboid",[["path",{d:"m21.12 6.4-6.05-4.06a2 2 0 0 0-2.17-.05L2.95 8.41a2 2 0 0 0-.95 1.7v5.82a2 2 0 0 0 .88 1.66l6.05 4.07a2 2 0 0 0 2.17.05l9.95-6.12a2 2 0 0 0 .95-1.7V8.06a2 2 0 0 0-.88-1.66Z",key:"1u2ovd"}],["path",{d:"M10 22v-8L2.25 9.15",key:"11pn4q"}],["path",{d:"m10 14 11.77-6.87",key:"1kt1wh"}]]);const EA=bn("image-down",[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19 3 3v-5.5",key:"9ldu5r"}],["path",{d:"m17 22 3-3",key:"1nkfve"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);const TA=bn("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const AA=bn("move-3d",[["path",{d:"M5 3v16h16",key:"1mqmf9"}],["path",{d:"m5 19 6-6",key:"jh6hbb"}],["path",{d:"m2 6 3-3 3 3",key:"tkyvxa"}],["path",{d:"m18 16 3 3-3 3",key:"1d4glt"}]]);const py=bn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const CA=bn("pointer-off",[["path",{d:"M10 4.5V4a2 2 0 0 0-2.41-1.957",key:"jsi14n"}],["path",{d:"M13.9 8.4a2 2 0 0 0-1.26-1.295",key:"hirc7f"}],["path",{d:"M21.7 16.2A8 8 0 0 0 22 14v-3a2 2 0 1 0-4 0v-1a2 2 0 0 0-3.63-1.158",key:"1jxb2e"}],["path",{d:"m7 15-1.8-1.8a2 2 0 0 0-2.79 2.86L6 19.7a7.74 7.74 0 0 0 6 2.3h2a8 8 0 0 0 5.657-2.343",key:"10r7hm"}],["path",{d:"M6 6v8",key:"tv5xkp"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const PA=bn("pointer",[["path",{d:"M22 14a8 8 0 0 1-8 8",key:"56vcr3"}],["path",{d:"M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1agjmk"}],["path",{d:"M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1",key:"wdbh2u"}],["path",{d:"M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10",key:"1ibuk9"}],["path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"g6ys72"}]]);const RA=bn("rectangle-horizontal",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]);const DA=bn("rectangle-vertical",[["rect",{width:"12",height:"20",x:"6",y:"2",rx:"2",key:"1oxtiu"}]]);const IA=bn("rotate-3d",[["path",{d:"M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2",key:"10n0gc"}],["path",{d:"m15.194 13.707 3.814 1.86-1.86 3.814",key:"16shm9"}],["path",{d:"M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4",key:"1lxi77"}]]);const NA=bn("scale-3d",[["path",{d:"M5 7v11a1 1 0 0 0 1 1h11",key:"13dt1j"}],["path",{d:"M5.293 18.707 11 13",key:"ezgbsx"}],["circle",{cx:"19",cy:"19",r:"2",key:"17f5cg"}],["circle",{cx:"5",cy:"5",r:"2",key:"1gwv83"}]]);const LA=bn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const OA=bn("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),eo=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},FA={class:"right-bar"},UA={id:"data-container"},kA={class:"metadata item"},BA={__name:"ObjectInfo",setup(t){bi.data&&Object.fromEntries(Object.entries(bi.data).filter(([n])=>n!=="dispatch"));const e=()=>{bi.isVisible=!bi.isVisible};return(n,i)=>(ge(),kt("div",FA,[et("div",{class:xn(["theme object-info",{"is-hidden":!T(bi).isVisible}]),id:"info-panel"},[et("div",UA,[et("div",kA,[i[2]||(i[2]=et("h1",{class:"text-lg font-bold section-title"},"METADATA",-1)),(ge(!0),kt(rn,null,rl(T(bi).data,(r,s)=>(ge(),kt("div",{key:s,class:"data-entry"},[et("p",null,[et("strong",null,cs(s)+":",1),Gt(" "+cs(r.value),1)])]))),128))])]),re(T(ln),{variant:"secondary",size:"icon",id:"closeObjectBar",onClick:i[0]||(i[0]=r=>e())},{default:ne(()=>[re(T(hy))]),_:1})],2),re(T(ln),{variant:"secondary",size:"icon",id:"openObjectBar",class:xn({"is-hidden":!T(bi).isVisible}),onClick:i[1]||(i[1]=r=>e())},{default:ne(()=>[re(T(fy))]),_:1},8,["class"])]))}},zA=eo(BA,[["__scopeId","data-v-97adc036"]]);const jh="182",Xs={ROTATE:0,DOLLY:1,PAN:2},Po={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},VA=0,wg=1,HA=2,xc=1,my=2,Sa=3,hs=0,In=1,Bn=2,Mr=0,Bo=1,Eg=2,Tg=3,Ag=4,GA=5,Us=100,WA=101,qA=102,XA=103,$A=104,YA=200,JA=201,KA=202,ZA=203,_f=204,xf=205,jA=206,QA=207,eC=208,tC=209,nC=210,iC=211,rC=212,sC=213,oC=214,yf=0,bf=1,Sf=2,Xo=3,Mf=4,wf=5,Ef=6,Tf=7,gy=0,aC=1,lC=2,Yi=0,vy=1,_y=2,xy=3,Qh=4,yy=5,by=6,Sy=7,My=300,Ks=301,$o=302,Af=303,Cf=304,Tu=306,Pf=1e3,xr=1001,Rf=1002,vn=1003,cC=1004,Pl=1005,Pn=1006,nd=1007,Bs=1008,Qn=1009,wy=1010,Ey=1011,$a=1012,ep=1013,ji=1014,Wi=1015,Nr=1016,tp=1017,np=1018,Ya=1020,Ty=35902,Ay=35899,Cy=1021,Py=1022,Si=1023,Lr=1026,zs=1027,Ry=1028,ip=1029,Yo=1030,rp=1031,sp=1033,yc=33776,bc=33777,Sc=33778,Mc=33779,Df=35840,If=35841,Nf=35842,Lf=35843,Of=36196,Ff=37492,Uf=37496,kf=37488,Bf=37489,zf=37490,Vf=37491,Hf=37808,Gf=37809,Wf=37810,qf=37811,Xf=37812,$f=37813,Yf=37814,Jf=37815,Kf=37816,Zf=37817,jf=37818,Qf=37819,eh=37820,th=37821,nh=36492,ih=36494,rh=36495,sh=36283,oh=36284,ah=36285,lh=36286,uC=3200,Dy=0,dC=1,es="",Zn="srgb",Jo="srgb-linear",qc="linear",Pt="srgb",co=7680,Cg=519,fC=512,hC=513,pC=514,op=515,mC=516,gC=517,ap=518,vC=519,Pg=35044,Rg="300 es",qi=2e3,Xc=2001;function Iy(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function $c(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function _C(){const t=$c("canvas");return t.style.display="block",t}const Dg={};function Ig(...t){const e="THREE."+t.shift();console.log(e,...t)}function tt(...t){const e="THREE."+t.shift();console.warn(e,...t)}function bt(...t){const e="THREE."+t.shift();console.error(e,...t)}function Ja(...t){const e=t.join(" ");e in Dg||(Dg[e]=!0,tt(...t))}function xC(t,e,n){return new Promise(function(i,r){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}class to{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+Sn[t>>16&255]+Sn[t>>24&255]+"-"+Sn[e&255]+Sn[e>>8&255]+"-"+Sn[e>>16&15|64]+Sn[e>>24&255]+"-"+Sn[n&63|128]+Sn[n>>8&255]+"-"+Sn[n>>16&255]+Sn[n>>24&255]+Sn[i&255]+Sn[i>>8&255]+Sn[i>>16&255]+Sn[i>>24&255]).toLowerCase()}function ht(t,e,n){return Math.max(e,Math.min(n,t))}function lp(t,e){return(t%e+e)%e}function yC(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)}function bC(t,e,n){return t!==e?(n-t)/(e-t):0}function Ua(t,e,n){return(1-n)*t+n*e}function SC(t,e,n,i){return Ua(t,e,1-Math.exp(-n*i))}function MC(t,e=1){return e-Math.abs(lp(t,e*2)-e)}function wC(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function EC(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function TC(t,e){return t+Math.floor(Math.random()*(e-t+1))}function AC(t,e){return t+Math.random()*(e-t)}function CC(t){return t*(.5-Math.random())}function PC(t){t!==void 0&&(Ng=t);let e=Ng+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function RC(t){return t*zo}function DC(t){return t*Ko}function IC(t){return(t&t-1)===0&&t!==0}function NC(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function LC(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function OC(t,e,n,i,r){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((e+i)/2),u=o((e+i)/2),d=s((e-i)/2),f=o((e-i)/2),h=s((i-e)/2),g=o((i-e)/2);switch(r){case"XYX":t.set(a*u,l*d,l*f,a*c);break;case"YZY":t.set(l*f,a*u,l*d,a*c);break;case"ZXZ":t.set(l*d,l*f,a*u,a*c);break;case"XZX":t.set(a*u,l*g,l*h,a*c);break;case"YXY":t.set(l*h,a*u,l*g,a*c);break;case"ZYZ":t.set(l*g,l*h,a*u,a*c);break;default:tt("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function To(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Fn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const Yc={DEG2RAD:zo,RAD2DEG:Ko,generateUUID:no,clamp:ht,euclideanModulo:lp,mapLinear:yC,inverseLerp:bC,lerp:Ua,damp:SC,pingpong:MC,smoothstep:wC,smootherstep:EC,randInt:TC,randFloat:AC,randFloatSpread:CC,seededRandom:PC,degToRad:RC,radToDeg:DC,isPowerOfTwo:IC,ceilPowerOfTwo:NC,floorPowerOfTwo:LC,setQuaternionFromProperEuler:OC,normalize:Fn,denormalize:To};class xe{constructor(e=0,n=0){xe.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=ht(this.x,e.x,n.x),this.y=ht(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=ht(this.x,e,n),this.y=ht(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ht(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}let pn=class{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],d=i[r+3],f=s[o+0],h=s[o+1],g=s[o+2],v=s[o+3];if(a<=0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d;return}if(a>=1){e[n+0]=f,e[n+1]=h,e[n+2]=g,e[n+3]=v;return}if(d!==v||l!==f||c!==h||u!==g){let m=l*f+c*h+u*g+d*v;m<0&&(f=-f,h=-h,g=-g,v=-v,m=-m);let p=1-a;if(m<.9995){const _=Math.acos(m),x=Math.sin(_);p=Math.sin(p*_)/x,a=Math.sin(a*_)/x,l=l*p+f*a,c=c*p+h*a,u=u*p+g*a,d=d*p+v*a}else{l=l*p+f*a,c=c*p+h*a,u=u*p+g*a,d=d*p+v*a;const _=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=_,c*=_,u*=_,d*=_}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],d=s[o],f=s[o+1],h=s[o+2],g=s[o+3];return e[n]=a*g+u*d+l*h-c*f,e[n+1]=l*g+u*f+c*d-a*h,e[n+2]=c*g+u*h+a*f-l*d,e[n+3]=u*g-a*d-l*f-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),d=a(s/2),f=l(i/2),h=l(r/2),g=l(s/2);switch(o){case"XYZ":this._x=f*u*d+c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d-f*h*g;break;case"YXZ":this._x=f*u*d+c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d+f*h*g;break;case"ZXY":this._x=f*u*d-c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d-f*h*g;break;case"ZYX":this._x=f*u*d-c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d+f*h*g;break;case"YZX":this._x=f*u*d+c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d-f*h*g;break;case"XZY":this._x=f*u*d-c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d+f*h*g;break;default:tt("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],r=n[4],s=n[8],o=n[1],a=n[5],l=n[9],c=n[2],u=n[6],d=n[10],f=i+a+d;if(f>0){const h=.5/Math.sqrt(f+1);this._w=.25/h,this._x=(u-l)*h,this._y=(s-c)*h,this._z=(o-r)*h}else if(i>a&&i>d){const h=2*Math.sqrt(1+i-a-d);this._w=(u-l)/h,this._x=.25*h,this._y=(r+o)/h,this._z=(s+c)/h}else if(a>d){const h=2*Math.sqrt(1+a-i-d);this._w=(s-c)/h,this._x=(r+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+d-i-a);this._w=(o-r)/h,this._x=(s+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ht(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,r=e._y,s=e._z,o=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,n){if(n<=0)return this;if(n>=1)return this.copy(e);let i=e._x,r=e._y,s=e._z,o=e._w,a=this.dot(e);a<0&&(i=-i,r=-r,s=-s,o=-o,a=-a);let l=1-n;if(a<.9995){const c=Math.acos(a),u=Math.sin(c);l=Math.sin(l*c)/u,n=Math.sin(n*c)/u,this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this._onChangeCallback()}else this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this.normalize();return this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};class I{constructor(e=0,n=0,i=0){I.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(Lg.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(Lg.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6]*r,this.y=s[1]*n+s[4]*i+s[7]*r,this.z=s[2]*n+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*n+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*n+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*n+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const n=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*n-s*r),d=2*(s*i-o*n);return this.x=n+l*c+o*d-a*u,this.y=i+l*u+a*c-s*d,this.z=r+l*d+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r,this.y=s[1]*n+s[5]*i+s[9]*r,this.z=s[2]*n+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=ht(this.x,e.x,n.x),this.y=ht(this.y,e.y,n.y),this.z=ht(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=ht(this.x,e,n),this.y=ht(this.y,e,n),this.z=ht(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,s=e.z,o=n.x,a=n.y,l=n.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return id.copy(this).projectOnVector(e),this.sub(id)}reflect(e){return this.sub(id.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(ht(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const id=new I,Lg=new pn;class ft{constructor(e,n,i,r,s,o,a,l,c){ft.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,a,l,c)}set(e,n,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=n,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],d=i[7],f=i[2],h=i[5],g=i[8],v=r[0],m=r[3],p=r[6],_=r[1],x=r[4],y=r[7],w=r[2],A=r[5],P=r[8];return s[0]=o*v+a*_+l*w,s[3]=o*m+a*x+l*A,s[6]=o*p+a*y+l*P,s[1]=c*v+u*_+d*w,s[4]=c*m+u*x+d*A,s[7]=c*p+u*y+d*P,s[2]=f*v+h*_+g*w,s[5]=f*m+h*x+g*A,s[8]=f*p+h*y+g*P,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*o*u-n*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*o-a*c,f=a*l-u*s,h=c*s-o*l,g=n*d+i*f+r*h;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return e[0]=d*v,e[1]=(r*c-u*i)*v,e[2]=(a*i-r*o)*v,e[3]=f*v,e[4]=(u*n-r*l)*v,e[5]=(r*s-a*n)*v,e[6]=h*v,e[7]=(i*l-c*n)*v,e[8]=(o*n-i*s)*v,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(rd.makeScale(e,n)),this}rotate(e){return this.premultiply(rd.makeRotation(-e)),this}translate(e,n){return this.premultiply(rd.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const rd=new ft,Og=new ft().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Fg=new ft().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function FC(){const t={enabled:!0,workingColorSpace:Jo,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===Pt&&(r.r=wr(r.r),r.g=wr(r.g),r.b=wr(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===Pt&&(r.r=Vo(r.r),r.g=Vo(r.g),r.b=Vo(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===es?qc:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return Ja("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return Ja("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[Jo]:{primaries:e,whitePoint:i,transfer:qc,toXYZ:Og,fromXYZ:Fg,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Zn},outputColorSpaceConfig:{drawingBufferColorSpace:Zn}},[Zn]:{primaries:e,whitePoint:i,transfer:Pt,toXYZ:Og,fromXYZ:Fg,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Zn}}}),t}const St=FC();function wr(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Vo(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let uo;class UC{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{uo===void 0&&(uo=$c("canvas")),uo.width=e.width,uo.height=e.height;const r=uo.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=uo}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=$c("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o1),this.pmremVersion=0}get width(){return this.source.getSize(od).x}get height(){return this.source.getSize(od).y}get depth(){return this.source.getSize(od).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){tt(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){tt(`Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==My)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Pf:e.x=e.x-Math.floor(e.x);break;case xr:e.x=e.x<0?0:1;break;case Rf:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Pf:e.y=e.y-Math.floor(e.y);break;case xr:e.y=e.y<0?0:1;break;case Rf:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}zn.DEFAULT_IMAGE=null;zn.DEFAULT_MAPPING=My;zn.DEFAULT_ANISOTROPY=1;class Zt{constructor(e=0,n=0,i=0,r=1){Zt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*n+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*n+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*n+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*n+o[7]*i+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,s;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],h=l[5],g=l[9],v=l[2],m=l[6],p=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-v)<.01&&Math.abs(g-m)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+v)<.1&&Math.abs(g+m)<.1&&Math.abs(c+h+p-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(c+1)/2,y=(h+1)/2,w=(p+1)/2,A=(u+f)/4,P=(d+v)/4,D=(g+m)/4;return x>y&&x>w?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=A/i,s=P/i):y>w?y<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(y),i=A/r,s=D/r):w<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(w),i=P/s,r=D/s),this.set(i,r,s,n),this}let _=Math.sqrt((m-g)*(m-g)+(d-v)*(d-v)+(f-u)*(f-u));return Math.abs(_)<.001&&(_=1),this.x=(m-g)/_,this.y=(d-v)/_,this.z=(f-u)/_,this.w=Math.acos((c+h+p-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=ht(this.x,e.x,n.x),this.y=ht(this.y,e.y,n.y),this.z=ht(this.z,e.z,n.z),this.w=ht(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=ht(this.x,e,n),this.y=ht(this.y,e,n),this.z=ht(this.z,e,n),this.w=ht(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(ht(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class zC extends to{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Pn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new Zt(0,0,e,n),this.scissorTest=!1,this.viewport=new Zt(0,0,e,n);const r={width:e,height:n,depth:i.depth},s=new zn(r);this.textures=[];const o=i.count;for(let a=0;a1);this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,_i),_i.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fa),Dl.subVectors(this.max,fa),fo.subVectors(e.a,fa),ho.subVectors(e.b,fa),po.subVectors(e.c,fa),Gr.subVectors(ho,fo),Wr.subVectors(po,ho),Ts.subVectors(fo,po);let n=[0,-Gr.z,Gr.y,0,-Wr.z,Wr.y,0,-Ts.z,Ts.y,Gr.z,0,-Gr.x,Wr.z,0,-Wr.x,Ts.z,0,-Ts.x,-Gr.y,Gr.x,0,-Wr.y,Wr.x,0,-Ts.y,Ts.x,0];return!ad(n,fo,ho,po,Dl)||(n=[1,0,0,0,1,0,0,0,1],!ad(n,fo,ho,po,Dl))?!1:(Il.crossVectors(Gr,Wr),n=[Il.x,Il.y,Il.z],ad(n,fo,ho,po,Dl))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,_i).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(_i).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ar[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ar[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ar[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ar[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ar[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ar[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ar[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ar[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ar),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const ar=[new I,new I,new I,new I,new I,new I,new I,new I],_i=new I,Rl=new ul,fo=new I,ho=new I,po=new I,Gr=new I,Wr=new I,Ts=new I,fa=new I,Dl=new I,Il=new I,As=new I;function ad(t,e,n,i,r){for(let s=0,o=t.length-3;s<=o;s+=3){As.fromArray(t,s);const a=r.x*Math.abs(As.x)+r.y*Math.abs(As.y)+r.z*Math.abs(As.z),l=e.dot(As),c=n.dot(As),u=i.dot(As);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const HC=new ul,ha=new I,ld=new I;let dl=class{constructor(e=new I,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):HC.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ha.subVectors(e,this.center);const n=ha.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(ha,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(ld.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ha.copy(e.center).add(ld)),this.expandByPoint(ha.copy(e.center).sub(ld))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}};const lr=new I,cd=new I,Nl=new I,qr=new I,ud=new I,Ll=new I,dd=new I;class fl{constructor(e=new I,n=new I(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,lr)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=lr.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(lr.copy(this.origin).addScaledVector(this.direction,n),lr.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){cd.copy(e).add(n).multiplyScalar(.5),Nl.copy(n).sub(e).normalize(),qr.copy(this.origin).sub(cd);const s=e.distanceTo(n)*.5,o=-this.direction.dot(Nl),a=qr.dot(this.direction),l=-qr.dot(Nl),c=qr.lengthSq(),u=Math.abs(1-o*o);let d,f,h,g;if(u>0)if(d=o*l-a,f=o*a-l,g=s*u,d>=0)if(f>=-g)if(f<=g){const v=1/u;d*=v,f*=v,h=d*(d+o*f+2*a)+f*(o*d+f+2*l)+c}else f=s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f=-s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f<=-g?(d=Math.max(0,-(-o*s+a)),f=d>0?-s:Math.min(Math.max(-s,-l),s),h=-d*d+f*(f+2*l)+c):f<=g?(d=0,f=Math.min(Math.max(-s,-l),s),h=f*(f+2*l)+c):(d=Math.max(0,-(o*s+a)),f=d>0?s:Math.min(Math.max(-s,-l),s),h=-d*d+f*(f+2*l)+c);else f=o>0?-s:s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(cd).addScaledVector(Nl,f),h}intersectSphere(e,n){lr.subVectors(e.center,this.origin);const i=lr.dot(this.direction),r=lr.dot(lr)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(i=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(i=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,o=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,o=(e.min.y-f.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,lr)!==null}intersectTriangle(e,n,i,r,s){ud.subVectors(n,e),Ll.subVectors(i,e),dd.crossVectors(ud,Ll);let o=this.direction.dot(dd),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;qr.subVectors(this.origin,e);const l=a*this.direction.dot(Ll.crossVectors(qr,Ll));if(l<0)return null;const c=a*this.direction.dot(ud.cross(qr));if(c<0||l+c>o)return null;const u=-a*qr.dot(dd);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class yt{constructor(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m){yt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m)}set(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m){const p=this.elements;return p[0]=e,p[4]=n,p[8]=i,p[12]=r,p[1]=s,p[5]=o,p[9]=a,p[13]=l,p[2]=c,p[6]=u,p[10]=d,p[14]=f,p[3]=h,p[7]=g,p[11]=v,p[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new yt().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,i=e.elements,r=1/mo.setFromMatrixColumn(e,0).length(),s=1/mo.setFromMatrixColumn(e,1).length(),o=1/mo.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const f=o*u,h=o*d,g=a*u,v=a*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=h+g*c,n[5]=f-v*c,n[9]=-a*l,n[2]=v-f*c,n[6]=g+h*c,n[10]=o*l}else if(e.order==="YXZ"){const f=l*u,h=l*d,g=c*u,v=c*d;n[0]=f+v*a,n[4]=g*a-h,n[8]=o*c,n[1]=o*d,n[5]=o*u,n[9]=-a,n[2]=h*a-g,n[6]=v+f*a,n[10]=o*l}else if(e.order==="ZXY"){const f=l*u,h=l*d,g=c*u,v=c*d;n[0]=f-v*a,n[4]=-o*d,n[8]=g+h*a,n[1]=h+g*a,n[5]=o*u,n[9]=v-f*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const f=o*u,h=o*d,g=a*u,v=a*d;n[0]=l*u,n[4]=g*c-h,n[8]=f*c+v,n[1]=l*d,n[5]=v*c+f,n[9]=h*c-g,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const f=o*l,h=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=v-f*d,n[8]=g*d+h,n[1]=d,n[5]=o*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*d+g,n[10]=f-v*d}else if(e.order==="XZY"){const f=o*l,h=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+v,n[5]=o*u,n[9]=h*d-g,n[2]=g*d-h,n[6]=a*u,n[10]=v*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(GC,e,WC)}lookAt(e,n,i){const r=this.elements;return Jn.subVectors(e,n),Jn.lengthSq()===0&&(Jn.z=1),Jn.normalize(),Xr.crossVectors(i,Jn),Xr.lengthSq()===0&&(Math.abs(i.z)===1?Jn.x+=1e-4:Jn.z+=1e-4,Jn.normalize(),Xr.crossVectors(i,Jn)),Xr.normalize(),Ol.crossVectors(Jn,Xr),r[0]=Xr.x,r[4]=Ol.x,r[8]=Jn.x,r[1]=Xr.y,r[5]=Ol.y,r[9]=Jn.y,r[2]=Xr.z,r[6]=Ol.z,r[10]=Jn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],d=i[5],f=i[9],h=i[13],g=i[2],v=i[6],m=i[10],p=i[14],_=i[3],x=i[7],y=i[11],w=i[15],A=r[0],P=r[4],D=r[8],S=r[12],M=r[1],N=r[5],B=r[9],q=r[13],K=r[2],$=r[6],W=r[10],k=r[14],z=r[3],de=r[7],le=r[11],pe=r[15];return s[0]=o*A+a*M+l*K+c*z,s[4]=o*P+a*N+l*$+c*de,s[8]=o*D+a*B+l*W+c*le,s[12]=o*S+a*q+l*k+c*pe,s[1]=u*A+d*M+f*K+h*z,s[5]=u*P+d*N+f*$+h*de,s[9]=u*D+d*B+f*W+h*le,s[13]=u*S+d*q+f*k+h*pe,s[2]=g*A+v*M+m*K+p*z,s[6]=g*P+v*N+m*$+p*de,s[10]=g*D+v*B+m*W+p*le,s[14]=g*S+v*q+m*k+p*pe,s[3]=_*A+x*M+y*K+w*z,s[7]=_*P+x*N+y*$+w*de,s[11]=_*D+x*B+y*W+w*le,s[15]=_*S+x*q+y*k+w*pe,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],h=e[14],g=e[3],v=e[7],m=e[11],p=e[15],_=l*h-c*f,x=a*h-c*d,y=a*f-l*d,w=o*h-c*u,A=o*f-l*u,P=o*d-a*u;return n*(v*_-m*x+p*y)-i*(g*_-m*w+p*A)+r*(g*x-v*w+p*P)-s*(g*y-v*A+m*P)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],h=e[11],g=e[12],v=e[13],m=e[14],p=e[15],_=d*m*c-v*f*c+v*l*h-a*m*h-d*l*p+a*f*p,x=g*f*c-u*m*c-g*l*h+o*m*h+u*l*p-o*f*p,y=u*v*c-g*d*c+g*a*h-o*v*h-u*a*p+o*d*p,w=g*d*l-u*v*l-g*a*f+o*v*f+u*a*m-o*d*m,A=n*_+i*x+r*y+s*w;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/A;return e[0]=_*P,e[1]=(v*f*s-d*m*s-v*r*h+i*m*h+d*r*p-i*f*p)*P,e[2]=(a*m*s-v*l*s+v*r*c-i*m*c-a*r*p+i*l*p)*P,e[3]=(d*l*s-a*f*s-d*r*c+i*f*c+a*r*h-i*l*h)*P,e[4]=x*P,e[5]=(u*m*s-g*f*s+g*r*h-n*m*h-u*r*p+n*f*p)*P,e[6]=(g*l*s-o*m*s-g*r*c+n*m*c+o*r*p-n*l*p)*P,e[7]=(o*f*s-u*l*s+u*r*c-n*f*c-o*r*h+n*l*h)*P,e[8]=y*P,e[9]=(g*d*s-u*v*s-g*i*h+n*v*h+u*i*p-n*d*p)*P,e[10]=(o*v*s-g*a*s+g*i*c-n*v*c-o*i*p+n*a*p)*P,e[11]=(u*a*s-o*d*s-u*i*c+n*d*c+o*i*h-n*a*h)*P,e[12]=w*P,e[13]=(u*v*r-g*d*r+g*i*f-n*v*f-u*i*m+n*d*m)*P,e[14]=(g*a*r-o*v*r-g*i*l+n*v*l+o*i*m-n*a*m)*P,e[15]=(o*d*r-u*a*r+u*i*l-n*d*l-o*i*f+n*a*f)*P,this}scale(e){const n=this.elements,i=e.x,r=e.y,s=e.z;return n[0]*=i,n[4]*=r,n[8]*=s,n[1]*=i,n[5]*=r,n[9]*=s,n[2]*=i,n[6]*=r,n[10]*=s,n[3]*=i,n[7]*=r,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,s=n._x,o=n._y,a=n._z,l=n._w,c=s+s,u=o+o,d=a+a,f=s*c,h=s*u,g=s*d,v=o*u,m=o*d,p=a*d,_=l*c,x=l*u,y=l*d,w=i.x,A=i.y,P=i.z;return r[0]=(1-(v+p))*w,r[1]=(h+y)*w,r[2]=(g-x)*w,r[3]=0,r[4]=(h-y)*A,r[5]=(1-(f+p))*A,r[6]=(m+_)*A,r[7]=0,r[8]=(g+x)*P,r[9]=(m-_)*P,r[10]=(1-(f+v))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return i.set(1,1,1),n.identity(),this;let s=mo.set(r[0],r[1],r[2]).length();const o=mo.set(r[4],r[5],r[6]).length(),a=mo.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),xi.copy(this);const c=1/s,u=1/o,d=1/a;return xi.elements[0]*=c,xi.elements[1]*=c,xi.elements[2]*=c,xi.elements[4]*=u,xi.elements[5]*=u,xi.elements[6]*=u,xi.elements[8]*=d,xi.elements[9]*=d,xi.elements[10]*=d,n.setFromRotationMatrix(xi),i.x=s,i.y=o,i.z=a,this}makePerspective(e,n,i,r,s,o,a=qi,l=!1){const c=this.elements,u=2*s/(n-e),d=2*s/(i-r),f=(n+e)/(n-e),h=(i+r)/(i-r);let g,v;if(l)g=s/(o-s),v=o*s/(o-s);else if(a===qi)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Xc)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=d,c[9]=h,c[13]=0,c[2]=0,c[6]=0,c[10]=g,c[14]=v,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,n,i,r,s,o,a=qi,l=!1){const c=this.elements,u=2/(n-e),d=2/(i-r),f=-(n+e)/(n-e),h=-(i+r)/(i-r);let g,v;if(l)g=1/(o-s),v=o/(o-s);else if(a===qi)g=-2/(o-s),v=-(o+s)/(o-s);else if(a===Xc)g=-1/(o-s),v=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=d,c[9]=0,c[13]=h,c[2]=0,c[6]=0,c[10]=g,c[14]=v,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const mo=new I,xi=new yt,GC=new I(0,0,0),WC=new I(1,1,1),Xr=new I,Ol=new I,Jn=new I,Ug=new yt,kg=new pn;class Ci{constructor(e=0,n=0,i=0,r=Ci.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],d=r[2],f=r[6],h=r[10];switch(n){case"XYZ":this._y=Math.asin(ht(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-ht(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(ht(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-ht(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,h),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(ht(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-ht(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,h),this._y=0);break;default:tt("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return Ug.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Ug,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return kg.setFromEuler(this),this.setFromQuaternion(kg,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ci.DEFAULT_ORDER="XYZ";class up{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(a=>({...a})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),d.length>0&&(i.shapes=d),f.length>0&&(i.skeletons=f),h.length>0&&(i.animations=h),g.length>0&&(i.nodes=g)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,n,i,r,s){yi.subVectors(r,n),ur.subVectors(i,n),hd.subVectors(e,n);const o=yi.dot(yi),a=yi.dot(ur),l=yi.dot(hd),c=ur.dot(ur),u=ur.dot(hd),d=o*c-a*a;if(d===0)return s.set(0,0,0),null;const f=1/d,h=(c*l-a*u)*f,g=(o*u-a*l)*f;return s.set(1-h-g,g,h)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,dr)===null?!1:dr.x>=0&&dr.y>=0&&dr.x+dr.y<=1}static getInterpolation(e,n,i,r,s,o,a,l){return this.getBarycoord(e,n,i,r,dr)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,dr.x),l.addScaledVector(o,dr.y),l.addScaledVector(a,dr.z),l)}static getInterpolatedAttribute(e,n,i,r,s,o){return vd.setScalar(0),_d.setScalar(0),xd.setScalar(0),vd.fromBufferAttribute(e,n),_d.fromBufferAttribute(e,i),xd.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(vd,s.x),o.addScaledVector(_d,s.y),o.addScaledVector(xd,s.z),o}static isFrontFacing(e,n,i,r){return yi.subVectors(i,n),ur.subVectors(e,n),yi.cross(ur).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return yi.subVectors(this.c,this.b),ur.subVectors(this.a,this.b),yi.cross(ur).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ci.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return ci.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return ci.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return ci.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ci.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,s=this.c;let o,a;_o.subVectors(r,i),xo.subVectors(s,i),pd.subVectors(e,i);const l=_o.dot(pd),c=xo.dot(pd);if(l<=0&&c<=0)return n.copy(i);md.subVectors(e,r);const u=_o.dot(md),d=xo.dot(md);if(u>=0&&d<=u)return n.copy(r);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),n.copy(i).addScaledVector(_o,o);gd.subVectors(e,s);const h=_o.dot(gd),g=xo.dot(gd);if(g>=0&&h<=g)return n.copy(s);const v=h*c-l*g;if(v<=0&&c>=0&&g<=0)return a=c/(c-g),n.copy(i).addScaledVector(xo,a);const m=u*g-h*d;if(m<=0&&d-u>=0&&h-g>=0)return Wg.subVectors(s,r),a=(d-u)/(d-u+(h-g)),n.copy(r).addScaledVector(Wg,a);const p=1/(m+v+f);return o=v*p,a=f*p,n.copy(i).addScaledVector(_o,o).addScaledVector(xo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Ly={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},$r={h:0,s:0,l:0},Ul={h:0,s:0,l:0};function yd(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class rt{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Zn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,St.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=St.workingColorSpace){return this.r=e,this.g=n,this.b=i,St.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=St.workingColorSpace){if(e=lp(e,1),n=ht(n,0,1),i=ht(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,o=2*i-s;this.r=yd(o,s,e+1/3),this.g=yd(o,s,e),this.b=yd(o,s,e-1/3)}return St.colorSpaceToWorking(this,r),this}setStyle(e,n=Zn){function i(s){s!==void 0&&parseFloat(s)<1&&tt("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:tt("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(s,16),n);tt("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Zn){const i=Ly[e.toLowerCase()];return i!==void 0?this.setHex(i,n):tt("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=wr(e.r),this.g=wr(e.g),this.b=wr(e.b),this}copyLinearToSRGB(e){return this.r=Vo(e.r),this.g=Vo(e.g),this.b=Vo(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Zn){return St.workingToColorSpace(Mn.copy(this),e),Math.round(ht(Mn.r*255,0,255))*65536+Math.round(ht(Mn.g*255,0,255))*256+Math.round(ht(Mn.b*255,0,255))}getHexString(e=Zn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=St.workingColorSpace){St.workingToColorSpace(Mn.copy(this),n);const i=Mn.r,r=Mn.g,s=Mn.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const d=o-a;switch(c=u<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){tt(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){tt(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Bo&&(i.blending=this.blending),this.side!==hs&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==_f&&(i.blendSrc=this.blendSrc),this.blendDst!==xf&&(i.blendDst=this.blendDst),this.blendEquation!==Us&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Xo&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Cg&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==co&&(i.stencilFail=this.stencilFail),this.stencilZFail!==co&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==co&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(n){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class vs extends io{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new rt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ci,this.combine=gy,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const nn=new I,kl=new xe;let KC=0;class Nn{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:KC++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=Pg,this.updateRanges=[],this.gpuType=Wi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;rn.count&&tt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ul);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){bt("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new I(-1/0,-1/0,-1/0),new I(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const s=e.morphAttributes;for(const c in s){const u=[],d=s[c];for(let f=0,h=d.length;f0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(qg.copy(s).invert(),Cs.copy(e.ray).applyMatrix4(qg),!(i.boundingBox!==null&&Cs.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Cs)))}_computeIntersections(e,n,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,d=s.attributes.normal,f=s.groups,h=s.drawRange;if(a!==null)if(Array.isArray(o))for(let g=0,v=f.length;gn.far?null:{distance:c,point:Wl.clone(),object:t}}function ql(t,e,n,i,r,s,o,a,l,c){t.getVertexPosition(a,zl),t.getVertexPosition(l,Vl),t.getVertexPosition(c,Hl);const u=jC(t,e,n,i,zl,Vl,Hl,$g);if(u){const d=new I;ci.getBarycoord($g,zl,Vl,Hl,d),r&&(u.uv=ci.getInterpolatedAttribute(r,a,l,c,d,new xe)),s&&(u.uv1=ci.getInterpolatedAttribute(s,a,l,c,d,new xe)),o&&(u.normal=ci.getInterpolatedAttribute(o,a,l,c,d,new I),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a,b:l,c,normal:new I,materialIndex:0};ci.getNormal(zl,Vl,Hl,f.normal),u.face=f,u.barycoord=d}return u}class Kt extends _t{constructor(e=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],d=[];let f=0,h=0;g("z","y","x",-1,-1,i,n,e,o,s,0),g("z","y","x",1,-1,i,n,-e,o,s,1),g("x","z","y",1,1,e,i,n,r,o,2),g("x","z","y",1,-1,e,i,-n,r,o,3),g("x","y","z",1,-1,e,n,i,r,s,4),g("x","y","z",-1,-1,e,n,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new ct(c,3)),this.setAttribute("normal",new ct(u,3)),this.setAttribute("uv",new ct(d,2));function g(v,m,p,_,x,y,w,A,P,D,S){const M=y/P,N=w/D,B=y/2,q=w/2,K=A/2,$=P+1,W=D+1;let k=0,z=0;const de=new I;for(let le=0;le0?1:-1,u.push(de.x,de.y,de.z),d.push(He/P),d.push(1-le/D),k+=1}}for(let le=0;ler.value||i.value||o.value?wr(e.default({present:o.value})[0],{ref:c=>{const u=_s(c);return typeof u?.hasAttribute>"u"||(u?.hasAttribute("data-reka-popper-content-wrapper")?s.value=u.firstElementChild:s.value=u),u}}):null}});const ff=Fe({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{if(!n.default)return null;const i=zh(n.default()),r=i.findIndex(l=>l.type!==er);if(r===-1)return i;const s=i[r];delete s.props?.ref;const o=s.props?Nt(e,s.props):e,a=Ks({...s,props:{}},o);return i.length===1?a:(i[r]=a,i)}}}),QM=["area","img","input"],Sn=Fe({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const i=t.asChild?"template":t.as;return typeof i=="string"&&QM.includes(i)?()=>wr(i,e):i!=="template"?()=>wr(t.as,e,{default:n.default}):()=>wr(ff,e,{default:n.default})}});function Zs(){const t=Ve(),e=Te(()=>["#text","#comment"].includes(t.value?.$el.nodeName)?t.value?.$el.nextElementSibling:_s(t));return{primitiveElement:t,currentElement:e}}const e1="dismissableLayer.pointerDownOutside",t1="dismissableLayer.focusOutside";function Mx(t,e){if(!(e instanceof Element))return!1;const n=e.closest("[data-dismissable-layer]"),i=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),r=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&(i===n||r.indexOf(i){});return pi(o=>{if(!Li||!In(n))return;const a=async c=>{const u=c.target;if(!(!e?.value||!u)){if(Mx(e.value,u)){r.value=!1;return}if(c.target&&!r.value){let h=function(){vx(e1,t,f)};var d=h;const f={originalEvent:c};c.pointerType==="touch"?(i.removeEventListener("click",s.value),s.value=h,i.addEventListener("click",s.value,{once:!0})):h()}else i.removeEventListener("click",s.value);r.value=!1}},l=window.setTimeout(()=>{i.addEventListener("pointerdown",a)},0);o(()=>{window.clearTimeout(l),i.removeEventListener("pointerdown",a),i.removeEventListener("click",s.value)})}),{onPointerDownCapture:()=>{In(n)&&(r.value=!0)}}}function i1(t,e,n=!0){const i=e?.value?.ownerDocument??globalThis?.document,r=Ve(!1);return pi(s=>{if(!Li||!In(n))return;const o=async a=>{if(!e?.value)return;await Ir(),await Ir();const l=a.target;!e.value||!l||Mx(e.value,l)||a.target&&!r.value&&vx(t1,t,{originalEvent:a})};i.addEventListener("focusin",o),s(()=>i.removeEventListener("focusin",o))}),{onFocusCapture:()=>{In(n)&&(r.value=!0)},onBlurCapture:()=>{In(n)&&(r.value=!1)}}}const ci=Yn({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var r1=Fe({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(t,{emit:e}){const n=t,i=e,{forwardRef:r,currentElement:s}=sn(),o=Te(()=>s.value?.ownerDocument??globalThis.document),a=Te(()=>ci.layersRoot),l=Te(()=>s.value?Array.from(a.value).indexOf(s.value):-1),c=Te(()=>ci.layersWithOutsidePointerEventsDisabled.size>0),u=Te(()=>{const h=Array.from(a.value),[g]=[...ci.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g);return l.value>=v}),d=n1(async h=>{const g=[...ci.branches].some(v=>v?.contains(h.target));!u.value||g||(i("pointerDownOutside",h),i("interactOutside",h),await Ir(),h.defaultPrevented||i("dismiss"))},s),f=i1(h=>{[...ci.branches].some(v=>v?.contains(h.target))||(i("focusOutside",h),i("interactOutside",h),h.defaultPrevented||i("dismiss"))},s);return CM("Escape",h=>{l.value===a.value.size-1&&(i("escapeKeyDown",h),h.defaultPrevented||i("dismiss"))}),pi(h=>{s.value&&(n.disableOutsidePointerEvents&&(ci.layersWithOutsidePointerEventsDisabled.size===0&&(ci.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents="none"),ci.layersWithOutsidePointerEventsDisabled.add(s.value)),a.value.add(s.value),h(()=>{n.disableOutsidePointerEvents&&ci.layersWithOutsidePointerEventsDisabled.size===1&&!Sc(ci.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=ci.originalBodyPointerEvents)}))}),pi(h=>{h(()=>{s.value&&(a.value.delete(s.value),ci.layersWithOutsidePointerEventsDisabled.delete(s.value))})}),(h,g)=>(me(),Be(M(Sn),{ref:M(r),"as-child":h.asChild,as:h.as,"data-dismissable-layer":"",style:kr({pointerEvents:c.value?u.value?"auto":"none":void 0}),onFocusCapture:M(f).onFocusCapture,onBlurCapture:M(f).onBlurCapture,onPointerdownCapture:M(d).onPointerDownCapture},{default:re(()=>[ot(h.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Ex=r1;const s1=gM(()=>Ve([]));function o1(){const t=s1();return{add(e){const n=t.value[0];e!==n&&n?.pause(),t.value=Zm(t.value,e),t.value.unshift(e)},remove(e){t.value=Zm(t.value,e),t.value[0]?.resume()}}}function Zm(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}const ju="focusScope.autoFocusOnMount",Qu="focusScope.autoFocusOnUnmount",jm={bubbles:!1,cancelable:!0};function a1(t,{select:e=!1}={}){const n=Ys();for(const i of t)if(Qr(i,{select:e}),Ys()!==n)return!0}function l1(t){const e=Tx(t),n=Qm(e,t),i=Qm(e.reverse(),t);return[n,i]}function Tx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Qm(t,e){for(const n of t)if(!c1(n,{upTo:e}))return n}function c1(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function u1(t){return t instanceof HTMLInputElement&&"select"in t}function Qr(t,{select:e=!1}={}){if(t&&t.focus){const n=Ys();t.focus({preventScroll:!0}),t!==n&&u1(t)&&e&&t.select()}}var d1=Fe({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:e}){const n=t,i=e,{currentRef:r,currentElement:s}=sn(),o=Ve(null),a=o1(),l=Yn({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});pi(u=>{if(!Li)return;const d=s.value;if(!n.trapped)return;function f(m){if(l.paused||!d)return;const p=m.target;d.contains(p)?o.value=p:Qr(o.value,{select:!0})}function h(m){if(l.paused||!d)return;const p=m.relatedTarget;p!==null&&(d.contains(p)||Qr(o.value,{select:!0}))}function g(m){const p=o.value;if(p===null||!m.some(y=>y.removedNodes.length>0))return;d.contains(p)||Qr(d)}document.addEventListener("focusin",f),document.addEventListener("focusout",h);const v=new MutationObserver(g);d&&v.observe(d,{childList:!0,subtree:!0}),u(()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",h),v.disconnect()})}),pi(async u=>{const d=s.value;if(await Ir(),!d)return;a.add(l);const f=Ys();if(!d.contains(f)){const g=new CustomEvent(ju,jm);d.addEventListener(ju,v=>i("mountAutoFocus",v)),d.dispatchEvent(g),g.defaultPrevented||(a1(Tx(d),{select:!0}),Ys()===f&&Qr(d))}u(()=>{d.removeEventListener(ju,m=>i("mountAutoFocus",m));const g=new CustomEvent(Qu,jm),v=m=>{i("unmountAutoFocus",m)};d.addEventListener(Qu,v),d.dispatchEvent(g),setTimeout(()=>{g.defaultPrevented||Qr(f??document.body,{select:!0}),d.removeEventListener(Qu,v),a.remove(l)},0)})});function c(u){if(!n.loop&&!n.trapped||l.paused)return;const d=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,f=Ys();if(d&&f){const h=u.currentTarget,[g,v]=l1(h);g&&v?!u.shiftKey&&f===v?(u.preventDefault(),n.loop&&Qr(g,{select:!0})):u.shiftKey&&f===g&&(u.preventDefault(),n.loop&&Qr(v,{select:!0})):f===h&&u.preventDefault()}}return(u,d)=>(me(),Be(M(Sn),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":u.asChild,as:u.as,onKeydown:c},{default:re(()=>[ot(u.$slots,"default")]),_:3},8,["as-child","as"]))}}),f1=d1,h1=Fe({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=gx();return(n,i)=>M(e)||n.forceMount?(me(),Be(zS,{key:0,to:n.to,disabled:n.disabled,defer:n.defer},[ot(n.$slots,"default")],8,["to","disabled","defer"])):ri("v-if",!0)}}),Ax=h1;const eg="data-reka-collection-item";function Gh(t={}){const{key:e="",isProvider:n=!1}=t,i=`${e}CollectionProvider`;let r;n?(r={collectionRef:Ve(),itemMap:Ve(new Map)},Rh(i,r)):r=Uo(i);const s=(u=!1)=>{const d=r.collectionRef.value;if(!d)return[];const f=Array.from(d.querySelectorAll(`[${eg}]`)),g=Array.from(r.itemMap.value.values()).sort((v,m)=>f.indexOf(v.ref)-f.indexOf(m.ref));return u?g:g.filter(v=>v.ref.dataset.disabled!=="")},o=Fe({name:"CollectionSlot",inheritAttrs:!1,setup(u,{slots:d,attrs:f}){const{primitiveElement:h,currentElement:g}=Zs();return en(g,()=>{r.collectionRef.value=g.value}),()=>wr(ff,{ref:h,...f},d)}}),a=Fe({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(u,{slots:d,attrs:f}){const{primitiveElement:h,currentElement:g}=Zs();return pi(v=>{if(g.value){const m=A_(g.value);r.itemMap.value.set(m,{ref:g.value,value:u.value}),v(()=>r.itemMap.value.delete(m))}}),()=>wr(ff,{...f,[eg]:"",ref:h},d)}}),l=Te(()=>Array.from(r.itemMap.value.values())),c=Te(()=>r.itemMap.value.size);return{getItems:s,reactiveItems:l,itemMapSize:c,CollectionSlot:o,CollectionItem:a}}var p1=Fe({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){return(e,n)=>(me(),Be(M(Sn),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:re(()=>[ot(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),Cx=p1,m1=Fe({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(t){const e=t,{primitiveElement:n,currentElement:i}=Zs(),r=Te(()=>e.checked??e.value);return en(r,(s,o)=>{if(!i.value)return;const a=i.value,l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(u&&s!==o){const d=new Event("input",{bubbles:!0}),f=new Event("change",{bubbles:!0});u.call(a,s),a.dispatchEvent(d),a.dispatchEvent(f)}}),(s,o)=>(me(),Be(Cx,Nt({ref_key:"primitiveElement",ref:n},{...e,...s.$attrs},{as:"input"}),null,16))}}),tg=m1,g1=Fe({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(t){const e=t,n=Te(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),i=Te(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((r,s)=>typeof r=="object"?Object.entries(r).map(([o,a])=>({name:`${e.name}[${s}][${o}]`,value:a})):{name:`${e.name}[${s}]`,value:r}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([r,s])=>({name:`${e.name}[${r}]`,value:s})):[]);return(r,s)=>(me(),Mt(nn,null,[ri(" We render single input if it's required "),n.value?(me(),Be(tg,Nt({key:r.name},{...e,...r.$attrs},{name:r.name,value:r.value}),null,16,["name","value"])):(me(!0),Mt(nn,{key:1},ll(i.value,o=>(me(),Be(tg,Nt({key:o.name},{ref_for:!0},{...e,...r.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))],2112))}}),Px=g1;const[Rx,v1]=Hr("PopperRoot");var _1=Fe({inheritAttrs:!1,__name:"PopperRoot",setup(t){const e=Ve();return v1({anchor:e,onAnchorChange:n=>e.value=n}),(n,i)=>ot(n.$slots,"default")}}),Dx=_1,x1=Fe({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,{forwardRef:n,currentElement:i}=sn(),r=Rx();return F_(()=>{r.onAnchorChange(e.reference??i.value)}),(s,o)=>(me(),Be(M(Sn),{ref:M(n),as:s.as,"as-child":s.asChild},{default:re(()=>[ot(s.$slots,"default")]),_:3},8,["as","as-child"]))}}),Ix=x1;function y1(t){return t!==null}function b1(t){return{name:"transformOrigin",options:t,fn(e){const{placement:n,rects:i,middlewareData:r}=e,o=r.arrow?.centerOffset!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[c,u]=hf(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(r.arrow?.x??0)+a/2,h=(r.arrow?.y??0)+l/2;let g="",v="";return c==="bottom"?(g=o?d:`${f}px`,v=`${-l}px`):c==="top"?(g=o?d:`${f}px`,v=`${i.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=o?d:`${h}px`):c==="left"&&(g=`${i.floating.width+l}px`,v=o?d:`${h}px`),{data:{x:g,y:v}}}}}function hf(t){const[e,n="center"]=t.split("-");return[e,n]}const S1=["top","right","bottom","left"],hs=Math.min,ti=Math.max,Wc=Math.round,Rl=Math.floor,Ki=t=>({x:t,y:t}),w1={left:"right",right:"left",bottom:"top",top:"bottom"};function pf(t,e,n){return ti(t,hs(e,n))}function Nr(t,e){return typeof t=="function"?t(e):t}function Lr(t){return t.split("-")[0]}function sa(t){return t.split("-")[1]}function Wh(t){return t==="x"?"y":"x"}function qh(t){return t==="y"?"height":"width"}function Xi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Xh(t){return Wh(Xi(t))}function M1(t,e,n){n===void 0&&(n=!1);const i=sa(t),r=Xh(t),s=qh(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=qc(o)),[o,qc(o)]}function E1(t){const e=qc(t);return[mf(t),e,mf(e)]}function mf(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ng=["left","right"],ig=["right","left"],T1=["top","bottom"],A1=["bottom","top"];function C1(t,e,n){switch(t){case"top":case"bottom":return n?e?ig:ng:e?ng:ig;case"left":case"right":return e?T1:A1;default:return[]}}function P1(t,e,n,i){const r=sa(t);let s=C1(Lr(t),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),e&&(s=s.concat(s.map(mf)))),s}function qc(t){const e=Lr(t);return w1[e]+t.slice(e.length)}function R1(t){return{top:0,right:0,bottom:0,left:0,...t}}function Nx(t){return typeof t!="number"?R1(t):{top:t,right:t,bottom:t,left:t}}function Xc(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function rg(t,e,n){let{reference:i,floating:r}=t;const s=Xi(e),o=Xh(e),a=qh(o),l=Lr(e),c=s==="y",u=i.x+i.width/2-r.width/2,d=i.y+i.height/2-r.height/2,f=i[a]/2-r[a]/2;let h;switch(l){case"top":h={x:u,y:i.y-r.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-r.width,y:d};break;default:h={x:i.x,y:i.y}}switch(sa(e)){case"start":h[o]-=f*(n&&c?-1:1);break;case"end":h[o]+=f*(n&&c?-1:1);break}return h}async function D1(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Nr(e,t),g=Nx(h),m=a[f?d==="floating"?"reference":"floating":d],p=Xc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=d==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),y=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},E=Xc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:x,strategy:l}):_);return{top:(p.top-E.top+g.top)/y.y,bottom:(E.bottom-p.bottom+g.bottom)/y.y,left:(p.left-E.left+g.left)/y.x,right:(E.right-p.right+g.right)/y.x}}const I1=50,N1=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:D1},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=rg(c,i,l),f=i,h=0;const g={};for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Nr(t,e)||{};if(c==null)return{};const d=Nx(u),f={x:n,y:i},h=Xh(r),g=qh(h),v=await o.getDimensions(c),m=h==="y",p=m?"top":"left",_=m?"bottom":"right",x=m?"clientHeight":"clientWidth",y=s.reference[g]+s.reference[h]-f[h]-s.floating[g],E=f[h]-s.reference[h],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let P=A?A[x]:0;(!P||!await(o.isElement==null?void 0:o.isElement(A)))&&(P=a.floating[x]||s.floating[g]);const D=y/2-E/2,S=P/2-v[g]/2-1,w=hs(d[p],S),N=hs(d[_],S),B=w,W=P-v[g]-N,Z=P/2-v[g]/2+D,X=pf(B,Z,W),H=!l.arrow&&sa(r)!=null&&Z!==X&&s.reference[g]/2-(ZZ<=0)){var N,B;const Z=(((N=s.flip)==null?void 0:N.index)||0)+1,X=P[Z];if(X&&(!(d==="alignment"?_!==Xi(X):!1)||w.every(J=>Xi(J.placement)===_?J.overflows[0]>0:!0)))return{data:{index:Z,overflows:w},reset:{placement:X}};let H=(B=w.filter(k=>k.overflows[0]<=0).sort((k,J)=>k.overflows[1]-J.overflows[1])[0])==null?void 0:B.placement;if(!H)switch(h){case"bestFit":{var W;const k=(W=w.filter(J=>{if(A){const ue=Xi(J.placement);return ue===_||ue==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(ue=>ue>0).reduce((ue,Y)=>ue+Y,0)]).sort((J,ue)=>J[1]-ue[1])[0])==null?void 0:W[0];k&&(H=k);break}case"initialPlacement":H=a;break}if(r!==H)return{reset:{placement:H}}}return{}}}};function sg(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function og(t){return S1.some(e=>t[e]>=0)}const F1=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:i}=e,{strategy:r="referenceHidden",...s}=Nr(t,e);switch(r){case"referenceHidden":{const o=await i.detectOverflow(e,{...s,elementContext:"reference"}),a=sg(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:og(a)}}}case"escaped":{const o=await i.detectOverflow(e,{...s,altBoundary:!0}),a=sg(o,n.floating);return{data:{escapedOffsets:a,escaped:og(a)}}}default:return{}}}}},Lx=new Set(["left","top"]);async function U1(t,e){const{placement:n,platform:i,elements:r}=t,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=Lr(n),a=sa(n),l=Xi(n)==="y",c=Lx.has(o)?-1:1,u=s&&l?-1:1,d=Nr(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const k1=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:s,placement:o,middlewareData:a}=e,l=await U1(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:o}}}}},B1=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:p=>{let{x:_,y:x}=p;return{x:_,y:x}}},...c}=Nr(t,e),u={x:n,y:i},d=await s.detectOverflow(e,c),f=Xi(Lr(r)),h=Wh(f);let g=u[h],v=u[f];if(o){const p=h==="y"?"top":"left",_=h==="y"?"bottom":"right",x=g+d[p],y=g-d[_];g=pf(x,g,y)}if(a){const p=f==="y"?"top":"left",_=f==="y"?"bottom":"right",x=v+d[p],y=v-d[_];v=pf(x,v,y)}const m=l.fn({...e,[h]:g,[f]:v});return{...m,data:{x:m.x-n,y:m.y-i,enabled:{[h]:o,[f]:a}}}}}},z1=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Nr(t,e),u={x:n,y:i},d=Xi(r),f=Wh(d);let h=u[f],g=u[d];const v=Nr(a,e),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const x=f==="y"?"height":"width",y=s.reference[f]-s.floating[x]+m.mainAxis,E=s.reference[f]+s.reference[x]-m.mainAxis;hE&&(h=E)}if(c){var p,_;const x=f==="y"?"width":"height",y=Lx.has(Lr(r)),E=s.reference[d]-s.floating[x]+(y&&((p=o.offset)==null?void 0:p[d])||0)+(y?0:m.crossAxis),A=s.reference[d]+s.reference[x]+(y?0:((_=o.offset)==null?void 0:_[d])||0)-(y?m.crossAxis:0);gA&&(g=A)}return{[f]:h,[d]:g}}}},V1=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...c}=Nr(t,e),u=await o.detectOverflow(e,c),d=Lr(r),f=sa(r),h=Xi(r)==="y",{width:g,height:v}=s.floating;let m,p;d==="top"||d==="bottom"?(m=d,p=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(p=d,m=f==="end"?"top":"bottom");const _=v-u.top-u.bottom,x=g-u.left-u.right,y=hs(v-u[m],_),E=hs(g-u[p],x),A=!e.middlewareData.shift;let P=y,D=E;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(D=x),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(P=_),A&&!f){const w=ti(u.left,0),N=ti(u.right,0),B=ti(u.top,0),W=ti(u.bottom,0);h?D=g-2*(w!==0||N!==0?w+N:ti(u.left,u.right)):P=v-2*(B!==0||W!==0?B+W:ti(u.top,u.bottom))}await l({...e,availableWidth:D,availableHeight:P});const S=await o.getDimensions(a.floating);return g!==S.width||v!==S.height?{reset:{rects:!0}}:{}}}};function Eu(){return typeof window<"u"}function no(t){return $h(t)?(t.nodeName||"").toLowerCase():"#document"}function ai(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ir(t){var e;return(e=($h(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function $h(t){return Eu()?t instanceof Node||t instanceof ai(t).Node:!1}function Pi(t){return Eu()?t instanceof Element||t instanceof ai(t).Element:!1}function Gr(t){return Eu()?t instanceof HTMLElement||t instanceof ai(t).HTMLElement:!1}function ag(t){return!Eu()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ai(t).ShadowRoot}function fl(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=Ri(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&r!=="inline"&&r!=="contents"}function H1(t){return/^(table|td|th)$/.test(no(t))}function Tu(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const G1=/transform|translate|scale|rotate|perspective|filter/,W1=/paint|layout|strict|content/,As=t=>!!t&&t!=="none";let ed;function Yh(t){const e=Pi(t)?Ri(t):t;return As(e.transform)||As(e.translate)||As(e.scale)||As(e.rotate)||As(e.perspective)||!Jh()&&(As(e.backdropFilter)||As(e.filter))||G1.test(e.willChange||"")||W1.test(e.contain||"")}function q1(t){let e=ps(t);for(;Gr(e)&&!Yo(e);){if(Yh(e))return e;if(Tu(e))return null;e=ps(e)}return null}function Jh(){return ed==null&&(ed=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ed}function Yo(t){return/^(html|body|#document)$/.test(no(t))}function Ri(t){return ai(t).getComputedStyle(t)}function Au(t){return Pi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ps(t){if(no(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ag(t)&&t.host||ir(t);return ag(e)?e.host:e}function Ox(t){const e=ps(t);return Yo(e)?t.ownerDocument?t.ownerDocument.body:t.body:Gr(e)&&fl(e)?e:Ox(e)}function Za(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Ox(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=ai(r);if(s){const a=gf(o);return e.concat(o,o.visualViewport||[],fl(r)?r:[],a&&n?Za(a):[])}else return e.concat(r,Za(r,[],n))}function gf(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Fx(t){const e=Ri(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Gr(t),s=r?t.offsetWidth:n,o=r?t.offsetHeight:i,a=Wc(n)!==s||Wc(i)!==o;return a&&(n=s,i=o),{width:n,height:i,$:a}}function Kh(t){return Pi(t)?t:t.contextElement}function Vo(t){const e=Kh(t);if(!Gr(e))return Ki(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=Fx(e);let o=(s?Wc(n.width):n.width)/i,a=(s?Wc(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const X1=Ki(0);function Ux(t){const e=ai(t);return!Jh()||!e.visualViewport?X1:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function $1(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ai(t)?!1:e}function js(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=Kh(t);let o=Ki(1);e&&(i?Pi(i)&&(o=Vo(i)):o=Vo(t));const a=$1(s,n,i)?Ux(s):Ki(0);let l=(r.left+a.x)/o.x,c=(r.top+a.y)/o.y,u=r.width/o.x,d=r.height/o.y;if(s){const f=ai(s),h=i&&Pi(i)?ai(i):i;let g=f,v=gf(g);for(;v&&i&&h!==g;){const m=Vo(v),p=v.getBoundingClientRect(),_=Ri(v),x=p.left+(v.clientLeft+parseFloat(_.paddingLeft))*m.x,y=p.top+(v.clientTop+parseFloat(_.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=x,c+=y,g=ai(v),v=gf(g)}}return Xc({width:u,height:d,x:l,y:c})}function Cu(t,e){const n=Au(t).scrollLeft;return e?e.left+n:js(ir(t)).left+n}function kx(t,e){const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-Cu(t,n),r=n.top+e.scrollTop;return{x:i,y:r}}function Y1(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const s=r==="fixed",o=ir(i),a=e?Tu(e.floating):!1;if(i===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Ki(1);const u=Ki(0),d=Gr(i);if((d||!d&&!s)&&((no(i)!=="body"||fl(o))&&(l=Au(i)),d)){const h=js(i);c=Vo(i),u.x=h.x+i.clientLeft,u.y=h.y+i.clientTop}const f=o&&!d&&!s?kx(o,l):Ki(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function J1(t){return Array.from(t.getClientRects())}function K1(t){const e=ir(t),n=Au(t),i=t.ownerDocument.body,r=ti(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=ti(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+Cu(t);const a=-n.scrollTop;return Ri(i).direction==="rtl"&&(o+=ti(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:o,y:a}}const lg=25;function Z1(t,e){const n=ai(t),i=ir(t),r=n.visualViewport;let s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;const u=Jh();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=Cu(i);if(c<=0){const u=i.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(i.clientWidth-d.clientWidth-h);g<=lg&&(s-=g)}else c<=lg&&(s+=c);return{width:s,height:o,x:a,y:l}}function j1(t,e){const n=js(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=Gr(t)?Vo(t):Ki(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=r*s.x,c=i*s.y;return{width:o,height:a,x:l,y:c}}function cg(t,e,n){let i;if(e==="viewport")i=Z1(t,n);else if(e==="document")i=K1(ir(t));else if(Pi(e))i=j1(e,n);else{const r=Ux(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Xc(i)}function Bx(t,e){const n=ps(t);return n===e||!Pi(n)||Yo(n)?!1:Ri(n).position==="fixed"||Bx(n,e)}function Q1(t,e){const n=e.get(t);if(n)return n;let i=Za(t,[],!1).filter(a=>Pi(a)&&no(a)!=="body"),r=null;const s=Ri(t).position==="fixed";let o=s?ps(t):t;for(;Pi(o)&&!Yo(o);){const a=Ri(o),l=Yh(o);!l&&a.position==="fixed"&&(r=null),(s?!l&&!r:!l&&a.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||fl(o)&&!l&&Bx(t,o))?i=i.filter(u=>u!==o):r=a,o=ps(o)}return e.set(t,i),i}function eE(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o=[...n==="clippingAncestors"?Tu(e)?[]:Q1(e,this._c):[].concat(n),i],a=cg(e,o[0],r);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f{o(!1,1e-7)},1e3)}P===1&&!Vx(c,t.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(E,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(t)}return o(!0),s}function aE(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=Kh(t),u=r||s?[...c?Za(c):[],...e?Za(e):[]]:[];u.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});const d=c&&a?oE(c,n):null;let f=-1,h=null;o&&(h=new ResizeObserver(p=>{let[_]=p;_&&_.target===c&&h&&e&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),n()}),c&&!l&&h.observe(c),e&&h.observe(e));let g,v=l?js(t):null;l&&m();function m(){const p=js(t);v&&!Vx(v,p)&&n(),v=p,g=requestAnimationFrame(m)}return n(),()=>{var p;u.forEach(_=>{r&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),d?.(),(p=h)==null||p.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const lE=k1,cE=B1,dg=O1,uE=V1,dE=F1,fE=L1,hE=z1,pE=(t,e,n)=>{const i=new Map,r={platform:sE,...n},s={...r.platform,_c:i};return N1(t,e,{...r,platform:s})};function mE(t){return t!=null&&typeof t=="object"&&"$el"in t}function vf(t){if(mE(t)){const e=t.$el;return $h(e)&&no(e)==="#comment"?null:e}return t}function Co(t){return typeof t=="function"?t():M(t)}function gE(t){return{name:"arrow",options:t,fn(e){const n=vf(Co(t.element));return n==null?{}:fE({element:n,padding:t.padding}).fn(e)}}}function Hx(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function fg(t,e){const n=Hx(t);return Math.round(e*n)/n}function vE(t,e,n){n===void 0&&(n={});const i=n.whileElementsMounted,r=Te(()=>{var P;return(P=Co(n.open))!=null?P:!0}),s=Te(()=>Co(n.middleware)),o=Te(()=>{var P;return(P=Co(n.placement))!=null?P:"bottom"}),a=Te(()=>{var P;return(P=Co(n.strategy))!=null?P:"absolute"}),l=Te(()=>{var P;return(P=Co(n.transform))!=null?P:!0}),c=Te(()=>vf(t.value)),u=Te(()=>vf(e.value)),d=Ve(0),f=Ve(0),h=Ve(a.value),g=Ve(o.value),v=gu({}),m=Ve(!1),p=Te(()=>{const P={position:h.value,left:"0",top:"0"};if(!u.value)return P;const D=fg(u.value,d.value),S=fg(u.value,f.value);return l.value?{...P,transform:"translate("+D+"px, "+S+"px)",...Hx(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:D+"px",top:S+"px"}});let _;function x(){if(c.value==null||u.value==null)return;const P=r.value;pE(c.value,u.value,{middleware:s.value,placement:o.value,strategy:a.value}).then(D=>{d.value=D.x,f.value=D.y,h.value=D.strategy,g.value=D.placement,v.value=D.middlewareData,m.value=P!==!1})}function y(){typeof _=="function"&&(_(),_=void 0)}function E(){if(y(),i===void 0){x();return}if(c.value!=null&&u.value!=null){_=i(c.value,u.value,x);return}}function A(){r.value||(m.value=!1)}return en([s,o,a,r],x,{flush:"sync"}),en([c,u],E,{flush:"sync"}),en(r,A,{flush:"sync"}),Eh()&&u_(y),{x:Fs(d),y:Fs(f),strategy:Fs(h),placement:Fs(g),middlewareData:Fs(v),isPositioned:Fs(m),floatingStyles:p,update:x}}const _E={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[ok,xE]=Hr("PopperContent");var yE=Fe({inheritAttrs:!1,__name:"PopperContent",props:nw({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{..._E}),emits:["placed"],setup(t,{emit:e}){const n=t,i=e,r=Rx(),{forwardRef:s,currentElement:o}=sn(),a=Ve(),l=Ve(),{width:c,height:u}=Sx(l),d=Te(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),f=Te(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),h=Te(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),g=Te(()=>({padding:f.value,boundary:h.value.filter(y1),altBoundary:h.value.length>0})),v=Te(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),m=mM(()=>[lE({mainAxis:n.sideOffset+u.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&dg({...g.value,...v.value}),n.avoidCollisions&&cE({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?hE():void 0,...g.value}),!n.prioritizePosition&&n.avoidCollisions&&dg({...g.value,...v.value}),uE({...g.value,apply:({elements:B,rects:W,availableWidth:Z,availableHeight:X})=>{const{width:H,height:k}=W.reference,J=B.floating.style;J.setProperty("--reka-popper-available-width",`${Z}px`),J.setProperty("--reka-popper-available-height",`${X}px`),J.setProperty("--reka-popper-anchor-width",`${H}px`),J.setProperty("--reka-popper-anchor-height",`${k}px`)}}),l.value&&gE({element:l.value,padding:n.arrowPadding}),b1({arrowWidth:c.value,arrowHeight:u.value}),n.hideWhenDetached&&dE({strategy:"referenceHidden",...g.value})]),p=Te(()=>n.reference??r.anchor.value),{floatingStyles:_,placement:x,isPositioned:y,middlewareData:E}=vE(p,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...B)=>aE(...B,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:m}),A=Te(()=>hf(x.value)[0]),P=Te(()=>hf(x.value)[1]);F_(()=>{y.value&&i("placed")});const D=Te(()=>{const B=E.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&B}),S=Ve("");pi(()=>{o.value&&(S.value=window.getComputedStyle(o.value).zIndex)});const w=Te(()=>E.value.arrow?.x??0),N=Te(()=>E.value.arrow?.y??0);return xE({placedSide:A,onArrowChange:B=>l.value=B,arrowX:w,arrowY:N,shouldHideArrow:D}),(B,W)=>(me(),Mt("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:kr({...M(_),transform:M(y)?M(_).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:S.value,"--reka-popper-transform-origin":[M(E).transformOrigin?.x,M(E).transformOrigin?.y].join(" "),...M(E).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[ie(M(Sn),Nt({ref:M(s)},B.$attrs,{"as-child":n.asChild,as:B.as,"data-side":A.value,"data-align":P.value,style:{animation:M(y)?void 0:"none"}}),{default:re(()=>[ot(B.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Gx=yE;function bE(t=[],e,n){const i=[...t];return i[n]=e,i.sort((r,s)=>r-s)}function Wx(t,e,n){const s=100/(n-e)*(t-e);return Bh(s,0,100)}function SE(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function wE(t,e){if(t.length===1)return 0;const n=t.map(r=>Math.abs(r-e)),i=Math.min(...n);return n.indexOf(i)}function ME(t,e,n){const i=t/2,s=Zh([0,50],[0,i]);return(i-s(e)*n)*n}function EE(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function TE(t,e){if(e>0){const n=EE(t);return Math.min(...n)>=e}return!0}function Zh(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const i=(e[1]-e[0])/(t[1]-t[0]);return e[0]+i*(n-t[0])}}function AE(t){return(String(t).split(".")[1]||"").length}function CE(t,e){const n=10**e;return Math.round(t*n)/n}const qx=["PageUp","PageDown"],Xx=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$x={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageUp","ArrowUp","ArrowLeft"]},[Yx,Jx]=Hr(["SliderVertical","SliderHorizontal"]);var PE=Fe({__name:"SliderHorizontal",props:{dir:{type:String,required:!1},min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:["slideEnd","slideStart","slideMove","homeKeyDown","endKeyDown","stepKeyDown"],setup(t,{emit:e}){const n=t,i=e,{max:r,min:s,dir:o,inverted:a}=Dr(n),{forwardRef:l,currentElement:c}=sn(),u=oa(),d=Ve(),f=Ve(),h=Te(()=>o?.value!=="rtl"&&!a.value||o?.value!=="ltr"&&a.value);function g(_,x){const y=f.value||c.value.getBoundingClientRect(),E=[...u.thumbElements.value][u.valueIndexToChangeRef.value],A=u.thumbAlignment.value==="contain"?E.clientWidth:0;!d.value&&!x&&u.thumbAlignment.value==="contain"&&(d.value=_.clientX-E.getBoundingClientRect().left);const P=[0,y.width-A],D=h.value?[s.value,r.value]:[r.value,s.value],S=Zh(P,D);f.value=y;const w=x?_.clientX-y.left-A/2:_.clientX-y.left-(d.value??0);return S(w)}const v=Te(()=>h.value?"left":"right"),m=Te(()=>h.value?"right":"left"),p=Te(()=>h.value?1:-1);return Jx({startEdge:v,endEdge:m,direction:p,size:"width"}),(_,x)=>(me(),Be(Kx,{ref:M(l),dir:M(o),"data-orientation":"horizontal",style:kr({"--reka-slider-thumb-transform":!h.value&&M(u).thumbAlignment.value==="overflow"?"translateX(50%)":"translateX(-50%)"}),onSlideStart:x[0]||(x[0]=y=>{const E=g(y,!0);i("slideStart",E)}),onSlideMove:x[1]||(x[1]=y=>{const E=g(y);i("slideMove",E)}),onSlideEnd:x[2]||(x[2]=()=>{f.value=void 0,d.value=void 0,i("slideEnd")}),onStepKeyDown:x[3]||(x[3]=y=>{const E=h.value?"from-left":"from-right",A=M($x)[E].includes(y.key);i("stepKeyDown",y,A?-1:1)}),onEndKeyDown:x[4]||(x[4]=y=>i("endKeyDown",y)),onHomeKeyDown:x[5]||(x[5]=y=>i("homeKeyDown",y))},{default:re(()=>[ot(_.$slots,"default")]),_:3},8,["dir","style"]))}}),RE=PE,DE=Fe({__name:"SliderVertical",props:{min:{type:Number,required:!0},max:{type:Number,required:!0},inverted:{type:Boolean,required:!0}},emits:["slideEnd","slideStart","slideMove","homeKeyDown","endKeyDown","stepKeyDown"],setup(t,{emit:e}){const n=t,i=e,{max:r,min:s,inverted:o}=Dr(n),a=oa(),{forwardRef:l,currentElement:c}=sn(),u=Ve(),d=Ve(),f=Te(()=>!o.value);function h(p,_){const x=d.value||c.value.getBoundingClientRect(),y=[...a.thumbElements.value][a.valueIndexToChangeRef.value],E=a.thumbAlignment.value==="contain"?y.clientHeight:0;!u.value&&!_&&a.thumbAlignment.value==="contain"&&(u.value=p.clientY-y.getBoundingClientRect().top);const A=[0,x.height-E],P=f.value?[r.value,s.value]:[s.value,r.value],D=Zh(A,P),S=_?p.clientY-x.top-E/2:p.clientY-x.top-(u.value??0);return d.value=x,D(S)}const g=Te(()=>f.value?"bottom":"top"),v=Te(()=>f.value?"top":"bottom"),m=Te(()=>f.value?1:-1);return Jx({startEdge:g,endEdge:v,direction:m,size:"height"}),(p,_)=>(me(),Be(Kx,{ref:M(l),"data-orientation":"vertical",style:kr({"--reka-slider-thumb-transform":!f.value&&M(a).thumbAlignment.value==="overflow"?"translateY(-50%)":"translateY(50%)"}),onSlideStart:_[0]||(_[0]=x=>{const y=h(x,!0);i("slideStart",y)}),onSlideMove:_[1]||(_[1]=x=>{const y=h(x);i("slideMove",y)}),onSlideEnd:_[2]||(_[2]=()=>{d.value=void 0,u.value=void 0,i("slideEnd")}),onStepKeyDown:_[3]||(_[3]=x=>{const y=f.value?"from-bottom":"from-top",E=M($x)[y].includes(x.key);i("stepKeyDown",x,E?-1:1)}),onEndKeyDown:_[4]||(_[4]=x=>i("endKeyDown",x)),onHomeKeyDown:_[5]||(_[5]=x=>i("homeKeyDown",x))},{default:re(()=>[ot(p.$slots,"default")]),_:3},8,["style"]))}}),IE=DE;const[oa,NE]=Hr("SliderRoot");var LE=Fe({inheritAttrs:!1,__name:"SliderRoot",props:{defaultValue:{type:Array,required:!1,default:()=>[0]},modelValue:{type:[Array,null],required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},inverted:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},minStepsBetweenThumbs:{type:Number,required:!1,default:0},thumbAlignment:{type:String,required:!1,default:"contain"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","valueCommit"],setup(t,{emit:e}){const n=t,i=e,{min:r,max:s,step:o,minStepsBetweenThumbs:a,orientation:l,disabled:c,thumbAlignment:u,dir:d}=Dr(n),f=OM(d),{forwardRef:h,currentElement:g}=sn(),v=yx(g),{CollectionSlot:m}=Gh({isProvider:!0}),p=Mu(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),_=Te(()=>Array.isArray(p.value)?[...p.value]:[]),x=Ve(0),y=Ve(_.value);function E(w){const N=wE(_.value,w);D(w,N)}function A(w){D(w,x.value)}function P(){const w=y.value[x.value];_.value[x.value]!==w&&i("valueCommit",Tt(_.value))}function D(w,N,{commit:B}={commit:!1}){const W=AE(o.value),Z=CE(Math.round((w-r.value)/o.value)*o.value+r.value,W),X=Bh(Z,r.value,s.value),H=bE(_.value,X,N);if(TE(H,a.value*o.value)){x.value=H.indexOf(X);const k=String(H)!==String(p.value);k&&B&&i("valueCommit",H),k&&(S.value[x.value]?.focus(),p.value=H)}}const S=Ve([]);return NE({modelValue:p,currentModelValue:_,valueIndexToChangeRef:x,thumbElements:S,orientation:l,min:r,max:s,disabled:c,thumbAlignment:u}),(w,N)=>(me(),Be(M(m),null,{default:re(()=>[(me(),Be(Ih(M(l)==="horizontal"?RE:IE),Nt(w.$attrs,{ref:M(h),"as-child":w.asChild,as:w.as,min:M(r),max:M(s),dir:M(f),inverted:w.inverted,"aria-disabled":M(c),"data-disabled":M(c)?"":void 0,onPointerdown:N[0]||(N[0]=()=>{M(c)||(y.value=_.value)}),onSlideStart:N[1]||(N[1]=B=>!M(c)&&E(B)),onSlideMove:N[2]||(N[2]=B=>!M(c)&&A(B)),onSlideEnd:N[3]||(N[3]=B=>!M(c)&&P()),onHomeKeyDown:N[4]||(N[4]=B=>!M(c)&&D(M(r),0,{commit:!0})),onEndKeyDown:N[5]||(N[5]=B=>!M(c)&&D(M(s),_.value.length-1,{commit:!0})),onStepKeyDown:N[6]||(N[6]=(B,W)=>{if(!M(c)){const H=M(qx).includes(B.key)||B.shiftKey&&M(Xx).includes(B.key)?10:1,k=x.value,J=_.value[k],ue=M(o)*H*W;D(J+ue,k,{commit:!0})}})}),{default:re(()=>[ot(w.$slots,"default",{modelValue:M(p)}),M(v)&&w.name?(me(),Be(M(Px),{key:0,type:"number",value:M(p),name:w.name,required:w.required,disabled:M(c),step:M(o)},null,8,["value","name","required","disabled","step"])):ri("v-if",!0)]),_:3},16,["as-child","as","min","max","dir","inverted","aria-disabled","data-disabled"]))]),_:3}))}}),OE=LE,FE=Fe({__name:"SliderImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},emits:["slideStart","slideMove","slideEnd","homeKeyDown","endKeyDown","stepKeyDown"],setup(t,{emit:e}){const n=t,i=e,r=oa();return(s,o)=>(me(),Be(M(Sn),Nt({"data-slider-impl":""},n,{onKeydown:o[0]||(o[0]=a=>{a.key==="Home"?(i("homeKeyDown",a),a.preventDefault()):a.key==="End"?(i("endKeyDown",a),a.preventDefault()):M(qx).concat(M(Xx)).includes(a.key)&&(i("stepKeyDown",a),a.preventDefault())}),onPointerdown:o[1]||(o[1]=a=>{const l=a.target;l.setPointerCapture(a.pointerId),a.preventDefault(),M(r).thumbElements.value.includes(l)?l.focus():i("slideStart",a)}),onPointermove:o[2]||(o[2]=a=>{a.target.hasPointerCapture(a.pointerId)&&i("slideMove",a)}),onPointerup:o[3]||(o[3]=a=>{const l=a.target;l.hasPointerCapture(a.pointerId)&&(l.releasePointerCapture(a.pointerId),i("slideEnd",a))})}),{default:re(()=>[ot(s.$slots,"default")]),_:3},16))}}),Kx=FE,UE=Fe({__name:"SliderRange",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=oa(),n=Yx();sn();const i=Te(()=>e.currentModelValue.value.map(o=>Wx(o,e.min.value,e.max.value))),r=Te(()=>e.currentModelValue.value.length>1?Math.min(...i.value):0),s=Te(()=>100-Math.max(...i.value,0));return(o,a)=>(me(),Be(M(Sn),{"data-disabled":M(e).disabled.value?"":void 0,"data-orientation":M(e).orientation.value,"as-child":o.asChild,as:o.as,style:kr({[M(n).startEdge.value]:`${r.value}%`,[M(n).endEdge.value]:`${s.value}%`})},{default:re(()=>[ot(o.$slots,"default")]),_:3},8,["data-disabled","data-orientation","as-child","as","style"]))}}),kE=UE,BE=Fe({inheritAttrs:!1,__name:"SliderThumbImpl",props:{index:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){const e=t,n=oa(),i=Yx(),{forwardRef:r,currentElement:s}=sn(),{CollectionItem:o}=Gh(),a=Te(()=>n.modelValue?.value?.[e.index]),l=Te(()=>a.value===void 0?0:Wx(a.value,n.min.value??0,n.max.value??100)),c=Te(()=>SE(e.index,n.modelValue?.value?.length??0)),u=Sx(s),d=Te(()=>u[i.size].value),f=Te(()=>n.thumbAlignment.value==="overflow"||!d.value?0:ME(d.value,l.value,i.direction.value)),h=gx();return Ni(()=>{n.thumbElements.value.push(s.value)}),ra(()=>{const g=n.thumbElements.value.findIndex(v=>v===s.value)??-1;n.thumbElements.value.splice(g,1)}),(g,v)=>(me(),Be(M(o),null,{default:re(()=>[ie(M(Sn),Nt(g.$attrs,{ref:M(r),role:"slider",tabindex:M(n).disabled.value?void 0:0,"aria-label":g.$attrs["aria-label"]||c.value,"data-disabled":M(n).disabled.value?"":void 0,"data-orientation":M(n).orientation.value,"aria-valuenow":a.value,"aria-valuemin":M(n).min.value,"aria-valuemax":M(n).max.value,"aria-orientation":M(n).orientation.value,"as-child":g.asChild,as:g.as,style:{transform:"var(--reka-slider-thumb-transform)",position:"absolute",[M(i).startEdge.value]:`calc(${l.value}% + ${f.value}px)`,display:!M(h)&&a.value===void 0?"none":void 0},onFocus:v[0]||(v[0]=()=>{M(n).valueIndexToChangeRef.value=g.index})}),{default:re(()=>[ot(g.$slots,"default")]),_:3},16,["tabindex","aria-label","data-disabled","data-orientation","aria-valuenow","aria-valuemin","aria-valuemax","aria-orientation","as-child","as","style"])]),_:3}))}}),zE=BE,VE=Fe({__name:"SliderThumb",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=t,{getItems:n}=Gh(),{forwardRef:i,currentElement:r}=sn(),s=Te(()=>r.value?n(!0).findIndex(o=>o.ref===r.value):-1);return(o,a)=>(me(),Be(zE,Nt({ref:M(i)},e,{index:s.value}),{default:re(()=>[ot(o.$slots,"default")]),_:3},16,["index"]))}}),HE=VE,GE=Fe({__name:"SliderTrack",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const e=oa();return sn(),(n,i)=>(me(),Be(M(Sn),{"as-child":n.asChild,as:n.as,"data-disabled":M(e).disabled.value?"":void 0,"data-orientation":M(e).orientation.value},{default:re(()=>[ot(n.$slots,"default")]),_:3},8,["as-child","as","data-disabled","data-orientation"]))}}),WE=GE;const[hl,qE]=Hr("PopoverRoot");var XE=Fe({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(t,{emit:e}){const n=t,i=e,{modal:r}=Dr(n),s=Mu(n,"open",i,{defaultValue:n.defaultOpen,passive:n.open===void 0});return qE({contentId:"",triggerId:"",modal:r,open:s,onOpenChange:l=>{s.value=l},onOpenToggle:()=>{s.value=!s.value},triggerElement:Ve(),hasCustomAnchor:Ve(!1)}),(l,c)=>(me(),Be(M(Dx),null,{default:re(()=>[ot(l.$slots,"default",{open:M(s),close:()=>s.value=!1})]),_:3}))}}),$E=XE,YE=Fe({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=dl(to(n,"trapFocus","disableOutsidePointerEvents")),{forwardRef:s}=sn(),o=hl();return UM(),(a,l)=>(me(),Be(M(f1),{"as-child":"",loop:"",trapped:a.trapFocus,onMountAutoFocus:l[5]||(l[5]=c=>i("openAutoFocus",c)),onUnmountAutoFocus:l[6]||(l[6]=c=>i("closeAutoFocus",c))},{default:re(()=>[ie(M(Ex),{"as-child":"","disable-outside-pointer-events":a.disableOutsidePointerEvents,onPointerDownOutside:l[0]||(l[0]=c=>i("pointerDownOutside",c)),onInteractOutside:l[1]||(l[1]=c=>i("interactOutside",c)),onEscapeKeyDown:l[2]||(l[2]=c=>i("escapeKeyDown",c)),onFocusOutside:l[3]||(l[3]=c=>i("focusOutside",c)),onDismiss:l[4]||(l[4]=c=>M(o).onOpenChange(!1))},{default:re(()=>[ie(M(Gx),Nt(M(r),{id:M(o).contentId,ref:M(s),"data-state":M(o).open.value?"open":"closed","aria-labelledby":M(o).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:re(()=>[ot(a.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),Zx=YE,JE=Fe({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=hl(),s=Ve(!1);NM(!0);const o=nr(n,i),{forwardRef:a,currentElement:l}=sn();return JM(l),(c,u)=>(me(),Be(Zx,Nt(M(o),{ref:M(a),"trap-focus":M(r).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:u[0]||(u[0]=ei(d=>{i("closeAutoFocus",d),s.value||M(r).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:u[1]||(u[1]=d=>{i("pointerDownOutside",d);const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,g=f.button===2||h;s.value=g}),onFocusOutside:u[2]||(u[2]=ei(()=>{},["prevent"]))}),{default:re(()=>[ot(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),KE=JE,ZE=Fe({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=hl(),s=Ve(!1),o=Ve(!1),a=nr(n,i);return(l,c)=>(me(),Be(Zx,Nt(M(a),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=u=>{i("closeAutoFocus",u),u.defaultPrevented||(s.value||M(r).triggerElement.value?.focus(),u.preventDefault()),s.value=!1,o.value=!1}),onInteractOutside:c[1]||(c[1]=async u=>{i("interactOutside",u),u.defaultPrevented||(s.value=!0,u.detail.originalEvent.type==="pointerdown"&&(o.value=!0));const d=u.target;M(r).triggerElement.value?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&o.value&&u.preventDefault()})}),{default:re(()=>[ot(l.$slots,"default")]),_:3},16))}}),jE=ZE,QE=Fe({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=hl(),s=nr(n,i),{forwardRef:o}=sn();return r.contentId||=Hh(void 0,"reka-popover-content"),(a,l)=>(me(),Be(M(wx),{present:a.forceMount||M(r).open.value},{default:re(()=>[M(r).modal.value?(me(),Be(KE,Nt({key:0},M(s),{ref:M(o)}),{default:re(()=>[ot(a.$slots,"default")]),_:3},16)):(me(),Be(jE,Nt({key:1},M(s),{ref:M(o)}),{default:re(()=>[ot(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),eT=QE,tT=Fe({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,i)=>(me(),Be(M(Ax),vs(zr(e)),{default:re(()=>[ot(n.$slots,"default")]),_:3},16))}}),nT=tT,iT=Fe({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=hl(),{forwardRef:i,currentElement:r}=sn();return n.triggerId||=Hh(void 0,"reka-popover-trigger"),Ni(()=>{n.triggerElement.value=r.value}),(s,o)=>(me(),Be(Ih(M(n).hasCustomAnchor.value?M(Sn):M(Ix)),{"as-child":""},{default:re(()=>[ie(M(Sn),{id:M(n).triggerId,ref:M(i),type:s.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":M(n).open.value,"aria-controls":M(n).contentId,"data-state":M(n).open.value?"open":"closed",as:s.as,"as-child":e.asChild,onClick:M(n).onOpenToggle},{default:re(()=>[ot(s.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),rT=iT;let nd=new Map,_f=!1;try{_f=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let $c=!1;try{$c=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const jx={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class Qx{format(e){let n="";if(!_f&&this.options.signDisplay!=null?n=oT(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!$c){var i;let{unit:r,unitDisplay:s="short",locale:o}=this.resolvedOptions();if(!r)return n;let a=(i=jx[r])===null||i===void 0?void 0:i[s];n+=a[o]||a.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n= start date");return`${this.format(e)} – ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n= start date");let i=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(n);return[...i.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!_f&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!$c&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,n={}){this.numberFormatter=sT(e,n),this.options=n}}function sT(t,e={}){let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!$c){var i;let{unit:o,unitDisplay:a="short"}=e;if(!o)throw new Error('unit option must be provided with style: "unit"');if(!(!((i=jx[o])===null||i===void 0)&&i[a]))throw new Error(`Unsupported unit ${o} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let r=t+(e?Object.entries(e).sort((o,a)=>o[0]0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):i=n>0),i){let r=t.format(-n),s=t.format(n),o=r.replace(s,"").replace(/\u200e|\u061C/,"");return[...o].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),r.replace(s,"!!!").replace(o,"+").replace("!!!",s)}else return t.format(n)}}const aT=new RegExp("^.*\\(.*\\).*$"),lT=["latn","arab","hanidec","deva","beng","fullwide"];class ey{parse(e){return id(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,n,i){return id(this.locale,this.options,e).isValidPartialNumber(e,n,i)}getNumberingSystem(e){return id(this.locale,this.options,e).options.numberingSystem}constructor(e,n={}){this.locale=e,this.options=n}}const hg=new Map;function id(t,e,n){let i=pg(t,e);if(!t.includes("-nu-")&&!i.isValidPartialNumber(n)){for(let r of lT)if(r!==i.options.numberingSystem){let s=pg(t+(t.includes("-u-")?"-nu-":"-u-nu-")+r,e);if(s.isValidPartialNumber(n))return s}}return i}function pg(t,e){let n=t+(e?Object.entries(e).sort((r,s)=>r[0]-1&&(n=`-${n}`)}let i=n?+n:NaN;if(isNaN(i))return NaN;if(this.options.style==="percent"){var r,s;let o={...this.options,style:"decimal",minimumFractionDigits:Math.min(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)+2,20),maximumFractionDigits:Math.min(((s=this.options.maximumFractionDigits)!==null&&s!==void 0?s:0)+2,20)};return new ey(this.locale,o).parse(new Qx(this.locale,o).format(i))}return this.options.currencySign==="accounting"&&aT.test(e)&&(i=-1*i),i}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=fo(e,".",this.symbols.group))),this.symbols.group==="’"&&e.includes("'")&&(e=fo(e,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(e=fo(e," ",this.symbols.group),e=fo(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,n=-1/0,i=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&n<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&i>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=fo(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,n={}){this.locale=e,n.roundingIncrement!==1&&n.roundingIncrement!=null&&(n.maximumFractionDigits==null&&n.minimumFractionDigits==null?(n.maximumFractionDigits=0,n.minimumFractionDigits=0):n.maximumFractionDigits==null?n.maximumFractionDigits=n.minimumFractionDigits:n.minimumFractionDigits==null&&(n.minimumFractionDigits=n.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,n),this.options=this.formatter.resolvedOptions(),this.symbols=dT(e,this.formatter,this.options,n);var i,r;this.options.style==="percent"&&(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)>18||((r=this.options.maximumFractionDigits)!==null&&r!==void 0?r:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const mg=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),uT=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function dT(t,e,n,i){var r,s,o,a;let l=new Intl.NumberFormat(t,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),d=uT.map(w=>l.formatToParts(w));var f;let h=(f=(r=c.find(w=>w.type==="minusSign"))===null||r===void 0?void 0:r.value)!==null&&f!==void 0?f:"-",g=(s=u.find(w=>w.type==="plusSign"))===null||s===void 0?void 0:s.value;!g&&(i?.signDisplay==="exceptZero"||i?.signDisplay==="always")&&(g="+");let m=(o=new Intl.NumberFormat(t,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(w=>w.type==="decimal"))===null||o===void 0?void 0:o.value,p=(a=c.find(w=>w.type==="group"))===null||a===void 0?void 0:a.value,_=c.filter(w=>!mg.has(w.type)).map(w=>gg(w.value)),x=d.flatMap(w=>w.filter(N=>!mg.has(N.type)).map(N=>gg(N.value))),y=[...new Set([..._,...x])].sort((w,N)=>N.length-w.length),E=y.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${y.join("|")}|[\\p{White_Space}]`,"gu"),A=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),P=new Map(A.map((w,N)=>[w,N])),D=new RegExp(`[${A.join("")}]`,"g");return{minusSign:h,plusSign:g,decimal:m,group:p,literals:E,numeral:D,index:w=>String(P.get(w))}}function fo(t,e,n){return t.replaceAll?t.replaceAll(e,n):t.split(e).join(n)}function gg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ty(t){const{disabled:e}=t,n=Ve(),i=px(),r=()=>window.clearTimeout(n.value),s=f=>{r(),!e.value&&(i.trigger(),n.value=window.setTimeout(()=>{s(60)},f))},o=()=>{s(400)},a=()=>{r()},l=Ve(!1),c=Te(()=>_s(t.target)),u=f=>{f.button!==0||l.value||(f.preventDefault(),l.value=!0,o())},d=()=>{l.value=!1,a()};return Li&&($s(c||window,"pointerdown",u),$s(window,"pointerup",d),$s(window,"pointercancel",d)),{isPressed:l,onTrigger:i.on}}function vg(t,e=Ve({})){return Uh(()=>new Qx(t.value,e.value))}function fT(t,e=Ve({})){return Uh(()=>new ey(t.value,e.value))}function _g(t,e,n){let i=t==="+"?e+n:e-n;if(e%1!==0||n%1!==0){const r=e.toString().split("."),s=n.toString().split("."),o=r[1]&&r[1].length||0,a=s[1]&&s[1].length||0,l=10**Math.max(o,a);e=Math.round(e*l),n=Math.round(n*l),i=t==="+"?e+n:e-n,i/=l}return i}const[jh,hT]=Hr("NumberFieldRoot");var pT=Fe({inheritAttrs:!1,__name:"NumberFieldRoot",props:{defaultValue:{type:Number,required:!1,default:void 0},modelValue:{type:[Number,null],required:!1},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1,default:1},stepSnapping:{type:Boolean,required:!1,default:!0},focusOnChange:{type:Boolean,required:!1,default:!0},formatOptions:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1},readonly:{type:Boolean,required:!1},disableWheelChange:{type:Boolean,required:!1},invertWheelChange:{type:Boolean,required:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,{disabled:r,readonly:s,disableWheelChange:o,invertWheelChange:a,min:l,max:c,step:u,stepSnapping:d,formatOptions:f,id:h,locale:g}=Dr(n),v=Mu(n,"modelValue",i,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{primitiveElement:m,currentElement:p}=Zs(),_=KM(g),x=yx(p),y=Ve(),E=Te(()=>!Sc(v.value)&&(J(v.value)===l.value||l.value&&!isNaN(v.value)?_g("-",v.value,u.value)!Sc(v.value)&&(J(v.value)===c.value||c.value&&!isNaN(v.value)?_g("+",v.value,u.value)>c.value:!1));function P(Y,pe=1){if(n.focusOnChange&&y.value?.focus(),n.disabled||n.readonly)return;const Ge=B.parse(y.value?.value??"");isNaN(Ge)?v.value=l.value??0:Y==="increase"?v.value=J(Ge+(u.value??1)*pe):v.value=J(Ge-(u.value??1)*pe)}function D(Y=1){P("increase",Y)}function S(Y=1){P("decrease",Y)}function w(Y){Y==="min"&&l.value!==void 0?v.value=J(l.value):Y==="max"&&c.value!==void 0&&(v.value=J(c.value))}const N=vg(_,f),B=fT(_,f),W=Te(()=>N.resolvedOptions().maximumFractionDigits>0?"decimal":"numeric"),Z=vg(_,f),X=Te(()=>Sc(v.value)||isNaN(v.value)?"":Z.format(v.value));function H(Y){return B.isValidPartialNumber(Y,l.value,c.value)}function k(Y){y.value&&(y.value.value=Y)}function J(Y){let pe;return u.value===void 0||isNaN(u.value)||!d.value?pe=Bh(Y,l.value,c.value):pe=RM(Y,l.value,c.value,u.value),pe=B.parse(N.format(pe)),pe}function ue(Y){const pe=B.parse(Y);return v.value=isNaN(pe)?void 0:J(pe),Y.length?(isNaN(pe),k(X.value)):k(Y)}return hT({modelValue:v,handleDecrease:S,handleIncrease:D,handleMinMaxValue:w,inputMode:W,inputEl:y,onInputElement:Y=>y.value=Y,textValue:X,readonly:s,validate:H,applyInputValue:ue,disabled:r,disableWheelChange:o,invertWheelChange:a,max:c,min:l,isDecreaseDisabled:E,isIncreaseDisabled:A,id:h}),(Y,pe)=>(me(),Be(M(Sn),Nt(Y.$attrs,{ref_key:"primitiveElement",ref:m,role:"group",as:Y.as,"as-child":Y.asChild,"data-disabled":M(r)?"":void 0,"data-readonly":M(s)?"":void 0}),{default:re(()=>[ot(Y.$slots,"default",{modelValue:M(v),textValue:X.value,readonly:M(s)}),M(x)&&Y.name?(me(),Be(M(Px),{key:0,type:"text",value:M(v),name:Y.name,disabled:M(r),readonly:M(s),required:Y.required},null,8,["value","name","disabled","readonly","required"])):ri("v-if",!0)]),_:3},16,["as","as-child","data-disabled","data-readonly"]))}}),mT=pT,gT=Fe({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=jh(),i=Te(()=>n.disabled?.value||n.readonly.value||e.disabled||n.isDecreaseDisabled.value),{primitiveElement:r,currentElement:s}=Zs(),{isPressed:o,onTrigger:a}=ty({target:s,disabled:i});return a(()=>{n.handleDecrease()}),(l,c)=>(me(),Be(M(Sn),Nt(e,{ref_key:"primitiveElement",ref:r,tabindex:"-1","aria-label":"Decrease",type:l.as==="button"?"button":void 0,style:{userSelect:M(o)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":M(o)?"true":void 0,onContextmenu:c[0]||(c[0]=ei(()=>{},["prevent"]))}),{default:re(()=>[ot(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),vT=gT,_T=Fe({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=jh(),i=Te(()=>n.disabled?.value||n.readonly.value||e.disabled||n.isIncreaseDisabled.value),{primitiveElement:r,currentElement:s}=Zs(),{isPressed:o,onTrigger:a}=ty({target:s,disabled:i});return a(()=>{n.handleIncrease()}),(l,c)=>(me(),Be(M(Sn),Nt(e,{ref_key:"primitiveElement",ref:r,tabindex:"-1","aria-label":"Increase",type:l.as==="button"?"button":void 0,style:{userSelect:M(o)?"none":void 0},disabled:i.value?"":void 0,"data-disabled":i.value?"":void 0,"data-pressed":M(o)?"true":void 0,onContextmenu:c[0]||(c[0]=ei(()=>{},["prevent"]))}),{default:re(()=>[ot(l.$slots,"default")]),_:3},16,["type","style","disabled","data-disabled","data-pressed"]))}}),xT=_T,yT=Fe({__name:"NumberFieldInput",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},setup(t){const e=t,{primitiveElement:n,currentElement:i}=Zs(),r=jh();function s(l){r.disableWheelChange.value||l.target===Ys()&&(Math.abs(l.deltaY)<=Math.abs(l.deltaX)||(l.preventDefault(),l.deltaY>0?r.invertWheelChange.value?r.handleDecrease():r.handleIncrease():l.deltaY<0&&(r.invertWheelChange.value?r.handleIncrease():r.handleDecrease())))}Ni(()=>{r.onInputElement(i.value)});const o=Ve(r.textValue.value);en(()=>r.textValue.value,()=>{o.value=r.textValue.value},{immediate:!0,deep:!0});function a(){requestAnimationFrame(()=>{o.value=r.textValue.value})}return(l,c)=>(me(),Be(M(Sn),Nt(e,{id:M(r).id.value,ref_key:"primitiveElement",ref:n,value:o.value,role:"spinbutton",type:"text",tabindex:"0",inputmode:M(r).inputMode.value,disabled:M(r).disabled.value?"":void 0,"data-disabled":M(r).disabled.value?"":void 0,readonly:M(r).readonly.value?"":void 0,"data-readonly":M(r).readonly.value?"":void 0,autocomplete:"off",autocorrect:"off",spellcheck:"false","aria-roledescription":"Number field","aria-valuenow":M(r).modelValue.value,"aria-valuemin":M(r).min.value,"aria-valuemax":M(r).max.value,onKeydown:[c[0]||(c[0]=Ts(ei(u=>M(r).handleIncrease(),["prevent"]),["up"])),c[1]||(c[1]=Ts(ei(u=>M(r).handleDecrease(),["prevent"]),["down"])),c[2]||(c[2]=Ts(ei(u=>M(r).handleIncrease(10),["prevent"]),["page-up"])),c[3]||(c[3]=Ts(ei(u=>M(r).handleDecrease(10),["prevent"]),["page-down"])),c[4]||(c[4]=Ts(ei(u=>M(r).handleMinMaxValue("min"),["prevent"]),["home"])),c[5]||(c[5]=Ts(ei(u=>M(r).handleMinMaxValue("max"),["prevent"]),["end"])),c[8]||(c[8]=Ts(u=>M(r).applyInputValue(u.target?.value),["enter"]))],onWheel:s,onBeforeinput:c[6]||(c[6]=u=>{const d=u.target;let f=d.value.slice(0,d.selectionStart??void 0)+(u.data??"")+d.value.slice(d.selectionEnd??void 0);M(r).validate(f)||u.preventDefault()}),onInput:c[7]||(c[7]=u=>{const d=u.target;o.value=d.value}),onChange:a,onBlur:c[9]||(c[9]=u=>M(r).applyInputValue(u.target?.value))}),{default:re(()=>[ot(l.$slots,"default")]),_:3},16,["id","value","inputmode","disabled","data-disabled","readonly","data-readonly","aria-valuenow","aria-valuemin","aria-valuemax"]))}}),bT=yT;const[Pu,ST]=Hr("TooltipProvider");var wT=Fe({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1},content:{type:Object,required:!1}},setup(t){const e=t,{delayDuration:n,skipDelayDuration:i,disableHoverableContent:r,disableClosingTrigger:s,ignoreNonKeyboardFocus:o,disabled:a,content:l}=Dr(e);sn();const c=Ve(!0),u=Ve(!1),{start:d,stop:f}=mx(()=>{c.value=!0},i,{immediate:!1});return ST({isOpenDelayed:c,delayDuration:n,onOpen(){f(),c.value=!1},onClose(){d()},isPointerInTransitRef:u,disableHoverableContent:r,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:o,content:l}),(h,g)=>ot(h.$slots,"default")}}),MT=wT;const ny="tooltip.open",[Ru,ET]=Hr("TooltipRoot");var TT=Fe({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(t,{emit:e}){const n=t,i=e;sn();const r=Pu(),s=Te(()=>n.disableHoverableContent??r.disableHoverableContent.value),o=Te(()=>n.disableClosingTrigger??r.disableClosingTrigger.value),a=Te(()=>n.disabled??r.disabled.value),l=Te(()=>n.delayDuration??r.delayDuration.value),c=Te(()=>n.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),u=Mu(n,"open",i,{defaultValue:n.defaultOpen,passive:n.open===void 0});en(u,x=>{r.onClose&&(x?(r.onOpen(),document.dispatchEvent(new CustomEvent(ny))):r.onClose())});const d=Ve(!1),f=Ve(),h=Te(()=>u.value?d.value?"delayed-open":"instant-open":"closed"),{start:g,stop:v}=mx(()=>{d.value=!0,u.value=!0},l,{immediate:!1});function m(){v(),d.value=!1,u.value=!0}function p(){v(),u.value=!1}function _(){g()}return ET({contentId:"",open:u,stateAttribute:h,trigger:f,onTriggerChange(x){f.value=x},onTriggerEnter(){r.isOpenDelayed.value?_():m()},onTriggerLeave(){s.value?p():v()},onOpen:m,onClose:p,disableHoverableContent:s,disableClosingTrigger:o,disabled:a,ignoreNonKeyboardFocus:c}),(x,y)=>(me(),Be(M(Dx),null,{default:re(()=>[ot(x.$slots,"default",{open:M(u)})]),_:3}))}}),AT=TT,CT=Fe({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=Ru(),s=Pu(),{forwardRef:o,currentElement:a}=sn(),l=Te(()=>n.ariaLabel||a.value?.textContent),c=Te(()=>{const{ariaLabel:u,...d}=n;return _x(d,s.content.value??{},{side:"top",sideOffset:0,align:"center",avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:"partial",hideWhenDetached:!1})});return Ni(()=>{$s(window,"scroll",u=>{u.target?.contains(r.trigger.value)&&r.onClose()},{capture:!0}),$s(window,ny,r.onClose)}),(u,d)=>(me(),Be(M(Ex),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:d[0]||(d[0]=f=>i("escapeKeyDown",f)),onPointerDownOutside:d[1]||(d[1]=f=>{M(r).disableClosingTrigger.value&&M(r).trigger.value?.contains(f.target)&&f.preventDefault(),i("pointerDownOutside",f)}),onFocusOutside:d[2]||(d[2]=ei(()=>{},["prevent"])),onDismiss:d[3]||(d[3]=f=>M(r).onClose())},{default:re(()=>[ie(M(Gx),Nt({ref:M(o),"data-state":M(r).stateAttribute.value},{...u.$attrs,...c.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:re(()=>[ot(u.$slots,"default"),ie(M(Cx),{id:M(r).contentId,role:"tooltip"},{default:re(()=>[Ht(Ei(l.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),iy=CT,PT=Fe({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(t){const n=dl(t),{forwardRef:i,currentElement:r}=sn(),{trigger:s,onClose:o}=Ru(),a=Pu(),{isPointerInTransit:l,onPointerExit:c}=kM(s,r);return a.isPointerInTransitRef=l,c(()=>{o()}),(u,d)=>(me(),Be(iy,Nt({ref:M(i)},M(n)),{default:re(()=>[ot(u.$slots,"default")]),_:3},16))}}),RT=PT,DT=Fe({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=Ru(),s=nr(n,i),{forwardRef:o}=sn();return(a,l)=>(me(),Be(M(wx),{present:a.forceMount||M(r).open.value},{default:re(()=>[(me(),Be(Ih(M(r).disableHoverableContent.value?iy:RT),Nt({ref:M(o)},M(s)),{default:re(()=>[ot(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),IT=DT,NT=Fe({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(t){const e=t;return(n,i)=>(me(),Be(M(Ax),vs(zr(e)),{default:re(()=>[ot(n.$slots,"default")]),_:3},16))}}),LT=NT,OT=Fe({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(t){const e=t,n=Ru(),i=Pu();n.contentId||=Hh(void 0,"reka-tooltip-content");const{forwardRef:r,currentElement:s}=sn(),o=Ve(!1),a=Ve(!1),l=Te(()=>n.disabled.value?{}:{click:v,focus:h,pointermove:d,pointerleave:f,pointerdown:u,blur:g});Ni(()=>{n.onTriggerChange(s.value)});function c(){setTimeout(()=>{o.value=!1},1)}function u(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),o.value=!0,document.addEventListener("pointerup",c,{once:!0})}function d(m){m.pointerType!=="touch"&&!a.value&&!i.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function f(){n.onTriggerLeave(),a.value=!1}function h(m){o.value||n.ignoreNonKeyboardFocus.value&&!m.target.matches?.(":focus-visible")||n.onOpen()}function g(){n.onClose()}function v(){n.disableClosingTrigger.value||n.onClose()}return(m,p)=>(me(),Be(M(Ix),{"as-child":"",reference:m.reference},{default:re(()=>[ie(M(Sn),Nt({ref:M(r),"aria-describedby":M(n).open.value?M(n).contentId:void 0,"data-state":M(n).stateAttribute.value,as:m.as,"as-child":e.asChild,"data-grace-area-trigger":""},ew(l.value)),{default:re(()=>[ot(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),FT=OT;function ry(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e{const n=new Array(t.length+e.length);for(let i=0;i({classGroupId:t,validator:e}),oy=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Yc="-",xg=[],BT="arbitrary..",zT=t=>{const e=HT(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return VT(o);const a=o.split(Yc),l=a[0]===""&&a.length>1?1:0;return ay(a,l,e)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=i[o],c=n[o];return l?c?UT(c,l):l:c||xg}return n[o]||xg}}},ay=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const c=ay(t,e+1,s);if(c)return c}const o=n.validators;if(o===null)return;const a=e===0?t.join(Yc):t.slice(e).join(Yc),l=o.length;for(let c=0;ct.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),i=e.slice(0,n);return i?BT+i:void 0})(),HT=t=>{const{theme:e,classGroups:n}=t;return GT(n,e)},GT=(t,e)=>{const n=oy();for(const i in t){const r=t[i];Qh(r,n,i,e)}return n},Qh=(t,e,n,i)=>{const r=t.length;for(let s=0;s{if(typeof t=="string"){qT(t,e,n);return}if(typeof t=="function"){XT(t,e,n,i);return}$T(t,e,n,i)},qT=(t,e,n)=>{const i=t===""?e:ly(e,t);i.classGroupId=n},XT=(t,e,n,i)=>{if(YT(t)){Qh(t(i),e,n,i);return}e.validators===null&&(e.validators=[]),e.validators.push(kT(n,t))},$T=(t,e,n,i)=>{const r=Object.entries(t),s=r.length;for(let o=0;o{let n=t;const i=e.split(Yc),r=i.length;for(let s=0;s"isThemeGetter"in t&&t.isThemeGetter===!0,JT=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),i=Object.create(null);const r=(s,o)=>{n[s]=o,e++,e>t&&(e=0,i=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=i[s])!==void 0)return r(s,o),o},set(s,o){s in n?n[s]=o:r(s,o)}}},xf="!",yg=":",KT=[],bg=(t,e,n,i,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:i,isExternal:r}),ZT=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=r=>{const s=[];let o=0,a=0,l=0,c;const u=r.length;for(let v=0;vl?c-l:void 0;return bg(s,h,f,g)};if(e){const r=e+yg,s=i;i=o=>o.startsWith(r)?s(o.slice(r.length)):bg(KT,!1,o,void 0,!0)}if(n){const r=i;i=s=>n({className:s,parseClassName:r})}return i},jT=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,i)=>{e.set(n,1e6+i)}),n=>{const i=[];let r=[];for(let s=0;s0&&(r.sort(),i.push(...r),r=[]),i.push(o)):r.push(o)}return r.length>0&&(r.sort(),i.push(...r)),i}},QT=t=>({cache:JT(t.cacheSize),parseClassName:ZT(t),sortModifiers:jT(t),...zT(t)}),eA=/\s+/,tA=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:s}=e,o=[],a=t.trim().split(eA);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let m=!!v,p=i(m?g.substring(0,v):g);if(!p){if(!m){l=u+(l.length>0?" "+l:l);continue}if(p=i(g),!p){l=u+(l.length>0?" "+l:l);continue}m=!1}const _=f.length===0?"":f.length===1?f[0]:s(f).join(":"),x=h?_+xf:_,y=x+p;if(o.indexOf(y)>-1)continue;o.push(y);const E=r(p,m);for(let A=0;A0?" "+l:l)}return l},nA=(...t)=>{let e=0,n,i,r="";for(;e{if(typeof t=="string")return t;let e,n="";for(let i=0;i{let n,i,r,s;const o=l=>{const c=e.reduce((u,d)=>d(u),t());return n=QT(c),i=n.cache.get,r=n.cache.set,s=a,a(l)},a=l=>{const c=i(l);if(c)return c;const u=tA(l,n);return r(l,u),u};return s=o,(...l)=>s(nA(...l))},rA=[],ln=t=>{const e=n=>n[t]||rA;return e.isThemeGetter=!0,e},uy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sA=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,oA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,lA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,cA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wr=t=>sA.test(t),vt=t=>!!t&&!Number.isNaN(Number(t)),qr=t=>!!t&&Number.isInteger(Number(t)),rd=t=>t.endsWith("%")&&vt(t.slice(0,-1)),cr=t=>oA.test(t),fy=()=>!0,dA=t=>aA.test(t)&&!lA.test(t),ep=()=>!1,fA=t=>cA.test(t),hA=t=>uA.test(t),pA=t=>!qe(t)&&!$e(t),mA=t=>xs(t,my,ep),qe=t=>uy.test(t),Cs=t=>xs(t,gy,dA),Sg=t=>xs(t,wA,vt),gA=t=>xs(t,_y,fy),vA=t=>xs(t,vy,ep),wg=t=>xs(t,hy,ep),_A=t=>xs(t,py,hA),Dl=t=>xs(t,xy,fA),$e=t=>dy.test(t),fa=t=>io(t,gy),xA=t=>io(t,vy),Mg=t=>io(t,hy),yA=t=>io(t,my),bA=t=>io(t,py),Il=t=>io(t,xy,!0),SA=t=>io(t,_y,!0),xs=(t,e,n)=>{const i=uy.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},io=(t,e,n=!1)=>{const i=dy.exec(t);return i?i[1]?e(i[1]):n:!1},hy=t=>t==="position"||t==="percentage",py=t=>t==="image"||t==="url",my=t=>t==="length"||t==="size"||t==="bg-size",gy=t=>t==="length",wA=t=>t==="number",vy=t=>t==="family-name",_y=t=>t==="number"||t==="weight",xy=t=>t==="shadow",MA=()=>{const t=ln("color"),e=ln("font"),n=ln("text"),i=ln("font-weight"),r=ln("tracking"),s=ln("leading"),o=ln("breakpoint"),a=ln("container"),l=ln("spacing"),c=ln("radius"),u=ln("shadow"),d=ln("inset-shadow"),f=ln("text-shadow"),h=ln("drop-shadow"),g=ln("blur"),v=ln("perspective"),m=ln("aspect"),p=ln("ease"),_=ln("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...y(),$e,qe],A=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],D=()=>[$e,qe,l],S=()=>[Wr,"full","auto",...D()],w=()=>[qr,"none","subgrid",$e,qe],N=()=>["auto",{span:["full",qr,$e,qe]},qr,$e,qe],B=()=>[qr,"auto",$e,qe],W=()=>["auto","min","max","fr",$e,qe],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...D()],k=()=>[Wr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],J=()=>[Wr,"screen","full","dvw","lvw","svw","min","max","fit",...D()],ue=()=>[Wr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],Y=()=>[t,$e,qe],pe=()=>[...y(),Mg,wg,{position:[$e,qe]}],Ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ze=()=>["auto","cover","contain",yA,mA,{size:[$e,qe]}],xt=()=>[rd,fa,Cs],at=()=>["","none","full",c,$e,qe],oe=()=>["",vt,fa,Cs],fe=()=>["solid","dashed","dotted","double"],Ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ne=()=>[vt,rd,Mg,wg],De=()=>["","none",g,$e,qe],mt=()=>["none",vt,$e,qe],L=()=>["none",vt,$e,qe],U=()=>[vt,$e,qe],O=()=>[Wr,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[cr],breakpoint:[cr],color:[fy],container:[cr],"drop-shadow":[cr],ease:["in","out","in-out"],font:[pA],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[cr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[cr],shadow:[cr],spacing:["px",vt],text:[cr],"text-shadow":[cr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Wr,qe,$e,m]}],container:["container"],columns:[{columns:[vt,qe,$e,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:S()}],"inset-x":[{"inset-x":S()}],"inset-y":[{"inset-y":S()}],start:[{"inset-s":S(),start:S()}],end:[{"inset-e":S(),end:S()}],"inset-bs":[{"inset-bs":S()}],"inset-be":[{"inset-be":S()}],top:[{top:S()}],right:[{right:S()}],bottom:[{bottom:S()}],left:[{left:S()}],visibility:["visible","invisible","collapse"],z:[{z:[qr,"auto",$e,qe]}],basis:[{basis:[Wr,"full","auto",a,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,Wr,"auto","initial","none",qe]}],grow:[{grow:["",vt,$e,qe]}],shrink:[{shrink:["",vt,$e,qe]}],order:[{order:[qr,"first","last","none",$e,qe]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":w()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:k()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[a,"screen",...k()]}],"min-w":[{"min-w":[a,"screen","none",...k()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...k()]}],h:[{h:["screen","lh",...k()]}],"min-h":[{"min-h":["screen","lh","none",...k()]}],"max-h":[{"max-h":["screen","lh",...k()]}],"font-size":[{text:["base",n,fa,Cs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,SA,gA]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rd,qe]}],"font-family":[{font:[xA,vA,e]}],"font-features":[{"font-features":[qe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,$e,qe]}],"line-clamp":[{"line-clamp":[vt,"none",$e,Sg]}],leading:[{leading:[s,...D()]}],"list-image":[{"list-image":["none",$e,qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",$e,Cs]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[vt,"auto",$e,qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e,qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e,qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:pe()}],"bg-repeat":[{bg:Ge()}],"bg-size":[{bg:Ze()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qr,$e,qe],radial:["",$e,qe],conic:[qr,$e,qe]},bA,_A]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:xt()}],"gradient-via-pos":[{via:xt()}],"gradient-to-pos":[{to:xt()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:at()}],"rounded-s":[{"rounded-s":at()}],"rounded-e":[{"rounded-e":at()}],"rounded-t":[{"rounded-t":at()}],"rounded-r":[{"rounded-r":at()}],"rounded-b":[{"rounded-b":at()}],"rounded-l":[{"rounded-l":at()}],"rounded-ss":[{"rounded-ss":at()}],"rounded-se":[{"rounded-se":at()}],"rounded-ee":[{"rounded-ee":at()}],"rounded-es":[{"rounded-es":at()}],"rounded-tl":[{"rounded-tl":at()}],"rounded-tr":[{"rounded-tr":at()}],"rounded-br":[{"rounded-br":at()}],"rounded-bl":[{"rounded-bl":at()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-bs":[{"border-bs":Y()}],"border-color-be":[{"border-be":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,$e,qe]}],"outline-w":[{outline:["",vt,fa,Cs]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",u,Il,Dl]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",d,Il,Dl]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[vt,Cs]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",f,Il,Dl]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[vt,$e,qe]}],"mix-blend":[{"mix-blend":[...Ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ie()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[vt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ne()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":Ne()}],"mask-image-t-to-pos":[{"mask-t-to":Ne()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":Ne()}],"mask-image-r-to-pos":[{"mask-r-to":Ne()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":Ne()}],"mask-image-b-to-pos":[{"mask-b-to":Ne()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":Ne()}],"mask-image-l-to-pos":[{"mask-l-to":Ne()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":Ne()}],"mask-image-x-to-pos":[{"mask-x-to":Ne()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":Ne()}],"mask-image-y-to-pos":[{"mask-y-to":Ne()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[$e,qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ne()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ne()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:pe()}],"mask-repeat":[{mask:Ge()}],"mask-size":[{mask:Ze()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,qe]}],filter:[{filter:["","none",$e,qe]}],blur:[{blur:De()}],brightness:[{brightness:[vt,$e,qe]}],contrast:[{contrast:[vt,$e,qe]}],"drop-shadow":[{"drop-shadow":["","none",h,Il,Dl]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",vt,$e,qe]}],"hue-rotate":[{"hue-rotate":[vt,$e,qe]}],invert:[{invert:["",vt,$e,qe]}],saturate:[{saturate:[vt,$e,qe]}],sepia:[{sepia:["",vt,$e,qe]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,qe]}],"backdrop-blur":[{"backdrop-blur":De()}],"backdrop-brightness":[{"backdrop-brightness":[vt,$e,qe]}],"backdrop-contrast":[{"backdrop-contrast":[vt,$e,qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,$e,qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,$e,qe]}],"backdrop-invert":[{"backdrop-invert":["",vt,$e,qe]}],"backdrop-opacity":[{"backdrop-opacity":[vt,$e,qe]}],"backdrop-saturate":[{"backdrop-saturate":[vt,$e,qe]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,$e,qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$e,qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",$e,qe]}],ease:[{ease:["linear","initial",p,$e,qe]}],delay:[{delay:[vt,$e,qe]}],animate:[{animate:["none",_,$e,qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,$e,qe]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:mt()}],"rotate-x":[{"rotate-x":mt()}],"rotate-y":[{"rotate-y":mt()}],"rotate-z":[{"rotate-z":mt()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:U()}],"skew-x":[{"skew-x":U()}],"skew-y":[{"skew-y":U()}],transform:[{transform:[$e,qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:O()}],"translate-x":[{"translate-x":O()}],"translate-y":[{"translate-y":O()}],"translate-z":[{"translate-z":O()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e,qe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e,qe]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[vt,fa,Cs,Sg]}],stroke:[{stroke:["none",...Y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},EA=iA(MA);function rr(...t){return EA(sy(t))}const yy=Fe({__name:"Slider",props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},orientation:{},dir:{},inverted:{type:Boolean},min:{},max:{},step:{},minStepsBetweenThumbs:{},thumbAlignment:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue","valueCommit"],setup(t,{emit:e}){const n=t,i=e,r=to(n,"class"),s=nr(r,i);return(o,a)=>(me(),Be(M(OE),Nt({"data-slot":"slider",class:M(rr)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",n.class)},M(s)),{default:re(({modelValue:l})=>[ie(M(WE),{"data-slot":"slider-track",class:"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"},{default:re(()=>[ie(M(kE),{"data-slot":"slider-range",class:"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})]),_:1}),(me(!0),Mt(nn,null,ll(l,(c,u)=>(me(),Be(M(HE),{key:u,"data-slot":"slider-thumb",class:"bg-white border-primary ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"}))),128))]),_:1},16,["class"]))}}),wi=Yn({title:"Object Infos",isVisible:!1,data:null}),wc=Yn({title:"Sidebar Infos",isVisible:!1,data:null}),_n=Yn({value:!0}),Mr=Yn({value:"translate"}),by=Yn({value:!1}),je=Yn({id:"",isVisible:!1,currentTime:[0],totalTime:10,step:.01,data:null,isPlaying:!1,isLooping:!1,speedMultiplier:1,cameraMode:"free"});function TA(){let t=0,e=0;for(let i=0;i<28;i+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>4,(n&128)==0)return this.assertBounds(),[t,e];for(let i=3;i<=31;i+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>>s,a=!(!(o>>>7)&&e==0),l=(a?o|128:o)&255;if(n.push(l),!a)return}const i=t>>>28&15|(e&7)<<4,r=e>>3!=0;if(n.push((r?i|128:i)&255),!!r){for(let s=3;s<31;s=s+7){const o=e>>>s,a=!!(o>>>7),l=(a?o|128:o)&255;if(n.push(l),!a)return}n.push(e>>>31&1)}}const Mc=4294967296;function Eg(t){const e=t[0]==="-";e&&(t=t.slice(1));const n=1e6;let i=0,r=0;function s(o,a){const l=Number(t.slice(o,a));r*=n,i=i*n+l,i>=Mc&&(r=r+(i/Mc|0),i=i%Mc)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?wy(i,r):tp(i,r)}function AA(t,e){let n=tp(t,e);const i=n.hi&2147483648;i&&(n=wy(n.lo,n.hi));const r=Sy(n.lo,n.hi);return i?"-"+r:r}function Sy(t,e){if({lo:t,hi:e}=CA(t,e),e<=2097151)return String(Mc*e+t);const n=t&16777215,i=(t>>>24|e<<8)&16777215,r=e>>16&65535;let s=n+i*6777216+r*6710656,o=i+r*8147497,a=r*2;const l=1e7;return s>=l&&(o+=Math.floor(s/l),s%=l),o>=l&&(a+=Math.floor(o/l),o%=l),a.toString()+Tg(o)+Tg(s)}function CA(t,e){return{lo:t>>>0,hi:e>>>0}}function tp(t,e){return{lo:t|0,hi:e|0}}function wy(t,e){return e=~e,t?t=~t+1:e+=1,tp(t,e)}const Tg=t=>{const e=String(t);return"0000000".slice(e.length)+e};function Ag(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let n=0;n<9;n++)e.push(t&127|128),t=t>>7;e.push(1)}}function PA(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let n=5;(t&128)!==0&&n<10;n++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var Cg={};const qi=RA();function RA(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof Cg!="object"||Cg.BUF_BIGINT_DISABLE!=="1")){const n=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),r=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(o){const a=typeof o=="bigint"?o:BigInt(o);if(a>i||as||a>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Dg(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return ad(e),Ag(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.encodeUtf8(e);return this.uint32(n.byteLength),this.raw(n)}float(e){FA(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){Dg(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){ad(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return ad(e),e=(e<<1^e>>31)>>>0,Ag(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=qi.enc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=qi.uEnc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}int64(e){let n=qi.enc(e);return sd(n.lo,n.hi,this.buf),this}sint64(e){const n=qi.enc(e),i=n.hi>>31,r=n.lo<<1^i,s=(n.hi<<1|n.lo>>>31)^i;return sd(r,s,this.buf),this}uint64(e){const n=qi.uEnc(e);return sd(n.lo,n.hi,this.buf),this}}class Se{constructor(e,n=My().decodeUtf8){this.decodeUtf8=n,this.varint64=TA,this.uint32=PA,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),n=e>>>3,i=e&7;if(n<=0||i<0||i>5)throw new Error("illegal tag: field no "+n+" wire type "+i);return[n,i]}skip(e,n){let i=this.pos;switch(e){case ns.Varint:for(;this.buf[this.pos++]&128;);break;case ns.Bit64:this.pos+=4;case ns.Bit32:this.pos+=4;break;case ns.LengthDelimited:let r=this.uint32();this.pos+=r;break;case ns.StartGroup:for(;;){const[s,o]=this.tag();if(o===ns.EndGroup){if(n!==void 0&&s!==n)throw new Error("invalid end group tag");break}this.skip(o,s)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return qi.dec(...this.varint64())}uint64(){return qi.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),i=-(e&1);return e=(e>>>1|(n&1)<<31)^i,n=n>>>1^i,qi.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return qi.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return qi.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.decodeUtf8(this.bytes())}}function ad(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>LA||tNA||t<0)throw new Error("invalid uint32: "+t)}function FA(t){if(typeof t=="string"){const e=t;if(t=Number(t),Number.isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>DA||t>>3){case 1:{if(s!==10)break;r.typeUrl=n.string();continue}case 2:{if(s!==18)break;r.value=n.bytes();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{typeUrl:ld(t.typeUrl)?globalThis.String(t.typeUrl):ld(t.type_url)?globalThis.String(t.type_url):"",value:ld(t.value)?UA(t.value):new Uint8Array(0)}},toJSON(t){const e={};return t.typeUrl!==""&&(e.typeUrl=t.typeUrl),t.value.length!==0&&(e.value=kA(t.value)),e},create(t){return Po.fromPartial(t??{})},fromPartial(t){const e=Ig();return e.typeUrl=t.typeUrl??"",e.value=t.value??new Uint8Array(0),e}};function UA(t){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(t,"base64"));{const e=globalThis.atob(t),n=new Uint8Array(e.length);for(let i=0;i{e.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(e.join(""))}}function ld(t){return t!=null}function Ng(t){switch(t){case 0:case"NULL_VALUE":return 0;default:return-1}}function BA(t){return t===0?"NULL_VALUE":"UNRECOGNIZED"}function cd(){return{fields:{}}}const Ta={encode(t,e=new ft){return globalThis.Object.entries(t.fields).forEach(([n,i])=>{i!==void 0&&yf.encode({key:n,value:i},e.uint32(10).fork()).join()}),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=cd();for(;n.pos>>3){case 1:{if(s!==10)break;const o=yf.decode(n,n.uint32());o.value!==void 0&&(r.fields[o.key]=o.value);continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{fields:bf(t.fields)?globalThis.Object.entries(t.fields).reduce((e,[n,i])=>(e[n]=i,e),{}):{}}},toJSON(t){const e={};if(t.fields){const n=globalThis.Object.entries(t.fields);n.length>0&&(e.fields={},n.forEach(([i,r])=>{e.fields[i]=r}))}return e},create(t){return Ta.fromPartial(t??{})},fromPartial(t){const e=cd();return e.fields=globalThis.Object.entries(t.fields??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=r),n),{}),e},wrap(t){const e=cd();if(t!==void 0)for(const n of globalThis.Object.keys(t))e.fields[n]=t[n];return e},unwrap(t){const e={};if(t.fields)for(const n of globalThis.Object.keys(t.fields))e[n]=t.fields[n];return e}};function Lg(){return{key:"",value:void 0}}const yf={encode(t,e=new ft){return t.key!==""&&e.uint32(10).string(t.key),t.value!==void 0&&si.encode(si.wrap(t.value),e.uint32(18).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Lg();for(;n.pos>>3){case 1:{if(s!==10)break;r.key=n.string();continue}case 2:{if(s!==18)break;r.value=si.unwrap(si.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{key:Hi(t.key)?globalThis.String(t.key):"",value:Hi(t?.value)?t.value:void 0}},toJSON(t){const e={};return t.key!==""&&(e.key=t.key),t.value!==void 0&&(e.value=t.value),e},create(t){return yf.fromPartial(t??{})},fromPartial(t){const e=Lg();return e.key=t.key??"",e.value=t.value??void 0,e}};function ud(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}const si={encode(t,e=new ft){return t.nullValue!==void 0&&e.uint32(8).int32(t.nullValue),t.numberValue!==void 0&&e.uint32(17).double(t.numberValue),t.stringValue!==void 0&&e.uint32(26).string(t.stringValue),t.boolValue!==void 0&&e.uint32(32).bool(t.boolValue),t.structValue!==void 0&&Ta.encode(Ta.wrap(t.structValue),e.uint32(42).fork()).join(),t.listValue!==void 0&&Aa.encode(Aa.wrap(t.listValue),e.uint32(50).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=ud();for(;n.pos>>3){case 1:{if(s!==8)break;r.nullValue=n.int32();continue}case 2:{if(s!==17)break;r.numberValue=n.double();continue}case 3:{if(s!==26)break;r.stringValue=n.string();continue}case 4:{if(s!==32)break;r.boolValue=n.bool();continue}case 5:{if(s!==42)break;r.structValue=Ta.unwrap(Ta.decode(n,n.uint32()));continue}case 6:{if(s!==50)break;r.listValue=Aa.unwrap(Aa.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{nullValue:Hi(t.nullValue)?Ng(t.nullValue):Hi(t.null_value)?Ng(t.null_value):void 0,numberValue:Hi(t.numberValue)?globalThis.Number(t.numberValue):Hi(t.number_value)?globalThis.Number(t.number_value):void 0,stringValue:Hi(t.stringValue)?globalThis.String(t.stringValue):Hi(t.string_value)?globalThis.String(t.string_value):void 0,boolValue:Hi(t.boolValue)?globalThis.Boolean(t.boolValue):Hi(t.bool_value)?globalThis.Boolean(t.bool_value):void 0,structValue:bf(t.structValue)?t.structValue:bf(t.struct_value)?t.struct_value:void 0,listValue:globalThis.Array.isArray(t.listValue)?[...t.listValue]:globalThis.Array.isArray(t.list_value)?[...t.list_value]:void 0}},toJSON(t){const e={};return t.nullValue!==void 0&&(e.nullValue=BA(t.nullValue)),t.numberValue!==void 0&&(e.numberValue=t.numberValue),t.stringValue!==void 0&&(e.stringValue=t.stringValue),t.boolValue!==void 0&&(e.boolValue=t.boolValue),t.structValue!==void 0&&(e.structValue=t.structValue),t.listValue!==void 0&&(e.listValue=t.listValue),e},create(t){return si.fromPartial(t??{})},fromPartial(t){const e=ud();return e.nullValue=t.nullValue??void 0,e.numberValue=t.numberValue??void 0,e.stringValue=t.stringValue??void 0,e.boolValue=t.boolValue??void 0,e.structValue=t.structValue??void 0,e.listValue=t.listValue??void 0,e},wrap(t){const e=ud();if(t===null)e.nullValue=0;else if(typeof t=="boolean")e.boolValue=t;else if(typeof t=="number")e.numberValue=t;else if(typeof t=="string")e.stringValue=t;else if(globalThis.Array.isArray(t))e.listValue=t;else if(typeof t=="object")e.structValue=t;else if(typeof t<"u")throw new globalThis.Error("Unsupported any value type: "+typeof t);return e},unwrap(t){if(t.stringValue!==void 0)return t.stringValue;if(t?.numberValue!==void 0)return t.numberValue;if(t?.boolValue!==void 0)return t.boolValue;if(t?.structValue!==void 0)return t.structValue;if(t?.listValue!==void 0)return t.listValue;if(t?.nullValue!==void 0)return null}};function dd(){return{values:[]}}const Aa={encode(t,e=new ft){for(const n of t.values)si.encode(si.wrap(n),e.uint32(10).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=dd();for(;n.pos>>3){case 1:{if(s!==10)break;r.values.push(si.unwrap(si.decode(n,n.uint32())));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{values:globalThis.Array.isArray(t?.values)?[...t.values]:[]}},toJSON(t){const e={};return t.values?.length&&(e.values=t.values),e},create(t){return Aa.fromPartial(t??{})},fromPartial(t){const e=dd();return e.values=t.values?.map(n=>n)||[],e},wrap(t){const e=dd();return e.values=t??[],e},unwrap(t){return t?.hasOwnProperty("values")&&globalThis.Array.isArray(t.values)?t.values:t}};function bf(t){return typeof t=="object"&&t!==null}function Hi(t){return t!=null}function Og(){return{message:void 0,value:void 0,fallback:void 0}}const Xn={encode(t,e=new ft){return t.message!==void 0&&Po.encode(t.message,e.uint32(10).fork()).join(),t.value!==void 0&&si.encode(si.wrap(t.value),e.uint32(18).fork()).join(),t.fallback!==void 0&&Ro.encode(t.fallback,e.uint32(26).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Og();for(;n.pos>>3){case 1:{if(s!==10)break;r.message=Po.decode(n,n.uint32());continue}case 2:{if(s!==18)break;r.value=si.unwrap(si.decode(n,n.uint32()));continue}case 3:{if(s!==26)break;r.fallback=Ro.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{message:fs(t.message)?Po.fromJSON(t.message):void 0,value:fs(t?.value)?t.value:void 0,fallback:fs(t.fallback)?Ro.fromJSON(t.fallback):void 0}},toJSON(t){const e={};return t.message!==void 0&&(e.message=Po.toJSON(t.message)),t.value!==void 0&&(e.value=t.value),t.fallback!==void 0&&(e.fallback=Ro.toJSON(t.fallback)),e},create(t){return Xn.fromPartial(t??{})},fromPartial(t){const e=Og();return e.message=t.message!==void 0&&t.message!==null?Po.fromPartial(t.message):void 0,e.value=t.value??void 0,e.fallback=t.fallback!==void 0&&t.fallback!==null?Ro.fromPartial(t.fallback):void 0,e}};function Fg(){return{data:void 0}}const Ro={encode(t,e=new ft){return t.data!==void 0&&is.encode(t.data,e.uint32(10).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Fg();for(;n.pos>>3){case 1:{if(s!==10)break;r.data=is.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{data:fs(t.data)?is.fromJSON(t.data):void 0}},toJSON(t){const e={};return t.data!==void 0&&(e.data=is.toJSON(t.data)),e},create(t){return Ro.fromPartial(t??{})},fromPartial(t){const e=Fg();return e.data=t.data!==void 0&&t.data!==null?is.fromPartial(t.data):void 0,e}};function Ug(){return{items:{}}}const is={encode(t,e=new ft){return globalThis.Object.entries(t.items).forEach(([n,i])=>{Sf.encode({key:n,value:i},e.uint32(10).fork()).join()}),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Ug();for(;n.pos>>3){case 1:{if(s!==10)break;const o=Sf.decode(n,n.uint32());o.value!==void 0&&(r.items[o.key]=o.value);continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{items:zA(t.items)?globalThis.Object.entries(t.items).reduce((e,[n,i])=>(e[n]=Xn.fromJSON(i),e),{}):{}}},toJSON(t){const e={};if(t.items){const n=globalThis.Object.entries(t.items);n.length>0&&(e.items={},n.forEach(([i,r])=>{e.items[i]=Xn.toJSON(r)}))}return e},create(t){return is.fromPartial(t??{})},fromPartial(t){const e=Ug();return e.items=globalThis.Object.entries(t.items??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=Xn.fromPartial(r)),n),{}),e}};function kg(){return{key:"",value:void 0}}const Sf={encode(t,e=new ft){return t.key!==""&&e.uint32(10).string(t.key),t.value!==void 0&&Xn.encode(t.value,e.uint32(18).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=kg();for(;n.pos>>3){case 1:{if(s!==10)break;r.key=n.string();continue}case 2:{if(s!==18)break;r.value=Xn.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{key:fs(t.key)?globalThis.String(t.key):"",value:fs(t.value)?Xn.fromJSON(t.value):void 0}},toJSON(t){const e={};return t.key!==""&&(e.key=t.key),t.value!==void 0&&(e.value=Xn.toJSON(t.value)),e},create(t){return Sf.fromPartial(t??{})},fromPartial(t){const e=kg();return e.key=t.key??"",e.value=t.value!==void 0&&t.value!==null?Xn.fromPartial(t.value):void 0,e}};function Bg(){return{data:void 0,version:void 0}}const Ey={encode(t,e=new ft){return t.data!==void 0&&Xn.encode(t.data,e.uint32(10).fork()).join(),t.version!==void 0&&e.uint32(18).string(t.version),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Bg();for(;n.pos>>3){case 1:{if(s!==10)break;r.data=Xn.decode(n,n.uint32());continue}case 2:{if(s!==18)break;r.version=n.string();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{data:fs(t.data)?Xn.fromJSON(t.data):void 0,version:fs(t.version)?globalThis.String(t.version):void 0}},toJSON(t){const e={};return t.data!==void 0&&(e.data=Xn.toJSON(t.data)),t.version!==void 0&&(e.version=t.version),e},create(t){return Ey.fromPartial(t??{})},fromPartial(t){const e=Bg();return e.data=t.data!==void 0&&t.data!==null?Xn.fromPartial(t.data):void 0,e.version=t.version??void 0,e}};function zA(t){return typeof t=="object"&&t!==null}function fs(t){return t!=null}function zg(){return{guid:"",name:"",x:0,y:0,z:0}}const Je={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.x!==0&&e.uint32(29).float(t.x),t.y!==0&&e.uint32(37).float(t.y),t.z!==0&&e.uint32(45).float(t.z),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=zg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.x=n.float();continue}case 4:{if(s!==37)break;r.y=n.float();continue}case 5:{if(s!==45)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",x:de(t.x)?globalThis.Number(t.x):0,y:de(t.y)?globalThis.Number(t.y):0,z:de(t.z)?globalThis.Number(t.z):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return Je.fromPartial(t??{})},fromPartial(t){const e=zg();return e.guid=t.guid??"",e.name=t.name??"",e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function Vg(){return{guid:"",name:"",x:0,y:0,z:0}}const It={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.x!==0&&e.uint32(29).float(t.x),t.y!==0&&e.uint32(37).float(t.y),t.z!==0&&e.uint32(45).float(t.z),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Vg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.x=n.float();continue}case 4:{if(s!==37)break;r.y=n.float();continue}case 5:{if(s!==45)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",x:de(t.x)?globalThis.Number(t.x):0,y:de(t.y)?globalThis.Number(t.y):0,z:de(t.z)?globalThis.Number(t.z):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return It.fromPartial(t??{})},fromPartial(t){const e=Vg();return e.guid=t.guid??"",e.name=t.name??"",e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function Hg(){return{guid:"",name:"",point:void 0,xaxis:void 0,yaxis:void 0}}const Qe={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.point!==void 0&&Je.encode(t.point,e.uint32(26).fork()).join(),t.xaxis!==void 0&&It.encode(t.xaxis,e.uint32(34).fork()).join(),t.yaxis!==void 0&&It.encode(t.yaxis,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Hg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.point=Je.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.xaxis=It.decode(n,n.uint32());continue}case 5:{if(s!==42)break;r.yaxis=It.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",point:de(t.point)?Je.fromJSON(t.point):void 0,xaxis:de(t.xaxis)?It.fromJSON(t.xaxis):void 0,yaxis:de(t.yaxis)?It.fromJSON(t.yaxis):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.point!==void 0&&(e.point=Je.toJSON(t.point)),t.xaxis!==void 0&&(e.xaxis=It.toJSON(t.xaxis)),t.yaxis!==void 0&&(e.yaxis=It.toJSON(t.yaxis)),e},create(t){return Qe.fromPartial(t??{})},fromPartial(t){const e=Hg();return e.guid=t.guid??"",e.name=t.name??"",e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e.xaxis=t.xaxis!==void 0&&t.xaxis!==null?It.fromPartial(t.xaxis):void 0,e.yaxis=t.yaxis!==void 0&&t.yaxis!==null?It.fromPartial(t.yaxis):void 0,e}};function Gg(){return{guid:"",name:"",point:void 0,normal:void 0}}const np={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.point!==void 0&&Je.encode(t.point,e.uint32(26).fork()).join(),t.normal!==void 0&&It.encode(t.normal,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Gg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.point=Je.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.normal=It.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",point:de(t.point)?Je.fromJSON(t.point):void 0,normal:de(t.normal)?It.fromJSON(t.normal):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.point!==void 0&&(e.point=Je.toJSON(t.point)),t.normal!==void 0&&(e.normal=It.toJSON(t.normal)),e},create(t){return np.fromPartial(t??{})},fromPartial(t){const e=Gg();return e.guid=t.guid??"",e.name=t.name??"",e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e.normal=t.normal!==void 0&&t.normal!==null?It.fromPartial(t.normal):void 0,e}};function Wg(){return{guid:"",name:"",w:0,x:0,y:0,z:0}}const ip={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.w!==0&&e.uint32(29).float(t.w),t.x!==0&&e.uint32(37).float(t.x),t.y!==0&&e.uint32(45).float(t.y),t.z!==0&&e.uint32(53).float(t.z),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Wg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.w=n.float();continue}case 4:{if(s!==37)break;r.x=n.float();continue}case 5:{if(s!==45)break;r.y=n.float();continue}case 6:{if(s!==53)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",w:de(t.w)?globalThis.Number(t.w):0,x:de(t.x)?globalThis.Number(t.x):0,y:de(t.y)?globalThis.Number(t.y):0,z:de(t.z)?globalThis.Number(t.z):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.w!==0&&(e.w=t.w),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return ip.fromPartial(t??{})},fromPartial(t){const e=Wg();return e.guid=t.guid??"",e.name=t.name??"",e.w=t.w??0,e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function qg(){return{guid:"",name:"",start:void 0,end:void 0}}const rp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.start!==void 0&&Je.encode(t.start,e.uint32(26).fork()).join(),t.end!==void 0&&Je.encode(t.end,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=qg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.start=Je.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.end=Je.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",start:de(t.start)?Je.fromJSON(t.start):void 0,end:de(t.end)?Je.fromJSON(t.end):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.start!==void 0&&(e.start=Je.toJSON(t.start)),t.end!==void 0&&(e.end=Je.toJSON(t.end)),e},create(t){return rp.fromPartial(t??{})},fromPartial(t){const e=qg();return e.guid=t.guid??"",e.name=t.name??"",e.start=t.start!==void 0&&t.start!==null?Je.fromPartial(t.start):void 0,e.end=t.end!==void 0&&t.end!==null?Je.fromPartial(t.end):void 0,e}};function Xg(){return{guid:"",name:"",radius:0,frame:void 0}}const rs={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Xg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==34)break;r.frame=Qe.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",radius:de(t.radius)?globalThis.Number(t.radius):0,frame:de(t.frame)?Qe.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),e},create(t){return rs.fromPartial(t??{})},fromPartial(t){const e=Xg();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e}};function $g(){return{guid:"",name:"",circle:void 0,startAngle:0,endAngle:0}}const sp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.circle!==void 0&&rs.encode(t.circle,e.uint32(26).fork()).join(),t.startAngle!==0&&e.uint32(37).float(t.startAngle),t.endAngle!==0&&e.uint32(45).float(t.endAngle),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=$g();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.circle=rs.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.startAngle=n.float();continue}case 5:{if(s!==45)break;r.endAngle=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",circle:de(t.circle)?rs.fromJSON(t.circle):void 0,startAngle:de(t.startAngle)?globalThis.Number(t.startAngle):de(t.start_angle)?globalThis.Number(t.start_angle):0,endAngle:de(t.endAngle)?globalThis.Number(t.endAngle):de(t.end_angle)?globalThis.Number(t.end_angle):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.circle!==void 0&&(e.circle=rs.toJSON(t.circle)),t.startAngle!==0&&(e.startAngle=t.startAngle),t.endAngle!==0&&(e.endAngle=t.endAngle),e},create(t){return sp.fromPartial(t??{})},fromPartial(t){const e=$g();return e.guid=t.guid??"",e.name=t.name??"",e.circle=t.circle!==void 0&&t.circle!==null?rs.fromPartial(t.circle):void 0,e.startAngle=t.startAngle??0,e.endAngle=t.endAngle??0,e}};function Yg(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const op={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.major!==0&&e.uint32(29).float(t.major),t.minor!==0&&e.uint32(37).float(t.minor),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Yg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.major=n.float();continue}case 4:{if(s!==37)break;r.minor=n.float();continue}case 5:{if(s!==42)break;r.frame=Qe.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",major:de(t.major)?globalThis.Number(t.major):0,minor:de(t.minor)?globalThis.Number(t.minor):0,frame:de(t.frame)?Qe.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.major!==0&&(e.major=t.major),t.minor!==0&&(e.minor=t.minor),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),e},create(t){return op.fromPartial(t??{})},fromPartial(t){const e=Yg();return e.guid=t.guid??"",e.name=t.name??"",e.major=t.major??0,e.minor=t.minor??0,e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e}};function Jg(){return{guid:"",name:"",focal:0,frame:void 0}}const ap={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.focal!==0&&e.uint32(29).float(t.focal),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Jg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.focal=n.float();continue}case 4:{if(s!==34)break;r.frame=Qe.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",focal:de(t.focal)?globalThis.Number(t.focal):0,frame:de(t.frame)?Qe.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.focal!==0&&(e.focal=t.focal),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),e},create(t){return ap.fromPartial(t??{})},fromPartial(t){const e=Jg();return e.guid=t.guid??"",e.name=t.name??"",e.focal=t.focal??0,e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e}};function Kg(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const lp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.major!==0&&e.uint32(29).float(t.major),t.minor!==0&&e.uint32(37).float(t.minor),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Kg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.major=n.float();continue}case 4:{if(s!==37)break;r.minor=n.float();continue}case 5:{if(s!==42)break;r.frame=Qe.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",major:de(t.major)?globalThis.Number(t.major):0,minor:de(t.minor)?globalThis.Number(t.minor):0,frame:de(t.frame)?Qe.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.major!==0&&(e.major=t.major),t.minor!==0&&(e.minor=t.minor),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),e},create(t){return lp.fromPartial(t??{})},fromPartial(t){const e=Kg();return e.guid=t.guid??"",e.name=t.name??"",e.major=t.major??0,e.minor=t.minor??0,e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e}};function Zg(){return{guid:"",name:"",points:[],degree:0}}const cp={encode(t,e=new ft){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(const n of t.points)Je.encode(n,e.uint32(26).fork()).join();return t.degree!==0&&e.uint32(32).int32(t.degree),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Zg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Je.decode(n,n.uint32()));continue}case 4:{if(s!==32)break;r.degree=n.int32();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[],degree:de(t.degree)?globalThis.Number(t.degree):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),t.degree!==0&&(e.degree=Math.round(t.degree)),e},create(t){return cp.fromPartial(t??{})},fromPartial(t){const e=Zg();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e.degree=t.degree??0,e}};function jg(){return{guid:"",name:"",points:[]}}const up={encode(t,e=new ft){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(const n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=jg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Je.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return up.fromPartial(t??{})},fromPartial(t){const e=jg();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function Qg(){return{guid:"",name:"",points:[]}}const dp={encode(t,e=new ft){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(const n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Qg();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Je.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return dp.fromPartial(t??{})},fromPartial(t){const e=Qg();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function e0(){return{guid:"",name:"",frame:void 0,xsize:0,ysize:0,zsize:0}}const fp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(26).fork()).join(),t.xsize!==0&&e.uint32(37).float(t.xsize),t.ysize!==0&&e.uint32(45).float(t.ysize),t.zsize!==0&&e.uint32(53).float(t.zsize),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=e0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.frame=Qe.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.xsize=n.float();continue}case 5:{if(s!==45)break;r.ysize=n.float();continue}case 6:{if(s!==53)break;r.zsize=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",frame:de(t.frame)?Qe.fromJSON(t.frame):void 0,xsize:de(t.xsize)?globalThis.Number(t.xsize):0,ysize:de(t.ysize)?globalThis.Number(t.ysize):0,zsize:de(t.zsize)?globalThis.Number(t.zsize):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),t.xsize!==0&&(e.xsize=t.xsize),t.ysize!==0&&(e.ysize=t.ysize),t.zsize!==0&&(e.zsize=t.zsize),e},create(t){return fp.fromPartial(t??{})},fromPartial(t){const e=e0();return e.guid=t.guid??"",e.name=t.name??"",e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e.xsize=t.xsize??0,e.ysize=t.ysize??0,e.zsize=t.zsize??0,e}};function t0(){return{guid:"",name:"",radius:0,frame:void 0}}const hp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=t0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==34)break;r.frame=Qe.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",radius:de(t.radius)?globalThis.Number(t.radius):0,frame:de(t.frame)?Qe.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),e},create(t){return hp.fromPartial(t??{})},fromPartial(t){const e=t0();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e}};function n0(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const pp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=n0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Qe.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",radius:de(t.radius)?globalThis.Number(t.radius):0,height:de(t.height)?globalThis.Number(t.height):0,frame:de(t.frame)?Qe.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),e},create(t){return pp.fromPartial(t??{})},fromPartial(t){const e=n0();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e}};function i0(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const mp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=i0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Qe.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",radius:de(t.radius)?globalThis.Number(t.radius):0,height:de(t.height)?globalThis.Number(t.height):0,frame:de(t.frame)?Qe.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),e},create(t){return mp.fromPartial(t??{})},fromPartial(t){const e=i0();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e}};function r0(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const gp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=r0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Qe.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",radius:de(t.radius)?globalThis.Number(t.radius):0,height:de(t.height)?globalThis.Number(t.height):0,frame:de(t.frame)?Qe.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),e},create(t){return gp.fromPartial(t??{})},fromPartial(t){const e=r0();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e}};function s0(){return{guid:"",name:"",radiusAxis:0,radiusPipe:0,frame:void 0}}const vp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radiusAxis!==0&&e.uint32(29).float(t.radiusAxis),t.radiusPipe!==0&&e.uint32(37).float(t.radiusPipe),t.frame!==void 0&&Qe.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=s0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radiusAxis=n.float();continue}case 4:{if(s!==37)break;r.radiusPipe=n.float();continue}case 5:{if(s!==42)break;r.frame=Qe.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",radiusAxis:de(t.radiusAxis)?globalThis.Number(t.radiusAxis):de(t.radius_axis)?globalThis.Number(t.radius_axis):0,radiusPipe:de(t.radiusPipe)?globalThis.Number(t.radiusPipe):de(t.radius_pipe)?globalThis.Number(t.radius_pipe):0,frame:de(t.frame)?Qe.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radiusAxis!==0&&(e.radiusAxis=t.radiusAxis),t.radiusPipe!==0&&(e.radiusPipe=t.radiusPipe),t.frame!==void 0&&(e.frame=Qe.toJSON(t.frame)),e},create(t){return vp.fromPartial(t??{})},fromPartial(t){const e=s0();return e.guid=t.guid??"",e.name=t.name??"",e.radiusAxis=t.radiusAxis??0,e.radiusPipe=t.radiusPipe??0,e.frame=t.frame!==void 0&&t.frame!==null?Qe.fromPartial(t.frame):void 0,e}};function o0(){return{guid:"",name:"",points:[]}}const _p={encode(t,e=new ft){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(const n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=o0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Je.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return _p.fromPartial(t??{})},fromPartial(t){const e=o0();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function a0(){return{guid:"",name:"",matrix:[]}}const xp={encode(t,e=new ft){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=a0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return xp.fromPartial(t??{})},fromPartial(t){const e=a0();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function l0(){return{guid:"",name:"",translationVector:void 0}}const yp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.translationVector!==void 0&&It.encode(t.translationVector,e.uint32(26).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=l0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.translationVector=It.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",translationVector:de(t.translationVector)?It.fromJSON(t.translationVector):de(t.translation_vector)?It.fromJSON(t.translation_vector):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.translationVector!==void 0&&(e.translationVector=It.toJSON(t.translationVector)),e},create(t){return yp.fromPartial(t??{})},fromPartial(t){const e=l0();return e.guid=t.guid??"",e.name=t.name??"",e.translationVector=t.translationVector!==void 0&&t.translationVector!==null?It.fromPartial(t.translationVector):void 0,e}};function c0(){return{guid:"",name:"",axis:void 0,angle:0,point:void 0}}const bp={encode(t,e=new ft){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.axis!==void 0&&It.encode(t.axis,e.uint32(26).fork()).join(),t.angle!==0&&e.uint32(37).float(t.angle),t.point!==void 0&&Je.encode(t.point,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=c0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.axis=It.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.angle=n.float();continue}case 5:{if(s!==42)break;r.point=Je.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:de(t.guid)?globalThis.String(t.guid):"",name:de(t.name)?globalThis.String(t.name):"",axis:de(t.axis)?It.fromJSON(t.axis):void 0,angle:de(t.angle)?globalThis.Number(t.angle):0,point:de(t.point)?Je.fromJSON(t.point):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.axis!==void 0&&(e.axis=It.toJSON(t.axis)),t.angle!==0&&(e.angle=t.angle),t.point!==void 0&&(e.point=Je.toJSON(t.point)),e},create(t){return bp.fromPartial(t??{})},fromPartial(t){const e=c0();return e.guid=t.guid??"",e.name=t.name??"",e.axis=t.axis!==void 0&&t.axis!==null?It.fromPartial(t.axis):void 0,e.angle=t.angle??0,e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e}};function u0(){return{guid:"",name:"",matrix:[]}}const Sp={encode(t,e=new ft){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=u0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return Sp.fromPartial(t??{})},fromPartial(t){const e=u0();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function d0(){return{guid:"",name:"",matrix:[]}}const wp={encode(t,e=new ft){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=d0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return wp.fromPartial(t??{})},fromPartial(t){const e=d0();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function f0(){return{guid:"",name:"",matrix:[]}}const Mp={encode(t,e=new ft){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=f0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return Mp.fromPartial(t??{})},fromPartial(t){const e=f0();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function h0(){return{guid:"",name:"",matrix:[]}}const Ep={encode(t,e=new ft){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=h0();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return Ep.fromPartial(t??{})},fromPartial(t){const e=h0();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function de(t){return t!=null}const Tp="182",Js={ROTATE:0,DOLLY:1,PAN:2},Io={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},VA=0,p0=1,HA=2,Ec=1,Ty=2,Ca=3,ms=0,Nn=1,zn=2,Er=0,Ho=1,m0=2,g0=3,v0=4,GA=5,zs=100,WA=101,qA=102,XA=103,$A=104,YA=200,JA=201,KA=202,ZA=203,wf=204,Mf=205,jA=206,QA=207,eC=208,tC=209,nC=210,iC=211,rC=212,sC=213,oC=214,Ef=0,Tf=1,Af=2,Jo=3,Cf=4,Pf=5,Rf=6,Df=7,Ay=0,aC=1,lC=2,Zi=0,Cy=1,Py=2,Ry=3,Ap=4,Dy=5,Iy=6,Ny=7,Ly=300,Qs=301,Ko=302,If=303,Nf=304,Du=306,Lf=1e3,Sr=1001,Of=1002,yn=1003,cC=1004,Nl=1005,Dn=1006,fd=1007,Hs=1008,ni=1009,Oy=1010,Fy=1011,ja=1012,Cp=1013,tr=1014,$i=1015,Or=1016,Pp=1017,Rp=1018,Qa=1020,Uy=35902,ky=35899,By=1021,zy=1022,Mi=1023,Fr=1026,Gs=1027,Vy=1028,Dp=1029,Zo=1030,Ip=1031,Np=1033,Tc=33776,Ac=33777,Cc=33778,Pc=33779,Ff=35840,Uf=35841,kf=35842,Bf=35843,zf=36196,Vf=37492,Hf=37496,Gf=37488,Wf=37489,qf=37490,Xf=37491,$f=37808,Yf=37809,Jf=37810,Kf=37811,Zf=37812,jf=37813,Qf=37814,eh=37815,th=37816,nh=37817,ih=37818,rh=37819,sh=37820,oh=37821,ah=36492,lh=36494,ch=36495,uh=36283,dh=36284,fh=36285,hh=36286,uC=3200,Hy=0,dC=1,ss="",Qn="srgb",jo="srgb-linear",Jc="linear",Dt="srgb",ho=7680,_0=519,fC=512,hC=513,pC=514,Lp=515,mC=516,gC=517,Op=518,vC=519,x0=35044,y0="300 es",Yi=2e3,Kc=2001;function Gy(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function Zc(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function _C(){const t=Zc("canvas");return t.style.display="block",t}const b0={};function S0(...t){const e="THREE."+t.shift();console.log(e,...t)}function nt(...t){const e="THREE."+t.shift();console.warn(e,...t)}function St(...t){const e="THREE."+t.shift();console.error(e,...t)}function el(...t){const e=t.join(" ");e in b0||(b0[e]=!0,nt(...t))}function xC(t,e,n){return new Promise(function(i,r){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:r();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}class ro{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const s=r.indexOf(n);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+Mn[t>>16&255]+Mn[t>>24&255]+"-"+Mn[e&255]+Mn[e>>8&255]+"-"+Mn[e>>16&15|64]+Mn[e>>24&255]+"-"+Mn[n&63|128]+Mn[n>>8&255]+"-"+Mn[n>>16&255]+Mn[n>>24&255]+Mn[i&255]+Mn[i>>8&255]+Mn[i>>16&255]+Mn[i>>24&255]).toLowerCase()}function pt(t,e,n){return Math.max(e,Math.min(n,t))}function Fp(t,e){return(t%e+e)%e}function yC(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)}function bC(t,e,n){return t!==e?(n-t)/(e-t):0}function Va(t,e,n){return(1-n)*t+n*e}function SC(t,e,n,i){return Va(t,e,1-Math.exp(-n*i))}function wC(t,e=1){return e-Math.abs(Fp(t,e*2)-e)}function MC(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function EC(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function TC(t,e){return t+Math.floor(Math.random()*(e-t+1))}function AC(t,e){return t+Math.random()*(e-t)}function CC(t){return t*(.5-Math.random())}function PC(t){t!==void 0&&(w0=t);let e=w0+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function RC(t){return t*Go}function DC(t){return t*Qo}function IC(t){return(t&t-1)===0&&t!==0}function NC(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function LC(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function OC(t,e,n,i,r){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((e+i)/2),u=o((e+i)/2),d=s((e-i)/2),f=o((e-i)/2),h=s((i-e)/2),g=o((i-e)/2);switch(r){case"XYX":t.set(a*u,l*d,l*f,a*c);break;case"YZY":t.set(l*f,a*u,l*d,a*c);break;case"ZXZ":t.set(l*d,l*f,a*u,a*c);break;case"XZX":t.set(a*u,l*g,l*h,a*c);break;case"YXY":t.set(l*h,a*u,l*g,a*c);break;case"ZYZ":t.set(l*g,l*h,a*u,a*c);break;default:nt("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Do(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Un(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const jc={DEG2RAD:Go,RAD2DEG:Qo,generateUUID:so,clamp:pt,euclideanModulo:Fp,mapLinear:yC,inverseLerp:bC,lerp:Va,damp:SC,pingpong:wC,smoothstep:MC,smootherstep:EC,randInt:TC,randFloat:AC,randFloatSpread:CC,seededRandom:PC,degToRad:RC,radToDeg:DC,isPowerOfTwo:IC,ceilPowerOfTwo:NC,floorPowerOfTwo:LC,setQuaternionFromProperEuler:OC,normalize:Un,denormalize:Do};class xe{constructor(e=0,n=0){xe.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,r=e.elements;return this.x=r[0]*n+r[3]*i+r[6],this.y=r[1]*n+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=pt(this.x,e.x,n.x),this.y=pt(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=pt(this.x,e,n),this.y=pt(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(pt(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(pt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),r=Math.sin(n),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}let vn=class{constructor(e=0,n=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=r}static slerpFlat(e,n,i,r,s,o,a){let l=i[r+0],c=i[r+1],u=i[r+2],d=i[r+3],f=s[o+0],h=s[o+1],g=s[o+2],v=s[o+3];if(a<=0){e[n+0]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d;return}if(a>=1){e[n+0]=f,e[n+1]=h,e[n+2]=g,e[n+3]=v;return}if(d!==v||l!==f||c!==h||u!==g){let m=l*f+c*h+u*g+d*v;m<0&&(f=-f,h=-h,g=-g,v=-v,m=-m);let p=1-a;if(m<.9995){const _=Math.acos(m),x=Math.sin(_);p=Math.sin(p*_)/x,a=Math.sin(a*_)/x,l=l*p+f*a,c=c*p+h*a,u=u*p+g*a,d=d*p+v*a}else{l=l*p+f*a,c=c*p+h*a,u=u*p+g*a,d=d*p+v*a;const _=1/Math.sqrt(l*l+c*c+u*u+d*d);l*=_,c*=_,u*=_,d*=_}}e[n]=l,e[n+1]=c,e[n+2]=u,e[n+3]=d}static multiplyQuaternionsFlat(e,n,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],u=i[r+3],d=s[o],f=s[o+1],h=s[o+2],g=s[o+3];return e[n]=a*g+u*d+l*h-c*f,e[n+1]=l*g+u*f+c*d-a*h,e[n+2]=c*g+u*h+a*f-l*d,e[n+3]=u*g-a*d-l*f-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,r){return this._x=e,this._y=n,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(r/2),d=a(s/2),f=l(i/2),h=l(r/2),g=l(s/2);switch(o){case"XYZ":this._x=f*u*d+c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d-f*h*g;break;case"YXZ":this._x=f*u*d+c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d+f*h*g;break;case"ZXY":this._x=f*u*d-c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d-f*h*g;break;case"ZYX":this._x=f*u*d-c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d+f*h*g;break;case"YZX":this._x=f*u*d+c*h*g,this._y=c*h*d+f*u*g,this._z=c*u*g-f*h*d,this._w=c*u*d-f*h*g;break;case"XZY":this._x=f*u*d-c*h*g,this._y=c*h*d-f*u*g,this._z=c*u*g+f*h*d,this._w=c*u*d+f*h*g;break;default:nt("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],r=n[4],s=n[8],o=n[1],a=n[5],l=n[9],c=n[2],u=n[6],d=n[10],f=i+a+d;if(f>0){const h=.5/Math.sqrt(f+1);this._w=.25/h,this._x=(u-l)*h,this._y=(s-c)*h,this._z=(o-r)*h}else if(i>a&&i>d){const h=2*Math.sqrt(1+i-a-d);this._w=(u-l)/h,this._x=.25*h,this._y=(r+o)/h,this._z=(s+c)/h}else if(a>d){const h=2*Math.sqrt(1+a-i-d);this._w=(s-c)/h,this._x=(r+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+d-i-a);this._w=(o-r)/h,this._x=(s+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(pt(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,n/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,r=e._y,s=e._z,o=e._w,a=n._x,l=n._y,c=n._z,u=n._w;return this._x=i*u+o*a+r*c-s*l,this._y=r*u+o*l+s*a-i*c,this._z=s*u+o*c+i*l-r*a,this._w=o*u-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,n){if(n<=0)return this;if(n>=1)return this.copy(e);let i=e._x,r=e._y,s=e._z,o=e._w,a=this.dot(e);a<0&&(i=-i,r=-r,s=-s,o=-o,a=-a);let l=1-n;if(a<.9995){const c=Math.acos(a),u=Math.sin(c);l=Math.sin(l*c)/u,n=Math.sin(n*c)/u,this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this._onChangeCallback()}else this._x=this._x*l+i*n,this._y=this._y*l+r*n,this._z=this._z*l+s*n,this._w=this._w*l+o*n,this.normalize();return this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}};class I{constructor(e=0,n=0,i=0){I.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(M0.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(M0.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6]*r,this.y=s[1]*n+s[4]*i+s[7]*r,this.z=s[2]*n+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*n+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*n+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*n+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const n=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),u=2*(a*n-s*r),d=2*(s*i-o*n);return this.x=n+l*c+o*d-a*u,this.y=i+l*u+a*c-s*d,this.z=r+l*d+s*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*r,this.y=s[1]*n+s[5]*i+s[9]*r,this.z=s[2]*n+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=pt(this.x,e.x,n.x),this.y=pt(this.y,e.y,n.y),this.z=pt(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=pt(this.x,e,n),this.y=pt(this.y,e,n),this.z=pt(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(pt(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,r=e.y,s=e.z,o=n.x,a=n.y,l=n.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return hd.copy(this).projectOnVector(e),this.sub(hd)}reflect(e){return this.sub(hd.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(pt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return n*n+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const r=Math.sin(n)*e;return this.x=r*Math.sin(i),this.y=Math.cos(n)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=r,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const hd=new I,M0=new vn;class ht{constructor(e,n,i,r,s,o,a,l,c){ht.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,a,l,c)}set(e,n,i,r,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=n,u[4]=s,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],d=i[7],f=i[2],h=i[5],g=i[8],v=r[0],m=r[3],p=r[6],_=r[1],x=r[4],y=r[7],E=r[2],A=r[5],P=r[8];return s[0]=o*v+a*_+l*E,s[3]=o*m+a*x+l*A,s[6]=o*p+a*y+l*P,s[1]=c*v+u*_+d*E,s[4]=c*m+u*x+d*A,s[7]=c*p+u*y+d*P,s[2]=f*v+h*_+g*E,s[5]=f*m+h*x+g*A,s[8]=f*p+h*y+g*P,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return n*o*u-n*a*c-i*s*u+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=u*o-a*c,f=a*l-u*s,h=c*s-o*l,g=n*d+i*f+r*h;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return e[0]=d*v,e[1]=(r*c-u*i)*v,e[2]=(a*i-r*o)*v,e[3]=f*v,e[4]=(u*n-r*l)*v,e[5]=(r*s-a*n)*v,e[6]=h*v,e[7]=(i*l-c*n)*v,e[8]=(o*n-i*s)*v,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(pd.makeScale(e,n)),this}rotate(e){return this.premultiply(pd.makeRotation(-e)),this}translate(e,n){return this.premultiply(pd.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<9;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const pd=new ht,E0=new ht().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),T0=new ht().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function FC(){const t={enabled:!0,workingColorSpace:jo,spaces:{},convert:function(r,s,o){return this.enabled===!1||s===o||!s||!o||(this.spaces[s].transfer===Dt&&(r.r=Tr(r.r),r.g=Tr(r.g),r.b=Tr(r.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===Dt&&(r.r=Wo(r.r),r.g=Wo(r.g),r.b=Wo(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===ss?Jc:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,o){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return el("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return el("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[jo]:{primaries:e,whitePoint:i,transfer:Jc,toXYZ:E0,fromXYZ:T0,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Qn},outputColorSpaceConfig:{drawingBufferColorSpace:Qn}},[Qn]:{primaries:e,whitePoint:i,transfer:Dt,toXYZ:E0,fromXYZ:T0,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Qn}}}),t}const wt=FC();function Tr(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Wo(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let po;class UC{static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{po===void 0&&(po=Zc("canvas")),po.width=e.width,po.height=e.height;const r=po.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=po}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Zc("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o1),this.pmremVersion=0}get width(){return this.source.getSize(gd).x}get height(){return this.source.getSize(gd).y}get depth(){return this.source.getSize(gd).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){nt(`Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){nt(`Texture.setValues(): property '${n}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Ly)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Lf:e.x=e.x-Math.floor(e.x);break;case Sr:e.x=e.x<0?0:1;break;case Of:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Lf:e.y=e.y-Math.floor(e.y);break;case Sr:e.y=e.y<0?0:1;break;case Of:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Vn.DEFAULT_IMAGE=null;Vn.DEFAULT_MAPPING=Ly;Vn.DEFAULT_ANISOTROPY=1;class jt{constructor(e=0,n=0,i=0,r=1){jt.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,r){return this.x=e,this.y=n,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*n+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*n+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*n+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*n+o[7]*i+o[11]*r+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,r,s;const l=e.elements,c=l[0],u=l[4],d=l[8],f=l[1],h=l[5],g=l[9],v=l[2],m=l[6],p=l[10];if(Math.abs(u-f)<.01&&Math.abs(d-v)<.01&&Math.abs(g-m)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+v)<.1&&Math.abs(g+m)<.1&&Math.abs(c+h+p-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(c+1)/2,y=(h+1)/2,E=(p+1)/2,A=(u+f)/4,P=(d+v)/4,D=(g+m)/4;return x>y&&x>E?x<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(x),r=A/i,s=P/i):y>E?y<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(y),i=A/r,s=D/r):E<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(E),i=P/s,r=D/s),this.set(i,r,s,n),this}let _=Math.sqrt((m-g)*(m-g)+(d-v)*(d-v)+(f-u)*(f-u));return Math.abs(_)<.001&&(_=1),this.x=(m-g)/_,this.y=(d-v)/_,this.z=(f-u)/_,this.w=Math.acos((c+h+p-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=pt(this.x,e.x,n.x),this.y=pt(this.y,e.y,n.y),this.z=pt(this.z,e.z,n.z),this.w=pt(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=pt(this.x,e,n),this.y=pt(this.y,e,n),this.z=pt(this.z,e,n),this.w=pt(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(pt(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class zC extends ro{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Dn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new jt(0,0,e,n),this.scissorTest=!1,this.viewport=new jt(0,0,e,n);const r={width:e,height:n,depth:i.depth},s=new Vn(r);this.textures=[];const o=i.count;for(let a=0;a1);this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,yi),yi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(ha),Ol.subVectors(this.max,ha),mo.subVectors(e.a,ha),go.subVectors(e.b,ha),vo.subVectors(e.c,ha),Xr.subVectors(go,mo),$r.subVectors(vo,go),Ps.subVectors(mo,vo);let n=[0,-Xr.z,Xr.y,0,-$r.z,$r.y,0,-Ps.z,Ps.y,Xr.z,0,-Xr.x,$r.z,0,-$r.x,Ps.z,0,-Ps.x,-Xr.y,Xr.x,0,-$r.y,$r.x,0,-Ps.y,Ps.x,0];return!vd(n,mo,go,vo,Ol)||(n=[1,0,0,0,1,0,0,0,1],!vd(n,mo,go,vo,Ol))?!1:(Fl.crossVectors(Xr,$r),n=[Fl.x,Fl.y,Fl.z],vd(n,mo,go,vo,Ol))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,yi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(yi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ur[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ur[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ur[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ur[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ur[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ur[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ur[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ur[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ur),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const ur=[new I,new I,new I,new I,new I,new I,new I,new I],yi=new I,Ll=new pl,mo=new I,go=new I,vo=new I,Xr=new I,$r=new I,Ps=new I,ha=new I,Ol=new I,Fl=new I,Rs=new I;function vd(t,e,n,i,r){for(let s=0,o=t.length-3;s<=o;s+=3){Rs.fromArray(t,s);const a=r.x*Math.abs(Rs.x)+r.y*Math.abs(Rs.y)+r.z*Math.abs(Rs.z),l=e.dot(Rs),c=n.dot(Rs),u=i.dot(Rs);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const HC=new pl,pa=new I,_d=new I;let ml=class{constructor(e=new I,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):HC.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;pa.subVectors(e,this.center);const n=pa.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),r=(i-this.radius)*.5;this.center.addScaledVector(pa,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(_d.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(pa.copy(e.center).add(_d)),this.expandByPoint(pa.copy(e.center).sub(_d))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}};const dr=new I,xd=new I,Ul=new I,Yr=new I,yd=new I,kl=new I,bd=new I;class gl{constructor(e=new I,n=new I(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,dr)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=dr.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(dr.copy(this.origin).addScaledVector(this.direction,n),dr.distanceToSquared(e))}distanceSqToSegment(e,n,i,r){xd.copy(e).add(n).multiplyScalar(.5),Ul.copy(n).sub(e).normalize(),Yr.copy(this.origin).sub(xd);const s=e.distanceTo(n)*.5,o=-this.direction.dot(Ul),a=Yr.dot(this.direction),l=-Yr.dot(Ul),c=Yr.lengthSq(),u=Math.abs(1-o*o);let d,f,h,g;if(u>0)if(d=o*l-a,f=o*a-l,g=s*u,d>=0)if(f>=-g)if(f<=g){const v=1/u;d*=v,f*=v,h=d*(d+o*f+2*a)+f*(o*d+f+2*l)+c}else f=s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f=-s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;else f<=-g?(d=Math.max(0,-(-o*s+a)),f=d>0?-s:Math.min(Math.max(-s,-l),s),h=-d*d+f*(f+2*l)+c):f<=g?(d=0,f=Math.min(Math.max(-s,-l),s),h=f*(f+2*l)+c):(d=Math.max(0,-(o*s+a)),f=d>0?s:Math.min(Math.max(-s,-l),s),h=-d*d+f*(f+2*l)+c);else f=o>0?-s:s,d=Math.max(0,-(o*f+a)),h=-d*d+f*(f+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(xd).addScaledVector(Ul,f),h}intersectSphere(e,n){dr.subVectors(e.center,this.origin);const i=dr.dot(this.direction),r=dr.dot(dr)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,r,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(i=(e.min.x-f.x)*c,r=(e.max.x-f.x)*c):(i=(e.max.x-f.x)*c,r=(e.min.x-f.x)*c),u>=0?(s=(e.min.y-f.y)*u,o=(e.max.y-f.y)*u):(s=(e.max.y-f.y)*u,o=(e.min.y-f.y)*u),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,n)}intersectsBox(e){return this.intersectBox(e,dr)!==null}intersectTriangle(e,n,i,r,s){yd.subVectors(n,e),kl.subVectors(i,e),bd.crossVectors(yd,kl);let o=this.direction.dot(bd),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Yr.subVectors(this.origin,e);const l=a*this.direction.dot(kl.crossVectors(Yr,kl));if(l<0)return null;const c=a*this.direction.dot(yd.cross(Yr));if(c<0||l+c>o)return null;const u=-a*Yr.dot(bd);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class yt{constructor(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m){yt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m)}set(e,n,i,r,s,o,a,l,c,u,d,f,h,g,v,m){const p=this.elements;return p[0]=e,p[4]=n,p[8]=i,p[12]=r,p[1]=s,p[5]=o,p[9]=a,p[13]=l,p[2]=c,p[6]=u,p[10]=d,p[14]=f,p[3]=h,p[7]=g,p[11]=v,p[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new yt().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return this.determinant()===0?(e.set(1,0,0),n.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const n=this.elements,i=e.elements,r=1/_o.setFromMatrixColumn(e,0).length(),s=1/_o.setFromMatrixColumn(e,1).length(),o=1/_o.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*o,n[9]=i[9]*o,n[10]=i[10]*o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const f=o*u,h=o*d,g=a*u,v=a*d;n[0]=l*u,n[4]=-l*d,n[8]=c,n[1]=h+g*c,n[5]=f-v*c,n[9]=-a*l,n[2]=v-f*c,n[6]=g+h*c,n[10]=o*l}else if(e.order==="YXZ"){const f=l*u,h=l*d,g=c*u,v=c*d;n[0]=f+v*a,n[4]=g*a-h,n[8]=o*c,n[1]=o*d,n[5]=o*u,n[9]=-a,n[2]=h*a-g,n[6]=v+f*a,n[10]=o*l}else if(e.order==="ZXY"){const f=l*u,h=l*d,g=c*u,v=c*d;n[0]=f-v*a,n[4]=-o*d,n[8]=g+h*a,n[1]=h+g*a,n[5]=o*u,n[9]=v-f*a,n[2]=-o*c,n[6]=a,n[10]=o*l}else if(e.order==="ZYX"){const f=o*u,h=o*d,g=a*u,v=a*d;n[0]=l*u,n[4]=g*c-h,n[8]=f*c+v,n[1]=l*d,n[5]=v*c+f,n[9]=h*c-g,n[2]=-c,n[6]=a*l,n[10]=o*l}else if(e.order==="YZX"){const f=o*l,h=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=v-f*d,n[8]=g*d+h,n[1]=d,n[5]=o*u,n[9]=-a*u,n[2]=-c*u,n[6]=h*d+g,n[10]=f-v*d}else if(e.order==="XZY"){const f=o*l,h=o*c,g=a*l,v=a*c;n[0]=l*u,n[4]=-d,n[8]=c*u,n[1]=f*d+v,n[5]=o*u,n[9]=h*d-g,n[2]=g*d-h,n[6]=a*u,n[10]=v*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(GC,e,WC)}lookAt(e,n,i){const r=this.elements;return Zn.subVectors(e,n),Zn.lengthSq()===0&&(Zn.z=1),Zn.normalize(),Jr.crossVectors(i,Zn),Jr.lengthSq()===0&&(Math.abs(i.z)===1?Zn.x+=1e-4:Zn.z+=1e-4,Zn.normalize(),Jr.crossVectors(i,Zn)),Jr.normalize(),Bl.crossVectors(Zn,Jr),r[0]=Jr.x,r[4]=Bl.x,r[8]=Zn.x,r[1]=Jr.y,r[5]=Bl.y,r[9]=Zn.y,r[2]=Jr.z,r[6]=Bl.z,r[10]=Zn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,r=n.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],d=i[5],f=i[9],h=i[13],g=i[2],v=i[6],m=i[10],p=i[14],_=i[3],x=i[7],y=i[11],E=i[15],A=r[0],P=r[4],D=r[8],S=r[12],w=r[1],N=r[5],B=r[9],W=r[13],Z=r[2],X=r[6],H=r[10],k=r[14],J=r[3],ue=r[7],Y=r[11],pe=r[15];return s[0]=o*A+a*w+l*Z+c*J,s[4]=o*P+a*N+l*X+c*ue,s[8]=o*D+a*B+l*H+c*Y,s[12]=o*S+a*W+l*k+c*pe,s[1]=u*A+d*w+f*Z+h*J,s[5]=u*P+d*N+f*X+h*ue,s[9]=u*D+d*B+f*H+h*Y,s[13]=u*S+d*W+f*k+h*pe,s[2]=g*A+v*w+m*Z+p*J,s[6]=g*P+v*N+m*X+p*ue,s[10]=g*D+v*B+m*H+p*Y,s[14]=g*S+v*W+m*k+p*pe,s[3]=_*A+x*w+y*Z+E*J,s[7]=_*P+x*N+y*X+E*ue,s[11]=_*D+x*B+y*H+E*Y,s[15]=_*S+x*W+y*k+E*pe,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],d=e[6],f=e[10],h=e[14],g=e[3],v=e[7],m=e[11],p=e[15],_=l*h-c*f,x=a*h-c*d,y=a*f-l*d,E=o*h-c*u,A=o*f-l*u,P=o*d-a*u;return n*(v*_-m*x+p*y)-i*(g*_-m*E+p*A)+r*(g*x-v*E+p*P)-s*(g*y-v*A+m*P)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=n,r[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],h=e[11],g=e[12],v=e[13],m=e[14],p=e[15],_=d*m*c-v*f*c+v*l*h-a*m*h-d*l*p+a*f*p,x=g*f*c-u*m*c-g*l*h+o*m*h+u*l*p-o*f*p,y=u*v*c-g*d*c+g*a*h-o*v*h-u*a*p+o*d*p,E=g*d*l-u*v*l-g*a*f+o*v*f+u*a*m-o*d*m,A=n*_+i*x+r*y+s*E;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/A;return e[0]=_*P,e[1]=(v*f*s-d*m*s-v*r*h+i*m*h+d*r*p-i*f*p)*P,e[2]=(a*m*s-v*l*s+v*r*c-i*m*c-a*r*p+i*l*p)*P,e[3]=(d*l*s-a*f*s-d*r*c+i*f*c+a*r*h-i*l*h)*P,e[4]=x*P,e[5]=(u*m*s-g*f*s+g*r*h-n*m*h-u*r*p+n*f*p)*P,e[6]=(g*l*s-o*m*s-g*r*c+n*m*c+o*r*p-n*l*p)*P,e[7]=(o*f*s-u*l*s+u*r*c-n*f*c-o*r*h+n*l*h)*P,e[8]=y*P,e[9]=(g*d*s-u*v*s-g*i*h+n*v*h+u*i*p-n*d*p)*P,e[10]=(o*v*s-g*a*s+g*i*c-n*v*c-o*i*p+n*a*p)*P,e[11]=(u*a*s-o*d*s-u*i*c+n*d*c+o*i*h-n*a*h)*P,e[12]=E*P,e[13]=(u*v*r-g*d*r+g*i*f-n*v*f-u*i*m+n*d*m)*P,e[14]=(g*a*r-o*v*r-g*i*l+n*v*l+o*i*m-n*a*m)*P,e[15]=(o*d*r-u*a*r+u*i*l-n*d*l-o*i*f+n*a*f)*P,this}scale(e){const n=this.elements,i=e.x,r=e.y,s=e.z;return n[0]*=i,n[4]*=r,n[8]*=s,n[1]*=i,n[5]*=r,n[9]*=s,n[2]*=i,n[6]*=r,n[10]*=s,n[3]*=i,n[7]*=r,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,r))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),r=Math.sin(n),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,u*a+i,u*l-r*o,0,c*l-r*a,u*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,n,r,1,0,0,0,0,1),this}compose(e,n,i){const r=this.elements,s=n._x,o=n._y,a=n._z,l=n._w,c=s+s,u=o+o,d=a+a,f=s*c,h=s*u,g=s*d,v=o*u,m=o*d,p=a*d,_=l*c,x=l*u,y=l*d,E=i.x,A=i.y,P=i.z;return r[0]=(1-(v+p))*E,r[1]=(h+y)*E,r[2]=(g-x)*E,r[3]=0,r[4]=(h-y)*A,r[5]=(1-(f+p))*A,r[6]=(m+_)*A,r[7]=0,r[8]=(g+x)*P,r[9]=(m-_)*P,r[10]=(1-(f+v))*P,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,n,i){const r=this.elements;if(e.x=r[12],e.y=r[13],e.z=r[14],this.determinant()===0)return i.set(1,1,1),n.identity(),this;let s=_o.set(r[0],r[1],r[2]).length();const o=_o.set(r[4],r[5],r[6]).length(),a=_o.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),bi.copy(this);const c=1/s,u=1/o,d=1/a;return bi.elements[0]*=c,bi.elements[1]*=c,bi.elements[2]*=c,bi.elements[4]*=u,bi.elements[5]*=u,bi.elements[6]*=u,bi.elements[8]*=d,bi.elements[9]*=d,bi.elements[10]*=d,n.setFromRotationMatrix(bi),i.x=s,i.y=o,i.z=a,this}makePerspective(e,n,i,r,s,o,a=Yi,l=!1){const c=this.elements,u=2*s/(n-e),d=2*s/(i-r),f=(n+e)/(n-e),h=(i+r)/(i-r);let g,v;if(l)g=s/(o-s),v=o*s/(o-s);else if(a===Yi)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Kc)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=f,c[12]=0,c[1]=0,c[5]=d,c[9]=h,c[13]=0,c[2]=0,c[6]=0,c[10]=g,c[14]=v,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,n,i,r,s,o,a=Yi,l=!1){const c=this.elements,u=2/(n-e),d=2/(i-r),f=-(n+e)/(n-e),h=-(i+r)/(i-r);let g,v;if(l)g=1/(o-s),v=o/(o-s);else if(a===Yi)g=-2/(o-s),v=-(o+s)/(o-s);else if(a===Kc)g=-1/(o-s),v=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=u,c[4]=0,c[8]=0,c[12]=f,c[1]=0,c[5]=d,c[9]=0,c[13]=h,c[2]=0,c[6]=0,c[10]=g,c[14]=v,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let r=0;r<16;r++)if(n[r]!==i[r])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const _o=new I,bi=new yt,GC=new I(0,0,0),WC=new I(1,1,1),Jr=new I,Bl=new I,Zn=new I,A0=new yt,C0=new vn;class Di{constructor(e=0,n=0,i=0,r=Di.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,r=this._order){return this._x=e,this._y=n,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],u=r[9],d=r[2],f=r[6],h=r[10];switch(n){case"XYZ":this._y=Math.asin(pt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-pt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(pt(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-pt(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,h),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(pt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-pt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,h),this._y=0);break;default:nt("Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return A0.makeRotationFromQuaternion(e),this.setFromRotationMatrix(A0,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return C0.setFromEuler(this),this.setFromQuaternion(C0,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Di.DEFAULT_ORDER="XYZ";class kp{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?a.boundingBox.toJSON():void 0,boundingSphere:a.boundingSphere?a.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(a=>({...a})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),d.length>0&&(i.shapes=d),f.length>0&&(i.skeletons=f),h.length>0&&(i.animations=h),g.length>0&&(i.nodes=g)}return i.object=r,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,n,i,r,s){Si.subVectors(r,n),hr.subVectors(i,n),wd.subVectors(e,n);const o=Si.dot(Si),a=Si.dot(hr),l=Si.dot(wd),c=hr.dot(hr),u=hr.dot(wd),d=o*c-a*a;if(d===0)return s.set(0,0,0),null;const f=1/d,h=(c*l-a*u)*f,g=(o*u-a*l)*f;return s.set(1-h-g,g,h)}static containsPoint(e,n,i,r){return this.getBarycoord(e,n,i,r,pr)===null?!1:pr.x>=0&&pr.y>=0&&pr.x+pr.y<=1}static getInterpolation(e,n,i,r,s,o,a,l){return this.getBarycoord(e,n,i,r,pr)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,pr.x),l.addScaledVector(o,pr.y),l.addScaledVector(a,pr.z),l)}static getInterpolatedAttribute(e,n,i,r,s,o){return Ad.setScalar(0),Cd.setScalar(0),Pd.setScalar(0),Ad.fromBufferAttribute(e,n),Cd.fromBufferAttribute(e,i),Pd.fromBufferAttribute(e,r),o.setScalar(0),o.addScaledVector(Ad,s.x),o.addScaledVector(Cd,s.y),o.addScaledVector(Pd,s.z),o}static isFrontFacing(e,n,i,r){return Si.subVectors(i,n),hr.subVectors(e,n),Si.cross(hr).dot(r)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,r){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,n,i,r){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Si.subVectors(this.c,this.b),hr.subVectors(this.a,this.b),Si.cross(hr).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return di.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return di.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,r,s){return di.getInterpolation(e,this.a,this.b,this.c,n,i,r,s)}containsPoint(e){return di.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return di.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,r=this.b,s=this.c;let o,a;bo.subVectors(r,i),So.subVectors(s,i),Md.subVectors(e,i);const l=bo.dot(Md),c=So.dot(Md);if(l<=0&&c<=0)return n.copy(i);Ed.subVectors(e,r);const u=bo.dot(Ed),d=So.dot(Ed);if(u>=0&&d<=u)return n.copy(r);const f=l*d-u*c;if(f<=0&&l>=0&&u<=0)return o=l/(l-u),n.copy(i).addScaledVector(bo,o);Td.subVectors(e,s);const h=bo.dot(Td),g=So.dot(Td);if(g>=0&&h<=g)return n.copy(s);const v=h*c-l*g;if(v<=0&&c>=0&&g<=0)return a=c/(c-g),n.copy(i).addScaledVector(So,a);const m=u*g-h*d;if(m<=0&&d-u>=0&&h-g>=0)return L0.subVectors(s,r),a=(d-u)/(d-u+(h-g)),n.copy(r).addScaledVector(L0,a);const p=1/(m+v+f);return o=v*p,a=f*p,n.copy(i).addScaledVector(bo,o).addScaledVector(So,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const qy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Kr={h:0,s:0,l:0},Vl={h:0,s:0,l:0};function Rd(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class st{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=Qn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,wt.colorSpaceToWorking(this,n),this}setRGB(e,n,i,r=wt.workingColorSpace){return this.r=e,this.g=n,this.b=i,wt.colorSpaceToWorking(this,r),this}setHSL(e,n,i,r=wt.workingColorSpace){if(e=Fp(e,1),n=pt(n,0,1),i=pt(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,o=2*i-s;this.r=Rd(o,s,e+1/3),this.g=Rd(o,s,e),this.b=Rd(o,s,e-1/3)}return wt.colorSpaceToWorking(this,r),this}setStyle(e,n=Qn){function i(s){s!==void 0&&parseFloat(s)<1&&nt("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:nt("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(o===6)return this.setHex(parseInt(s,16),n);nt("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=Qn){const i=qy[e.toLowerCase()];return i!==void 0?this.setHex(i,n):nt("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Tr(e.r),this.g=Tr(e.g),this.b=Tr(e.b),this}copyLinearToSRGB(e){return this.r=Wo(e.r),this.g=Wo(e.g),this.b=Wo(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Qn){return wt.workingToColorSpace(En.copy(this),e),Math.round(pt(En.r*255,0,255))*65536+Math.round(pt(En.g*255,0,255))*256+Math.round(pt(En.b*255,0,255))}getHexString(e=Qn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=wt.workingColorSpace){wt.workingToColorSpace(En.copy(this),n);const i=En.r,r=En.g,s=En.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const d=o-a;switch(c=u<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){nt(`Material: parameter '${n}' has value of undefined.`);continue}const r=this[n];if(r===void 0){nt(`Material: '${n}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Ho&&(i.blending=this.blending),this.side!==ms&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==wf&&(i.blendSrc=this.blendSrc),this.blendDst!==Mf&&(i.blendDst=this.blendDst),this.blendEquation!==zs&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Jo&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==_0&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ho&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ho&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ho&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.allowOverride===!1&&(i.allowOverride=!1),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(n){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const r=n.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class ys extends oo{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new st(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Di,this.combine=Ay,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const on=new I,Hl=new xe;let KC=0;class Ln{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:KC++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=x0,this.updateRanges=[],this.gpuType=$i,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let r=0,s=this.itemSize;rn.count&&nt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new pl);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){St("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new I(-1/0,-1/0,-1/0),new I(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,r=n.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let d=0,f=c.length;d0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(n))}const s=e.morphAttributes;for(const c in s){const u=[],d=s[c];for(let f=0,h=d.length;f0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(O0.copy(s).invert(),Ds.copy(e.ray).applyMatrix4(O0),!(i.boundingBox!==null&&Ds.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,Ds)))}_computeIntersections(e,n,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,d=s.attributes.normal,f=s.groups,h=s.drawRange;if(a!==null)if(Array.isArray(o))for(let g=0,v=f.length;gn.far?null:{distance:c,point:Yl.clone(),object:t}}function Jl(t,e,n,i,r,s,o,a,l,c){t.getVertexPosition(a,Wl),t.getVertexPosition(l,ql),t.getVertexPosition(c,Xl);const u=jC(t,e,n,i,Wl,ql,Xl,U0);if(u){const d=new I;di.getBarycoord(U0,Wl,ql,Xl,d),r&&(u.uv=di.getInterpolatedAttribute(r,a,l,c,d,new xe)),s&&(u.uv1=di.getInterpolatedAttribute(s,a,l,c,d,new xe)),o&&(u.normal=di.getInterpolatedAttribute(o,a,l,c,d,new I),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const f={a,b:l,c,normal:new I,materialIndex:0};di.getNormal(Wl,ql,Xl,f.normal),u.face=f,u.barycoord=d}return u}class Zt extends bt{constructor(e=1,n=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],d=[];let f=0,h=0;g("z","y","x",-1,-1,i,n,e,o,s,0),g("z","y","x",1,-1,i,n,-e,o,s,1),g("x","z","y",1,1,e,i,n,r,o,2),g("x","z","y",1,-1,e,i,-n,r,o,3),g("x","y","z",1,-1,e,n,i,r,s,4),g("x","y","z",-1,-1,e,n,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new ut(c,3)),this.setAttribute("normal",new ut(u,3)),this.setAttribute("uv",new ut(d,2));function g(v,m,p,_,x,y,E,A,P,D,S){const w=y/P,N=E/D,B=y/2,W=E/2,Z=A/2,X=P+1,H=D+1;let k=0,J=0;const ue=new I;for(let Y=0;Y0?1:-1,u.push(ue.x,ue.y,ue.z),d.push(Ge/P),d.push(1-Y/D),k+=1}}for(let Y=0;Y0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class By extends Lt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new yt,this.projectionMatrix=new yt,this.projectionMatrixInverse=new yt,this.coordinateSystem=qi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Yr=new I,Yg=new xe,Jg=new xe;class Wn extends By{constructor(e=50,n=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Ko*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(zo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ko*2*Math.atan(Math.tan(zo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,i){Yr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Yr.x,Yr.y).multiplyScalar(-e/Yr.z),Yr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Yr.x,Yr.y).multiplyScalar(-e/Yr.z)}getViewSize(e,n){return this.getViewBounds(e,Yg,Jg),n.subVectors(Jg,Yg)}setViewOffset(e,n,i,r,s,o){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(zo*.5*this.fov)/this.zoom,i=2*n,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,n-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,n,n-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const bo=-90,So=1;class nP extends Lt{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Wn(bo,So,e,n);r.layers=this.layers,this.add(r);const s=new Wn(bo,So,e,n);s.layers=this.layers,this.add(s);const o=new Wn(bo,So,e,n);o.layers=this.layers,this.add(o);const a=new Wn(bo,So,e,n);a.layers=this.layers,this.add(a);const l=new Wn(bo,So,e,n);l.layers=this.layers,this.add(l);const c=new Wn(bo,So,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[i,r,s,o,a,l]=n;for(const c of n)this.remove(c);if(e===qi)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Xc)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const v=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(n,s),e.setRenderTarget(i,1,r),e.render(n,o),e.setRenderTarget(i,2,r),e.render(n,a),e.setRenderTarget(i,3,r),e.render(n,l),e.setRenderTarget(i,4,r),e.render(n,c),i.texture.generateMipmaps=v,e.setRenderTarget(i,5,r),e.render(n,u),e.setRenderTarget(d,f,h),e.xr.enabled=g,i.texture.needsPMREMUpdate=!0}}class zy extends zn{constructor(e=[],n=Ks,i,r,s,o,a,l,c,u){super(e,n,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Vy extends Ji{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new zy(r),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Ii extends oo{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=eP,this.fragmentShader=tP,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ea(e.uniforms),this.uniformsGroups=QC(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?n.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?n.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?n.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?n.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?n.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?n.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?n.uniforms[r]={type:"m4",value:o.toArray()}:n.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}let Ky=class extends Ut{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new yt,this.projectionMatrix=new yt,this.projectionMatrixInverse=new yt,this.coordinateSystem=Yi,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}};const Zr=new I,k0=new xe,B0=new xe;class qn extends Ky{constructor(e=50,n=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Qo*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Go*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Qo*2*Math.atan(Math.tan(Go*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,i){Zr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Zr.x,Zr.y).multiplyScalar(-e/Zr.z),Zr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Zr.x,Zr.y).multiplyScalar(-e/Zr.z)}getViewSize(e,n){return this.getViewBounds(e,k0,B0),n.subVectors(B0,k0)}setViewOffset(e,n,i,r,s,o){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Go*.5*this.fov)/this.zoom,i=2*n,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,n-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,n,n-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const Mo=-90,Eo=1;class nP extends Ut{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new qn(Mo,Eo,e,n);r.layers=this.layers,this.add(r);const s=new qn(Mo,Eo,e,n);s.layers=this.layers,this.add(s);const o=new qn(Mo,Eo,e,n);o.layers=this.layers,this.add(o);const a=new qn(Mo,Eo,e,n);a.layers=this.layers,this.add(a);const l=new qn(Mo,Eo,e,n);l.layers=this.layers,this.add(l);const c=new qn(Mo,Eo,e,n);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[i,r,s,o,a,l]=n;for(const c of n)this.remove(c);if(e===Yi)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Kc)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of n)this.add(c),c.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,u]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),g=e.xr.enabled;e.xr.enabled=!1;const v=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(n,s),e.setRenderTarget(i,1,r),e.render(n,o),e.setRenderTarget(i,2,r),e.render(n,a),e.setRenderTarget(i,3,r),e.render(n,l),e.setRenderTarget(i,4,r),e.render(n,c),i.texture.generateMipmaps=v,e.setRenderTarget(i,5,r),e.render(n,u),e.setRenderTarget(d,f,h),e.xr.enabled=g,i.texture.needsPMREMUpdate=!0}}class Zy extends Vn{constructor(e=[],n=Qs,i,r,s,o,a,l,c,u){super(e,n,i,r,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class jy extends ji{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Zy(r),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -39,9 +39,9 @@ gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new Kt(5,5,5),s=new Pi({name:"CubemapFromEquirect",uniforms:Zo(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:In,blending:Mr});s.uniforms.tEquirect.value=n;const o=new be(r,s),a=n.minFilter;return n.minFilter===Bs&&(n.minFilter=Pn),new nP(1,10,this).update(e,o),n.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,n=!0,i=!0,r=!0){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(n,i,r);e.setRenderTarget(s)}}class Xl extends Lt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const iP={type:"move"};class Md{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Xl,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Xl,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new I,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new I),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Xl,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new I,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new I),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const v of e.hand.values()){const m=n.getJointPose(v,i),p=this._getHandJoint(c,v);m!==null&&(p.matrix.fromArray(m.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=m.radius),p.visible=m!==null}const u=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=u.position.distanceTo(d.position),h=.02,g=.005;c.inputState.pinching&&f>h+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=h-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(iP)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new Xl;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class rP extends Lt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ci,this.environmentIntensity=1,this.environmentRotation=new Ci,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class sP extends zn{constructor(e=null,n=1,i=1,r,s,o,a,l,c=vn,u=vn,d,f){super(null,o,a,l,c,u,r,s,d,f),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const wd=new I,oP=new I,aP=new ft;let mr=class{constructor(e=new I(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=wd.subVectors(i,n).cross(oP.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(wd),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||aP.getNormalMatrix(e),r=this.coplanarPoint(wd).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const Ps=new dl,lP=new xe(.5,.5),$l=new I;class dp{constructor(e=new mr,n=new mr,i=new mr,r=new mr,s=new mr,o=new mr){this.planes=[e,n,i,r,s,o]}set(e,n,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=qi,i=!1){const r=this.planes,s=e.elements,o=s[0],a=s[1],l=s[2],c=s[3],u=s[4],d=s[5],f=s[6],h=s[7],g=s[8],v=s[9],m=s[10],p=s[11],_=s[12],x=s[13],y=s[14],w=s[15];if(r[0].setComponents(c-o,h-u,p-g,w-_).normalize(),r[1].setComponents(c+o,h+u,p+g,w+_).normalize(),r[2].setComponents(c+a,h+d,p+v,w+x).normalize(),r[3].setComponents(c-a,h-d,p-v,w-x).normalize(),i)r[4].setComponents(l,f,m,y).normalize(),r[5].setComponents(c-l,h-f,p-m,w-y).normalize();else if(r[4].setComponents(c-l,h-f,p-m,w-y).normalize(),n===qi)r[5].setComponents(c+l,h+f,p+m,w+y).normalize();else if(n===Xc)r[5].setComponents(l,f,m,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Ps.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Ps.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Ps)}intersectsSprite(e){Ps.center.set(0,0,0);const n=lP.distanceTo(e.center);return Ps.radius=.7071067811865476+n,Ps.applyMatrix4(e.matrixWorld),this.intersectsSphere(Ps)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)0?e.max.x:e.min.x,$l.y=r.normal.y>0?e.max.y:e.min.y,$l.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint($l)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class vi extends io{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new rt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Jc=new I,Kc=new I,Kg=new yt,ga=new fl,Yl=new dl,Ed=new I,Zg=new I;let hn=class extends Lt{constructor(e=new _t,n=new vi){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[0];for(let r=1,s=n.count;r0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;Ed.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(Ed);if(!(ce.far))return{distance:c,point:Zg.clone().applyMatrix4(t.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:t}}const jg=new I,Qg=new I;class fp extends hn{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[];for(let r=0,s=n.count;r0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class Ka extends zn{constructor(e,n,i=ji,r,s,o,a=vn,l=vn,c,u=Lr,d=1){if(u!==Lr&&u!==zs)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:n,depth:d};super(f,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new cp(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class cP extends Ka{constructor(e,n=ji,i=Ks,r,s,o=vn,a=vn,l,c=Lr){const u={width:e,height:e,depth:1},d=[u,u,u,u,u,u];super(e,e,n,i,r,s,o,a,l,c),this.image=d,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Hy extends zn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class mp extends _t{constructor(e=1,n=1,i=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:n,capSegments:i,radialSegments:r,heightSegments:s},n=Math.max(0,n),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),s=Math.max(1,Math.floor(s));const o=[],a=[],l=[],c=[],u=n/2,d=Math.PI/2*e,f=n,h=2*d+f,g=i*2+s,v=r+1,m=new I,p=new I;for(let _=0;_<=g;_++){let x=0,y=0,w=0,A=0;if(_<=i){const S=_/i,M=S*Math.PI/2;y=-u-e*Math.cos(M),w=e*Math.sin(M),A=-e*Math.cos(M),x=S*d}else if(_<=i+s){const S=(_-i)/s;y=-u+S*n,w=e,A=0,x=d+S*f}else{const S=(_-i-s)/i,M=S*Math.PI/2;y=u+e*Math.sin(M),w=e*Math.cos(M),A=e*Math.sin(M),x=d+f+S*d}const P=Math.max(0,Math.min(1,x/h));let D=0;_===0?D=.5/r:_===g&&(D=-.5/r);for(let S=0;S<=r;S++){const M=S/r,N=M*Math.PI*2,B=Math.sin(N),q=Math.cos(N);p.x=-w*q,p.y=y,p.z=w*B,a.push(p.x,p.y,p.z),m.set(-w*q,A,w*B),m.normalize(),l.push(m.x,m.y,m.z),c.push(M+D,P)}if(_>0){const S=(_-1)*v;for(let M=0;M0&&x(!0),n>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ct(d,3)),this.setAttribute("normal",new ct(f,3)),this.setAttribute("uv",new ct(h,2));function _(){const y=new I,w=new I;let A=0;const P=(n-e)/i;for(let D=0;D<=s;D++){const S=[],M=D/s,N=M*(n-e)+e;for(let B=0;B<=r;B++){const q=B/r,K=q*l+a,$=Math.sin(K),W=Math.cos(K);w.x=N*$,w.y=-M*i+m,w.z=N*W,d.push(w.x,w.y,w.z),y.set($,P,W).normalize(),f.push(y.x,y.y,y.z),h.push(q,1-M),S.push(g++)}v.push(S)}for(let D=0;D0||S!==0)&&(u.push(M,N,q),A+=3),(n>0||S!==s-1)&&(u.push(N,B,q),A+=3)}c.addGroup(p,A,0),p+=A}function x(y){const w=g,A=new xe,P=new I;let D=0;const S=y===!0?e:n,M=y===!0?1:-1;for(let B=1;B<=r;B++)d.push(0,m*M,0),f.push(0,M,0),h.push(.5,.5),g++;const N=g;for(let B=0;B<=r;B++){const K=B/r*l+a,$=Math.cos(K),W=Math.sin(K);P.x=S*W,P.y=m*M,P.z=S*$,d.push(P.x,P.y,P.z),f.push(0,M,0),A.x=$*.5+.5,A.y=W*.5*M+.5,h.push(A.x,A.y),g++}for(let B=0;B.9&&P<.1&&(x<.2&&(o[_+0]+=1),y<.2&&(o[_+2]+=1),w<.2&&(o[_+4]+=1))}}function f(_){s.push(_.x,_.y,_.z)}function h(_,x){const y=_*3;x.x=e[y+0],x.y=e[y+1],x.z=e[y+2]}function g(){const _=new I,x=new I,y=new I,w=new I,A=new xe,P=new xe,D=new xe;for(let S=0,M=0;S0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],f=i[r+1]-u,h=(o-u)/f;return(r+h)/(s-1)}getTangent(e,n){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=n||(o.isVector2?new xe:new I);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,n){const i=this.getUtoTmapping(e);return this.getTangent(i,n)}computeFrenetFrames(e,n=!1){const i=new I,r=[],s=[],o=[],a=new I,l=new yt;for(let h=0;h<=e;h++){const g=h/e;r[h]=this.getTangentAt(g,new I)}s[0]=new I,o[0]=new I;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),d=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),d<=c&&(c=d,i.set(0,1,0)),f<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let h=1;h<=e;h++){if(s[h]=s[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(r[h-1],r[h]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(ht(r[h-1].dot(r[h]),-1,1));s[h].applyMatrix4(l.makeRotationAxis(a,g))}o[h].crossVectors(r[h],s[h])}if(n===!0){let h=Math.acos(ht(s[0].dot(s[e]),-1,1));h/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(h=-h);for(let g=1;g<=e;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],h*g)),o[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class _p extends nr{constructor(e=0,n=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,n=new xe){const i=n,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(tc.subVectors(r[0],r[1]).add(r[0]),c=tc);const d=r[a%s],f=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(n0(a,l.x,c.x,u.x,d.x),n0(a,l.y,c.y,u.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.points.length;n=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,n)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let i=0,r=this.curves.length;i1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,i=e.curves.length;n0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class wc extends dh{constructor(e){super(e),this.uuid=no(),this.type="Shape",this.holes=[]}getPointsHoles(e){const n=[];for(let i=0,r=this.holes.length;i80*n){a=t[0],l=t[1];let u=a,d=l;for(let f=n;fu&&(u=h),g>d&&(d=g)}c=Math.max(u-a,d-l),c=c!==0?32767/c:0}return Za(s,o,n,a,l,c,0),o}function $y(t,e,n,i,r){let s;if(r===zP(t,e,n,i)>0)for(let o=e;o=e;o-=i)s=i0(o/i|0,t[o],t[o+1],s);return s&&jo(s,s.next)&&(Qa(s),s=s.next),s}function Zs(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(jo(n,n.next)||Xt(n.prev,n,n.next)===0)){if(Qa(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function Za(t,e,n,i,r,s,o){if(!t)return;!o&&s&&LP(t,i,r,s);let a=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(s?TP(t,i,r,s):EP(t)){e.push(l.i,t.i,c.i),Qa(t),t=c.next,a=c.next;continue}if(t=c,t===a){o?o===1?(t=AP(Zs(t),e),Za(t,e,n,i,r,s,2)):o===2&&CP(t,e,n,i,r,s):Za(Zs(t),e,n,i,r,s,1);break}}}function EP(t){const e=t.prev,n=t,i=t.next;if(Xt(e,n,i)>=0)return!1;const r=e.x,s=n.x,o=i.x,a=e.y,l=n.y,c=i.y,u=Math.min(r,s,o),d=Math.min(a,l,c),f=Math.max(r,s,o),h=Math.max(a,l,c);let g=i.next;for(;g!==e;){if(g.x>=u&&g.x<=f&&g.y>=d&&g.y<=h&&Ma(r,a,s,l,o,c,g.x,g.y)&&Xt(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function TP(t,e,n,i){const r=t.prev,s=t,o=t.next;if(Xt(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,d=s.y,f=o.y,h=Math.min(a,l,c),g=Math.min(u,d,f),v=Math.max(a,l,c),m=Math.max(u,d,f),p=fh(h,g,e,n,i),_=fh(v,m,e,n,i);let x=t.prevZ,y=t.nextZ;for(;x&&x.z>=p&&y&&y.z<=_;){if(x.x>=h&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&Ma(a,u,l,d,c,f,x.x,x.y)&&Xt(x.prev,x,x.next)>=0||(x=x.prevZ,y.x>=h&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&Ma(a,u,l,d,c,f,y.x,y.y)&&Xt(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;x&&x.z>=p;){if(x.x>=h&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&Ma(a,u,l,d,c,f,x.x,x.y)&&Xt(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;y&&y.z<=_;){if(y.x>=h&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&Ma(a,u,l,d,c,f,y.x,y.y)&&Xt(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function AP(t,e){let n=t;do{const i=n.prev,r=n.next.next;!jo(i,r)&&Jy(i,n,n.next,r)&&ja(i,r)&&ja(r,i)&&(e.push(i.i,n.i,r.i),Qa(n),Qa(n.next),n=t=r),n=n.next}while(n!==t);return Zs(n)}function CP(t,e,n,i,r,s){let o=t;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&UP(o,a)){let l=Ky(o,a);o=Zs(o,o.next),l=Zs(l,l.next),Za(o,e,n,i,r,s,0),Za(l,e,n,i,r,s,0);return}a=a.next}o=o.next}while(o!==t)}function PP(t,e,n,i){const r=[];for(let s=0,o=e.length;s=n.next.y&&n.next.y!==n.y){const d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>s&&(s=d,o=n.x=n.x&&n.x>=l&&i!==n.x&&Yy(ro.x||n.x===o.x&&NP(o,n)))&&(o=n,u=d)}n=n.next}while(n!==a);return o}function NP(t,e){return Xt(t.prev,t,e.prev)<0&&Xt(e.next,t,t.next)<0}function LP(t,e,n,i){let r=t;do r.z===0&&(r.z=fh(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,OP(r)}function OP(t){let e,n=1;do{let i=t,r;t=null;let s=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=o}s.nextZ=null,n*=2}while(e>1);return t}function fh(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function FP(t){let e=t,n=t;do(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(n-o)*(e-a)&&(n-o)*(s-a)>=(r-o)*(i-a)}function Ma(t,e,n,i,r,s,o,a){return!(t===o&&e===a)&&Yy(t,e,n,i,r,s,o,a)}function UP(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!kP(t,e)&&(ja(t,e)&&ja(e,t)&&BP(t,e)&&(Xt(t.prev,t,e.prev)||Xt(t,e.prev,e))||jo(t,e)&&Xt(t.prev,t,t.next)>0&&Xt(e.prev,e,e.next)>0)}function Xt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function jo(t,e){return t.x===e.x&&t.y===e.y}function Jy(t,e,n,i){const r=ic(Xt(t,e,n)),s=ic(Xt(t,e,i)),o=ic(Xt(n,i,t)),a=ic(Xt(n,i,e));return!!(r!==s&&o!==a||r===0&&nc(t,n,e)||s===0&&nc(t,i,e)||o===0&&nc(n,t,i)||a===0&&nc(n,e,i))}function nc(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function ic(t){return t>0?1:t<0?-1:0}function kP(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Jy(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function ja(t,e){return Xt(t.prev,t,t.next)<0?Xt(t,e,t.next)>=0&&Xt(t,t.prev,e)>=0:Xt(t,e,t.prev)<0||Xt(t,t.next,e)<0}function BP(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function Ky(t,e){const n=hh(t.i,t.x,t.y),i=hh(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function i0(t,e,n,i){const r=hh(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Qa(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function hh(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function zP(t,e,n,i){let r=0;for(let s=e,o=n-i;s2&&t[e-1].equals(t[0])&&t.pop()}function s0(t,e){for(let n=0;nNumber.EPSILON){const J=Math.sqrt(b),se=Math.sqrt(oe*oe+E*E),Z=G.x-ee/J,Ce=G.y+Q/J,ve=V.x-E/se,Ne=V.y+oe/se,$e=((ve-Z)*E-(Ne-Ce)*oe)/(Q*E-ee*oe);Y=Z+Q*$e-F.x,C=Ce+ee*$e-F.y;const me=Y*Y+C*C;if(me<=2)return new xe(Y,C);ae=Math.sqrt(me/2)}else{let J=!1;Q>Number.EPSILON?oe>Number.EPSILON&&(J=!0):Q<-Number.EPSILON?oe<-Number.EPSILON&&(J=!0):Math.sign(ee)===Math.sign(E)&&(J=!0),J?(Y=-ee,C=Q,ae=Math.sqrt(b)):(Y=Q,C=ee,ae=Math.sqrt(b/2))}return new xe(Y/ae,C/ae)}const de=[];for(let F=0,G=$.length,V=G-1,Y=F+1;F=0;F--){const G=F/m,V=h*Math.cos(G*Math.PI/2),Y=g*Math.sin(G*Math.PI/2)+v;for(let C=0,ae=$.length;C=0;){const Y=V;let C=V-1;C<0&&(C=F.length-1);for(let ae=0,Q=u+m*2;ae0)&&h.push(x,y,A),(p!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class XP extends io{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=uC,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class $P extends io{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const o0={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class YP{constructor(e,n,i){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=i,this._abortController=null,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,d){return c.push(u,d),this},this.removeHandler=function(u){const d=c.indexOf(u);return d!==-1&&c.splice(d,2),this},this.getHandler=function(u){for(let d=0,f=c.length;d{n&&n(s),this.manager.itemEnd(e)},0),s;if(fr[e]!==void 0){fr[e].push({onLoad:n,onProgress:i,onError:r});return}fr[e]=[],fr[e].push({onLoad:n,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&tt("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=fr[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),h=f?parseInt(f):0,g=h!==0;let v=0;const m=new ReadableStream({start(p){_();function _(){d.read().then(({done:x,value:y})=>{if(x)p.close();else{v+=y.byteLength;const w=new ProgressEvent("progress",{lengthComputable:g,loaded:v,total:h});for(let A=0,P=u.length;A{p.error(x)})}}});return new Response(m)}else throw new KP(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a==="")return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),f=d&&d[1]?d[1].toLowerCase():void 0,h=new TextDecoder(f);return c.arrayBuffer().then(g=>h.decode(g))}}}).then(c=>{o0.add(`file:${e}`,c);const u=fr[e];delete fr[e];for(let d=0,f=u.length;d{const u=fr[e];if(u===void 0)throw this.manager.itemError(e),c;delete fr[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class ml extends Lt{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new rt(e),this.intensity=n}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}const Rd=new yt,a0=new I,l0=new I;class Sp{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xe(512,512),this.mapType=Qn,this.map=null,this.mapPass=null,this.matrix=new yt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new dp,this._frameExtents=new xe(1,1),this._viewportCount=1,this._viewports=[new Zt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;a0.setFromMatrixPosition(e.matrixWorld),n.position.copy(a0),l0.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(l0),n.updateMatrixWorld(),Rd.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Rd,n.coordinateSystem,n.reversedDepth),n.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Rd)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class jP extends Sp{constructor(){super(new Wn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,i=Ko*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=e.distance||n.far;(i!==n.fov||r!==n.aspect||s!==n.far)&&(n.fov=i,n.aspect=r,n.far=s,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class QP extends ml{constructor(e,n,i=0,r=Math.PI/3,s=0,o=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Lt.DEFAULT_UP),this.updateMatrix(),this.target=new Lt,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new jP}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.distance=this.distance,n.object.angle=this.angle,n.object.decay=this.decay,n.object.penumbra=this.penumbra,n.object.target=this.target.uuid,this.map&&this.map.isTexture&&(n.object.map=this.map.toJSON(e).uuid),n.object.shadow=this.shadow.toJSON(),n}}class eR extends Sp{constructor(){super(new Wn(90,1,.5,500)),this.isPointLightShadow=!0}}class tR extends ml{constructor(e,n,i=0,r=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new eR}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.distance=this.distance,n.object.decay=this.decay,n.object.shadow=this.shadow.toJSON(),n}}class Mp extends By{constructor(e=-1,n=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+n,l=r-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class nR extends Sp{constructor(){super(new Mp(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Zy extends ml{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Lt.DEFAULT_UP),this.updateMatrix(),this.target=new Lt,this.shadow=new nR}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}class jy extends ml{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class iR extends ml{constructor(e,n,i=10,r=10){super(e,n),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const n=super.toJSON(e);return n.object.width=this.width,n.object.height=this.height,n}}class rR extends Wn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const c0=new yt;class Qy{constructor(e,n,i=0,r=1/0){this.ray=new fl(e,n),this.near=i,this.far=r,this.camera=null,this.layers=new up,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,n){this.ray.set(e,n)}setFromCamera(e,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):bt("Raycaster: Unsupported camera type: "+n.type)}setFromXRController(e){return c0.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(c0),this}intersectObject(e,n=!0,i=[]){return ph(e,this,i,n),i.sort(u0),i}intersectObjects(e,n=!0,i=[]){for(let r=0,s=e.length;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{m0.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(m0,n)}}setLength(e,n=e*.2,i=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(i,n,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class eb extends fp{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new _t;r.setAttribute("position",new ct(n,3)),r.setAttribute("color",new ct(i,3));const s=new vi({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,n,i){const r=new rt,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(n),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class cR{constructor(){this.type="ShapePath",this.color=new rt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new dh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,i,r){return this.currentPath.quadraticCurveTo(e,n,i,r),this}bezierCurveTo(e,n,i,r,s,o){return this.currentPath.bezierCurveTo(e,n,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(p){const _=[];for(let x=0,y=p.length;xNumber.EPSILON){if(M<0&&(P=_[A],S=-S,D=_[w],M=-M),p.yD.y)continue;if(p.y===P.y){if(p.x===P.x)return!0}else{const N=M*(p.x-P.x)-S*(p.y-P.y);if(N===0)return!0;if(N<0)continue;y=!y}}else{if(p.y!==P.y)continue;if(D.x<=p.x&&p.x<=P.x||P.x<=p.x&&p.x<=D.x)return!0}}return y}const r=Vs.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new wc,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const d=[],f=[];let h=[],g=0,v;f[g]=void 0,h[g]=[];for(let p=0,_=s.length;p<_;p++)a=s[p],v=a.getPoints(),o=r(v),o=e?!o:o,o?(!u&&f[g]&&g++,f[g]={s:new wc,p:v},f[g].s.curves=a.curves,u&&g++,h[g]=[]):h[g].push({h:a,p:v[0]});if(!f[0])return n(s);if(f.length>1){let p=!1,_=0;for(let x=0,y=f.length;x0&&p===!1&&(h=d)}let m;for(let p=0,_=f.length;p<_;p++){l=f[p].s,c.push(l),m=h[p];for(let x=0,y=m.length;xh.start-g.start);let f=0;for(let h=1;hh+g?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&f<=h-g&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=n.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(iP)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new Kl;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class rP extends Ut{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Di,this.environmentIntensity=1,this.environmentRotation=new Di,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class sP extends Vn{constructor(e=null,n=1,i=1,r,s,o,a,l,c=yn,u=yn,d,f){super(null,o,a,l,c,u,r,s,d,f),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ld=new I,oP=new I,aP=new ht;let _r=class{constructor(e=new I(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,r){return this.normal.set(e,n,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const r=Ld.subVectors(i,n).cross(oP.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(Ld),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:n.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||aP.getNormalMatrix(e),r=this.coplanarPoint(Ld).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}};const Is=new ml,lP=new xe(.5,.5),Zl=new I;class Bp{constructor(e=new _r,n=new _r,i=new _r,r=new _r,s=new _r,o=new _r){this.planes=[e,n,i,r,s,o]}set(e,n,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=Yi,i=!1){const r=this.planes,s=e.elements,o=s[0],a=s[1],l=s[2],c=s[3],u=s[4],d=s[5],f=s[6],h=s[7],g=s[8],v=s[9],m=s[10],p=s[11],_=s[12],x=s[13],y=s[14],E=s[15];if(r[0].setComponents(c-o,h-u,p-g,E-_).normalize(),r[1].setComponents(c+o,h+u,p+g,E+_).normalize(),r[2].setComponents(c+a,h+d,p+v,E+x).normalize(),r[3].setComponents(c-a,h-d,p-v,E-x).normalize(),i)r[4].setComponents(l,f,m,y).normalize(),r[5].setComponents(c-l,h-f,p-m,E-y).normalize();else if(r[4].setComponents(c-l,h-f,p-m,E-y).normalize(),n===Yi)r[5].setComponents(c+l,h+f,p+m,E+y).normalize();else if(n===Kc)r[5].setComponents(l,f,m,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Is.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Is.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Is)}intersectsSprite(e){Is.center.set(0,0,0);const n=lP.distanceTo(e.center);return Is.radius=.7071067811865476+n,Is.applyMatrix4(e.matrixWorld),this.intersectsSphere(Is)}intersectsSphere(e){const n=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)0?e.max.x:e.min.x,Zl.y=r.normal.y>0?e.max.y:e.min.y,Zl.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Zl)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class xi extends oo{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new st(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const Qc=new I,eu=new I,z0=new yt,va=new gl,jl=new ml,Od=new I,V0=new I;let gn=class extends Ut{constructor(e=new bt,n=new xi){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[0];for(let r=1,s=n.count;r0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;Od.applyMatrix4(t.matrixWorld);const c=e.ray.origin.distanceTo(Od);if(!(ce.far))return{distance:c,point:V0.clone().applyMatrix4(t.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:t}}const H0=new I,G0=new I;class zp extends gn{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[];for(let r=0,s=n.count;r0){const r=n[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class tl extends Vn{constructor(e,n,i=tr,r,s,o,a=yn,l=yn,c,u=Fr,d=1){if(u!==Fr&&u!==Gs)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const f={width:e,height:n,depth:d};super(f,r,s,o,a,l,u,i,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Up(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class cP extends tl{constructor(e,n=tr,i=Qs,r,s,o=yn,a=yn,l,c=Fr){const u={width:e,height:e,depth:1},d=[u,u,u,u,u,u];super(e,e,n,i,r,s,o,a,l,c),this.image=d,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Qy extends Vn{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Gp extends bt{constructor(e=1,n=1,i=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:n,capSegments:i,radialSegments:r,heightSegments:s},n=Math.max(0,n),i=Math.max(1,Math.floor(i)),r=Math.max(3,Math.floor(r)),s=Math.max(1,Math.floor(s));const o=[],a=[],l=[],c=[],u=n/2,d=Math.PI/2*e,f=n,h=2*d+f,g=i*2+s,v=r+1,m=new I,p=new I;for(let _=0;_<=g;_++){let x=0,y=0,E=0,A=0;if(_<=i){const S=_/i,w=S*Math.PI/2;y=-u-e*Math.cos(w),E=e*Math.sin(w),A=-e*Math.cos(w),x=S*d}else if(_<=i+s){const S=(_-i)/s;y=-u+S*n,E=e,A=0,x=d+S*f}else{const S=(_-i-s)/i,w=S*Math.PI/2;y=u+e*Math.sin(w),E=e*Math.cos(w),A=e*Math.sin(w),x=d+f+S*d}const P=Math.max(0,Math.min(1,x/h));let D=0;_===0?D=.5/r:_===g&&(D=-.5/r);for(let S=0;S<=r;S++){const w=S/r,N=w*Math.PI*2,B=Math.sin(N),W=Math.cos(N);p.x=-E*W,p.y=y,p.z=E*B,a.push(p.x,p.y,p.z),m.set(-E*W,A,E*B),m.normalize(),l.push(m.x,m.y,m.z),c.push(w+D,P)}if(_>0){const S=(_-1)*v;for(let w=0;w0&&x(!0),n>0&&x(!1)),this.setIndex(u),this.setAttribute("position",new ut(d,3)),this.setAttribute("normal",new ut(f,3)),this.setAttribute("uv",new ut(h,2));function _(){const y=new I,E=new I;let A=0;const P=(n-e)/i;for(let D=0;D<=s;D++){const S=[],w=D/s,N=w*(n-e)+e;for(let B=0;B<=r;B++){const W=B/r,Z=W*l+a,X=Math.sin(Z),H=Math.cos(Z);E.x=N*X,E.y=-w*i+m,E.z=N*H,d.push(E.x,E.y,E.z),y.set(X,P,H).normalize(),f.push(y.x,y.y,y.z),h.push(W,1-w),S.push(g++)}v.push(S)}for(let D=0;D0||S!==0)&&(u.push(w,N,W),A+=3),(n>0||S!==s-1)&&(u.push(N,B,W),A+=3)}c.addGroup(p,A,0),p+=A}function x(y){const E=g,A=new xe,P=new I;let D=0;const S=y===!0?e:n,w=y===!0?1:-1;for(let B=1;B<=r;B++)d.push(0,m*w,0),f.push(0,w,0),h.push(.5,.5),g++;const N=g;for(let B=0;B<=r;B++){const Z=B/r*l+a,X=Math.cos(Z),H=Math.sin(Z);P.x=S*H,P.y=m*w,P.z=S*X,d.push(P.x,P.y,P.z),f.push(0,w,0),A.x=X*.5+.5,A.y=H*.5*w+.5,h.push(A.x,A.y),g++}for(let B=0;B.9&&P<.1&&(x<.2&&(o[_+0]+=1),y<.2&&(o[_+2]+=1),E<.2&&(o[_+4]+=1))}}function f(_){s.push(_.x,_.y,_.z)}function h(_,x){const y=_*3;x.x=e[y+0],x.y=e[y+1],x.z=e[y+2]}function g(){const _=new I,x=new I,y=new I,E=new I,A=new xe,P=new xe,D=new xe;for(let S=0,w=0;S0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const u=i[r],f=i[r+1]-u,h=(o-u)/f;return(r+h)/(s-1)}getTangent(e,n){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=n||(o.isVector2?new xe:new I);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,n){const i=this.getUtoTmapping(e);return this.getTangent(i,n)}computeFrenetFrames(e,n=!1){const i=new I,r=[],s=[],o=[],a=new I,l=new yt;for(let h=0;h<=e;h++){const g=h/e;r[h]=this.getTangentAt(g,new I)}s[0]=new I,o[0]=new I;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),d=Math.abs(r[0].y),f=Math.abs(r[0].z);u<=c&&(c=u,i.set(1,0,0)),d<=c&&(c=d,i.set(0,1,0)),f<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let h=1;h<=e;h++){if(s[h]=s[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(r[h-1],r[h]),a.length()>Number.EPSILON){a.normalize();const g=Math.acos(pt(r[h-1].dot(r[h]),-1,1));s[h].applyMatrix4(l.makeRotationAxis(a,g))}o[h].crossVectors(r[h],s[h])}if(n===!0){let h=Math.acos(pt(s[0].dot(s[e]),-1,1));h/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(h=-h);for(let g=1;g<=e;g++)s[g].applyMatrix4(l.makeRotationAxis(r[g],h*g)),o[g].crossVectors(r[g],s[g])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Xp extends sr{constructor(e=0,n=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,n=new xe){const i=n,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=r[(a-1)%s]:(sc.subVectors(r[0],r[1]).add(r[0]),c=sc);const d=r[a%s],f=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(X0(a,l.x,c.x,u.x,d.x),X0(a,l.y,c.y,u.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.points.length;n=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,n)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let i=0,r=this.curves.length;i1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,i=e.curves.length;n0){const d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Rc extends gh{constructor(e){super(e),this.uuid=so(),this.type="Shape",this.holes=[]}getPointsHoles(e){const n=[];for(let i=0,r=this.holes.length;i80*n){a=t[0],l=t[1];let u=a,d=l;for(let f=n;fu&&(u=h),g>d&&(d=g)}c=Math.max(u-a,d-l),c=c!==0?32767/c:0}return nl(s,o,n,a,l,c,0),o}function rb(t,e,n,i,r){let s;if(r===zP(t,e,n,i)>0)for(let o=e;o=e;o-=i)s=$0(o/i|0,t[o],t[o+1],s);return s&&ta(s,s.next)&&(rl(s),s=s.next),s}function eo(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(ta(n,n.next)||$t(n.prev,n,n.next)===0)){if(rl(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function nl(t,e,n,i,r,s,o){if(!t)return;!o&&s&&LP(t,i,r,s);let a=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(s?TP(t,i,r,s):EP(t)){e.push(l.i,t.i,c.i),rl(t),t=c.next,a=c.next;continue}if(t=c,t===a){o?o===1?(t=AP(eo(t),e),nl(t,e,n,i,r,s,2)):o===2&&CP(t,e,n,i,r,s):nl(eo(t),e,n,i,r,s,1);break}}}function EP(t){const e=t.prev,n=t,i=t.next;if($t(e,n,i)>=0)return!1;const r=e.x,s=n.x,o=i.x,a=e.y,l=n.y,c=i.y,u=Math.min(r,s,o),d=Math.min(a,l,c),f=Math.max(r,s,o),h=Math.max(a,l,c);let g=i.next;for(;g!==e;){if(g.x>=u&&g.x<=f&&g.y>=d&&g.y<=h&&Pa(r,a,s,l,o,c,g.x,g.y)&&$t(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function TP(t,e,n,i){const r=t.prev,s=t,o=t.next;if($t(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,u=r.y,d=s.y,f=o.y,h=Math.min(a,l,c),g=Math.min(u,d,f),v=Math.max(a,l,c),m=Math.max(u,d,f),p=vh(h,g,e,n,i),_=vh(v,m,e,n,i);let x=t.prevZ,y=t.nextZ;for(;x&&x.z>=p&&y&&y.z<=_;){if(x.x>=h&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&Pa(a,u,l,d,c,f,x.x,x.y)&&$t(x.prev,x,x.next)>=0||(x=x.prevZ,y.x>=h&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&Pa(a,u,l,d,c,f,y.x,y.y)&&$t(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;x&&x.z>=p;){if(x.x>=h&&x.x<=v&&x.y>=g&&x.y<=m&&x!==r&&x!==o&&Pa(a,u,l,d,c,f,x.x,x.y)&&$t(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;y&&y.z<=_;){if(y.x>=h&&y.x<=v&&y.y>=g&&y.y<=m&&y!==r&&y!==o&&Pa(a,u,l,d,c,f,y.x,y.y)&&$t(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function AP(t,e){let n=t;do{const i=n.prev,r=n.next.next;!ta(i,r)&&ob(i,n,n.next,r)&&il(i,r)&&il(r,i)&&(e.push(i.i,n.i,r.i),rl(n),rl(n.next),n=t=r),n=n.next}while(n!==t);return eo(n)}function CP(t,e,n,i,r,s){let o=t;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&UP(o,a)){let l=ab(o,a);o=eo(o,o.next),l=eo(l,l.next),nl(o,e,n,i,r,s,0),nl(l,e,n,i,r,s,0);return}a=a.next}o=o.next}while(o!==t)}function PP(t,e,n,i){const r=[];for(let s=0,o=e.length;s=n.next.y&&n.next.y!==n.y){const d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>s&&(s=d,o=n.x=n.x&&n.x>=l&&i!==n.x&&sb(ro.x||n.x===o.x&&NP(o,n)))&&(o=n,u=d)}n=n.next}while(n!==a);return o}function NP(t,e){return $t(t.prev,t,e.prev)<0&&$t(e.next,t,t.next)<0}function LP(t,e,n,i){let r=t;do r.z===0&&(r.z=vh(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,OP(r)}function OP(t){let e,n=1;do{let i=t,r;t=null;let s=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,a--):(r=o,o=o.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=o}s.nextZ=null,n*=2}while(e>1);return t}function vh(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function FP(t){let e=t,n=t;do(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(n-o)*(e-a)&&(n-o)*(s-a)>=(r-o)*(i-a)}function Pa(t,e,n,i,r,s,o,a){return!(t===o&&e===a)&&sb(t,e,n,i,r,s,o,a)}function UP(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!kP(t,e)&&(il(t,e)&&il(e,t)&&BP(t,e)&&($t(t.prev,t,e.prev)||$t(t,e.prev,e))||ta(t,e)&&$t(t.prev,t,t.next)>0&&$t(e.prev,e,e.next)>0)}function $t(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ta(t,e){return t.x===e.x&&t.y===e.y}function ob(t,e,n,i){const r=ac($t(t,e,n)),s=ac($t(t,e,i)),o=ac($t(n,i,t)),a=ac($t(n,i,e));return!!(r!==s&&o!==a||r===0&&oc(t,n,e)||s===0&&oc(t,i,e)||o===0&&oc(n,t,i)||a===0&&oc(n,e,i))}function oc(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function ac(t){return t>0?1:t<0?-1:0}function kP(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ob(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function il(t,e){return $t(t.prev,t,t.next)<0?$t(t,e,t.next)>=0&&$t(t,t.prev,e)>=0:$t(t,e,t.prev)<0||$t(t,t.next,e)<0}function BP(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function ab(t,e){const n=_h(t.i,t.x,t.y),i=_h(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function $0(t,e,n,i){const r=_h(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function rl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function _h(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function zP(t,e,n,i){let r=0;for(let s=e,o=n-i;s2&&t[e-1].equals(t[0])&&t.pop()}function J0(t,e){for(let n=0;nNumber.EPSILON){const K=Math.sqrt(b),ae=Math.sqrt(le*le+T*T),j=G.x-te/K,Ae=G.y+ee/K,ve=z.x-T/ae,Le=z.y+le/ae,Ye=((ve-j)*T-(Le-Ae)*le)/(ee*T-te*le);$=j+ee*Ye-O.x,C=Ae+te*Ye-O.y;const ge=$*$+C*C;if(ge<=2)return new xe($,C);ce=Math.sqrt(ge/2)}else{let K=!1;ee>Number.EPSILON?le>Number.EPSILON&&(K=!0):ee<-Number.EPSILON?le<-Number.EPSILON&&(K=!0):Math.sign(te)===Math.sign(T)&&(K=!0),K?($=-te,C=ee,ce=Math.sqrt(b)):($=ee,C=te,ce=Math.sqrt(b/2))}return new xe($/ce,C/ce)}const ue=[];for(let O=0,G=X.length,z=G-1,$=O+1;O=0;O--){const G=O/m,z=h*Math.cos(G*Math.PI/2),$=g*Math.sin(G*Math.PI/2)+v;for(let C=0,ce=X.length;C=0;){const $=z;let C=z-1;C<0&&(C=O.length-1);for(let ce=0,ee=u+m*2;ce0)&&h.push(x,y,A),(p!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class XP extends oo{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=uC,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class $P extends oo{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const K0={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class YP{constructor(e,n,i){const r=this;let s=!1,o=0,a=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=i,this._abortController=null,this.itemStart=function(u){a++,s===!1&&r.onStart!==void 0&&r.onStart(u,o,a),s=!0},this.itemEnd=function(u){o++,r.onProgress!==void 0&&r.onProgress(u,o,a),o===a&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,d){return c.push(u,d),this},this.removeHandler=function(u){const d=c.indexOf(u);return d!==-1&&c.splice(d,2),this},this.getHandler=function(u){for(let d=0,f=c.length;d{n&&n(s),this.manager.itemEnd(e)},0),s;if(mr[e]!==void 0){mr[e].push({onLoad:n,onProgress:i,onError:r});return}mr[e]=[],mr[e].push({onLoad:n,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&nt("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=mr[e],d=c.body.getReader(),f=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),h=f?parseInt(f):0,g=h!==0;let v=0;const m=new ReadableStream({start(p){_();function _(){d.read().then(({done:x,value:y})=>{if(x)p.close();else{v+=y.byteLength;const E=new ProgressEvent("progress",{lengthComputable:g,loaded:v,total:h});for(let A=0,P=u.length;A{p.error(x)})}}});return new Response(m)}else throw new KP(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a==="")return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),f=d&&d[1]?d[1].toLowerCase():void 0,h=new TextDecoder(f);return c.arrayBuffer().then(g=>h.decode(g))}}}).then(c=>{K0.add(`file:${e}`,c);const u=mr[e];delete mr[e];for(let d=0,f=u.length;d{const u=mr[e];if(u===void 0)throw this.manager.itemError(e),c;delete mr[e];for(let d=0,f=u.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class xl extends Ut{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new st(e),this.intensity=n}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,n}}const zd=new yt,Z0=new I,j0=new I;class Kp{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new xe(512,512),this.mapType=ni,this.map=null,this.mapPass=null,this.matrix=new yt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Bp,this._frameExtents=new xe(1,1),this._viewportCount=1,this._viewports=[new jt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;Z0.setFromMatrixPosition(e.matrixWorld),n.position.copy(Z0),j0.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(j0),n.updateMatrixWorld(),zd.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(zd,n.coordinateSystem,n.reversedDepth),n.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(zd)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class jP extends Kp{constructor(){super(new qn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,i=Qo*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=e.distance||n.far;(i!==n.fov||r!==n.aspect||s!==n.far)&&(n.fov=i,n.aspect=r,n.far=s,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class QP extends xl{constructor(e,n,i=0,r=Math.PI/3,s=0,o=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Ut.DEFAULT_UP),this.updateMatrix(),this.target=new Ut,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new jP}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.distance=this.distance,n.object.angle=this.angle,n.object.decay=this.decay,n.object.penumbra=this.penumbra,n.object.target=this.target.uuid,this.map&&this.map.isTexture&&(n.object.map=this.map.toJSON(e).uuid),n.object.shadow=this.shadow.toJSON(),n}}class e2 extends Kp{constructor(){super(new qn(90,1,.5,500)),this.isPointLightShadow=!0}}class t2 extends xl{constructor(e,n,i=0,r=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new e2}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.distance=this.distance,n.object.decay=this.decay,n.object.shadow=this.shadow.toJSON(),n}}class Zp extends Ky{constructor(e=-1,n=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+n,l=r-n;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class n2 extends Kp{constructor(){super(new Zp(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class lb extends xl{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Ut.DEFAULT_UP),this.updateMatrix(),this.target=new Ut,this.shadow=new n2}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const n=super.toJSON(e);return n.object.shadow=this.shadow.toJSON(),n.object.target=this.target.uuid,n}}class cb extends xl{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class i2 extends xl{constructor(e,n,i=10,r=10){super(e,n),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const n=super.toJSON(e);return n.object.width=this.width,n.object.height=this.height,n}}class r2 extends qn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const Q0=new yt;class ub{constructor(e,n,i=0,r=1/0){this.ray=new gl(e,n),this.near=i,this.far=r,this.camera=null,this.layers=new kp,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,n){this.ray.set(e,n)}setFromCamera(e,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):St("Raycaster: Unsupported camera type: "+n.type)}setFromXRController(e){return Q0.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Q0),this}intersectObject(e,n=!0,i=[]){return xh(e,this,i,n),i.sort(ev),i}intersectObjects(e,n=!0,i=[]){for(let r=0,s=e.length;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{sv.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(sv,n)}}setLength(e,n=e*.2,i=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(i,n,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class db extends zp{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new bt;r.setAttribute("position",new ut(n,3)),r.setAttribute("color",new ut(i,3));const s=new xi({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,n,i){const r=new st,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(n),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class l2{constructor(){this.type="ShapePath",this.color=new st,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new gh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,i,r){return this.currentPath.quadraticCurveTo(e,n,i,r),this}bezierCurveTo(e,n,i,r,s,o){return this.currentPath.bezierCurveTo(e,n,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(p){const _=[];for(let x=0,y=p.length;xNumber.EPSILON){if(w<0&&(P=_[A],S=-S,D=_[E],w=-w),p.yD.y)continue;if(p.y===P.y){if(p.x===P.x)return!0}else{const N=w*(p.x-P.x)-S*(p.y-P.y);if(N===0)return!0;if(N<0)continue;y=!y}}else{if(p.y!==P.y)continue;if(D.x<=p.x&&p.x<=P.x||P.x<=p.x&&p.x<=D.x)return!0}}return y}const r=Ws.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new Rc,l.curves=a.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const d=[],f=[];let h=[],g=0,v;f[g]=void 0,h[g]=[];for(let p=0,_=s.length;p<_;p++)a=s[p],v=a.getPoints(),o=r(v),o=e?!o:o,o?(!u&&f[g]&&g++,f[g]={s:new Rc,p:v},f[g].s.curves=a.curves,u&&g++,h[g]=[]):h[g].push({h:a,p:v[0]});if(!f[0])return n(s);if(f.length>1){let p=!1,_=0;for(let x=0,y=f.length;x0&&p===!1&&(h=d)}let m;for(let p=0,_=f.length;p<_;p++){l=f[p].s,c.push(l),m=h[p];for(let x=0,y=m.length;xh.start-g.start);let f=0;for(let h=1;h 0 +#endif`,T2=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -291,26 +291,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,CR=`#if NUM_CLIPPING_PLANES > 0 +#endif`,A2=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,PR=`#if NUM_CLIPPING_PLANES > 0 +#endif`,C2=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,RR=`#if NUM_CLIPPING_PLANES > 0 +#endif`,P2=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,DR=`#if defined( USE_COLOR_ALPHA ) +#endif`,R2=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,IR=`#if defined( USE_COLOR_ALPHA ) +#endif`,D2=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,NR=`#if defined( USE_COLOR_ALPHA ) +#endif`,I2=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; -#endif`,LR=`#if defined( USE_COLOR_ALPHA ) +#endif`,N2=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); @@ -324,7 +324,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; -#endif`,OR=`#define PI 3.141592653589793 +#endif`,L2=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -391,7 +391,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,FR=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,O2=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -484,7 +484,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,UR=`vec3 transformedNormal = objectNormal; +#endif`,F2=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -513,21 +513,21 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,kR=`#ifdef USE_DISPLACEMENTMAP +#endif`,U2=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,BR=`#ifdef USE_DISPLACEMENTMAP +#endif`,k2=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,zR=`#ifdef USE_EMISSIVEMAP +#endif`,B2=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE emissiveColor = sRGBTransferEOTF( emissiveColor ); #endif totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,VR=`#ifdef USE_EMISSIVEMAP +#endif`,z2=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,HR="gl_FragColor = linearToOutputTexel( gl_FragColor );",GR=`vec4 LinearTransferOETF( in vec4 value ) { +#endif`,V2="gl_FragColor = linearToOutputTexel( gl_FragColor );",H2=`vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferEOTF( in vec4 value ) { @@ -535,7 +535,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) { } vec4 sRGBTransferOETF( in vec4 value ) { return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,WR=`#ifdef USE_ENVMAP +}`,G2=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -564,7 +564,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,qR=`#ifdef USE_ENVMAP +#endif`,W2=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -573,7 +573,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else uniform sampler2D envMap; #endif -#endif`,XR=`#ifdef USE_ENVMAP +#endif`,q2=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -584,7 +584,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,$R=`#ifdef USE_ENVMAP +#endif`,X2=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -595,7 +595,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,YR=`#ifdef USE_ENVMAP +#endif`,$2=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -612,18 +612,18 @@ vec4 sRGBTransferOETF( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,JR=`#ifdef USE_FOG +#endif`,Y2=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,KR=`#ifdef USE_FOG +#endif`,J2=`#ifdef USE_FOG varying float vFogDepth; -#endif`,ZR=`#ifdef USE_FOG +#endif`,K2=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,jR=`#ifdef USE_FOG +#endif`,Z2=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -632,7 +632,7 @@ vec4 sRGBTransferOETF( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,QR=`#ifdef USE_GRADIENTMAP +#endif`,j2=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -644,12 +644,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif -}`,e2=`#ifdef USE_LIGHTMAP +}`,Q2=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,t2=`LambertMaterial material; +#endif`,eR=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,n2=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,tR=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -663,7 +663,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,i2=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,nR=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -779,7 +779,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,r2=`#ifdef USE_ENVMAP +#endif`,iR=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -812,8 +812,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,s2=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,o2=`varying vec3 vViewPosition; +#endif`,rR=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,sR=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -825,11 +825,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,a2=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,oR=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,l2=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,aR=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -846,7 +846,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,c2=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,lR=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb; material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); material.metalness = metalnessFactor; @@ -936,7 +936,7 @@ material.roughness = min( material.roughness, 1.0 ); material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,u2=`uniform sampler2D dfgLUT; +#endif`,cR=`uniform sampler2D dfgLUT; struct PhysicalMaterial { vec3 diffuseColor; vec3 diffuseContribution; @@ -1284,7 +1284,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,d2=` +}`,uR=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1401,7 +1401,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,f2=`#if defined( RE_IndirectDiffuse ) +#endif`,dR=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1420,32 +1420,32 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,h2=`#if defined( RE_IndirectDiffuse ) +#endif`,fR=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,p2=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) +#endif`,hR=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,m2=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) +#endif`,pR=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,g2=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER +#endif`,mR=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER varying float vFragDepth; varying float vIsPerspective; -#endif`,v2=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER +#endif`,gR=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,_2=`#ifdef USE_MAP +#endif`,vR=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,x2=`#ifdef USE_MAP +#endif`,_R=`#ifdef USE_MAP uniform sampler2D map; -#endif`,y2=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,xR=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1457,7 +1457,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,b2=`#if defined( USE_POINTS_UV ) +#endif`,yR=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1469,19 +1469,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,S2=`float metalnessFactor = metalness; +#endif`,bR=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,M2=`#ifdef USE_METALNESSMAP +#endif`,SR=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,w2=`#ifdef USE_INSTANCING_MORPH +#endif`,wR=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } -#endif`,E2=`#if defined( USE_MORPHCOLORS ) +#endif`,MR=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1490,12 +1490,12 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,T2=`#ifdef USE_MORPHNORMALS +#endif`,ER=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } -#endif`,A2=`#ifdef USE_MORPHTARGETS +#endif`,TR=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; @@ -1509,12 +1509,12 @@ IncidentLight directLight; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } -#endif`,C2=`#ifdef USE_MORPHTARGETS +#endif`,AR=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } -#endif`,P2=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,CR=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1555,7 +1555,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,R2=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,PR=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1570,25 +1570,25 @@ vec3 nonPerturbedNormal = normal;`,R2=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,D2=`#ifndef FLAT_SHADED +#endif`,RR=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,I2=`#ifndef FLAT_SHADED +#endif`,DR=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,N2=`#ifndef FLAT_SHADED +#endif`,IR=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,L2=`#ifdef USE_NORMALMAP +#endif`,NR=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1610,13 +1610,13 @@ vec3 nonPerturbedNormal = normal;`,R2=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,O2=`#ifdef USE_CLEARCOAT +#endif`,LR=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,F2=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,OR=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,U2=`#ifdef USE_CLEARCOATMAP +#endif`,FR=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1625,18 +1625,18 @@ vec3 nonPerturbedNormal = normal;`,R2=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,k2=`#ifdef USE_IRIDESCENCEMAP +#endif`,UR=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,B2=`#ifdef OPAQUE +#endif`,kR=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,z2=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,BR=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1705,9 +1705,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,V2=`#ifdef PREMULTIPLIED_ALPHA +}`,zR=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,H2=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,VR=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1715,22 +1715,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,G2=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,HR=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,W2=`#ifdef DITHERING +#endif`,GR=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } -#endif`,q2=`float roughnessFactor = roughness; +#endif`,WR=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,X2=`#ifdef USE_ROUGHNESSMAP +#endif`,qR=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,$2=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,XR=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1912,7 +1912,7 @@ gl_Position = projectionMatrix * mvPosition;`,G2=`#ifdef DITHERING } #endif #endif -#endif`,Y2=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,$R=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -1953,7 +1953,7 @@ gl_Position = projectionMatrix * mvPosition;`,G2=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,J2=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,YR=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -1985,7 +1985,7 @@ gl_Position = projectionMatrix * mvPosition;`,G2=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,K2=`float getShadowMask() { +#endif`,JR=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2017,12 +2017,12 @@ gl_Position = projectionMatrix * mvPosition;`,G2=`#ifdef DITHERING #endif #endif return shadow; -}`,Z2=`#ifdef USE_SKINNING +}`,KR=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,j2=`#ifdef USE_SKINNING +#endif`,ZR=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2037,7 +2037,7 @@ gl_Position = projectionMatrix * mvPosition;`,G2=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,Q2=`#ifdef USE_SKINNING +#endif`,jR=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2045,7 +2045,7 @@ gl_Position = projectionMatrix * mvPosition;`,G2=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,e3=`#ifdef USE_SKINNING +#endif`,QR=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2056,17 +2056,17 @@ gl_Position = projectionMatrix * mvPosition;`,G2=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,t3=`float specularStrength; +#endif`,e3=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,n3=`#ifdef USE_SPECULARMAP +#endif`,t3=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,i3=`#if defined( TONE_MAPPING ) +#endif`,n3=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,r3=`#ifndef saturate +#endif`,i3=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2163,7 +2163,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,s3=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,r3=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2184,7 +2184,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,s3=`#ifdef USE_TRANSMISS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,o3=`#ifdef USE_TRANSMISSION +#endif`,s3=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2310,7 +2310,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,s3=`#ifdef USE_TRANSMISS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,a3=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,o3=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2380,7 +2380,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,s3=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,l3=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,a3=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2474,7 +2474,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,s3=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,c3=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,l3=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2545,7 +2545,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,s3=`#ifdef USE_TRANSMISS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,u3=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,c3=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; @@ -2554,12 +2554,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,s3=`#ifdef USE_TRANSMISS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const d3=`varying vec2 vUv; +#endif`;const u3=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,f3=`uniform sampler2D t2D; +}`,d3=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2571,14 +2571,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,h3=`varying vec3 vWorldDirection; +}`,f3=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,p3=`#ifdef ENVMAP_TYPE_CUBE +}`,h3=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2601,14 +2601,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,m3=`varying vec3 vWorldDirection; +}`,p3=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,g3=`uniform samplerCube tCube; +}`,m3=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2618,7 +2618,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,v3=`#include +}`,g3=`#include #include #include #include @@ -2645,7 +2645,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,_3=`#if DEPTH_PACKING == 3200 +}`,v3=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2683,7 +2683,7 @@ void main() { #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif -}`,x3=`#define DISTANCE +}`,_3=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2710,7 +2710,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,y3=`#define DISTANCE +}`,x3=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2733,13 +2733,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); -}`,b3=`varying vec3 vWorldDirection; +}`,y3=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,S3=`uniform sampler2D tEquirect; +}`,b3=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2748,7 +2748,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,M3=`uniform float scale; +}`,S3=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2798,7 +2798,7 @@ void main() { #include #include #include -}`,E3=`#include +}`,M3=`#include #include #include #include @@ -2830,7 +2830,7 @@ void main() { #include #include #include -}`,T3=`uniform vec3 diffuse; +}`,E3=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2878,7 +2878,7 @@ void main() { #include #include #include -}`,A3=`#define LAMBERT +}`,T3=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2917,7 +2917,7 @@ void main() { #include #include #include -}`,C3=`#define LAMBERT +}`,A3=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2973,7 +2973,7 @@ void main() { #include #include #include -}`,P3=`#define MATCAP +}`,C3=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3007,7 +3007,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,R3=`#define MATCAP +}`,P3=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3053,7 +3053,7 @@ void main() { #include #include #include -}`,D3=`#define NORMAL +}`,R3=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3086,7 +3086,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,I3=`#define NORMAL +}`,D3=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3107,7 +3107,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,N3=`#define PHONG +}`,I3=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3146,7 +3146,7 @@ void main() { #include #include #include -}`,L3=`#define PHONG +}`,N3=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3204,7 +3204,7 @@ void main() { #include #include #include -}`,O3=`#define STANDARD +}`,L3=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3247,7 +3247,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,F3=`#define STANDARD +}`,O3=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3372,7 +3372,7 @@ void main() { #include #include #include -}`,U3=`#define TOON +}`,F3=`#define TOON varying vec3 vViewPosition; #include #include @@ -3409,7 +3409,7 @@ void main() { #include #include #include -}`,k3=`#define TOON +}`,U3=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3461,7 +3461,7 @@ void main() { #include #include #include -}`,B3=`uniform float size; +}`,k3=`uniform float size; uniform float scale; #include #include @@ -3492,7 +3492,7 @@ void main() { #include #include #include -}`,z3=`uniform vec3 diffuse; +}`,B3=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3517,7 +3517,7 @@ void main() { #include #include #include -}`,V3=`#include +}`,z3=`#include #include #include #include @@ -3540,7 +3540,7 @@ void main() { #include #include #include -}`,H3=`uniform vec3 color; +}`,V3=`uniform vec3 color; uniform float opacity; #include #include @@ -3555,7 +3555,7 @@ void main() { #include #include #include -}`,G3=`uniform float rotation; +}`,H3=`uniform float rotation; uniform vec2 center; #include #include @@ -3579,7 +3579,7 @@ void main() { #include #include #include -}`,W3=`uniform vec3 diffuse; +}`,G3=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3604,7 +3604,7 @@ void main() { #include #include #include -}`,pt={alphahash_fragment:fR,alphahash_pars_fragment:hR,alphamap_fragment:pR,alphamap_pars_fragment:mR,alphatest_fragment:gR,alphatest_pars_fragment:vR,aomap_fragment:_R,aomap_pars_fragment:xR,batching_pars_vertex:yR,batching_vertex:bR,begin_vertex:SR,beginnormal_vertex:MR,bsdfs:wR,iridescence_fragment:ER,bumpmap_pars_fragment:TR,clipping_planes_fragment:AR,clipping_planes_pars_fragment:CR,clipping_planes_pars_vertex:PR,clipping_planes_vertex:RR,color_fragment:DR,color_pars_fragment:IR,color_pars_vertex:NR,color_vertex:LR,common:OR,cube_uv_reflection_fragment:FR,defaultnormal_vertex:UR,displacementmap_pars_vertex:kR,displacementmap_vertex:BR,emissivemap_fragment:zR,emissivemap_pars_fragment:VR,colorspace_fragment:HR,colorspace_pars_fragment:GR,envmap_fragment:WR,envmap_common_pars_fragment:qR,envmap_pars_fragment:XR,envmap_pars_vertex:$R,envmap_physical_pars_fragment:r2,envmap_vertex:YR,fog_vertex:JR,fog_pars_vertex:KR,fog_fragment:ZR,fog_pars_fragment:jR,gradientmap_pars_fragment:QR,lightmap_pars_fragment:e2,lights_lambert_fragment:t2,lights_lambert_pars_fragment:n2,lights_pars_begin:i2,lights_toon_fragment:s2,lights_toon_pars_fragment:o2,lights_phong_fragment:a2,lights_phong_pars_fragment:l2,lights_physical_fragment:c2,lights_physical_pars_fragment:u2,lights_fragment_begin:d2,lights_fragment_maps:f2,lights_fragment_end:h2,logdepthbuf_fragment:p2,logdepthbuf_pars_fragment:m2,logdepthbuf_pars_vertex:g2,logdepthbuf_vertex:v2,map_fragment:_2,map_pars_fragment:x2,map_particle_fragment:y2,map_particle_pars_fragment:b2,metalnessmap_fragment:S2,metalnessmap_pars_fragment:M2,morphinstance_vertex:w2,morphcolor_vertex:E2,morphnormal_vertex:T2,morphtarget_pars_vertex:A2,morphtarget_vertex:C2,normal_fragment_begin:P2,normal_fragment_maps:R2,normal_pars_fragment:D2,normal_pars_vertex:I2,normal_vertex:N2,normalmap_pars_fragment:L2,clearcoat_normal_fragment_begin:O2,clearcoat_normal_fragment_maps:F2,clearcoat_pars_fragment:U2,iridescence_pars_fragment:k2,opaque_fragment:B2,packing:z2,premultiplied_alpha_fragment:V2,project_vertex:H2,dithering_fragment:G2,dithering_pars_fragment:W2,roughnessmap_fragment:q2,roughnessmap_pars_fragment:X2,shadowmap_pars_fragment:$2,shadowmap_pars_vertex:Y2,shadowmap_vertex:J2,shadowmask_pars_fragment:K2,skinbase_vertex:Z2,skinning_pars_vertex:j2,skinning_vertex:Q2,skinnormal_vertex:e3,specularmap_fragment:t3,specularmap_pars_fragment:n3,tonemapping_fragment:i3,tonemapping_pars_fragment:r3,transmission_fragment:s3,transmission_pars_fragment:o3,uv_pars_fragment:a3,uv_pars_vertex:l3,uv_vertex:c3,worldpos_vertex:u3,background_vert:d3,background_frag:f3,backgroundCube_vert:h3,backgroundCube_frag:p3,cube_vert:m3,cube_frag:g3,depth_vert:v3,depth_frag:_3,distance_vert:x3,distance_frag:y3,equirect_vert:b3,equirect_frag:S3,linedashed_vert:M3,linedashed_frag:w3,meshbasic_vert:E3,meshbasic_frag:T3,meshlambert_vert:A3,meshlambert_frag:C3,meshmatcap_vert:P3,meshmatcap_frag:R3,meshnormal_vert:D3,meshnormal_frag:I3,meshphong_vert:N3,meshphong_frag:L3,meshphysical_vert:O3,meshphysical_frag:F3,meshtoon_vert:U3,meshtoon_frag:k3,points_vert:B3,points_frag:z3,shadow_vert:V3,shadow_frag:H3,sprite_vert:G3,sprite_frag:W3},De={common:{diffuse:{value:new rt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ft},alphaMap:{value:null},alphaMapTransform:{value:new ft},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ft}},envmap:{envMap:{value:null},envMapRotation:{value:new ft},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ft}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ft}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ft},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ft},normalScale:{value:new xe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ft},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ft}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ft}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ft}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new rt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new rt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ft},alphaTest:{value:0},uvTransform:{value:new ft}},sprite:{diffuse:{value:new rt(16777215)},opacity:{value:1},center:{value:new xe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ft},alphaMap:{value:null},alphaMapTransform:{value:new ft},alphaTest:{value:0}}},Vi={basic:{uniforms:Un([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.fog]),vertexShader:pt.meshbasic_vert,fragmentShader:pt.meshbasic_frag},lambert:{uniforms:Un([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new rt(0)}}]),vertexShader:pt.meshlambert_vert,fragmentShader:pt.meshlambert_frag},phong:{uniforms:Un([De.common,De.specularmap,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.fog,De.lights,{emissive:{value:new rt(0)},specular:{value:new rt(1118481)},shininess:{value:30}}]),vertexShader:pt.meshphong_vert,fragmentShader:pt.meshphong_frag},standard:{uniforms:Un([De.common,De.envmap,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.roughnessmap,De.metalnessmap,De.fog,De.lights,{emissive:{value:new rt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:pt.meshphysical_vert,fragmentShader:pt.meshphysical_frag},toon:{uniforms:Un([De.common,De.aomap,De.lightmap,De.emissivemap,De.bumpmap,De.normalmap,De.displacementmap,De.gradientmap,De.fog,De.lights,{emissive:{value:new rt(0)}}]),vertexShader:pt.meshtoon_vert,fragmentShader:pt.meshtoon_frag},matcap:{uniforms:Un([De.common,De.bumpmap,De.normalmap,De.displacementmap,De.fog,{matcap:{value:null}}]),vertexShader:pt.meshmatcap_vert,fragmentShader:pt.meshmatcap_frag},points:{uniforms:Un([De.points,De.fog]),vertexShader:pt.points_vert,fragmentShader:pt.points_frag},dashed:{uniforms:Un([De.common,De.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:pt.linedashed_vert,fragmentShader:pt.linedashed_frag},depth:{uniforms:Un([De.common,De.displacementmap]),vertexShader:pt.depth_vert,fragmentShader:pt.depth_frag},normal:{uniforms:Un([De.common,De.bumpmap,De.normalmap,De.displacementmap,{opacity:{value:1}}]),vertexShader:pt.meshnormal_vert,fragmentShader:pt.meshnormal_frag},sprite:{uniforms:Un([De.sprite,De.fog]),vertexShader:pt.sprite_vert,fragmentShader:pt.sprite_frag},background:{uniforms:{uvTransform:{value:new ft},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:pt.background_vert,fragmentShader:pt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ft}},vertexShader:pt.backgroundCube_vert,fragmentShader:pt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:pt.cube_vert,fragmentShader:pt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:pt.equirect_vert,fragmentShader:pt.equirect_frag},distance:{uniforms:Un([De.common,De.displacementmap,{referencePosition:{value:new I},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:pt.distance_vert,fragmentShader:pt.distance_frag},shadow:{uniforms:Un([De.lights,De.fog,{color:{value:new rt(0)},opacity:{value:1}}]),vertexShader:pt.shadow_vert,fragmentShader:pt.shadow_frag}};Vi.physical={uniforms:Un([Vi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ft},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ft},clearcoatNormalScale:{value:new xe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ft},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ft},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ft},sheen:{value:0},sheenColor:{value:new rt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ft},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ft},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ft},transmissionSamplerSize:{value:new xe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ft},attenuationDistance:{value:0},attenuationColor:{value:new rt(0)},specularColor:{value:new rt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ft},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ft},anisotropyVector:{value:new xe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ft}}]),vertexShader:pt.meshphysical_vert,fragmentShader:pt.meshphysical_frag};const oc={r:0,b:0,g:0},Rs=new Ci,q3=new yt;function X3(t,e,n,i,r,s,o){const a=new rt(0);let l=s===!0?0:1,c,u,d=null,f=0,h=null;function g(x){let y=x.isScene===!0?x.background:null;return y&&y.isTexture&&(y=(x.backgroundBlurriness>0?n:e).get(y)),y}function v(x){let y=!1;const w=g(x);w===null?p(a,l):w&&w.isColor&&(p(w,1),y=!0);const A=t.xr.getEnvironmentBlendMode();A==="additive"?i.buffers.color.setClear(0,0,0,1,o):A==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||y)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function m(x,y){const w=g(y);w&&(w.isCubeTexture||w.mapping===Tu)?(u===void 0&&(u=new be(new Kt(1,1,1),new Pi({name:"BackgroundCubeMaterial",uniforms:Zo(Vi.backgroundCube.uniforms),vertexShader:Vi.backgroundCube.vertexShader,fragmentShader:Vi.backgroundCube.fragmentShader,side:In,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(A,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Rs.copy(y.backgroundRotation),Rs.x*=-1,Rs.y*=-1,Rs.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Rs.y*=-1,Rs.z*=-1),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(q3.makeRotationFromEuler(Rs)),u.material.toneMapped=St.getTransfer(w.colorSpace)!==Pt,(d!==w||f!==w.version||h!==t.toneMapping)&&(u.material.needsUpdate=!0,d=w,f=w.version,h=t.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new be(new hl(2,2),new Pi({name:"BackgroundMaterial",uniforms:Zo(Vi.background.uniforms),vertexShader:Vi.background.vertexShader,fragmentShader:Vi.background.fragmentShader,side:hs,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=St.getTransfer(w.colorSpace)!==Pt,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(d!==w||f!==w.version||h!==t.toneMapping)&&(c.material.needsUpdate=!0,d=w,f=w.version,h=t.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function p(x,y){x.getRGB(oc,Uy(t)),i.buffers.color.setClear(oc.r,oc.g,oc.b,y,o)}function _(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(x,y=1){a.set(x),l=y,p(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,p(a,l)},render:v,addToRenderList:m,dispose:_}}function $3(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=f(null);let s=r,o=!1;function a(M,N,B,q,K){let $=!1;const W=d(q,B,N);s!==W&&(s=W,c(s.object)),$=h(M,q,B,K),$&&g(M,q,B,K),K!==null&&e.update(K,t.ELEMENT_ARRAY_BUFFER),($||o)&&(o=!1,y(M,N,B,q),K!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(K).buffer))}function l(){return t.createVertexArray()}function c(M){return t.bindVertexArray(M)}function u(M){return t.deleteVertexArray(M)}function d(M,N,B){const q=B.wireframe===!0;let K=i[M.id];K===void 0&&(K={},i[M.id]=K);let $=K[N.id];$===void 0&&($={},K[N.id]=$);let W=$[q];return W===void 0&&(W=f(l()),$[q]=W),W}function f(M){const N=[],B=[],q=[];for(let K=0;K=0){const le=K[z];let pe=$[z];if(pe===void 0&&(z==="instanceMatrix"&&M.instanceMatrix&&(pe=M.instanceMatrix),z==="instanceColor"&&M.instanceColor&&(pe=M.instanceColor)),le===void 0||le.attribute!==pe||pe&&le.data!==pe.data)return!0;W++}return s.attributesNum!==W||s.index!==q}function g(M,N,B,q){const K={},$=N.attributes;let W=0;const k=B.getAttributes();for(const z in k)if(k[z].location>=0){let le=$[z];le===void 0&&(z==="instanceMatrix"&&M.instanceMatrix&&(le=M.instanceMatrix),z==="instanceColor"&&M.instanceColor&&(le=M.instanceColor));const pe={};pe.attribute=le,le&&le.data&&(pe.data=le.data),K[z]=pe,W++}s.attributes=K,s.attributesNum=W,s.index=q}function v(){const M=s.newAttributes;for(let N=0,B=M.length;N=0){let de=K[k];if(de===void 0&&(k==="instanceMatrix"&&M.instanceMatrix&&(de=M.instanceMatrix),k==="instanceColor"&&M.instanceColor&&(de=M.instanceColor)),de!==void 0){const le=de.normalized,pe=de.itemSize,He=e.get(de);if(He===void 0)continue;const Be=He.buffer,st=He.type,xt=He.bytesPerElement,ce=st===t.INT||st===t.UNSIGNED_INT||de.gpuType===ep;if(de.isInterleavedBufferAttribute){const ue=de.data,Ie=ue.stride,Ye=de.offset;if(ue.isInstancedInterleavedBuffer){for(let Ae=0;Ae0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(tt("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),m=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),p=t.getParameter(t.MAX_VERTEX_ATTRIBS),_=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),x=t.getParameter(t.MAX_VARYING_VECTORS),y=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),w=t.getParameter(t.MAX_SAMPLES),A=t.getParameter(t.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:h,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:_,maxVaryings:x,maxFragmentUniforms:y,maxSamples:w,samples:A}}function K3(t){const e=this;let n=null,i=0,r=!1,s=!1;const o=new mr,a=new ft,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const h=d.length!==0||f||i!==0||r;return r=f,i=d.length,h},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,h){const g=d.clippingPlanes,v=d.clipIntersection,m=d.clipShadows,p=t.get(d);if(!r||g===null||g.length===0||s&&!m)s?u(null):c();else{const _=s?0:i,x=_*4;let y=p.clippingState||null;l.value=y,y=u(g,f,x,h);for(let w=0;w!==x;++w)y[w]=n[w];p.clippingState=y,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=_}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(d,f,h,g){const v=d!==null?d.length:0;let m=null;if(v!==0){if(m=l.value,g!==!0||m===null){const p=h+v*4,_=f.matrixWorldInverse;a.getNormalMatrix(_),(m===null||m.length0){const c=new Vy(l.height);return c.fromEquirectangularTexture(t,o),e.set(o,c),o.addEventListener("dispose",r),n(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}const os=4,v0=[.125,.215,.35,.446,.526,.582],ks=20,j3=256,va=new Mp,_0=new rt;let Id=null,Nd=0,Ld=0,Od=!1;const Q3=new I;class x0{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,n=0,i=.1,r=100,s={}){const{size:o=256,position:a=Q3}=s;Id=this._renderer.getRenderTarget(),Nd=this._renderer.getActiveCubeFace(),Ld=this._renderer.getActiveMipmapLevel(),Od=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,r,l,a),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=S0(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=b0(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?w:0,w,w),d.setRenderTarget(r),p&&d.render(v,l),d.render(e,l)}d.toneMapping=h,d.autoClear=f,e.background=_}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===Ks||e.mapping===$o;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=S0()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=b0());const s=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Mo(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(o,va)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;sg-os?i-g+os:0),p=4*(this._cubeSize-v);l.envMap.value=e.texture,l.roughness.value=h,l.mipInt.value=g-n,Mo(s,m,p,3*v,2*v),r.setRenderTarget(s),r.render(a,va),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-i,Mo(e,m,p,3*v,2*v),r.setRenderTarget(e),r.render(a,va)}_blur(e,n,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,n,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,n,i,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&bt("blur direction must be either latitudinal or longitudinal!");const u=3,d=this._lodMeshes[r];d.material=c;const f=c.uniforms,h=this._sizeLods[i]-1,g=isFinite(s)?Math.PI/(2*h):2*Math.PI/(2*ks-1),v=s/g,m=isFinite(s)?1+Math.floor(u*v):ks;m>ks&&tt(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${ks}`);const p=[];let _=0;for(let P=0;Px-os?r-x+os:0),A=4*(this._cubeSize-y);Mo(n,w,A,3*y,2*y),l.setRenderTarget(n),l.render(d,va)}}function eD(t){const e=[],n=[],i=[];let r=t;const s=t-os+1+v0.length;for(let o=0;ot-os?l=v0[o-t+os-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],h=6,g=6,v=3,m=2,p=1,_=new Float32Array(v*g*h),x=new Float32Array(m*g*h),y=new Float32Array(p*g*h);for(let A=0;A2?0:-1,S=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];_.set(S,v*g*A),x.set(f,m*g*A);const M=[A,A,A,A,A,A];y.set(M,p*g*A)}const w=new _t;w.setAttribute("position",new Nn(_,v)),w.setAttribute("uv",new Nn(x,m)),w.setAttribute("faceIndex",new Nn(y,p)),i.push(new be(w,null)),r>os&&r--}return{lodMeshes:i,sizeLods:e,sigmas:n}}function y0(t,e,n){const i=new Ji(t,e,n);return i.texture.mapping=Tu,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Mo(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function tD(t,e,n){return new Pi({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:j3,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Cu(),fragmentShader:` +}`,gt={alphahash_fragment:d2,alphahash_pars_fragment:f2,alphamap_fragment:h2,alphamap_pars_fragment:p2,alphatest_fragment:m2,alphatest_pars_fragment:g2,aomap_fragment:v2,aomap_pars_fragment:_2,batching_pars_vertex:x2,batching_vertex:y2,begin_vertex:b2,beginnormal_vertex:S2,bsdfs:w2,iridescence_fragment:M2,bumpmap_pars_fragment:E2,clipping_planes_fragment:T2,clipping_planes_pars_fragment:A2,clipping_planes_pars_vertex:C2,clipping_planes_vertex:P2,color_fragment:R2,color_pars_fragment:D2,color_pars_vertex:I2,color_vertex:N2,common:L2,cube_uv_reflection_fragment:O2,defaultnormal_vertex:F2,displacementmap_pars_vertex:U2,displacementmap_vertex:k2,emissivemap_fragment:B2,emissivemap_pars_fragment:z2,colorspace_fragment:V2,colorspace_pars_fragment:H2,envmap_fragment:G2,envmap_common_pars_fragment:W2,envmap_pars_fragment:q2,envmap_pars_vertex:X2,envmap_physical_pars_fragment:iR,envmap_vertex:$2,fog_vertex:Y2,fog_pars_vertex:J2,fog_fragment:K2,fog_pars_fragment:Z2,gradientmap_pars_fragment:j2,lightmap_pars_fragment:Q2,lights_lambert_fragment:eR,lights_lambert_pars_fragment:tR,lights_pars_begin:nR,lights_toon_fragment:rR,lights_toon_pars_fragment:sR,lights_phong_fragment:oR,lights_phong_pars_fragment:aR,lights_physical_fragment:lR,lights_physical_pars_fragment:cR,lights_fragment_begin:uR,lights_fragment_maps:dR,lights_fragment_end:fR,logdepthbuf_fragment:hR,logdepthbuf_pars_fragment:pR,logdepthbuf_pars_vertex:mR,logdepthbuf_vertex:gR,map_fragment:vR,map_pars_fragment:_R,map_particle_fragment:xR,map_particle_pars_fragment:yR,metalnessmap_fragment:bR,metalnessmap_pars_fragment:SR,morphinstance_vertex:wR,morphcolor_vertex:MR,morphnormal_vertex:ER,morphtarget_pars_vertex:TR,morphtarget_vertex:AR,normal_fragment_begin:CR,normal_fragment_maps:PR,normal_pars_fragment:RR,normal_pars_vertex:DR,normal_vertex:IR,normalmap_pars_fragment:NR,clearcoat_normal_fragment_begin:LR,clearcoat_normal_fragment_maps:OR,clearcoat_pars_fragment:FR,iridescence_pars_fragment:UR,opaque_fragment:kR,packing:BR,premultiplied_alpha_fragment:zR,project_vertex:VR,dithering_fragment:HR,dithering_pars_fragment:GR,roughnessmap_fragment:WR,roughnessmap_pars_fragment:qR,shadowmap_pars_fragment:XR,shadowmap_pars_vertex:$R,shadowmap_vertex:YR,shadowmask_pars_fragment:JR,skinbase_vertex:KR,skinning_pars_vertex:ZR,skinning_vertex:jR,skinnormal_vertex:QR,specularmap_fragment:e3,specularmap_pars_fragment:t3,tonemapping_fragment:n3,tonemapping_pars_fragment:i3,transmission_fragment:r3,transmission_pars_fragment:s3,uv_pars_fragment:o3,uv_pars_vertex:a3,uv_vertex:l3,worldpos_vertex:c3,background_vert:u3,background_frag:d3,backgroundCube_vert:f3,backgroundCube_frag:h3,cube_vert:p3,cube_frag:m3,depth_vert:g3,depth_frag:v3,distance_vert:_3,distance_frag:x3,equirect_vert:y3,equirect_frag:b3,linedashed_vert:S3,linedashed_frag:w3,meshbasic_vert:M3,meshbasic_frag:E3,meshlambert_vert:T3,meshlambert_frag:A3,meshmatcap_vert:C3,meshmatcap_frag:P3,meshnormal_vert:R3,meshnormal_frag:D3,meshphong_vert:I3,meshphong_frag:N3,meshphysical_vert:L3,meshphysical_frag:O3,meshtoon_vert:F3,meshtoon_frag:U3,points_vert:k3,points_frag:B3,shadow_vert:z3,shadow_frag:V3,sprite_vert:H3,sprite_frag:G3},Re={common:{diffuse:{value:new st(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ht},alphaMap:{value:null},alphaMapTransform:{value:new ht},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ht}},envmap:{envMap:{value:null},envMapRotation:{value:new ht},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ht}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ht}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ht},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ht},normalScale:{value:new xe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ht},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ht}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ht}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ht}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new st(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new st(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ht},alphaTest:{value:0},uvTransform:{value:new ht}},sprite:{diffuse:{value:new st(16777215)},opacity:{value:1},center:{value:new xe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ht},alphaMap:{value:null},alphaMapTransform:{value:new ht},alphaTest:{value:0}}},Wi={basic:{uniforms:kn([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.fog]),vertexShader:gt.meshbasic_vert,fragmentShader:gt.meshbasic_frag},lambert:{uniforms:kn([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,Re.lights,{emissive:{value:new st(0)}}]),vertexShader:gt.meshlambert_vert,fragmentShader:gt.meshlambert_frag},phong:{uniforms:kn([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,Re.lights,{emissive:{value:new st(0)},specular:{value:new st(1118481)},shininess:{value:30}}]),vertexShader:gt.meshphong_vert,fragmentShader:gt.meshphong_frag},standard:{uniforms:kn([Re.common,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.roughnessmap,Re.metalnessmap,Re.fog,Re.lights,{emissive:{value:new st(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag},toon:{uniforms:kn([Re.common,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.gradientmap,Re.fog,Re.lights,{emissive:{value:new st(0)}}]),vertexShader:gt.meshtoon_vert,fragmentShader:gt.meshtoon_frag},matcap:{uniforms:kn([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,{matcap:{value:null}}]),vertexShader:gt.meshmatcap_vert,fragmentShader:gt.meshmatcap_frag},points:{uniforms:kn([Re.points,Re.fog]),vertexShader:gt.points_vert,fragmentShader:gt.points_frag},dashed:{uniforms:kn([Re.common,Re.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:gt.linedashed_vert,fragmentShader:gt.linedashed_frag},depth:{uniforms:kn([Re.common,Re.displacementmap]),vertexShader:gt.depth_vert,fragmentShader:gt.depth_frag},normal:{uniforms:kn([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,{opacity:{value:1}}]),vertexShader:gt.meshnormal_vert,fragmentShader:gt.meshnormal_frag},sprite:{uniforms:kn([Re.sprite,Re.fog]),vertexShader:gt.sprite_vert,fragmentShader:gt.sprite_frag},background:{uniforms:{uvTransform:{value:new ht},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:gt.background_vert,fragmentShader:gt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ht}},vertexShader:gt.backgroundCube_vert,fragmentShader:gt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:gt.cube_vert,fragmentShader:gt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:gt.equirect_vert,fragmentShader:gt.equirect_frag},distance:{uniforms:kn([Re.common,Re.displacementmap,{referencePosition:{value:new I},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:gt.distance_vert,fragmentShader:gt.distance_frag},shadow:{uniforms:kn([Re.lights,Re.fog,{color:{value:new st(0)},opacity:{value:1}}]),vertexShader:gt.shadow_vert,fragmentShader:gt.shadow_frag}};Wi.physical={uniforms:kn([Wi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ht},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ht},clearcoatNormalScale:{value:new xe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ht},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ht},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ht},sheen:{value:0},sheenColor:{value:new st(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ht},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ht},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ht},transmissionSamplerSize:{value:new xe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ht},attenuationDistance:{value:0},attenuationColor:{value:new st(0)},specularColor:{value:new st(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ht},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ht},anisotropyVector:{value:new xe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ht}}]),vertexShader:gt.meshphysical_vert,fragmentShader:gt.meshphysical_frag};const uc={r:0,b:0,g:0},Ns=new Di,W3=new yt;function q3(t,e,n,i,r,s,o){const a=new st(0);let l=s===!0?0:1,c,u,d=null,f=0,h=null;function g(x){let y=x.isScene===!0?x.background:null;return y&&y.isTexture&&(y=(x.backgroundBlurriness>0?n:e).get(y)),y}function v(x){let y=!1;const E=g(x);E===null?p(a,l):E&&E.isColor&&(p(E,1),y=!0);const A=t.xr.getEnvironmentBlendMode();A==="additive"?i.buffers.color.setClear(0,0,0,1,o):A==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||y)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function m(x,y){const E=g(y);E&&(E.isCubeTexture||E.mapping===Du)?(u===void 0&&(u=new be(new Zt(1,1,1),new Ii({name:"BackgroundCubeMaterial",uniforms:ea(Wi.backgroundCube.uniforms),vertexShader:Wi.backgroundCube.vertexShader,fragmentShader:Wi.backgroundCube.fragmentShader,side:Nn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(A,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(u)),Ns.copy(y.backgroundRotation),Ns.x*=-1,Ns.y*=-1,Ns.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Ns.y*=-1,Ns.z*=-1),u.material.uniforms.envMap.value=E,u.material.uniforms.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=y.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(W3.makeRotationFromEuler(Ns)),u.material.toneMapped=wt.getTransfer(E.colorSpace)!==Dt,(d!==E||f!==E.version||h!==t.toneMapping)&&(u.material.needsUpdate=!0,d=E,f=E.version,h=t.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null)):E&&E.isTexture&&(c===void 0&&(c=new be(new vl(2,2),new Ii({name:"BackgroundMaterial",uniforms:ea(Wi.background.uniforms),vertexShader:Wi.background.vertexShader,fragmentShader:Wi.background.fragmentShader,side:ms,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=E,c.material.uniforms.backgroundIntensity.value=y.backgroundIntensity,c.material.toneMapped=wt.getTransfer(E.colorSpace)!==Dt,E.matrixAutoUpdate===!0&&E.updateMatrix(),c.material.uniforms.uvTransform.value.copy(E.matrix),(d!==E||f!==E.version||h!==t.toneMapping)&&(c.material.needsUpdate=!0,d=E,f=E.version,h=t.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function p(x,y){x.getRGB(uc,Yy(t)),i.buffers.color.setClear(uc.r,uc.g,uc.b,y,o)}function _(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(x,y=1){a.set(x),l=y,p(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,p(a,l)},render:v,addToRenderList:m,dispose:_}}function X3(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},r=f(null);let s=r,o=!1;function a(w,N,B,W,Z){let X=!1;const H=d(W,B,N);s!==H&&(s=H,c(s.object)),X=h(w,W,B,Z),X&&g(w,W,B,Z),Z!==null&&e.update(Z,t.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,y(w,N,B,W),Z!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(Z).buffer))}function l(){return t.createVertexArray()}function c(w){return t.bindVertexArray(w)}function u(w){return t.deleteVertexArray(w)}function d(w,N,B){const W=B.wireframe===!0;let Z=i[w.id];Z===void 0&&(Z={},i[w.id]=Z);let X=Z[N.id];X===void 0&&(X={},Z[N.id]=X);let H=X[W];return H===void 0&&(H=f(l()),X[W]=H),H}function f(w){const N=[],B=[],W=[];for(let Z=0;Z=0){const Y=Z[J];let pe=X[J];if(pe===void 0&&(J==="instanceMatrix"&&w.instanceMatrix&&(pe=w.instanceMatrix),J==="instanceColor"&&w.instanceColor&&(pe=w.instanceColor)),Y===void 0||Y.attribute!==pe||pe&&Y.data!==pe.data)return!0;H++}return s.attributesNum!==H||s.index!==W}function g(w,N,B,W){const Z={},X=N.attributes;let H=0;const k=B.getAttributes();for(const J in k)if(k[J].location>=0){let Y=X[J];Y===void 0&&(J==="instanceMatrix"&&w.instanceMatrix&&(Y=w.instanceMatrix),J==="instanceColor"&&w.instanceColor&&(Y=w.instanceColor));const pe={};pe.attribute=Y,Y&&Y.data&&(pe.data=Y.data),Z[J]=pe,H++}s.attributes=Z,s.attributesNum=H,s.index=W}function v(){const w=s.newAttributes;for(let N=0,B=w.length;N=0){let ue=Z[k];if(ue===void 0&&(k==="instanceMatrix"&&w.instanceMatrix&&(ue=w.instanceMatrix),k==="instanceColor"&&w.instanceColor&&(ue=w.instanceColor)),ue!==void 0){const Y=ue.normalized,pe=ue.itemSize,Ge=e.get(ue);if(Ge===void 0)continue;const Ze=Ge.buffer,xt=Ge.type,at=Ge.bytesPerElement,oe=xt===t.INT||xt===t.UNSIGNED_INT||ue.gpuType===Cp;if(ue.isInterleavedBufferAttribute){const fe=ue.data,Ie=fe.stride,Ne=ue.offset;if(fe.isInstancedInterleavedBuffer){for(let De=0;De0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=n.precision!==void 0?n.precision:"highp";const u=l(c);u!==c&&(nt("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),g=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=t.getParameter(t.MAX_TEXTURE_SIZE),m=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),p=t.getParameter(t.MAX_VERTEX_ATTRIBS),_=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),x=t.getParameter(t.MAX_VARYING_VECTORS),y=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),E=t.getParameter(t.MAX_SAMPLES),A=t.getParameter(t.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:h,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:_,maxVaryings:x,maxFragmentUniforms:y,maxSamples:E,samples:A}}function J3(t){const e=this;let n=null,i=0,r=!1,s=!1;const o=new _r,a=new ht,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const h=d.length!==0||f||i!==0||r;return r=f,i=d.length,h},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,f){n=u(d,f,0)},this.setState=function(d,f,h){const g=d.clippingPlanes,v=d.clipIntersection,m=d.clipShadows,p=t.get(d);if(!r||g===null||g.length===0||s&&!m)s?u(null):c();else{const _=s?0:i,x=_*4;let y=p.clippingState||null;l.value=y,y=u(g,f,x,h);for(let E=0;E!==x;++E)y[E]=n[E];p.clippingState=y,this.numIntersection=v?this.numPlanes:0,this.numPlanes+=_}};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(d,f,h,g){const v=d!==null?d.length:0;let m=null;if(v!==0){if(m=l.value,g!==!0||m===null){const p=h+v*4,_=f.matrixWorldInverse;a.getNormalMatrix(_),(m===null||m.length0){const c=new jy(l.height);return c.fromEquirectangularTexture(t,o),e.set(o,c),o.addEventListener("dispose",r),n(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}const cs=4,av=[.125,.215,.35,.446,.526,.582],Vs=20,Z3=256,_a=new Zp,lv=new st;let Hd=null,Gd=0,Wd=0,qd=!1;const j3=new I;class cv{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,n=0,i=.1,r=100,s={}){const{size:o=256,position:a=j3}=s;Hd=this._renderer.getRenderTarget(),Gd=this._renderer.getActiveCubeFace(),Wd=this._renderer.getActiveMipmapLevel(),qd=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,r,l,a),n>0&&this._blur(l,0,0,n),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=fv(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=dv(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?E:0,E,E),d.setRenderTarget(r),p&&d.render(v,l),d.render(e,l)}d.toneMapping=h,d.autoClear=f,e.background=_}_textureToCubeUV(e,n){const i=this._renderer,r=e.mapping===Qs||e.mapping===Ko;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=fv()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=dv());const s=r?this._cubemapMaterial:this._equirectMaterial,o=this._lodMeshes[0];o.material=s;const a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;To(n,0,0,3*l,2*l),i.setRenderTarget(n),i.render(o,_a)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;sg-cs?i-g+cs:0),p=4*(this._cubeSize-v);l.envMap.value=e.texture,l.roughness.value=h,l.mipInt.value=g-n,To(s,m,p,3*v,2*v),r.setRenderTarget(s),r.render(a,_a),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=g-i,To(e,m,p,3*v,2*v),r.setRenderTarget(e),r.render(a,_a)}_blur(e,n,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,n,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,n,i,r,s,o,a){const l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&St("blur direction must be either latitudinal or longitudinal!");const u=3,d=this._lodMeshes[r];d.material=c;const f=c.uniforms,h=this._sizeLods[i]-1,g=isFinite(s)?Math.PI/(2*h):2*Math.PI/(2*Vs-1),v=s/g,m=isFinite(s)?1+Math.floor(u*v):Vs;m>Vs&&nt(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Vs}`);const p=[];let _=0;for(let P=0;Px-cs?r-x+cs:0),A=4*(this._cubeSize-y);To(n,E,A,3*y,2*y),l.setRenderTarget(n),l.render(d,_a)}}function Q3(t){const e=[],n=[],i=[];let r=t;const s=t-cs+1+av.length;for(let o=0;ot-cs?l=av[o-t+cs-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),u=-c,d=1+c,f=[u,u,d,u,d,d,u,u,d,d,u,d],h=6,g=6,v=3,m=2,p=1,_=new Float32Array(v*g*h),x=new Float32Array(m*g*h),y=new Float32Array(p*g*h);for(let A=0;A2?0:-1,S=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];_.set(S,v*g*A),x.set(f,m*g*A);const w=[A,A,A,A,A,A];y.set(w,p*g*A)}const E=new bt;E.setAttribute("position",new Ln(_,v)),E.setAttribute("uv",new Ln(x,m)),E.setAttribute("faceIndex",new Ln(y,p)),i.push(new be(E,null)),r>cs&&r--}return{lodMeshes:i,sizeLods:e,sigmas:n}}function uv(t,e,n){const i=new ji(t,e,n);return i.texture.mapping=Du,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function To(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function eD(t,e,n){return new Ii({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:Z3,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Nu(),fragmentShader:` precision highp float; precision highp int; @@ -3712,7 +3712,7 @@ void main() { gl_FragColor = vec4(prefilteredColor, 1.0); } - `,blending:Mr,depthTest:!1,depthWrite:!1})}function nD(t,e,n){const i=new Float32Array(ks),r=new I(0,1,0);return new Pi({name:"SphericalGaussianBlur",defines:{n:ks,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Cu(),fragmentShader:` + `,blending:Er,depthTest:!1,depthWrite:!1})}function tD(t,e,n){const i=new Float32Array(Vs),r=new I(0,1,0);return new Ii({name:"SphericalGaussianBlur",defines:{n:Vs,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Nu(),fragmentShader:` precision mediump float; precision mediump int; @@ -3772,7 +3772,7 @@ void main() { } } - `,blending:Mr,depthTest:!1,depthWrite:!1})}function b0(){return new Pi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Cu(),fragmentShader:` + `,blending:Er,depthTest:!1,depthWrite:!1})}function dv(){return new Ii({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Nu(),fragmentShader:` precision mediump float; precision mediump int; @@ -3791,7 +3791,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:Mr,depthTest:!1,depthWrite:!1})}function S0(){return new Pi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Cu(),fragmentShader:` + `,blending:Er,depthTest:!1,depthWrite:!1})}function fv(){return new Ii({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Nu(),fragmentShader:` precision mediump float; precision mediump int; @@ -3807,7 +3807,7 @@ void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } - `,blending:Mr,depthTest:!1,depthWrite:!1})}function Cu(){return` + `,blending:Er,depthTest:!1,depthWrite:!1})}function Nu(){return` precision mediump float; precision mediump int; @@ -3862,7 +3862,7 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function iD(t){let e=new WeakMap,n=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Af||l===Cf,u=l===Ks||l===$o;if(c||u){let d=e.get(a);const f=d!==void 0?d.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==f)return n===null&&(n=new x0(t)),d=c?n.fromEquirectangular(a,d):n.fromCubemap(a,d),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),d.texture;if(d!==void 0)return d.texture;{const h=a.image;return c&&h&&h.height>0||u&&h&&r(h)?(n===null&&(n=new x0(t)),d=c?n.fromEquirectangular(a):n.fromCubemap(a),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),a.addEventListener("dispose",s),d.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(A=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const P=new Float32Array(w*A*4*d),D=new Ny(P,w,A,d);D.type=Wi,D.needsUpdate=!0;const S=y*4;for(let N=0;N0||u&&h&&r(h)?(n===null&&(n=new cv(t)),d=c?n.fromEquirectangular(a):n.fromCubemap(a),d.texture.pmremVersion=a.pmremVersion,e.set(a,d),a.addEventListener("dispose",s),d.texture):null}}}return a}function r(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(A=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const P=new Float32Array(E*A*4*d),D=new Wy(P,E,A,d);D.type=$i,D.needsUpdate=!0;const S=y*4;for(let N=0;N0&&m[0].isRenderPass===!0;const x=s.width,y=s.height;for(let w=0;w0)return t;const r=e*n;let s=M0[r];if(s===void 0&&(s=new Float32Array(r),M0[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=n,t[o].toArray(s,a)}return s}function cn(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n0&&(this.seq=r.concat(s))}setValue(e,n,i,r){const s=this.map[n];s!==void 0&&s.setValue(e,i,r)}setOptional(e,n,i){const r=n[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,n,i,r){for(let s=0,o=n.length;s!==o;++s){const a=n[s],l=i[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,r)}}static seqWithValue(e,n){const i=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in n&&i.push(o)}return i}}function P0(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}const nI=37297;let iI=0;function rI(t,e){const n=t.split(` + }`,depthTest:!1,depthWrite:!1}),c=new be(a,l),u=new Zp(-1,1,1,-1,0,1);let d=null,f=null,h=!1,g,v=null,m=[],p=!1;this.setSize=function(_,x){s.setSize(_,x),o.setSize(_,x);for(let y=0;y0&&m[0].isRenderPass===!0;const x=s.width,y=s.height;for(let E=0;E0)return t;const r=e*n;let s=hv[r];if(s===void 0&&(s=new Float32Array(r),hv[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=n,t[o].toArray(s,a)}return s}function fn(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n0&&(this.seq=r.concat(s))}setValue(e,n,i,r){const s=this.map[n];s!==void 0&&s.setValue(e,i,r)}setOptional(e,n,i){const r=n[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,n,i,r){for(let s=0,o=n.length;s!==o;++s){const a=n[s],l=i[a.id];l.needsUpdate!==!1&&a.setValue(e,l.value,r)}}static seqWithValue(e,n){const i=[];for(let r=0,s=e.length;r!==s;++r){const o=e[r];o.id in n&&i.push(o)}return i}}function xv(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}const tI=37297;let nI=0;function iI(t,e){const n=t.split(` `),i=[],r=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let o=r;o":" "} ${a}: ${n[o]}`)}return i.join(` -`)}const R0=new ft;function sI(t){St._getMatrix(R0,St.workingColorSpace,t);const e=`mat3( ${R0.elements.map(n=>n.toFixed(4))} )`;switch(St.getTransfer(t)){case qc:return[e,"LinearTransferOETF"];case Pt:return[e,"sRGBTransferOETF"];default:return tt("WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function D0(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),s=(t.getShaderInfoLog(e)||"").trim();if(i&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` +`)}const yv=new ht;function rI(t){wt._getMatrix(yv,wt.workingColorSpace,t);const e=`mat3( ${yv.elements.map(n=>n.toFixed(4))} )`;switch(wt.getTransfer(t)){case Jc:return[e,"LinearTransferOETF"];case Dt:return[e,"sRGBTransferOETF"];default:return nt("WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function bv(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),s=(t.getShaderInfoLog(e)||"").trim();if(i&&s==="")return"";const o=/ERROR: 0:(\d+)/.exec(s);if(o){const a=parseInt(o[1]);return n.toUpperCase()+` `+s+` -`+rI(t.getShaderSource(e),a)}else return s}function oI(t,e){const n=sI(e);return[`vec4 ${t}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(` -`)}const aI={[vy]:"Linear",[_y]:"Reinhard",[xy]:"Cineon",[Qh]:"ACESFilmic",[by]:"AgX",[Sy]:"Neutral",[yy]:"Custom"};function lI(t,e){const n=aI[e];return n===void 0?(tt("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+t+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const ac=new I;function cI(){St.getLuminanceCoefficients(ac);const t=ac.x.toFixed(4),e=ac.y.toFixed(4),n=ac.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(` -`)}function uI(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(wa).join(` -`)}function dI(t){const e=[];for(const n in t){const i=t[n];i!==!1&&e.push("#define "+n+" "+i)}return e.join(` -`)}function fI(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function gh(t){return t.replace(hI,mI)}const pI=new Map;function mI(t,e){let n=pt[e];if(n===void 0){const i=pI.get(e);if(i!==void 0)n=pt[i],tt('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return gh(n)}const gI=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function L0(t){return t.replace(gI,vI)}function vI(t,e,n,i){let r="";for(let s=parseInt(e);s/gm;function bh(t){return t.replace(fI,pI)}const hI=new Map;function pI(t,e){let n=gt[e];if(n===void 0){const i=hI.get(e);if(i!==void 0)n=gt[i],nt('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return bh(n)}const mI=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Mv(t){return t.replace(mI,gI)}function gI(t,e,n,i){let r="";for(let s=parseInt(e);s0&&(m+=` -`),p=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(wa).join(` +`),p=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(Ra).join(` `),p.length>0&&(p+=` -`)):(m=[O0(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(wa).join(` -`),p=[O0(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Yi?"#define TONE_MAPPING":"",n.toneMapping!==Yi?pt.tonemapping_pars_fragment:"",n.toneMapping!==Yi?lI("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",pt.colorspace_pars_fragment,oI("linearToOutputTexel",n.outputColorSpace),cI(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` -`].filter(wa).join(` -`)),o=gh(o),o=I0(o,n),o=N0(o,n),a=gh(a),a=I0(a,n),a=N0(a,n),o=L0(o),a=L0(a),n.isRawShaderMaterial!==!0&&(_=`#version 300 es +`)):(m=[Ev(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Ra).join(` +`),p=[Ev(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Zi?"#define TONE_MAPPING":"",n.toneMapping!==Zi?gt.tonemapping_pars_fragment:"",n.toneMapping!==Zi?aI("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",gt.colorspace_pars_fragment,sI("linearToOutputTexel",n.outputColorSpace),lI(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`].filter(Ra).join(` +`)),o=bh(o),o=Sv(o,n),o=wv(o,n),a=bh(a),a=Sv(a,n),a=wv(a,n),o=Mv(o),a=Mv(a),n.isRawShaderMaterial!==!0&&(_=`#version 300 es `,m=[h,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` -`+m,p=["#define varying in",n.glslVersion===Rg?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Rg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`+m,p=["#define varying in",n.glslVersion===y0?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===y0?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` -`+p);const x=_+m+o,y=_+p+a,w=P0(r,r.VERTEX_SHADER,x),A=P0(r,r.FRAGMENT_SHADER,y);r.attachShader(v,w),r.attachShader(v,A),n.index0AttributeName!==void 0?r.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(v,0,"position"),r.linkProgram(v);function P(N){if(t.debug.checkShaderErrors){const B=r.getProgramInfoLog(v)||"",q=r.getShaderInfoLog(w)||"",K=r.getShaderInfoLog(A)||"",$=B.trim(),W=q.trim(),k=K.trim();let z=!0,de=!0;if(r.getProgramParameter(v,r.LINK_STATUS)===!1)if(z=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(r,v,w,A);else{const le=D0(r,w,"vertex"),pe=D0(r,A,"fragment");bt("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(v,r.VALIDATE_STATUS)+` +`+p);const x=_+m+o,y=_+p+a,E=xv(r,r.VERTEX_SHADER,x),A=xv(r,r.FRAGMENT_SHADER,y);r.attachShader(v,E),r.attachShader(v,A),n.index0AttributeName!==void 0?r.bindAttribLocation(v,0,n.index0AttributeName):n.morphTargets===!0&&r.bindAttribLocation(v,0,"position"),r.linkProgram(v);function P(N){if(t.debug.checkShaderErrors){const B=r.getProgramInfoLog(v)||"",W=r.getShaderInfoLog(E)||"",Z=r.getShaderInfoLog(A)||"",X=B.trim(),H=W.trim(),k=Z.trim();let J=!0,ue=!0;if(r.getProgramParameter(v,r.LINK_STATUS)===!1)if(J=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(r,v,E,A);else{const Y=bv(r,E,"vertex"),pe=bv(r,A,"fragment");St("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(v,r.VALIDATE_STATUS)+` Material Name: `+N.name+` Material Type: `+N.type+` -Program Info Log: `+$+` -`+le+` -`+pe)}else $!==""?tt("WebGLProgram: Program Info Log:",$):(W===""||k==="")&&(de=!1);de&&(N.diagnostics={runnable:z,programLog:$,vertexShader:{log:W,prefix:m},fragmentShader:{log:k,prefix:p}})}r.deleteShader(w),r.deleteShader(A),D=new Ec(r,v),S=fI(r,v)}let D;this.getUniforms=function(){return D===void 0&&P(this),D};let S;this.getAttributes=function(){return S===void 0&&P(this),S};let M=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(v,nI)),M},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=iI++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=w,this.fragmentShader=A,this}let CI=0;class PI{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(n),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new RI(e),n.set(e,i)),i}}class RI{constructor(e){this.id=CI++,this.code=e,this.usedTimes=0}}function DI(t,e,n,i,r,s,o){const a=new up,l=new PI,c=new Set,u=[],d=new Map,f=r.logarithmicDepthBuffer;let h=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(S){return c.add(S),S===0?"uv":`uv${S}`}function m(S,M,N,B,q){const K=B.fog,$=q.geometry,W=S.isMeshStandardMaterial?B.environment:null,k=(S.isMeshStandardMaterial?n:e).get(S.envMap||W),z=k&&k.mapping===Tu?k.image.height:null,de=g[S.type];S.precision!==null&&(h=r.getMaxPrecision(S.precision),h!==S.precision&&tt("WebGLProgram.getParameters:",S.precision,"not supported, using",h,"instead."));const le=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,pe=le!==void 0?le.length:0;let He=0;$.morphAttributes.position!==void 0&&(He=1),$.morphAttributes.normal!==void 0&&(He=2),$.morphAttributes.color!==void 0&&(He=3);let Be,st,xt,ce;if(de){const At=Vi[de];Be=At.vertexShader,st=At.fragmentShader}else Be=S.vertexShader,st=S.fragmentShader,l.update(S),xt=l.getVertexShaderID(S),ce=l.getFragmentShaderID(S);const ue=t.getRenderTarget(),Ie=t.state.buffers.depth.getReversed(),Ye=q.isInstancedMesh===!0,Ae=q.isBatchedMesh===!0,mt=!!S.map,L=!!S.matcap,U=!!k,F=!!S.aoMap,G=!!S.lightMap,V=!!S.bumpMap,Y=!!S.normalMap,C=!!S.displacementMap,ae=!!S.emissiveMap,Q=!!S.metalnessMap,ee=!!S.roughnessMap,oe=S.anisotropy>0,E=S.clearcoat>0,b=S.dispersion>0,O=S.iridescence>0,J=S.sheen>0,se=S.transmission>0,Z=oe&&!!S.anisotropyMap,Ce=E&&!!S.clearcoatMap,ve=E&&!!S.clearcoatNormalMap,Ne=E&&!!S.clearcoatRoughnessMap,$e=O&&!!S.iridescenceMap,me=O&&!!S.iridescenceThicknessMap,we=J&&!!S.sheenColorMap,Pe=J&&!!S.sheenRoughnessMap,Ue=!!S.specularMap,Me=!!S.specularColorMap,ut=!!S.specularIntensityMap,H=se&&!!S.transmissionMap,Oe=se&&!!S.thicknessMap,ye=!!S.gradientMap,ze=!!S.alphaMap,_e=S.alphaTest>0,he=!!S.alphaHash,Ee=!!S.extensions;let lt=Yi;S.toneMapped&&(ue===null||ue.isXRRenderTarget===!0)&&(lt=t.toneMapping);const Bt={shaderID:de,shaderType:S.type,shaderName:S.name,vertexShader:Be,fragmentShader:st,defines:S.defines,customVertexShaderID:xt,customFragmentShaderID:ce,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:h,batching:Ae,batchingColor:Ae&&q._colorsTexture!==null,instancing:Ye,instancingColor:Ye&&q.instanceColor!==null,instancingMorph:Ye&&q.morphTexture!==null,outputColorSpace:ue===null?t.outputColorSpace:ue.isXRRenderTarget===!0?ue.texture.colorSpace:Jo,alphaToCoverage:!!S.alphaToCoverage,map:mt,matcap:L,envMap:U,envMapMode:U&&k.mapping,envMapCubeUVHeight:z,aoMap:F,lightMap:G,bumpMap:V,normalMap:Y,displacementMap:C,emissiveMap:ae,normalMapObjectSpace:Y&&S.normalMapType===dC,normalMapTangentSpace:Y&&S.normalMapType===Dy,metalnessMap:Q,roughnessMap:ee,anisotropy:oe,anisotropyMap:Z,clearcoat:E,clearcoatMap:Ce,clearcoatNormalMap:ve,clearcoatRoughnessMap:Ne,dispersion:b,iridescence:O,iridescenceMap:$e,iridescenceThicknessMap:me,sheen:J,sheenColorMap:we,sheenRoughnessMap:Pe,specularMap:Ue,specularColorMap:Me,specularIntensityMap:ut,transmission:se,transmissionMap:H,thicknessMap:Oe,gradientMap:ye,opaque:S.transparent===!1&&S.blending===Bo&&S.alphaToCoverage===!1,alphaMap:ze,alphaTest:_e,alphaHash:he,combine:S.combine,mapUv:mt&&v(S.map.channel),aoMapUv:F&&v(S.aoMap.channel),lightMapUv:G&&v(S.lightMap.channel),bumpMapUv:V&&v(S.bumpMap.channel),normalMapUv:Y&&v(S.normalMap.channel),displacementMapUv:C&&v(S.displacementMap.channel),emissiveMapUv:ae&&v(S.emissiveMap.channel),metalnessMapUv:Q&&v(S.metalnessMap.channel),roughnessMapUv:ee&&v(S.roughnessMap.channel),anisotropyMapUv:Z&&v(S.anisotropyMap.channel),clearcoatMapUv:Ce&&v(S.clearcoatMap.channel),clearcoatNormalMapUv:ve&&v(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ne&&v(S.clearcoatRoughnessMap.channel),iridescenceMapUv:$e&&v(S.iridescenceMap.channel),iridescenceThicknessMapUv:me&&v(S.iridescenceThicknessMap.channel),sheenColorMapUv:we&&v(S.sheenColorMap.channel),sheenRoughnessMapUv:Pe&&v(S.sheenRoughnessMap.channel),specularMapUv:Ue&&v(S.specularMap.channel),specularColorMapUv:Me&&v(S.specularColorMap.channel),specularIntensityMapUv:ut&&v(S.specularIntensityMap.channel),transmissionMapUv:H&&v(S.transmissionMap.channel),thicknessMapUv:Oe&&v(S.thicknessMap.channel),alphaMapUv:ze&&v(S.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(Y||oe),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:q.isPoints===!0&&!!$.attributes.uv&&(mt||ze),fog:!!K,useFog:S.fog===!0,fogExp2:!!K&&K.isFogExp2,flatShading:S.flatShading===!0&&S.wireframe===!1,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:Ie,skinning:q.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:pe,morphTextureStride:He,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:t.shadowMap.enabled&&N.length>0,shadowMapType:t.shadowMap.type,toneMapping:lt,decodeVideoTexture:mt&&S.map.isVideoTexture===!0&&St.getTransfer(S.map.colorSpace)===Pt,decodeVideoTextureEmissive:ae&&S.emissiveMap.isVideoTexture===!0&&St.getTransfer(S.emissiveMap.colorSpace)===Pt,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===Bn,flipSided:S.side===In,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:Ee&&S.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ee&&S.extensions.multiDraw===!0||Ae)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return Bt.vertexUv1s=c.has(1),Bt.vertexUv2s=c.has(2),Bt.vertexUv3s=c.has(3),c.clear(),Bt}function p(S){const M=[];if(S.shaderID?M.push(S.shaderID):(M.push(S.customVertexShaderID),M.push(S.customFragmentShaderID)),S.defines!==void 0)for(const N in S.defines)M.push(N),M.push(S.defines[N]);return S.isRawShaderMaterial===!1&&(_(M,S),x(M,S),M.push(t.outputColorSpace)),M.push(S.customProgramCacheKey),M.join()}function _(S,M){S.push(M.precision),S.push(M.outputColorSpace),S.push(M.envMapMode),S.push(M.envMapCubeUVHeight),S.push(M.mapUv),S.push(M.alphaMapUv),S.push(M.lightMapUv),S.push(M.aoMapUv),S.push(M.bumpMapUv),S.push(M.normalMapUv),S.push(M.displacementMapUv),S.push(M.emissiveMapUv),S.push(M.metalnessMapUv),S.push(M.roughnessMapUv),S.push(M.anisotropyMapUv),S.push(M.clearcoatMapUv),S.push(M.clearcoatNormalMapUv),S.push(M.clearcoatRoughnessMapUv),S.push(M.iridescenceMapUv),S.push(M.iridescenceThicknessMapUv),S.push(M.sheenColorMapUv),S.push(M.sheenRoughnessMapUv),S.push(M.specularMapUv),S.push(M.specularColorMapUv),S.push(M.specularIntensityMapUv),S.push(M.transmissionMapUv),S.push(M.thicknessMapUv),S.push(M.combine),S.push(M.fogExp2),S.push(M.sizeAttenuation),S.push(M.morphTargetsCount),S.push(M.morphAttributeCount),S.push(M.numDirLights),S.push(M.numPointLights),S.push(M.numSpotLights),S.push(M.numSpotLightMaps),S.push(M.numHemiLights),S.push(M.numRectAreaLights),S.push(M.numDirLightShadows),S.push(M.numPointLightShadows),S.push(M.numSpotLightShadows),S.push(M.numSpotLightShadowsWithMaps),S.push(M.numLightProbes),S.push(M.shadowMapType),S.push(M.toneMapping),S.push(M.numClippingPlanes),S.push(M.numClipIntersection),S.push(M.depthPacking)}function x(S,M){a.disableAll(),M.instancing&&a.enable(0),M.instancingColor&&a.enable(1),M.instancingMorph&&a.enable(2),M.matcap&&a.enable(3),M.envMap&&a.enable(4),M.normalMapObjectSpace&&a.enable(5),M.normalMapTangentSpace&&a.enable(6),M.clearcoat&&a.enable(7),M.iridescence&&a.enable(8),M.alphaTest&&a.enable(9),M.vertexColors&&a.enable(10),M.vertexAlphas&&a.enable(11),M.vertexUv1s&&a.enable(12),M.vertexUv2s&&a.enable(13),M.vertexUv3s&&a.enable(14),M.vertexTangents&&a.enable(15),M.anisotropy&&a.enable(16),M.alphaHash&&a.enable(17),M.batching&&a.enable(18),M.dispersion&&a.enable(19),M.batchingColor&&a.enable(20),M.gradientMap&&a.enable(21),S.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reversedDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),S.push(a.mask)}function y(S){const M=g[S.type];let N;if(M){const B=Vi[M];N=ky.clone(B.uniforms)}else N=S.uniforms;return N}function w(S,M){let N=d.get(M);return N!==void 0?++N.usedTimes:(N=new AI(t,M,S,s),u.push(N),d.set(M,N)),N}function A(S){if(--S.usedTimes===0){const M=u.indexOf(S);u[M]=u[u.length-1],u.pop(),d.delete(S.cacheKey),S.destroy()}}function P(S){l.remove(S)}function D(){l.dispose()}return{getParameters:m,getProgramCacheKey:p,getUniforms:y,acquireProgram:w,releaseProgram:A,releaseShaderCache:P,programs:u,dispose:D}}function II(){let t=new WeakMap;function e(o){return t.has(o)}function n(o){let a=t.get(o);return a===void 0&&(a={},t.set(o,a)),a}function i(o){t.delete(o)}function r(o,a,l){t.get(o)[a]=l}function s(){t=new WeakMap}return{has:e,get:n,remove:i,update:r,dispose:s}}function NI(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function F0(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function U0(){const t=[];let e=0;const n=[],i=[],r=[];function s(){e=0,n.length=0,i.length=0,r.length=0}function o(d,f,h,g,v,m){let p=t[e];return p===void 0?(p={id:d.id,object:d,geometry:f,material:h,groupOrder:g,renderOrder:d.renderOrder,z:v,group:m},t[e]=p):(p.id=d.id,p.object=d,p.geometry=f,p.material=h,p.groupOrder=g,p.renderOrder=d.renderOrder,p.z=v,p.group=m),e++,p}function a(d,f,h,g,v,m){const p=o(d,f,h,g,v,m);h.transmission>0?i.push(p):h.transparent===!0?r.push(p):n.push(p)}function l(d,f,h,g,v,m){const p=o(d,f,h,g,v,m);h.transmission>0?i.unshift(p):h.transparent===!0?r.unshift(p):n.unshift(p)}function c(d,f){n.length>1&&n.sort(d||NI),i.length>1&&i.sort(f||F0),r.length>1&&r.sort(f||F0)}function u(){for(let d=e,f=t.length;d=s.length?(o=new U0,s.push(o)):o=s[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function OI(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new I,color:new rt};break;case"SpotLight":n={position:new I,direction:new I,color:new rt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new I,color:new rt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new I,skyColor:new rt,groundColor:new rt};break;case"RectAreaLight":n={color:new rt,position:new I,halfWidth:new I,halfHeight:new I};break}return t[e.id]=n,n}}}function FI(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let UI=0;function kI(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function BI(t){const e=new OI,n=FI(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new I);const r=new I,s=new yt,o=new yt;function a(c){let u=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let h=0,g=0,v=0,m=0,p=0,_=0,x=0,y=0,w=0,A=0,P=0;c.sort(kI);for(let S=0,M=c.length;S0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=De.LTC_FLOAT_1,i.rectAreaLTC2=De.LTC_FLOAT_2):(i.rectAreaLTC1=De.LTC_HALF_1,i.rectAreaLTC2=De.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=d,i.ambient[2]=f;const D=i.hash;(D.directionalLength!==h||D.pointLength!==g||D.spotLength!==v||D.rectAreaLength!==m||D.hemiLength!==p||D.numDirectionalShadows!==_||D.numPointShadows!==x||D.numSpotShadows!==y||D.numSpotMaps!==w||D.numLightProbes!==P)&&(i.directional.length=h,i.spot.length=v,i.rectArea.length=m,i.point.length=g,i.hemi.length=p,i.directionalShadow.length=_,i.directionalShadowMap.length=_,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=y,i.spotShadowMap.length=y,i.directionalShadowMatrix.length=_,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=y+w-A,i.spotLightMap.length=w,i.numSpotLightShadowsWithMaps=A,i.numLightProbes=P,D.directionalLength=h,D.pointLength=g,D.spotLength=v,D.rectAreaLength=m,D.hemiLength=p,D.numDirectionalShadows=_,D.numPointShadows=x,D.numSpotShadows=y,D.numSpotMaps=w,D.numLightProbes=P,i.version=UI++)}function l(c,u){let d=0,f=0,h=0,g=0,v=0;const m=u.matrixWorldInverse;for(let p=0,_=c.length;p<_;p++){const x=c[p];if(x.isDirectionalLight){const y=i.directional[d];y.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),y.direction.sub(r),y.direction.transformDirection(m),d++}else if(x.isSpotLight){const y=i.spot[h];y.position.setFromMatrixPosition(x.matrixWorld),y.position.applyMatrix4(m),y.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),y.direction.sub(r),y.direction.transformDirection(m),h++}else if(x.isRectAreaLight){const y=i.rectArea[g];y.position.setFromMatrixPosition(x.matrixWorld),y.position.applyMatrix4(m),o.identity(),s.copy(x.matrixWorld),s.premultiply(m),o.extractRotation(s),y.halfWidth.set(x.width*.5,0,0),y.halfHeight.set(0,x.height*.5,0),y.halfWidth.applyMatrix4(o),y.halfHeight.applyMatrix4(o),g++}else if(x.isPointLight){const y=i.point[f];y.position.setFromMatrixPosition(x.matrixWorld),y.position.applyMatrix4(m),f++}else if(x.isHemisphereLight){const y=i.hemi[v];y.direction.setFromMatrixPosition(x.matrixWorld),y.direction.transformDirection(m),v++}}}return{setup:a,setupView:l,state:i}}function k0(t){const e=new BI(t),n=[],i=[];function r(u){c.camera=u,n.length=0,i.length=0}function s(u){n.push(u)}function o(u){i.push(u)}function a(){e.setup(n)}function l(u){e.setupView(n,u)}const c={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function zI(t){let e=new WeakMap;function n(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new k0(t),e.set(r,[a])):s>=o.length?(a=new k0(t),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:n,dispose:i}}const VI=`void main() { +Program Info Log: `+X+` +`+Y+` +`+pe)}else X!==""?nt("WebGLProgram: Program Info Log:",X):(H===""||k==="")&&(ue=!1);ue&&(N.diagnostics={runnable:J,programLog:X,vertexShader:{log:H,prefix:m},fragmentShader:{log:k,prefix:p}})}r.deleteShader(E),r.deleteShader(A),D=new Dc(r,v),S=dI(r,v)}let D;this.getUniforms=function(){return D===void 0&&P(this),D};let S;this.getAttributes=function(){return S===void 0&&P(this),S};let w=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return w===!1&&(w=r.getProgramParameter(v,tI)),w},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(v),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=nI++,this.cacheKey=e,this.usedTimes=1,this.program=v,this.vertexShader=E,this.fragmentShader=A,this}let AI=0;class CI{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(n),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new PI(e),n.set(e,i)),i}}class PI{constructor(e){this.id=AI++,this.code=e,this.usedTimes=0}}function RI(t,e,n,i,r,s,o){const a=new kp,l=new CI,c=new Set,u=[],d=new Map,f=r.logarithmicDepthBuffer;let h=r.precision;const g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(S){return c.add(S),S===0?"uv":`uv${S}`}function m(S,w,N,B,W){const Z=B.fog,X=W.geometry,H=S.isMeshStandardMaterial?B.environment:null,k=(S.isMeshStandardMaterial?n:e).get(S.envMap||H),J=k&&k.mapping===Du?k.image.height:null,ue=g[S.type];S.precision!==null&&(h=r.getMaxPrecision(S.precision),h!==S.precision&&nt("WebGLProgram.getParameters:",S.precision,"not supported, using",h,"instead."));const Y=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,pe=Y!==void 0?Y.length:0;let Ge=0;X.morphAttributes.position!==void 0&&(Ge=1),X.morphAttributes.normal!==void 0&&(Ge=2),X.morphAttributes.color!==void 0&&(Ge=3);let Ze,xt,at,oe;if(ue){const Pt=Wi[ue];Ze=Pt.vertexShader,xt=Pt.fragmentShader}else Ze=S.vertexShader,xt=S.fragmentShader,l.update(S),at=l.getVertexShaderID(S),oe=l.getFragmentShaderID(S);const fe=t.getRenderTarget(),Ie=t.state.buffers.depth.getReversed(),Ne=W.isInstancedMesh===!0,De=W.isBatchedMesh===!0,mt=!!S.map,L=!!S.matcap,U=!!k,O=!!S.aoMap,G=!!S.lightMap,z=!!S.bumpMap,$=!!S.normalMap,C=!!S.displacementMap,ce=!!S.emissiveMap,ee=!!S.metalnessMap,te=!!S.roughnessMap,le=S.anisotropy>0,T=S.clearcoat>0,b=S.dispersion>0,F=S.iridescence>0,K=S.sheen>0,ae=S.transmission>0,j=le&&!!S.anisotropyMap,Ae=T&&!!S.clearcoatMap,ve=T&&!!S.clearcoatNormalMap,Le=T&&!!S.clearcoatRoughnessMap,Ye=F&&!!S.iridescenceMap,ge=F&&!!S.iridescenceThicknessMap,Me=K&&!!S.sheenColorMap,Ce=K&&!!S.sheenRoughnessMap,ke=!!S.specularMap,we=!!S.specularColorMap,dt=!!S.specularIntensityMap,V=ae&&!!S.transmissionMap,Ue=ae&&!!S.thicknessMap,ye=!!S.gradientMap,ze=!!S.alphaMap,_e=S.alphaTest>0,he=!!S.alphaHash,Ee=!!S.extensions;let ct=Zi;S.toneMapped&&(fe===null||fe.isXRRenderTarget===!0)&&(ct=t.toneMapping);const Gt={shaderID:ue,shaderType:S.type,shaderName:S.name,vertexShader:Ze,fragmentShader:xt,defines:S.defines,customVertexShaderID:at,customFragmentShaderID:oe,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:h,batching:De,batchingColor:De&&W._colorsTexture!==null,instancing:Ne,instancingColor:Ne&&W.instanceColor!==null,instancingMorph:Ne&&W.morphTexture!==null,outputColorSpace:fe===null?t.outputColorSpace:fe.isXRRenderTarget===!0?fe.texture.colorSpace:jo,alphaToCoverage:!!S.alphaToCoverage,map:mt,matcap:L,envMap:U,envMapMode:U&&k.mapping,envMapCubeUVHeight:J,aoMap:O,lightMap:G,bumpMap:z,normalMap:$,displacementMap:C,emissiveMap:ce,normalMapObjectSpace:$&&S.normalMapType===dC,normalMapTangentSpace:$&&S.normalMapType===Hy,metalnessMap:ee,roughnessMap:te,anisotropy:le,anisotropyMap:j,clearcoat:T,clearcoatMap:Ae,clearcoatNormalMap:ve,clearcoatRoughnessMap:Le,dispersion:b,iridescence:F,iridescenceMap:Ye,iridescenceThicknessMap:ge,sheen:K,sheenColorMap:Me,sheenRoughnessMap:Ce,specularMap:ke,specularColorMap:we,specularIntensityMap:dt,transmission:ae,transmissionMap:V,thicknessMap:Ue,gradientMap:ye,opaque:S.transparent===!1&&S.blending===Ho&&S.alphaToCoverage===!1,alphaMap:ze,alphaTest:_e,alphaHash:he,combine:S.combine,mapUv:mt&&v(S.map.channel),aoMapUv:O&&v(S.aoMap.channel),lightMapUv:G&&v(S.lightMap.channel),bumpMapUv:z&&v(S.bumpMap.channel),normalMapUv:$&&v(S.normalMap.channel),displacementMapUv:C&&v(S.displacementMap.channel),emissiveMapUv:ce&&v(S.emissiveMap.channel),metalnessMapUv:ee&&v(S.metalnessMap.channel),roughnessMapUv:te&&v(S.roughnessMap.channel),anisotropyMapUv:j&&v(S.anisotropyMap.channel),clearcoatMapUv:Ae&&v(S.clearcoatMap.channel),clearcoatNormalMapUv:ve&&v(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Le&&v(S.clearcoatRoughnessMap.channel),iridescenceMapUv:Ye&&v(S.iridescenceMap.channel),iridescenceThicknessMapUv:ge&&v(S.iridescenceThicknessMap.channel),sheenColorMapUv:Me&&v(S.sheenColorMap.channel),sheenRoughnessMapUv:Ce&&v(S.sheenRoughnessMap.channel),specularMapUv:ke&&v(S.specularMap.channel),specularColorMapUv:we&&v(S.specularColorMap.channel),specularIntensityMapUv:dt&&v(S.specularIntensityMap.channel),transmissionMapUv:V&&v(S.transmissionMap.channel),thicknessMapUv:Ue&&v(S.thicknessMap.channel),alphaMapUv:ze&&v(S.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&($||le),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!X.attributes.uv&&(mt||ze),fog:!!Z,useFog:S.fog===!0,fogExp2:!!Z&&Z.isFogExp2,flatShading:S.flatShading===!0&&S.wireframe===!1,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:f,reversedDepthBuffer:Ie,skinning:W.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:pe,morphTextureStride:Ge,numDirLights:w.directional.length,numPointLights:w.point.length,numSpotLights:w.spot.length,numSpotLightMaps:w.spotLightMap.length,numRectAreaLights:w.rectArea.length,numHemiLights:w.hemi.length,numDirLightShadows:w.directionalShadowMap.length,numPointLightShadows:w.pointShadowMap.length,numSpotLightShadows:w.spotShadowMap.length,numSpotLightShadowsWithMaps:w.numSpotLightShadowsWithMaps,numLightProbes:w.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:t.shadowMap.enabled&&N.length>0,shadowMapType:t.shadowMap.type,toneMapping:ct,decodeVideoTexture:mt&&S.map.isVideoTexture===!0&&wt.getTransfer(S.map.colorSpace)===Dt,decodeVideoTextureEmissive:ce&&S.emissiveMap.isVideoTexture===!0&&wt.getTransfer(S.emissiveMap.colorSpace)===Dt,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===zn,flipSided:S.side===Nn,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:Ee&&S.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ee&&S.extensions.multiDraw===!0||De)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return Gt.vertexUv1s=c.has(1),Gt.vertexUv2s=c.has(2),Gt.vertexUv3s=c.has(3),c.clear(),Gt}function p(S){const w=[];if(S.shaderID?w.push(S.shaderID):(w.push(S.customVertexShaderID),w.push(S.customFragmentShaderID)),S.defines!==void 0)for(const N in S.defines)w.push(N),w.push(S.defines[N]);return S.isRawShaderMaterial===!1&&(_(w,S),x(w,S),w.push(t.outputColorSpace)),w.push(S.customProgramCacheKey),w.join()}function _(S,w){S.push(w.precision),S.push(w.outputColorSpace),S.push(w.envMapMode),S.push(w.envMapCubeUVHeight),S.push(w.mapUv),S.push(w.alphaMapUv),S.push(w.lightMapUv),S.push(w.aoMapUv),S.push(w.bumpMapUv),S.push(w.normalMapUv),S.push(w.displacementMapUv),S.push(w.emissiveMapUv),S.push(w.metalnessMapUv),S.push(w.roughnessMapUv),S.push(w.anisotropyMapUv),S.push(w.clearcoatMapUv),S.push(w.clearcoatNormalMapUv),S.push(w.clearcoatRoughnessMapUv),S.push(w.iridescenceMapUv),S.push(w.iridescenceThicknessMapUv),S.push(w.sheenColorMapUv),S.push(w.sheenRoughnessMapUv),S.push(w.specularMapUv),S.push(w.specularColorMapUv),S.push(w.specularIntensityMapUv),S.push(w.transmissionMapUv),S.push(w.thicknessMapUv),S.push(w.combine),S.push(w.fogExp2),S.push(w.sizeAttenuation),S.push(w.morphTargetsCount),S.push(w.morphAttributeCount),S.push(w.numDirLights),S.push(w.numPointLights),S.push(w.numSpotLights),S.push(w.numSpotLightMaps),S.push(w.numHemiLights),S.push(w.numRectAreaLights),S.push(w.numDirLightShadows),S.push(w.numPointLightShadows),S.push(w.numSpotLightShadows),S.push(w.numSpotLightShadowsWithMaps),S.push(w.numLightProbes),S.push(w.shadowMapType),S.push(w.toneMapping),S.push(w.numClippingPlanes),S.push(w.numClipIntersection),S.push(w.depthPacking)}function x(S,w){a.disableAll(),w.instancing&&a.enable(0),w.instancingColor&&a.enable(1),w.instancingMorph&&a.enable(2),w.matcap&&a.enable(3),w.envMap&&a.enable(4),w.normalMapObjectSpace&&a.enable(5),w.normalMapTangentSpace&&a.enable(6),w.clearcoat&&a.enable(7),w.iridescence&&a.enable(8),w.alphaTest&&a.enable(9),w.vertexColors&&a.enable(10),w.vertexAlphas&&a.enable(11),w.vertexUv1s&&a.enable(12),w.vertexUv2s&&a.enable(13),w.vertexUv3s&&a.enable(14),w.vertexTangents&&a.enable(15),w.anisotropy&&a.enable(16),w.alphaHash&&a.enable(17),w.batching&&a.enable(18),w.dispersion&&a.enable(19),w.batchingColor&&a.enable(20),w.gradientMap&&a.enable(21),S.push(a.mask),a.disableAll(),w.fog&&a.enable(0),w.useFog&&a.enable(1),w.flatShading&&a.enable(2),w.logarithmicDepthBuffer&&a.enable(3),w.reversedDepthBuffer&&a.enable(4),w.skinning&&a.enable(5),w.morphTargets&&a.enable(6),w.morphNormals&&a.enable(7),w.morphColors&&a.enable(8),w.premultipliedAlpha&&a.enable(9),w.shadowMapEnabled&&a.enable(10),w.doubleSided&&a.enable(11),w.flipSided&&a.enable(12),w.useDepthPacking&&a.enable(13),w.dithering&&a.enable(14),w.transmission&&a.enable(15),w.sheen&&a.enable(16),w.opaque&&a.enable(17),w.pointsUvs&&a.enable(18),w.decodeVideoTexture&&a.enable(19),w.decodeVideoTextureEmissive&&a.enable(20),w.alphaToCoverage&&a.enable(21),S.push(a.mask)}function y(S){const w=g[S.type];let N;if(w){const B=Wi[w];N=Jy.clone(B.uniforms)}else N=S.uniforms;return N}function E(S,w){let N=d.get(w);return N!==void 0?++N.usedTimes:(N=new TI(t,w,S,s),u.push(N),d.set(w,N)),N}function A(S){if(--S.usedTimes===0){const w=u.indexOf(S);u[w]=u[u.length-1],u.pop(),d.delete(S.cacheKey),S.destroy()}}function P(S){l.remove(S)}function D(){l.dispose()}return{getParameters:m,getProgramCacheKey:p,getUniforms:y,acquireProgram:E,releaseProgram:A,releaseShaderCache:P,programs:u,dispose:D}}function DI(){let t=new WeakMap;function e(o){return t.has(o)}function n(o){let a=t.get(o);return a===void 0&&(a={},t.set(o,a)),a}function i(o){t.delete(o)}function r(o,a,l){t.get(o)[a]=l}function s(){t=new WeakMap}return{has:e,get:n,remove:i,update:r,dispose:s}}function II(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Tv(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Av(){const t=[];let e=0;const n=[],i=[],r=[];function s(){e=0,n.length=0,i.length=0,r.length=0}function o(d,f,h,g,v,m){let p=t[e];return p===void 0?(p={id:d.id,object:d,geometry:f,material:h,groupOrder:g,renderOrder:d.renderOrder,z:v,group:m},t[e]=p):(p.id=d.id,p.object=d,p.geometry=f,p.material=h,p.groupOrder=g,p.renderOrder=d.renderOrder,p.z=v,p.group=m),e++,p}function a(d,f,h,g,v,m){const p=o(d,f,h,g,v,m);h.transmission>0?i.push(p):h.transparent===!0?r.push(p):n.push(p)}function l(d,f,h,g,v,m){const p=o(d,f,h,g,v,m);h.transmission>0?i.unshift(p):h.transparent===!0?r.unshift(p):n.unshift(p)}function c(d,f){n.length>1&&n.sort(d||II),i.length>1&&i.sort(f||Tv),r.length>1&&r.sort(f||Tv)}function u(){for(let d=e,f=t.length;d=s.length?(o=new Av,s.push(o)):o=s[r],o}function n(){t=new WeakMap}return{get:e,dispose:n}}function LI(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new I,color:new st};break;case"SpotLight":n={position:new I,direction:new I,color:new st,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new I,color:new st,distance:0,decay:0};break;case"HemisphereLight":n={direction:new I,skyColor:new st,groundColor:new st};break;case"RectAreaLight":n={color:new st,position:new I,halfWidth:new I,halfHeight:new I};break}return t[e.id]=n,n}}}function OI(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new xe,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let FI=0;function UI(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function kI(t){const e=new LI,n=OI(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new I);const r=new I,s=new yt,o=new yt;function a(c){let u=0,d=0,f=0;for(let S=0;S<9;S++)i.probe[S].set(0,0,0);let h=0,g=0,v=0,m=0,p=0,_=0,x=0,y=0,E=0,A=0,P=0;c.sort(UI);for(let S=0,w=c.length;S0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Re.LTC_FLOAT_1,i.rectAreaLTC2=Re.LTC_FLOAT_2):(i.rectAreaLTC1=Re.LTC_HALF_1,i.rectAreaLTC2=Re.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=d,i.ambient[2]=f;const D=i.hash;(D.directionalLength!==h||D.pointLength!==g||D.spotLength!==v||D.rectAreaLength!==m||D.hemiLength!==p||D.numDirectionalShadows!==_||D.numPointShadows!==x||D.numSpotShadows!==y||D.numSpotMaps!==E||D.numLightProbes!==P)&&(i.directional.length=h,i.spot.length=v,i.rectArea.length=m,i.point.length=g,i.hemi.length=p,i.directionalShadow.length=_,i.directionalShadowMap.length=_,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=y,i.spotShadowMap.length=y,i.directionalShadowMatrix.length=_,i.pointShadowMatrix.length=x,i.spotLightMatrix.length=y+E-A,i.spotLightMap.length=E,i.numSpotLightShadowsWithMaps=A,i.numLightProbes=P,D.directionalLength=h,D.pointLength=g,D.spotLength=v,D.rectAreaLength=m,D.hemiLength=p,D.numDirectionalShadows=_,D.numPointShadows=x,D.numSpotShadows=y,D.numSpotMaps=E,D.numLightProbes=P,i.version=FI++)}function l(c,u){let d=0,f=0,h=0,g=0,v=0;const m=u.matrixWorldInverse;for(let p=0,_=c.length;p<_;p++){const x=c[p];if(x.isDirectionalLight){const y=i.directional[d];y.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),y.direction.sub(r),y.direction.transformDirection(m),d++}else if(x.isSpotLight){const y=i.spot[h];y.position.setFromMatrixPosition(x.matrixWorld),y.position.applyMatrix4(m),y.direction.setFromMatrixPosition(x.matrixWorld),r.setFromMatrixPosition(x.target.matrixWorld),y.direction.sub(r),y.direction.transformDirection(m),h++}else if(x.isRectAreaLight){const y=i.rectArea[g];y.position.setFromMatrixPosition(x.matrixWorld),y.position.applyMatrix4(m),o.identity(),s.copy(x.matrixWorld),s.premultiply(m),o.extractRotation(s),y.halfWidth.set(x.width*.5,0,0),y.halfHeight.set(0,x.height*.5,0),y.halfWidth.applyMatrix4(o),y.halfHeight.applyMatrix4(o),g++}else if(x.isPointLight){const y=i.point[f];y.position.setFromMatrixPosition(x.matrixWorld),y.position.applyMatrix4(m),f++}else if(x.isHemisphereLight){const y=i.hemi[v];y.direction.setFromMatrixPosition(x.matrixWorld),y.direction.transformDirection(m),v++}}}return{setup:a,setupView:l,state:i}}function Cv(t){const e=new kI(t),n=[],i=[];function r(u){c.camera=u,n.length=0,i.length=0}function s(u){n.push(u)}function o(u){i.push(u)}function a(){e.setup(n)}function l(u){e.setupView(n,u)}const c={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:r,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function BI(t){let e=new WeakMap;function n(r,s=0){const o=e.get(r);let a;return o===void 0?(a=new Cv(t),e.set(r,[a])):s>=o.length?(a=new Cv(t),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:n,dispose:i}}const zI=`void main() { gl_Position = vec4( position, 1.0 ); -}`,HI=`uniform sampler2D shadow_pass; +}`,VI=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; void main() { @@ -3986,12 +3986,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); -}`,GI=[new I(1,0,0),new I(-1,0,0),new I(0,1,0),new I(0,-1,0),new I(0,0,1),new I(0,0,-1)],WI=[new I(0,-1,0),new I(0,-1,0),new I(0,0,1),new I(0,0,-1),new I(0,-1,0),new I(0,-1,0)],B0=new yt,_a=new I,Ud=new I;function qI(t,e,n){let i=new dp;const r=new xe,s=new xe,o=new Zt,a=new XP,l=new $P,c={},u=n.maxTextureSize,d={[hs]:In,[In]:hs,[Bn]:Bn},f=new Pi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xe},radius:{value:4}},vertexShader:VI,fragmentShader:HI}),h=f.clone();h.defines.HORIZONTAL_PASS=1;const g=new _t;g.setAttribute("position",new Nn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new be(g,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=xc;let p=this.type;this.render=function(A,P,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||A.length===0)return;A.type===my&&(tt("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),A.type=xc);const S=t.getRenderTarget(),M=t.getActiveCubeFace(),N=t.getActiveMipmapLevel(),B=t.state;B.setBlending(Mr),B.buffers.depth.getReversed()===!0?B.buffers.color.setClear(0,0,0,0):B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const q=p!==this.type;q&&P.traverse(function(K){K.material&&(Array.isArray(K.material)?K.material.forEach($=>$.needsUpdate=!0):K.material.needsUpdate=!0)});for(let K=0,$=A.length;K<$;K++){const W=A[K],k=W.shadow;if(k===void 0){tt("WebGLShadowMap:",W,"has no shadow.");continue}if(k.autoUpdate===!1&&k.needsUpdate===!1)continue;r.copy(k.mapSize);const z=k.getFrameExtents();if(r.multiply(z),s.copy(k.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/z.x),r.x=s.x*z.x,k.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/z.y),r.y=s.y*z.y,k.mapSize.y=s.y)),k.map===null||q===!0){if(k.map!==null&&(k.map.depthTexture!==null&&(k.map.depthTexture.dispose(),k.map.depthTexture=null),k.map.dispose()),this.type===Sa){if(W.isPointLight){tt("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}k.map=new Ji(r.x,r.y,{format:Yo,type:Nr,minFilter:Pn,magFilter:Pn,generateMipmaps:!1}),k.map.texture.name=W.name+".shadowMap",k.map.depthTexture=new Ka(r.x,r.y,Wi),k.map.depthTexture.name=W.name+".shadowMapDepth",k.map.depthTexture.format=Lr,k.map.depthTexture.compareFunction=null,k.map.depthTexture.minFilter=vn,k.map.depthTexture.magFilter=vn}else{W.isPointLight?(k.map=new Vy(r.x),k.map.depthTexture=new cP(r.x,ji)):(k.map=new Ji(r.x,r.y),k.map.depthTexture=new Ka(r.x,r.y,ji)),k.map.depthTexture.name=W.name+".shadowMap",k.map.depthTexture.format=Lr;const le=t.state.buffers.depth.getReversed();this.type===xc?(k.map.depthTexture.compareFunction=le?ap:op,k.map.depthTexture.minFilter=Pn,k.map.depthTexture.magFilter=Pn):(k.map.depthTexture.compareFunction=null,k.map.depthTexture.minFilter=vn,k.map.depthTexture.magFilter=vn)}k.camera.updateProjectionMatrix()}const de=k.map.isWebGLCubeRenderTarget?6:1;for(let le=0;le0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const B=M.uuid,q=P.uuid;let K=c[B];K===void 0&&(K={},c[B]=K);let $=K[q];$===void 0&&($=M.clone(),K[q]=$,P.addEventListener("dispose",w)),M=$}if(M.visible=P.visible,M.wireframe=P.wireframe,S===Sa?M.side=P.shadowSide!==null?P.shadowSide:P.side:M.side=P.shadowSide!==null?P.shadowSide:d[P.side],M.alphaMap=P.alphaMap,M.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,M.map=P.map,M.clipShadows=P.clipShadows,M.clippingPlanes=P.clippingPlanes,M.clipIntersection=P.clipIntersection,M.displacementMap=P.displacementMap,M.displacementScale=P.displacementScale,M.displacementBias=P.displacementBias,M.wireframeLinewidth=P.wireframeLinewidth,M.linewidth=P.linewidth,D.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const B=t.properties.get(M);B.light=D}return M}function y(A,P,D,S,M){if(A.visible===!1)return;if(A.layers.test(P.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&M===Sa)&&(!A.frustumCulled||i.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,A.matrixWorld);const q=e.update(A),K=A.material;if(Array.isArray(K)){const $=q.groups;for(let W=0,k=$.length;W=1):z.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(z)[1]),W=k>=2);let de=null,le={};const pe=t.getParameter(t.SCISSOR_BOX),He=t.getParameter(t.VIEWPORT),Be=new Zt().fromArray(pe),st=new Zt().fromArray(He);function xt(H,Oe,ye,ze){const _e=new Uint8Array(4),he=t.createTexture();t.bindTexture(H,he),t.texParameteri(H,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(H,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Ee=0;Ee"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xe,u=new WeakMap;let d;const f=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(E,b){return h?new OffscreenCanvas(E,b):$c("canvas")}function v(E,b,O){let J=1;const se=oe(E);if((se.width>O||se.height>O)&&(J=O/Math.max(se.width,se.height)),J<1)if(typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&E instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&E instanceof ImageBitmap||typeof VideoFrame<"u"&&E instanceof VideoFrame){const Z=Math.floor(J*se.width),Ce=Math.floor(J*se.height);d===void 0&&(d=g(Z,Ce));const ve=b?g(Z,Ce):d;return ve.width=Z,ve.height=Ce,ve.getContext("2d").drawImage(E,0,0,Z,Ce),tt("WebGLRenderer: Texture has been resized from ("+se.width+"x"+se.height+") to ("+Z+"x"+Ce+")."),ve}else return"data"in E&&tt("WebGLRenderer: Image in DataTexture is too big ("+se.width+"x"+se.height+")."),E;return E}function m(E){return E.generateMipmaps}function p(E){t.generateMipmap(E)}function _(E){return E.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:E.isWebGL3DRenderTarget?t.TEXTURE_3D:E.isWebGLArrayRenderTarget||E.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function x(E,b,O,J,se=!1){if(E!==null){if(t[E]!==void 0)return t[E];tt("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+E+"'")}let Z=b;if(b===t.RED&&(O===t.FLOAT&&(Z=t.R32F),O===t.HALF_FLOAT&&(Z=t.R16F),O===t.UNSIGNED_BYTE&&(Z=t.R8)),b===t.RED_INTEGER&&(O===t.UNSIGNED_BYTE&&(Z=t.R8UI),O===t.UNSIGNED_SHORT&&(Z=t.R16UI),O===t.UNSIGNED_INT&&(Z=t.R32UI),O===t.BYTE&&(Z=t.R8I),O===t.SHORT&&(Z=t.R16I),O===t.INT&&(Z=t.R32I)),b===t.RG&&(O===t.FLOAT&&(Z=t.RG32F),O===t.HALF_FLOAT&&(Z=t.RG16F),O===t.UNSIGNED_BYTE&&(Z=t.RG8)),b===t.RG_INTEGER&&(O===t.UNSIGNED_BYTE&&(Z=t.RG8UI),O===t.UNSIGNED_SHORT&&(Z=t.RG16UI),O===t.UNSIGNED_INT&&(Z=t.RG32UI),O===t.BYTE&&(Z=t.RG8I),O===t.SHORT&&(Z=t.RG16I),O===t.INT&&(Z=t.RG32I)),b===t.RGB_INTEGER&&(O===t.UNSIGNED_BYTE&&(Z=t.RGB8UI),O===t.UNSIGNED_SHORT&&(Z=t.RGB16UI),O===t.UNSIGNED_INT&&(Z=t.RGB32UI),O===t.BYTE&&(Z=t.RGB8I),O===t.SHORT&&(Z=t.RGB16I),O===t.INT&&(Z=t.RGB32I)),b===t.RGBA_INTEGER&&(O===t.UNSIGNED_BYTE&&(Z=t.RGBA8UI),O===t.UNSIGNED_SHORT&&(Z=t.RGBA16UI),O===t.UNSIGNED_INT&&(Z=t.RGBA32UI),O===t.BYTE&&(Z=t.RGBA8I),O===t.SHORT&&(Z=t.RGBA16I),O===t.INT&&(Z=t.RGBA32I)),b===t.RGB&&(O===t.UNSIGNED_INT_5_9_9_9_REV&&(Z=t.RGB9_E5),O===t.UNSIGNED_INT_10F_11F_11F_REV&&(Z=t.R11F_G11F_B10F)),b===t.RGBA){const Ce=se?qc:St.getTransfer(J);O===t.FLOAT&&(Z=t.RGBA32F),O===t.HALF_FLOAT&&(Z=t.RGBA16F),O===t.UNSIGNED_BYTE&&(Z=Ce===Pt?t.SRGB8_ALPHA8:t.RGBA8),O===t.UNSIGNED_SHORT_4_4_4_4&&(Z=t.RGBA4),O===t.UNSIGNED_SHORT_5_5_5_1&&(Z=t.RGB5_A1)}return(Z===t.R16F||Z===t.R32F||Z===t.RG16F||Z===t.RG32F||Z===t.RGBA16F||Z===t.RGBA32F)&&e.get("EXT_color_buffer_float"),Z}function y(E,b){let O;return E?b===null||b===ji||b===Ya?O=t.DEPTH24_STENCIL8:b===Wi?O=t.DEPTH32F_STENCIL8:b===$a&&(O=t.DEPTH24_STENCIL8,tt("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===ji||b===Ya?O=t.DEPTH_COMPONENT24:b===Wi?O=t.DEPTH_COMPONENT32F:b===$a&&(O=t.DEPTH_COMPONENT16),O}function w(E,b){return m(E)===!0||E.isFramebufferTexture&&E.minFilter!==vn&&E.minFilter!==Pn?Math.log2(Math.max(b.width,b.height))+1:E.mipmaps!==void 0&&E.mipmaps.length>0?E.mipmaps.length:E.isCompressedTexture&&Array.isArray(E.image)?b.mipmaps.length:1}function A(E){const b=E.target;b.removeEventListener("dispose",A),D(b),b.isVideoTexture&&u.delete(b)}function P(E){const b=E.target;b.removeEventListener("dispose",P),M(b)}function D(E){const b=i.get(E);if(b.__webglInit===void 0)return;const O=E.source,J=f.get(O);if(J){const se=J[b.__cacheKey];se.usedTimes--,se.usedTimes===0&&S(E),Object.keys(J).length===0&&f.delete(O)}i.remove(E)}function S(E){const b=i.get(E);t.deleteTexture(b.__webglTexture);const O=E.source,J=f.get(O);delete J[b.__cacheKey],o.memory.textures--}function M(E){const b=i.get(E);if(E.depthTexture&&(E.depthTexture.dispose(),i.remove(E.depthTexture)),E.isWebGLCubeRenderTarget)for(let J=0;J<6;J++){if(Array.isArray(b.__webglFramebuffer[J]))for(let se=0;se=r.maxTextures&&tt("WebGLTextures: Trying to use "+E+" texture units while this GPU supports only "+r.maxTextures),N+=1,E}function K(E){const b=[];return b.push(E.wrapS),b.push(E.wrapT),b.push(E.wrapR||0),b.push(E.magFilter),b.push(E.minFilter),b.push(E.anisotropy),b.push(E.internalFormat),b.push(E.format),b.push(E.type),b.push(E.generateMipmaps),b.push(E.premultiplyAlpha),b.push(E.flipY),b.push(E.unpackAlignment),b.push(E.colorSpace),b.join()}function $(E,b){const O=i.get(E);if(E.isVideoTexture&&Q(E),E.isRenderTargetTexture===!1&&E.isExternalTexture!==!0&&E.version>0&&O.__version!==E.version){const J=E.image;if(J===null)tt("WebGLRenderer: Texture marked for update but no image data found.");else if(J.complete===!1)tt("WebGLRenderer: Texture marked for update but image is incomplete");else{ce(O,E,b);return}}else E.isExternalTexture&&(O.__webglTexture=E.sourceTexture?E.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,O.__webglTexture,t.TEXTURE0+b)}function W(E,b){const O=i.get(E);if(E.isRenderTargetTexture===!1&&E.version>0&&O.__version!==E.version){ce(O,E,b);return}else E.isExternalTexture&&(O.__webglTexture=E.sourceTexture?E.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,O.__webglTexture,t.TEXTURE0+b)}function k(E,b){const O=i.get(E);if(E.isRenderTargetTexture===!1&&E.version>0&&O.__version!==E.version){ce(O,E,b);return}n.bindTexture(t.TEXTURE_3D,O.__webglTexture,t.TEXTURE0+b)}function z(E,b){const O=i.get(E);if(E.isCubeDepthTexture!==!0&&E.version>0&&O.__version!==E.version){ue(O,E,b);return}n.bindTexture(t.TEXTURE_CUBE_MAP,O.__webglTexture,t.TEXTURE0+b)}const de={[Pf]:t.REPEAT,[xr]:t.CLAMP_TO_EDGE,[Rf]:t.MIRRORED_REPEAT},le={[vn]:t.NEAREST,[cC]:t.NEAREST_MIPMAP_NEAREST,[Pl]:t.NEAREST_MIPMAP_LINEAR,[Pn]:t.LINEAR,[nd]:t.LINEAR_MIPMAP_NEAREST,[Bs]:t.LINEAR_MIPMAP_LINEAR},pe={[fC]:t.NEVER,[vC]:t.ALWAYS,[hC]:t.LESS,[op]:t.LEQUAL,[pC]:t.EQUAL,[ap]:t.GEQUAL,[mC]:t.GREATER,[gC]:t.NOTEQUAL};function He(E,b){if(b.type===Wi&&e.has("OES_texture_float_linear")===!1&&(b.magFilter===Pn||b.magFilter===nd||b.magFilter===Pl||b.magFilter===Bs||b.minFilter===Pn||b.minFilter===nd||b.minFilter===Pl||b.minFilter===Bs)&&tt("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(E,t.TEXTURE_WRAP_S,de[b.wrapS]),t.texParameteri(E,t.TEXTURE_WRAP_T,de[b.wrapT]),(E===t.TEXTURE_3D||E===t.TEXTURE_2D_ARRAY)&&t.texParameteri(E,t.TEXTURE_WRAP_R,de[b.wrapR]),t.texParameteri(E,t.TEXTURE_MAG_FILTER,le[b.magFilter]),t.texParameteri(E,t.TEXTURE_MIN_FILTER,le[b.minFilter]),b.compareFunction&&(t.texParameteri(E,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(E,t.TEXTURE_COMPARE_FUNC,pe[b.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===vn||b.minFilter!==Pl&&b.minFilter!==Bs||b.type===Wi&&e.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||i.get(b).__currentAnisotropy){const O=e.get("EXT_texture_filter_anisotropic");t.texParameterf(E,O.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,r.getMaxAnisotropy())),i.get(b).__currentAnisotropy=b.anisotropy}}}function Be(E,b){let O=!1;E.__webglInit===void 0&&(E.__webglInit=!0,b.addEventListener("dispose",A));const J=b.source;let se=f.get(J);se===void 0&&(se={},f.set(J,se));const Z=K(b);if(Z!==E.__cacheKey){se[Z]===void 0&&(se[Z]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,O=!0),se[Z].usedTimes++;const Ce=se[E.__cacheKey];Ce!==void 0&&(se[E.__cacheKey].usedTimes--,Ce.usedTimes===0&&S(b)),E.__cacheKey=Z,E.__webglTexture=se[Z].texture}return O}function st(E,b,O){return Math.floor(Math.floor(E/O)/b)}function xt(E,b,O,J){const Z=E.updateRanges;if(Z.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,b.width,b.height,O,J,b.data);else{Z.sort((me,we)=>me.start-we.start);let Ce=0;for(let me=1;me0){H&&Oe&&n.texStorage2D(t.TEXTURE_2D,ze,Ue,ut[0].width,ut[0].height);for(let _e=0,he=ut.length;_e0){const Ee=g0(Me.width,Me.height,b.format,b.type);for(const lt of b.layerUpdates){const Bt=Me.data.subarray(lt*Ee/Me.data.BYTES_PER_ELEMENT,(lt+1)*Ee/Me.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,lt,Me.width,Me.height,1,we,Bt)}b.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,0,Me.width,Me.height,me.depth,we,Me.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,_e,Ue,Me.width,Me.height,me.depth,0,Me.data,0,0);else tt("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else H?ye&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,0,Me.width,Me.height,me.depth,we,Pe,Me.data):n.texImage3D(t.TEXTURE_2D_ARRAY,_e,Ue,Me.width,Me.height,me.depth,0,we,Pe,Me.data)}else{H&&Oe&&n.texStorage2D(t.TEXTURE_2D,ze,Ue,ut[0].width,ut[0].height);for(let _e=0,he=ut.length;_e0){const _e=g0(me.width,me.height,b.format,b.type);for(const he of b.layerUpdates){const Ee=me.data.subarray(he*_e/me.data.BYTES_PER_ELEMENT,(he+1)*_e/me.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,he,me.width,me.height,1,we,Pe,Ee)}b.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,we,Pe,me.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,Ue,me.width,me.height,me.depth,0,we,Pe,me.data);else if(b.isData3DTexture)H?(Oe&&n.texStorage3D(t.TEXTURE_3D,ze,Ue,me.width,me.height,me.depth),ye&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,we,Pe,me.data)):n.texImage3D(t.TEXTURE_3D,0,Ue,me.width,me.height,me.depth,0,we,Pe,me.data);else if(b.isFramebufferTexture){if(Oe)if(H)n.texStorage2D(t.TEXTURE_2D,ze,Ue,me.width,me.height);else{let _e=me.width,he=me.height;for(let Ee=0;Ee>=1,he>>=1}}else if(ut.length>0){if(H&&Oe){const _e=oe(ut[0]);n.texStorage2D(t.TEXTURE_2D,ze,Ue,_e.width,_e.height)}for(let _e=0,he=ut.length;_e0&&ze++;const he=oe(we[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,ze,ut,he.width,he.height)}for(let he=0;he<6;he++)if(me){H?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,we[he].width,we[he].height,Ue,Me,we[he].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,ut,we[he].width,we[he].height,0,Ue,Me,we[he].data);for(let Ee=0;Ee<_e.length;Ee++){const Bt=_e[Ee].image[he].image;H?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,0,0,Bt.width,Bt.height,Ue,Me,Bt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,ut,Bt.width,Bt.height,0,Ue,Me,Bt.data)}}else{H?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Ue,Me,we[he]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,ut,Ue,Me,we[he]);for(let Ee=0;Ee<_e.length;Ee++){const lt=_e[Ee];H?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,0,0,Ue,Me,lt.image[he]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,ut,Ue,Me,lt.image[he])}}}m(b)&&p(t.TEXTURE_CUBE_MAP),Z.__version=se.version,b.onUpdate&&b.onUpdate(b)}E.__version=b.version}function Ie(E,b,O,J,se,Z){const Ce=s.convert(O.format,O.colorSpace),ve=s.convert(O.type),Ne=x(O.internalFormat,Ce,ve,O.colorSpace),$e=i.get(b),me=i.get(O);if(me.__renderTarget=b,!$e.__hasExternalTextures){const we=Math.max(1,b.width>>Z),Pe=Math.max(1,b.height>>Z);se===t.TEXTURE_3D||se===t.TEXTURE_2D_ARRAY?n.texImage3D(se,Z,Ne,we,Pe,b.depth,0,Ce,ve,null):n.texImage2D(se,Z,Ne,we,Pe,0,Ce,ve,null)}n.bindFramebuffer(t.FRAMEBUFFER,E),ae(b)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,J,se,me.__webglTexture,0,C(b)):(se===t.TEXTURE_2D||se>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&se<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,J,se,me.__webglTexture,Z),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ye(E,b,O){if(t.bindRenderbuffer(t.RENDERBUFFER,E),b.depthBuffer){const J=b.depthTexture,se=J&&J.isDepthTexture?J.type:null,Z=y(b.stencilBuffer,se),Ce=b.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;ae(b)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,C(b),Z,b.width,b.height):O?t.renderbufferStorageMultisample(t.RENDERBUFFER,C(b),Z,b.width,b.height):t.renderbufferStorage(t.RENDERBUFFER,Z,b.width,b.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ce,t.RENDERBUFFER,E)}else{const J=b.textures;for(let se=0;se{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,J.removeEventListener("dispose",se)};J.addEventListener("dispose",se),b.__depthDisposeCallback=se}b.__boundDepthTexture=J}if(E.depthTexture&&!b.__autoAllocateDepthBuffer)if(O)for(let J=0;J<6;J++)Ae(b.__webglFramebuffer[J],E,J);else{const J=E.texture.mipmaps;J&&J.length>0?Ae(b.__webglFramebuffer[0],E,0):Ae(b.__webglFramebuffer,E,0)}else if(O){b.__webglDepthbuffer=[];for(let J=0;J<6;J++)if(n.bindFramebuffer(t.FRAMEBUFFER,b.__webglFramebuffer[J]),b.__webglDepthbuffer[J]===void 0)b.__webglDepthbuffer[J]=t.createRenderbuffer(),Ye(b.__webglDepthbuffer[J],E,!1);else{const se=E.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Z=b.__webglDepthbuffer[J];t.bindRenderbuffer(t.RENDERBUFFER,Z),t.framebufferRenderbuffer(t.FRAMEBUFFER,se,t.RENDERBUFFER,Z)}}else{const J=E.texture.mipmaps;if(J&&J.length>0?n.bindFramebuffer(t.FRAMEBUFFER,b.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=t.createRenderbuffer(),Ye(b.__webglDepthbuffer,E,!1);else{const se=E.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Z=b.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,Z),t.framebufferRenderbuffer(t.FRAMEBUFFER,se,t.RENDERBUFFER,Z)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function L(E,b,O){const J=i.get(E);b!==void 0&&Ie(J.__webglFramebuffer,E,E.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),O!==void 0&&mt(E)}function U(E){const b=E.texture,O=i.get(E),J=i.get(b);E.addEventListener("dispose",P);const se=E.textures,Z=E.isWebGLCubeRenderTarget===!0,Ce=se.length>1;if(Ce||(J.__webglTexture===void 0&&(J.__webglTexture=t.createTexture()),J.__version=b.version,o.memory.textures++),Z){O.__webglFramebuffer=[];for(let ve=0;ve<6;ve++)if(b.mipmaps&&b.mipmaps.length>0){O.__webglFramebuffer[ve]=[];for(let Ne=0;Ne0){O.__webglFramebuffer=[];for(let ve=0;ve0&&ae(E)===!1){O.__webglMultisampledFramebuffer=t.createFramebuffer(),O.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,O.__webglMultisampledFramebuffer);for(let ve=0;ve0)for(let Ne=0;Ne0)for(let Ne=0;Ne0){if(ae(E)===!1){const b=E.textures,O=E.width,J=E.height;let se=t.COLOR_BUFFER_BIT;const Z=E.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ce=i.get(E),ve=b.length>1;if(ve)for(let $e=0;$e0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let $e=0;$e0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function Q(E){const b=o.render.frame;u.get(E)!==b&&(u.set(E,b),E.update())}function ee(E,b){const O=E.colorSpace,J=E.format,se=E.type;return E.isCompressedTexture===!0||E.isVideoTexture===!0||O!==Jo&&O!==es&&(St.getTransfer(O)===Pt?(J!==Si||se!==Qn)&&tt("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):bt("WebGLTextures: Unsupported texture color space:",O)),b}function oe(E){return typeof HTMLImageElement<"u"&&E instanceof HTMLImageElement?(c.width=E.naturalWidth||E.width,c.height=E.naturalHeight||E.height):typeof VideoFrame<"u"&&E instanceof VideoFrame?(c.width=E.displayWidth,c.height=E.displayHeight):(c.width=E.width,c.height=E.height),c}this.allocateTextureUnit=q,this.resetTextureUnits=B,this.setTexture2D=$,this.setTexture2DArray=W,this.setTexture3D=k,this.setTextureCube=z,this.rebindTextures=L,this.setupRenderTarget=U,this.updateRenderTargetMipmap=F,this.updateMultisampleRenderTarget=Y,this.setupDepthRenderbuffer=mt,this.setupFrameBufferTexture=Ie,this.useMultisampledRTT=ae,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function JI(t,e){function n(i,r=es){let s;const o=St.getTransfer(r);if(i===Qn)return t.UNSIGNED_BYTE;if(i===tp)return t.UNSIGNED_SHORT_4_4_4_4;if(i===np)return t.UNSIGNED_SHORT_5_5_5_1;if(i===Ty)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===Ay)return t.UNSIGNED_INT_10F_11F_11F_REV;if(i===wy)return t.BYTE;if(i===Ey)return t.SHORT;if(i===$a)return t.UNSIGNED_SHORT;if(i===ep)return t.INT;if(i===ji)return t.UNSIGNED_INT;if(i===Wi)return t.FLOAT;if(i===Nr)return t.HALF_FLOAT;if(i===Cy)return t.ALPHA;if(i===Py)return t.RGB;if(i===Si)return t.RGBA;if(i===Lr)return t.DEPTH_COMPONENT;if(i===zs)return t.DEPTH_STENCIL;if(i===Ry)return t.RED;if(i===ip)return t.RED_INTEGER;if(i===Yo)return t.RG;if(i===rp)return t.RG_INTEGER;if(i===sp)return t.RGBA_INTEGER;if(i===yc||i===bc||i===Sc||i===Mc)if(o===Pt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===yc)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===bc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Sc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Mc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===yc)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===bc)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Sc)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Mc)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Df||i===If||i===Nf||i===Lf)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Df)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===If)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Nf)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Lf)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===Of||i===Ff||i===Uf||i===kf||i===Bf||i===zf||i===Vf)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===Of||i===Ff)return o===Pt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Uf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(i===kf)return s.COMPRESSED_R11_EAC;if(i===Bf)return s.COMPRESSED_SIGNED_R11_EAC;if(i===zf)return s.COMPRESSED_RG11_EAC;if(i===Vf)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===Hf||i===Gf||i===Wf||i===qf||i===Xf||i===$f||i===Yf||i===Jf||i===Kf||i===Zf||i===jf||i===Qf||i===eh||i===th)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===Hf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Gf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Wf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===qf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Xf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===$f)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Yf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===Jf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===Kf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===Zf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===jf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===Qf)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===eh)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===th)return o===Pt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===nh||i===ih||i===rh)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===nh)return o===Pt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===ih)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===rh)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===sh||i===oh||i===ah||i===lh)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===sh)return s.COMPRESSED_RED_RGTC1_EXT;if(i===oh)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===ah)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===lh)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Ya?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}const KI=` +}`,HI=[new I(1,0,0),new I(-1,0,0),new I(0,1,0),new I(0,-1,0),new I(0,0,1),new I(0,0,-1)],GI=[new I(0,-1,0),new I(0,-1,0),new I(0,0,1),new I(0,0,-1),new I(0,-1,0),new I(0,-1,0)],Pv=new yt,xa=new I,$d=new I;function WI(t,e,n){let i=new Bp;const r=new xe,s=new xe,o=new jt,a=new XP,l=new $P,c={},u=n.maxTextureSize,d={[ms]:Nn,[Nn]:ms,[zn]:zn},f=new Ii({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new xe},radius:{value:4}},vertexShader:zI,fragmentShader:VI}),h=f.clone();h.defines.HORIZONTAL_PASS=1;const g=new bt;g.setAttribute("position",new Ln(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new be(g,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ec;let p=this.type;this.render=function(A,P,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||A.length===0)return;A.type===Ty&&(nt("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),A.type=Ec);const S=t.getRenderTarget(),w=t.getActiveCubeFace(),N=t.getActiveMipmapLevel(),B=t.state;B.setBlending(Er),B.buffers.depth.getReversed()===!0?B.buffers.color.setClear(0,0,0,0):B.buffers.color.setClear(1,1,1,1),B.buffers.depth.setTest(!0),B.setScissorTest(!1);const W=p!==this.type;W&&P.traverse(function(Z){Z.material&&(Array.isArray(Z.material)?Z.material.forEach(X=>X.needsUpdate=!0):Z.material.needsUpdate=!0)});for(let Z=0,X=A.length;Zu||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/J.x),r.x=s.x*J.x,k.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/J.y),r.y=s.y*J.y,k.mapSize.y=s.y)),k.map===null||W===!0){if(k.map!==null&&(k.map.depthTexture!==null&&(k.map.depthTexture.dispose(),k.map.depthTexture=null),k.map.dispose()),this.type===Ca){if(H.isPointLight){nt("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}k.map=new ji(r.x,r.y,{format:Zo,type:Or,minFilter:Dn,magFilter:Dn,generateMipmaps:!1}),k.map.texture.name=H.name+".shadowMap",k.map.depthTexture=new tl(r.x,r.y,$i),k.map.depthTexture.name=H.name+".shadowMapDepth",k.map.depthTexture.format=Fr,k.map.depthTexture.compareFunction=null,k.map.depthTexture.minFilter=yn,k.map.depthTexture.magFilter=yn}else{H.isPointLight?(k.map=new jy(r.x),k.map.depthTexture=new cP(r.x,tr)):(k.map=new ji(r.x,r.y),k.map.depthTexture=new tl(r.x,r.y,tr)),k.map.depthTexture.name=H.name+".shadowMap",k.map.depthTexture.format=Fr;const Y=t.state.buffers.depth.getReversed();this.type===Ec?(k.map.depthTexture.compareFunction=Y?Op:Lp,k.map.depthTexture.minFilter=Dn,k.map.depthTexture.magFilter=Dn):(k.map.depthTexture.compareFunction=null,k.map.depthTexture.minFilter=yn,k.map.depthTexture.magFilter=yn)}k.camera.updateProjectionMatrix()}const ue=k.map.isWebGLCubeRenderTarget?6:1;for(let Y=0;Y0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const B=w.uuid,W=P.uuid;let Z=c[B];Z===void 0&&(Z={},c[B]=Z);let X=Z[W];X===void 0&&(X=w.clone(),Z[W]=X,P.addEventListener("dispose",E)),w=X}if(w.visible=P.visible,w.wireframe=P.wireframe,S===Ca?w.side=P.shadowSide!==null?P.shadowSide:P.side:w.side=P.shadowSide!==null?P.shadowSide:d[P.side],w.alphaMap=P.alphaMap,w.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,w.map=P.map,w.clipShadows=P.clipShadows,w.clippingPlanes=P.clippingPlanes,w.clipIntersection=P.clipIntersection,w.displacementMap=P.displacementMap,w.displacementScale=P.displacementScale,w.displacementBias=P.displacementBias,w.wireframeLinewidth=P.wireframeLinewidth,w.linewidth=P.linewidth,D.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const B=t.properties.get(w);B.light=D}return w}function y(A,P,D,S,w){if(A.visible===!1)return;if(A.layers.test(P.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&w===Ca)&&(!A.frustumCulled||i.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,A.matrixWorld);const W=e.update(A),Z=A.material;if(Array.isArray(Z)){const X=W.groups;for(let H=0,k=X.length;H=1):J.indexOf("OpenGL ES")!==-1&&(k=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),H=k>=2);let ue=null,Y={};const pe=t.getParameter(t.SCISSOR_BOX),Ge=t.getParameter(t.VIEWPORT),Ze=new jt().fromArray(pe),xt=new jt().fromArray(Ge);function at(V,Ue,ye,ze){const _e=new Uint8Array(4),he=t.createTexture();t.bindTexture(V,he),t.texParameteri(V,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(V,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Ee=0;Ee"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new xe,u=new WeakMap;let d;const f=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function g(T,b){return h?new OffscreenCanvas(T,b):Zc("canvas")}function v(T,b,F){let K=1;const ae=le(T);if((ae.width>F||ae.height>F)&&(K=F/Math.max(ae.width,ae.height)),K<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){const j=Math.floor(K*ae.width),Ae=Math.floor(K*ae.height);d===void 0&&(d=g(j,Ae));const ve=b?g(j,Ae):d;return ve.width=j,ve.height=Ae,ve.getContext("2d").drawImage(T,0,0,j,Ae),nt("WebGLRenderer: Texture has been resized from ("+ae.width+"x"+ae.height+") to ("+j+"x"+Ae+")."),ve}else return"data"in T&&nt("WebGLRenderer: Image in DataTexture is too big ("+ae.width+"x"+ae.height+")."),T;return T}function m(T){return T.generateMipmaps}function p(T){t.generateMipmap(T)}function _(T){return T.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:T.isWebGL3DRenderTarget?t.TEXTURE_3D:T.isWebGLArrayRenderTarget||T.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function x(T,b,F,K,ae=!1){if(T!==null){if(t[T]!==void 0)return t[T];nt("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let j=b;if(b===t.RED&&(F===t.FLOAT&&(j=t.R32F),F===t.HALF_FLOAT&&(j=t.R16F),F===t.UNSIGNED_BYTE&&(j=t.R8)),b===t.RED_INTEGER&&(F===t.UNSIGNED_BYTE&&(j=t.R8UI),F===t.UNSIGNED_SHORT&&(j=t.R16UI),F===t.UNSIGNED_INT&&(j=t.R32UI),F===t.BYTE&&(j=t.R8I),F===t.SHORT&&(j=t.R16I),F===t.INT&&(j=t.R32I)),b===t.RG&&(F===t.FLOAT&&(j=t.RG32F),F===t.HALF_FLOAT&&(j=t.RG16F),F===t.UNSIGNED_BYTE&&(j=t.RG8)),b===t.RG_INTEGER&&(F===t.UNSIGNED_BYTE&&(j=t.RG8UI),F===t.UNSIGNED_SHORT&&(j=t.RG16UI),F===t.UNSIGNED_INT&&(j=t.RG32UI),F===t.BYTE&&(j=t.RG8I),F===t.SHORT&&(j=t.RG16I),F===t.INT&&(j=t.RG32I)),b===t.RGB_INTEGER&&(F===t.UNSIGNED_BYTE&&(j=t.RGB8UI),F===t.UNSIGNED_SHORT&&(j=t.RGB16UI),F===t.UNSIGNED_INT&&(j=t.RGB32UI),F===t.BYTE&&(j=t.RGB8I),F===t.SHORT&&(j=t.RGB16I),F===t.INT&&(j=t.RGB32I)),b===t.RGBA_INTEGER&&(F===t.UNSIGNED_BYTE&&(j=t.RGBA8UI),F===t.UNSIGNED_SHORT&&(j=t.RGBA16UI),F===t.UNSIGNED_INT&&(j=t.RGBA32UI),F===t.BYTE&&(j=t.RGBA8I),F===t.SHORT&&(j=t.RGBA16I),F===t.INT&&(j=t.RGBA32I)),b===t.RGB&&(F===t.UNSIGNED_INT_5_9_9_9_REV&&(j=t.RGB9_E5),F===t.UNSIGNED_INT_10F_11F_11F_REV&&(j=t.R11F_G11F_B10F)),b===t.RGBA){const Ae=ae?Jc:wt.getTransfer(K);F===t.FLOAT&&(j=t.RGBA32F),F===t.HALF_FLOAT&&(j=t.RGBA16F),F===t.UNSIGNED_BYTE&&(j=Ae===Dt?t.SRGB8_ALPHA8:t.RGBA8),F===t.UNSIGNED_SHORT_4_4_4_4&&(j=t.RGBA4),F===t.UNSIGNED_SHORT_5_5_5_1&&(j=t.RGB5_A1)}return(j===t.R16F||j===t.R32F||j===t.RG16F||j===t.RG32F||j===t.RGBA16F||j===t.RGBA32F)&&e.get("EXT_color_buffer_float"),j}function y(T,b){let F;return T?b===null||b===tr||b===Qa?F=t.DEPTH24_STENCIL8:b===$i?F=t.DEPTH32F_STENCIL8:b===ja&&(F=t.DEPTH24_STENCIL8,nt("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===tr||b===Qa?F=t.DEPTH_COMPONENT24:b===$i?F=t.DEPTH_COMPONENT32F:b===ja&&(F=t.DEPTH_COMPONENT16),F}function E(T,b){return m(T)===!0||T.isFramebufferTexture&&T.minFilter!==yn&&T.minFilter!==Dn?Math.log2(Math.max(b.width,b.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?b.mipmaps.length:1}function A(T){const b=T.target;b.removeEventListener("dispose",A),D(b),b.isVideoTexture&&u.delete(b)}function P(T){const b=T.target;b.removeEventListener("dispose",P),w(b)}function D(T){const b=i.get(T);if(b.__webglInit===void 0)return;const F=T.source,K=f.get(F);if(K){const ae=K[b.__cacheKey];ae.usedTimes--,ae.usedTimes===0&&S(T),Object.keys(K).length===0&&f.delete(F)}i.remove(T)}function S(T){const b=i.get(T);t.deleteTexture(b.__webglTexture);const F=T.source,K=f.get(F);delete K[b.__cacheKey],o.memory.textures--}function w(T){const b=i.get(T);if(T.depthTexture&&(T.depthTexture.dispose(),i.remove(T.depthTexture)),T.isWebGLCubeRenderTarget)for(let K=0;K<6;K++){if(Array.isArray(b.__webglFramebuffer[K]))for(let ae=0;ae=r.maxTextures&&nt("WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+r.maxTextures),N+=1,T}function Z(T){const b=[];return b.push(T.wrapS),b.push(T.wrapT),b.push(T.wrapR||0),b.push(T.magFilter),b.push(T.minFilter),b.push(T.anisotropy),b.push(T.internalFormat),b.push(T.format),b.push(T.type),b.push(T.generateMipmaps),b.push(T.premultiplyAlpha),b.push(T.flipY),b.push(T.unpackAlignment),b.push(T.colorSpace),b.join()}function X(T,b){const F=i.get(T);if(T.isVideoTexture&&ee(T),T.isRenderTargetTexture===!1&&T.isExternalTexture!==!0&&T.version>0&&F.__version!==T.version){const K=T.image;if(K===null)nt("WebGLRenderer: Texture marked for update but no image data found.");else if(K.complete===!1)nt("WebGLRenderer: Texture marked for update but image is incomplete");else{oe(F,T,b);return}}else T.isExternalTexture&&(F.__webglTexture=T.sourceTexture?T.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,F.__webglTexture,t.TEXTURE0+b)}function H(T,b){const F=i.get(T);if(T.isRenderTargetTexture===!1&&T.version>0&&F.__version!==T.version){oe(F,T,b);return}else T.isExternalTexture&&(F.__webglTexture=T.sourceTexture?T.sourceTexture:null);n.bindTexture(t.TEXTURE_2D_ARRAY,F.__webglTexture,t.TEXTURE0+b)}function k(T,b){const F=i.get(T);if(T.isRenderTargetTexture===!1&&T.version>0&&F.__version!==T.version){oe(F,T,b);return}n.bindTexture(t.TEXTURE_3D,F.__webglTexture,t.TEXTURE0+b)}function J(T,b){const F=i.get(T);if(T.isCubeDepthTexture!==!0&&T.version>0&&F.__version!==T.version){fe(F,T,b);return}n.bindTexture(t.TEXTURE_CUBE_MAP,F.__webglTexture,t.TEXTURE0+b)}const ue={[Lf]:t.REPEAT,[Sr]:t.CLAMP_TO_EDGE,[Of]:t.MIRRORED_REPEAT},Y={[yn]:t.NEAREST,[cC]:t.NEAREST_MIPMAP_NEAREST,[Nl]:t.NEAREST_MIPMAP_LINEAR,[Dn]:t.LINEAR,[fd]:t.LINEAR_MIPMAP_NEAREST,[Hs]:t.LINEAR_MIPMAP_LINEAR},pe={[fC]:t.NEVER,[vC]:t.ALWAYS,[hC]:t.LESS,[Lp]:t.LEQUAL,[pC]:t.EQUAL,[Op]:t.GEQUAL,[mC]:t.GREATER,[gC]:t.NOTEQUAL};function Ge(T,b){if(b.type===$i&&e.has("OES_texture_float_linear")===!1&&(b.magFilter===Dn||b.magFilter===fd||b.magFilter===Nl||b.magFilter===Hs||b.minFilter===Dn||b.minFilter===fd||b.minFilter===Nl||b.minFilter===Hs)&&nt("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(T,t.TEXTURE_WRAP_S,ue[b.wrapS]),t.texParameteri(T,t.TEXTURE_WRAP_T,ue[b.wrapT]),(T===t.TEXTURE_3D||T===t.TEXTURE_2D_ARRAY)&&t.texParameteri(T,t.TEXTURE_WRAP_R,ue[b.wrapR]),t.texParameteri(T,t.TEXTURE_MAG_FILTER,Y[b.magFilter]),t.texParameteri(T,t.TEXTURE_MIN_FILTER,Y[b.minFilter]),b.compareFunction&&(t.texParameteri(T,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(T,t.TEXTURE_COMPARE_FUNC,pe[b.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===yn||b.minFilter!==Nl&&b.minFilter!==Hs||b.type===$i&&e.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||i.get(b).__currentAnisotropy){const F=e.get("EXT_texture_filter_anisotropic");t.texParameterf(T,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,r.getMaxAnisotropy())),i.get(b).__currentAnisotropy=b.anisotropy}}}function Ze(T,b){let F=!1;T.__webglInit===void 0&&(T.__webglInit=!0,b.addEventListener("dispose",A));const K=b.source;let ae=f.get(K);ae===void 0&&(ae={},f.set(K,ae));const j=Z(b);if(j!==T.__cacheKey){ae[j]===void 0&&(ae[j]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,F=!0),ae[j].usedTimes++;const Ae=ae[T.__cacheKey];Ae!==void 0&&(ae[T.__cacheKey].usedTimes--,Ae.usedTimes===0&&S(b)),T.__cacheKey=j,T.__webglTexture=ae[j].texture}return F}function xt(T,b,F){return Math.floor(Math.floor(T/F)/b)}function at(T,b,F,K){const j=T.updateRanges;if(j.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,b.width,b.height,F,K,b.data);else{j.sort((ge,Me)=>ge.start-Me.start);let Ae=0;for(let ge=1;ge0){V&&Ue&&n.texStorage2D(t.TEXTURE_2D,ze,ke,dt[0].width,dt[0].height);for(let _e=0,he=dt.length;_e0){const Ee=ov(we.width,we.height,b.format,b.type);for(const ct of b.layerUpdates){const Gt=we.data.subarray(ct*Ee/we.data.BYTES_PER_ELEMENT,(ct+1)*Ee/we.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,ct,we.width,we.height,1,Me,Gt)}b.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,0,we.width,we.height,ge.depth,Me,we.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,_e,ke,we.width,we.height,ge.depth,0,we.data,0,0);else nt("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else V?ye&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,_e,0,0,0,we.width,we.height,ge.depth,Me,Ce,we.data):n.texImage3D(t.TEXTURE_2D_ARRAY,_e,ke,we.width,we.height,ge.depth,0,Me,Ce,we.data)}else{V&&Ue&&n.texStorage2D(t.TEXTURE_2D,ze,ke,dt[0].width,dt[0].height);for(let _e=0,he=dt.length;_e0){const _e=ov(ge.width,ge.height,b.format,b.type);for(const he of b.layerUpdates){const Ee=ge.data.subarray(he*_e/ge.data.BYTES_PER_ELEMENT,(he+1)*_e/ge.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,he,ge.width,ge.height,1,Me,Ce,Ee)}b.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,ge.width,ge.height,ge.depth,Me,Ce,ge.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,ke,ge.width,ge.height,ge.depth,0,Me,Ce,ge.data);else if(b.isData3DTexture)V?(Ue&&n.texStorage3D(t.TEXTURE_3D,ze,ke,ge.width,ge.height,ge.depth),ye&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,ge.width,ge.height,ge.depth,Me,Ce,ge.data)):n.texImage3D(t.TEXTURE_3D,0,ke,ge.width,ge.height,ge.depth,0,Me,Ce,ge.data);else if(b.isFramebufferTexture){if(Ue)if(V)n.texStorage2D(t.TEXTURE_2D,ze,ke,ge.width,ge.height);else{let _e=ge.width,he=ge.height;for(let Ee=0;Ee>=1,he>>=1}}else if(dt.length>0){if(V&&Ue){const _e=le(dt[0]);n.texStorage2D(t.TEXTURE_2D,ze,ke,_e.width,_e.height)}for(let _e=0,he=dt.length;_e0&&ze++;const he=le(Me[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,ze,dt,he.width,he.height)}for(let he=0;he<6;he++)if(ge){V?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,Me[he].width,Me[he].height,ke,we,Me[he].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,dt,Me[he].width,Me[he].height,0,ke,we,Me[he].data);for(let Ee=0;Ee<_e.length;Ee++){const Gt=_e[Ee].image[he].image;V?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,0,0,Gt.width,Gt.height,ke,we,Gt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,dt,Gt.width,Gt.height,0,ke,we,Gt.data)}}else{V?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,0,0,ke,we,Me[he]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,dt,ke,we,Me[he]);for(let Ee=0;Ee<_e.length;Ee++){const ct=_e[Ee];V?ye&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,0,0,ke,we,ct.image[he]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+he,Ee+1,dt,ke,we,ct.image[he])}}}m(b)&&p(t.TEXTURE_CUBE_MAP),j.__version=ae.version,b.onUpdate&&b.onUpdate(b)}T.__version=b.version}function Ie(T,b,F,K,ae,j){const Ae=s.convert(F.format,F.colorSpace),ve=s.convert(F.type),Le=x(F.internalFormat,Ae,ve,F.colorSpace),Ye=i.get(b),ge=i.get(F);if(ge.__renderTarget=b,!Ye.__hasExternalTextures){const Me=Math.max(1,b.width>>j),Ce=Math.max(1,b.height>>j);ae===t.TEXTURE_3D||ae===t.TEXTURE_2D_ARRAY?n.texImage3D(ae,j,Le,Me,Ce,b.depth,0,Ae,ve,null):n.texImage2D(ae,j,Le,Me,Ce,0,Ae,ve,null)}n.bindFramebuffer(t.FRAMEBUFFER,T),ce(b)?a.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,K,ae,ge.__webglTexture,0,C(b)):(ae===t.TEXTURE_2D||ae>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&ae<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,K,ae,ge.__webglTexture,j),n.bindFramebuffer(t.FRAMEBUFFER,null)}function Ne(T,b,F){if(t.bindRenderbuffer(t.RENDERBUFFER,T),b.depthBuffer){const K=b.depthTexture,ae=K&&K.isDepthTexture?K.type:null,j=y(b.stencilBuffer,ae),Ae=b.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;ce(b)?a.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,C(b),j,b.width,b.height):F?t.renderbufferStorageMultisample(t.RENDERBUFFER,C(b),j,b.width,b.height):t.renderbufferStorage(t.RENDERBUFFER,j,b.width,b.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ae,t.RENDERBUFFER,T)}else{const K=b.textures;for(let ae=0;ae{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,K.removeEventListener("dispose",ae)};K.addEventListener("dispose",ae),b.__depthDisposeCallback=ae}b.__boundDepthTexture=K}if(T.depthTexture&&!b.__autoAllocateDepthBuffer)if(F)for(let K=0;K<6;K++)De(b.__webglFramebuffer[K],T,K);else{const K=T.texture.mipmaps;K&&K.length>0?De(b.__webglFramebuffer[0],T,0):De(b.__webglFramebuffer,T,0)}else if(F){b.__webglDepthbuffer=[];for(let K=0;K<6;K++)if(n.bindFramebuffer(t.FRAMEBUFFER,b.__webglFramebuffer[K]),b.__webglDepthbuffer[K]===void 0)b.__webglDepthbuffer[K]=t.createRenderbuffer(),Ne(b.__webglDepthbuffer[K],T,!1);else{const ae=T.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,j=b.__webglDepthbuffer[K];t.bindRenderbuffer(t.RENDERBUFFER,j),t.framebufferRenderbuffer(t.FRAMEBUFFER,ae,t.RENDERBUFFER,j)}}else{const K=T.texture.mipmaps;if(K&&K.length>0?n.bindFramebuffer(t.FRAMEBUFFER,b.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=t.createRenderbuffer(),Ne(b.__webglDepthbuffer,T,!1);else{const ae=T.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,j=b.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,j),t.framebufferRenderbuffer(t.FRAMEBUFFER,ae,t.RENDERBUFFER,j)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function L(T,b,F){const K=i.get(T);b!==void 0&&Ie(K.__webglFramebuffer,T,T.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),F!==void 0&&mt(T)}function U(T){const b=T.texture,F=i.get(T),K=i.get(b);T.addEventListener("dispose",P);const ae=T.textures,j=T.isWebGLCubeRenderTarget===!0,Ae=ae.length>1;if(Ae||(K.__webglTexture===void 0&&(K.__webglTexture=t.createTexture()),K.__version=b.version,o.memory.textures++),j){F.__webglFramebuffer=[];for(let ve=0;ve<6;ve++)if(b.mipmaps&&b.mipmaps.length>0){F.__webglFramebuffer[ve]=[];for(let Le=0;Le0){F.__webglFramebuffer=[];for(let ve=0;ve0&&ce(T)===!1){F.__webglMultisampledFramebuffer=t.createFramebuffer(),F.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let ve=0;ve0)for(let Le=0;Le0)for(let Le=0;Le0){if(ce(T)===!1){const b=T.textures,F=T.width,K=T.height;let ae=t.COLOR_BUFFER_BIT;const j=T.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ae=i.get(T),ve=b.length>1;if(ve)for(let Ye=0;Ye0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ae.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ae.__webglFramebuffer);for(let Ye=0;Ye0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function ee(T){const b=o.render.frame;u.get(T)!==b&&(u.set(T,b),T.update())}function te(T,b){const F=T.colorSpace,K=T.format,ae=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||F!==jo&&F!==ss&&(wt.getTransfer(F)===Dt?(K!==Mi||ae!==ni)&&nt("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):St("WebGLTextures: Unsupported texture color space:",F)),b}function le(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=W,this.resetTextureUnits=B,this.setTexture2D=X,this.setTexture2DArray=H,this.setTexture3D=k,this.setTextureCube=J,this.rebindTextures=L,this.setupRenderTarget=U,this.updateRenderTargetMipmap=O,this.updateMultisampleRenderTarget=$,this.setupDepthRenderbuffer=mt,this.setupFrameBufferTexture=Ie,this.useMultisampledRTT=ce,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function YI(t,e){function n(i,r=ss){let s;const o=wt.getTransfer(r);if(i===ni)return t.UNSIGNED_BYTE;if(i===Pp)return t.UNSIGNED_SHORT_4_4_4_4;if(i===Rp)return t.UNSIGNED_SHORT_5_5_5_1;if(i===Uy)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===ky)return t.UNSIGNED_INT_10F_11F_11F_REV;if(i===Oy)return t.BYTE;if(i===Fy)return t.SHORT;if(i===ja)return t.UNSIGNED_SHORT;if(i===Cp)return t.INT;if(i===tr)return t.UNSIGNED_INT;if(i===$i)return t.FLOAT;if(i===Or)return t.HALF_FLOAT;if(i===By)return t.ALPHA;if(i===zy)return t.RGB;if(i===Mi)return t.RGBA;if(i===Fr)return t.DEPTH_COMPONENT;if(i===Gs)return t.DEPTH_STENCIL;if(i===Vy)return t.RED;if(i===Dp)return t.RED_INTEGER;if(i===Zo)return t.RG;if(i===Ip)return t.RG_INTEGER;if(i===Np)return t.RGBA_INTEGER;if(i===Tc||i===Ac||i===Cc||i===Pc)if(o===Dt)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Tc)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Ac)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Cc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Pc)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Tc)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Ac)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Cc)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Pc)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Ff||i===Uf||i===kf||i===Bf)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Ff)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Uf)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===kf)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Bf)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===zf||i===Vf||i===Hf||i===Gf||i===Wf||i===qf||i===Xf)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===zf||i===Vf)return o===Dt?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===Hf)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(i===Gf)return s.COMPRESSED_R11_EAC;if(i===Wf)return s.COMPRESSED_SIGNED_R11_EAC;if(i===qf)return s.COMPRESSED_RG11_EAC;if(i===Xf)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===$f||i===Yf||i===Jf||i===Kf||i===Zf||i===jf||i===Qf||i===eh||i===th||i===nh||i===ih||i===rh||i===sh||i===oh)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===$f)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===Yf)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===Jf)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===Kf)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===Zf)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===jf)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===Qf)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===eh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===th)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===nh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===ih)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===rh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===sh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===oh)return o===Dt?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===ah||i===lh||i===ch)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===ah)return o===Dt?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===lh)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===ch)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===uh||i===dh||i===fh||i===hh)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===uh)return s.COMPRESSED_RED_RGTC1_EXT;if(i===dh)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===fh)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===hh)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Qa?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}const JI=` void main() { gl_Position = vec4( position, 1.0 ); -}`,ZI=` +}`,KI=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -4010,7 +4010,7 @@ void main() { } -}`;class jI{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new Hy(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new Pi({vertexShader:KI,fragmentShader:ZI,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new be(new hl(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class QI extends to{constructor(e,n){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,f=null,h=null,g=null;const v=typeof XRWebGLBinding<"u",m=new jI,p={},_=n.getContextAttributes();let x=null,y=null;const w=[],A=[],P=new xe;let D=null;const S=new Wn;S.viewport=new Zt;const M=new Wn;M.viewport=new Zt;const N=[S,M],B=new rR;let q=null,K=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ce){let ue=w[ce];return ue===void 0&&(ue=new Md,w[ce]=ue),ue.getTargetRaySpace()},this.getControllerGrip=function(ce){let ue=w[ce];return ue===void 0&&(ue=new Md,w[ce]=ue),ue.getGripSpace()},this.getHand=function(ce){let ue=w[ce];return ue===void 0&&(ue=new Md,w[ce]=ue),ue.getHandSpace()};function $(ce){const ue=A.indexOf(ce.inputSource);if(ue===-1)return;const Ie=w[ue];Ie!==void 0&&(Ie.update(ce.inputSource,ce.frame,c||o),Ie.dispatchEvent({type:ce.type,data:ce.inputSource}))}function W(){r.removeEventListener("select",$),r.removeEventListener("selectstart",$),r.removeEventListener("selectend",$),r.removeEventListener("squeeze",$),r.removeEventListener("squeezestart",$),r.removeEventListener("squeezeend",$),r.removeEventListener("end",W),r.removeEventListener("inputsourceschange",k);for(let ce=0;ce=0&&(A[Ye]=null,w[Ye].disconnect(Ie))}for(let ue=0;ue=A.length){A.push(Ie),Ye=mt;break}else if(A[mt]===null){A[mt]=Ie,Ye=mt;break}if(Ye===-1)break}const Ae=w[Ye];Ae&&Ae.connect(Ie)}}const z=new I,de=new I;function le(ce,ue,Ie){z.setFromMatrixPosition(ue.matrixWorld),de.setFromMatrixPosition(Ie.matrixWorld);const Ye=z.distanceTo(de),Ae=ue.projectionMatrix.elements,mt=Ie.projectionMatrix.elements,L=Ae[14]/(Ae[10]-1),U=Ae[14]/(Ae[10]+1),F=(Ae[9]+1)/Ae[5],G=(Ae[9]-1)/Ae[5],V=(Ae[8]-1)/Ae[0],Y=(mt[8]+1)/mt[0],C=L*V,ae=L*Y,Q=Ye/(-V+Y),ee=Q*-V;if(ue.matrixWorld.decompose(ce.position,ce.quaternion,ce.scale),ce.translateX(ee),ce.translateZ(Q),ce.matrixWorld.compose(ce.position,ce.quaternion,ce.scale),ce.matrixWorldInverse.copy(ce.matrixWorld).invert(),Ae[10]===-1)ce.projectionMatrix.copy(ue.projectionMatrix),ce.projectionMatrixInverse.copy(ue.projectionMatrixInverse);else{const oe=L+Q,E=U+Q,b=C-ee,O=ae+(Ye-ee),J=F*U/E*oe,se=G*U/E*oe;ce.projectionMatrix.makePerspective(b,O,J,se,oe,E),ce.projectionMatrixInverse.copy(ce.projectionMatrix).invert()}}function pe(ce,ue){ue===null?ce.matrixWorld.copy(ce.matrix):ce.matrixWorld.multiplyMatrices(ue.matrixWorld,ce.matrix),ce.matrixWorldInverse.copy(ce.matrixWorld).invert()}this.updateCamera=function(ce){if(r===null)return;let ue=ce.near,Ie=ce.far;m.texture!==null&&(m.depthNear>0&&(ue=m.depthNear),m.depthFar>0&&(Ie=m.depthFar)),B.near=M.near=S.near=ue,B.far=M.far=S.far=Ie,(q!==B.near||K!==B.far)&&(r.updateRenderState({depthNear:B.near,depthFar:B.far}),q=B.near,K=B.far),B.layers.mask=ce.layers.mask|6,S.layers.mask=B.layers.mask&3,M.layers.mask=B.layers.mask&5;const Ye=ce.parent,Ae=B.cameras;pe(B,Ye);for(let mt=0;mt0&&(m.alphaTest.value=p.alphaTest);const _=e.get(p),x=_.envMap,y=_.envMapRotation;x&&(m.envMap.value=x,Ds.copy(y),Ds.x*=-1,Ds.y*=-1,Ds.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(Ds.y*=-1,Ds.z*=-1),m.envMapRotation.value.setFromMatrix4(eN.makeRotationFromEuler(Ds)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap&&(m.lightMap.value=p.lightMap,m.lightMapIntensity.value=p.lightMapIntensity,n(p.lightMap,m.lightMapTransform)),p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,n(p.aoMap,m.aoMapTransform))}function o(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform))}function a(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function l(m,p,_,x){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*_,m.scale.value=x*.5,p.map&&(m.map.value=p.map,n(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function c(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function u(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function d(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function f(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function h(m,p,_){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,n(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,n(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,n(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,n(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,n(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===In&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,n(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,n(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,n(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,n(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,n(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,n(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,n(p.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,p){p.matcap&&(m.matcap.value=p.matcap)}function v(m,p){const _=e.get(p).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function nN(t,e,n,i){let r={},s={},o=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(_,x){const y=x.program;i.uniformBlockBinding(_,y)}function c(_,x){let y=r[_.id];y===void 0&&(g(_),y=u(_),r[_.id]=y,_.addEventListener("dispose",m));const w=x.program;i.updateUBOMapping(_,w);const A=e.render.frame;s[_.id]!==A&&(f(_),s[_.id]=A)}function u(_){const x=d();_.__bindingPointIndex=x;const y=t.createBuffer(),w=_.__size,A=_.usage;return t.bindBuffer(t.UNIFORM_BUFFER,y),t.bufferData(t.UNIFORM_BUFFER,w,A),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,x,y),y}function d(){for(let _=0;_0&&(y+=w-A),_.__size=y,_.__cache={},this}function v(_){const x={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(x.boundary=4,x.storage=4):_.isVector2?(x.boundary=8,x.storage=8):_.isVector3||_.isColor?(x.boundary=16,x.storage=12):_.isVector4?(x.boundary=16,x.storage=16):_.isMatrix3?(x.boundary=48,x.storage=48):_.isMatrix4?(x.boundary=64,x.storage=64):_.isTexture?tt("WebGLRenderer: Texture samplers can not be part of an uniforms group."):tt("WebGLRenderer: Unsupported uniform value type.",_),x}function m(_){const x=_.target;x.removeEventListener("dispose",m);const y=o.indexOf(x.__bindingPointIndex);o.splice(y,1),t.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function p(){for(const _ in r)t.deleteBuffer(r[_]);o=[],r={},s={}}return{bind:l,update:c,dispose:p}}const iN=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Fi=null;function rN(){return Fi===null&&(Fi=new sP(iN,16,16,Yo,Nr),Fi.name="DFG_LUT",Fi.minFilter=Pn,Fi.magFilter=Pn,Fi.wrapS=xr,Fi.wrapT=xr,Fi.generateMipmaps=!1,Fi.needsUpdate=!0),Fi}class sN{constructor(e={}){const{canvas:n=_C(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reversedDepthBuffer:f=!1,outputBufferType:h=Qn}=e;this.isWebGLRenderer=!0;let g;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=i.getContextAttributes().alpha}else g=o;const v=h,m=new Set([sp,rp,ip]),p=new Set([Qn,ji,$a,Ya,tp,np]),_=new Uint32Array(4),x=new Int32Array(4);let y=null,w=null;const A=[],P=[];let D=null;this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Yi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let M=!1;this._outputColorSpace=Zn;let N=0,B=0,q=null,K=-1,$=null;const W=new Zt,k=new Zt;let z=null;const de=new rt(0);let le=0,pe=n.width,He=n.height,Be=1,st=null,xt=null;const ce=new Zt(0,0,pe,He),ue=new Zt(0,0,pe,He);let Ie=!1;const Ye=new dp;let Ae=!1,mt=!1;const L=new yt,U=new I,F=new Zt,G={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let V=!1;function Y(){return q===null?Be:1}let C=i;function ae(R,X){return n.getContext(R,X)}try{const R={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${jh}`),n.addEventListener("webglcontextlost",lt,!1),n.addEventListener("webglcontextrestored",Bt,!1),n.addEventListener("webglcontextcreationerror",At,!1),C===null){const X="webgl2";if(C=ae(X,R),C===null)throw ae(X)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(R){throw bt("WebGLRenderer: "+R.message),R}let Q,ee,oe,E,b,O,J,se,Z,Ce,ve,Ne,$e,me,we,Pe,Ue,Me,ut,H,Oe,ye,ze,_e;function he(){Q=new rD(C),Q.init(),ye=new JI(C,Q),ee=new J3(C,Q,e,ye),oe=new $I(C,Q),ee.reversedDepthBuffer&&f&&oe.buffers.depth.setReversed(!0),E=new aD(C),b=new II,O=new YI(C,Q,oe,b,ee,ye,E),J=new Z3(S),se=new iD(S),Z=new dR(C),ze=new $3(C,Z),Ce=new sD(C,Z,E,ze),ve=new cD(C,Ce,Z,E),ut=new lD(C,ee,O),Pe=new K3(b),Ne=new DI(S,J,se,Q,ee,ze,Pe),$e=new tN(S,b),me=new LI,we=new zI(Q),Me=new X3(S,J,se,oe,ve,g,l),Ue=new qI(S,ve,ee),_e=new nN(C,E,ee,oe),H=new Y3(C,Q,E),Oe=new oD(C,Q,E),E.programs=Ne.programs,S.capabilities=ee,S.extensions=Q,S.properties=b,S.renderLists=me,S.shadowMap=Ue,S.state=oe,S.info=E}he(),v!==Qn&&(D=new dD(v,n.width,n.height,r,s));const Ee=new QI(S,C);this.xr=Ee,this.getContext=function(){return C},this.getContextAttributes=function(){return C.getContextAttributes()},this.forceContextLoss=function(){const R=Q.get("WEBGL_lose_context");R&&R.loseContext()},this.forceContextRestore=function(){const R=Q.get("WEBGL_lose_context");R&&R.restoreContext()},this.getPixelRatio=function(){return Be},this.setPixelRatio=function(R){R!==void 0&&(Be=R,this.setSize(pe,He,!1))},this.getSize=function(R){return R.set(pe,He)},this.setSize=function(R,X,ie=!0){if(Ee.isPresenting){tt("WebGLRenderer: Can't change size while VR device is presenting.");return}pe=R,He=X,n.width=Math.floor(R*Be),n.height=Math.floor(X*Be),ie===!0&&(n.style.width=R+"px",n.style.height=X+"px"),D!==null&&D.setSize(n.width,n.height),this.setViewport(0,0,R,X)},this.getDrawingBufferSize=function(R){return R.set(pe*Be,He*Be).floor()},this.setDrawingBufferSize=function(R,X,ie){pe=R,He=X,Be=ie,n.width=Math.floor(R*ie),n.height=Math.floor(X*ie),this.setViewport(0,0,R,X)},this.setEffects=function(R){if(v===Qn){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(R){for(let X=0;X{function Re(){if(te.forEach(function(Ge){b.get(Ge).currentProgram.isReady()&&te.delete(Ge)}),te.size===0){j(R);return}setTimeout(Re,10)}Q.get("KHR_parallel_shader_compile")!==null?Re():setTimeout(Re,10)})};let Iu=null;function wb(R){Iu&&Iu(R)}function nm(){xs.stop()}function im(){xs.start()}const xs=new nb;xs.setAnimationLoop(wb),typeof self<"u"&&xs.setContext(self),this.setAnimationLoop=function(R){Iu=R,Ee.setAnimationLoop(R),R===null?xs.stop():xs.start()},Ee.addEventListener("sessionstart",nm),Ee.addEventListener("sessionend",im),this.render=function(R,X){if(X!==void 0&&X.isCamera!==!0){bt("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(M===!0)return;const ie=Ee.enabled===!0&&Ee.isPresenting===!0,te=D!==null&&(q===null||ie)&&D.begin(S,q);if(R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),X.parent===null&&X.matrixWorldAutoUpdate===!0&&X.updateMatrixWorld(),Ee.enabled===!0&&Ee.isPresenting===!0&&(D===null||D.isCompositing()===!1)&&(Ee.cameraAutoUpdate===!0&&Ee.updateCamera(X),X=Ee.getCamera()),R.isScene===!0&&R.onBeforeRender(S,R,X,q),w=we.get(R,P.length),w.init(X),P.push(w),L.multiplyMatrices(X.projectionMatrix,X.matrixWorldInverse),Ye.setFromProjectionMatrix(L,qi,X.reversedDepth),mt=this.localClippingEnabled,Ae=Pe.init(this.clippingPlanes,mt),y=me.get(R,A.length),y.init(),A.push(y),Ee.enabled===!0&&Ee.isPresenting===!0){const Ge=S.xr.getDepthSensingMesh();Ge!==null&&Nu(Ge,X,-1/0,S.sortObjects)}Nu(R,X,0,S.sortObjects),y.finish(),S.sortObjects===!0&&y.sort(st,xt),V=Ee.enabled===!1||Ee.isPresenting===!1||Ee.hasDepthSensing()===!1,V&&Me.addToRenderList(y,R),this.info.render.frame++,Ae===!0&&Pe.beginShadows();const j=w.state.shadowsArray;if(Ue.render(j,R,X),Ae===!0&&Pe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(te&&D.hasRenderPass())===!1){const Ge=y.opaque,Le=y.transmissive;if(w.setupLights(),X.isArrayCamera){const Xe=X.cameras;if(Le.length>0)for(let Ke=0,it=Xe.length;Ke0&&sm(Ge,Le,R,X),V&&Me.render(R),rm(y,R,X)}q!==null&&B===0&&(O.updateMultisampleRenderTarget(q),O.updateRenderTargetMipmap(q)),te&&D.end(S),R.isScene===!0&&R.onAfterRender(S,R,X),ze.resetDefaultState(),K=-1,$=null,P.pop(),P.length>0?(w=P[P.length-1],Ae===!0&&Pe.setGlobalState(S.clippingPlanes,w.state.camera)):w=null,A.pop(),A.length>0?y=A[A.length-1]:y=null};function Nu(R,X,ie,te){if(R.visible===!1)return;if(R.layers.test(X.layers)){if(R.isGroup)ie=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(X);else if(R.isLight)w.pushLight(R),R.castShadow&&w.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||Ye.intersectsSprite(R)){te&&F.setFromMatrixPosition(R.matrixWorld).applyMatrix4(L);const Ge=ve.update(R),Le=R.material;Le.visible&&y.push(R,Ge,Le,ie,F.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||Ye.intersectsObject(R))){const Ge=ve.update(R),Le=R.material;if(te&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),F.copy(R.boundingSphere.center)):(Ge.boundingSphere===null&&Ge.computeBoundingSphere(),F.copy(Ge.boundingSphere.center)),F.applyMatrix4(R.matrixWorld).applyMatrix4(L)),Array.isArray(Le)){const Xe=Ge.groups;for(let Ke=0,it=Xe.length;Ke0&&gl(j,X,ie),Re.length>0&&gl(Re,X,ie),Ge.length>0&&gl(Ge,X,ie),oe.buffers.depth.setTest(!0),oe.buffers.depth.setMask(!0),oe.buffers.color.setMask(!0),oe.setPolygonOffset(!1)}function sm(R,X,ie,te){if((ie.isScene===!0?ie.overrideMaterial:null)!==null)return;if(w.state.transmissionRenderTarget[te.id]===void 0){const vt=Q.has("EXT_color_buffer_half_float")||Q.has("EXT_color_buffer_float");w.state.transmissionRenderTarget[te.id]=new Ji(1,1,{generateMipmaps:!0,type:vt?Nr:Qn,minFilter:Bs,samples:ee.samples,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:St.workingColorSpace})}const Re=w.state.transmissionRenderTarget[te.id],Ge=te.viewport||W;Re.setSize(Ge.z*S.transmissionResolutionScale,Ge.w*S.transmissionResolutionScale);const Le=S.getRenderTarget(),Xe=S.getActiveCubeFace(),Ke=S.getActiveMipmapLevel();S.setRenderTarget(Re),S.getClearColor(de),le=S.getClearAlpha(),le<1&&S.setClearColor(16777215,.5),S.clear(),V&&Me.render(ie);const it=S.toneMapping;S.toneMapping=Yi;const je=te.viewport;if(te.viewport!==void 0&&(te.viewport=void 0),w.setupLightsView(te),Ae===!0&&Pe.setGlobalState(S.clippingPlanes,te),gl(R,ie,te),O.updateMultisampleRenderTarget(Re),O.updateRenderTargetMipmap(Re),Q.has("WEBGL_multisampled_render_to_texture")===!1){let vt=!1;for(let It=0,Yt=X.length;It0),je=!!ie.morphAttributes.position,vt=!!ie.morphAttributes.normal,It=!!ie.morphAttributes.color;let Yt=Yi;te.toneMapped&&(q===null||q.isXRRenderTarget===!0)&&(Yt=S.toneMapping);const Jt=ie.morphAttributes.position||ie.morphAttributes.normal||ie.morphAttributes.color,Ot=Jt!==void 0?Jt.length:0,Qe=b.get(te),Ct=w.state.lights;if(Ae===!0&&(mt===!0||R!==$)){const Ln=R===$&&te.id===K;Pe.setState(te,R,Ln)}let Mt=!1;te.version===Qe.__version?(Qe.needsLights&&Qe.lightsStateVersion!==Ct.state.version||Qe.outputColorSpace!==Le||j.isBatchedMesh&&Qe.batching===!1||!j.isBatchedMesh&&Qe.batching===!0||j.isBatchedMesh&&Qe.batchingColor===!0&&j.colorTexture===null||j.isBatchedMesh&&Qe.batchingColor===!1&&j.colorTexture!==null||j.isInstancedMesh&&Qe.instancing===!1||!j.isInstancedMesh&&Qe.instancing===!0||j.isSkinnedMesh&&Qe.skinning===!1||!j.isSkinnedMesh&&Qe.skinning===!0||j.isInstancedMesh&&Qe.instancingColor===!0&&j.instanceColor===null||j.isInstancedMesh&&Qe.instancingColor===!1&&j.instanceColor!==null||j.isInstancedMesh&&Qe.instancingMorph===!0&&j.morphTexture===null||j.isInstancedMesh&&Qe.instancingMorph===!1&&j.morphTexture!==null||Qe.envMap!==Xe||te.fog===!0&&Qe.fog!==Re||Qe.numClippingPlanes!==void 0&&(Qe.numClippingPlanes!==Pe.numPlanes||Qe.numIntersection!==Pe.numIntersection)||Qe.vertexAlphas!==Ke||Qe.vertexTangents!==it||Qe.morphTargets!==je||Qe.morphNormals!==vt||Qe.morphColors!==It||Qe.toneMapping!==Yt||Qe.morphTargetsCount!==Ot)&&(Mt=!0):(Mt=!0,Qe.__version=te.version);let $n=Qe.currentProgram;Mt===!0&&($n=vl(te,X,j));let ro=!1,Yn=!1,aa=!1;const zt=$n.getUniforms(),Vn=Qe.uniforms;if(oe.useProgram($n.program)&&(ro=!0,Yn=!0,aa=!0),te.id!==K&&(K=te.id,Yn=!0),ro||$!==R){oe.buffers.depth.getReversed()&&R.reversedDepth!==!0&&(R._reversedDepth=!0,R.updateProjectionMatrix()),zt.setValue(C,"projectionMatrix",R.projectionMatrix),zt.setValue(C,"viewMatrix",R.matrixWorldInverse);const Hn=zt.map.cameraPosition;Hn!==void 0&&Hn.setValue(C,U.setFromMatrixPosition(R.matrixWorld)),ee.logarithmicDepthBuffer&&zt.setValue(C,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(te.isMeshPhongMaterial||te.isMeshToonMaterial||te.isMeshLambertMaterial||te.isMeshBasicMaterial||te.isMeshStandardMaterial||te.isShaderMaterial)&&zt.setValue(C,"isOrthographic",R.isOrthographicCamera===!0),$!==R&&($=R,Yn=!0,aa=!0)}if(Qe.needsLights&&(Ct.state.directionalShadowMap.length>0&&zt.setValue(C,"directionalShadowMap",Ct.state.directionalShadowMap,O),Ct.state.spotShadowMap.length>0&&zt.setValue(C,"spotShadowMap",Ct.state.spotShadowMap,O),Ct.state.pointShadowMap.length>0&&zt.setValue(C,"pointShadowMap",Ct.state.pointShadowMap,O)),j.isSkinnedMesh){zt.setOptional(C,j,"bindMatrix"),zt.setOptional(C,j,"bindMatrixInverse");const Ln=j.skeleton;Ln&&(Ln.boneTexture===null&&Ln.computeBoneTexture(),zt.setValue(C,"boneTexture",Ln.boneTexture,O))}j.isBatchedMesh&&(zt.setOptional(C,j,"batchingTexture"),zt.setValue(C,"batchingTexture",j._matricesTexture,O),zt.setOptional(C,j,"batchingIdTexture"),zt.setValue(C,"batchingIdTexture",j._indirectTexture,O),zt.setOptional(C,j,"batchingColorTexture"),j._colorsTexture!==null&&zt.setValue(C,"batchingColorTexture",j._colorsTexture,O));const si=ie.morphAttributes;if((si.position!==void 0||si.normal!==void 0||si.color!==void 0)&&ut.update(j,ie,$n),(Yn||Qe.receiveShadow!==j.receiveShadow)&&(Qe.receiveShadow=j.receiveShadow,zt.setValue(C,"receiveShadow",j.receiveShadow)),te.isMeshGouraudMaterial&&te.envMap!==null&&(Vn.envMap.value=Xe,Vn.flipEnvMap.value=Xe.isCubeTexture&&Xe.isRenderTargetTexture===!1?-1:1),te.isMeshStandardMaterial&&te.envMap===null&&X.environment!==null&&(Vn.envMapIntensity.value=X.environmentIntensity),Vn.dfgLUT!==void 0&&(Vn.dfgLUT.value=rN()),Yn&&(zt.setValue(C,"toneMappingExposure",S.toneMappingExposure),Qe.needsLights&&Tb(Vn,aa),Re&&te.fog===!0&&$e.refreshFogUniforms(Vn,Re),$e.refreshMaterialUniforms(Vn,te,Be,He,w.state.transmissionRenderTarget[R.id]),Ec.upload(C,am(Qe),Vn,O)),te.isShaderMaterial&&te.uniformsNeedUpdate===!0&&(Ec.upload(C,am(Qe),Vn,O),te.uniformsNeedUpdate=!1),te.isSpriteMaterial&&zt.setValue(C,"center",j.center),zt.setValue(C,"modelViewMatrix",j.modelViewMatrix),zt.setValue(C,"normalMatrix",j.normalMatrix),zt.setValue(C,"modelMatrix",j.matrixWorld),te.isShaderMaterial||te.isRawShaderMaterial){const Ln=te.uniformsGroups;for(let Hn=0,Lu=Ln.length;Hn0&&O.useMultisampledRTT(R)===!1?te=b.get(R).__webglMultisampledFramebuffer:Array.isArray(Ke)?te=Ke[ie]:te=Ke,W.copy(R.viewport),k.copy(R.scissor),z=R.scissorTest}else W.copy(ce).multiplyScalar(Be).floor(),k.copy(ue).multiplyScalar(Be).floor(),z=Ie;if(ie!==0&&(te=Cb),oe.bindFramebuffer(C.FRAMEBUFFER,te)&&oe.drawBuffers(R,te),oe.viewport(W),oe.scissor(k),oe.setScissorTest(z),j){const Le=b.get(R.texture);C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_CUBE_MAP_POSITIVE_X+X,Le.__webglTexture,ie)}else if(Re){const Le=X;for(let Xe=0;Xe=0&&X<=R.width-te&&ie>=0&&ie<=R.height-j&&(R.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Le),C.readPixels(X,ie,te,j,ye.convert(it),ye.convert(je),Re))}finally{const Ke=q!==null?b.get(q).__webglFramebuffer:null;oe.bindFramebuffer(C.FRAMEBUFFER,Ke)}}},this.readRenderTargetPixelsAsync=async function(R,X,ie,te,j,Re,Ge,Le=0){if(!(R&&R.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Xe=b.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Ge!==void 0&&(Xe=Xe[Ge]),Xe)if(X>=0&&X<=R.width-te&&ie>=0&&ie<=R.height-j){oe.bindFramebuffer(C.FRAMEBUFFER,Xe);const Ke=R.textures[Le],it=Ke.format,je=Ke.type;if(!ee.textureFormatReadable(it))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!ee.textureTypeReadable(je))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const vt=C.createBuffer();C.bindBuffer(C.PIXEL_PACK_BUFFER,vt),C.bufferData(C.PIXEL_PACK_BUFFER,Re.byteLength,C.STREAM_READ),R.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Le),C.readPixels(X,ie,te,j,ye.convert(it),ye.convert(je),0);const It=q!==null?b.get(q).__webglFramebuffer:null;oe.bindFramebuffer(C.FRAMEBUFFER,It);const Yt=C.fenceSync(C.SYNC_GPU_COMMANDS_COMPLETE,0);return C.flush(),await xC(C,Yt,4),C.bindBuffer(C.PIXEL_PACK_BUFFER,vt),C.getBufferSubData(C.PIXEL_PACK_BUFFER,0,Re),C.deleteBuffer(vt),C.deleteSync(Yt),Re}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(R,X=null,ie=0){const te=Math.pow(2,-ie),j=Math.floor(R.image.width*te),Re=Math.floor(R.image.height*te),Ge=X!==null?X.x:0,Le=X!==null?X.y:0;O.setTexture2D(R,0),C.copyTexSubImage2D(C.TEXTURE_2D,ie,0,0,Ge,Le,j,Re),oe.unbindTexture()};const Pb=C.createFramebuffer(),Rb=C.createFramebuffer();this.copyTextureToTexture=function(R,X,ie=null,te=null,j=0,Re=null){Re===null&&(j!==0?(Ja("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Re=j,j=0):Re=0);let Ge,Le,Xe,Ke,it,je,vt,It,Yt;const Jt=R.isCompressedTexture?R.mipmaps[Re]:R.image;if(ie!==null)Ge=ie.max.x-ie.min.x,Le=ie.max.y-ie.min.y,Xe=ie.isBox3?ie.max.z-ie.min.z:1,Ke=ie.min.x,it=ie.min.y,je=ie.isBox3?ie.min.z:0;else{const si=Math.pow(2,-j);Ge=Math.floor(Jt.width*si),Le=Math.floor(Jt.height*si),R.isDataArrayTexture?Xe=Jt.depth:R.isData3DTexture?Xe=Math.floor(Jt.depth*si):Xe=1,Ke=0,it=0,je=0}te!==null?(vt=te.x,It=te.y,Yt=te.z):(vt=0,It=0,Yt=0);const Ot=ye.convert(X.format),Qe=ye.convert(X.type);let Ct;X.isData3DTexture?(O.setTexture3D(X,0),Ct=C.TEXTURE_3D):X.isDataArrayTexture||X.isCompressedArrayTexture?(O.setTexture2DArray(X,0),Ct=C.TEXTURE_2D_ARRAY):(O.setTexture2D(X,0),Ct=C.TEXTURE_2D),C.pixelStorei(C.UNPACK_FLIP_Y_WEBGL,X.flipY),C.pixelStorei(C.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),C.pixelStorei(C.UNPACK_ALIGNMENT,X.unpackAlignment);const Mt=C.getParameter(C.UNPACK_ROW_LENGTH),$n=C.getParameter(C.UNPACK_IMAGE_HEIGHT),ro=C.getParameter(C.UNPACK_SKIP_PIXELS),Yn=C.getParameter(C.UNPACK_SKIP_ROWS),aa=C.getParameter(C.UNPACK_SKIP_IMAGES);C.pixelStorei(C.UNPACK_ROW_LENGTH,Jt.width),C.pixelStorei(C.UNPACK_IMAGE_HEIGHT,Jt.height),C.pixelStorei(C.UNPACK_SKIP_PIXELS,Ke),C.pixelStorei(C.UNPACK_SKIP_ROWS,it),C.pixelStorei(C.UNPACK_SKIP_IMAGES,je);const zt=R.isDataArrayTexture||R.isData3DTexture,Vn=X.isDataArrayTexture||X.isData3DTexture;if(R.isDepthTexture){const si=b.get(R),Ln=b.get(X),Hn=b.get(si.__renderTarget),Lu=b.get(Ln.__renderTarget);oe.bindFramebuffer(C.READ_FRAMEBUFFER,Hn.__webglFramebuffer),oe.bindFramebuffer(C.DRAW_FRAMEBUFFER,Lu.__webglFramebuffer);for(let ys=0;ysMath.PI&&(i-=Gn),r<-Math.PI?r+=Gn:r>Math.PI&&(r-=Gn),i<=r?this._spherical.theta=Math.max(i,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+r)/2?Math.max(i,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=o!=this._spherical.radius}if(an.setFromSpherical(this._spherical),an.applyQuaternion(this._quatInverse),n.copy(this.target).add(an),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=an.length();o=this._clampDistance(a*this._scale);const l=a-o;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),s=!!l}else if(this.object.isOrthographicCamera){const a=new I(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=l!==this.object.zoom;const c=new I(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=an.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(lc.origin.copy(this.object.position),lc.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(lc.direction))kd||8*(1-this._lastQuaternion.dot(this.object.quaternion))>kd||this._lastTargetPosition.distanceToSquared(this.target)>kd?(this.dispatchEvent(z0),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?Gn/60*this.autoRotateSpeed*e:Gn/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){an.setFromMatrixColumn(n,0),an.multiplyScalar(-e),this._panOffset.add(an)}_panUp(e,n){this.screenSpacePanning===!0?an.setFromMatrixColumn(n,1):(an.setFromMatrixColumn(n,0),an.crossVectors(this.object.up,an)),an.multiplyScalar(e),this._panOffset.add(an)}_pan(e,n){const i=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;an.copy(r).sub(this.target);let s=an.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/i.clientHeight,this.object.matrix),this._panUp(2*n*s/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),r=e-i.left,s=n-i.top,o=i.width,a=i.height;this._mouse.x=r/o*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(Gn*this._rotateDelta.x/n.clientHeight),this._rotateUp(Gn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Gn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Gn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Gn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Gn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._rotateStart.set(i,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._panStart.set(i,r)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const i=this._getSecondPointerPosition(e),r=.5*(e.pageX+i.x),s=.5*(e.pageY+i.y);this._rotateEnd.set(r,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(Gn*this._rotateDelta.x/n.clientHeight),this._rotateUp(Gn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._panEnd.set(i,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+n.x)*.5,a=(e.pageY+n.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n.9&&(o.visible=!1)),this.axis==="Y"&&(qt.setFromEuler(cc.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(qt),Math.abs(Ft.copy(Os).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(qt.setFromEuler(cc.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(qt),Math.abs(Ft.copy(Ta).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(qt.setFromEuler(cc.set(0,Math.PI/2,0)),Ft.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix($0.lookAt(X0,Ft,Os)),o.quaternion.multiply(qt),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),En.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),En.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(En),o.visible=this.dragging):(o.quaternion.copy(i),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(Ft.copy(Ea).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(Ft.copy(Os).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(Ft.copy(Ta).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(Ft.copy(Ta).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(Ft.copy(Ea).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(Ft.copy(Os).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(uc.copy(i),Ft.copy(this.eye).applyQuaternion(qt.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix($0.lookAt(this.eye,X0,Os)),o.name==="X"&&(qt.setFromAxisAngle(Ea,Math.atan2(-Ft.y,Ft.z)),qt.multiplyQuaternions(uc,qt),o.quaternion.copy(qt)),o.name==="Y"&&(qt.setFromAxisAngle(Os,Math.atan2(Ft.x,Ft.z)),qt.multiplyQuaternions(uc,qt),o.quaternion.copy(qt)),o.name==="Z"&&(qt.setFromAxisAngle(Ta,Math.atan2(Ft.y,Ft.x)),qt.multiplyQuaternions(uc,qt),o.quaternion.copy(qt))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis?(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1):this.axis.split("").some(function(l){return o.name===l})&&(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1))}super.updateMatrixWorld(e)}}class CN extends be{constructor(){super(new hl(1e5,1e5,2,2),new vs({visible:!1,wireframe:!0,side:Bn,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),dc.copy(Ea).applyQuaternion(n==="local"?this.worldQuaternion:Tc),xa.copy(Os).applyQuaternion(n==="local"?this.worldQuaternion:Tc),ya.copy(Ta).applyQuaternion(n==="local"?this.worldQuaternion:Tc),Ft.copy(xa),this.mode){case"translate":case"scale":switch(this.axis){case"X":Ft.copy(this.eye).cross(dc),Ui.copy(dc).cross(Ft);break;case"Y":Ft.copy(this.eye).cross(xa),Ui.copy(xa).cross(Ft);break;case"Z":Ft.copy(this.eye).cross(ya),Ui.copy(ya).cross(Ft);break;case"XY":Ui.copy(ya);break;case"YZ":Ui.copy(dc);break;case"XZ":Ft.copy(ya),Ui.copy(xa);break;case"XYZ":case"E":Ui.set(0,0,0);break}break;default:Ui.set(0,0,0)}Ui.length()===0?this.quaternion.copy(this.cameraQuaternion):(Y0.lookAt(En.set(0,0,0),Ui,Ft),this.quaternion.setFromRotationMatrix(Y0)),super.updateMatrixWorld(e)}}const Or={},Qo={};function PN(t){let e;switch(t.type.value){case"standard_material":e=RN(t);break;case"line_material":e=DN(t);break;case"point_material":e=IN(t);break;case"physical_material":e=NN(t);break}Qo[t.guid.value]=e,Or[t.geometry_guid.value]=t.guid.value,UN(t.geometry_guid.value,e)}function RN(t){let e=t.color.value;e=e.replace("#","0x");let n=t.emissive.value;return n=n.replace("#","0x"),new sa({color:parseInt(e),metalness:t.metalness.value,roughness:t.roughness.value,emissive:parseInt(n),emissiveIntensity:t.emissive_intensity.value,flatShading:t.flat_shading.value,wireframe:t.wireframe.value,side:Bn})}function DN(t){let e=t.color.value;return e=e.replace("#","0x"),new vi({color:parseInt(e)})}function IN(t){let e=t.color.value;return e=e.replace("#","0x"),new hp({color:parseInt(e),size:t.size.value})}function NN(t){let e=t.color.value;e=e.replace("#","0x");let n=t.emissive.value;n=n.replace("#","0x");let i=t.attenuation_color.value;i=i.replace("#","0x");let r=t.sheen_color.value;r=r.replace("#","0x");let s=t.specular_color.value;return s=s.replace("#","0x"),new qP({color:parseInt(e),metalness:t.metalness.value,roughness:t.roughness.value,emissive:parseInt(n),emissiveIntensity:t.emissive_intensity.value,flatShading:t.flat_shading.value,wireframe:t.wireframe.value,side:Bn,anisotropy:t.anisotropy.value,anisotropyRotation:t.anisotropy_rotation.value,attenuationColor:parseInt(i),attenuationDistance:t.attenuation_distance.value,clearcoat:t.clearcoat.value,clearcoatRoughness:t.clearcoat_roughness.value,dispersion:t.dispersion.value,ior:t.ior.value,iridescence:t.iridescence.value,iridescenceIOR:t.iridescence_ior.value,iridescenceThicknessRange:[t.iridescence_thickness_start.value,t.iridescence_thickness_end.value],reflectivity:t.reflectivity.value,sheen:t.sheen.value,sheenColor:parseInt(r),specularColor:parseInt(s),sheenRoughness:t.sheen_roughness.value,specularIntensity:t.specular_intensity.value,thickness:t.thickness.value,transmission:t.transmission.value})}const ui={},LN=["Line","Point","Vector","Frame","Plane","Polyline"];function ON(t){console.log(t.name),LN.includes(t.name)&&FN(t);const e=t.guid,n=ui[e],i=t.buildGeometry();if(!i||!(i instanceof be))return;const r=i.geometry;if(r.computeBoundingSphere(),r.computeBoundingBox(),n instanceof be){const s=n.geometry;n.geometry=r,n.position.copy(i.position),n.quaternion.copy(i.quaternion),n.scale.copy(i.scale),s&&s.dispose()}else{if(Or[e]){const s=Or[e];Qo[s]&&(i.material=Qo[s])}else i.material=new sa({color:35071,roughness:.5,metalness:.5});if(Wt.add(i),ui[e]=i,ax.value){const s=new uP(i.geometry),o=new fp(s,new vi({color:0}));o.layers.set(1),i.add(o)}}}function FN(t){const e=t.buildGeometry(),n=t.guid;let i;if(Or[n]){const r=Or[n];Qo[r]&&(i=Qo[r])}else return;e instanceof hn||e instanceof pp?e.material=i:(e instanceof wp||e instanceof void 0)&&e.setColor(i.color),Wt.add(e),ui[n]=e}function UN(t,e){const n=ui[t];if(n){if(n){n.material=e;return}(n instanceof wp||n instanceof void 0)&&n.setColor(e.color)}}function kN(){let t=0,e=0;for(let i=0;i<28;i+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>4,(n&128)==0)return this.assertBounds(),[t,e];for(let i=3;i<=31;i+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>>s,a=!(!(o>>>7)&&e==0),l=(a?o|128:o)&255;if(n.push(l),!a)return}const i=t>>>28&15|(e&7)<<4,r=e>>3!=0;if(n.push((r?i|128:i)&255),!!r){for(let s=3;s<31;s=s+7){const o=e>>>s,a=!!(o>>>7),l=(a?o|128:o)&255;if(n.push(l),!a)return}n.push(e>>>31&1)}}const Ac=4294967296;function J0(t){const e=t[0]==="-";e&&(t=t.slice(1));const n=1e6;let i=0,r=0;function s(o,a){const l=Number(t.slice(o,a));r*=n,i=i*n+l,i>=Ac&&(r=r+(i/Ac|0),i=i%Ac)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?cb(i,r):Tp(i,r)}function BN(t,e){let n=Tp(t,e);const i=n.hi&2147483648;i&&(n=cb(n.lo,n.hi));const r=lb(n.lo,n.hi);return i?"-"+r:r}function lb(t,e){if({lo:t,hi:e}=zN(t,e),e<=2097151)return String(Ac*e+t);const n=t&16777215,i=(t>>>24|e<<8)&16777215,r=e>>16&65535;let s=n+i*6777216+r*6710656,o=i+r*8147497,a=r*2;const l=1e7;return s>=l&&(o+=Math.floor(s/l),s%=l),o>=l&&(a+=Math.floor(o/l),o%=l),a.toString()+K0(o)+K0(s)}function zN(t,e){return{lo:t>>>0,hi:e>>>0}}function Tp(t,e){return{lo:t|0,hi:e|0}}function cb(t,e){return e=~e,t?t=~t+1:e+=1,Tp(t,e)}const K0=t=>{const e=String(t);return"0000000".slice(e.length)+e};function Z0(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let n=0;n<9;n++)e.push(t&127|128),t=t>>7;e.push(1)}}function VN(){let t=this.buf[this.pos++],e=t&127;if((t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,(t&128)==0)return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,(t&128)==0)return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let n=5;(t&128)!==0&&n<10;n++)t=this.buf[this.pos++];if((t&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var j0={};const Hi=HN();function HN(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof j0!="object"||j0.BUF_BIGINT_DISABLE!=="1")){const n=BigInt("-9223372036854775808"),i=BigInt("9223372036854775807"),r=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(o){const a=typeof o=="bigint"?o:BigInt(o);if(a>i||as||a>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(tv(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return Gd(e),Z0(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.encodeUtf8(e);return this.uint32(n.byteLength),this.raw(n)}float(e){YN(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){tv(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){Gd(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return Gd(e),e=(e<<1^e>>31)>>>0,Z0(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=Hi.enc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=Hi.uEnc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}int64(e){let n=Hi.enc(e);return Vd(n.lo,n.hi,this.buf),this}sint64(e){const n=Hi.enc(e),i=n.hi>>31,r=n.lo<<1^i,s=(n.hi<<1|n.lo>>>31)^i;return Vd(r,s,this.buf),this}uint64(e){const n=Hi.uEnc(e);return Vd(n.lo,n.hi,this.buf),this}}class Se{constructor(e,n=ub().decodeUtf8){this.decodeUtf8=n,this.varint64=kN,this.uint32=VN,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),n=e>>>3,i=e&7;if(n<=0||i<0||i>5)throw new Error("illegal tag: field no "+n+" wire type "+i);return[n,i]}skip(e,n){let i=this.pos;switch(e){case Qr.Varint:for(;this.buf[this.pos++]&128;);break;case Qr.Bit64:this.pos+=4;case Qr.Bit32:this.pos+=4;break;case Qr.LengthDelimited:let r=this.uint32();this.pos+=r;break;case Qr.StartGroup:for(;;){const[s,o]=this.tag();if(o===Qr.EndGroup){if(n!==void 0&&s!==n)throw new Error("invalid end group tag");break}this.skip(o,s)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Hi.dec(...this.varint64())}uint64(){return Hi.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),i=-(e&1);return e=(e>>>1|(n&1)<<31)^i,n=n>>>1^i,Hi.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Hi.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Hi.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.decodeUtf8(this.bytes())}}function Gd(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>XN||t<$N)throw new Error("invalid int32: "+t)}function tv(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid uint32: "+typeof t);if(!Number.isInteger(t)||t>qN||t<0)throw new Error("invalid uint32: "+t)}function YN(t){if(typeof t=="string"){const e=t;if(t=Number(t),Number.isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>GN||t>>3){case 1:{if(s!==10)break;r.typeUrl=n.string();continue}case 2:{if(s!==18)break;r.value=n.bytes();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{typeUrl:Wd(t.typeUrl)?globalThis.String(t.typeUrl):Wd(t.type_url)?globalThis.String(t.type_url):"",value:Wd(t.value)?JN(t.value):new Uint8Array(0)}},toJSON(t){const e={};return t.typeUrl!==""&&(e.typeUrl=t.typeUrl),t.value.length!==0&&(e.value=KN(t.value)),e},create(t){return Ao.fromPartial(t??{})},fromPartial(t){const e=nv();return e.typeUrl=t.typeUrl??"",e.value=t.value??new Uint8Array(0),e}};function JN(t){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(t,"base64"));{const e=globalThis.atob(t),n=new Uint8Array(e.length);for(let i=0;i{e.push(globalThis.String.fromCharCode(n))}),globalThis.btoa(e.join(""))}}function Wd(t){return t!=null}function iv(t){switch(t){case 0:case"NULL_VALUE":return 0;default:return-1}}function ZN(t){return t===0?"NULL_VALUE":"UNRECOGNIZED"}function qd(){return{fields:{}}}const Aa={encode(t,e=new dt){return globalThis.Object.entries(t.fields).forEach(([n,i])=>{i!==void 0&&vh.encode({key:n,value:i},e.uint32(10).fork()).join()}),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=qd();for(;n.pos>>3){case 1:{if(s!==10)break;const o=vh.decode(n,n.uint32());o.value!==void 0&&(r.fields[o.key]=o.value);continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{fields:_h(t.fields)?globalThis.Object.entries(t.fields).reduce((e,[n,i])=>(e[n]=i,e),{}):{}}},toJSON(t){const e={};if(t.fields){const n=globalThis.Object.entries(t.fields);n.length>0&&(e.fields={},n.forEach(([i,r])=>{e.fields[i]=r}))}return e},create(t){return Aa.fromPartial(t??{})},fromPartial(t){const e=qd();return e.fields=globalThis.Object.entries(t.fields??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=r),n),{}),e},wrap(t){const e=qd();if(t!==void 0)for(const n of globalThis.Object.keys(t))e.fields[n]=t[n];return e},unwrap(t){const e={};if(t.fields)for(const n of globalThis.Object.keys(t.fields))e[n]=t.fields[n];return e}};function rv(){return{key:"",value:void 0}}const vh={encode(t,e=new dt){return t.key!==""&&e.uint32(10).string(t.key),t.value!==void 0&&ti.encode(ti.wrap(t.value),e.uint32(18).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=rv();for(;n.pos>>3){case 1:{if(s!==10)break;r.key=n.string();continue}case 2:{if(s!==18)break;r.value=ti.unwrap(ti.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{key:Bi(t.key)?globalThis.String(t.key):"",value:Bi(t?.value)?t.value:void 0}},toJSON(t){const e={};return t.key!==""&&(e.key=t.key),t.value!==void 0&&(e.value=t.value),e},create(t){return vh.fromPartial(t??{})},fromPartial(t){const e=rv();return e.key=t.key??"",e.value=t.value??void 0,e}};function Xd(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}const ti={encode(t,e=new dt){return t.nullValue!==void 0&&e.uint32(8).int32(t.nullValue),t.numberValue!==void 0&&e.uint32(17).double(t.numberValue),t.stringValue!==void 0&&e.uint32(26).string(t.stringValue),t.boolValue!==void 0&&e.uint32(32).bool(t.boolValue),t.structValue!==void 0&&Aa.encode(Aa.wrap(t.structValue),e.uint32(42).fork()).join(),t.listValue!==void 0&&Ca.encode(Ca.wrap(t.listValue),e.uint32(50).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Xd();for(;n.pos>>3){case 1:{if(s!==8)break;r.nullValue=n.int32();continue}case 2:{if(s!==17)break;r.numberValue=n.double();continue}case 3:{if(s!==26)break;r.stringValue=n.string();continue}case 4:{if(s!==32)break;r.boolValue=n.bool();continue}case 5:{if(s!==42)break;r.structValue=Aa.unwrap(Aa.decode(n,n.uint32()));continue}case 6:{if(s!==50)break;r.listValue=Ca.unwrap(Ca.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{nullValue:Bi(t.nullValue)?iv(t.nullValue):Bi(t.null_value)?iv(t.null_value):void 0,numberValue:Bi(t.numberValue)?globalThis.Number(t.numberValue):Bi(t.number_value)?globalThis.Number(t.number_value):void 0,stringValue:Bi(t.stringValue)?globalThis.String(t.stringValue):Bi(t.string_value)?globalThis.String(t.string_value):void 0,boolValue:Bi(t.boolValue)?globalThis.Boolean(t.boolValue):Bi(t.bool_value)?globalThis.Boolean(t.bool_value):void 0,structValue:_h(t.structValue)?t.structValue:_h(t.struct_value)?t.struct_value:void 0,listValue:globalThis.Array.isArray(t.listValue)?[...t.listValue]:globalThis.Array.isArray(t.list_value)?[...t.list_value]:void 0}},toJSON(t){const e={};return t.nullValue!==void 0&&(e.nullValue=ZN(t.nullValue)),t.numberValue!==void 0&&(e.numberValue=t.numberValue),t.stringValue!==void 0&&(e.stringValue=t.stringValue),t.boolValue!==void 0&&(e.boolValue=t.boolValue),t.structValue!==void 0&&(e.structValue=t.structValue),t.listValue!==void 0&&(e.listValue=t.listValue),e},create(t){return ti.fromPartial(t??{})},fromPartial(t){const e=Xd();return e.nullValue=t.nullValue??void 0,e.numberValue=t.numberValue??void 0,e.stringValue=t.stringValue??void 0,e.boolValue=t.boolValue??void 0,e.structValue=t.structValue??void 0,e.listValue=t.listValue??void 0,e},wrap(t){const e=Xd();if(t===null)e.nullValue=0;else if(typeof t=="boolean")e.boolValue=t;else if(typeof t=="number")e.numberValue=t;else if(typeof t=="string")e.stringValue=t;else if(globalThis.Array.isArray(t))e.listValue=t;else if(typeof t=="object")e.structValue=t;else if(typeof t<"u")throw new globalThis.Error("Unsupported any value type: "+typeof t);return e},unwrap(t){if(t.stringValue!==void 0)return t.stringValue;if(t?.numberValue!==void 0)return t.numberValue;if(t?.boolValue!==void 0)return t.boolValue;if(t?.structValue!==void 0)return t.structValue;if(t?.listValue!==void 0)return t.listValue;if(t?.nullValue!==void 0)return null}};function $d(){return{values:[]}}const Ca={encode(t,e=new dt){for(const n of t.values)ti.encode(ti.wrap(n),e.uint32(10).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=$d();for(;n.pos>>3){case 1:{if(s!==10)break;r.values.push(ti.unwrap(ti.decode(n,n.uint32())));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{values:globalThis.Array.isArray(t?.values)?[...t.values]:[]}},toJSON(t){const e={};return t.values?.length&&(e.values=t.values),e},create(t){return Ca.fromPartial(t??{})},fromPartial(t){const e=$d();return e.values=t.values?.map(n=>n)||[],e},wrap(t){const e=$d();return e.values=t??[],e},unwrap(t){return t?.hasOwnProperty("values")&&globalThis.Array.isArray(t.values)?t.values:t}};function _h(t){return typeof t=="object"&&t!==null}function Bi(t){return t!=null}function sv(){return{message:void 0,value:void 0,fallback:void 0}}const qn={encode(t,e=new dt){return t.message!==void 0&&Ao.encode(t.message,e.uint32(10).fork()).join(),t.value!==void 0&&ti.encode(ti.wrap(t.value),e.uint32(18).fork()).join(),t.fallback!==void 0&&Co.encode(t.fallback,e.uint32(26).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=sv();for(;n.pos>>3){case 1:{if(s!==10)break;r.message=Ao.decode(n,n.uint32());continue}case 2:{if(s!==18)break;r.value=ti.unwrap(ti.decode(n,n.uint32()));continue}case 3:{if(s!==26)break;r.fallback=Co.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{message:us(t.message)?Ao.fromJSON(t.message):void 0,value:us(t?.value)?t.value:void 0,fallback:us(t.fallback)?Co.fromJSON(t.fallback):void 0}},toJSON(t){const e={};return t.message!==void 0&&(e.message=Ao.toJSON(t.message)),t.value!==void 0&&(e.value=t.value),t.fallback!==void 0&&(e.fallback=Co.toJSON(t.fallback)),e},create(t){return qn.fromPartial(t??{})},fromPartial(t){const e=sv();return e.message=t.message!==void 0&&t.message!==null?Ao.fromPartial(t.message):void 0,e.value=t.value??void 0,e.fallback=t.fallback!==void 0&&t.fallback!==null?Co.fromPartial(t.fallback):void 0,e}};function ov(){return{data:void 0}}const Co={encode(t,e=new dt){return t.data!==void 0&&ns.encode(t.data,e.uint32(10).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=ov();for(;n.pos>>3){case 1:{if(s!==10)break;r.data=ns.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{data:us(t.data)?ns.fromJSON(t.data):void 0}},toJSON(t){const e={};return t.data!==void 0&&(e.data=ns.toJSON(t.data)),e},create(t){return Co.fromPartial(t??{})},fromPartial(t){const e=ov();return e.data=t.data!==void 0&&t.data!==null?ns.fromPartial(t.data):void 0,e}};function av(){return{items:{}}}const ns={encode(t,e=new dt){return globalThis.Object.entries(t.items).forEach(([n,i])=>{xh.encode({key:n,value:i},e.uint32(10).fork()).join()}),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=av();for(;n.pos>>3){case 1:{if(s!==10)break;const o=xh.decode(n,n.uint32());o.value!==void 0&&(r.items[o.key]=o.value);continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{items:jN(t.items)?globalThis.Object.entries(t.items).reduce((e,[n,i])=>(e[n]=qn.fromJSON(i),e),{}):{}}},toJSON(t){const e={};if(t.items){const n=globalThis.Object.entries(t.items);n.length>0&&(e.items={},n.forEach(([i,r])=>{e.items[i]=qn.toJSON(r)}))}return e},create(t){return ns.fromPartial(t??{})},fromPartial(t){const e=av();return e.items=globalThis.Object.entries(t.items??{}).reduce((n,[i,r])=>(r!==void 0&&(n[i]=qn.fromPartial(r)),n),{}),e}};function lv(){return{key:"",value:void 0}}const xh={encode(t,e=new dt){return t.key!==""&&e.uint32(10).string(t.key),t.value!==void 0&&qn.encode(t.value,e.uint32(18).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=lv();for(;n.pos>>3){case 1:{if(s!==10)break;r.key=n.string();continue}case 2:{if(s!==18)break;r.value=qn.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{key:us(t.key)?globalThis.String(t.key):"",value:us(t.value)?qn.fromJSON(t.value):void 0}},toJSON(t){const e={};return t.key!==""&&(e.key=t.key),t.value!==void 0&&(e.value=qn.toJSON(t.value)),e},create(t){return xh.fromPartial(t??{})},fromPartial(t){const e=lv();return e.key=t.key??"",e.value=t.value!==void 0&&t.value!==null?qn.fromPartial(t.value):void 0,e}};function cv(){return{data:void 0,version:void 0}}const db={encode(t,e=new dt){return t.data!==void 0&&qn.encode(t.data,e.uint32(10).fork()).join(),t.version!==void 0&&e.uint32(18).string(t.version),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=cv();for(;n.pos>>3){case 1:{if(s!==10)break;r.data=qn.decode(n,n.uint32());continue}case 2:{if(s!==18)break;r.version=n.string();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{data:us(t.data)?qn.fromJSON(t.data):void 0,version:us(t.version)?globalThis.String(t.version):void 0}},toJSON(t){const e={};return t.data!==void 0&&(e.data=qn.toJSON(t.data)),t.version!==void 0&&(e.version=t.version),e},create(t){return db.fromPartial(t??{})},fromPartial(t){const e=cv();return e.data=t.data!==void 0&&t.data!==null?qn.fromPartial(t.data):void 0,e.version=t.version??void 0,e}};function jN(t){return typeof t=="object"&&t!==null}function us(t){return t!=null}function uv(){return{guid:"",name:"",x:0,y:0,z:0}}const Je={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.x!==0&&e.uint32(29).float(t.x),t.y!==0&&e.uint32(37).float(t.y),t.z!==0&&e.uint32(45).float(t.z),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=uv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.x=n.float();continue}case 4:{if(s!==37)break;r.y=n.float();continue}case 5:{if(s!==45)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",x:fe(t.x)?globalThis.Number(t.x):0,y:fe(t.y)?globalThis.Number(t.y):0,z:fe(t.z)?globalThis.Number(t.z):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return Je.fromPartial(t??{})},fromPartial(t){const e=uv();return e.guid=t.guid??"",e.name=t.name??"",e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function dv(){return{guid:"",name:"",x:0,y:0,z:0}}const Rt={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.x!==0&&e.uint32(29).float(t.x),t.y!==0&&e.uint32(37).float(t.y),t.z!==0&&e.uint32(45).float(t.z),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=dv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.x=n.float();continue}case 4:{if(s!==37)break;r.y=n.float();continue}case 5:{if(s!==45)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",x:fe(t.x)?globalThis.Number(t.x):0,y:fe(t.y)?globalThis.Number(t.y):0,z:fe(t.z)?globalThis.Number(t.z):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return Rt.fromPartial(t??{})},fromPartial(t){const e=dv();return e.guid=t.guid??"",e.name=t.name??"",e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function fv(){return{guid:"",name:"",point:void 0,xaxis:void 0,yaxis:void 0}}const Ze={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.point!==void 0&&Je.encode(t.point,e.uint32(26).fork()).join(),t.xaxis!==void 0&&Rt.encode(t.xaxis,e.uint32(34).fork()).join(),t.yaxis!==void 0&&Rt.encode(t.yaxis,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=fv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.point=Je.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.xaxis=Rt.decode(n,n.uint32());continue}case 5:{if(s!==42)break;r.yaxis=Rt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",point:fe(t.point)?Je.fromJSON(t.point):void 0,xaxis:fe(t.xaxis)?Rt.fromJSON(t.xaxis):void 0,yaxis:fe(t.yaxis)?Rt.fromJSON(t.yaxis):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.point!==void 0&&(e.point=Je.toJSON(t.point)),t.xaxis!==void 0&&(e.xaxis=Rt.toJSON(t.xaxis)),t.yaxis!==void 0&&(e.yaxis=Rt.toJSON(t.yaxis)),e},create(t){return Ze.fromPartial(t??{})},fromPartial(t){const e=fv();return e.guid=t.guid??"",e.name=t.name??"",e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e.xaxis=t.xaxis!==void 0&&t.xaxis!==null?Rt.fromPartial(t.xaxis):void 0,e.yaxis=t.yaxis!==void 0&&t.yaxis!==null?Rt.fromPartial(t.yaxis):void 0,e}};function hv(){return{guid:"",name:"",point:void 0,normal:void 0}}const Ap={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.point!==void 0&&Je.encode(t.point,e.uint32(26).fork()).join(),t.normal!==void 0&&Rt.encode(t.normal,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=hv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.point=Je.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.normal=Rt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",point:fe(t.point)?Je.fromJSON(t.point):void 0,normal:fe(t.normal)?Rt.fromJSON(t.normal):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.point!==void 0&&(e.point=Je.toJSON(t.point)),t.normal!==void 0&&(e.normal=Rt.toJSON(t.normal)),e},create(t){return Ap.fromPartial(t??{})},fromPartial(t){const e=hv();return e.guid=t.guid??"",e.name=t.name??"",e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e.normal=t.normal!==void 0&&t.normal!==null?Rt.fromPartial(t.normal):void 0,e}};function pv(){return{guid:"",name:"",w:0,x:0,y:0,z:0}}const Cp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.w!==0&&e.uint32(29).float(t.w),t.x!==0&&e.uint32(37).float(t.x),t.y!==0&&e.uint32(45).float(t.y),t.z!==0&&e.uint32(53).float(t.z),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=pv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.w=n.float();continue}case 4:{if(s!==37)break;r.x=n.float();continue}case 5:{if(s!==45)break;r.y=n.float();continue}case 6:{if(s!==53)break;r.z=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",w:fe(t.w)?globalThis.Number(t.w):0,x:fe(t.x)?globalThis.Number(t.x):0,y:fe(t.y)?globalThis.Number(t.y):0,z:fe(t.z)?globalThis.Number(t.z):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.w!==0&&(e.w=t.w),t.x!==0&&(e.x=t.x),t.y!==0&&(e.y=t.y),t.z!==0&&(e.z=t.z),e},create(t){return Cp.fromPartial(t??{})},fromPartial(t){const e=pv();return e.guid=t.guid??"",e.name=t.name??"",e.w=t.w??0,e.x=t.x??0,e.y=t.y??0,e.z=t.z??0,e}};function mv(){return{guid:"",name:"",start:void 0,end:void 0}}const Pp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.start!==void 0&&Je.encode(t.start,e.uint32(26).fork()).join(),t.end!==void 0&&Je.encode(t.end,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=mv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.start=Je.decode(n,n.uint32());continue}case 4:{if(s!==34)break;r.end=Je.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",start:fe(t.start)?Je.fromJSON(t.start):void 0,end:fe(t.end)?Je.fromJSON(t.end):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.start!==void 0&&(e.start=Je.toJSON(t.start)),t.end!==void 0&&(e.end=Je.toJSON(t.end)),e},create(t){return Pp.fromPartial(t??{})},fromPartial(t){const e=mv();return e.guid=t.guid??"",e.name=t.name??"",e.start=t.start!==void 0&&t.start!==null?Je.fromPartial(t.start):void 0,e.end=t.end!==void 0&&t.end!==null?Je.fromPartial(t.end):void 0,e}};function gv(){return{guid:"",name:"",radius:0,frame:void 0}}const is={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=gv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==34)break;r.frame=Ze.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return is.fromPartial(t??{})},fromPartial(t){const e=gv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function vv(){return{guid:"",name:"",circle:void 0,startAngle:0,endAngle:0}}const Rp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.circle!==void 0&&is.encode(t.circle,e.uint32(26).fork()).join(),t.startAngle!==0&&e.uint32(37).float(t.startAngle),t.endAngle!==0&&e.uint32(45).float(t.endAngle),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=vv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.circle=is.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.startAngle=n.float();continue}case 5:{if(s!==45)break;r.endAngle=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",circle:fe(t.circle)?is.fromJSON(t.circle):void 0,startAngle:fe(t.startAngle)?globalThis.Number(t.startAngle):fe(t.start_angle)?globalThis.Number(t.start_angle):0,endAngle:fe(t.endAngle)?globalThis.Number(t.endAngle):fe(t.end_angle)?globalThis.Number(t.end_angle):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.circle!==void 0&&(e.circle=is.toJSON(t.circle)),t.startAngle!==0&&(e.startAngle=t.startAngle),t.endAngle!==0&&(e.endAngle=t.endAngle),e},create(t){return Rp.fromPartial(t??{})},fromPartial(t){const e=vv();return e.guid=t.guid??"",e.name=t.name??"",e.circle=t.circle!==void 0&&t.circle!==null?is.fromPartial(t.circle):void 0,e.startAngle=t.startAngle??0,e.endAngle=t.endAngle??0,e}};function _v(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const Dp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.major!==0&&e.uint32(29).float(t.major),t.minor!==0&&e.uint32(37).float(t.minor),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=_v();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.major=n.float();continue}case 4:{if(s!==37)break;r.minor=n.float();continue}case 5:{if(s!==42)break;r.frame=Ze.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",major:fe(t.major)?globalThis.Number(t.major):0,minor:fe(t.minor)?globalThis.Number(t.minor):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.major!==0&&(e.major=t.major),t.minor!==0&&(e.minor=t.minor),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Dp.fromPartial(t??{})},fromPartial(t){const e=_v();return e.guid=t.guid??"",e.name=t.name??"",e.major=t.major??0,e.minor=t.minor??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function xv(){return{guid:"",name:"",focal:0,frame:void 0}}const Ip={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.focal!==0&&e.uint32(29).float(t.focal),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=xv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.focal=n.float();continue}case 4:{if(s!==34)break;r.frame=Ze.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",focal:fe(t.focal)?globalThis.Number(t.focal):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.focal!==0&&(e.focal=t.focal),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Ip.fromPartial(t??{})},fromPartial(t){const e=xv();return e.guid=t.guid??"",e.name=t.name??"",e.focal=t.focal??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function yv(){return{guid:"",name:"",major:0,minor:0,frame:void 0}}const Np={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.major!==0&&e.uint32(29).float(t.major),t.minor!==0&&e.uint32(37).float(t.minor),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=yv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.major=n.float();continue}case 4:{if(s!==37)break;r.minor=n.float();continue}case 5:{if(s!==42)break;r.frame=Ze.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",major:fe(t.major)?globalThis.Number(t.major):0,minor:fe(t.minor)?globalThis.Number(t.minor):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.major!==0&&(e.major=t.major),t.minor!==0&&(e.minor=t.minor),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Np.fromPartial(t??{})},fromPartial(t){const e=yv();return e.guid=t.guid??"",e.name=t.name??"",e.major=t.major??0,e.minor=t.minor??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function bv(){return{guid:"",name:"",points:[],degree:0}}const Lp={encode(t,e=new dt){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(const n of t.points)Je.encode(n,e.uint32(26).fork()).join();return t.degree!==0&&e.uint32(32).int32(t.degree),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=bv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Je.decode(n,n.uint32()));continue}case 4:{if(s!==32)break;r.degree=n.int32();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[],degree:fe(t.degree)?globalThis.Number(t.degree):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),t.degree!==0&&(e.degree=Math.round(t.degree)),e},create(t){return Lp.fromPartial(t??{})},fromPartial(t){const e=bv();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e.degree=t.degree??0,e}};function Sv(){return{guid:"",name:"",points:[]}}const Op={encode(t,e=new dt){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(const n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Sv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Je.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return Op.fromPartial(t??{})},fromPartial(t){const e=Sv();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function Mv(){return{guid:"",name:"",points:[]}}const Fp={encode(t,e=new dt){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(const n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Mv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Je.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return Fp.fromPartial(t??{})},fromPartial(t){const e=Mv();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function wv(){return{guid:"",name:"",frame:void 0,xsize:0,ysize:0,zsize:0}}const Up={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(26).fork()).join(),t.xsize!==0&&e.uint32(37).float(t.xsize),t.ysize!==0&&e.uint32(45).float(t.ysize),t.zsize!==0&&e.uint32(53).float(t.zsize),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=wv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.frame=Ze.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.xsize=n.float();continue}case 5:{if(s!==45)break;r.ysize=n.float();continue}case 6:{if(s!==53)break;r.zsize=n.float();continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0,xsize:fe(t.xsize)?globalThis.Number(t.xsize):0,ysize:fe(t.ysize)?globalThis.Number(t.ysize):0,zsize:fe(t.zsize)?globalThis.Number(t.zsize):0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),t.xsize!==0&&(e.xsize=t.xsize),t.ysize!==0&&(e.ysize=t.ysize),t.zsize!==0&&(e.zsize=t.zsize),e},create(t){return Up.fromPartial(t??{})},fromPartial(t){const e=wv();return e.guid=t.guid??"",e.name=t.name??"",e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e.xsize=t.xsize??0,e.ysize=t.ysize??0,e.zsize=t.zsize??0,e}};function Ev(){return{guid:"",name:"",radius:0,frame:void 0}}const kp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(34).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Ev();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==34)break;r.frame=Ze.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return kp.fromPartial(t??{})},fromPartial(t){const e=Ev();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Tv(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const Bp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Tv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Ze.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,height:fe(t.height)?globalThis.Number(t.height):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Bp.fromPartial(t??{})},fromPartial(t){const e=Tv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Av(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const zp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Av();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Ze.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,height:fe(t.height)?globalThis.Number(t.height):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return zp.fromPartial(t??{})},fromPartial(t){const e=Av();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Cv(){return{guid:"",name:"",radius:0,height:0,frame:void 0}}const Vp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radius!==0&&e.uint32(29).float(t.radius),t.height!==0&&e.uint32(37).float(t.height),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Cv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radius=n.float();continue}case 4:{if(s!==37)break;r.height=n.float();continue}case 5:{if(s!==42)break;r.frame=Ze.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radius:fe(t.radius)?globalThis.Number(t.radius):0,height:fe(t.height)?globalThis.Number(t.height):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radius!==0&&(e.radius=t.radius),t.height!==0&&(e.height=t.height),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Vp.fromPartial(t??{})},fromPartial(t){const e=Cv();return e.guid=t.guid??"",e.name=t.name??"",e.radius=t.radius??0,e.height=t.height??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Pv(){return{guid:"",name:"",radiusAxis:0,radiusPipe:0,frame:void 0}}const Hp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.radiusAxis!==0&&e.uint32(29).float(t.radiusAxis),t.radiusPipe!==0&&e.uint32(37).float(t.radiusPipe),t.frame!==void 0&&Ze.encode(t.frame,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Pv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==29)break;r.radiusAxis=n.float();continue}case 4:{if(s!==37)break;r.radiusPipe=n.float();continue}case 5:{if(s!==42)break;r.frame=Ze.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",radiusAxis:fe(t.radiusAxis)?globalThis.Number(t.radiusAxis):fe(t.radius_axis)?globalThis.Number(t.radius_axis):0,radiusPipe:fe(t.radiusPipe)?globalThis.Number(t.radiusPipe):fe(t.radius_pipe)?globalThis.Number(t.radius_pipe):0,frame:fe(t.frame)?Ze.fromJSON(t.frame):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.radiusAxis!==0&&(e.radiusAxis=t.radiusAxis),t.radiusPipe!==0&&(e.radiusPipe=t.radiusPipe),t.frame!==void 0&&(e.frame=Ze.toJSON(t.frame)),e},create(t){return Hp.fromPartial(t??{})},fromPartial(t){const e=Pv();return e.guid=t.guid??"",e.name=t.name??"",e.radiusAxis=t.radiusAxis??0,e.radiusPipe=t.radiusPipe??0,e.frame=t.frame!==void 0&&t.frame!==null?Ze.fromPartial(t.frame):void 0,e}};function Rv(){return{guid:"",name:"",points:[]}}const Gp={encode(t,e=new dt){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name);for(const n of t.points)Je.encode(n,e.uint32(26).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Rv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.points.push(Je.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",points:globalThis.Array.isArray(t?.points)?t.points.map(e=>Je.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.points?.length&&(e.points=t.points.map(n=>Je.toJSON(n))),e},create(t){return Gp.fromPartial(t??{})},fromPartial(t){const e=Rv();return e.guid=t.guid??"",e.name=t.name??"",e.points=t.points?.map(n=>Je.fromPartial(n))||[],e}};function Dv(){return{guid:"",name:"",matrix:[]}}const Wp={encode(t,e=new dt){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Dv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return Wp.fromPartial(t??{})},fromPartial(t){const e=Dv();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function Iv(){return{guid:"",name:"",translationVector:void 0}}const qp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.translationVector!==void 0&&Rt.encode(t.translationVector,e.uint32(26).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Iv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.translationVector=Rt.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",translationVector:fe(t.translationVector)?Rt.fromJSON(t.translationVector):fe(t.translation_vector)?Rt.fromJSON(t.translation_vector):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.translationVector!==void 0&&(e.translationVector=Rt.toJSON(t.translationVector)),e},create(t){return qp.fromPartial(t??{})},fromPartial(t){const e=Iv();return e.guid=t.guid??"",e.name=t.name??"",e.translationVector=t.translationVector!==void 0&&t.translationVector!==null?Rt.fromPartial(t.translationVector):void 0,e}};function Nv(){return{guid:"",name:"",axis:void 0,angle:0,point:void 0}}const Xp={encode(t,e=new dt){return t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),t.axis!==void 0&&Rt.encode(t.axis,e.uint32(26).fork()).join(),t.angle!==0&&e.uint32(37).float(t.angle),t.point!==void 0&&Je.encode(t.point,e.uint32(42).fork()).join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Nv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.axis=Rt.decode(n,n.uint32());continue}case 4:{if(s!==37)break;r.angle=n.float();continue}case 5:{if(s!==42)break;r.point=Je.decode(n,n.uint32());continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:fe(t.guid)?globalThis.String(t.guid):"",name:fe(t.name)?globalThis.String(t.name):"",axis:fe(t.axis)?Rt.fromJSON(t.axis):void 0,angle:fe(t.angle)?globalThis.Number(t.angle):0,point:fe(t.point)?Je.fromJSON(t.point):void 0}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.axis!==void 0&&(e.axis=Rt.toJSON(t.axis)),t.angle!==0&&(e.angle=t.angle),t.point!==void 0&&(e.point=Je.toJSON(t.point)),e},create(t){return Xp.fromPartial(t??{})},fromPartial(t){const e=Nv();return e.guid=t.guid??"",e.name=t.name??"",e.axis=t.axis!==void 0&&t.axis!==null?Rt.fromPartial(t.axis):void 0,e.angle=t.angle??0,e.point=t.point!==void 0&&t.point!==null?Je.fromPartial(t.point):void 0,e}};function Lv(){return{guid:"",name:"",matrix:[]}}const $p={encode(t,e=new dt){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Lv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return $p.fromPartial(t??{})},fromPartial(t){const e=Lv();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function Ov(){return{guid:"",name:"",matrix:[]}}const Yp={encode(t,e=new dt){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Ov();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return Yp.fromPartial(t??{})},fromPartial(t){const e=Ov();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function Fv(){return{guid:"",name:"",matrix:[]}}const Jp={encode(t,e=new dt){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Fv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return Jp.fromPartial(t??{})},fromPartial(t){const e=Fv();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function Uv(){return{guid:"",name:"",matrix:[]}}const Kp={encode(t,e=new dt){t.guid!==""&&e.uint32(10).string(t.guid),t.name!==""&&e.uint32(18).string(t.name),e.uint32(26).fork();for(const n of t.matrix)e.float(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Uv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s===29){r.matrix.push(n.float());continue}if(s===26){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.guid!==""&&(e.guid=t.guid),t.name!==""&&(e.name=t.name),t.matrix?.length&&(e.matrix=t.matrix),e},create(t){return Kp.fromPartial(t??{})},fromPartial(t){const e=Uv();return e.guid=t.guid??"",e.name=t.name??"",e.matrix=t.matrix?.map(n=>n)||[],e}};function fe(t){return t!=null}class QN{data;constructor(e){let n;"bytes"in e?n=eL(e.bytes):n=e.data,this.data=n}get bytes(){return tL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get matrix(){return this.data.matrix}buildThreeMatrix(){const e=this.data.matrix,n=new yt;return n.set(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]),n}}function eL(t){return Wp.decode(t)}function tL(t){return Wp.encode(t).finish()}function _s(t){const e=new I(t.point.x,t.point.y,t.point.z),n=new I(t.xaxis.x,t.xaxis.y,t.xaxis.z),i=new I(t.yaxis.x,t.yaxis.y,t.yaxis.z),r=new I().crossVectors(n,i),s=new yt;return s.makeBasis(n,i,r),s.setPosition(e),s}class hi{data;constructor(e){let n;if("bytes"in e?n=nL(e.bytes):n=e.data,n.x===void 0||n.y===void 0||n.z===void 0)throw new Error("Invalid PointData: Missing required properties (x, y, or z).");this.data=n}get bytes(){return iL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}buildGeometry(){const e=new _t,n=new Float32Array([this.x,this.y,this.z]);return e.setAttribute("position",new Nn(n,3)),new pp(e)}}function nL(t){return Je.decode(t)}function iL(t){return Je.encode(t).finish()}class ea{data;constructor(e){let n;if("bytes"in e?n=rL(e.bytes):n=e.data,n.x===void 0||n.y===void 0||n.z===void 0)throw new Error("Invalid VectorData: Missing required properties (x, y, or z).");this.data=n}get bytes(){return sL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get x(){return this.data.x}get y(){return this.data.y}get z(){return this.data.z}buildGeometry(e){const n=new I(this.x,this.y,this.z),i=n.length();n.normalize();let r;e?r=new I(e.x,e.y,e.z):r=new I(0,0,0);let s=new wp(n,r,i,16711680);return s.setDirection(n),s}}function rL(t){return Rt.decode(t)}function sL(t){return Rt.encode(t).finish()}class Ii{data;_point;_xaxis;_yaxis;constructor(e){let n;if("bytes"in e?n=oL(e.bytes):n=e.data,!n.point||!n.xaxis||!n.yaxis)throw new Error("Invalid FrameData: Missing required properties (point, xaxis, or yaxis).");this.data=n}get bytes(){return aL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get point(){return this._point||(this._point=new hi({data:this.data.point})),this._point}get xaxis(){return this._xaxis||(this._xaxis=new ea({data:this.data.xaxis})),this._xaxis}get yaxis(){return this._yaxis||(this._yaxis=new ea({data:this.data.yaxis})),this._yaxis}buildGeometry(){const e=new eb(1);e.setColors(new rt(16711680),new rt(65280),new rt(255));const n=_s(this.data);return e.applyMatrix4(n),e}}function oL(t){return Ze.decode(t)}function aL(t){return Ze.encode(t).finish()}class fb{data;_frame;constructor(e){let n;if("bytes"in e?n=lL(e.bytes):n=e.data,!n.radius||!n.frame)throw new Error("Invalid CircleData: Missing required properties (radius or frame).");this.data=n}get bytes(){return cL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get frame(){return this._frame||(this._frame=new Ii({data:this.data.frame})),this._frame}buildGeometry(e=64){const n=new gp(this.data.radius,e),i=_s(this.data.frame),r=new be(n);return r.applyMatrix4(i),r}}function lL(t){return is.decode(t)}function cL(t){return is.encode(t).finish()}class uL{data;_circle;constructor(e){let n;if("bytes"in e?n=dL(e.bytes):n=e.data,!n.startAngle||!n.endAngle||!n.circle)throw new Error("Invalid ArcData: Missing required properties (startAngle, endAngle, or circle).");this.data=n}get bytes(){return fL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get startAngle(){return this.data.startAngle}get endAngle(){return this.data.endAngle}get circle(){return this._circle||(this._circle=new fb({data:this.data.circle})),this._circle}buildGeometry(){throw new Error("Method not implemented.")}}function dL(t){return Rp.decode(t)}function fL(t){return Rp.encode(t).finish()}class hL{data;_points;constructor(e){let n;if("bytes"in e?n=pL(e.bytes):n=e.data,!n.points||n.points.length===0)throw new Error("Invalid BezierData: Missing required property points.");this.data=n}get bytes(){return mL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){if(!this._points){this._points=[];for(const e of this.data.points){const n=new hi({data:e});this._points.push(n)}}return this._points}buildGeometry(){throw Error("Method not implemented.")}}function pL(t){return Lp.decode(t)}function mL(t){return Lp.encode(t).finish()}class gL{data;_frame;constructor(e){let n;if("bytes"in e?n=vL(e.bytes):n=e.data,!n.xsize||!n.ysize||!n.zsize||!n.frame)throw new Error("Invalid BoxData: Missing required properties (xsize, ysize, zsize, or frame).");this.data=n}get bytes(){return _L(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get xsize(){return this.data.xsize}get ysize(){return this.data.ysize}get zsize(){return this.data.zsize}get frame(){return this._frame||(this._frame=new Ii({data:this.data.frame})),this._frame}buildGeometry(){const e=new Kt(this.data.xsize,this.data.ysize,this.data.zsize),n=_s(this.data.frame),i=new be(e);return i.applyMatrix4(n),i}}function vL(t){return Up.decode(t)}function _L(t){return Up.encode(t).finish()}class xL{data;_frame;constructor(e){let n;if("bytes"in e?n=yL(e.bytes):n=e.data,!n.radius||!n.height||!n.frame)throw new Error("Invalid CapsuleData: Missing required properties (radius, height, or frame).");this.data=n}get bytes(){return bL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||(this._frame=new Ii({data:this.data.frame})),this._frame}buildGeometry(e=64){const n=new mp(this.data.radius,this.data.height,e,e),i=new be(n),r=_s(this.data.frame);return i.applyMatrix4(r),i}}function yL(t){return Vp.decode(t)}function bL(t){return Vp.encode(t).finish()}class SL{data;_frame;constructor(e){let n;if("bytes"in e?n=ML(e.bytes):n=e.data,!n.radius||!n.height||!n.frame)throw new Error("Invalid ConeData: Missing required properties (radius, height, or frame).");this.data=n}get bytes(){return wL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||(this._frame=new Ii({data:this.data.frame})),this._frame}buildGeometry(e=64){const n=new Au(this.radius,this.height,e),i=new be(n),r=_s(this.data.frame);return i.applyMatrix4(r),i}}function ML(t){return zp.decode(t)}function wL(t){return zp.encode(t).finish()}class EL{data;_frame;constructor(e){let n;if("bytes"in e?n=TL(e.bytes):n=e.data,!n.radius||!n.height||!n.frame)throw new Error("Invalid CylinderData: Missing required properties (radius, height, or frame).");this.data=n}get bytes(){return AL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get radius(){return this.data.radius}get height(){return this.data.height}get frame(){return this._frame||(this._frame=new Ii({data:this.data.frame})),this._frame}buildGeometry(e=64){const n=new fn(this.data.radius,this.data.radius,this.data.height,e),i=new be(n),r=_s(this.frame);return i.applyMatrix4(r),i}}function TL(t){return Bp.decode(t)}function AL(t){return Bp.encode(t).finish()}class CL{data;_frame;constructor(e){let n;if("bytes"in e?n=PL(e.bytes):n=e.data,!n.major||!n.minor||!n.frame)throw new Error("Invalid EllipseData: Missing required properties (major, minor, or frame).");this.data=n}get bytes(){return RL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get major(){return this.data.major}get minor(){return this.data.minor}get frame(){return this._frame||(this._frame=new Ii({data:this.data.frame})),this._frame}buildGeometry(e=64){throw Error("Method not implemented.")}}function PL(t){return Dp.decode(t)}function RL(t){return Dp.encode(t).finish()}class DL{data;_frame;constructor(e){let n;if("bytes"in e?n=IL(e.bytes):n=e.data,!n.major||!n.minor||!n.frame)throw new Error("Invalid HyperbolaData: Missing required properties (a, b, or frame).");this.data=n}get bytes(){return NL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get major(){return this.data.major}get minor(){return this.data.minor}get frame(){return this._frame||(this._frame=new Ii({data:this.data.frame})),this._frame}buildGeometry(e=64){throw Error("Method not implemented.")}}function IL(t){return Np.decode(t)}function NL(t){return Np.encode(t).finish()}class LL{data;_start;_end;constructor(e){let n;if("bytes"in e?n=OL(e.bytes):n=e.data,!n.start||!n.end)throw new Error("Invalid LineData: Missing required properties (start or end).");this.data=n}get bytes(){return FL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get start(){return this._start||(this._start=new hi({data:this.data.start})),this._start}get end(){return this._end||(this._end=new hi({data:this.data.end})),this._end}buildGeometry(){const e=new I(this.data.start.x,this.data.start.y,this.data.start.z),n=new I(this.data.end.x,this.data.end.y,this.data.end.z),i=new _t().setFromPoints([e,n]),r=new vi({color:255});return new hn(i,r)}}function OL(t){return Pp.decode(t)}function FL(t){return Pp.encode(t).finish()}class UL{data;_frame;constructor(e){let n;if("bytes"in e?n=kL(e.bytes):n=e.data,!n.focal||!n.frame)throw new Error("Invalid ParabolaData: Missing required properties (focal_length or frame).");this.data=n}get bytes(){return BL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get focal(){return this.data.focal}get frame(){return this._frame||(this._frame=new Ii({data:this.data.frame})),this._frame}buildGeometry(e=64){throw Error("Method not implemented.")}}function kL(t){return Ip.decode(t)}function BL(t){return Ip.encode(t).finish()}class zL{data;_point;_normal;constructor(e){let n;if("bytes"in e?n=VL(e.bytes):n=e.data,!n.point||!n.normal)throw new Error("Invalid PlaneData: Missing required properties (point or normal).");this.data=n}get bytes(){return HL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get point(){return this._point||(this._point=new hi({data:this.data.point})),this._point}get normal(){return this._normal||(this._normal=new ea({data:this.data.normal})),this._normal}buildGeometry(e=2){const n=new mr(new I(this.normal.x,this.normal.y,this.normal.z),0);return n.translate(new I(this.point.x,this.point.y,this.point.z)),new lR(n,e)}}function VL(t){return Ap.decode(t)}function HL(t){return Ap.encode(t).finish()}class GL{data;_points;constructor(e){let n;if("bytes"in e?n=WL(e.bytes):n=e.data,!n.points||n.points.length===0)throw new Error("Invalid PointcloudData: Missing required property points.");this.data=n}get bytes(){return qL(this.data)}get guid(){return this.data.guid}get name(){return this.data.name}get points(){if(!this._points){this._points=[];for(const e of this.data.points){const n=new hi({data:e});this._points.push(n)}}return this._points}buildGeometry(){const e=new _t,n=new Float32Array(this.points.length*3);for(let s=0;s>>3){case 1:{if(s===8){r.indices.push(n.uint32());continue}if(s===10){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.indices?.length&&(e.indices=t.indices.map(n=>Math.round(n))),e},create(t){return rs.fromPartial(t??{})},fromPartial(t){const e=kv();return e.indices=t.indices?.map(n=>n)||[],e}};function Bv(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const Zp={encode(t,e=new dt){t.guid!==void 0&&e.uint32(10).string(t.guid),t.name!==void 0&&e.uint32(18).string(t.name);for(const n of t.vertices)Je.encode(n,e.uint32(26).fork()).join();for(const n of t.faces)rs.encode(n,e.uint32(34).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Bv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.vertices.push(Je.decode(n,n.uint32()));continue}case 4:{if(s!==34)break;r.faces.push(rs.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:Zc(t.guid)?globalThis.String(t.guid):void 0,name:Zc(t.name)?globalThis.String(t.name):void 0,vertices:globalThis.Array.isArray(t?.vertices)?t.vertices.map(e=>Je.fromJSON(e)):[],faces:globalThis.Array.isArray(t?.faces)?t.faces.map(e=>rs.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==void 0&&(e.guid=t.guid),t.name!==void 0&&(e.name=t.name),t.vertices?.length&&(e.vertices=t.vertices.map(n=>Je.toJSON(n))),t.faces?.length&&(e.faces=t.faces.map(n=>rs.toJSON(n))),e},create(t){return Zp.fromPartial(t??{})},fromPartial(t){const e=Bv();return e.guid=t.guid??void 0,e.name=t.name??void 0,e.vertices=t.vertices?.map(n=>Je.fromPartial(n))||[],e.faces=t.faces?.map(n=>rs.fromPartial(n))||[],e}};function zv(){return{vertexIndices:[]}}const ss={encode(t,e=new dt){e.uint32(10).fork();for(const n of t.vertexIndices)e.int32(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=zv();for(;n.pos>>3){case 1:{if(s===8){r.vertexIndices.push(n.int32());continue}if(s===10){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):globalThis.Array.isArray(t?.vertex_indices)?t.vertex_indices.map(e=>globalThis.Number(e)):[]}},toJSON(t){const e={};return t.vertexIndices?.length&&(e.vertexIndices=t.vertexIndices.map(n=>Math.round(n))),e},create(t){return ss.fromPartial(t??{})},fromPartial(t){const e=zv();return e.vertexIndices=t.vertexIndices?.map(n=>n)||[],e}};function Vv(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const jp={encode(t,e=new dt){t.guid!==void 0&&e.uint32(10).string(t.guid),t.name!==void 0&&e.uint32(18).string(t.name);for(const n of t.vertices)Je.encode(n,e.uint32(26).fork()).join();for(const n of t.faces)ss.encode(n,e.uint32(34).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Vv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.vertices.push(Je.decode(n,n.uint32()));continue}case 4:{if(s!==34)break;r.faces.push(ss.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:Zc(t.guid)?globalThis.String(t.guid):void 0,name:Zc(t.name)?globalThis.String(t.name):void 0,vertices:globalThis.Array.isArray(t?.vertices)?t.vertices.map(e=>Je.fromJSON(e)):[],faces:globalThis.Array.isArray(t?.faces)?t.faces.map(e=>ss.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==void 0&&(e.guid=t.guid),t.name!==void 0&&(e.name=t.name),t.vertices?.length&&(e.vertices=t.vertices.map(n=>Je.toJSON(n))),t.faces?.length&&(e.faces=t.faces.map(n=>ss.toJSON(n))),e},create(t){return jp.fromPartial(t??{})},fromPartial(t){const e=Vv();return e.guid=t.guid??void 0,e.name=t.name??void 0,e.vertices=t.vertices?.map(n=>Je.fromPartial(n))||[],e.faces=t.faces?.map(n=>ss.fromPartial(n))||[],e}};function Zc(t){return t!=null}class EO{data;constructor(e){let n;if("bytes"in e?n=TO(e.bytes):n=e.data,!n.vertexIndices)throw new Error("Invalid FaceData: Missing required property 'vertices'.");this.data=n}get bytes(){return AO(this.data)}get vertexIndices(){return this.data.vertexIndices}}function TO(t){return ss.decode(t)}function AO(t){return ss.encode(t).finish()}class CO{data;_points;_faces;constructor(e){let n;if("bytes"in e?n=PO(e.bytes):n=e.data,!n.vertices||!n.faces)throw new Error("Invalid PolyhedronData: Missing required properties (vertices or faces).");this.data=n}get bytes(){return RO(this.data)}get guid(){return this.data.guid?this.data.guid:""}get name(){return this.data.name?this.data.name:""}get vertices(){if(!this._points){this._points=[];for(const e of this.data.vertices){const n=new hi({data:e});this._points.push(n)}}return this._points}get faces(){if(!this._faces){this._faces=[];for(const e of this.data.faces){const n=new EO({data:e});this._faces.push(n)}}return this._faces}buildGeometry(){const e=new _t,n=new Float32Array(this.vertices.length*3);for(let o=0;on&&l.add(N)}l.normalize(),g.setXYZ(p+w,l.x,l.y,l.z)}}return u.setAttribute("normal",g),u}class OO{data;_vertices;constructor(e){let n;if("bytes"in e?n=FO(e.bytes):n=e.data,!n.vertices||!n.faces)throw new Error("Invalid MeshData: Missing required properties (vertices or faces).");this.data=n}get bytes(){return UO(this.data)}get guid(){return this.data.guid?this.data.guid:""}get name(){return this.data.name?this.data.name:""}get vertices(){if(!this._vertices){this._vertices=[];for(const e of this.data.vertices){const n=new hi({data:e});this._vertices.push(n)}}return this._vertices}get faces(){const e=[];for(const n of this.data.faces){const i=new DO({data:n});e.push(i)}return e}buildGeometry(){let e=new _t;const n=new Float32Array(this.vertices.length*3);this.vertices.forEach((o,a)=>{n[a*3]=o.x,n[a*3+1]=o.y,n[a*3+2]=o.z});const i=[];for(const o of this.faces){const a=o.indices;for(let l=1;l1&&e.multiplyScalar(1/n),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}class Ru extends be{constructor(){const e=Ru.SkyShader,n=new Pi({name:e.name,uniforms:ky.clone(e.uniforms),vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,side:In,depthWrite:!1});super(new Kt(1,1,1),n),this.isSky=!0}}Ru.SkyShader={name:"SkyShader",uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new I},up:{value:new I(0,1,0)}},vertexShader:` +}`;class ZI{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new Qy(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new Ii({vertexShader:JI,fragmentShader:KI,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new be(new vl(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class jI extends ro{constructor(e,n){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,d=null,f=null,h=null,g=null;const v=typeof XRWebGLBinding<"u",m=new ZI,p={},_=n.getContextAttributes();let x=null,y=null;const E=[],A=[],P=new xe;let D=null;const S=new qn;S.viewport=new jt;const w=new qn;w.viewport=new jt;const N=[S,w],B=new r2;let W=null,Z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(oe){let fe=E[oe];return fe===void 0&&(fe=new Nd,E[oe]=fe),fe.getTargetRaySpace()},this.getControllerGrip=function(oe){let fe=E[oe];return fe===void 0&&(fe=new Nd,E[oe]=fe),fe.getGripSpace()},this.getHand=function(oe){let fe=E[oe];return fe===void 0&&(fe=new Nd,E[oe]=fe),fe.getHandSpace()};function X(oe){const fe=A.indexOf(oe.inputSource);if(fe===-1)return;const Ie=E[fe];Ie!==void 0&&(Ie.update(oe.inputSource,oe.frame,c||o),Ie.dispatchEvent({type:oe.type,data:oe.inputSource}))}function H(){r.removeEventListener("select",X),r.removeEventListener("selectstart",X),r.removeEventListener("selectend",X),r.removeEventListener("squeeze",X),r.removeEventListener("squeezestart",X),r.removeEventListener("squeezeend",X),r.removeEventListener("end",H),r.removeEventListener("inputsourceschange",k);for(let oe=0;oe=0&&(A[Ne]=null,E[Ne].disconnect(Ie))}for(let fe=0;fe=A.length){A.push(Ie),Ne=mt;break}else if(A[mt]===null){A[mt]=Ie,Ne=mt;break}if(Ne===-1)break}const De=E[Ne];De&&De.connect(Ie)}}const J=new I,ue=new I;function Y(oe,fe,Ie){J.setFromMatrixPosition(fe.matrixWorld),ue.setFromMatrixPosition(Ie.matrixWorld);const Ne=J.distanceTo(ue),De=fe.projectionMatrix.elements,mt=Ie.projectionMatrix.elements,L=De[14]/(De[10]-1),U=De[14]/(De[10]+1),O=(De[9]+1)/De[5],G=(De[9]-1)/De[5],z=(De[8]-1)/De[0],$=(mt[8]+1)/mt[0],C=L*z,ce=L*$,ee=Ne/(-z+$),te=ee*-z;if(fe.matrixWorld.decompose(oe.position,oe.quaternion,oe.scale),oe.translateX(te),oe.translateZ(ee),oe.matrixWorld.compose(oe.position,oe.quaternion,oe.scale),oe.matrixWorldInverse.copy(oe.matrixWorld).invert(),De[10]===-1)oe.projectionMatrix.copy(fe.projectionMatrix),oe.projectionMatrixInverse.copy(fe.projectionMatrixInverse);else{const le=L+ee,T=U+ee,b=C-te,F=ce+(Ne-te),K=O*U/T*le,ae=G*U/T*le;oe.projectionMatrix.makePerspective(b,F,K,ae,le,T),oe.projectionMatrixInverse.copy(oe.projectionMatrix).invert()}}function pe(oe,fe){fe===null?oe.matrixWorld.copy(oe.matrix):oe.matrixWorld.multiplyMatrices(fe.matrixWorld,oe.matrix),oe.matrixWorldInverse.copy(oe.matrixWorld).invert()}this.updateCamera=function(oe){if(r===null)return;let fe=oe.near,Ie=oe.far;m.texture!==null&&(m.depthNear>0&&(fe=m.depthNear),m.depthFar>0&&(Ie=m.depthFar)),B.near=w.near=S.near=fe,B.far=w.far=S.far=Ie,(W!==B.near||Z!==B.far)&&(r.updateRenderState({depthNear:B.near,depthFar:B.far}),W=B.near,Z=B.far),B.layers.mask=oe.layers.mask|6,S.layers.mask=B.layers.mask&3,w.layers.mask=B.layers.mask&5;const Ne=oe.parent,De=B.cameras;pe(B,Ne);for(let mt=0;mt0&&(m.alphaTest.value=p.alphaTest);const _=e.get(p),x=_.envMap,y=_.envMapRotation;x&&(m.envMap.value=x,Ls.copy(y),Ls.x*=-1,Ls.y*=-1,Ls.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(Ls.y*=-1,Ls.z*=-1),m.envMapRotation.value.setFromMatrix4(QI.makeRotationFromEuler(Ls)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=p.reflectivity,m.ior.value=p.ior,m.refractionRatio.value=p.refractionRatio),p.lightMap&&(m.lightMap.value=p.lightMap,m.lightMapIntensity.value=p.lightMapIntensity,n(p.lightMap,m.lightMapTransform)),p.aoMap&&(m.aoMap.value=p.aoMap,m.aoMapIntensity.value=p.aoMapIntensity,n(p.aoMap,m.aoMapTransform))}function o(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform))}function a(m,p){m.dashSize.value=p.dashSize,m.totalSize.value=p.dashSize+p.gapSize,m.scale.value=p.scale}function l(m,p,_,x){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.size.value=p.size*_,m.scale.value=x*.5,p.map&&(m.map.value=p.map,n(p.map,m.uvTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function c(m,p){m.diffuse.value.copy(p.color),m.opacity.value=p.opacity,m.rotation.value=p.rotation,p.map&&(m.map.value=p.map,n(p.map,m.mapTransform)),p.alphaMap&&(m.alphaMap.value=p.alphaMap,n(p.alphaMap,m.alphaMapTransform)),p.alphaTest>0&&(m.alphaTest.value=p.alphaTest)}function u(m,p){m.specular.value.copy(p.specular),m.shininess.value=Math.max(p.shininess,1e-4)}function d(m,p){p.gradientMap&&(m.gradientMap.value=p.gradientMap)}function f(m,p){m.metalness.value=p.metalness,p.metalnessMap&&(m.metalnessMap.value=p.metalnessMap,n(p.metalnessMap,m.metalnessMapTransform)),m.roughness.value=p.roughness,p.roughnessMap&&(m.roughnessMap.value=p.roughnessMap,n(p.roughnessMap,m.roughnessMapTransform)),p.envMap&&(m.envMapIntensity.value=p.envMapIntensity)}function h(m,p,_){m.ior.value=p.ior,p.sheen>0&&(m.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),m.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(m.sheenColorMap.value=p.sheenColorMap,n(p.sheenColorMap,m.sheenColorMapTransform)),p.sheenRoughnessMap&&(m.sheenRoughnessMap.value=p.sheenRoughnessMap,n(p.sheenRoughnessMap,m.sheenRoughnessMapTransform))),p.clearcoat>0&&(m.clearcoat.value=p.clearcoat,m.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(m.clearcoatMap.value=p.clearcoatMap,n(p.clearcoatMap,m.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,n(p.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(m.clearcoatNormalMap.value=p.clearcoatNormalMap,n(p.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Nn&&m.clearcoatNormalScale.value.negate())),p.dispersion>0&&(m.dispersion.value=p.dispersion),p.iridescence>0&&(m.iridescence.value=p.iridescence,m.iridescenceIOR.value=p.iridescenceIOR,m.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(m.iridescenceMap.value=p.iridescenceMap,n(p.iridescenceMap,m.iridescenceMapTransform)),p.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=p.iridescenceThicknessMap,n(p.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),p.transmission>0&&(m.transmission.value=p.transmission,m.transmissionSamplerMap.value=_.texture,m.transmissionSamplerSize.value.set(_.width,_.height),p.transmissionMap&&(m.transmissionMap.value=p.transmissionMap,n(p.transmissionMap,m.transmissionMapTransform)),m.thickness.value=p.thickness,p.thicknessMap&&(m.thicknessMap.value=p.thicknessMap,n(p.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=p.attenuationDistance,m.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(m.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(m.anisotropyMap.value=p.anisotropyMap,n(p.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=p.specularIntensity,m.specularColor.value.copy(p.specularColor),p.specularColorMap&&(m.specularColorMap.value=p.specularColorMap,n(p.specularColorMap,m.specularColorMapTransform)),p.specularIntensityMap&&(m.specularIntensityMap.value=p.specularIntensityMap,n(p.specularIntensityMap,m.specularIntensityMapTransform))}function g(m,p){p.matcap&&(m.matcap.value=p.matcap)}function v(m,p){const _=e.get(p).light;m.referencePosition.value.setFromMatrixPosition(_.matrixWorld),m.nearDistance.value=_.shadow.camera.near,m.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function tN(t,e,n,i){let r={},s={},o=[];const a=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function l(_,x){const y=x.program;i.uniformBlockBinding(_,y)}function c(_,x){let y=r[_.id];y===void 0&&(g(_),y=u(_),r[_.id]=y,_.addEventListener("dispose",m));const E=x.program;i.updateUBOMapping(_,E);const A=e.render.frame;s[_.id]!==A&&(f(_),s[_.id]=A)}function u(_){const x=d();_.__bindingPointIndex=x;const y=t.createBuffer(),E=_.__size,A=_.usage;return t.bindBuffer(t.UNIFORM_BUFFER,y),t.bufferData(t.UNIFORM_BUFFER,E,A),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,x,y),y}function d(){for(let _=0;_0&&(y+=E-A),_.__size=y,_.__cache={},this}function v(_){const x={boundary:0,storage:0};return typeof _=="number"||typeof _=="boolean"?(x.boundary=4,x.storage=4):_.isVector2?(x.boundary=8,x.storage=8):_.isVector3||_.isColor?(x.boundary=16,x.storage=12):_.isVector4?(x.boundary=16,x.storage=16):_.isMatrix3?(x.boundary=48,x.storage=48):_.isMatrix4?(x.boundary=64,x.storage=64):_.isTexture?nt("WebGLRenderer: Texture samplers can not be part of an uniforms group."):nt("WebGLRenderer: Unsupported uniform value type.",_),x}function m(_){const x=_.target;x.removeEventListener("dispose",m);const y=o.indexOf(x.__bindingPointIndex);o.splice(y,1),t.deleteBuffer(r[x.id]),delete r[x.id],delete s[x.id]}function p(){for(const _ in r)t.deleteBuffer(r[_]);o=[],r={},s={}}return{bind:l,update:c,dispose:p}}const nN=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Bi=null;function iN(){return Bi===null&&(Bi=new sP(nN,16,16,Zo,Or),Bi.name="DFG_LUT",Bi.minFilter=Dn,Bi.magFilter=Dn,Bi.wrapS=Sr,Bi.wrapT=Sr,Bi.generateMipmaps=!1,Bi.needsUpdate=!0),Bi}class rN{constructor(e={}){const{canvas:n=_C(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1,reversedDepthBuffer:f=!1,outputBufferType:h=ni}=e;this.isWebGLRenderer=!0;let g;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=i.getContextAttributes().alpha}else g=o;const v=h,m=new Set([Np,Ip,Dp]),p=new Set([ni,tr,ja,Qa,Pp,Rp]),_=new Uint32Array(4),x=new Int32Array(4);let y=null,E=null;const A=[],P=[];let D=null;this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Zi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const S=this;let w=!1;this._outputColorSpace=Qn;let N=0,B=0,W=null,Z=-1,X=null;const H=new jt,k=new jt;let J=null;const ue=new st(0);let Y=0,pe=n.width,Ge=n.height,Ze=1,xt=null,at=null;const oe=new jt(0,0,pe,Ge),fe=new jt(0,0,pe,Ge);let Ie=!1;const Ne=new Bp;let De=!1,mt=!1;const L=new yt,U=new I,O=new jt,G={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let z=!1;function $(){return W===null?Ze:1}let C=i;function ce(R,q){return n.getContext(R,q)}try{const R={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${Tp}`),n.addEventListener("webglcontextlost",ct,!1),n.addEventListener("webglcontextrestored",Gt,!1),n.addEventListener("webglcontextcreationerror",Pt,!1),C===null){const q="webgl2";if(C=ce(q,R),C===null)throw ce(q)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(R){throw St("WebGLRenderer: "+R.message),R}let ee,te,le,T,b,F,K,ae,j,Ae,ve,Le,Ye,ge,Me,Ce,ke,we,dt,V,Ue,ye,ze,_e;function he(){ee=new iD(C),ee.init(),ye=new YI(C,ee),te=new Y3(C,ee,e,ye),le=new XI(C,ee),te.reversedDepthBuffer&&f&&le.buffers.depth.setReversed(!0),T=new oD(C),b=new DI,F=new $I(C,ee,le,b,te,ye,T),K=new K3(S),ae=new nD(S),j=new u2(C),ze=new X3(C,j),Ae=new rD(C,j,T,ze),ve=new lD(C,Ae,j,T),dt=new aD(C,te,F),Ce=new J3(b),Le=new RI(S,K,ae,ee,te,ze,Ce),Ye=new eN(S,b),ge=new NI,Me=new BI(ee),we=new q3(S,K,ae,le,ve,g,l),ke=new WI(S,ve,te),_e=new tN(C,T,te,le),V=new $3(C,ee,T),Ue=new sD(C,ee,T),T.programs=Le.programs,S.capabilities=te,S.extensions=ee,S.properties=b,S.renderLists=ge,S.shadowMap=ke,S.state=le,S.info=T}he(),v!==ni&&(D=new uD(v,n.width,n.height,r,s));const Ee=new jI(S,C);this.xr=Ee,this.getContext=function(){return C},this.getContextAttributes=function(){return C.getContextAttributes()},this.forceContextLoss=function(){const R=ee.get("WEBGL_lose_context");R&&R.loseContext()},this.forceContextRestore=function(){const R=ee.get("WEBGL_lose_context");R&&R.restoreContext()},this.getPixelRatio=function(){return Ze},this.setPixelRatio=function(R){R!==void 0&&(Ze=R,this.setSize(pe,Ge,!1))},this.getSize=function(R){return R.set(pe,Ge)},this.setSize=function(R,q,se=!0){if(Ee.isPresenting){nt("WebGLRenderer: Can't change size while VR device is presenting.");return}pe=R,Ge=q,n.width=Math.floor(R*Ze),n.height=Math.floor(q*Ze),se===!0&&(n.style.width=R+"px",n.style.height=q+"px"),D!==null&&D.setSize(n.width,n.height),this.setViewport(0,0,R,q)},this.getDrawingBufferSize=function(R){return R.set(pe*Ze,Ge*Ze).floor()},this.setDrawingBufferSize=function(R,q,se){pe=R,Ge=q,Ze=se,n.width=Math.floor(R*se),n.height=Math.floor(q*se),this.setViewport(0,0,R,q)},this.setEffects=function(R){if(v===ni){console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(R){for(let q=0;q{function Pe(){if(ne.forEach(function(We){b.get(We).currentProgram.isReady()&&ne.delete(We)}),ne.size===0){Q(R);return}setTimeout(Pe,10)}ee.get("KHR_parallel_shader_compile")!==null?Pe():setTimeout(Pe,10)})};let Uu=null;function Ob(R){Uu&&Uu(R)}function om(){Ss.stop()}function am(){Ss.start()}const Ss=new hb;Ss.setAnimationLoop(Ob),typeof self<"u"&&Ss.setContext(self),this.setAnimationLoop=function(R){Uu=R,Ee.setAnimationLoop(R),R===null?Ss.stop():Ss.start()},Ee.addEventListener("sessionstart",om),Ee.addEventListener("sessionend",am),this.render=function(R,q){if(q!==void 0&&q.isCamera!==!0){St("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;const se=Ee.enabled===!0&&Ee.isPresenting===!0,ne=D!==null&&(W===null||se)&&D.begin(S,W);if(R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),q.parent===null&&q.matrixWorldAutoUpdate===!0&&q.updateMatrixWorld(),Ee.enabled===!0&&Ee.isPresenting===!0&&(D===null||D.isCompositing()===!1)&&(Ee.cameraAutoUpdate===!0&&Ee.updateCamera(q),q=Ee.getCamera()),R.isScene===!0&&R.onBeforeRender(S,R,q,W),E=Me.get(R,P.length),E.init(q),P.push(E),L.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Ne.setFromProjectionMatrix(L,Yi,q.reversedDepth),mt=this.localClippingEnabled,De=Ce.init(this.clippingPlanes,mt),y=ge.get(R,A.length),y.init(),A.push(y),Ee.enabled===!0&&Ee.isPresenting===!0){const We=S.xr.getDepthSensingMesh();We!==null&&ku(We,q,-1/0,S.sortObjects)}ku(R,q,0,S.sortObjects),y.finish(),S.sortObjects===!0&&y.sort(xt,at),z=Ee.enabled===!1||Ee.isPresenting===!1||Ee.hasDepthSensing()===!1,z&&we.addToRenderList(y,R),this.info.render.frame++,De===!0&&Ce.beginShadows();const Q=E.state.shadowsArray;if(ke.render(Q,R,q),De===!0&&Ce.endShadows(),this.info.autoReset===!0&&this.info.reset(),(ne&&D.hasRenderPass())===!1){const We=y.opaque,Oe=y.transmissive;if(E.setupLights(),q.isArrayCamera){const Xe=q.cameras;if(Oe.length>0)for(let Ke=0,rt=Xe.length;Ke0&&cm(We,Oe,R,q),z&&we.render(R),lm(y,R,q)}W!==null&&B===0&&(F.updateMultisampleRenderTarget(W),F.updateRenderTargetMipmap(W)),ne&&D.end(S),R.isScene===!0&&R.onAfterRender(S,R,q),ze.resetDefaultState(),Z=-1,X=null,P.pop(),P.length>0?(E=P[P.length-1],De===!0&&Ce.setGlobalState(S.clippingPlanes,E.state.camera)):E=null,A.pop(),A.length>0?y=A[A.length-1]:y=null};function ku(R,q,se,ne){if(R.visible===!1)return;if(R.layers.test(q.layers)){if(R.isGroup)se=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(q);else if(R.isLight)E.pushLight(R),R.castShadow&&E.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||Ne.intersectsSprite(R)){ne&&O.setFromMatrixPosition(R.matrixWorld).applyMatrix4(L);const We=ve.update(R),Oe=R.material;Oe.visible&&y.push(R,We,Oe,se,O.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||Ne.intersectsObject(R))){const We=ve.update(R),Oe=R.material;if(ne&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),O.copy(R.boundingSphere.center)):(We.boundingSphere===null&&We.computeBoundingSphere(),O.copy(We.boundingSphere.center)),O.applyMatrix4(R.matrixWorld).applyMatrix4(L)),Array.isArray(Oe)){const Xe=We.groups;for(let Ke=0,rt=Xe.length;Ke0&&yl(Q,q,se),Pe.length>0&&yl(Pe,q,se),We.length>0&&yl(We,q,se),le.buffers.depth.setTest(!0),le.buffers.depth.setMask(!0),le.buffers.color.setMask(!0),le.setPolygonOffset(!1)}function cm(R,q,se,ne){if((se.isScene===!0?se.overrideMaterial:null)!==null)return;if(E.state.transmissionRenderTarget[ne.id]===void 0){const _t=ee.has("EXT_color_buffer_half_float")||ee.has("EXT_color_buffer_float");E.state.transmissionRenderTarget[ne.id]=new ji(1,1,{generateMipmaps:!0,type:_t?Or:ni,minFilter:Hs,samples:te.samples,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:wt.workingColorSpace})}const Pe=E.state.transmissionRenderTarget[ne.id],We=ne.viewport||H;Pe.setSize(We.z*S.transmissionResolutionScale,We.w*S.transmissionResolutionScale);const Oe=S.getRenderTarget(),Xe=S.getActiveCubeFace(),Ke=S.getActiveMipmapLevel();S.setRenderTarget(Pe),S.getClearColor(ue),Y=S.getClearAlpha(),Y<1&&S.setClearColor(16777215,.5),S.clear(),z&&we.render(se);const rt=S.toneMapping;S.toneMapping=Zi;const et=ne.viewport;if(ne.viewport!==void 0&&(ne.viewport=void 0),E.setupLightsView(ne),De===!0&&Ce.setGlobalState(S.clippingPlanes,ne),yl(R,se,ne),F.updateMultisampleRenderTarget(Pe),F.updateRenderTargetMipmap(Pe),ee.has("WEBGL_multisampled_render_to_texture")===!1){let _t=!1;for(let Lt=0,Jt=q.length;Lt0),et=!!se.morphAttributes.position,_t=!!se.morphAttributes.normal,Lt=!!se.morphAttributes.color;let Jt=Zi;ne.toneMapped&&(W===null||W.isXRRenderTarget===!0)&&(Jt=S.toneMapping);const Kt=se.morphAttributes.position||se.morphAttributes.normal||se.morphAttributes.color,kt=Kt!==void 0?Kt.length:0,tt=b.get(ne),Rt=E.state.lights;if(De===!0&&(mt===!0||R!==X)){const On=R===X&&ne.id===Z;Ce.setState(ne,R,On)}let Et=!1;ne.version===tt.__version?(tt.needsLights&&tt.lightsStateVersion!==Rt.state.version||tt.outputColorSpace!==Oe||Q.isBatchedMesh&&tt.batching===!1||!Q.isBatchedMesh&&tt.batching===!0||Q.isBatchedMesh&&tt.batchingColor===!0&&Q.colorTexture===null||Q.isBatchedMesh&&tt.batchingColor===!1&&Q.colorTexture!==null||Q.isInstancedMesh&&tt.instancing===!1||!Q.isInstancedMesh&&tt.instancing===!0||Q.isSkinnedMesh&&tt.skinning===!1||!Q.isSkinnedMesh&&tt.skinning===!0||Q.isInstancedMesh&&tt.instancingColor===!0&&Q.instanceColor===null||Q.isInstancedMesh&&tt.instancingColor===!1&&Q.instanceColor!==null||Q.isInstancedMesh&&tt.instancingMorph===!0&&Q.morphTexture===null||Q.isInstancedMesh&&tt.instancingMorph===!1&&Q.morphTexture!==null||tt.envMap!==Xe||ne.fog===!0&&tt.fog!==Pe||tt.numClippingPlanes!==void 0&&(tt.numClippingPlanes!==Ce.numPlanes||tt.numIntersection!==Ce.numIntersection)||tt.vertexAlphas!==Ke||tt.vertexTangents!==rt||tt.morphTargets!==et||tt.morphNormals!==_t||tt.morphColors!==Lt||tt.toneMapping!==Jt||tt.morphTargetsCount!==kt)&&(Et=!0):(Et=!0,tt.__version=ne.version);let Jn=tt.currentProgram;Et===!0&&(Jn=bl(ne,q,Q));let lo=!1,Kn=!1,ca=!1;const Wt=Jn.getUniforms(),Hn=tt.uniforms;if(le.useProgram(Jn.program)&&(lo=!0,Kn=!0,ca=!0),ne.id!==Z&&(Z=ne.id,Kn=!0),lo||X!==R){le.buffers.depth.getReversed()&&R.reversedDepth!==!0&&(R._reversedDepth=!0,R.updateProjectionMatrix()),Wt.setValue(C,"projectionMatrix",R.projectionMatrix),Wt.setValue(C,"viewMatrix",R.matrixWorldInverse);const Gn=Wt.map.cameraPosition;Gn!==void 0&&Gn.setValue(C,U.setFromMatrixPosition(R.matrixWorld)),te.logarithmicDepthBuffer&&Wt.setValue(C,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(ne.isMeshPhongMaterial||ne.isMeshToonMaterial||ne.isMeshLambertMaterial||ne.isMeshBasicMaterial||ne.isMeshStandardMaterial||ne.isShaderMaterial)&&Wt.setValue(C,"isOrthographic",R.isOrthographicCamera===!0),X!==R&&(X=R,Kn=!0,ca=!0)}if(tt.needsLights&&(Rt.state.directionalShadowMap.length>0&&Wt.setValue(C,"directionalShadowMap",Rt.state.directionalShadowMap,F),Rt.state.spotShadowMap.length>0&&Wt.setValue(C,"spotShadowMap",Rt.state.spotShadowMap,F),Rt.state.pointShadowMap.length>0&&Wt.setValue(C,"pointShadowMap",Rt.state.pointShadowMap,F)),Q.isSkinnedMesh){Wt.setOptional(C,Q,"bindMatrix"),Wt.setOptional(C,Q,"bindMatrixInverse");const On=Q.skeleton;On&&(On.boneTexture===null&&On.computeBoneTexture(),Wt.setValue(C,"boneTexture",On.boneTexture,F))}Q.isBatchedMesh&&(Wt.setOptional(C,Q,"batchingTexture"),Wt.setValue(C,"batchingTexture",Q._matricesTexture,F),Wt.setOptional(C,Q,"batchingIdTexture"),Wt.setValue(C,"batchingIdTexture",Q._indirectTexture,F),Wt.setOptional(C,Q,"batchingColorTexture"),Q._colorsTexture!==null&&Wt.setValue(C,"batchingColorTexture",Q._colorsTexture,F));const li=se.morphAttributes;if((li.position!==void 0||li.normal!==void 0||li.color!==void 0)&&dt.update(Q,se,Jn),(Kn||tt.receiveShadow!==Q.receiveShadow)&&(tt.receiveShadow=Q.receiveShadow,Wt.setValue(C,"receiveShadow",Q.receiveShadow)),ne.isMeshGouraudMaterial&&ne.envMap!==null&&(Hn.envMap.value=Xe,Hn.flipEnvMap.value=Xe.isCubeTexture&&Xe.isRenderTargetTexture===!1?-1:1),ne.isMeshStandardMaterial&&ne.envMap===null&&q.environment!==null&&(Hn.envMapIntensity.value=q.environmentIntensity),Hn.dfgLUT!==void 0&&(Hn.dfgLUT.value=iN()),Kn&&(Wt.setValue(C,"toneMappingExposure",S.toneMappingExposure),tt.needsLights&&Ub(Hn,ca),Pe&&ne.fog===!0&&Ye.refreshFogUniforms(Hn,Pe),Ye.refreshMaterialUniforms(Hn,ne,Ze,Ge,E.state.transmissionRenderTarget[R.id]),Dc.upload(C,dm(tt),Hn,F)),ne.isShaderMaterial&&ne.uniformsNeedUpdate===!0&&(Dc.upload(C,dm(tt),Hn,F),ne.uniformsNeedUpdate=!1),ne.isSpriteMaterial&&Wt.setValue(C,"center",Q.center),Wt.setValue(C,"modelViewMatrix",Q.modelViewMatrix),Wt.setValue(C,"normalMatrix",Q.normalMatrix),Wt.setValue(C,"modelMatrix",Q.matrixWorld),ne.isShaderMaterial||ne.isRawShaderMaterial){const On=ne.uniformsGroups;for(let Gn=0,Bu=On.length;Gn0&&F.useMultisampledRTT(R)===!1?ne=b.get(R).__webglMultisampledFramebuffer:Array.isArray(Ke)?ne=Ke[se]:ne=Ke,H.copy(R.viewport),k.copy(R.scissor),J=R.scissorTest}else H.copy(oe).multiplyScalar(Ze).floor(),k.copy(fe).multiplyScalar(Ze).floor(),J=Ie;if(se!==0&&(ne=Bb),le.bindFramebuffer(C.FRAMEBUFFER,ne)&&le.drawBuffers(R,ne),le.viewport(H),le.scissor(k),le.setScissorTest(J),Q){const Oe=b.get(R.texture);C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_CUBE_MAP_POSITIVE_X+q,Oe.__webglTexture,se)}else if(Pe){const Oe=q;for(let Xe=0;Xe=0&&q<=R.width-ne&&se>=0&&se<=R.height-Q&&(R.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Oe),C.readPixels(q,se,ne,Q,ye.convert(rt),ye.convert(et),Pe))}finally{const Ke=W!==null?b.get(W).__webglFramebuffer:null;le.bindFramebuffer(C.FRAMEBUFFER,Ke)}}},this.readRenderTargetPixelsAsync=async function(R,q,se,ne,Q,Pe,We,Oe=0){if(!(R&&R.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Xe=b.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&We!==void 0&&(Xe=Xe[We]),Xe)if(q>=0&&q<=R.width-ne&&se>=0&&se<=R.height-Q){le.bindFramebuffer(C.FRAMEBUFFER,Xe);const Ke=R.textures[Oe],rt=Ke.format,et=Ke.type;if(!te.textureFormatReadable(rt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!te.textureTypeReadable(et))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const _t=C.createBuffer();C.bindBuffer(C.PIXEL_PACK_BUFFER,_t),C.bufferData(C.PIXEL_PACK_BUFFER,Pe.byteLength,C.STREAM_READ),R.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Oe),C.readPixels(q,se,ne,Q,ye.convert(rt),ye.convert(et),0);const Lt=W!==null?b.get(W).__webglFramebuffer:null;le.bindFramebuffer(C.FRAMEBUFFER,Lt);const Jt=C.fenceSync(C.SYNC_GPU_COMMANDS_COMPLETE,0);return C.flush(),await xC(C,Jt,4),C.bindBuffer(C.PIXEL_PACK_BUFFER,_t),C.getBufferSubData(C.PIXEL_PACK_BUFFER,0,Pe),C.deleteBuffer(_t),C.deleteSync(Jt),Pe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(R,q=null,se=0){const ne=Math.pow(2,-se),Q=Math.floor(R.image.width*ne),Pe=Math.floor(R.image.height*ne),We=q!==null?q.x:0,Oe=q!==null?q.y:0;F.setTexture2D(R,0),C.copyTexSubImage2D(C.TEXTURE_2D,se,0,0,We,Oe,Q,Pe),le.unbindTexture()};const zb=C.createFramebuffer(),Vb=C.createFramebuffer();this.copyTextureToTexture=function(R,q,se=null,ne=null,Q=0,Pe=null){Pe===null&&(Q!==0?(el("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Pe=Q,Q=0):Pe=0);let We,Oe,Xe,Ke,rt,et,_t,Lt,Jt;const Kt=R.isCompressedTexture?R.mipmaps[Pe]:R.image;if(se!==null)We=se.max.x-se.min.x,Oe=se.max.y-se.min.y,Xe=se.isBox3?se.max.z-se.min.z:1,Ke=se.min.x,rt=se.min.y,et=se.isBox3?se.min.z:0;else{const li=Math.pow(2,-Q);We=Math.floor(Kt.width*li),Oe=Math.floor(Kt.height*li),R.isDataArrayTexture?Xe=Kt.depth:R.isData3DTexture?Xe=Math.floor(Kt.depth*li):Xe=1,Ke=0,rt=0,et=0}ne!==null?(_t=ne.x,Lt=ne.y,Jt=ne.z):(_t=0,Lt=0,Jt=0);const kt=ye.convert(q.format),tt=ye.convert(q.type);let Rt;q.isData3DTexture?(F.setTexture3D(q,0),Rt=C.TEXTURE_3D):q.isDataArrayTexture||q.isCompressedArrayTexture?(F.setTexture2DArray(q,0),Rt=C.TEXTURE_2D_ARRAY):(F.setTexture2D(q,0),Rt=C.TEXTURE_2D),C.pixelStorei(C.UNPACK_FLIP_Y_WEBGL,q.flipY),C.pixelStorei(C.UNPACK_PREMULTIPLY_ALPHA_WEBGL,q.premultiplyAlpha),C.pixelStorei(C.UNPACK_ALIGNMENT,q.unpackAlignment);const Et=C.getParameter(C.UNPACK_ROW_LENGTH),Jn=C.getParameter(C.UNPACK_IMAGE_HEIGHT),lo=C.getParameter(C.UNPACK_SKIP_PIXELS),Kn=C.getParameter(C.UNPACK_SKIP_ROWS),ca=C.getParameter(C.UNPACK_SKIP_IMAGES);C.pixelStorei(C.UNPACK_ROW_LENGTH,Kt.width),C.pixelStorei(C.UNPACK_IMAGE_HEIGHT,Kt.height),C.pixelStorei(C.UNPACK_SKIP_PIXELS,Ke),C.pixelStorei(C.UNPACK_SKIP_ROWS,rt),C.pixelStorei(C.UNPACK_SKIP_IMAGES,et);const Wt=R.isDataArrayTexture||R.isData3DTexture,Hn=q.isDataArrayTexture||q.isData3DTexture;if(R.isDepthTexture){const li=b.get(R),On=b.get(q),Gn=b.get(li.__renderTarget),Bu=b.get(On.__renderTarget);le.bindFramebuffer(C.READ_FRAMEBUFFER,Gn.__webglFramebuffer),le.bindFramebuffer(C.DRAW_FRAMEBUFFER,Bu.__webglFramebuffer);for(let ws=0;ws>>3){case 1:{if(s===8){r.indices.push(n.uint32());continue}if(s===10){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):[]}},toJSON(t){const e={};return t.indices?.length&&(e.indices=t.indices.map(n=>Math.round(n))),e},create(t){return as.fromPartial(t??{})},fromPartial(t){const e=Rv();return e.indices=t.indices?.map(n=>n)||[],e}};function Dv(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const em={encode(t,e=new ft){t.guid!==void 0&&e.uint32(10).string(t.guid),t.name!==void 0&&e.uint32(18).string(t.name);for(const n of t.vertices)Je.encode(n,e.uint32(26).fork()).join();for(const n of t.faces)as.encode(n,e.uint32(34).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Dv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.vertices.push(Je.decode(n,n.uint32()));continue}case 4:{if(s!==34)break;r.faces.push(as.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:tu(t.guid)?globalThis.String(t.guid):void 0,name:tu(t.name)?globalThis.String(t.name):void 0,vertices:globalThis.Array.isArray(t?.vertices)?t.vertices.map(e=>Je.fromJSON(e)):[],faces:globalThis.Array.isArray(t?.faces)?t.faces.map(e=>as.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==void 0&&(e.guid=t.guid),t.name!==void 0&&(e.name=t.name),t.vertices?.length&&(e.vertices=t.vertices.map(n=>Je.toJSON(n))),t.faces?.length&&(e.faces=t.faces.map(n=>as.toJSON(n))),e},create(t){return em.fromPartial(t??{})},fromPartial(t){const e=Dv();return e.guid=t.guid??void 0,e.name=t.name??void 0,e.vertices=t.vertices?.map(n=>Je.fromPartial(n))||[],e.faces=t.faces?.map(n=>as.fromPartial(n))||[],e}};function Iv(){return{vertexIndices:[]}}const ls={encode(t,e=new ft){e.uint32(10).fork();for(const n of t.vertexIndices)e.int32(n);return e.join(),e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Iv();for(;n.pos>>3){case 1:{if(s===8){r.vertexIndices.push(n.int32());continue}if(s===10){const o=n.uint32()+n.pos;for(;n.posglobalThis.Number(e)):globalThis.Array.isArray(t?.vertex_indices)?t.vertex_indices.map(e=>globalThis.Number(e)):[]}},toJSON(t){const e={};return t.vertexIndices?.length&&(e.vertexIndices=t.vertexIndices.map(n=>Math.round(n))),e},create(t){return ls.fromPartial(t??{})},fromPartial(t){const e=Iv();return e.vertexIndices=t.vertexIndices?.map(n=>n)||[],e}};function Nv(){return{guid:void 0,name:void 0,vertices:[],faces:[]}}const tm={encode(t,e=new ft){t.guid!==void 0&&e.uint32(10).string(t.guid),t.name!==void 0&&e.uint32(18).string(t.name);for(const n of t.vertices)Je.encode(n,e.uint32(26).fork()).join();for(const n of t.faces)ls.encode(n,e.uint32(34).fork()).join();return e},decode(t,e){const n=t instanceof Se?t:new Se(t),i=e===void 0?n.len:n.pos+e,r=Nv();for(;n.pos>>3){case 1:{if(s!==10)break;r.guid=n.string();continue}case 2:{if(s!==18)break;r.name=n.string();continue}case 3:{if(s!==26)break;r.vertices.push(Je.decode(n,n.uint32()));continue}case 4:{if(s!==34)break;r.faces.push(ls.decode(n,n.uint32()));continue}}if((s&7)===4||s===0)break;n.skip(s&7)}return r},fromJSON(t){return{guid:tu(t.guid)?globalThis.String(t.guid):void 0,name:tu(t.name)?globalThis.String(t.name):void 0,vertices:globalThis.Array.isArray(t?.vertices)?t.vertices.map(e=>Je.fromJSON(e)):[],faces:globalThis.Array.isArray(t?.faces)?t.faces.map(e=>ls.fromJSON(e)):[]}},toJSON(t){const e={};return t.guid!==void 0&&(e.guid=t.guid),t.name!==void 0&&(e.name=t.name),t.vertices?.length&&(e.vertices=t.vertices.map(n=>Je.toJSON(n))),t.faces?.length&&(e.faces=t.faces.map(n=>ls.toJSON(n))),e},create(t){return tm.fromPartial(t??{})},fromPartial(t){const e=Nv();return e.guid=t.guid??void 0,e.name=t.name??void 0,e.vertices=t.vertices?.map(n=>Je.fromPartial(n))||[],e.faces=t.faces?.map(n=>ls.fromPartial(n))||[],e}};function tu(t){return t!=null}class DL{data;constructor(e){let n;if("bytes"in e?n=IL(e.bytes):n=e.data,!n.vertexIndices)throw new Error("Invalid FaceData: Missing required property 'vertices'.");this.data=n}get bytes(){return NL(this.data)}get vertexIndices(){return this.data.vertexIndices}}function IL(t){return ls.decode(t)}function NL(t){return ls.encode(t).finish()}class LL{data;_points;_faces;constructor(e){let n;if("bytes"in e?n=OL(e.bytes):n=e.data,!n.vertices||!n.faces)throw new Error("Invalid PolyhedronData: Missing required properties (vertices or faces).");this.data=n}get bytes(){return FL(this.data)}get guid(){return this.data.guid?this.data.guid:""}get name(){return this.data.name?this.data.name:""}get vertices(){if(!this._points){this._points=[];for(const e of this.data.vertices){const n=new mi({data:e});this._points.push(n)}}return this._points}get faces(){if(!this._faces){this._faces=[];for(const e of this.data.faces){const n=new DL({data:e});this._faces.push(n)}}return this._faces}buildGeometry(){const e=new bt,n=new Float32Array(this.vertices.length*3);for(let o=0;on&&l.add(N)}l.normalize(),g.setXYZ(p+E,l.x,l.y,l.z)}}return u.setAttribute("normal",g),u}class VL{data;_vertices;constructor(e){let n;if("bytes"in e?n=HL(e.bytes):n=e.data,!n.vertices||!n.faces)throw new Error("Invalid MeshData: Missing required properties (vertices or faces).");this.data=n}get bytes(){return GL(this.data)}get guid(){return this.data.guid?this.data.guid:""}get name(){return this.data.name?this.data.name:""}get vertices(){if(!this._vertices){this._vertices=[];for(const e of this.data.vertices){const n=new mi({data:e});this._vertices.push(n)}}return this._vertices}get faces(){const e=[];for(const n of this.data.faces){const i=new UL({data:n});e.push(i)}return e}buildGeometry(){let e=new bt;const n=new Float32Array(this.vertices.length*3);this.vertices.forEach((o,a)=>{n[a*3]=o.x,n[a*3+1]=o.y,n[a*3+2]=o.z});const i=[];for(const o of this.faces){const a=o.indices;for(let l=1;lMath.PI&&(i-=Wn),r<-Math.PI?r+=Wn:r>Math.PI&&(r-=Wn),i<=r?this._spherical.theta=Math.max(i,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(i+r)/2?Math.max(i,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const o=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=o!=this._spherical.radius}if(cn.setFromSpherical(this._spherical),cn.applyQuaternion(this._quatInverse),n.copy(this.target).add(cn),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let o=null;if(this.object.isPerspectiveCamera){const a=cn.length();o=this._clampDistance(a*this._scale);const l=a-o;this.object.position.addScaledVector(this._dollyDirection,l),this.object.updateMatrixWorld(),s=!!l}else if(this.object.isOrthographicCamera){const a=new I(this._mouse.x,this._mouse.y,0);a.unproject(this.object);const l=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=l!==this.object.zoom;const c=new I(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(a),this.object.updateMatrixWorld(),o=cn.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;o!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position):(fc.origin.copy(this.object.position),fc.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(fc.direction))Yd||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Yd||this._lastTargetPosition.distanceToSquared(this.target)>Yd?(this.dispatchEvent(Lv),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e!==null?Wn/60*this.autoRotateSpeed*e:Wn/60/60*this.autoRotateSpeed}_getZoomScale(e){const n=Math.abs(e*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,n){cn.setFromMatrixColumn(n,0),cn.multiplyScalar(-e),this._panOffset.add(cn)}_panUp(e,n){this.screenSpacePanning===!0?cn.setFromMatrixColumn(n,1):(cn.setFromMatrixColumn(n,0),cn.crossVectors(this.object.up,cn)),cn.multiplyScalar(e),this._panOffset.add(cn)}_pan(e,n){const i=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;cn.copy(r).sub(this.target);let s=cn.length();s*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*s/i.clientHeight,this.object.matrix),this._panUp(2*n*s/i.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/i.clientWidth,this.object.matrix),this._panUp(n*(this.object.top-this.object.bottom)/this.object.zoom/i.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(e,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const i=this.domElement.getBoundingClientRect(),r=e-i.left,s=n-i.top,o=i.width,a=i.height;this._mouse.x=r/o*2-1,this._mouse.y=-(s/a)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(Wn*this._rotateDelta.x/n.clientHeight),this._rotateUp(Wn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let n=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Wn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),n=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Wn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),n=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Wn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),n=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Wn*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),n=!0;break}n&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._rotateStart.set(i,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._panStart.set(i,r)}}_handleTouchStartDolly(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyStart.set(0,s)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{const i=this._getSecondPointerPosition(e),r=.5*(e.pageX+i.x),s=.5*(e.pageY+i.y);this._rotateEnd.set(r,s)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(Wn*this._rotateDelta.x/n.clientHeight),this._rotateUp(Wn*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{const n=this._getSecondPointerPosition(e),i=.5*(e.pageX+n.x),r=.5*(e.pageY+n.y);this._panEnd.set(i,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const n=this._getSecondPointerPosition(e),i=e.pageX-n.x,r=e.pageY-n.y,s=Math.sqrt(i*i+r*r);this._dollyEnd.set(0,s),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const o=(e.pageX+n.x)*.5,a=(e.pageY+n.y)*.5;this._updateZoomParameters(o,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let n=0;n.9&&(o.visible=!1)),this.axis==="Y"&&(Xt.setFromEuler(hc.set(0,0,Math.PI/2)),o.quaternion.copy(i).multiply(Xt),Math.abs(Bt.copy(ks).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(Xt.setFromEuler(hc.set(0,Math.PI/2,0)),o.quaternion.copy(i).multiply(Xt),Math.abs(Bt.copy(Ia).applyQuaternion(i).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(Xt.setFromEuler(hc.set(0,Math.PI/2,0)),Bt.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(Vv.lookAt(zv,Bt,ks)),o.quaternion.multiply(Xt),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),An.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),An.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(An),o.visible=this.dragging):(o.quaternion.copy(i),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(i),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(Bt.copy(Da).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(Bt.copy(ks).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(Bt.copy(Ia).applyQuaternion(i).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(Bt.copy(Ia).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(Bt.copy(Da).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(Bt.copy(ks).applyQuaternion(i).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(pc.copy(i),Bt.copy(this.eye).applyQuaternion(Xt.copy(i).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(Vv.lookAt(this.eye,zv,ks)),o.name==="X"&&(Xt.setFromAxisAngle(Da,Math.atan2(-Bt.y,Bt.z)),Xt.multiplyQuaternions(pc,Xt),o.quaternion.copy(Xt)),o.name==="Y"&&(Xt.setFromAxisAngle(ks,Math.atan2(Bt.x,Bt.z)),Xt.multiplyQuaternions(pc,Xt),o.quaternion.copy(Xt)),o.name==="Z"&&(Xt.setFromAxisAngle(Ia,Math.atan2(Bt.y,Bt.x)),Xt.multiplyQuaternions(pc,Xt),o.quaternion.copy(Xt))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis?(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1):this.axis.split("").some(function(l){return o.name===l})&&(o.material.color.copy(this.materialLib.active.color),o.material.opacity=1))}super.updateMatrixWorld(e)}}class vO extends be{constructor(){super(new vl(1e5,1e5,2,2),new ys({visible:!1,wireframe:!0,side:zn,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),mc.copy(Da).applyQuaternion(n==="local"?this.worldQuaternion:Ic),ya.copy(ks).applyQuaternion(n==="local"?this.worldQuaternion:Ic),ba.copy(Ia).applyQuaternion(n==="local"?this.worldQuaternion:Ic),Bt.copy(ya),this.mode){case"translate":case"scale":switch(this.axis){case"X":Bt.copy(this.eye).cross(mc),zi.copy(mc).cross(Bt);break;case"Y":Bt.copy(this.eye).cross(ya),zi.copy(ya).cross(Bt);break;case"Z":Bt.copy(this.eye).cross(ba),zi.copy(ba).cross(Bt);break;case"XY":zi.copy(ba);break;case"YZ":zi.copy(mc);break;case"XZ":Bt.copy(ba),zi.copy(ya);break;case"XYZ":case"E":zi.set(0,0,0);break}break;default:zi.set(0,0,0)}zi.length()===0?this.quaternion.copy(this.cameraQuaternion):(Hv.lookAt(An.set(0,0,0),zi,Bt),this.quaternion.setFromRotationMatrix(Hv)),super.updateMatrixWorld(e)}}const Ur={},ia={};function _O(t){let e;switch(t.type.value){case"standard_material":e=xO(t);break;case"line_material":e=yO(t);break;case"point_material":e=bO(t);break;case"physical_material":e=SO(t);break}ia[t.guid.value]=e,Ur[t.geometry_guid.value]=t.guid.value,TO(t.geometry_guid.value,e)}function xO(t){let e=t.color.value;e=e.replace("#","0x");let n=t.emissive.value;return n=n.replace("#","0x"),new aa({color:parseInt(e),metalness:t.metalness.value,roughness:t.roughness.value,emissive:parseInt(n),emissiveIntensity:t.emissive_intensity.value,flatShading:t.flat_shading.value,opacity:t.opacity.value,transparent:t.opacity.value<1,depthWrite:t.opacity.value>=1,wireframe:t.wireframe.value,side:zn})}function yO(t){let e=t.color.value;return e=e.replace("#","0x"),new xi({color:parseInt(e),opacity:t.opacity.value,transparent:t.opacity.value<1,depthWrite:t.opacity.value>=1})}function bO(t){let e=t.color.value;return e=e.replace("#","0x"),new Vp({color:parseInt(e),size:t.size.value})}function SO(t){let e=t.color.value;e=e.replace("#","0x");let n=t.emissive.value;n=n.replace("#","0x");let i=t.attenuation_color.value;i=i.replace("#","0x");let r=t.sheen_color.value;r=r.replace("#","0x");let s=t.specular_color.value;return s=s.replace("#","0x"),new qP({color:parseInt(e),metalness:t.metalness.value,roughness:t.roughness.value,emissive:parseInt(n),emissiveIntensity:t.emissive_intensity.value,flatShading:t.flat_shading.value,wireframe:t.wireframe.value,side:zn,anisotropy:t.anisotropy.value,anisotropyRotation:t.anisotropy_rotation.value,attenuationColor:parseInt(i),attenuationDistance:t.attenuation_distance.value,clearcoat:t.clearcoat.value,clearcoatRoughness:t.clearcoat_roughness.value,dispersion:t.dispersion.value,ior:t.ior.value,iridescence:t.iridescence.value,iridescenceIOR:t.iridescence_ior.value,iridescenceThicknessRange:[t.iridescence_thickness_start.value,t.iridescence_thickness_end.value],opacity:t.opacity.value,transparent:t.opacity.value<1,depthWrite:t.opacity.value>=1,reflectivity:t.reflectivity.value,sheen:t.sheen.value,sheenColor:parseInt(r),specularColor:parseInt(s),sheenRoughness:t.sheen_roughness.value,specularIntensity:t.specular_intensity.value,thickness:t.thickness.value,transmission:t.transmission.value})}const fi={},wO=["Line","Point","Vector","Frame","Plane","Polyline"];function MO(t){console.log(t.name),wO.includes(t.name)&&EO(t);const e=t.guid,n=fi[e],i=t.buildGeometry();if(!i||!(i instanceof be))return;const r=i.geometry;if(r.computeBoundingSphere(),r.computeBoundingBox(),n instanceof be){const s=n.geometry;n.geometry=r,n.position.copy(i.position),n.quaternion.copy(i.quaternion),n.scale.copy(i.scale),s&&s.dispose()}else{if(Ur[e]){const s=Ur[e];ia[s]&&(i.material=ia[s])}else i.material=new aa({color:35071,roughness:.5,metalness:.5});if(i.name=e,Vt.add(i),fi[e]=i,by.value){const s=new uP(i.geometry),o=new zp(s,new xi({color:0}));o.layers.set(1),i.add(o)}}}function EO(t){const e=t.buildGeometry(),n=t.guid;let i;if(Ur[n]){const r=Ur[n];ia[r]&&(i=ia[r])}else return;e instanceof gn||e instanceof Hp?e.material=i:(e instanceof Qp||e instanceof jp)&&e.setColor(i.color),Vt.add(e),fi[n]=e}function TO(t,e){const n=fi[t];if(n){if(n){n.material=e;return}(n instanceof Qp||n instanceof jp)&&n.setColor(e.color)}}function AO(){wi.isVisible=!0}function CO(){wi.isVisible=!1}function nu(t){delete t.dispatch,t!=null&&(wi.data=t)}document.addEventListener("keydown",t=>{(t.key==="I"||t.key==="i")&&(wi.isVisible?CO():AO())});let iu,qo,Xo,Gv=!1,Wv=!1;function Ar(t){Xo&&Xo.setMode(t)}class PO{tControl;constructor(e){if(Gv)throw new Error("TransformControlsManager has already been initialized.");this.tControl=new cO(Ft,rn.domElement),Vt.add(this.tControl.getHelper()),this.setupEventListeners(),Gv=!0}setupEventListeners(){this.tControl.addEventListener("dragging-changed",e=>{an.enabled=!e.value}),window.addEventListener("keydown",e=>{if(!(e.altKey||e.ctrlKey||e.metaKey))switch(e.key){case"w":if(!_n.value)break;Ar("translate"),Mr.value="translate";break;case"e":if(!_n.value)break;Ar("rotate"),Mr.value="rotate";break;case"r":if(!_n.value)break;Ar("scale"),Mr.value="scale";break;case"p":_n.value=!_n.value;break;case"Escape":this.tControl.detach(),nu({});break}})}get controls(){return this.tControl}}class RO{raycaster;pickedObject;constructor(){if(Wv)throw new Error("PickHelper has already been initialized.");this.raycaster=new ub,this.raycaster.layers.set(0),this.pickedObject=null,this.setupEventListeners(),Wv=!0}setupEventListeners(){window.addEventListener("keydown",e=>{e.key==="Escape"&&this.pickedObject&&(this.dehighlightObject(this.pickedObject),nu({}))}),iu={x:0,y:0},window.addEventListener("mousedown",e=>{e.button===0&&(Xo.dragging||(IO(e),this.pick(iu,Vt)))})}getPickedObject(e){this.raycaster.setFromCamera(e,Ft);const n=this.raycaster.intersectObjects(fi?Object.values(fi):[],!0);return n.length?n[0].object:null}getPickedObjectKey(e){return Object.keys(fi).find(n=>fi[n]===e)}sendMessage(e){Eb({dispatch:"object_picked",guid:e})}pick(e,n){if(!_n.value)return;const i=this.getPickedObject(e);if(i){this.pickedObject!==i&&this.pickedObject!==null&&this.dehighlightObject(this.pickedObject),this.pickedObject=i,Xo.attach(this.pickedObject);const r=this.getPickedObjectKey(this.pickedObject);this.sendMessage(r),this.highlightObject(this.pickedObject)}else this.pickedObject&&(this.dehighlightObject(this.pickedObject),this.pickedObject=null,Xo.detach(),nu({}))}dehighlightObject(e){e.savedColor&&(e.material.color.copy(e.savedColor),e.material.emissive?.set("black"),e.material.emissiveIntensity=0)}highlightObject(e){e.savedColor||(e.savedColor=e.material.color.clone()),e.material.color.set("orange"),e.material.emissive&&(e.material.emissive.set("yellow"),e.material.emissiveIntensity=.1)}}function DO(t){const e=qo.getBoundingClientRect();return{x:(t.clientX-e.left)*(qo.width/e.width),y:(t.clientY-e.top)*(qo.height/e.height)}}function IO(t){const e=DO(t);iu.x=e.x/qo.width*2-1,iu.y=e.y/qo.height*-2+1}function NO(t){return qo=document.querySelector("canvas"),Xo=new PO().controls,t}Ut.DEFAULT_UP.set(0,0,1);const Vt=new rP,Ft=new qn(60,window.innerWidth/window.innerHeight,.1,1e3);Ft.position.set(8,-15,15);Ft.zoom=1;Ft.layers.enable(1);const rn=new rN({antialias:!0});rn.setSize(window.innerWidth,window.innerHeight);rn.setPixelRatio(window.devicePixelRatio);rn.toneMapping=Ap;rn.shadowMap.enabled=!0;rn.shadowMap.type=Ty;rn.toneMappingExposure=2.5;rn.physicallyCorrectLights=!0;rn.outputColorSpace=Qn;document.body.appendChild(rn.domElement);const an=new KL(Ft,rn.domElement);an.enableDamping=!0;an.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:Js.ROTATE};const LO={top:new I(0,0,1),bottom:new I(0,0,-1),front:new I(0,-1,0),back:new I(0,1,0),left:new I(-1,0,0),right:new I(1,0,0),front_left:new I(-1,-1,1),front_right:new I(1,-1,1),back_left:new I(-1,1,1),back_right:new I(1,1,1)},OO=new Map([["Numpad5","top"],["Numpad0","bottom"],["Numpad2","front"],["Numpad8","back"],["Numpad4","left"],["Numpad6","right"],["Numpad1","front_left"],["Numpad3","front_right"],["Numpad7","back_left"],["Numpad9","back_right"]]),Sb=new db(5);Vt.add(Sb);const FO=new RO;NO(FO);let Sa=null,wa=null,qv="free";function wb(){requestAnimationFrame(wb);const t=je.cameraMode;if(t!=="free"){if(Sa||Vt.traverse(e=>{e instanceof be&&e.material&&e.material.color&&e.material.color.r===1&&e.material.color.g===0&&e.material.color.b===0&&(Sa=e)}),Sa){const e=new I;if(Sa.getWorldPosition(e),t==="look")an.target.lerp(e,.08),wa=null;else if(t==="follow"){(qv!=="follow"||!wa)&&(wa=new I().subVectors(Ft.position,an.target)),an.target.lerp(e,.08);const n=new I().addVectors(an.target,wa);Ft.position.lerp(n,.08)}}}else Sa=null,wa=null;qv=t,an.update(),rn.render(Vt,Ft)}wb();window.addEventListener("keydown",t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const e=UO(t.code);e&&(im(e),t.preventDefault())});window.addEventListener("resize",()=>{Ft.aspect=window.innerWidth/window.innerHeight,Ft.updateProjectionMatrix(),rn.setSize(window.innerWidth,window.innerHeight)});function im(t){const e=an.target.clone(),n=LO[t].clone().normalize(),i=Ft.position.distanceTo(e);Ft.position.copy(e.clone().add(n.multiplyScalar(i))),an.update()}function us(t){im(t)}function UO(t){return OO.get(t)??null}function kO(t){switch(t.type.value){case"background_color":BO(t);break;case"controls_damping":an.enableDamping=t.damping.value;break;case"world_axis":Sb.visible=t.show.value;break;case"picker":_n.value=t.enabled.value;break;case"camera_fov":Ft.fov=t.fov.value,Ft.updateProjectionMatrix();break;case"camera_zoom":Ft.zoom=t.zoom.value,Ft.updateProjectionMatrix();break;case"camera_position":Ft.position.set(t.x.value,t.y.value,t.z.value),an.update();break;case"camera_target":an.target.set(t.x.value,t.y.value,t.z.value),an.update();break;case"camera_view":{const e=t.preset.value;e&&im(e);break}case"show_edges":by.value=t.show.value;break;default:console.warn("Unknown scene type:",t.type.value)}}function BO(t){let e=t.color.value;e=e.replace("#","0x"),e=parseInt(e),Vt.background=new st(e)}function zO(t){const e=t.guid.value;if(e in fi){const n=fi[e];Vt.remove(n),delete fi[e]}e in Ur&&delete Ur[e]}function Mb(t){if(!t)return null;if(Array.isArray(t)&&t.length===16)return t;if(typeof t=="object"){const n=(t?.message||t)?.value;if(n instanceof Uint8Array){const i=[],r=new DataView(n.buffer,n.byteOffset,n.byteLength);try{for(let s=0;s<16;s++)i.push(r.getFloat64(5+s*13,!0));return i}catch{}}for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&t[i]!==null&&typeof t[i]=="object"){const r=Mb(t[i]);if(r)return r}}return null}function VO(t){const e=String(t.guid?.value||t.guid||"").trim(),n=Mb(t.matrix);let i;if(Vt.traverse(r=>{r.name&&String(r.name).trim()===e&&(i=r)}),i&&n&&n.length===16){const r=new yt;r.set(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15]),i.matrixAutoUpdate=!1,i.matrix.copy(r),i.updateMatrixWorld(!0)}}class HO extends gn{constructor(e,n){const i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new bt;r.setAttribute("position",new ut(i,3)),r.computeBoundingSphere();const s=new xi({fog:!1});super(r,s),this.light=e,this.color=n,this.type="RectAreaLightHelper";const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],a=new bt;a.setAttribute("position",new ut(o,3)),a.computeBoundingSphere(),this.add(new be(a,new ys({side:Nn,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const e=this.material.color,n=Math.max(e.r,e.g,e.b);n>1&&e.multiplyScalar(1/n),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}class Ou extends be{constructor(){const e=Ou.SkyShader,n=new Ii({name:e.name,uniforms:Jy.clone(e.uniforms),vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,side:Nn,depthWrite:!1});super(new Zt(1,1,1),n),this.isSky=!0}}Ou.SkyShader={name:"SkyShader",uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new I},up:{value:new I(0,1,0)}},vertexShader:` uniform vec3 sunPosition; uniform float rayleigh; uniform float turbidity; @@ -4163,5 +4163,5 @@ void main() { #include #include - }`};const Qt={},di={};function WO(t){t.type.value=="point_light"?qO(t):t.type.value=="spot_light"?XO(t):t.type.value=="rect_light"?$O(t):t.type.value=="sunlight"?YO(t):t.type.value=="sky"?JO(t):t.type.value=="ambient_light"&&KO(t)}function qO(t){let e,n;Qt[t.guid.value]?e=Qt[t.guid.value]:(e=new tR,Wt.add(e));let i=t.color.value;i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.distance=t.distance.value,e.decay=t.decay.value,e.position.set(t.x.value,t.y.value,t.z.value),e.castShadow=!0,e.shadow.bias=-.002,e.shadow.normalBias=.02,di[t.guid.value]&&t.helper.value?(n=di[t.guid.value],n.update()):t.helper.value&&(n=new oR(e,.5),Wt.add(n)),Qt[t.guid.value]=e,n&&(di[t.guid.value]=n)}function XO(t){let e,n;Qt[t.guid.value]?(e=Qt[t.guid.value],Wt.remove(e.target)):(e=new QP,Wt.add(e));let i=t.color.value;i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.distance=t.distance.value,e.angle=t.angle.value,e.penumbra=t.penumbra.value,e.decay=t.decay.value,e.position.set(t.x.value,t.y.value,t.z.value);const r=new Lt;r.position.set(t.tx.value,t.ty.value,t.tz.value),Wt.add(r),e.target=r,Wt.remove(r),e.castShadow=!0,e.shadow.bias=-.002,e.shadow.normalBias=.02,di[t.guid.value]&&t.helper.value?(n=di[t.guid.value],n.update()):t.helper.value&&(n=new sR(e),Wt.add(n)),Qt[t.guid.value]=e,n&&(di[t.guid.value]=n)}function $O(t){let e,n;Qt[t.guid.value]?e=Qt[t.guid.value]:(e=new iR,Wt.add(e));let i=t.color.value;i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.width=t.width.value,e.height=t.height.value,e.position.set(t.x.value,t.y.value,t.z.value),e.lookAt(t.tx.value,t.ty.value,t.tz.value),di[t.guid.value]&&t.helper.value?n=di[t.guid.value]:t.helper.value&&(n=new GO(e),Wt.add(n)),Qt[t.guid.value]=e,n&&(di[t.guid.value]=n)}function YO(t){let e,n;Qt[t.guid.value]?e=Qt[t.guid.value]:(e=new Zy,Wt.add(e));let i=t.color.value;if(i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.position.set(t.x.value,t.y.value,t.z.value),e.target.position.set(t.tx.value,t.ty.value,t.tz.value),e.castShadow=!0,di[t.guid.value]&&t.helper.value)n=di[t.guid.value],n.update();else if(t.helper.value){const r=new aR(e);Wt.add(r)}Qt[t.guid.value]=e,n&&(di[t.guid.value]=n)}function JO(t){let e,n,i;Qt[t.guid.value]?(e=Qt[t.guid.value],n=Qt[t.guid.value+"_sun"],i=Qt[t.guid.value+"_ambient"]):(e=new Ru,n=new Zy(16777215,1),i=new jy(16777215,.6),Wt.add(e),Wt.add(n),Wt.add(i)),e.scale.setScalar(1e3),e.material.uniforms.up.value=new I(0,0,1),e.material.uniforms.turbidity.value=t.turbidity.value,e.material.uniforms.rayleigh.value=t.rayleigh.value,e.material.uniforms.mieCoefficient.value=t.mie_coefficient.value,e.material.uniforms.mieDirectionalG.value=t.mie_directional_g.value;let r=new I;const s=Yc.degToRad(90-t.elevation.value),o=Yc.degToRad(t.azimuth.value);r.setFromSphericalCoords(1,s,o),e.material.uniforms.sunPosition.value=r,n.position.copy(e.material.uniforms.sunPosition.value),n.color.copy(Hv(t.elevation.value)),i.color.copy(Hv(t.elevation.value)).multiplyScalar(.6),Qt[t.guid.value]=e,Qt[t.guid.value+"_sun"]=n,Qt[t.guid.value+"_ambient"]=i}function Hv(t){if(t>10)return new rt(16777215);if(t>0){const e=t/10;return new rt(16777164).lerp(new rt(16777215),e)}if(t>-5){const e=(t+5)/5;return new rt(16764006).lerp(new rt(16777164),e)}return new rt(16764006)}function KO(t){let e;Qt[t.guid.value]?e=Qt[t.guid.value]:(e=new jy,Wt.add(e));let n=t.color.value;n=n.replace("#","0x"),n=parseInt(n),e.color.set(n),e.intensity=t.intensity.value,e.color.needsUpdate=!0,console.log(t.intensity.value)}const Du=ri([]);function ZO(t){const e=t.type.value;switch(e){case"button":jO(t),vc.isVisible=!0;break;case"slider":QO(t),vc.isVisible=!0;break;case"number_field":eF(t),vc.isVisible=!0;break;default:console.warn("Unknown component type:",e)}}function jO(t){const e={id:Date.now(),component:"Button",label:t.label?.value,props:{text:t.text.value,variant:t.variant.value},action:t.guid.value};Du.push(e)}function QO(t){const e={id:Date.now(),component:"Slider",label:t.label?.value,props:{min:t.min.value,max:t.max.value,step:t.step.value,defaultValue:[t.default_value.value]},action:t.guid.value};Du.push(e)}function eF(t){const e={id:Date.now(),component:"NumberField",label:t.label?.value,props:{min:t.min.value,max:t.max.value,step:t.step.value,value:t.value.value},action:t.guid.value};Du.push(e)}function Yd(t,e){const n={dispatch:"ui_callback",action:t,value:null};e!==void 0&&(n.value=e),mb(n)}class tF extends yp{constructor(e,n={}){const i=n.font;if(i===void 0)super();else{const r=i.generateShapes(e,n.size,n.direction);n.depth===void 0&&(n.depth=50),n.bevelThickness===void 0&&(n.bevelThickness=10),n.bevelSize===void 0&&(n.bevelSize=8),n.bevelEnabled===void 0&&(n.bevelEnabled=!1),super(r,n)}this.type="TextGeometry"}}class nF extends bp{constructor(e){super(e)}load(e,n,i,r){const s=this,o=new ZP(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){const l=s.parse(JSON.parse(a));n&&n(l)},i,r)}parse(e){return new iF(e)}}class iF{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,n=100,i="ltr"){const r=[],s=rF(e,n,this.data,i);for(let o=0,a=s.length;o{i.load(r,a=>{Jd[n]=a,s(a)},void 0,a=>o(a))})}async function lF(t){const e=t.text.value,n=t.font.value,i=t.weight.value,r=t.depth.value,s=t.size.value,o=await aF(n,i),a=new tF(e,{font:o,size:s,depth:r});let l;if(Or[t.guid.value]){const _=Or[t.guid.value];l=Qo[_]}else l=new sa({color:65535,side:Bn});let c;t.centered.value?(a.computeBoundingBox(),c=-.5*(a.boundingBox.max.x-a.boundingBox.min.x)):c=0;const u=new I(t.point_x.value,t.point_y.value,t.point_z.value),d=new I(t.direction_x.value,t.direction_y.value,t.direction_z.value),f=new I(t.up_x.value,t.up_y.value,t.up_z.value),h=new I().crossVectors(d,f).normalize(),g=d.clone().normalize(),v=f.clone().normalize(),m=new yt().makeBasis(g,v,h);m.setPosition(u);const p=new be(a,l);p.position.x=c,p.applyMatrix4(m),ui[t.guid.value]=p,Wt.add(p)}function cF(t){pb(t);const e=VO(t);if(e instanceof hb){uF(e);return}else ON(e)}function uF(t){const e=t.data.items;switch(e.dispatch.value){case"material":PN(e);break;case"light":WO(e);break;case"scene":MF(e);break;case"ui":ZO(e);break;case"text":oF(e);break;case"object_infos":Wc(e);break;case"remove_object":EF(e);break;default:console.warn("Unknown dispatch value:",e.dispatch.value)}}let gr=null;function dF(){const t=()=>{gr=new WebSocket("ws://127.0.0.1:9001/ws"),gr.binaryType="arraybuffer",gr.onopen=()=>{sessionStorage.getItem("reloaded")||(sessionStorage.setItem("reloaded","true"),window.location.reload())},gr.onmessage=e=>{if(e.data instanceof ArrayBuffer){const n=new Uint8Array(e.data);cF(n)}else console.warn("❓ Received non-binary data:",e.data)},gr.onerror=e=>{console.error("WebSocket error:",e)},gr.onclose=()=>{sessionStorage.removeItem("reloaded"),setTimeout(t,1e3)}};t()}function fF(t){gr&&gr.readyState===WebSocket.OPEN?gr.send(t):console.error("WebSocket is not open. Unable to send message.")}function mb(t){try{const e=JSON.stringify(t),n=hF(e);fF(n)}catch{}}function hF(t){return new TextEncoder().encode(t).buffer}let jc,Ho,Go,Gv=!1,Wv=!1;function Er(t){Go&&Go.setMode(t)}class pF{tControl;constructor(e){if(Gv)throw new Error("TransformControlsManager has already been initialized.");this.tControl=new yN(Ht,en.domElement),Wt.add(this.tControl.getHelper()),this.setupEventListeners(),Gv=!0}setupEventListeners(){this.tControl.addEventListener("dragging-changed",e=>{Rn.enabled=!e.value}),window.addEventListener("keydown",e=>{if(!(e.altKey||e.ctrlKey||e.metaKey))switch(e.key){case"w":if(!mn.value)break;Er("translate"),Sr.value="translate";break;case"e":if(!mn.value)break;Er("rotate"),Sr.value="rotate";break;case"r":if(!mn.value)break;Er("scale"),Sr.value="scale";break;case"p":mn.value=!mn.value;break;case"Escape":this.tControl.detach(),Wc({});break}})}get controls(){return this.tControl}}class mF{raycaster;pickedObject;constructor(){if(Wv)throw new Error("PickHelper has already been initialized.");this.raycaster=new Qy,this.raycaster.layers.set(0),this.pickedObject=null,this.setupEventListeners(),Wv=!0}setupEventListeners(){window.addEventListener("keydown",e=>{e.key==="Escape"&&this.pickedObject&&(this.dehighlightObject(this.pickedObject),Wc({}))}),jc={x:0,y:0},window.addEventListener("mousedown",e=>{e.button===0&&(Go.dragging||(vF(e),this.pick(jc,Wt)))})}getPickedObject(e){this.raycaster.setFromCamera(e,Ht);const n=this.raycaster.intersectObjects(ui?Object.values(ui):[],!0);return n.length?n[0].object:null}getPickedObjectKey(e){return Object.keys(ui).find(n=>ui[n]===e)}sendMessage(e){mb({dispatch:"object_picked",guid:e})}pick(e,n){if(!mn.value)return;const i=this.getPickedObject(e);if(i){this.pickedObject!==i&&this.pickedObject!==null&&this.dehighlightObject(this.pickedObject),this.pickedObject=i,Go.attach(this.pickedObject);const r=this.getPickedObjectKey(this.pickedObject);this.sendMessage(r),this.highlightObject(this.pickedObject)}else this.pickedObject&&(this.dehighlightObject(this.pickedObject),this.pickedObject=null,Go.detach(),Wc({}))}dehighlightObject(e){e.savedColor&&(e.material.color.copy(e.savedColor),e.material.emissive?.set("black"),e.material.emissiveIntensity=0)}highlightObject(e){e.savedColor||(e.savedColor=e.material.color.clone()),e.material.color.set("orange"),e.material.emissive&&(e.material.emissive.set("yellow"),e.material.emissiveIntensity=.1)}}function gF(t){const e=Ho.getBoundingClientRect();return{x:(t.clientX-e.left)*(Ho.width/e.width),y:(t.clientY-e.top)*(Ho.height/e.height)}}function vF(t){const e=gF(t);jc.x=e.x/Ho.width*2-1,jc.y=e.y/Ho.height*-2+1}function _F(t){return Ho=document.querySelector("canvas"),Go=new pF().controls,t}Lt.DEFAULT_UP.set(0,0,1);const Wt=new rP,Ht=new Wn(60,window.innerWidth/window.innerHeight,.1,1e3);Ht.position.set(8,-15,15);Ht.zoom=1;Ht.layers.enable(1);const en=new sN({antialias:!0});en.setSize(window.innerWidth,window.innerHeight);en.setPixelRatio(window.devicePixelRatio);en.toneMapping=Qh;en.shadowMap.enabled=!0;en.shadowMap.type=my;en.toneMappingExposure=2.5;en.physicallyCorrectLights=!0;en.outputColorSpace=Zn;document.body.appendChild(en.domElement);const Rn=new aN(Ht,en.domElement);Rn.enableDamping=!0;Rn.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:Xs.ROTATE};const xF={top:new I(0,0,1),bottom:new I(0,0,-1),front:new I(0,-1,0),back:new I(0,1,0),left:new I(-1,0,0),right:new I(1,0,0),front_left:new I(-1,-1,1),front_right:new I(1,-1,1),back_left:new I(-1,1,1),back_right:new I(1,1,1)},yF=new Map([["Numpad5","top"],["Numpad0","bottom"],["Numpad2","front"],["Numpad8","back"],["Numpad4","left"],["Numpad6","right"],["Numpad1","front_left"],["Numpad3","front_right"],["Numpad7","back_left"],["Numpad9","back_right"]]),gb=new eb(5);Wt.add(gb);const bF=new mF;_F(bF);function vb(){requestAnimationFrame(vb),Rn.update(),en.render(Wt,Ht)}vb();window.addEventListener("keydown",t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const e=SF(t.code);e&&(Qp(e),t.preventDefault())});window.addEventListener("resize",()=>{Ht.aspect=window.innerWidth/window.innerHeight,Ht.updateProjectionMatrix(),en.setSize(window.innerWidth,window.innerHeight)});function Qp(t){const e=Rn.target.clone(),n=xF[t].clone().normalize(),i=Ht.position.distanceTo(e);Ht.position.copy(e.clone().add(n.multiplyScalar(i))),Rn.update()}function as(t){Qp(t)}function SF(t){return yF.get(t)??null}function MF(t){switch(t.type.value){case"background_color":wF(t);break;case"controls_damping":Rn.enableDamping=t.damping.value;break;case"world_axis":gb.visible=t.show.value;break;case"picker":mn.value=t.enabled.value;break;case"camera_fov":Ht.fov=t.fov.value,Ht.updateProjectionMatrix();break;case"camera_zoom":Ht.zoom=t.zoom.value,Ht.updateProjectionMatrix();break;case"camera_position":Ht.position.set(t.x.value,t.y.value,t.z.value),Rn.update();break;case"camera_target":Rn.target.set(t.x.value,t.y.value,t.z.value),Rn.update();break;case"camera_view":{const e=t.preset.value;e&&Qp(e);break}case"show_edges":ax.value=t.show.value;break;default:console.warn("Unknown scene type:",t.type.value)}}function wF(t){let e=t.color.value;e=e.replace("#","0x"),e=parseInt(e),Wt.background=new rt(e)}function EF(t){const e=t.guid.value;if(e in ui){const n=ui[e];Wt.remove(n),delete ui[e]}e in Or&&delete Or[e]}function _b(t){return{id:`view-${Date.now()}`,name:t,cameraPosition:{x:Ht.position.x,y:Ht.position.y,z:Ht.position.z},target:{x:Rn.target.x,y:Rn.target.y,z:Rn.target.z},zoom:Ht.zoom,fov:Ht.fov}}function TF(t){Ht.position.set(t.cameraPosition.x,t.cameraPosition.y,t.cameraPosition.z),Rn.target.set(t.target.x,t.target.y,t.target.z),Ht.zoom=t.zoom,Ht.fov=t.fov,Ht.updateProjectionMatrix(),Rn.update()}function qv(t,e){return!Number.isFinite(t)||t<=0?e:Math.max(16,Math.round(t))}function AF(t,e,n){const i=document.createElement("canvas");i.width=t,i.height=e;const r=i.getContext("2d");if(!r)throw new Error("Unable to create screenshot canvas context");const s=en.domElement,o=s.getBoundingClientRect(),a=Math.round(o.width)||s.clientWidth||s.width,l=Math.round(o.height)||s.clientHeight||s.height;n==="jpg"?(r.fillStyle="#ffffff",r.fillRect(0,0,t,e)):r.clearRect(0,0,t,e);const c=Math.max(t/a,e/l),u=Math.round(a*c),d=Math.round(l*c),f=Math.floor((t-u)/2),h=Math.floor((e-d)/2);return r.drawImage(s,f,h,u,d),i}function CF(t,e){const n=document.createElement("a");n.download=e,n.href=t,n.click()}function PF(t){return`compas-view-${new Date().toISOString().replace(/[:.]/g,"-")}.${t}`}function xb(t={}){Rn.update(),en.render(Wt,Ht);const e=t.format??"png",n=en.domElement.width||en.domElement.clientWidth,i=en.domElement.height||en.domElement.clientHeight,r=qv(t.width??n,n),s=qv(t.height??i,i),o=AF(r,s,e),a=e==="jpg"?"image/jpeg":e==="webp"?"image/webp":"image/png",l=e==="jpg"?t.quality??.92:void 0,c=e==="jpg"?"jpg":e==="webp"?"webp":"png",u=t.fileName??PF(c),d=o.toDataURL(a,l);CF(d,u)}function RF(t){if(t.ctrlKey||t.metaKey||t.altKey)return!0;const e=t.target;if(!e)return!1;const n=e.tagName;return n==="INPUT"||n==="TEXTAREA"||n==="SELECT"?!0:e.isContentEditable}function em(t){const e=n=>{if(RF(n))return;const i=n.key.toLowerCase(),r=t[i];r&&(n.preventDefault(),r(n))};Ri(()=>{document.addEventListener("keydown",e)}),mu(()=>{document.removeEventListener("keydown",e)})}const ir=Fe({__name:"Kbd",props:{class:{}},setup(t){const e=t;return(n,i)=>(ge(),kt("kbd",{class:xn(T(tr)("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e.class))},[ot(n.$slots,"default")],2))}}),pi=Fe({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const r=Qi(t,e);return(s,o)=>(ge(),ke(T(gT),ms(kr(T(r))),{default:ne(()=>[ot(s.$slots,"default")]),_:3},16))}}),mi=Fe({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=js(n,"class"),s=Qi(r,i);return(o,a)=>(ge(),ke(T(MT),null,{default:ne(()=>[re(T(bT),Dt({...T(s),...o.$attrs},{class:T(tr)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:ne(()=>[ot(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Ni=Fe({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const e=t;return(n,i)=>(ge(),ke(T(hT),ms(kr(e)),{default:ne(()=>[ot(n.$slots,"default")]),_:3},16))}}),gi=Fe({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,i)=>(ge(),ke(T(ET),ms(kr(e)),{default:ne(()=>[ot(n.$slots,"default")]),_:3},16))}}),DF=Fe({__name:"MoveButton",setup(t){function e(){Er("translate"),Sr.value="translate"}return(n,i)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),null,{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon",class:xn({active:T(Sr).value=="translate",disabled:!T(mn).value}),onClick:e,disabled:!T(mn).value},{default:ne(()=>[re(T(AA))]),_:1},8,["class","disabled"])]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[i[1]||(i[1]=Gt("Move mode ",-1)),re(T(ir),null,{default:ne(()=>[...i[0]||(i[0]=[Gt("W",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),IF=Fe({__name:"RotateButton",setup(t){function e(){Er("rotate"),Sr.value="rotate"}return(n,i)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),null,{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon",class:xn({active:T(Sr).value=="rotate",disabled:!T(mn).value}),onClick:e,disabled:!T(mn).value},{default:ne(()=>[re(T(IA),{size:16,"stroke-width":2,"aria-hidden":"true"})]),_:1},8,["class","disabled"])]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[i[1]||(i[1]=Gt("Rotate mode ",-1)),re(T(ir),null,{default:ne(()=>[...i[0]||(i[0]=[Gt("E",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),NF={class:"button-icon"},LF=Fe({__name:"ScaleButton",props:{active:{type:Boolean}},emits:["activated"],setup(t,{emit:e}){function n(){Er("scale"),Sr.value="scale"}return(i,r)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),null,{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon",class:xn(["toolbar-button",{active:T(Sr).value=="scale",disabled:!T(mn).value}]),onClick:n,disabled:!T(mn).value},{default:ne(()=>[et("span",NF,[re(T(NA),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1},8,["class","disabled"])]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[r[1]||(r[1]=Gt("Rotate mode ",-1)),re(T(ir),null,{default:ne(()=>[...r[0]||(r[0]=[Gt("R",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),OF={key:0},FF={key:1},UF=Fe({__name:"EnablePicker",setup(t){function e(){mn.value=!mn.value}return(n,i)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),null,{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon",onClick:e,class:xn({active:!T(mn).value})},{default:ne(()=>[T(mn).value?(ge(),kt("span",OF,[re(T(PA))])):(ge(),kt("span",FF,[re(T(CA))]))]),_:1},8,["class"])]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[i[1]||(i[1]=Gt("Enable/Disable object selection ",-1)),re(T(ir),null,{default:ne(()=>[...i[0]||(i[0]=[Gt("P",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),kF={class:"toolbar-group"},BF=Fe({__name:"TransformGroup",setup(t){const e=Ve(null);function n(i){e.value=i}return em({w:()=>{Er("translate"),n("move")},e:()=>{Er("rotate"),n("rotate")},r:()=>{Er("scale"),n("scale")}}),(i,r)=>(ge(),kt("div",kF,[re(T(UF),{active:e.value==="move",onActivated:r[0]||(r[0]=s=>n("move"))},null,8,["active"]),re(T(DF),{active:e.value==="move",onActivated:r[1]||(r[1]=s=>n("move"))},null,8,["active"]),re(T(IF),{active:e.value==="rotate",onActivated:r[2]||(r[2]=s=>n("rotate"))},null,8,["active"]),re(T(LF),{active:e.value==="scale",onActivated:r[3]||(r[3]=s=>n("scale"))},null,8,["active"])]))}}),zF=Fe({__name:"TopViewButton",setup(t){function e(){as("top")}return(n,i)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),null,{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:ne(()=>[re(T(DA))]),_:1})]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[i[1]||(i[1]=Gt("Top view ",-1)),re(T(ir),null,{default:ne(()=>[...i[0]||(i[0]=[Gt("5",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),VF=Fe({__name:"FrontViewButton",setup(t){function e(){as("front")}return(n,i)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),null,{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon",onClick:e},{default:ne(()=>[re(T(LA))]),_:1})]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[i[1]||(i[1]=Gt("Front view ",-1)),re(T(ir),null,{default:ne(()=>[...i[0]||(i[0]=[Gt("2",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),HF={class:"button-icon"},GF=Fe({__name:"RightViewButton",setup(t){function e(){as("right")}return(n,i)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),null,{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:ne(()=>[et("span",HF,[re(T(RA),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1})]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[i[1]||(i[1]=Gt("Right view ",-1)),re(T(ir),null,{default:ne(()=>[...i[0]||(i[0]=[Gt("6",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),WF={class:"button-icon"},qF=Fe({__name:"PerspectiveViewButton",setup(t){function e(){as("front_right")}return(n,i)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),null,{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:ne(()=>[et("span",WF,[re(T(wA),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1})]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[i[1]||(i[1]=Gt("Perspective view ",-1)),re(T(ir),null,{default:ne(()=>[...i[0]||(i[0]=[Gt("3",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),XF={class:"toolbar-group"},$F=Fe({__name:"ViewGroup",setup(t){return em({2:()=>{as("front")},3:()=>{as("front_right")},5:()=>{as("top")},6:()=>{as("right")}}),(e,n)=>(ge(),kt("div",XF,[re(T(zF)),re(T(VF)),re(T(GF)),re(T(qF))]))}}),YF={class:"button-icon save-view-icon"},JF={class:"save-view-overlay","aria-hidden":"true"},KF=Fe({__name:"SaveViewButton",props:{defaultName:{}},emits:["saved"],setup(t,{emit:e}){const n=t,i=e;function r(){const s=window.prompt("Name for saved view",n.defaultName);if(s===null)return;const o=s.trim()||n.defaultName,a=_b(o);i("saved",a)}return(s,o)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),null,{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon",onClick:r},{default:ne(()=>[et("span",YF,[re(T(SA),{size:15,"stroke-width":2,"aria-hidden":"true"}),et("span",JF,[re(T(py),{class:"save-view-overlay-icon"})])])]),_:1})]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[o[1]||(o[1]=Gt("Save Current View ",-1)),re(T(ir),null,{default:ne(()=>[...o[0]||(o[0]=[Gt("S",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),ZF=eo(KF,[["__scopeId","data-v-49e45054"]]),yb=Fe({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const r=Qi(t,e);return(s,o)=>(ge(),ke(T(FE),ms(kr(T(r))),{default:ne(()=>[ot(s.$slots,"default")]),_:3},16))}}),bb=Fe({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,i)=>(ge(),ke(T($E),ms(kr(e)),{default:ne(()=>[ot(n.$slots,"default")]),_:3},16))}}),Sb=Fe({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:8},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=js(n,"class"),s=Qi(r,i);return(o,a)=>(ge(),ke(T(qE),null,{default:ne(()=>[re(T(GE),Dt({...T(s),...o.$attrs},{class:T(tr)("z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:ne(()=>[ot(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),jF={class:"inline-flex h-full w-full items-center justify-center"},QF={class:"flex h-8 items-stretch overflow-hidden rounded-lg border border-input bg-secondary"},eU={key:0,disabled:"",value:""},tU=["value"],nU=Fe({__name:"SavedViewsButton",props:{views:{},selectedViewId:{}},emits:["select","delete"],setup(t,{emit:e}){const n=t,i=e,r=Ve(!1),s=Ve(""),o=Ve(!1);let a=null;sn(()=>[n.selectedViewId,n.views],([u,d])=>{if(d.length===0){s.value="";return}const f=d.some(h=>h.id===u);s.value=f?u:d[0].id},{immediate:!0});function l(){s.value&&i("select",s.value)}function c(){s.value&&(o.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{o.value=!1,a=null},160),i("delete",s.value))}return mu(()=>{a&&clearTimeout(a)}),(u,d)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(yb),{open:r.value,"onUpdate:open":d[1]||(d[1]=f=>r.value=f),modal:!0},{default:ne(()=>[re(T(bb),{"as-child":""},{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon"},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),{"as-child":""},{default:ne(()=>[et("span",jF,[re(T(MA))])]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[...d[2]||(d[2]=[et("p",null,"Saved views",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),re(T(Sb),{class:"theme z-[4000] w-72 rounded-xl p-2 text-secondary-foreground",side:"bottom",align:"start"},{default:ne(()=>[et("div",QF,[hc(et("select",{"onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),class:"h-full flex-1 border-0 bg-transparent px-3 py-1 text-sm text-secondary-foreground outline-none",onChange:l},[t.views.length===0?(ge(),kt("option",eU," No saved views ")):yr("",!0),(ge(!0),kt(rn,null,rl(t.views,f=>(ge(),kt("option",{key:f.id,value:f.id},cs(f.name),9,tU))),128))],544),[[ox,s.value]]),re(T(pi),null,{default:ne(()=>[re(T(gi),{"as-child":""},{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon-sm",class:xn(["h-full w-8 rounded-none border-l border-input transition-[background-color,color,box-shadow]",{"saved-view-delete-pressed":o.value}]),disabled:!s.value,onClick:li(c,["stop"])},{default:ne(()=>[re(T(OA),{class:"h-3 w-3"})]),_:1},8,["class","disabled"])]),_:1}),re(T(mi),{class:"z-[4100]",side:"bottom"},{default:ne(()=>[...d[3]||(d[3]=[et("p",null,"Delete saved view",-1)])]),_:1})]),_:1})])]),_:1})]),_:1},8,["open"])]),_:1}))}}),iU=eo(nU,[["__scopeId","data-v-95b0c23f"]]),rU={class:"inline-flex h-full w-full items-center justify-center"},sU={class:"grid gap-5"},oU={class:"grid gap-3"},aU={class:"grid grid-cols-3 items-center gap-4"},lU={class:"grid grid-cols-3 items-center gap-4"},cU={class:"grid grid-cols-3 items-center gap-4"},uU={class:"flex justify-end gap-2"},dU=Fe({__name:"SaveScreenshotButton",setup(t){const e=Ve(!1),n=Ve(1920),i=Ve(1080),r=Ve("png");function s(l,c){return Number.isFinite(l)?Math.min(8192,Math.max(64,Math.round(l))):c}function o(){const l=en.domElement;if(!l)return;const c=l.getBoundingClientRect(),u=Math.round(c.width)||l.clientWidth||l.width,d=Math.round(c.height)||l.clientHeight||l.height;n.value=s(u,n.value),i.value=s(d,i.value)}function a(){xb({width:s(n.value,1920),height:s(i.value,1080),format:r.value}),e.value=!1}return sn(e,l=>{l&&o()}),(l,c)=>(ge(),ke(T(Ni),{"delay-duration":600},{default:ne(()=>[re(T(yb),{open:e.value,"onUpdate:open":c[4]||(c[4]=u=>e.value=u),modal:!0},{default:ne(()=>[re(T(bb),{"as-child":""},{default:ne(()=>[re(T(ln),{variant:"secondary",size:"icon"},{default:ne(()=>[re(T(pi),null,{default:ne(()=>[re(T(gi),{"as-child":""},{default:ne(()=>[et("span",rU,[re(T(EA))])]),_:1}),re(T(mi),{class:"z-1000",side:"bottom"},{default:ne(()=>[et("p",null,[c[6]||(c[6]=Gt("Save screenshot ",-1)),re(T(ir),null,{default:ne(()=>[...c[5]||(c[5]=[Gt("F",-1)])]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1}),re(T(Sb),{class:"theme z-[4000] w-84 rounded-xl p-5 text-secondary-foreground",side:"bottom",align:"start"},{default:ne(()=>[et("div",sU,[c[13]||(c[13]=et("div",{class:"space-y-2"},[et("h4",{class:"font-medium leading-none"}," Export Screenshot "),et("p",{class:"text-sm text-muted-foreground"}," Set width, height, and image format. ")],-1)),et("div",oU,[et("div",aU,[c[7]||(c[7]=et("label",{for:"screenshot-width",class:"text-sm"},"Width",-1)),hc(et("input",{id:"screenshot-width","onUpdate:modelValue":c[0]||(c[0]=u=>n.value=u),type:"number",min:"64",max:"8192",class:"col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},null,512),[[Hm,n.value,void 0,{number:!0}]])]),et("div",lU,[c[8]||(c[8]=et("label",{for:"screenshot-height",class:"text-sm"},"Height",-1)),hc(et("input",{id:"screenshot-height","onUpdate:modelValue":c[1]||(c[1]=u=>i.value=u),type:"number",min:"64",max:"8192",class:"col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},null,512),[[Hm,i.value,void 0,{number:!0}]])]),et("div",cU,[c[10]||(c[10]=et("label",{for:"screenshot-format",class:"text-sm"},"Format",-1)),hc(et("select",{id:"screenshot-format","onUpdate:modelValue":c[2]||(c[2]=u=>r.value=u),class:"col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},[...c[9]||(c[9]=[et("option",{value:"png"},"PNG",-1),et("option",{value:"jpg"},"JPG",-1),et("option",{value:"webp"},"WEBP",-1)])],512),[[ox,r.value]])])]),et("div",uU,[re(T(ln),{variant:"secondary",size:"sm",onClick:c[3]||(c[3]=u=>e.value=!1)},{default:ne(()=>[...c[11]||(c[11]=[Gt("Cancel",-1)])]),_:1}),re(T(ln),{variant:"secondary",size:"sm",onClick:a},{default:ne(()=>[...c[12]||(c[12]=[Gt("Save",-1)])]),_:1})])])]),_:1})]),_:1},8,["open"])]),_:1}))}}),fU={class:"display-tools-wrapper"},hU={class:"toolbar-group"},Xv="compas_threejs_saved_views",pU=Fe({__name:"DisplayGroup",setup(t){const e=Ve([]),n=Ve("");function i(){localStorage.setItem(Xv,JSON.stringify(e.value))}function r(){const c=localStorage.getItem(Xv);if(c)try{const u=JSON.parse(c);Array.isArray(u)&&(e.value=u)}catch{e.value=[]}}function s(c){e.value=[...e.value,c],n.value=c.id,i()}function o(){const c=`View ${e.value.length+1}`,u=window.prompt("Name for saved view",c);if(u===null)return;const d=u.trim()||c,f=_b(d);s(f)}function a(c){n.value=c;const u=e.value.find(d=>d.id===c);u&&TF(u)}function l(c){const u=e.value.filter(d=>d.id!==c);e.value=u,n.value===c&&(n.value=u[0]?.id??""),i()}return Ri(()=>{r()}),em({s:()=>{o()},f:()=>{xb({format:"png"})}}),(c,u)=>(ge(),kt("div",fU,[et("div",hU,[re(T(ZF),{"default-name":`View ${e.value.length+1}`,onSaved:s},null,8,["default-name"]),re(T(iU),{views:e.value,"selected-view-id":n.value,onSelect:a,onDelete:l},null,8,["views","selected-view-id"]),re(T(dU))])]))}}),mU={class:"toolbar theme"},gU=Fe({__name:"Toolbar",setup(t){return(e,n)=>(ge(),kt("div",mU,[n[0]||(n[0]=et("h1",{class:"text-lg font-bold"},"COMPAS ThreeJs",-1)),re(BF),re($F),re(pU)]))}}),vU=eo(gU,[["__scopeId","data-v-8f0a01f7"]]),_U=Fe({__name:"Slider",props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},orientation:{},dir:{},inverted:{type:Boolean},min:{},max:{},step:{},minStepsBetweenThumbs:{},thumbAlignment:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue","valueCommit"],setup(t,{emit:e}){const n=t,i=e,r=js(n,"class"),s=Qi(r,i);return(o,a)=>(ge(),ke(T(wE),Dt({"data-slot":"slider",class:T(tr)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",n.class)},T(s)),{default:ne(({modelValue:l})=>[re(T(NE),{"data-slot":"slider-track",class:"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"},{default:ne(()=>[re(T(AE),{"data-slot":"slider-range",class:"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})]),_:1}),(ge(!0),kt(rn,null,rl(l,(c,u)=>(ge(),ke(T(DE),{key:u,"data-slot":"slider-thumb",class:"bg-white border-primary ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"}))),128))]),_:1},16,["class"]))}}),xU=Fe({__name:"NumberField",props:{defaultValue:{},modelValue:{},min:{},max:{},step:{},stepSnapping:{type:Boolean},focusOnChange:{type:Boolean},formatOptions:{},locale:{},disabled:{type:Boolean},readonly:{type:Boolean},disableWheelChange:{type:Boolean},invertWheelChange:{type:Boolean},id:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,r=js(n,"class"),s=Qi(r,i);return(o,a)=>(ge(),ke(T(rT),Dt(T(s),{class:T(tr)("grid gap-1.5",n.class)}),{default:ne(l=>[ot(o.$slots,"default",ms(kr(l)))]),_:3},16,["class"]))}}),yU=Fe({__name:"NumberFieldContent",props:{class:{}},setup(t){const e=t;return(n,i)=>(ge(),kt("div",{class:xn(T(tr)("relative [&>[data-slot=input]]:has-[[data-slot=increment]]:pr-5 [&>[data-slot=input]]:has-[[data-slot=decrement]]:pl-5",e.class))},[ot(n.$slots,"default")],2))}}),bU=Fe({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=js(e,"class"),i=al(n);return(r,s)=>(ge(),ke(T(oT),Dt({"data-slot":"decrement"},T(i),{class:T(tr)("absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20",e.class)}),{default:ne(()=>[ot(r.$slots,"default",{},()=>[re(T(TA),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),SU=Fe({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=js(e,"class"),i=al(n);return(r,s)=>(ge(),ke(T(lT),Dt({"data-slot":"increment"},T(i),{class:T(tr)("absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3",e.class)}),{default:ne(()=>[ot(r.$slots,"default",{},()=>[re(T(py),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),MU=Fe({__name:"NumberFieldInput",props:{class:{}},setup(t){const e=t;return(n,i)=>(ge(),ke(T(uT),{"data-slot":"input",class:xn(T(tr)("flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-sm text-center shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e.class))},null,8,["class"]))}}),wU={key:0,class:"dynamic-label"},EU={key:2,class:"slider-container"},TU={key:0,class:"slider-value"},AU={key:3,class:"number-field-container"},CU=Fe({__name:"Openbar",setup(t){const e=Ve(!0);function n(){e.value=!e.value}return document.addEventListener("keydown",i=>{(i.key==="Q"||i.key==="q")&&n()}),(i,r)=>(ge(),kt(rn,null,[et("div",{id:"openbar",class:xn(["theme",{"is-hidden":!e.value}])},[(ge(!0),kt(rn,null,rl(T(Du),s=>(ge(),kt("div",{key:s.id,class:"dynamic-item"},[s.label?(ge(),kt("label",wU,cs(s.label),1)):yr("",!0),s.component==="Button"?(ge(),ke(T(ln),{key:1,variant:"secondary",onClick:o=>T(Yd)(s.action)},{default:ne(()=>[Gt(cs(s.props.text),1)]),_:2},1032,["onClick"])):s.component==="Slider"?(ge(),kt("div",EU,[re(T(_U),{min:s.props.min,max:s.props.max,step:s.props.step,"default-value":s.props.defaultValue,modelValue:s.props.defaultValue,"onUpdate:modelValue":[o=>s.props.defaultValue=o,o=>T(Yd)(s.action,o[0])],class:"w-[80%]"},null,8,["min","max","step","default-value","modelValue","onUpdate:modelValue"]),s.props.defaultValue?(ge(),kt("span",TU,cs(s.props.defaultValue[0]),1)):yr("",!0)])):s.component==="NumberField"?(ge(),kt("div",AU,[re(T(xU),{min:s.props.min,max:s.props.max,step:s.props.step,"default-value":s.props.value,modelValue:s.props.value,"onUpdate:modelValue":[o=>s.props.value=o,o=>T(Yd)(s.action,o)],class:"w-full"},{default:ne(()=>[re(T(yU),null,{default:ne(()=>[re(T(bU)),re(T(MU)),re(T(SU))]),_:1})]),_:1},8,["min","max","step","default-value","modelValue","onUpdate:modelValue"])])):yr("",!0)]))),128)),re(T(ln),{variant:"secondary",size:"icon",class:"mb-4",onClick:r[0]||(r[0]=s=>n())},{default:ne(()=>[re(T(fy))]),_:1})],2),re(T(ln),{variant:"secondary",size:"icon",class:xn(["mb-5",{"is-hidden":!e.value}]),onClick:r[1]||(r[1]=s=>n())},{default:ne(()=>[re(T(hy))]),_:1},8,["class"])],64))}}),PU=eo(CU,[["__scopeId","data-v-2776f440"]]),RU={id:"sidebar"},DU={__name:"Sidebar",setup(t){return(e,n)=>(ge(),kt("div",RU,[re(vU),T(vc).isVisible?(ge(),ke(PU,{key:0})):yr("",!0)]))}},IU=eo(DU,[["__scopeId","data-v-ad216085"]]),NU={class:"app-container"},LU=Fe({__name:"App",setup(t){const e=Ve(null);return Ri(()=>{e.value&&(e.value.appendChild(en.domElement),dF())}),(n,i)=>(ge(),kt("div",NU,[re(IU),et("div",{ref_key:"threeContainer",ref:e,class:"three-container"},null,512),re(zA)]))}}),OU=eo(LU,[["__scopeId","data-v-13e012f1"]]),FU=ew(OU);FU.mount("#app"); + }`};const tn={},hi={};function GO(t){t.type.value=="point_light"?WO(t):t.type.value=="spot_light"?qO(t):t.type.value=="rect_light"?XO(t):t.type.value=="sunlight"?$O(t):t.type.value=="sky"?YO(t):t.type.value=="ambient_light"&&JO(t)}function WO(t){let e,n;tn[t.guid.value]?e=tn[t.guid.value]:(e=new t2,Vt.add(e));let i=t.color.value;i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.distance=t.distance.value,e.decay=t.decay.value,e.position.set(t.x.value,t.y.value,t.z.value),e.castShadow=!0,e.shadow.bias=-.002,e.shadow.normalBias=.02,hi[t.guid.value]&&t.helper.value?(n=hi[t.guid.value],n.update()):t.helper.value&&(n=new o2(e,.5),Vt.add(n)),tn[t.guid.value]=e,n&&(hi[t.guid.value]=n)}function qO(t){let e,n;tn[t.guid.value]?(e=tn[t.guid.value],Vt.remove(e.target)):(e=new QP,Vt.add(e));let i=t.color.value;i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.distance=t.distance.value,e.angle=t.angle.value,e.penumbra=t.penumbra.value,e.decay=t.decay.value,e.position.set(t.x.value,t.y.value,t.z.value);const r=new Ut;r.position.set(t.tx.value,t.ty.value,t.tz.value),Vt.add(r),e.target=r,Vt.remove(r),e.castShadow=!0,e.shadow.bias=-.002,e.shadow.normalBias=.02,hi[t.guid.value]&&t.helper.value?(n=hi[t.guid.value],n.update()):t.helper.value&&(n=new s2(e),Vt.add(n)),tn[t.guid.value]=e,n&&(hi[t.guid.value]=n)}function XO(t){let e,n;tn[t.guid.value]?e=tn[t.guid.value]:(e=new i2,Vt.add(e));let i=t.color.value;i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.width=t.width.value,e.height=t.height.value,e.position.set(t.x.value,t.y.value,t.z.value),e.lookAt(t.tx.value,t.ty.value,t.tz.value),hi[t.guid.value]&&t.helper.value?n=hi[t.guid.value]:t.helper.value&&(n=new HO(e),Vt.add(n)),tn[t.guid.value]=e,n&&(hi[t.guid.value]=n)}function $O(t){let e,n;tn[t.guid.value]?e=tn[t.guid.value]:(e=new lb,Vt.add(e));let i=t.color.value;if(i=i.replace("#","0x"),i=parseInt(i),e.color.set(i),e.intensity=t.intensity.value,e.position.set(t.x.value,t.y.value,t.z.value),e.target.position.set(t.tx.value,t.ty.value,t.tz.value),e.castShadow=!0,hi[t.guid.value]&&t.helper.value)n=hi[t.guid.value],n.update();else if(t.helper.value){const r=new a2(e);Vt.add(r)}tn[t.guid.value]=e,n&&(hi[t.guid.value]=n)}function YO(t){let e,n,i;tn[t.guid.value]?(e=tn[t.guid.value],n=tn[t.guid.value+"_sun"],i=tn[t.guid.value+"_ambient"]):(e=new Ou,n=new lb(16777215,1),i=new cb(16777215,.6),Vt.add(e),Vt.add(n),Vt.add(i)),e.scale.setScalar(1e3),e.material.uniforms.up.value=new I(0,0,1),e.material.uniforms.turbidity.value=t.turbidity.value,e.material.uniforms.rayleigh.value=t.rayleigh.value,e.material.uniforms.mieCoefficient.value=t.mie_coefficient.value,e.material.uniforms.mieDirectionalG.value=t.mie_directional_g.value;let r=new I;const s=jc.degToRad(90-t.elevation.value),o=jc.degToRad(t.azimuth.value);r.setFromSphericalCoords(1,s,o),e.material.uniforms.sunPosition.value=r,n.position.copy(e.material.uniforms.sunPosition.value),n.color.copy(Xv(t.elevation.value)),i.color.copy(Xv(t.elevation.value)).multiplyScalar(.6),tn[t.guid.value]=e,tn[t.guid.value+"_sun"]=n,tn[t.guid.value+"_ambient"]=i}function Xv(t){if(t>10)return new st(16777215);if(t>0){const e=t/10;return new st(16777164).lerp(new st(16777215),e)}if(t>-5){const e=(t+5)/5;return new st(16764006).lerp(new st(16777164),e)}return new st(16764006)}function JO(t){let e;tn[t.guid.value]?e=tn[t.guid.value]:(e=new cb,Vt.add(e));let n=t.color.value;n=n.replace("#","0x"),n=parseInt(n),e.color.set(n),e.intensity=t.intensity.value,e.color.needsUpdate=!0,console.log(t.intensity.value)}class KO extends Yp{constructor(e,n={}){const i=n.font;if(i===void 0)super();else{const r=i.generateShapes(e,n.size,n.direction);n.depth===void 0&&(n.depth=50),n.bevelThickness===void 0&&(n.bevelThickness=10),n.bevelSize===void 0&&(n.bevelSize=8),n.bevelEnabled===void 0&&(n.bevelEnabled=!1),super(r,n)}this.type="TextGeometry"}}class ZO extends Jp{constructor(e){super(e)}load(e,n,i,r){const s=this,o=new ZP(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){const l=s.parse(JSON.parse(a));n&&n(l)},i,r)}parse(e){return new jO(e)}}class jO{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,n=100,i="ltr"){const r=[],s=QO(e,n,this.data,i);for(let o=0,a=s.length;o{i.load(r,a=>{Zd[n]=a,s(a)},void 0,a=>o(a))})}async function iF(t){const e=t.text.value,n=t.font.value,i=t.weight.value,r=t.depth.value,s=t.size.value,o=await nF(n,i),a=new KO(e,{font:o,size:s,depth:r});let l;if(Ur[t.guid.value]){const _=Ur[t.guid.value];l=ia[_]}else l=new aa({color:65535,side:zn});let c;t.centered.value?(a.computeBoundingBox(),c=-.5*(a.boundingBox.max.x-a.boundingBox.min.x)):c=0;const u=new I(t.point_x.value,t.point_y.value,t.point_z.value),d=new I(t.direction_x.value,t.direction_y.value,t.direction_z.value),f=new I(t.up_x.value,t.up_y.value,t.up_z.value),h=new I().crossVectors(d,f).normalize(),g=d.clone().normalize(),v=f.clone().normalize(),m=new yt().makeBasis(g,v,h);m.setPosition(u);const p=new be(a,l);p.position.x=c,p.applyMatrix4(m),fi[t.guid.value]=p,Vt.add(p)}function rF(t){yb(t);const e=$L(t);if(e instanceof xb){sF(e);return}else MO(e)}function sF(t){const e=t.data.items;switch(e.dispatch.value){case"material":_O(e);break;case"light":GO(e);break;case"scene":kO(e);break;case"ui":cF(e);break;case"text":tF(e);break;case"object_infos":nu(e);break;case"remove_object":zO(e);break;case"transform":VO(e);break;default:console.warn("Unknown dispatch value:",e.dispatch.value)}}let xr=null;function oF(){const t=()=>{xr=new WebSocket("ws://127.0.0.1:9001/ws"),xr.binaryType="arraybuffer",xr.onopen=()=>{sessionStorage.getItem("reloaded")||(sessionStorage.setItem("reloaded","true"),window.location.reload())},xr.onmessage=e=>{if(e.data instanceof ArrayBuffer){const n=new Uint8Array(e.data);rF(n)}else console.warn("❓ Received non-binary data:",e.data)},xr.onerror=e=>{console.error("WebSocket error:",e)},xr.onclose=()=>{sessionStorage.removeItem("reloaded"),setTimeout(t,1e3)}};t()}function aF(t){xr&&xr.readyState===WebSocket.OPEN?xr.send(t):console.error("WebSocket is not open. Unable to send message.")}function Eb(t){try{const e=JSON.stringify(t),n=lF(e);aF(n)}catch{}}function lF(t){return new TextEncoder().encode(t).buffer}const Fu=Yn([]);function cF(t){const e=t.type.value;switch(e){case"button":uF(t),wc.isVisible=!0;break;case"slider":dF(t),wc.isVisible=!0;break;case"number_field":fF(t),wc.isVisible=!0;break;case"timeline":hF(t);break;default:console.warn("Unknown component type:",e)}}function uF(t){const e={id:Date.now(),component:"Button",label:t.label?.value,props:{text:t.text.value,variant:t.variant.value},action:t.guid.value};Fu.push(e)}function dF(t){const e={id:Date.now(),component:"Slider",label:t.label?.value,props:{min:t.min.value,max:t.max.value,step:t.step.value,defaultValue:[t.default_value.value]},action:t.guid.value};Fu.push(e)}function fF(t){const e={id:Date.now(),component:"NumberField",label:t.label?.value,props:{min:t.min.value,max:t.max.value,step:t.step.value,value:t.value.value},action:t.guid.value};Fu.push(e)}function hF(t){je.id=t.guid.value,je.totalTime=t.total_time.value,je.step=t.step.value,t.value&&t.value.value!==void 0&&(je.currentTime=[t.value.value]),je.isVisible=!0,console.log("⏱️ Timeline intercepted! Total time:",je.totalTime)}function Wa(t,e){const n={dispatch:"ui_callback",action:t,value:null};e!==void 0&&(n.value=e),Eb(n)}const pF={class:"flex items-center gap-3"},mF=["title"],gF={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vF={key:1,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},_F={key:2,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},xF={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor"},yF={key:1,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor"},bF={class:"text-sm font-mono text-zinc-500 w-12 text-right"},SF={class:"text-sm font-mono text-zinc-500 w-12"},$v=130,wF=Fe({__name:"TrajectoryTimeline",setup(t){const e=u=>{const d=Math.sign(u.deltaY);let f=je.currentTime[0]+d*je.step*10;f=Math.max(0,Math.min(f,je.totalTime)),je.currentTime=[f]},n=()=>{je.isPlaying=!1},i=()=>{const u=[.5,1,1.5,2],f=(u.indexOf(je.speedMultiplier)+1)%u.length;je.speedMultiplier=u[f]},r=()=>{const u=["free","look","follow"],d=u.indexOf(je.cameraMode);je.cameraMode=u[(d+1)%u.length]};let s=null,o=0;const a=u=>{if(!je.isPlaying)return;o||(o=u);const d=(u-o)/1e3;o=u;let f=je.currentTime[0]+d*je.speedMultiplier;f>=je.totalTime&&(je.isLooping?f=0:(f=je.totalTime,je.isPlaying=!1)),je.currentTime=[f],je.isPlaying&&(s=requestAnimationFrame(a))};en(()=>je.isPlaying,u=>{u?(je.currentTime[0]>=je.totalTime&&(je.currentTime=[0]),o=performance.now(),s=requestAnimationFrame(a)):s&&(cancelAnimationFrame(s),s=null)}),ra(()=>{s&&cancelAnimationFrame(s)});let l=null,c=0;return en(()=>je.currentTime[0],u=>{if(!je.id)return;const d=Date.now(),f=d-c;f>=$v?(c=d,Wa(je.id,[u])):(l&&clearTimeout(l),l=setTimeout(()=>{c=Date.now(),Wa(je.id,[u])},$v-f))}),(u,d)=>M(je).isVisible?(me(),Mt("div",{key:0,class:"fixed bottom-0 left-0 w-full px-8 py-4 bg-white/80 dark:bg-zinc-950/80 backdrop-blur-md border-t z-50 flex items-center gap-6 shadow-lg",onWheel:ei(e,["prevent"])},[He("div",pF,[He("button",{onClick:r,class:dn(["p-2 rounded hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors flex items-center justify-center w-10 h-10",{"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20":M(je).cameraMode!=="free","text-zinc-500":M(je).cameraMode==="free"}]),title:`Camera: ${M(je).cameraMode.toUpperCase()}`},[M(je).cameraMode==="free"?(me(),Mt("svg",gF,[...d[3]||(d[3]=[He("path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"},null,-1),He("circle",{cx:"12",cy:"13",r:"3"},null,-1)])])):ri("",!0),M(je).cameraMode==="look"?(me(),Mt("svg",vF,[...d[4]||(d[4]=[He("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"},null,-1),He("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):ri("",!0),M(je).cameraMode==="follow"?(me(),Mt("svg",_F,[...d[5]||(d[5]=[He("polygon",{points:"3 11 22 2 13 21 11 13 3 11"},null,-1),Ht("< ",-1)])])):ri("",!0)],10,mF),He("button",{onClick:d[0]||(d[0]=f=>M(je).isLooping=!M(je).isLooping),class:dn(["p-2 rounded hover:bg-zinc-200 dark:hover:bg-zinc-800 transition-colors",{"text-blue-600 dark:text-blue-400":M(je).isLooping,"text-zinc-500":!M(je).isLooping}]),title:"Toggle Loop"},[...d[6]||(d[6]=[Rw('',1)])],2),He("button",{onClick:d[1]||(d[1]=f=>M(je).isPlaying=!M(je).isPlaying),class:"flex items-center justify-center w-10 h-10 bg-zinc-900 text-white dark:bg-white dark:text-zinc-900 rounded-full hover:scale-105 transition-transform"},[M(je).isPlaying?(me(),Mt("svg",xF,[...d[7]||(d[7]=[He("rect",{x:"6",y:"4",width:"4",height:"16"},null,-1),He("rect",{x:"14",y:"4",width:"4",height:"16"},null,-1)])])):(me(),Mt("svg",yF,[...d[8]||(d[8]=[He("polygon",{points:"5 3 19 12 5 21 5 3"},null,-1)])]))]),He("button",{onClick:i,class:"w-12 text-sm font-semibold text-zinc-600 dark:text-zinc-300 hover:text-zinc-900 dark:hover:text-white transition-colors",title:"Playback Speed"},Ei(M(je).speedMultiplier)+"x ",1)]),He("div",bF,Ei(M(je).currentTime[0].toFixed(2)),1),ie(M(yy),{class:"flex-1 cursor-pointer",modelValue:M(je).currentTime,"onUpdate:modelValue":[d[2]||(d[2]=f=>M(je).currentTime=f),n],max:M(je).totalTime,step:M(je).step},null,8,["modelValue","max","step"]),He("div",SF,Ei(M(je).totalTime.toFixed(2)),1)],32)):ri("",!0)}}),Yv=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Jv=sy,MF=(t,e)=>n=>{var i;if(e?.variants==null)return Jv(t,n?.class,n?.className);const{variants:r,defaultVariants:s}=e,o=Object.keys(r).map(c=>{const u=n?.[c],d=s?.[c];if(u===null)return null;const f=Yv(u)||Yv(d);return r[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(g=>{let[v,m]=g;return Array.isArray(m)?m.includes({...s,...a}[v]):{...s,...a}[v]===m})?[...c,d,f]:c},[]);return Jv(t,o,l,n?.class,n?.className)},un=Fe({__name:"Button",props:{variant:{},size:{},class:{},asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t;return(n,i)=>(me(),Be(M(Sn),{"data-slot":"button",as:t.as,"as-child":t.asChild,class:dn(M(rr)(M(EF)({variant:t.variant,size:t.size}),e.class))},{default:re(()=>[ot(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),EF=MF("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});const TF=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const Kv=t=>t==="";const AF=(...t)=>t.filter((e,n,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===n).join(" ").trim();const Zv=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const CF=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,i)=>i?i.toUpperCase():n.toLowerCase());const PF=t=>{const e=CF(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Ma={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const RF=({name:t,iconNode:e,absoluteStrokeWidth:n,"absolute-stroke-width":i,strokeWidth:r,"stroke-width":s,size:o=Ma.width,color:a=Ma.stroke,...l},{slots:c})=>wr("svg",{...Ma,...l,width:o,height:o,stroke:a,"stroke-width":Kv(n)||Kv(i)||n===!0||i===!0?Number(r||s||Ma["stroke-width"])*24/Number(o):r||s||Ma["stroke-width"],class:AF("lucide",l.class,...t?[`lucide-${Zv(PF(t))}-icon`,`lucide-${Zv(t)}`]:["lucide-icon"]),...!c.default&&!TF(l)&&{"aria-hidden":"true"}},[...e.map(u=>wr(...u)),...c.default?[c.default()]:[]]);const wn=(t,e)=>(n,{slots:i,attrs:r})=>wr(RF,{...r,...n,iconNode:e,name:t},i);const Tb=wn("arrow-big-left-dash",[["path",{d:"M13 9a1 1 0 0 1-1-1V5.061a1 1 0 0 0-1.811-.75l-6.835 6.836a1.207 1.207 0 0 0 0 1.707l6.835 6.835a1 1 0 0 0 1.811-.75V16a1 1 0 0 1 1-1h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1z",key:"p8w4w5"}],["path",{d:"M20 9v6",key:"14roy0"}]]);const Ab=wn("arrow-big-right-dash",[["path",{d:"M11 9a1 1 0 0 0 1-1V5.061a1 1 0 0 1 1.811-.75l6.836 6.836a1.207 1.207 0 0 1 0 1.707l-6.836 6.835a1 1 0 0 1-1.811-.75V16a1 1 0 0 0-1-1H9a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z",key:"67vhrh"}],["path",{d:"M4 9v6",key:"bns7oa"}]]);const DF=wn("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);const IF=wn("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);const NF=wn("cuboid",[["path",{d:"m21.12 6.4-6.05-4.06a2 2 0 0 0-2.17-.05L2.95 8.41a2 2 0 0 0-.95 1.7v5.82a2 2 0 0 0 .88 1.66l6.05 4.07a2 2 0 0 0 2.17.05l9.95-6.12a2 2 0 0 0 .95-1.7V8.06a2 2 0 0 0-.88-1.66Z",key:"1u2ovd"}],["path",{d:"M10 22v-8L2.25 9.15",key:"11pn4q"}],["path",{d:"m10 14 11.77-6.87",key:"1kt1wh"}]]);const LF=wn("image-down",[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19 3 3v-5.5",key:"9ldu5r"}],["path",{d:"m17 22 3-3",key:"1nkfve"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);const OF=wn("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const FF=wn("move-3d",[["path",{d:"M5 3v16h16",key:"1mqmf9"}],["path",{d:"m5 19 6-6",key:"jh6hbb"}],["path",{d:"m2 6 3-3 3 3",key:"tkyvxa"}],["path",{d:"m18 16 3 3-3 3",key:"1d4glt"}]]);const Cb=wn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const UF=wn("pointer-off",[["path",{d:"M10 4.5V4a2 2 0 0 0-2.41-1.957",key:"jsi14n"}],["path",{d:"M13.9 8.4a2 2 0 0 0-1.26-1.295",key:"hirc7f"}],["path",{d:"M21.7 16.2A8 8 0 0 0 22 14v-3a2 2 0 1 0-4 0v-1a2 2 0 0 0-3.63-1.158",key:"1jxb2e"}],["path",{d:"m7 15-1.8-1.8a2 2 0 0 0-2.79 2.86L6 19.7a7.74 7.74 0 0 0 6 2.3h2a8 8 0 0 0 5.657-2.343",key:"10r7hm"}],["path",{d:"M6 6v8",key:"tv5xkp"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const kF=wn("pointer",[["path",{d:"M22 14a8 8 0 0 1-8 8",key:"56vcr3"}],["path",{d:"M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1agjmk"}],["path",{d:"M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1",key:"wdbh2u"}],["path",{d:"M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10",key:"1ibuk9"}],["path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"g6ys72"}]]);const BF=wn("rectangle-horizontal",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]);const zF=wn("rectangle-vertical",[["rect",{width:"12",height:"20",x:"6",y:"2",rx:"2",key:"1oxtiu"}]]);const VF=wn("rotate-3d",[["path",{d:"M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2",key:"10n0gc"}],["path",{d:"m15.194 13.707 3.814 1.86-1.86 3.814",key:"16shm9"}],["path",{d:"M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4",key:"1lxi77"}]]);const HF=wn("scale-3d",[["path",{d:"M5 7v11a1 1 0 0 0 1 1h11",key:"13dt1j"}],["path",{d:"M5.293 18.707 11 13",key:"ezgbsx"}],["circle",{cx:"19",cy:"19",r:"2",key:"17f5cg"}],["circle",{cx:"5",cy:"5",r:"2",key:"1gwv83"}]]);const GF=wn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const WF=wn("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ao=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},qF={class:"right-bar"},XF={id:"data-container"},$F={class:"metadata item"},YF={__name:"ObjectInfo",setup(t){wi.data&&Object.fromEntries(Object.entries(wi.data).filter(([n])=>n!=="dispatch"));const e=()=>{wi.isVisible=!wi.isVisible};return(n,i)=>(me(),Mt("div",qF,[He("div",{class:dn(["theme object-info",{"is-hidden":!M(wi).isVisible}]),id:"info-panel"},[He("div",XF,[He("div",$F,[i[2]||(i[2]=He("h1",{class:"text-lg font-bold section-title"},"METADATA",-1)),(me(!0),Mt(nn,null,ll(M(wi).data,(r,s)=>(me(),Mt("div",{key:s,class:"data-entry"},[He("p",null,[He("strong",null,Ei(s)+":",1),Ht(" "+Ei(r.value),1)])]))),128))])]),ie(M(un),{variant:"secondary",size:"icon",id:"closeObjectBar",onClick:i[0]||(i[0]=r=>e())},{default:re(()=>[ie(M(Ab))]),_:1})],2),ie(M(un),{variant:"secondary",size:"icon",id:"openObjectBar",class:dn({"is-hidden":!M(wi).isVisible}),onClick:i[1]||(i[1]=r=>e())},{default:re(()=>[ie(M(Tb))]),_:1},8,["class"])]))}},JF=ao(YF,[["__scopeId","data-v-97adc036"]]);function Pb(t){return{id:`view-${Date.now()}`,name:t,cameraPosition:{x:Ft.position.x,y:Ft.position.y,z:Ft.position.z},target:{x:an.target.x,y:an.target.y,z:an.target.z},zoom:Ft.zoom,fov:Ft.fov}}function KF(t){Ft.position.set(t.cameraPosition.x,t.cameraPosition.y,t.cameraPosition.z),an.target.set(t.target.x,t.target.y,t.target.z),Ft.zoom=t.zoom,Ft.fov=t.fov,Ft.updateProjectionMatrix(),an.update()}function jv(t,e){return!Number.isFinite(t)||t<=0?e:Math.max(16,Math.round(t))}function ZF(t,e,n){const i=document.createElement("canvas");i.width=t,i.height=e;const r=i.getContext("2d");if(!r)throw new Error("Unable to create screenshot canvas context");const s=rn.domElement,o=s.getBoundingClientRect(),a=Math.round(o.width)||s.clientWidth||s.width,l=Math.round(o.height)||s.clientHeight||s.height;n==="jpg"?(r.fillStyle="#ffffff",r.fillRect(0,0,t,e)):r.clearRect(0,0,t,e);const c=Math.max(t/a,e/l),u=Math.round(a*c),d=Math.round(l*c),f=Math.floor((t-u)/2),h=Math.floor((e-d)/2);return r.drawImage(s,f,h,u,d),i}function jF(t,e){const n=document.createElement("a");n.download=e,n.href=t,n.click()}function QF(t){return`compas-view-${new Date().toISOString().replace(/[:.]/g,"-")}.${t}`}function Rb(t={}){an.update(),rn.render(Vt,Ft);const e=t.format??"png",n=rn.domElement.width||rn.domElement.clientWidth,i=rn.domElement.height||rn.domElement.clientHeight,r=jv(t.width??n,n),s=jv(t.height??i,i),o=ZF(r,s,e),a=e==="jpg"?"image/jpeg":e==="webp"?"image/webp":"image/png",l=e==="jpg"?t.quality??.92:void 0,c=e==="jpg"?"jpg":e==="webp"?"webp":"png",u=t.fileName??QF(c),d=o.toDataURL(a,l);jF(d,u)}function eU(t){if(t.ctrlKey||t.metaKey||t.altKey)return!0;const e=t.target;if(!e)return!1;const n=e.tagName;return n==="INPUT"||n==="TEXTAREA"||n==="SELECT"?!0:e.isContentEditable}function rm(t){const e=n=>{if(eU(n))return;const i=n.key.toLowerCase(),r=t[i];r&&(n.preventDefault(),r(n))};Ni(()=>{document.addEventListener("keydown",e)}),yu(()=>{document.removeEventListener("keydown",e)})}const or=Fe({__name:"Kbd",props:{class:{}},setup(t){const e=t;return(n,i)=>(me(),Mt("kbd",{class:dn(M(rr)("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3","[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",e.class))},[ot(n.$slots,"default")],2))}}),gi=Fe({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const r=nr(t,e);return(s,o)=>(me(),Be(M(AT),vs(zr(M(r))),{default:re(()=>[ot(s.$slots,"default")]),_:3},16))}}),vi=Fe({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:e}){const n=t,i=e,r=to(n,"class"),s=nr(r,i);return(o,a)=>(me(),Be(M(LT),null,{default:re(()=>[ie(M(IT),Nt({...M(s),...o.$attrs},{class:M(rr)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:re(()=>[ot(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Fi=Fe({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const e=t;return(n,i)=>(me(),Be(M(MT),vs(zr(e)),{default:re(()=>[ot(n.$slots,"default")]),_:3},16))}}),_i=Fe({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,i)=>(me(),Be(M(FT),vs(zr(e)),{default:re(()=>[ot(n.$slots,"default")]),_:3},16))}}),tU=Fe({__name:"MoveButton",setup(t){function e(){Ar("translate"),Mr.value="translate"}return(n,i)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),null,{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon",class:dn({active:M(Mr).value=="translate",disabled:!M(_n).value}),onClick:e,disabled:!M(_n).value},{default:re(()=>[ie(M(FF))]),_:1},8,["class","disabled"])]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[i[1]||(i[1]=Ht("Move mode ",-1)),ie(M(or),null,{default:re(()=>[...i[0]||(i[0]=[Ht("W",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),nU=Fe({__name:"RotateButton",setup(t){function e(){Ar("rotate"),Mr.value="rotate"}return(n,i)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),null,{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon",class:dn({active:M(Mr).value=="rotate",disabled:!M(_n).value}),onClick:e,disabled:!M(_n).value},{default:re(()=>[ie(M(VF),{size:16,"stroke-width":2,"aria-hidden":"true"})]),_:1},8,["class","disabled"])]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[i[1]||(i[1]=Ht("Rotate mode ",-1)),ie(M(or),null,{default:re(()=>[...i[0]||(i[0]=[Ht("E",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),iU={class:"button-icon"},rU=Fe({__name:"ScaleButton",props:{active:{type:Boolean}},emits:["activated"],setup(t,{emit:e}){function n(){Ar("scale"),Mr.value="scale"}return(i,r)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),null,{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon",class:dn(["toolbar-button",{active:M(Mr).value=="scale",disabled:!M(_n).value}]),onClick:n,disabled:!M(_n).value},{default:re(()=>[He("span",iU,[ie(M(HF),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1},8,["class","disabled"])]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[r[1]||(r[1]=Ht("Rotate mode ",-1)),ie(M(or),null,{default:re(()=>[...r[0]||(r[0]=[Ht("R",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),sU={key:0},oU={key:1},aU=Fe({__name:"EnablePicker",setup(t){function e(){_n.value=!_n.value}return(n,i)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),null,{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon",onClick:e,class:dn({active:!M(_n).value})},{default:re(()=>[M(_n).value?(me(),Mt("span",sU,[ie(M(kF))])):(me(),Mt("span",oU,[ie(M(UF))]))]),_:1},8,["class"])]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[i[1]||(i[1]=Ht("Enable/Disable object selection ",-1)),ie(M(or),null,{default:re(()=>[...i[0]||(i[0]=[Ht("P",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),lU={class:"toolbar-group"},cU=Fe({__name:"TransformGroup",setup(t){const e=Ve(null);function n(i){e.value=i}return rm({w:()=>{Ar("translate"),n("move")},e:()=>{Ar("rotate"),n("rotate")},r:()=>{Ar("scale"),n("scale")}}),(i,r)=>(me(),Mt("div",lU,[ie(M(aU),{active:e.value==="move",onActivated:r[0]||(r[0]=s=>n("move"))},null,8,["active"]),ie(M(tU),{active:e.value==="move",onActivated:r[1]||(r[1]=s=>n("move"))},null,8,["active"]),ie(M(nU),{active:e.value==="rotate",onActivated:r[2]||(r[2]=s=>n("rotate"))},null,8,["active"]),ie(M(rU),{active:e.value==="scale",onActivated:r[3]||(r[3]=s=>n("scale"))},null,8,["active"])]))}}),uU=Fe({__name:"TopViewButton",setup(t){function e(){us("top")}return(n,i)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),null,{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:re(()=>[ie(M(zF))]),_:1})]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[i[1]||(i[1]=Ht("Top view ",-1)),ie(M(or),null,{default:re(()=>[...i[0]||(i[0]=[Ht("5",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),dU=Fe({__name:"FrontViewButton",setup(t){function e(){us("front")}return(n,i)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),null,{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon",onClick:e},{default:re(()=>[ie(M(GF))]),_:1})]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[i[1]||(i[1]=Ht("Front view ",-1)),ie(M(or),null,{default:re(()=>[...i[0]||(i[0]=[Ht("2",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),fU={class:"button-icon"},hU=Fe({__name:"RightViewButton",setup(t){function e(){us("right")}return(n,i)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),null,{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:re(()=>[He("span",fU,[ie(M(BF),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1})]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[i[1]||(i[1]=Ht("Right view ",-1)),ie(M(or),null,{default:re(()=>[...i[0]||(i[0]=[Ht("6",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),pU={class:"button-icon"},mU=Fe({__name:"PerspectiveViewButton",setup(t){function e(){us("front_right")}return(n,i)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),null,{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon",class:"toolbar-button",onClick:e},{default:re(()=>[He("span",pU,[ie(M(NF),{size:16,"stroke-width":2,"aria-hidden":"true"})])]),_:1})]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[i[1]||(i[1]=Ht("Perspective view ",-1)),ie(M(or),null,{default:re(()=>[...i[0]||(i[0]=[Ht("3",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),gU={class:"toolbar-group"},vU=Fe({__name:"ViewGroup",setup(t){return rm({2:()=>{us("front")},3:()=>{us("front_right")},5:()=>{us("top")},6:()=>{us("right")}}),(e,n)=>(me(),Mt("div",gU,[ie(M(uU)),ie(M(dU)),ie(M(hU)),ie(M(mU))]))}}),_U={class:"button-icon save-view-icon"},xU={class:"save-view-overlay","aria-hidden":"true"},yU=Fe({__name:"SaveViewButton",props:{defaultName:{}},emits:["saved"],setup(t,{emit:e}){const n=t,i=e;function r(){const s=window.prompt("Name for saved view",n.defaultName);if(s===null)return;const o=s.trim()||n.defaultName,a=Pb(o);i("saved",a)}return(s,o)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),null,{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon",onClick:r},{default:re(()=>[He("span",_U,[ie(M(DF),{size:15,"stroke-width":2,"aria-hidden":"true"}),He("span",xU,[ie(M(Cb),{class:"save-view-overlay-icon"})])])]),_:1})]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[o[1]||(o[1]=Ht("Save Current View ",-1)),ie(M(or),null,{default:re(()=>[...o[0]||(o[0]=[Ht("S",-1)])]),_:1})])]),_:1})]),_:1})]),_:1}))}}),bU=ao(yU,[["__scopeId","data-v-49e45054"]]),Db=Fe({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const r=nr(t,e);return(s,o)=>(me(),Be(M($E),vs(zr(M(r))),{default:re(()=>[ot(s.$slots,"default")]),_:3},16))}}),Ib=Fe({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,i)=>(me(),Be(M(rT),vs(zr(e)),{default:re(()=>[ot(n.$slots,"default")]),_:3},16))}}),Nb=Fe({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:8},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,i=e,r=to(n,"class"),s=nr(r,i);return(o,a)=>(me(),Be(M(nT),null,{default:re(()=>[ie(M(eT),Nt({...M(s),...o.$attrs},{class:M(rr)("z-50 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:re(()=>[ot(o.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),SU={class:"inline-flex h-full w-full items-center justify-center"},wU={class:"flex h-8 items-stretch overflow-hidden rounded-lg border border-input bg-secondary"},MU={key:0,disabled:"",value:""},EU=["value"],TU=Fe({__name:"SavedViewsButton",props:{views:{},selectedViewId:{}},emits:["select","delete"],setup(t,{emit:e}){const n=t,i=e,r=Ve(!1),s=Ve(""),o=Ve(!1);let a=null;en(()=>[n.selectedViewId,n.views],([u,d])=>{if(d.length===0){s.value="";return}const f=d.some(h=>h.id===u);s.value=f?u:d[0].id},{immediate:!0});function l(){s.value&&i("select",s.value)}function c(){s.value&&(o.value=!0,a&&clearTimeout(a),a=setTimeout(()=>{o.value=!1,a=null},160),i("delete",s.value))}return yu(()=>{a&&clearTimeout(a)}),(u,d)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(Db),{open:r.value,"onUpdate:open":d[1]||(d[1]=f=>r.value=f),modal:!0},{default:re(()=>[ie(M(Ib),{"as-child":""},{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon"},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),{"as-child":""},{default:re(()=>[He("span",SU,[ie(M(IF))])]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[...d[2]||(d[2]=[He("p",null,"Saved views",-1)])]),_:1})]),_:1})]),_:1})]),_:1}),ie(M(Nb),{class:"theme z-[4000] w-72 rounded-xl p-2 text-secondary-foreground",side:"bottom",align:"start"},{default:re(()=>[He("div",wU,[vc(He("select",{"onUpdate:modelValue":d[0]||(d[0]=f=>s.value=f),class:"h-full flex-1 border-0 bg-transparent px-3 py-1 text-sm text-secondary-foreground outline-none",onChange:l},[t.views.length===0?(me(),Mt("option",MU," No saved views ")):ri("",!0),(me(!0),Mt(nn,null,ll(t.views,f=>(me(),Mt("option",{key:f.id,value:f.id},Ei(f.name),9,EU))),128))],544),[[hx,s.value]]),ie(M(gi),null,{default:re(()=>[ie(M(_i),{"as-child":""},{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon-sm",class:dn(["h-full w-8 rounded-none border-l border-input transition-[background-color,color,box-shadow]",{"saved-view-delete-pressed":o.value}]),disabled:!s.value,onClick:ei(c,["stop"])},{default:re(()=>[ie(M(WF),{class:"h-3 w-3"})]),_:1},8,["class","disabled"])]),_:1}),ie(M(vi),{class:"z-[4100]",side:"bottom"},{default:re(()=>[...d[3]||(d[3]=[He("p",null,"Delete saved view",-1)])]),_:1})]),_:1})])]),_:1})]),_:1},8,["open"])]),_:1}))}}),AU=ao(TU,[["__scopeId","data-v-95b0c23f"]]),CU={class:"inline-flex h-full w-full items-center justify-center"},PU={class:"grid gap-5"},RU={class:"grid gap-3"},DU={class:"grid grid-cols-3 items-center gap-4"},IU={class:"grid grid-cols-3 items-center gap-4"},NU={class:"grid grid-cols-3 items-center gap-4"},LU={class:"flex justify-end gap-2"},OU=Fe({__name:"SaveScreenshotButton",setup(t){const e=Ve(!1),n=Ve(1920),i=Ve(1080),r=Ve("png");function s(l,c){return Number.isFinite(l)?Math.min(8192,Math.max(64,Math.round(l))):c}function o(){const l=rn.domElement;if(!l)return;const c=l.getBoundingClientRect(),u=Math.round(c.width)||l.clientWidth||l.width,d=Math.round(c.height)||l.clientHeight||l.height;n.value=s(u,n.value),i.value=s(d,i.value)}function a(){Rb({width:s(n.value,1920),height:s(i.value,1080),format:r.value}),e.value=!1}return en(e,l=>{l&&o()}),(l,c)=>(me(),Be(M(Fi),{"delay-duration":600},{default:re(()=>[ie(M(Db),{open:e.value,"onUpdate:open":c[4]||(c[4]=u=>e.value=u),modal:!0},{default:re(()=>[ie(M(Ib),{"as-child":""},{default:re(()=>[ie(M(un),{variant:"secondary",size:"icon"},{default:re(()=>[ie(M(gi),null,{default:re(()=>[ie(M(_i),{"as-child":""},{default:re(()=>[He("span",CU,[ie(M(LF))])]),_:1}),ie(M(vi),{class:"z-1000",side:"bottom"},{default:re(()=>[He("p",null,[c[6]||(c[6]=Ht("Save screenshot ",-1)),ie(M(or),null,{default:re(()=>[...c[5]||(c[5]=[Ht("F",-1)])]),_:1})])]),_:1})]),_:1})]),_:1})]),_:1}),ie(M(Nb),{class:"theme z-[4000] w-84 rounded-xl p-5 text-secondary-foreground",side:"bottom",align:"start"},{default:re(()=>[He("div",PU,[c[13]||(c[13]=He("div",{class:"space-y-2"},[He("h4",{class:"font-medium leading-none"}," Export Screenshot "),He("p",{class:"text-sm text-muted-foreground"}," Set width, height, and image format. ")],-1)),He("div",RU,[He("div",DU,[c[7]||(c[7]=He("label",{for:"screenshot-width",class:"text-sm"},"Width",-1)),vc(He("input",{id:"screenshot-width","onUpdate:modelValue":c[0]||(c[0]=u=>n.value=u),type:"number",min:"64",max:"8192",class:"col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},null,512),[[Xm,n.value,void 0,{number:!0}]])]),He("div",IU,[c[8]||(c[8]=He("label",{for:"screenshot-height",class:"text-sm"},"Height",-1)),vc(He("input",{id:"screenshot-height","onUpdate:modelValue":c[1]||(c[1]=u=>i.value=u),type:"number",min:"64",max:"8192",class:"col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},null,512),[[Xm,i.value,void 0,{number:!0}]])]),He("div",NU,[c[10]||(c[10]=He("label",{for:"screenshot-format",class:"text-sm"},"Format",-1)),vc(He("select",{id:"screenshot-format","onUpdate:modelValue":c[2]||(c[2]=u=>r.value=u),class:"col-span-2 h-8 rounded-lg border border-input bg-secondary px-3 py-1 text-sm text-secondary-foreground shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]"},[...c[9]||(c[9]=[He("option",{value:"png"},"PNG",-1),He("option",{value:"jpg"},"JPG",-1),He("option",{value:"webp"},"WEBP",-1)])],512),[[hx,r.value]])])]),He("div",LU,[ie(M(un),{variant:"secondary",size:"sm",onClick:c[3]||(c[3]=u=>e.value=!1)},{default:re(()=>[...c[11]||(c[11]=[Ht("Cancel",-1)])]),_:1}),ie(M(un),{variant:"secondary",size:"sm",onClick:a},{default:re(()=>[...c[12]||(c[12]=[Ht("Save",-1)])]),_:1})])])]),_:1})]),_:1},8,["open"])]),_:1}))}}),FU={class:"display-tools-wrapper"},UU={class:"toolbar-group"},Qv="compas_threejs_saved_views",kU=Fe({__name:"DisplayGroup",setup(t){const e=Ve([]),n=Ve("");function i(){localStorage.setItem(Qv,JSON.stringify(e.value))}function r(){const c=localStorage.getItem(Qv);if(c)try{const u=JSON.parse(c);Array.isArray(u)&&(e.value=u)}catch{e.value=[]}}function s(c){e.value=[...e.value,c],n.value=c.id,i()}function o(){const c=`View ${e.value.length+1}`,u=window.prompt("Name for saved view",c);if(u===null)return;const d=u.trim()||c,f=Pb(d);s(f)}function a(c){n.value=c;const u=e.value.find(d=>d.id===c);u&&KF(u)}function l(c){const u=e.value.filter(d=>d.id!==c);e.value=u,n.value===c&&(n.value=u[0]?.id??""),i()}return Ni(()=>{r()}),rm({s:()=>{o()},f:()=>{Rb({format:"png"})}}),(c,u)=>(me(),Mt("div",FU,[He("div",UU,[ie(M(bU),{"default-name":`View ${e.value.length+1}`,onSaved:s},null,8,["default-name"]),ie(M(AU),{views:e.value,"selected-view-id":n.value,onSelect:a,onDelete:l},null,8,["views","selected-view-id"]),ie(M(OU))])]))}}),BU={class:"toolbar theme"},zU=Fe({__name:"Toolbar",setup(t){return(e,n)=>(me(),Mt("div",BU,[n[0]||(n[0]=He("h1",{class:"text-lg font-bold"},"COMPAS ThreeJs",-1)),ie(cU),ie(vU),ie(kU)]))}}),VU=ao(zU,[["__scopeId","data-v-8f0a01f7"]]),HU=Fe({__name:"NumberField",props:{defaultValue:{},modelValue:{},min:{},max:{},step:{},stepSnapping:{type:Boolean},focusOnChange:{type:Boolean},formatOptions:{},locale:{},disabled:{type:Boolean},readonly:{type:Boolean},disableWheelChange:{type:Boolean},invertWheelChange:{type:Boolean},id:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,i=e,r=to(n,"class"),s=nr(r,i);return(o,a)=>(me(),Be(M(mT),Nt(M(s),{class:M(rr)("grid gap-1.5",n.class)}),{default:re(l=>[ot(o.$slots,"default",vs(zr(l)))]),_:3},16,["class"]))}}),GU=Fe({__name:"NumberFieldContent",props:{class:{}},setup(t){const e=t;return(n,i)=>(me(),Mt("div",{class:dn(M(rr)("relative [&>[data-slot=input]]:has-[[data-slot=increment]]:pr-5 [&>[data-slot=input]]:has-[[data-slot=decrement]]:pl-5",e.class))},[ot(n.$slots,"default")],2))}}),WU=Fe({__name:"NumberFieldDecrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=to(e,"class"),i=dl(n);return(r,s)=>(me(),Be(M(vT),Nt({"data-slot":"decrement"},M(i),{class:M(rr)("absolute top-1/2 -translate-y-1/2 left-0 p-3 disabled:cursor-not-allowed disabled:opacity-20",e.class)}),{default:re(()=>[ot(r.$slots,"default",{},()=>[ie(M(OF),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),qU=Fe({__name:"NumberFieldIncrement",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=to(e,"class"),i=dl(n);return(r,s)=>(me(),Be(M(xT),Nt({"data-slot":"increment"},M(i),{class:M(rr)("absolute top-1/2 -translate-y-1/2 right-0 disabled:cursor-not-allowed disabled:opacity-20 p-3",e.class)}),{default:re(()=>[ot(r.$slots,"default",{},()=>[ie(M(Cb),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),XU=Fe({__name:"NumberFieldInput",props:{class:{}},setup(t){const e=t;return(n,i)=>(me(),Be(M(bT),{"data-slot":"input",class:dn(M(rr)("flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-sm text-center shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e.class))},null,8,["class"]))}}),$U={key:0,class:"dynamic-label"},YU={key:2,class:"slider-container"},JU={key:0,class:"slider-value"},KU={key:3,class:"number-field-container"},ZU=Fe({__name:"Openbar",setup(t){const e=Ve(!0);function n(){e.value=!e.value}return document.addEventListener("keydown",i=>{(i.key==="Q"||i.key==="q")&&n()}),(i,r)=>(me(),Mt(nn,null,[He("div",{id:"openbar",class:dn(["theme",{"is-hidden":!e.value}])},[(me(!0),Mt(nn,null,ll(M(Fu),s=>(me(),Mt("div",{key:s.id,class:"dynamic-item"},[s.label?(me(),Mt("label",$U,Ei(s.label),1)):ri("",!0),s.component==="Button"?(me(),Be(M(un),{key:1,variant:"secondary",onClick:o=>M(Wa)(s.action)},{default:re(()=>[Ht(Ei(s.props.text),1)]),_:2},1032,["onClick"])):s.component==="Slider"?(me(),Mt("div",YU,[ie(M(yy),{min:s.props.min,max:s.props.max,step:s.props.step,"default-value":s.props.defaultValue,modelValue:s.props.defaultValue,"onUpdate:modelValue":[o=>s.props.defaultValue=o,o=>M(Wa)(s.action,o[0])],class:"w-[80%]"},null,8,["min","max","step","default-value","modelValue","onUpdate:modelValue"]),s.props.defaultValue?(me(),Mt("span",JU,Ei(s.props.defaultValue[0]),1)):ri("",!0)])):s.component==="NumberField"?(me(),Mt("div",KU,[ie(M(HU),{min:s.props.min,max:s.props.max,step:s.props.step,"default-value":s.props.value,modelValue:s.props.value,"onUpdate:modelValue":[o=>s.props.value=o,o=>M(Wa)(s.action,o)],class:"w-full"},{default:re(()=>[ie(M(GU),null,{default:re(()=>[ie(M(WU)),ie(M(XU)),ie(M(qU))]),_:1})]),_:1},8,["min","max","step","default-value","modelValue","onUpdate:modelValue"])])):ri("",!0)]))),128)),ie(M(un),{variant:"secondary",size:"icon",class:"mb-4",onClick:r[0]||(r[0]=s=>n())},{default:re(()=>[ie(M(Tb))]),_:1})],2),ie(M(un),{variant:"secondary",size:"icon",class:dn(["mb-5",{"is-hidden":!e.value}]),onClick:r[1]||(r[1]=s=>n())},{default:re(()=>[ie(M(Ab))]),_:1},8,["class"])],64))}}),jU=ao(ZU,[["__scopeId","data-v-2776f440"]]),QU={id:"sidebar"},ek={__name:"Sidebar",setup(t){return(e,n)=>(me(),Mt("div",QU,[ie(VU),M(wc).isVisible?(me(),Be(jU,{key:0})):ri("",!0)]))}},tk=ao(ek,[["__scopeId","data-v-ad216085"]]),nk={class:"app-container"},ik=Fe({__name:"App",setup(t){const e=Ve(null);return Ni(()=>{e.value&&(e.value.appendChild(rn.domElement),oF())}),(n,i)=>(me(),Mt(nn,null,[He("div",nk,[ie(tk),He("div",{ref_key:"threeContainer",ref:e,class:"three-container"},null,512),ie(JF)]),ie(wF)],64))}}),rk=ao(ik,[["__scopeId","data-v-be99da2e"]]),sk=fM(rk);sk.mount("#app"); diff --git a/src/compas_threejs/viewer/server.py b/src/compas_threejs/viewer/server.py index edfedf6..a66ac56 100644 --- a/src/compas_threejs/viewer/server.py +++ b/src/compas_threejs/viewer/server.py @@ -20,15 +20,22 @@ async def websocket_endpoint(websocket: WebSocket): await websocket.accept() clients.add(websocket) - current_state = scene_state.copy() - for guid, buffer in current_state.items(): - await websocket.send_bytes(buffer) + try: + current_state = scene_state.copy() + for guid, buffer in current_state.items(): + await websocket.send_bytes(buffer) + except (WebSocketDisconnect, ConnectionAbortedError): + clients.discard(websocket) + return try: while True: data = await websocket.receive_bytes() if viewer_instance: viewer_instance.on_message(data) - except WebSocketDisconnect: + except (WebSocketDisconnect, ConnectionAbortedError): + clients.discard(websocket) + except Exception as e: + print(f"Unexpected error: {e}") clients.discard(websocket) diff --git a/src/compas_threejs/viewer/viewer.py b/src/compas_threejs/viewer/viewer.py index e2affe6..138617f 100644 --- a/src/compas_threejs/viewer/viewer.py +++ b/src/compas_threejs/viewer/viewer.py @@ -475,6 +475,34 @@ def update_metadata(self, metadata): self._metadata_registry[key] = metadata break + def transform(self, geometry, matrix): + """ + Updates only the 4x4 transformation matrix of an existing object. + + Parameters + ---------- + geometry : compas.geometry.Geometry | str + The geometry object to be transformed, or its unique GUID string. + matrix : compas.geometry.Transformation | list + The 4x4 transformation matrix. + """ + obj_id = getattr(geometry, 'guid', geometry) + + if hasattr(matrix, 'list'): + flat_matrix = matrix.list + else: + if isinstance(matrix[0], (list, tuple)): + flat_matrix = [item for sublist in matrix for item in sublist] + else: + flat_matrix = list(matrix) + + message = { + "dispatch": "transform", + "guid": str(obj_id), + "matrix": flat_matrix + } + self._send_dictionary_message(message) + # ---- TEXT -------------------------------------------------------------------------------- def add_text(self, text, material=None):