implement another usability test

This commit is contained in:
MrPlatnum committed 2025-09-25 16:03:44 +02:00
1 parent eb69558504
commit b09823850b
14 files changed
+1665 -68

No files matched your search

Binary file not shown.
+4
View File
@@ -18,6 +18,10 @@ export const routes: Routes = [
path: 'completion',
loadComponent: () => import('./components/completion/completion.component').then(c => c.CompletionComponent)
},
{
path: 'test',
loadComponent: () => import('./components/test-suite/assessments/preivew/ceiling-placement-demonstrator.component').then(c => c.CeilingPlacementDemonstratorComponent)
},
{
path: '**',
redirectTo: '/consent'
@@ -17,8 +17,8 @@
<div class="space-y-4 text-gray-700">
<p>
<strong>Zweck:</strong> Diese empirische Studie untersucht optimale Design-Parameter für
deckenbasierte Augmented-Reality-Anwendungen.
<strong>Zweck:</strong> Diese Studie untersucht optimale Design-Parameter für
deckenbasierte Augmented-Reality-Anwendungen. In dieser Simulation geht es darum ein Einkaufserlebnis für eine Deckenlampe zu simulieren um die Benutzbarkeit der Software abschätzen zu können.
</p>
<div>
@@ -35,6 +35,7 @@
<p>
<strong>Datenschutz:</strong> Alle erhobenen Daten werden anonymisiert und ausschließlich
für wissenschaftliche Analysen verwendet. Es werden keine personenbezogenen Daten erfasst.
Es werden keine Bilder oder Videos erfasst.
</p>
<p>
@@ -0,0 +1,142 @@
<div class="min-h-screen bg-gray-50 py-2 px-4">
<div class="max-w-3xl mx-auto bg-white rounded-lg shadow-lg p-8">
<div class="text-center mb-8">
<h2 class="text-3xl font-bold text-gray-900">Abschließender Fragebogen</h2>
<p class="text-gray-600 mt-2">Ihre Angaben helfen uns bei der wissenschaftlichen Auswertung der Studie.</p>
</div>
<form [formGroup]="feedbackForm" (ngSubmit)="onSubmit()">
<div class="mb-8">
<h3 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
<span class="bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm mr-3">2</span>
Demografische Angaben
</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label for="age-input" class="block text-sm font-medium text-gray-700 mb-2">Alter *</label>
<input id="age-input" type="number" formControlName="age" min="13" max="120" (change)="logInteraction($event)" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Ihr Alter">
</div>
<div>
<label for="gender-select" class="block text-sm font-medium text-gray-700 mb-2">Geschlecht *</label>
<select id="gender-select" formControlName="gender" (change)="logInteraction($event)" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option [ngValue]="null" disabled>Bitte auswählen</option>
<option value="male">Männlich</option>
<option value="female">Weiblich</option>
<option value="non-binary">Divers</option>
<option value="prefer-not-to-say">Keine Angabe</option>
</select>
</div>
</div>
</div>
<div class="mb-8">
<h3 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
<span class="bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm mr-3">3</span>
Vorerfahrung mit AR/VR
</h3>
<div class="space-y-6">
<div class="p-4 border border-gray-200 rounded-lg">
<label class="block text-sm font-medium text-gray-800 mb-3">Erfahrung mit Augmented Reality (AR) *</label>
<div class="flex justify-between items-center">
<span class="text-xs text-gray-500 w-1/5 text-center">Keine<br>Erfahrung</span>
<div class="flex-grow flex justify-around">
<label *ngFor="let option of [1, 2, 3, 4, 5]" class="flex flex-col items-center cursor-pointer">
<input type="radio" formControlName="arExperience" [value]="option" (change)="logInteraction($event)" class="mb-1 focus:ring-blue-500 text-blue-600">
<span class="text-sm">{{ option }}</span>
</label>
</div>
<span class="text-xs text-gray-500 w-1/5 text-center">Experte</span>
</div>
</div>
<div class="p-4 border border-gray-200 rounded-lg">
<label class="block text-sm font-medium text-gray-800 mb-3">Erfahrung mit Virtual Reality (VR) *</label>
<div class="flex justify-between items-center">
<span class="text-xs text-gray-500 w-1/5 text-center">Keine<br>Erfahrung</span>
<div class="flex-grow flex justify-around">
<label *ngFor="let option of [1, 2, 3, 4, 5]" class="flex flex-col items-center cursor-pointer">
<input type="radio" formControlName="vrExperience" [value]="option" (change)="logInteraction($event)" class="mb-1 focus:ring-blue-500 text-blue-600">
<span class="text-sm">{{ option }}</span>
</label>
</div>
<span class="text-xs text-gray-500 w-1/5 text-center">Experte</span>
</div>
</div>
</div>
</div>
<div class="mb-8">
<h3 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
<span class="bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm mr-3">4</span>
Bewertung der Benutzerfreundlichkeit
</h3>
<p class="text-sm text-gray-600 mb-6">Bitte bewerten Sie die folgende Anwendung anhand der nachstehenden Aussagen auf einer Skala von 1 (stimme überhaupt nicht zu) bis 5 (stimme voll zu).</p>
<div class="space-y-1">
<div *ngFor="let item of usabilityItems; let i = index" class="p-1 border border-gray-200 rounded-lg">
<label class="block text-sm font-medium text-gray-800 mb-3">{{ i + 1 }}. {{ item.label }} *</label>
<div class="flex justify-between items-center text-center">
<span class="text-xs text-gray-500 w-1/5">Stimme überhaupt<br>nicht zu</span>
<div class="flex-grow flex justify-around">
<label *ngFor="let option of [1, 2, 3, 4, 5]" class="flex flex-col items-center cursor-pointer">
<input type="radio" [formControlName]="item.controlName" [value]="option" (change)="logInteraction($event)" class="mb-1 focus:ring-blue-500 text-blue-600">
<span class="text-sm">{{ option }}</span>
</label>
</div>
<span class="text-xs text-gray-500 w-1/5">Stimme<br>voll zu</span>
</div>
</div>
</div>
</div>
<div class="mb-8">
<h3 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
<span class="bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm mr-3">5</span>
Detailliertes Feedback zur Anwendung
</h3>
<p class="text-sm text-gray-600 mb-6">Bitte bewerten Sie die folgenden Aussagen auf einer Skala von 1 (stimme überhaupt nicht zu) bis 7 (stimme voll zu).</p>
<div class="space-y-4">
<div *ngFor="let item of harItems; let i = index" class="p-4 border border-gray-200 rounded-lg">
<label class="block text-sm font-medium text-gray-800 mb-3">{{ i + 1 }}. {{ item.label }} *</label>
<div class="flex justify-between items-center text-center">
<span class="text-xs text-gray-500 w-1/6">Stimme überhaupt<br>nicht zu</span>
<div class="flex-grow flex justify-around">
<label *ngFor="let option of [1, 2, 3, 4, 5, 6, 7]" class="flex flex-col items-center cursor-pointer">
<input type="radio" [formControlName]="item.controlName" [value]="option" (change)="logInteraction($event)" class="mb-1 focus:ring-blue-500 text-blue-600">
<span class="text-sm">{{ option }}</span>
</label>
</div>
<span class="text-xs text-gray-500 w-1/6">Stimme<br>voll zu</span>
</div>
</div>
</div>
</div>
<div class="mb-8">
<h3 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
<span class="bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm mr-3">6</span>
Abschließendes Feedback
</h3>
<div>
<label for="comments-textarea" class="block text-sm font-medium text-gray-700 mb-2">Anmerkungen und Verbesserungsvorschläge</label>
<textarea id="comments-textarea" formControlName="comments" rows="4" (change)="logInteraction($event)" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Ihre Gedanken, Vorschläge oder aufgetretene Probleme..."></textarea>
</div>
</div>
<div class="text-center">
<button id="submit-button" type="submit" (click)="logInteraction($event)" [disabled]="!feedbackForm.valid || isSubmitting" class="bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed text-white font-bold py-3 px-8 rounded-lg text-lg transition-colors duration-200">
<span *ngIf="!isSubmitting">Fragebogen absenden</span>
<span *ngIf="isSubmitting">Wird übermittelt...</span>
</button>
<div *ngIf="!feedbackForm.valid && feedbackForm.touched" class="text-center mt-2">
<p class="text-red-500 text-sm">Bitte füllen Sie alle mit * markierten Pflichtfelder aus.</p>
</div>
</div>
</form>
<div *ngIf="isSubmitted" class="mt-8 p-4 bg-green-100 border border-green-400 text-green-700 rounded-md text-center">
<h4 class="font-semibold">Vielen Dank!</h4>
<p>Ihre Angaben wurden erfolgreich übermittelt. Die Studie ist hiermit abgeschlossen.</p>
</div>
</div>
</div>
@@ -0,0 +1,117 @@
import { Component, EventEmitter, inject, OnInit, Output } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MetricsTrackerService } from '../../../../services/metrics-tracker.service';
@Component({
selector: 'app-feedback',
standalone: true,
imports: [CommonModule, ReactiveFormsModule],
templateUrl: './feedback.component.html',
})
export class FeedbackComponent implements OnInit {
private metricsService = inject(MetricsTrackerService);
private formBuilder = inject(FormBuilder);
@Output() testComplete = new EventEmitter<void>();
feedbackForm!: FormGroup;
isSubmitting = false;
isSubmitted = false;
usabilityItems = [
{ label: 'Ich denke, dass ich diese AR-Anwendung gerne regelmäßig nutzen würde.', controlName: 'usability1' },
{ label: 'Ich empfinde diese AR-Anwendung als unnötig komplex.', controlName: 'usability2' },
{ label: 'Ich empfinde diese AR-Anwendung als einfach zu nutzen.', controlName: 'usability3' },
{ label: 'Ich denke, dass ich technischen Support brauchen würde, um diese AR-Anwendung zu nutzen.', controlName: 'usability4' },
{ label: 'Ich finde, dass die verschiedenen Funktionen dieser AR-Anwendung gut integriert sind.', controlName: 'usability5' },
{ label: 'Ich finde, dass es in dieser AR-Anwendung zu viele Inkonsistenzen gibt.', controlName: 'usability6' },
{ label: 'Ich kann mir vorstellen, dass die meisten Leute diese AR-Anwendung schnell zu beherrschen lernen.', controlName: 'usability7' },
{ label: 'Ich empfinde die Bedienung dieser AR-Anwendung als sehr umständlich.', controlName: 'usability8' },
{ label: 'Ich habe mich bei der Nutzung dieser AR-Anwendung sehr sicher gefühlt.', controlName: 'usability9' },
{ label: 'Ich musste eine Menge Dinge lernen, bevor ich mit dieser AR-Anwendung arbeiten konnte.', controlName: 'usability10' }
];
harItems = [
{ label: 'Ich finde, dass die Interaktion mit dieser Anwendung eine hohe körperliche Muskelanstrengung erfordert.', controlName: 'har1' },
{ label: 'Ich empfand die Nutzung der Anwendung als angenehm für meine Arme und Hände.', controlName: 'har2' },
{ label: 'Ich fand es schwierig, das Gerät während der Bedienung der Anwendung zu halten.', controlName: 'har3' },
{ label: 'Ich fand es einfach, Informationen über die Anwendung einzugeben.', controlName: 'har4' },
{ label: 'Ich hatte das Gefühl, dass mein Arm oder meine Hand nach der Nutzung der Anwendung müde wurde.', controlName: 'har5' },
{ label: 'Ich denke, die Anwendung ist einfach zu steuern.', controlName: 'har6' },
{ label: 'Ich hatte das Gefühl, dass ich irgendwann den Halt verlor und das Gerät fallen ließ.', controlName: 'har7' },
{ label: 'Ich denke, die Bedienung dieser Anwendung ist einfach und unkompliziert.', controlName: 'har8' },
{ label: 'Ich denke, dass die Interaktion mit dieser Anwendung eine hohe geistige Anstrengung erfordert.', controlName: 'har9' },
{ label: 'Ich fand die Menge der auf dem Bildschirm angezeigten Informationen angemessen.', controlName: 'har10' },
{ label: 'Ich fand die auf dem Bildschirm angezeigten Informationen schwer lesbar.', controlName: 'har11' },
{ label: 'Ich hatte das Gefühl, dass die Informationsanzeige schnell genug reagierte.', controlName: 'har12' },
{ label: 'Ich fand die auf dem Bildschirm angezeigten Informationen verwirrend.', controlName: 'har13' },
{ label: 'Ich fand die Wörter und Symbole auf dem Bildschirm leicht lesbar.', controlName: 'har14' },
{ label: 'Ich hatte das Gefühl, dass das Display zu stark flimmerte.', controlName: 'har15' },
{ label: 'Ich fand die auf dem Bildschirm angezeigten Informationen konsistent.', controlName: 'har16' }
];
constructor() {
this.logInteraction = this.logInteraction.bind(this);
}
ngOnInit() {
this.createForm();
}
logInteraction(event: Event) {
this.metricsService.logInteraction(event);
}
createForm() {
const formControls: { [key: string]: any } = {
// Demographics
age: [null, [Validators.required, Validators.min(13), Validators.max(120)]],
gender: [null, Validators.required],
// Experience
arExperience: [null, Validators.required],
vrExperience: [null, Validators.required],
// Final Comments
comments: [''],
};
// Usability items (1-5 scale)
this.usabilityItems.forEach(item => {
formControls[item.controlName] = [null, Validators.required];
});
// HAR items (1-7 scale)
this.harItems.forEach(item => {
formControls[item.controlName] = [null, Validators.required];
});
this.feedbackForm = this.formBuilder.group(formControls);
}
onSubmit() {
if (this.feedbackForm.valid) {
this.isSubmitting = true;
const formData = {
...this.feedbackForm.value,
submittedAt: new Date().toISOString()
};
this.metricsService.sendMetricsToServer(formData).subscribe({
next: () => {
this.isSubmitting = false;
this.isSubmitted = true;
setTimeout(() => this.testComplete.emit(), 3000);
},
error: (err) => {
console.error("FINAL SUBMISSION FAILED:", err);
this.isSubmitting = false;
}
});
} else {
this.feedbackForm.markAllAsTouched();
console.error("Form is invalid. Please fill out all required fields.");
}
}
}
@@ -0,0 +1,33 @@
.vertical-slider {
-webkit-appearance: none;
appearance: none;
width: 120px;
height: 8px;
background: #4a5568;
border-radius: 9999px;
outline: none;
cursor: pointer;
transform: rotate(-90deg);
}
.vertical-slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 24px;
height: 24px;
background: #ffffff;
border-radius: 50%;
border: 2px solid #e2e8f0;
}
.vertical-slider::-moz-range-thumb {
width: 24px;
height: 24px;
background: #ffffff;
border-radius: 50%;
border: 2px solid #e2e8f0;
}
@@ -0,0 +1,63 @@
<div class="w-full h-1/2 relative font-sans">
<div *ngIf="arHasBeenActive && !isArActive" class="w-full flex justify-center">
<button (click)="finishExperience()"
class="bg-green-600 text-white py-3 px-8 rounded-lg shadow-lg hover:bg-green-700 transition-colors">
Einkaufserlebnis beenden
</button>
</div>
<div class="w-full h-full relative font-sans mb-4">
<model-viewer #modelViewer class="absolute inset-0 w-full h-96" src="models/CeilingLamp.glb" ar camera-controls
ar-modes="webxr" ar-placement="ceiling" ar-interaction="true" camera-orbit="0deg 135deg 105%"
shadow-intensity="1" ar-scale="fixed" scale="0.1 0.1 0.1" alt="Virtuelles 3D-Modell einer Deckenleuchte">
<button slot="ar-button" (click)="logInteraction($event)"
class="absolute top-4 left-1/2 -translate-x-1/2 bg-blue-600 text-white py-2 px-6 rounded-lg shadow-md hover:bg-blue-700 transition-colors z-10">
Diese Lampe bei mir Zuhause anschauen
</button>
<div *ngIf="isArActive" class="absolute inset-0 z-20 pointer-events-none">
<div *ngIf="isInfoBoxVisible"
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-black bg-opacity-80 p-6 rounded-xl text-white text-center shadow-lg transition-opacity duration-300 w-80 pointer-events-auto flex flex-col items-center">
<p class="mb-4">
Versuchen Sie die Lampe an der Decke zu plazieren und schauen Sie sich die Lampe an. Die Lampe
lässt sich mit den Fingern verschieben und mit dem Slider in der Höhe platzieren.
</p>
<button (click)="dismissInfoBox($event)"
class="bg-blue-600 text-white py-2 px-6 rounded-lg hover:bg-blue-700 transition-colors">
Verstanden
</button>
</div>
<div *ngIf="!isInfoBoxVisible && !isModelPlaced && !isCeilingAimed"
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-black bg-opacity-70 p-4 rounded-xl text-white text-center transition-opacity duration-300 w-64 pointer-events-auto">
<h4 class="text-lg font-semibold">Decke anvisieren</h4>
<p class="mt-1 text-sm opacity-90">Richten Sie Ihr Gerät nach oben und schauen Sie sich um.</p>
</div>
<div *ngIf="isModelPlaced"
class="ar-controls absolute bottom-8 left-1/2 -translate-x-1/2 bg-black bg-opacity-70 p-5 rounded-xl flex flex-col items-center space-y-4 text-white z-10 pointer-events-auto w-80">
<div class="flex flex-col items-start w-full">
<label for="offset-slider" class="text-sm font-medium mb-1">Höhe anpassen</label>
<input id="offset-slider" type="range" min="-0.5" max="2" step="0.01" [ngModel]="verticalOffset"
(ngModelChange)="onOffsetChange($event)" (input)="logInteraction($event)"
class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer" />
<span class="text-xs mt-1 self-center">{{ verticalOffset >= 0 ? '+' : '' }}{{
verticalOffset.toFixed(2) }}m</span>
</div>
<div class="flex space-x-4 justify-center w-full">
<button id="reset-ceiling-btn" (click)="resetOffset($event)"
class="bg-gray-600 text-white py-2 px-4 rounded-lg flex-1">
Höhe zurücksetzen
</button>
</div>
</div>
</div>
</model-viewer>
</div>
</div>
@@ -0,0 +1,169 @@
import {
Component,
AfterViewInit,
OnDestroy,
ViewChild,
ElementRef,
CUSTOM_ELEMENTS_SCHEMA,
NgZone,
inject,
Output,
EventEmitter
} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import '../../../../../assets/scripts/model-viewer.min.js';
import { MetricsTrackerService } from '../../../../services/metrics-tracker.service.js';
interface ModelViewerElement extends HTMLElement {
arVerticalOffset?: number;
setAttribute(name: string, value: string): void;
getAttribute(name: string): string | null;
removeAttribute(name: string): void;
getAnchor: () => Promise<string | null>;
activateAR: () => Promise<void>;
deactivateAR?: () => void;
}
@Component({
selector: 'app-ceiling-placement-demonstrator',
standalone: true,
imports: [CommonModule, FormsModule],
templateUrl: 'ceiling-placement-demonstrator.component.html',
styleUrl: 'ceiling-placement-demonstrator.component.css',
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class CeilingPlacementDemonstratorComponent implements AfterViewInit, OnDestroy {
@ViewChild('modelViewer') modelViewerRef!: ElementRef<ModelViewerElement>;
@Output() testComplete = new EventEmitter<void>();
private metricsService = inject(MetricsTrackerService);
private zone = inject(NgZone);
public isArActive = false;
public isModelPlaced = false;
public isCeilingAimed = false;
public arHasBeenActive = false;
public isInfoBoxVisible = true;
private hasStartedTracking = false;
public verticalOffset = 0;
private modelViewerElement!: ModelViewerElement;
constructor() {
this.logInteraction = this.logInteraction.bind(this);
}
ngAfterViewInit() {
this.modelViewerElement = this.modelViewerRef.nativeElement;
this.modelViewerElement.addEventListener('ar-status', this.handleArStatus);
this.modelViewerElement.addEventListener('ar-tracking', (ev: any) => {
this.zone.run(() => {
this.isCeilingAimed = ev?.detail?.status === 'tracking';
});
});
}
public logInteraction(event: Event) {
this.metricsService.logInteraction(event);
}
public async activateAr(event: MouseEvent) {
this.logInteraction(event);
try {
await this.modelViewerElement.activateAR();
} catch (error) {
console.error("Failed to activate AR:", error);
}
}
public dismissInfoBox(event: MouseEvent) {
this.isInfoBoxVisible = false;
this.logInteraction(event);
}
private pushVerticalOffset(value: number) {
if (!this.modelViewerElement) return;
(this.modelViewerElement as any).arVerticalOffset = value;
this.modelViewerElement.setAttribute('ar-vertical-offset', String(value));
}
public onOffsetChange(value: number) {
this.verticalOffset = value;
this.pushVerticalOffset(value);
}
public finishExperience() {
const finalPlacement = {
finalVerticalOffset: this.verticalOffset,
};
this.metricsService.logInteraction(new CustomEvent('test-results', {
detail: {
testName: 'CeilingPlacementDemonstrator',
results: finalPlacement
}
}));
this.testComplete.emit();
}
public resetOffset(event: Event) {
this.verticalOffset = 0;
this.pushVerticalOffset(0);
this.logInteraction(event);
}
private handleArStatus = (event: any) => {
this.zone.run(() => {
const status = event.detail?.status;
switch (status) {
case 'session-started':
this.isArActive = true;
this.arHasBeenActive = true;
this.isModelPlaced = false;
this.isInfoBoxVisible = true;
if (!this.hasStartedTracking) {
this.hasStartedTracking = true;
this.metricsService.startTracking(this.modelViewerElement, "ceiling_placement");
}
this.pushVerticalOffset(this.verticalOffset);
break;
case 'object-placed':
this.isModelPlaced = true;
this.isInfoBoxVisible = false;
this.pushVerticalOffset(this.verticalOffset);
break;
case 'not-presenting':
case 'failed':
this.isArActive = false;
break;
}
});
};
private resetArState() {
this.isArActive = false;
this.isModelPlaced = false;
this.isCeilingAimed = false;
this.isInfoBoxVisible = true;
this.verticalOffset = 0;
}
ngOnDestroy() {
if (this.modelViewerElement) {
this.modelViewerElement.removeEventListener('ar-status', this.handleArStatus);
}
if(this.hasStartedTracking) {
this.metricsService.stopTracking();
}
this.resetArState();
}
}
@@ -2,31 +2,24 @@
<!-- Header -->
<div class="mb-6">
<h1 class="text-3xl font-bold text-gray-800 mb-6">Augmented Reality Umfrage</h1>
<!-- Progress Section -->
<div class="mb-6">
<div class="flex justify-between items-center mb-2">
<span class="text-sm font-medium text-gray-700">Test {{ currentTest }} von {{ totalTests }}</span>
<span class="text-sm font-medium text-gray-700">{{ progress | number:'1.1-1' }}%</span>
</div>
<div class="w-full bg-gray-200 rounded-full h-2 overflow-hidden">
<div class="bg-gradient-to-r from-blue-600 to-blue-400 h-full rounded-full" [style.width.%]="progress"></div>
</div>
</div>
<!-- Status Display -->
<div *ngIf="currentTest < 4" class="bg-gray-50 border border-gray-200 rounded-lg p-4 mb-6 font-mono text-sm">
<div class="text-red-600">Bitte achten Sie darauf die Kamera auf eine Deckenfläche zu richten.</div>
</div>
</div>
<!-- Assessment Container -->
<div class="assessment-container" style="height: 70vh; min-height: 500px;">
<div class="assessment-container" class="h-full" style="min-height: 500px;">
<div *ngIf="currentTest === 1" class="w-full h-full flex flex-col">
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4 mb-4 font-mono text-sm">
<div class="text-black-600">
<h2 class="text-base mb-2">In dieser Simulation geht es darum ein Einkaufserlebnis in Augmented Reality für Objekte zu simulieren die an der Decke befestigt werden können. Wenn Sie mit der Plazierung zufriden sich können sie die AR Umgebung mit dem X schliesen und das Einkaufserlebnis beenden.</h2>
</div>
</div>
<!-- Assessment 1 -->
<div class="flex-1 min-h-0">
<app-ceiling-placement-demonstrator (testComplete)="onTestComplete()" (redoTest)="redoTest(1)"></app-ceiling-placement-demonstrator>
</div>
</div>
<!--
Assessment 1
<div *ngIf="currentTest === 1" class="w-full h-full flex flex-col">
<!-- Description -->
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4 mb-4 font-mono text-sm">
<div class="text-black-600">
<h2 class="text-base mb-2">In diesem Test geht es darum, die Lesbarkeit von Texten in Augmented-Reality-Umgebungen (AR) im Kontext von Deckenflächen zu untersuchen.</h2>
@@ -38,13 +31,11 @@
</div>
</div>
<!-- Component container -->
<div class="flex-1 min-h-0">
<app-text-legibility-assessment (testComplete)="onTestComplete()" (redoTest)="redoTest(1)"></app-text-legibility-assessment>
</div>
</div>
<!-- Assessment 2 -->
<div *ngIf="currentTest === 2" class="w-full h-full flex flex-col">
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4 mb-4 font-mono text-sm">
<div class="text-black-600">
@@ -57,7 +48,6 @@
</div>
</div>
<!-- Assessment 3 -->
<div *ngIf="currentTest === 3" class="w-full h-full flex flex-col">
<div class="bg-gray-50 border border-gray-200 rounded-lg p-4 mb-4 font-mono text-sm">
<div class="text-black-600">
@@ -72,21 +62,14 @@
<div class="flex-1 min-h-0">
<app-spatial-stability-assessment (testComplete)="onTestComplete()" (redoTest)="redoTest(3)"></app-spatial-stability-assessment>
</div>
</div>
</div> -->
<!-- Assessment 4 -->
<div *ngIf="currentTest === 4" class="w-full h-full overflow-auto">
<app-demographics-feedback (testComplete)="onTestComplete()" (redoTest)="redoTest(4)"></app-demographics-feedback>
<div *ngIf="currentTest === 2" class="w-full h-full overflow-auto">
<app-feedback (testComplete)="onTestComplete()" (redoTest)="redoTest(4)"></app-feedback>
</div>
</div>
<!-- Skip Button -->
<div *ngIf="currentTest !== 4" class="flex justify-center mt-6 mb-4">
<button (click)="forceNextTest()"
class="bg-red-600 hover:bg-red-700 text-white font-bold py-3 px-6 rounded-lg shadow-lg text-sm">
Test überspringen
</button>
</div>
</div>
@@ -7,6 +7,8 @@ import { SpatialStabilityAssessmentComponent } from './assessments/spatial-stabi
import { TextLegibilityAssessmentComponent } from './assessments/text-legibility-assessment/text-legibility-assessment.component';
import { SpatialPositionAssessmentComponent } from './assessments/spatial-position-assessment/spatial-position-assessment.component';
import { DemographicsFeedbackComponent } from './assessments/demographics-feedback/demographics-feedback.component';
import { FeedbackComponent } from './assessments/feedback-component/feedback.component';
import { CeilingPlacementDemonstratorComponent } from "./assessments/preivew/ceiling-placement-demonstrator.component";
@Component({
selector: 'app-test-suite',
@@ -16,8 +18,8 @@ import { DemographicsFeedbackComponent } from './assessments/demographics-feedba
SpatialStabilityAssessmentComponent,
TextLegibilityAssessmentComponent,
SpatialPositionAssessmentComponent,
DemographicsFeedbackComponent,
DemographicsFeedbackComponent
CeilingPlacementDemonstratorComponent,
FeedbackComponent
],
templateUrl: './test-suite.component.html',
styleUrls: ['./test-suite.component.css']
+1 -1
View File
@@ -153,7 +153,7 @@ export class MetricsTrackerService {
}
console.log(`Starting tracking for test: ${testName}`);
this.trackingSubscription = interval(500).subscribe(async () => {
this.trackingSubscription = interval(100).subscribe(async () => {
if (!this.activeLog) return;
const timestamp = Date.now();
+2 -2
View File
@@ -6,9 +6,9 @@ import { Router } from '@angular/router';
providedIn: 'root'
})
export class TestProgressService {
private totalTests = 4;
private totalTests = 2;
private currentTestSubject = new BehaviorSubject<number>(1);
private progressSubject = new BehaviorSubject<number>(25); // (1/totalTests) * 100
private progressSubject = new BehaviorSubject<number>(50); // (1/totalTests) * 100
currentTest$ = this.currentTestSubject.asObservable();
progress$ = this.progressSubject.asObservable();
File diff suppressed because it is too large. Load diff
+28 -28
View File
@@ -700,7 +700,7 @@ const bg=t=>{const e=t.observeEffects||!1,i=t.intrinsics instanceof Function?t.i
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var Eg=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const Sg=_g({initialValue:0,keyframes:[{frames:5,value:-1},{frames:1,value:-1},{frames:8,value:1},{frames:1,value:1},{frames:5,value:0},{frames:18,value:0}]}),Cg=_g({initialValue:0,keyframes:[{frames:1,value:1},{frames:5,value:1},{frames:1,value:0},{frames:6,value:0}]}),wg="0deg 75deg 105%",Ig=["front","right","back","left"],Mg=["upper-","","lower-"],Tg="auto",Bg="basic",Rg="wiggle",Dg="none",Lg=()=>({basis:[Lm(Em(30,"deg"))],keywords:{auto:[null]}}),Pg=()=>({basis:[Lm(Em(12,"deg"))],keywords:{auto:[null]}}),Ug=(()=>{const t=Sm(wg)[0].terms,e=Um(t[0]),i=Um(t[1]);return t=>{const n=t[Lx].idealCameraDistance();return{basis:[e,i,Em(n,"m")],keywords:{auto:[null,null,Em(105,"%")]}}}})(),Fg=t=>{const e=2.2*t[Lx].boundingSphere.radius;return{basis:[Em(-1/0,"rad"),Em(0,"rad"),Em(e,"m")],keywords:{auto:[null,null,null]}}},Ng=t=>{const e=Ug(t),i=new ig([],e).evaluate()[2];return{basis:[Em(1/0,"rad"),Em(Math.PI,"rad"),Em(i,"m")],keywords:{auto:[null,null,null]}}},Og=t=>{const e=t[Lx].boundingBox.getCenter(new Ci);return{basis:[Em(e.x,"m"),Em(e.y,"m"),Em(e.z,"m")],keywords:{auto:[null,null,null]}}},Qg=Math.PI/2,kg=Math.PI/3,Gg=Qg/2,Hg=2*Math.PI,zg=Symbol("controls"),Vg=Symbol("panElement"),Wg=Symbol("promptElement"),qg=Symbol("promptAnimatedContainer"),jg=Symbol("fingerAnimatedContainers"),Xg=Symbol("deferInteractionPrompt"),Yg=Symbol("updateAria"),Kg=Symbol("a11y"),Jg=Symbol("updateA11y"),$g=Symbol("updateCameraForRadius"),Zg=Symbol("cancelPrompts"),tf=Symbol("onChange"),ef=Symbol("onPointerChange"),nf=Symbol("waitingToPromptUser"),sf=Symbol("userHasInteracted"),rf=Symbol("promptElementVisibleTime"),af=Symbol("lastPromptOffset"),of=Symbol("cancellationSource"),lf=Symbol("lastSpherical"),cf=Symbol("jumpCamera"),hf=Symbol("initialized"),uf=Symbol("maintainThetaPhi"),df=Symbol("syncCameraOrbit"),pf=Symbol("syncFieldOfView"),Af=Symbol("syncCameraTarget"),mf=Symbol("syncMinCameraOrbit"),gf=Symbol("syncMaxCameraOrbit"),ff=Symbol("syncMinFieldOfView"),vf=Symbol("syncMaxFieldOfView"),bf=new $e,yf=new Ci,xf=Object.freeze({minimumRadius:0,maximumRadius:1/0,minimumPolarAngle:0,maximumPolarAngle:Math.PI,minimumAzimuthalAngle:-1/0,maximumAzimuthalAngle:1/0,minimumFieldOfView:10,maximumFieldOfView:45,touchAction:"none"}),_f=Math.PI/8,Ef=.04,Sf={USER_INTERACTION:"user-interaction",NONE:"none",AUTOMATIC:"automatic"};class Cf extends ke{constructor(t,e,i){super(),this.camera=t,this.element=e,this.scene=i,this.orbitSensitivity=1,this.zoomSensitivity=1,this.panSensitivity=1,this.inputSensitivity=1,this.changeSource=Sf.NONE,this._interactionEnabled=!1,this._disableZoom=!1,this.isUserPointing=!1,this.enablePan=!0,this.enableTap=!0,this.panProjection=new Ze,this.panPerPixel=0,this.spherical=new hl,this.goalSpherical=new hl,this.thetaDamper=new vm,this.phiDamper=new vm,this.radiusDamper=new vm,this.logFov=Math.log(xf.maximumFieldOfView),this.goalLogFov=this.logFov,this.fovDamper=new vm,this.touchMode=null,this.pointers=[],this.startTime=0,this.startPointerPosition={clientX:0,clientY:0},this.lastSeparation=0,this.touchDecided=!1,this.onContext=t=>{if(this.enablePan)t.preventDefault();else for(const t of this.pointers)this.onPointerUp(new PointerEvent("pointercancel",Object.assign(Object.assign({},this.startPointerPosition),{pointerId:t.id})))},this.touchModeZoom=(t,e)=>{if(!this._disableZoom){const t=this.twoTouchDistance(this.pointers[0],this.pointers[1]),e=Ef*this.zoomSensitivity*(this.lastSeparation-t)*50/this.scene.height;this.lastSeparation=t,this.userAdjustOrbit(0,0,e)}this.panPerPixel>0&&this.movePan(t,e)},this.disableScroll=t=>{t.preventDefault()},this.touchModeRotate=(t,e)=>{const{touchAction:i}=this._options;if(!this.touchDecided&&"none"!==i){this.touchDecided=!0;const n=Math.abs(t),s=Math.abs(e);if(this.changeSource===Sf.USER_INTERACTION&&("pan-y"===i&&s>n||"pan-x"===i&&n>s))return void(this.touchMode=null);this.element.addEventListener("touchmove",this.disableScroll,{passive:!1})}this.handleSinglePointerMove(t,e)},this.onPointerDown=t=>{if(this.pointers.length>2)return;const{element:e}=this;0===this.pointers.length&&(e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),this.touchMode=null,this.touchDecided=!1,this.startPointerPosition.clientX=t.clientX,this.startPointerPosition.clientY=t.clientY,this.startTime=performance.now());try{e.setPointerCapture(t.pointerId)}catch(t){}this.pointers.push({clientX:t.clientX,clientY:t.clientY,id:t.pointerId}),this.isUserPointing=!1,"touch"===t.pointerType?(this.changeSource=t.altKey?Sf.AUTOMATIC:Sf.USER_INTERACTION,this.onTouchChange(t)):(this.changeSource=Sf.USER_INTERACTION,this.onMouseDown(t)),this.changeSource===Sf.USER_INTERACTION&&this.dispatchEvent({type:"user-interaction"})},this.onPointerMove=t=>{const e=this.Line truncated
var Eg=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const Sg=_g({initialValue:0,keyframes:[{frames:5,value:-1},{frames:1,value:-1},{frames:8,value:1},{frames:1,value:1},{frames:5,value:0},{frames:18,value:0}]}),Cg=_g({initialValue:0,keyframes:[{frames:1,value:1},{frames:5,value:1},{frames:1,value:0},{frames:6,value:0}]}),wg="0deg 75deg 105%",Ig=["front","right","back","left"],Mg=["upper-","","lower-"],Tg="auto",Bg="basic",Rg="wiggle",Dg="none",Lg=()=>({basis:[Lm(Em(30,"deg"))],keywords:{auto:[null]}}),Pg=()=>({basis:[Lm(Em(12,"deg"))],keywords:{auto:[null]}}),Ug=(()=>{const t=Sm(wg)[0].terms,e=Um(t[0]),i=Um(t[1]);return t=>{const n=t[Dx].idealCameraDistance();return{basis:[e,i,Em(n,"m")],keywords:{auto:[null,null,Em(105,"%")]}}}})(),Fg=t=>{const e=2.2*t[Dx].boundingSphere.radius;return{basis:[Em(-1/0,"rad"),Em(0,"rad"),Em(e,"m")],keywords:{auto:[null,null,null]}}},Ng=t=>{const e=Ug(t),i=new ig([],e).evaluate()[2];return{basis:[Em(1/0,"rad"),Em(Math.PI,"rad"),Em(i,"m")],keywords:{auto:[null,null,null]}}},Og=t=>{const e=t[Dx].boundingBox.getCenter(new Ci);return{basis:[Em(e.x,"m"),Em(e.y,"m"),Em(e.z,"m")],keywords:{auto:[null,null,null]}}},Qg=Math.PI/2,kg=Math.PI/3,Gg=Qg/2,Hg=2*Math.PI,zg=Symbol("controls"),Vg=Symbol("panElement"),Wg=Symbol("promptElement"),qg=Symbol("promptAnimatedContainer"),jg=Symbol("fingerAnimatedContainers"),Xg=Symbol("deferInteractionPrompt"),Yg=Symbol("updateAria"),Kg=Symbol("a11y"),Jg=Symbol("updateA11y"),$g=Symbol("updateCameraForRadius"),Zg=Symbol("cancelPrompts"),tf=Symbol("onChange"),ef=Symbol("onPointerChange"),nf=Symbol("waitingToPromptUser"),sf=Symbol("userHasInteracted"),rf=Symbol("promptElementVisibleTime"),af=Symbol("lastPromptOffset"),of=Symbol("cancellationSource"),lf=Symbol("lastSpherical"),cf=Symbol("jumpCamera"),hf=Symbol("initialized"),uf=Symbol("maintainThetaPhi"),df=Symbol("syncCameraOrbit"),pf=Symbol("syncFieldOfView"),Af=Symbol("syncCameraTarget"),mf=Symbol("syncMinCameraOrbit"),gf=Symbol("syncMaxCameraOrbit"),ff=Symbol("syncMinFieldOfView"),vf=Symbol("syncMaxFieldOfView"),bf=new $e,yf=new Ci,xf=Object.freeze({minimumRadius:0,maximumRadius:1/0,minimumPolarAngle:0,maximumPolarAngle:Math.PI,minimumAzimuthalAngle:-1/0,maximumAzimuthalAngle:1/0,minimumFieldOfView:10,maximumFieldOfView:45,touchAction:"none"}),_f=Math.PI/8,Ef=.04,Sf={USER_INTERACTION:"user-interaction",NONE:"none",AUTOMATIC:"automatic"};class Cf extends ke{constructor(t,e,i){super(),this.camera=t,this.element=e,this.scene=i,this.orbitSensitivity=1,this.zoomSensitivity=1,this.panSensitivity=1,this.inputSensitivity=1,this.changeSource=Sf.NONE,this._interactionEnabled=!1,this._disableZoom=!1,this.isUserPointing=!1,this.enablePan=!0,this.enableTap=!0,this.panProjection=new Ze,this.panPerPixel=0,this.spherical=new hl,this.goalSpherical=new hl,this.thetaDamper=new vm,this.phiDamper=new vm,this.radiusDamper=new vm,this.logFov=Math.log(xf.maximumFieldOfView),this.goalLogFov=this.logFov,this.fovDamper=new vm,this.touchMode=null,this.pointers=[],this.startTime=0,this.startPointerPosition={clientX:0,clientY:0},this.lastSeparation=0,this.touchDecided=!1,this.onContext=t=>{if(this.enablePan)t.preventDefault();else for(const t of this.pointers)this.onPointerUp(new PointerEvent("pointercancel",Object.assign(Object.assign({},this.startPointerPosition),{pointerId:t.id})))},this.touchModeZoom=(t,e)=>{if(!this._disableZoom){const t=this.twoTouchDistance(this.pointers[0],this.pointers[1]),e=Ef*this.zoomSensitivity*(this.lastSeparation-t)*50/this.scene.height;this.lastSeparation=t,this.userAdjustOrbit(0,0,e)}this.panPerPixel>0&&this.movePan(t,e)},this.disableScroll=t=>{t.preventDefault()},this.touchModeRotate=(t,e)=>{const{touchAction:i}=this._options;if(!this.touchDecided&&"none"!==i){this.touchDecided=!0;const n=Math.abs(t),s=Math.abs(e);if(this.changeSource===Sf.USER_INTERACTION&&("pan-y"===i&&s>n||"pan-x"===i&&n>s))return void(this.touchMode=null);this.element.addEventListener("touchmove",this.disableScroll,{passive:!1})}this.handleSinglePointerMove(t,e)},this.onPointerDown=t=>{if(this.pointers.length>2)return;const{element:e}=this;0===this.pointers.length&&(e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),this.touchMode=null,this.touchDecided=!1,this.startPointerPosition.clientX=t.clientX,this.startPointerPosition.clientY=t.clientY,this.startTime=performance.now());try{e.setPointerCapture(t.pointerId)}catch(t){}this.pointers.push({clientX:t.clientX,clientY:t.clientY,id:t.pointerId}),this.isUserPointing=!1,"touch"===t.pointerType?(this.changeSource=t.altKey?Sf.AUTOMATIC:Sf.USER_INTERACTION,this.onTouchChange(t)):(this.changeSource=Sf.USER_INTERACTION,this.onMouseDown(t)),this.changeSource===Sf.USER_INTERACTION&&this.dispatchEvent({type:"user-interaction"})},this.onPointerMove=t=>{const e=this.Line truncated
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -715,7 +715,7 @@ var Eg=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="session-started",zf="object-placed",Vf="failed",Wf="tracking",qf="not-tracking",jf=new Ci,Xf=new Si,Yf=new en,Kf=new Ci,Jf=new ks(45,1,.1,100),$f=(new gs).setFromPoints([new Ci(0,0,0),new Ci(0,0,-1)]),Zf="screen-space",tv="world-space";class ev extends ke{isWorldSpaceReady(){return this.xrMode===tv&&this.worldSpaceInitialPlacementDone}constructor(t){super(),this.renderer=t,this.currentSession=null,this.placementMode="floor",this.anchorOffset=null,this.isInteractionEnabled=!0,this.placementBox=null,this.menuPanel=null,this.lastTick=null,this.turntableRotation=null,this.oldShadowIntensity=null,this.frame=null,this.initialHitSource=null,this.transientHitTestSource=null,this.inputSource=null,this._presentedScene=null,this.resolveCleanup=null,this.exitWebXRButtonContainer=null,this.overlay=null,this.xrLight=null,this.xrMode=null,this.xrController1=null,this.xrController2=null,this.selectedXRController=null,this.parsedAnchorOffset=null,this.tracking=!0,this.frames=0,this.initialized=!1,this.oldTarget=new Ci,this.placementComplete=!1,this.isTranslating=!1,this.isRotating=!1,this.isTwoHandInteraction=!1,this.lastDragPosition=new Ci,this.deltaRotation=new Si,this.scaleLine=new Nr($f),this.firstRatio=0,this.lastAngle=0,this.goalPosition=new Ci,this.goalYaw=0,this.goalScale=1,this.xDamper=new vm,this.yDamper=new vm,this.zDamper=new vm,this.yawDamper=new vm,this.pitchDamper=new vm,this.rollDamper=new vm,this.scaleDamper=new vm,this.wasTwoFingering=!1,this.worldSpaceInitialPlacementDone=!1,this.initialModelScale=1,this.minScale=1,this.maxScale=1,this.onExitWebXRButtonContainerClick=()=>this.stopPresenting(),this.onControllerSelectStart=t=>{var e,i,n;const s=this.presentedScene,r=t.target,a=this.menuPanel;if(null!=this.menuPanel.exitButtonControllerIntersection(s,r))return null===(e=this.menuPanel)||void 0===e||e.dispose(),void this.stopPresenting();if(null!=this.menuPanel.scaleModeButtonControllerIntersection(s,r)){const t=this.menuPanel.handleScaleToggle(this.worldSpaceInitialPlacementDone,this.initialModelScale,this.minScale,this.maxScale);return void(null!==t&&(this.goalScale=t))}a&&(a.show=!1);const o=this.placementBox.controllerIntersection(s,r);if(null!=o){const t=(new Mi).setFromObject(s.pivot).min.y+.2;if(o.point.y<=t)null!=this.selectedXRController?(this.selectedXRController.userData.line.visible=!1,s.canScale&&this.isWorldSpaceReady()&&(this.isTwoHandInteraction=!0,this.firstRatio=this.controllerSeparation()/s.pivot.scale.x,this.scaleLine.visible=!0)):r.attach(s.pivot),this.selectedXRController=r,s.setShadowIntensity(.01);else if(r==this.xrController1?this.xrController1.userData.isSelected=!0:r==this.xrController2&&(this.xrController2.userData.isSelected=!0),(null===(i=this.xrController1)||void 0===i?void 0:i.userData.isSelected)&&(null===(n=this.xrController2)||void 0===n?void 0:n.userData.isSelected))s.canScale&&this.isWorldSpaceReady()&&(this.isTwoHandInteraction=!0,this.firstRatio=this.controllerSeparation()/s.pivot.scale.x,this.scaleLine.visible=!0);else{const t=r===this.xrController1?this.xrController2:this.xrController1;r.userData.initialX=r.position.x,t.userData.turning=!1,r.userData.turning=!0,r.userData.line.visible=!1}}},this.onControllerSelectEnd=t=>{const e=t.target;if(e.userData.turning=!1,e.userData.line.visible=!0,this.isTwoHandInteraction=!1,this.scaleLine.visible=!1,e==this.xrController1?this.xrController1.userData.isSelected=!1:e==this.xrController2&&(this.xrController2.userData.isSelected=!1),null!=this.selectedXRController&&this.selectedXRController!=e)return;const i=this.presentedScene;i.attach(i.pivot),this.selectedXRController=null,this.goalYaw=Math.atan2(i.pivot.matrix.elements[8],i.pivot.matrix.elements[10]),this.goalPosition.x=i.pivot.position.x,this.goalPosition.z=i.pivot.position.z,this.isWorldSpaceReady()&&(this.goalPosition.y=i.pivot.position.y);this.menuPanel.show=!0},this.onUpdateScene=()=>{null!=this.placementBox&&this.isPresenting&&(this.placementBox.updateFromModelChanges(),this.placementBox.setScreenSpaceMode(this.xrMode===Zf)),this.xrMode!==Zf&&(this.menuPanel&&(this.menuPanel.dispose(),this.menuPanel=null),this.menuPanel=new Uf,this.presentedScene.add(this.menuPanel),this.menuPanel.updatePosition(this.presentedScene.getCamera(),this.placementBox))},this.onSelectStart=t=>{if(!this.isInteractionEnabled)return;const e=this.transientHitTestSource;if(null==e)return;const i=this.frame.getHitTestResultsForTransientInput(e),n=this.presentedScene,s=this.placementBox;if(1===i.length){this.inputSource=t.inputSource;const{axes:e}=this.inputSource.gamepad,i=s.getHit(this.presentedScene,e[0],e[1]);s.show=!0,null!=i?(this.isTranslating=!0,this.lastDragPosition.copy(i)):!1===this.placeOnWall&&(this.isRotating=!0,this.lastAngle=1.5*e[0])}else if(2===i.length){s.show=!0,this.isTwoHandInteraction=!0;const{separation:t,angle:e}=this.fingerPolar(i);return this.lastAngle=e,0===this.firstRatio&&(this.firstRatio=t/n.pivoLine truncated
const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="session-started",zf="object-placed",Vf="failed",Wf="tracking",qf=new Ci,jf=new Si,Xf=new en,Yf=new Ci,Kf=new ks(45,1,.1,100),Jf=(new gs).setFromPoints([new Ci(0,0,0),new Ci(0,0,-1)]),$f="screen-space",Zf="world-space";class tv extends ke{isWorldSpaceReady(){return this.xrMode===Zf&&this.worldSpaceInitialPlacementDone}setVerticalOffset(t){const e=t-this._manualYOffset;if(this._manualYOffset=t,this.isPresenting&&!this.modelAnchor){const t=this.presentedScene;this.goalPosition.y+=e,t.pivot.position.y+=e}}constructor(t){super(),this.renderer=t,this.currentSession=null,this.placementMode="floor",this.anchorOffset=null,this.isInteractionEnabled=!0,this.placementBox=null,this.menuPanel=null,this.lastTick=null,this.turntableRotation=null,this.oldShadowIntensity=null,this.frame=null,this.initialHitSource=null,this.transientHitTestSource=null,this.inputSource=null,this._presentedScene=null,this.resolveCleanup=null,this.exitWebXRButtonContainer=null,this.overlay=null,this.xrLight=null,this.xrMode=null,this.xrController1=null,this.xrController2=null,this.selectedXRController=null,this.parsedAnchorOffset=null,this.tracking=!0,this.frames=0,this.initialized=!1,this.oldTarget=new Ci,this.placementComplete=!1,this.isTranslating=!1,this.isRotating=!1,this.isTwoHandInteraction=!1,this.lastDragPosition=new Ci,this.deltaRotation=new Si,this.scaleLine=new Nr(Jf),this.firstRatio=0,this.lastAngle=0,this.goalPosition=new Ci,this.goalYaw=0,this.goalScale=1,this.xDamper=new vm,this.yDamper=new vm,this.zDamper=new vm,this.yawDamper=new vm,this.pitchDamper=new vm,this.rollDamper=new vm,this.scaleDamper=new vm,this.wasTwoFingering=!1,this.worldSpaceInitialPlacementDone=!1,this.initialModelScale=1,this.minScale=1,this.maxScale=1,this.modelAnchor=void 0,this._anchorYOffset=0,this._manualYOffset=0,this.onExitWebXRButtonContainerClick=()=>this.stopPresenting(),this.onControllerSelectStart=t=>{var e,i,n;const s=this.presentedScene,r=t.target,a=this.menuPanel;if(null!=this.menuPanel.exitButtonControllerIntersection(s,r))return null===(e=this.menuPanel)||void 0===e||e.dispose(),void this.stopPresenting();if(null!=this.menuPanel.scaleModeButtonControllerIntersection(s,r)){const t=this.menuPanel.handleScaleToggle(this.worldSpaceInitialPlacementDone,this.initialModelScale,this.minScale,this.maxScale);return void(null!==t&&(this.goalScale=t))}a&&(a.show=!1);const o=this.placementBox.controllerIntersection(s,r);if(null!=o){const t=(new Mi).setFromObject(s.pivot).min.y+.2;if(o.point.y<=t)null!=this.selectedXRController?(this.selectedXRController.userData.line.visible=!1,s.canScale&&this.isWorldSpaceReady()&&(this.isTwoHandInteraction=!0,this.firstRatio=this.controllerSeparation()/s.pivot.scale.x,this.scaleLine.visible=!0)):r.attach(s.pivot),this.selectedXRController=r,s.setShadowIntensity(.01);else if(r==this.xrController1?this.xrController1.userData.isSelected=!0:r==this.xrController2&&(this.xrController2.userData.isSelected=!0),(null===(i=this.xrController1)||void 0===i?void 0:i.userData.isSelected)&&(null===(n=this.xrController2)||void 0===n?void 0:n.userData.isSelected))s.canScale&&this.isWorldSpaceReady()&&(this.isTwoHandInteraction=!0,this.firstRatio=this.controllerSeparation()/s.pivot.scale.x,this.scaleLine.visible=!0);else{const t=r===this.xrController1?this.xrController2:this.xrController1;r.userData.initialX=r.position.x,t.userData.turning=!1,r.userData.turning=!0,r.userData.line.visible=!1}}},this.onControllerSelectEnd=t=>{const e=t.target;if(e.userData.turning=!1,e.userData.line.visible=!0,this.isTwoHandInteraction=!1,this.scaleLine.visible=!1,e==this.xrController1?this.xrController1.userData.isSelected=!1:e==this.xrController2&&(this.xrController2.userData.isSelected=!1),null!=this.selectedXRController&&this.selectedXRController!=e)return;const i=this.presentedScene;i.attach(i.pivot),this.selectedXRController=null,this.goalYaw=Math.atan2(i.pivot.matrix.elements[8],i.pivot.matrix.elements[10]),this.goalPosition.x=i.pivot.position.x,this.goalPosition.z=i.pivot.position.z,this.isWorldSpaceReady()&&(this.goalPosition.y=i.pivot.position.y);this.menuPanel.show=!0},this.onUpdateScene=()=>{null!=this.placementBox&&this.isPresenting&&(this.placementBox.updateFromModelChanges(),this.placementBox.setScreenSpaceMode(this.xrMode===$f)),this.xrMode!==$f&&(this.menuPanel&&(this.menuPanel.dispose(),this.menuPanel=null),this.menuPanel=new Uf,this.presentedScene.add(this.menuPanel),this.menuPanel.updatePosition(this.presentedScene.getCamera(),this.placementBox))},this.onSelectStart=t=>{if(!this.isInteractionEnabled)return;const e=this.transientHitTestSource;if(null==e)return;const i=this.frame.getHitTestResultsForTransientInput(e),n=this.presentedScene,s=this.placementBox;if(1===i.length){this.inputSource=t.inputSource;const{axes:e}=this.inputSource.gamepad,i=s.getHit(this.presentedScene,e[0],e[1]);s.show=!0,null!=i?(this.isTranslating=!0,this.lastDragPosition.copy(i)):!1===thisLine truncated
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -729,7 +729,7 @@ const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="sessi
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const sv=Symbol("prepared"),rv=Symbol("prepare"),av=Symbol("preparedGLTF"),ov=Symbol("clone");class lv{static prepare(t){if(null==t.scene)throw new Error("Model does not have a scene");if(t[sv])return t;const e=this[rv](t);return e[sv]=!0,e}static[rv](t){const{scene:e}=t,i=[e];return Object.assign(Object.assign({},t),{scene:e,scenes:i})}get parser(){return this[av].parser}get animations(){return this[av].animations}get scene(){return this[av].scene}get scenes(){return this[av].scenes}get cameras(){return this[av].cameras}get asset(){return this[av].asset}get userData(){return this[av].userData}constructor(t){this[av]=t}clone(){return new(0,this.constructor)(this[ov]())}dispose(){this.scenes.forEach((t=>{t.traverse((t=>{const e=t;if(!e.material)return;(Array.isArray(e.material)?e.material:[e.material]).forEach((t=>{for(const e in t){const i=t[e];if(i instanceof vi){const t=i.source.data;null!=t.close&&t.close(),i.dispose()}}t.dispose()})),e.geometry.dispose()}))}))}[ov](){const t=this[av],e=iv(this.scene);cv(e,this.scene);const i=[e],n=t.userData?Object.assign({},t.userData):{};return Object.assign(Object.assign({},t),{scene:e,scenes:i,userData:n})}}const cv=(t,e)=>{hv(t,e,((t,e)=>{void 0!==e.userData.variantMaterials&&(t.userData.variantMaterials=new Map(e.userData.variantMaterials)),void 0!==e.userData.variantData&&(t.userData.variantData=e.userData.variantData),void 0!==e.userData.originalMaterial&&(t.userData.originalMaterial=e.userData.originalMaterial)}))},hv=(t,e,i)=>{i(t,e);for(let n=0;n<t.children.length;n++)hv(t.children[n],e.children[n],i)},uv=Symbol("threeGLTF"),dv=Symbol("gltf"),pv=Symbol("gltfElementMap"),Av=Symbol("threeObjectMap"),mv=Symbol("parallelTraverseThreeScene"),gv=Symbol("correlateOriginalThreeGLTF"),fv=Symbol("correlateCloneThreeGLTF");class vv{static from(t,e){return null!=e?this[fv](t,e):this[gv](t)}static[gv](t){const e=t.parser.json,i=t.parser.associations,n=new Map,s={name:"Default"},r={index:-1};for(const t of i.keys())t instanceof Jn&&null==i.get(t)&&(r.index<0&&(null==e.materials&&(e.materials=[]),r.index=e.materials.length,e.materials.push(s)),t.name=s.name,i.set(t,{materials:r.index}));for(const[t,s]of i){s&&(t.userData=t.userData||{},t.userData.associations=s);for(const i in s)if(null!=i&&"primitives"!==i){const r=i,a=(e[r]||[])[s[r]];if(null==a)continue;let o=n.get(a);null==o&&(o=new Set,n.set(a,o)),o.add(t)}}return new vv(t,e,i,n)}static[fv](t,e){const i=e.threeGLTF,n=e.gltf,s=JSON.parse(JSON.stringify(n)),r=new Map,a=new Map;for(let n=0;n<i.scenes.length;n++)this[mv](i.scenes[n],t.scenes[n],((t,i)=>{const n=e.threeObjectMap.get(t);if(null!=n)for(const t in n)if(null!=t&&"primitives"!==t){const e=t,o=n[e],l=s[e][o],c=r.get(i)||{};c[e]=o,r.set(i,c);const h=a.get(l)||new Set;h.add(i),a.set(l,h)}}));return new vv(t,s,r,a)}static[mv](t,e,i){const n=(t,e)=>{if(i(t,e),t.isObject3D){const s=t,r=e;if(s.material)if(Array.isArray(s.material))for(let t=0;t<s.material.length;++t)i(s.material[t],r.material[t]);else i(s.material,r.material);for(let i=0;i<t.children.length;++i)n(t.children[i],e.children[i])}};n(t,e)}get threeGLTF(){return this[uv]}get gltf(){return this[dv]}get gltfElementMap(){return this[pv]}get threeObjectMap(){return this[Av]}constructor(t,e,i,n){this[uv]=t,this[dv]=e,this[pv]=n,this[Av]=i}}
*/const nv=Symbol("prepared"),sv=Symbol("prepare"),rv=Symbol("preparedGLTF"),av=Symbol("clone");class ov{static prepare(t){if(null==t.scene)throw new Error("Model does not have a scene");if(t[nv])return t;const e=this[sv](t);return e[nv]=!0,e}static[sv](t){const{scene:e}=t,i=[e];return Object.assign(Object.assign({},t),{scene:e,scenes:i})}get parser(){return this[rv].parser}get animations(){return this[rv].animations}get scene(){return this[rv].scene}get scenes(){return this[rv].scenes}get cameras(){return this[rv].cameras}get asset(){return this[rv].asset}get userData(){return this[rv].userData}constructor(t){this[rv]=t}clone(){return new(0,this.constructor)(this[av]())}dispose(){this.scenes.forEach((t=>{t.traverse((t=>{const e=t;if(!e.material)return;(Array.isArray(e.material)?e.material:[e.material]).forEach((t=>{for(const e in t){const i=t[e];if(i instanceof vi){const t=i.source.data;null!=t.close&&t.close(),i.dispose()}}t.dispose()})),e.geometry.dispose()}))}))}[av](){const t=this[rv],e=ev(this.scene);lv(e,this.scene);const i=[e],n=t.userData?Object.assign({},t.userData):{};return Object.assign(Object.assign({},t),{scene:e,scenes:i,userData:n})}}const lv=(t,e)=>{cv(t,e,((t,e)=>{void 0!==e.userData.variantMaterials&&(t.userData.variantMaterials=new Map(e.userData.variantMaterials)),void 0!==e.userData.variantData&&(t.userData.variantData=e.userData.variantData),void 0!==e.userData.originalMaterial&&(t.userData.originalMaterial=e.userData.originalMaterial)}))},cv=(t,e,i)=>{i(t,e);for(let n=0;n<t.children.length;n++)cv(t.children[n],e.children[n],i)},hv=Symbol("threeGLTF"),uv=Symbol("gltf"),dv=Symbol("gltfElementMap"),pv=Symbol("threeObjectMap"),Av=Symbol("parallelTraverseThreeScene"),mv=Symbol("correlateOriginalThreeGLTF"),gv=Symbol("correlateCloneThreeGLTF");class fv{static from(t,e){return null!=e?this[gv](t,e):this[mv](t)}static[mv](t){const e=t.parser.json,i=t.parser.associations,n=new Map,s={name:"Default"},r={index:-1};for(const t of i.keys())t instanceof Jn&&null==i.get(t)&&(r.index<0&&(null==e.materials&&(e.materials=[]),r.index=e.materials.length,e.materials.push(s)),t.name=s.name,i.set(t,{materials:r.index}));for(const[t,s]of i){s&&(t.userData=t.userData||{},t.userData.associations=s);for(const i in s)if(null!=i&&"primitives"!==i){const r=i,a=(e[r]||[])[s[r]];if(null==a)continue;let o=n.get(a);null==o&&(o=new Set,n.set(a,o)),o.add(t)}}return new fv(t,e,i,n)}static[gv](t,e){const i=e.threeGLTF,n=e.gltf,s=JSON.parse(JSON.stringify(n)),r=new Map,a=new Map;for(let n=0;n<i.scenes.length;n++)this[Av](i.scenes[n],t.scenes[n],((t,i)=>{const n=e.threeObjectMap.get(t);if(null!=n)for(const t in n)if(null!=t&&"primitives"!==t){const e=t,o=n[e],l=s[e][o],c=r.get(i)||{};c[e]=o,r.set(i,c);const h=a.get(l)||new Set;h.add(i),a.set(l,h)}}));return new fv(t,s,r,a)}static[Av](t,e,i){const n=(t,e)=>{if(i(t,e),t.isObject3D){const s=t,r=e;if(s.material)if(Array.isArray(s.material))for(let t=0;t<s.material.length;++t)i(s.material[t],r.material[t]);else i(s.material,r.material);for(let i=0;i<t.children.length;++i)n(t.children[i],e.children[i])}};n(t,e)}get threeGLTF(){return this[hv]}get gltf(){return this[uv]}get gltfElementMap(){return this[dv]}get threeObjectMap(){return this[pv]}constructor(t,e,i,n){this[hv]=t,this[uv]=e,this[dv]=n,this[pv]=i}}
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -743,7 +743,7 @@ const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="sessi
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const bv=Symbol("correlatedSceneGraph");class yv extends lv{static[rv](t){const e=super[rv](t);null==e[bv]&&(e[bv]=vv.from(e));const{scene:i}=e,n=new qi(void 0,1/0);return i.traverse((t=>{t.renderOrder=1e3,t.frustumCulled=!1,t.name||(t.name=t.uuid);const i=t;if(i.material){const{geometry:t}=i;i.castShadow=!0,i.isSkinnedMesh&&(t.boundingSphere=n,t.boundingBox=null);const s=i.material;if(!0===s.isMeshBasicMaterial&&(s.toneMapped=!1),s.shadowSide=0,s.aoMap){const{gltf:i,threeObjectMap:n}=e[bv],r=n.get(s);if(null!=i.materials&&null!=r&&null!=r.materials){const e=i.materials[r.materials];e.occlusionTexture&&0===e.occlusionTexture.texCoord&&null!=t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv)}}}})),e}get correlatedSceneGraph(){return this[av][bv]}[ov](){const t=super[ov](),e=new Map;return t.scene.traverse((t=>{const i=t;if(i.material){const t=i.material;if(null!=t){if(e.has(t.uuid))return void(i.material=e.get(t.uuid));i.material=t.clone(),e.set(t.uuid,i.material)}}const n=t;void 0!==n.target&&n.add(n.target)})),t[bv]=vv.from(t,this.correlatedSceneGraph),t}}const xv=(t,e,i)=>{let n;switch(t){case mt:n=new Uint8ClampedArray(e*i*4);break;case _t:n=new Uint16Array(e*i*4);break;case yt:n=new Uint32Array(e*i*4);break;case gt:n=new Int8Array(e*i*4);break;case ft:n=new Int16Array(e*i*4);break;case bt:n=new Int32Array(e*i*4);break;case xt:n=new Float32Array(e*i*4);break;default:throw new Error("Unsupported data type")}return n};let _v;class Ev{constructor(t){var e,i,n,s,r,a,o,l,c,h,u,d,p,A,m,g;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(t){throw this._renderer.setRenderTarget(null),t}this._renderer.setRenderTarget(null)},this._width=t.width,this._height=t.height,this._type=t.type,this._colorSpace=t.colorSpace;const f={format:It,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:void 0!==(null===(e=t.renderTargetOptions)||void 0===e?void 0:e.anisotropy)?null===(i=t.renderTargetOptions)||void 0===i?void 0:i.anisotropy:1,generateMipmaps:void 0!==(null===(n=t.renderTargetOptions)||void 0===n?void 0:n.generateMipmaps)&&(null===(s=t.renderTargetOptions)||void 0===s?void 0:s.generateMipmaps),magFilter:void 0!==(null===(r=t.renderTargetOptions)||void 0===r?void 0:r.magFilter)?null===(a=t.renderTargetOptions)||void 0===a?void 0:a.magFilter:dt,minFilter:void 0!==(null===(o=t.renderTargetOptions)||void 0===o?void 0:o.minFilter)?null===(l=t.renderTargetOptions)||void 0===l?void 0:l.minFilter:dt,samples:void 0!==(null===(c=t.renderTargetOptions)||void 0===c?void 0:c.samples)?null===(h=t.renderTargetOptions)||void 0===h?void 0:h.samples:void 0,wrapS:void 0!==(null===(u=t.renderTargetOptions)||void 0===u?void 0:u.wrapS)?null===(d=t.renderTargetOptions)||void 0===d?void 0:d.wrapS:ot,wrapT:void 0!==(null===(p=t.renderTargetOptions)||void 0===p?void 0:p.wrapT)?null===(A=t.renderTargetOptions)||void 0===A?void 0:A.wrapT:ot};if(this._material=t.material,t.renderer?this._renderer=t.renderer:(this._renderer=Ev.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Xs,this._camera=new Ho,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!((t,e,i,n)=>{if(void 0!==_v)return _v;const s=new xi(1,1,n);e.setRenderTarget(s);const r=new Ms(new Xa,new $n({color:16777215}));e.render(r,i),e.setRenderTarget(null);const a=xv(t,s.width,s.height);return e.readRenderTargetPixels(s,0,0,s.width,s.height,a),s.dispose(),r.geometry.dispose(),r.material.dispose(),_v=0!==a[0],_v})(this._type,this._renderer,this._camera,f)){let t;if(this._type===_t)t=this._renderer.extensions.has("EXT_color_buffer_float")?xt:void 0;void 0!==t?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to 1015`),this._type=t):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new Ms(new Xa,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new xi(this.width,this.height,f),this._renderTarget.texture.mapping=void 0!==(null===(m=t.renderTargetOptions)||void 0===m?void 0:m.mapping)?null===(g=t.renderTargetOptions)||void 0===g?void 0:g.mapping:et}static instantiateRenderer(){const t=new Xh;return t.setSize(128,128),t}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const t=xv(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,t),t}toDataTexture(t){const e=new cr(this.toArray(),this.width,this.height,It,this._type,(null==t?void 0:t.mapping)||et,(null==t?void 0:t.wrapS)||ot,(null==t?void 0:t.wrapT)||ot,(null==t?void 0:t.magFilter)||dt,(null==t?void 0:t.minFLine truncated
*/const vv=Symbol("correlatedSceneGraph");class bv extends ov{static[sv](t){const e=super[sv](t);null==e[vv]&&(e[vv]=fv.from(e));const{scene:i}=e,n=new qi(void 0,1/0);return i.traverse((t=>{t.renderOrder=1e3,t.frustumCulled=!1,t.name||(t.name=t.uuid);const i=t;if(i.material){const{geometry:t}=i;i.castShadow=!0,i.isSkinnedMesh&&(t.boundingSphere=n,t.boundingBox=null);const s=i.material;if(!0===s.isMeshBasicMaterial&&(s.toneMapped=!1),s.shadowSide=0,s.aoMap){const{gltf:i,threeObjectMap:n}=e[vv],r=n.get(s);if(null!=i.materials&&null!=r&&null!=r.materials){const e=i.materials[r.materials];e.occlusionTexture&&0===e.occlusionTexture.texCoord&&null!=t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv)}}}})),e}get correlatedSceneGraph(){return this[rv][vv]}[av](){const t=super[av](),e=new Map;return t.scene.traverse((t=>{const i=t;if(i.material){const t=i.material;if(null!=t){if(e.has(t.uuid))return void(i.material=e.get(t.uuid));i.material=t.clone(),e.set(t.uuid,i.material)}}const n=t;void 0!==n.target&&n.add(n.target)})),t[vv]=fv.from(t,this.correlatedSceneGraph),t}}const yv=(t,e,i)=>{let n;switch(t){case mt:n=new Uint8ClampedArray(e*i*4);break;case _t:n=new Uint16Array(e*i*4);break;case yt:n=new Uint32Array(e*i*4);break;case gt:n=new Int8Array(e*i*4);break;case ft:n=new Int16Array(e*i*4);break;case bt:n=new Int32Array(e*i*4);break;case xt:n=new Float32Array(e*i*4);break;default:throw new Error("Unsupported data type")}return n};let xv;class _v{constructor(t){var e,i,n,s,r,a,o,l,c,h,u,d,p,A,m,g;this._rendererIsDisposable=!1,this._supportsReadPixels=!0,this.render=()=>{this._renderer.setRenderTarget(this._renderTarget);try{this._renderer.render(this._scene,this._camera)}catch(t){throw this._renderer.setRenderTarget(null),t}this._renderer.setRenderTarget(null)},this._width=t.width,this._height=t.height,this._type=t.type,this._colorSpace=t.colorSpace;const f={format:It,depthBuffer:!1,stencilBuffer:!1,type:this._type,colorSpace:this._colorSpace,anisotropy:void 0!==(null===(e=t.renderTargetOptions)||void 0===e?void 0:e.anisotropy)?null===(i=t.renderTargetOptions)||void 0===i?void 0:i.anisotropy:1,generateMipmaps:void 0!==(null===(n=t.renderTargetOptions)||void 0===n?void 0:n.generateMipmaps)&&(null===(s=t.renderTargetOptions)||void 0===s?void 0:s.generateMipmaps),magFilter:void 0!==(null===(r=t.renderTargetOptions)||void 0===r?void 0:r.magFilter)?null===(a=t.renderTargetOptions)||void 0===a?void 0:a.magFilter:dt,minFilter:void 0!==(null===(o=t.renderTargetOptions)||void 0===o?void 0:o.minFilter)?null===(l=t.renderTargetOptions)||void 0===l?void 0:l.minFilter:dt,samples:void 0!==(null===(c=t.renderTargetOptions)||void 0===c?void 0:c.samples)?null===(h=t.renderTargetOptions)||void 0===h?void 0:h.samples:void 0,wrapS:void 0!==(null===(u=t.renderTargetOptions)||void 0===u?void 0:u.wrapS)?null===(d=t.renderTargetOptions)||void 0===d?void 0:d.wrapS:ot,wrapT:void 0!==(null===(p=t.renderTargetOptions)||void 0===p?void 0:p.wrapT)?null===(A=t.renderTargetOptions)||void 0===A?void 0:A.wrapT:ot};if(this._material=t.material,t.renderer?this._renderer=t.renderer:(this._renderer=_v.instantiateRenderer(),this._rendererIsDisposable=!0),this._scene=new Xs,this._camera=new Ho,this._camera.position.set(0,0,10),this._camera.left=-.5,this._camera.right=.5,this._camera.top=.5,this._camera.bottom=-.5,this._camera.updateProjectionMatrix(),!((t,e,i,n)=>{if(void 0!==xv)return xv;const s=new xi(1,1,n);e.setRenderTarget(s);const r=new Ms(new Xa,new $n({color:16777215}));e.render(r,i),e.setRenderTarget(null);const a=yv(t,s.width,s.height);return e.readRenderTargetPixels(s,0,0,s.width,s.height,a),s.dispose(),r.geometry.dispose(),r.material.dispose(),xv=0!==a[0],xv})(this._type,this._renderer,this._camera,f)){let t;if(this._type===_t)t=this._renderer.extensions.has("EXT_color_buffer_float")?xt:void 0;void 0!==t?(console.warn(`This browser does not support reading pixels from ${this._type} RenderTargets, switching to 1015`),this._type=t):(this._supportsReadPixels=!1,console.warn("This browser dos not support toArray or toDataTexture, calls to those methods will result in an error thrown"))}this._quad=new Ms(new Xa,this._material),this._quad.geometry.computeBoundingBox(),this._scene.add(this._quad),this._renderTarget=new xi(this.width,this.height,f),this._renderTarget.texture.mapping=void 0!==(null===(m=t.renderTargetOptions)||void 0===m?void 0:m.mapping)?null===(g=t.renderTargetOptions)||void 0===g?void 0:g.mapping:et}static instantiateRenderer(){const t=new Xh;return t.setSize(128,128),t}toArray(){if(!this._supportsReadPixels)throw new Error("Can't read pixels in this browser");const t=yv(this._type,this._width,this._height);return this._renderer.readRenderTargetPixels(this._renderTarget,0,0,this._width,this._height,t),t}toDataTexture(t){const e=new cr(this.toArray(),this.width,this.height,It,this._type,(null==t?void 0:t.mapping)||et,(null==t?void 0:t.wrapS)||ot,(null==t?void 0:t.wrapT)||ot,(null==t?void 0:t.magFilter)||dt,(null==t?void 0:t.minFLine truncated
/* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -757,7 +757,7 @@ const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="sessi
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const Pv={topLight:{intensity:500,position:[.418,16.199,.3]},room:{position:[-.757,13.219,.717],scale:[31.713,28.305,28.591]},boxes:[{position:[-10.906,2.009,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,.857,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:50,position:[-16.116,14.37,8.208],scale:[.1,2.428,2.739]},{intensity:50,position:[-16.109,18.021,-8.207],scale:[.1,2.425,2.751]},{intensity:17,position:[14.904,12.198,-1.832],scale:[.15,4.265,6.331]},{intensity:43,position:[-.462,8.89,14.52],scale:[4.38,5.441,.088]},{intensity:20,position:[3.235,11.486,-12.541],scale:[2.5,2,.1]},{intensity:100,position:[0,20,0],scale:[1,.1,1]}]},Uv={topLight:{intensity:400,position:[.5,14,.5]},room:{position:[0,13.2,0],scale:[31.5,28.5,31.5]},boxes:[{position:[-10.906,-1,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,-.16,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:80,position:[-14,10,8],scale:[.1,2.5,2.5]},{intensity:80,position:[-14,14,-4],scale:[.1,2.5,2.5]},{intensity:23,position:[14,12,0],scale:[.1,5,5]},{intensity:16,position:[0,9,14],scale:[5,5,.1]},{intensity:80,position:[7,8,-14],scale:[2.5,2.5,.1]},{intensity:80,position:[-7,16,-14],scale:[2.5,2.5,.1]},{intensity:1,position:[0,20,0],scale:[.1,.1,.1]}]};class Fv extends Xs{constructor(t){super(),this.position.y=-3.5;const e=new Bs;e.deleteAttribute("uv");const i=new Ja({metalness:0,side:1}),n=new Ja({metalness:0}),s="legacy"==t?Pv:Uv,r=new Go(16777215,s.topLight.intensity,28,2);r.position.set(...s.topLight.position),this.add(r);const a=new Ms(e,i);a.position.set(...s.room.position),a.scale.set(...s.room.scale),this.add(a);for(const t of s.boxes){const i=new Ms(e,n);i.position.set(...t.position),i.rotation.set(0,t.rotation,0),i.scale.set(...t.scale),this.add(i)}for(const t of s.lights){const i=new Ms(e,this.createAreaLightMaterial(t.intensity));i.position.set(...t.position),i.scale.set(...t.scale),this.add(i)}}createAreaLightMaterial(t){const e=new $n;return e.color.setScalar(t),e}}
*/const Lv={topLight:{intensity:500,position:[.418,16.199,.3]},room:{position:[-.757,13.219,.717],scale:[31.713,28.305,28.591]},boxes:[{position:[-10.906,2.009,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,.857,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:50,position:[-16.116,14.37,8.208],scale:[.1,2.428,2.739]},{intensity:50,position:[-16.109,18.021,-8.207],scale:[.1,2.425,2.751]},{intensity:17,position:[14.904,12.198,-1.832],scale:[.15,4.265,6.331]},{intensity:43,position:[-.462,8.89,14.52],scale:[4.38,5.441,.088]},{intensity:20,position:[3.235,11.486,-12.541],scale:[2.5,2,.1]},{intensity:100,position:[0,20,0],scale:[1,.1,1]}]},Pv={topLight:{intensity:400,position:[.5,14,.5]},room:{position:[0,13.2,0],scale:[31.5,28.5,31.5]},boxes:[{position:[-10.906,-1,1.846],rotation:-.195,scale:[2.328,7.905,4.651]},{position:[-5.607,-.754,-.758],rotation:.994,scale:[1.97,1.534,3.955]},{position:[6.167,-.16,7.803],rotation:.561,scale:[3.927,6.285,3.687]},{position:[-2.017,.018,6.124],rotation:.333,scale:[2.002,4.566,2.064]},{position:[2.291,-.756,-2.621],rotation:-.286,scale:[1.546,1.552,1.496]},{position:[-2.193,-.369,-5.547],rotation:.516,scale:[3.875,3.487,2.986]}],lights:[{intensity:80,position:[-14,10,8],scale:[.1,2.5,2.5]},{intensity:80,position:[-14,14,-4],scale:[.1,2.5,2.5]},{intensity:23,position:[14,12,0],scale:[.1,5,5]},{intensity:16,position:[0,9,14],scale:[5,5,.1]},{intensity:80,position:[7,8,-14],scale:[2.5,2.5,.1]},{intensity:80,position:[-7,16,-14],scale:[2.5,2.5,.1]},{intensity:1,position:[0,20,0],scale:[.1,.1,.1]}]};class Uv extends Xs{constructor(t){super(),this.position.y=-3.5;const e=new Bs;e.deleteAttribute("uv");const i=new Ja({metalness:0,side:1}),n=new Ja({metalness:0}),s="legacy"==t?Lv:Pv,r=new Go(16777215,s.topLight.intensity,28,2);r.position.set(...s.topLight.position),this.add(r);const a=new Ms(e,i);a.position.set(...s.room.position),a.scale.set(...s.room.scale),this.add(a);for(const t of s.boxes){const i=new Ms(e,n);i.position.set(...t.position),i.rotation.set(0,t.rotation,0),i.scale.set(...t.scale),this.add(i)}for(const t of s.lights){const i=new Ms(e,this.createAreaLightMaterial(t.intensity));i.position.set(...t.position),i.scale.set(...t.scale),this.add(i)}}createAreaLightMaterial(t){const e=new $n;return e.color.setScalar(t),e}}
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -771,7 +771,7 @@ const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="sessi
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const Nv=20,Ov=/\.hdr(\.js)?$/;class Qv{constructor(t){this.threeRenderer=t,this.lottieLoaderUrl="",this._ldrLoader=null,this._imageLoader=null,this._hdrLoader=null,this._lottieLoader=null,this.generatedEnvironmentMap=null,this.generatedEnvironmentMapAlt=null,this.skyboxCache=new Map,this.blurMaterial=null,this.blurScene=null}ldrLoader(t){return null==this._ldrLoader&&(this._ldrLoader=new To),this._ldrLoader.setWithCredentials(t),this._ldrLoader}imageLoader(t){return null==this._imageLoader&&(this._imageLoader=new Dv(this.threeRenderer)),this._imageLoader.setWithCredentials(t),this._imageLoader}hdrLoader(t){return null==this._hdrLoader&&(this._hdrLoader=new Lv,this._hdrLoader.setDataType(_t)),this._hdrLoader.setWithCredentials(t),this._hdrLoader}async getLottieLoader(t){if(null==this._lottieLoader){const{LottieLoader:t}=await import(this.lottieLoaderUrl);this._lottieLoader=new t}return this._lottieLoader.setWithCredentials(t),this._lottieLoader}async loadImage(t,e){const i=await new Promise(((i,n)=>this.ldrLoader(e).load(t,i,(()=>{}),n)));return i.name=t,i.flipY=!1,i}async loadLottie(t,e,i){const n=await this.getLottieLoader(i);n.setQuality(e);const s=await new Promise(((e,i)=>n.load(t,e,(()=>{}),i)));return s.name=t,s}async loadEquirect(t,e=!1,i=()=>{}){try{const n=Ov.test(t),s=n?this.hdrLoader(e):this.imageLoader(e),r=await new Promise(((e,n)=>s.load(t,(t=>{const{renderTarget:i}=t;if(null!=i){const{texture:n}=i;t.dispose(!1),e(n)}else e(t)}),(t=>{i(t.loaded/t.total*.9)}),n)));return i(1),r.name=t,r.mapping=st,n||(r.colorSpace=Ee),r}finally{i&&i(1)}}async generateEnvironmentMapAndSkybox(t=null,e=null,i=()=>{},n=!1){const s="legacy"!==e;"legacy"!==e&&"neutral"!==e||(e=null),e=qu(e);let r,a=Promise.resolve(null);t&&(a=this.loadEquirectFromUrl(t,n,i)),r=e?this.loadEquirectFromUrl(e,n,i):t?this.loadEquirectFromUrl(t,n,i):s?this.loadGeneratedEnvironmentMapAlt():this.loadGeneratedEnvironmentMap();const[o,l]=await Promise.all([r,a]);if(null==o)throw new Error("Failed to load environment map.");return{environmentMap:o,skybox:l}}async loadEquirectFromUrl(t,e,i){if(!this.skyboxCache.has(t)){const n=this.loadEquirect(t,e,i);this.skyboxCache.set(t,n)}return this.skyboxCache.get(t)}async GenerateEnvironmentMap(t,e){await((t=0)=>new Promise((e=>setTimeout(e,t))))();const i=this.threeRenderer,n=new Vs(256,{generateMipmaps:!1,type:_t,format:It,colorSpace:Se,depthBuffer:!0}),s=new Hs(.1,100,n),r=s.renderTarget.texture;r.name=e;const a=i.outputColorSpace,o=i.toneMapping;return i.toneMapping=0,i.outputColorSpace=Se,s.update(i,t),this.blurCubemap(n,.04),i.toneMapping=o,i.outputColorSpace=a,r}async loadGeneratedEnvironmentMap(){return null==this.generatedEnvironmentMap&&(this.generatedEnvironmentMap=this.GenerateEnvironmentMap(new Fv("legacy"),"legacy")),this.generatedEnvironmentMap}async loadGeneratedEnvironmentMapAlt(){return null==this.generatedEnvironmentMapAlt&&(this.generatedEnvironmentMapAlt=this.GenerateEnvironmentMap(new Fv("neutral"),"neutral")),this.generatedEnvironmentMapAlt}blurCubemap(t,e){if(null==this.blurMaterial){this.blurMaterial=this.getBlurShader(Nv);const t=new Bs,e=new Ms(t,this.blurMaterial);this.blurScene=new Xs,this.blurScene.add(e)}const i=t.clone();this.halfblur(t,i,e,"latitudinal"),this.halfblur(i,t,e,"longitudinal")}halfblur(t,e,i,n){const s=t.width,r=isFinite(i)?Math.PI/(2*s):2*Math.PI/39,a=i/r,o=isFinite(i)?1+Math.floor(3*a):Nv;o>Nv&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${o} samples when the maximum is set to 20`);const l=[];let c=0;for(let t=0;t<Nv;++t){const e=t/a,i=Math.exp(-e*e/2);l.push(i),0==t?c+=i:t<o&&(c+=2*i)}for(let t=0;t<l.length;t++)l[t]=l[t]/c;const h=this.blurMaterial.uniforms;h.envMap.value=t.texture,h.samples.value=o,h.weights.value=l,h.latitudinal.value="latitudinal"===n,h.dTheta.value=r;new Hs(.1,100,e).update(this.threeRenderer,this.blurScene)}getBlurShader(t){const e=new Float32Array(t),i=new Ci(0,1,0);return new Us({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},poleAxis:{value:i}},vertexShader:"\n \n varying vec3 vOutputDirection;\n \n void main() {\n \n vOutputDirection = vec3( position );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n \n }\n ",fragmentShader:"\n varying vec3 vOutputDirection;\n \n uniform samplerCube envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform vec3 poleAxis;\n \n vec3 getSample( float theta, vec3 axis ) {\n \n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n \n ret Line truncated
*/const Fv=20,Nv=/\.hdr(\.js)?$/;class Ov{constructor(t){this.threeRenderer=t,this.lottieLoaderUrl="",this._ldrLoader=null,this._imageLoader=null,this._hdrLoader=null,this._lottieLoader=null,this.generatedEnvironmentMap=null,this.generatedEnvironmentMapAlt=null,this.skyboxCache=new Map,this.blurMaterial=null,this.blurScene=null}ldrLoader(t){return null==this._ldrLoader&&(this._ldrLoader=new To),this._ldrLoader.setWithCredentials(t),this._ldrLoader}imageLoader(t){return null==this._imageLoader&&(this._imageLoader=new Rv(this.threeRenderer)),this._imageLoader.setWithCredentials(t),this._imageLoader}hdrLoader(t){return null==this._hdrLoader&&(this._hdrLoader=new Dv,this._hdrLoader.setDataType(_t)),this._hdrLoader.setWithCredentials(t),this._hdrLoader}async getLottieLoader(t){if(null==this._lottieLoader){const{LottieLoader:t}=await import(this.lottieLoaderUrl);this._lottieLoader=new t}return this._lottieLoader.setWithCredentials(t),this._lottieLoader}async loadImage(t,e){const i=await new Promise(((i,n)=>this.ldrLoader(e).load(t,i,(()=>{}),n)));return i.name=t,i.flipY=!1,i}async loadLottie(t,e,i){const n=await this.getLottieLoader(i);n.setQuality(e);const s=await new Promise(((e,i)=>n.load(t,e,(()=>{}),i)));return s.name=t,s}async loadEquirect(t,e=!1,i=()=>{}){try{const n=Nv.test(t),s=n?this.hdrLoader(e):this.imageLoader(e),r=await new Promise(((e,n)=>s.load(t,(t=>{const{renderTarget:i}=t;if(null!=i){const{texture:n}=i;t.dispose(!1),e(n)}else e(t)}),(t=>{i(t.loaded/t.total*.9)}),n)));return i(1),r.name=t,r.mapping=st,n||(r.colorSpace=Ee),r}finally{i&&i(1)}}async generateEnvironmentMapAndSkybox(t=null,e=null,i=()=>{},n=!1){const s="legacy"!==e;"legacy"!==e&&"neutral"!==e||(e=null),e=qu(e);let r,a=Promise.resolve(null);t&&(a=this.loadEquirectFromUrl(t,n,i)),r=e?this.loadEquirectFromUrl(e,n,i):t?this.loadEquirectFromUrl(t,n,i):s?this.loadGeneratedEnvironmentMapAlt():this.loadGeneratedEnvironmentMap();const[o,l]=await Promise.all([r,a]);if(null==o)throw new Error("Failed to load environment map.");return{environmentMap:o,skybox:l}}async loadEquirectFromUrl(t,e,i){if(!this.skyboxCache.has(t)){const n=this.loadEquirect(t,e,i);this.skyboxCache.set(t,n)}return this.skyboxCache.get(t)}async GenerateEnvironmentMap(t,e){await((t=0)=>new Promise((e=>setTimeout(e,t))))();const i=this.threeRenderer,n=new Vs(256,{generateMipmaps:!1,type:_t,format:It,colorSpace:Se,depthBuffer:!0}),s=new Hs(.1,100,n),r=s.renderTarget.texture;r.name=e;const a=i.outputColorSpace,o=i.toneMapping;return i.toneMapping=0,i.outputColorSpace=Se,s.update(i,t),this.blurCubemap(n,.04),i.toneMapping=o,i.outputColorSpace=a,r}async loadGeneratedEnvironmentMap(){return null==this.generatedEnvironmentMap&&(this.generatedEnvironmentMap=this.GenerateEnvironmentMap(new Uv("legacy"),"legacy")),this.generatedEnvironmentMap}async loadGeneratedEnvironmentMapAlt(){return null==this.generatedEnvironmentMapAlt&&(this.generatedEnvironmentMapAlt=this.GenerateEnvironmentMap(new Uv("neutral"),"neutral")),this.generatedEnvironmentMapAlt}blurCubemap(t,e){if(null==this.blurMaterial){this.blurMaterial=this.getBlurShader(Fv);const t=new Bs,e=new Ms(t,this.blurMaterial);this.blurScene=new Xs,this.blurScene.add(e)}const i=t.clone();this.halfblur(t,i,e,"latitudinal"),this.halfblur(i,t,e,"longitudinal")}halfblur(t,e,i,n){const s=t.width,r=isFinite(i)?Math.PI/(2*s):2*Math.PI/39,a=i/r,o=isFinite(i)?1+Math.floor(3*a):Fv;o>Fv&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${o} samples when the maximum is set to 20`);const l=[];let c=0;for(let t=0;t<Fv;++t){const e=t/a,i=Math.exp(-e*e/2);l.push(i),0==t?c+=i:t<o&&(c+=2*i)}for(let t=0;t<l.length;t++)l[t]=l[t]/c;const h=this.blurMaterial.uniforms;h.envMap.value=t.texture,h.samples.value=o,h.weights.value=l,h.latitudinal.value="latitudinal"===n,h.dTheta.value=r;new Hs(.1,100,e).update(this.threeRenderer,this.blurScene)}getBlurShader(t){const e=new Float32Array(t),i=new Ci(0,1,0);return new Us({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},poleAxis:{value:i}},vertexShader:"\n \n varying vec3 vOutputDirection;\n \n void main() {\n \n vOutputDirection = vec3( position );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n \n }\n ",fragmentShader:"\n varying vec3 vOutputDirection;\n \n uniform samplerCube envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform vec3 poleAxis;\n \n vec3 getSample( float theta, vec3 axis ) {\n \n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n \n ret Line truncated
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -785,7 +785,7 @@ const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="sessi
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const kv=[1,.79,.62,.5,.4,.31,.25],Gv="high-performance";class Hv extends ke{static get singleton(){return this._singleton||(this._singleton=new Hv({powerPreference:(self.ModelViewerElement||{}).powerPreference||Gv,debug:Ju()})),this._singleton}static resetSingleton(){const t=this._singleton.dispose();for(const e of t)e.disconnectedCallback();this._singleton=new Hv({powerPreference:(self.ModelViewerElement||{}).powerPreference||Gv,debug:Ju()});for(const e of t)e.connectedCallback()}get canRender(){return null!=this.threeRenderer}get scaleFactor(){return kv[this.scaleStep]}set minScale(t){let e=1;for(;e<kv.length&&!(kv[e]<t);)++e;this.lastStep=e-1}constructor(t){super(),this.loader=new cA(yv),this.width=0,this.height=0,this.dpr=1,this.scenes=new Set,this.multipleScenesVisible=!1,this.lastTick=performance.now(),this.renderedLastFrame=!1,this.scaleStep=0,this.lastStep=3,this.avgFrameDuration=50,this.onWebGLContextLost=t=>{this.dispatchEvent({type:"contextlost",sourceEvent:t})},this.onWebGLContextRestored=()=>{var t;null===(t=this.textureUtils)||void 0===t||t.dispose(),this.textureUtils=new Qv(this.threeRenderer);for(const t of this.scenes)t.element[ed]()},this.dpr=window.devicePixelRatio,this.canvas3D=document.createElement("canvas"),this.canvas3D.id="webgl-canvas",this.canvas3D.classList.add("show");try{this.threeRenderer=new Xh({canvas:this.canvas3D,alpha:!0,antialias:!0,powerPreference:t.powerPreference,preserveDrawingBuffer:!0}),this.threeRenderer.autoClear=!0,this.threeRenderer.setPixelRatio(1),this.threeRenderer.debug={checkShaderErrors:!!t.debug,onShaderError:null},this.threeRenderer.toneMapping=7}catch(t){console.warn(t)}this.arRenderer=new ev(this),this.textureUtils=this.canRender?new Qv(this.threeRenderer):null,cA.initializeKTX2Loader(this.threeRenderer),this.canvas3D.addEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas3D.addEventListener("webglcontextrestored",this.onWebGLContextRestored),this.updateRendererSize()}registerScene(t){this.scenes.add(t),t.forceRescale();const e=new $e;this.threeRenderer.getSize(e),t.canvas.width=e.x,t.canvas.height=e.y,this.canRender&&this.scenes.size>0&&this.threeRenderer.setAnimationLoop(((t,e)=>this.render(t,e)))}unregisterScene(t){this.scenes.delete(t),this.canvas3D.parentElement===t.canvas.parentElement&&t.canvas.parentElement.removeChild(this.canvas3D),this.canRender&&0===this.scenes.size&&this.threeRenderer.setAnimationLoop(null)}displayCanvas(t){return t.element.modelIsVisible&&!this.multipleScenesVisible?this.canvas3D:t.element[Dx]}countVisibleScenes(){const{canvas3D:t}=this;let e=0,i=null;for(const n of this.scenes){const{element:s}=n;s.modelIsVisible&&null==n.externalRenderer&&++e,t.parentElement===n.canvas.parentElement&&(i=n)}const n=e>1;if(null!=i){const e=n&&!this.multipleScenesVisible,s=!i.element.modelIsVisible;if(e||s){const{width:e,height:n}=this.sceneSize(i);this.copyPixels(i,e,n),t.parentElement.removeChild(t)}}this.multipleScenesVisible=n}updateRendererSize(){var t;const e=window.devicePixelRatio;if(e!==this.dpr)for(const t of this.scenes){const{element:e}=t;e[bx](e.getBoundingClientRect())}let i=0,n=0;for(const t of this.scenes)i=Math.max(i,t.width),n=Math.max(n,t.height);if(i!==this.width||n!==this.height||e!==this.dpr){this.width=i,this.height=n,this.dpr=e,i=Math.ceil(i*e),n=Math.ceil(n*e),this.canRender&&this.threeRenderer.setSize(i,n,!1);for(const e of this.scenes){const{canvas:s}=e;s.width=i,s.height=n,e.forceRescale(),null===(t=e.effectRenderer)||void 0===t||t.setSize(i,n)}}}updateRendererScale(t){const e=this.scaleStep;this.avgFrameDuration+=Ku(.2*(t-this.avgFrameDuration),-5,5),this.avgFrameDuration>60?++this.scaleStep:this.avgFrameDuration<40&&this.scaleStep>0&&--this.scaleStep,this.scaleStep=Math.min(this.scaleStep,this.lastStep),e!==this.scaleStep&&(this.avgFrameDuration=50)}shouldRender(t){if(t.shouldRender())t.scaleStep!=this.scaleStep&&(t.scaleStep=this.scaleStep,this.rescaleCanvas(t));else{if(0==t.scaleStep)return!1;t.scaleStep=0,this.rescaleCanvas(t)}return!0}rescaleCanvas(t){const e=kv[t.scaleStep],i=Math.ceil(this.width/e),n=Math.ceil(this.height/e),{style:s}=t.canvas;s.width=`${i}px`,s.height=`${n}px`,this.canvas3D.style.width=`${i}px`,this.canvas3D.style.height=`${n}px`;const r=this.dpr*e,a=e<1?"GPU throttling":this.dpr!==window.devicePixelRatio?"No meta viewport tag":"";t.element.dispatchEvent(new CustomEvent("render-scale",{detail:{reportedDpr:window.devicePixelRatio,renderedDpr:r,minimumDpr:this.dpr*kv[this.lastStep],pixelWidth:Math.ceil(t.width*r),pixelHeight:Math.ceil(t.height*r),reason:a}}))}sceneSize(t){const{dpr:e}=this,i=kv[t.scaleStep];return{width:Math.min(Math.ceil(t.width*i*e),this.canvas3D.width),height:Math.min(Math.ceil(t.height*i*e),this.canvas3D.height)}}copyPixels(t,e,i){const n=t.context;null!=n?(n.clearRect(0,0,e,i),n.drawImage(this.canvas3D,0,0,e,i,0,0,e,i),t.canvas.classList.add("show")):console.log("could not acquire 2d context")}orderedScenes(){const t=[];for(const e of[!1,!0])foLine truncated
*/const Qv=[1,.79,.62,.5,.4,.31,.25],kv="high-performance";class Gv extends ke{static get singleton(){return this._singleton||(this._singleton=new Gv({powerPreference:(self.ModelViewerElement||{}).powerPreference||kv,debug:Ju()})),this._singleton}static resetSingleton(){const t=this._singleton.dispose();for(const e of t)e.disconnectedCallback();this._singleton=new Gv({powerPreference:(self.ModelViewerElement||{}).powerPreference||kv,debug:Ju()});for(const e of t)e.connectedCallback()}get canRender(){return null!=this.threeRenderer}get scaleFactor(){return Qv[this.scaleStep]}set minScale(t){let e=1;for(;e<Qv.length&&!(Qv[e]<t);)++e;this.lastStep=e-1}constructor(t){super(),this.loader=new cA(bv),this.width=0,this.height=0,this.dpr=1,this.scenes=new Set,this.multipleScenesVisible=!1,this.lastTick=performance.now(),this.renderedLastFrame=!1,this.scaleStep=0,this.lastStep=3,this.avgFrameDuration=50,this.onWebGLContextLost=t=>{this.dispatchEvent({type:"contextlost",sourceEvent:t})},this.onWebGLContextRestored=()=>{var t;null===(t=this.textureUtils)||void 0===t||t.dispose(),this.textureUtils=new Ov(this.threeRenderer);for(const t of this.scenes)t.element[ed]()},this.dpr=window.devicePixelRatio,this.canvas3D=document.createElement("canvas"),this.canvas3D.id="webgl-canvas",this.canvas3D.classList.add("show");try{this.threeRenderer=new Xh({canvas:this.canvas3D,alpha:!0,antialias:!0,powerPreference:t.powerPreference,preserveDrawingBuffer:!0}),this.threeRenderer.autoClear=!0,this.threeRenderer.setPixelRatio(1),this.threeRenderer.debug={checkShaderErrors:!!t.debug,onShaderError:null},this.threeRenderer.toneMapping=7}catch(t){console.warn(t)}this.arRenderer=new tv(this),this.textureUtils=this.canRender?new Ov(this.threeRenderer):null,cA.initializeKTX2Loader(this.threeRenderer),this.canvas3D.addEventListener("webglcontextlost",this.onWebGLContextLost),this.canvas3D.addEventListener("webglcontextrestored",this.onWebGLContextRestored),this.updateRendererSize()}registerScene(t){this.scenes.add(t),t.forceRescale();const e=new $e;this.threeRenderer.getSize(e),t.canvas.width=e.x,t.canvas.height=e.y,this.canRender&&this.scenes.size>0&&this.threeRenderer.setAnimationLoop(((t,e)=>this.render(t,e)))}unregisterScene(t){this.scenes.delete(t),this.canvas3D.parentElement===t.canvas.parentElement&&t.canvas.parentElement.removeChild(this.canvas3D),this.canRender&&0===this.scenes.size&&this.threeRenderer.setAnimationLoop(null)}displayCanvas(t){return t.element.modelIsVisible&&!this.multipleScenesVisible?this.canvas3D:t.element[Rx]}countVisibleScenes(){const{canvas3D:t}=this;let e=0,i=null;for(const n of this.scenes){const{element:s}=n;s.modelIsVisible&&null==n.externalRenderer&&++e,t.parentElement===n.canvas.parentElement&&(i=n)}const n=e>1;if(null!=i){const e=n&&!this.multipleScenesVisible,s=!i.element.modelIsVisible;if(e||s){const{width:e,height:n}=this.sceneSize(i);this.copyPixels(i,e,n),t.parentElement.removeChild(t)}}this.multipleScenesVisible=n}updateRendererSize(){var t;const e=window.devicePixelRatio;if(e!==this.dpr)for(const t of this.scenes){const{element:e}=t;e[vx](e.getBoundingClientRect())}let i=0,n=0;for(const t of this.scenes)i=Math.max(i,t.width),n=Math.max(n,t.height);if(i!==this.width||n!==this.height||e!==this.dpr){this.width=i,this.height=n,this.dpr=e,i=Math.ceil(i*e),n=Math.ceil(n*e),this.canRender&&this.threeRenderer.setSize(i,n,!1);for(const e of this.scenes){const{canvas:s}=e;s.width=i,s.height=n,e.forceRescale(),null===(t=e.effectRenderer)||void 0===t||t.setSize(i,n)}}}updateRendererScale(t){const e=this.scaleStep;this.avgFrameDuration+=Ku(.2*(t-this.avgFrameDuration),-5,5),this.avgFrameDuration>60?++this.scaleStep:this.avgFrameDuration<40&&this.scaleStep>0&&--this.scaleStep,this.scaleStep=Math.min(this.scaleStep,this.lastStep),e!==this.scaleStep&&(this.avgFrameDuration=50)}shouldRender(t){if(t.shouldRender())t.scaleStep!=this.scaleStep&&(t.scaleStep=this.scaleStep,this.rescaleCanvas(t));else{if(0==t.scaleStep)return!1;t.scaleStep=0,this.rescaleCanvas(t)}return!0}rescaleCanvas(t){const e=Qv[t.scaleStep],i=Math.ceil(this.width/e),n=Math.ceil(this.height/e),{style:s}=t.canvas;s.width=`${i}px`,s.height=`${n}px`,this.canvas3D.style.width=`${i}px`,this.canvas3D.style.height=`${n}px`;const r=this.dpr*e,a=e<1?"GPU throttling":this.dpr!==window.devicePixelRatio?"No meta viewport tag":"";t.element.dispatchEvent(new CustomEvent("render-scale",{detail:{reportedDpr:window.devicePixelRatio,renderedDpr:r,minimumDpr:this.dpr*Qv[this.lastStep],pixelWidth:Math.ceil(t.width*r),pixelHeight:Math.ceil(t.height*r),reason:a}}))}sceneSize(t){const{dpr:e}=this,i=Qv[t.scaleStep];return{width:Math.min(Math.ceil(t.width*i*e),this.canvas3D.width),height:Math.min(Math.ceil(t.height*i*e),this.canvas3D.height)}}copyPixels(t,e,i){const n=t.context;null!=n?(n.clearRect(0,0,e,i),n.drawImage(this.canvas3D,0,0,e,i,0,0,e,i),t.canvas.classList.add("show")):console.log("could not acquire 2d context")}orderedScenes(){const t=[];for(const e of[!1,!0])foLine truncated
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -799,7 +799,7 @@ const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="sessi
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const zv=Symbol("correlatedObjects"),Vv=Symbol("onUpdate");class Wv{constructor(t,e){this[Vv]=t,this[zv]=e}}
*/const Hv=Symbol("correlatedObjects"),zv=Symbol("onUpdate");class Vv{constructor(t,e){this[zv]=t,this[Hv]=e}}
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -813,7 +813,7 @@ const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="sessi
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const qv=new $n,jv=new Xa(2,2);let Xv=0;const Yv=Symbol("threeTexture"),Kv=Symbol("threeTextures");let Jv=class extends Wv{get[Yv](){var t;return null===(t=this[zv])||void 0===t?void 0:t.values().next().value}get[Kv](){return this[zv]}constructor(t,e){super(t,new Set(e?[e]:[])),this[Yv].image.src||(this[Yv].image.src=e.name?e.name:"adhoc_image"+Xv++),this[Yv].image.name||(this[Yv].image.name=e&&e.image&&e.image.src?e.image.src.split("/").pop():"adhoc_image")}get name(){return this[Yv].image.name||""}get uri(){return this[Yv].image.src}get bufferView(){return this[Yv].image.bufferView}get element(){const t=this[Yv];if(t&&(t.isCanvasTexture||t.isVideoTexture))return t.image}get animation(){const t=this[Yv];if(t&&t.isCanvasTexture&&t.animation)return t.animation}get type(){return null!=this.uri?"external":"embedded"}set name(t){for(const e of this[Kv])e.image.name=t}update(){const t=this[Yv];t&&t.isCanvasTexture&&!t.animation&&(this[Yv].needsUpdate=!0,this[Vv]())}async createThumbnail(t,e){const i=new Xs;qv.map=this[Yv];const n=new Ms(jv,qv);i.add(n);const s=new Ho(-1,1,1,-1,0,1),{threeRenderer:r}=Hv.singleton,a=new xi(t,e);r.setRenderTarget(a),r.render(i,s),r.setRenderTarget(null);const o=new Uint8Array(t*e*4);r.readRenderTargetPixels(a,0,0,t,e,o),cx.width=t,cx.height=e;const l=cx.getContext("2d"),c=l.createImageData(t,e);return c.data.set(o),l.putImageData(c,0,0),new Promise((async(t,e)=>{cx.toBlob((i=>{if(!i)return e("Failed to capture thumbnail.");t(URL.createObjectURL(i))}),"image/png")}))}};var $v,Zv;!function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.NearestMipmapNearest=9984]="NearestMipmapNearest",t[t.LinearMipmapNearest=9985]="LinearMipmapNearest",t[t.NearestMipmapLinear=9986]="NearestMipmapLinear",t[t.LinearMipmapLinear=9987]="LinearMipmapLinear"}($v||($v={})),function(t){t[t.ClampToEdge=33071]="ClampToEdge",t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.Repeat=10497]="Repeat"}(Zv||(Zv={}));
*/const Wv=new $n,qv=new Xa(2,2);let jv=0;const Xv=Symbol("threeTexture"),Yv=Symbol("threeTextures");let Kv=class extends Vv{get[Xv](){var t;return null===(t=this[Hv])||void 0===t?void 0:t.values().next().value}get[Yv](){return this[Hv]}constructor(t,e){super(t,new Set(e?[e]:[])),this[Xv].image.src||(this[Xv].image.src=e.name?e.name:"adhoc_image"+jv++),this[Xv].image.name||(this[Xv].image.name=e&&e.image&&e.image.src?e.image.src.split("/").pop():"adhoc_image")}get name(){return this[Xv].image.name||""}get uri(){return this[Xv].image.src}get bufferView(){return this[Xv].image.bufferView}get element(){const t=this[Xv];if(t&&(t.isCanvasTexture||t.isVideoTexture))return t.image}get animation(){const t=this[Xv];if(t&&t.isCanvasTexture&&t.animation)return t.animation}get type(){return null!=this.uri?"external":"embedded"}set name(t){for(const e of this[Yv])e.image.name=t}update(){const t=this[Xv];t&&t.isCanvasTexture&&!t.animation&&(this[Xv].needsUpdate=!0,this[zv]())}async createThumbnail(t,e){const i=new Xs;Wv.map=this[Xv];const n=new Ms(qv,Wv);i.add(n);const s=new Ho(-1,1,1,-1,0,1),{threeRenderer:r}=Gv.singleton,a=new xi(t,e);r.setRenderTarget(a),r.render(i,s),r.setRenderTarget(null);const o=new Uint8Array(t*e*4);r.readRenderTargetPixels(a,0,0,t,e,o),lx.width=t,lx.height=e;const l=lx.getContext("2d"),c=l.createImageData(t,e);return c.data.set(o),l.putImageData(c,0,0),new Promise((async(t,e)=>{lx.toBlob((i=>{if(!i)return e("Failed to capture thumbnail.");t(URL.createObjectURL(i))}),"image/png")}))}};var Jv,$v;!function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.NearestMipmapNearest=9984]="NearestMipmapNearest",t[t.LinearMipmapNearest=9985]="LinearMipmapNearest",t[t.NearestMipmapLinear=9986]="NearestMipmapLinear",t[t.LinearMipmapLinear=9987]="LinearMipmapLinear"}(Jv||(Jv={})),function(t){t[t.ClampToEdge=33071]="ClampToEdge",t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.Repeat=10497]="Repeat"}($v||($v={}));
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -828,7 +828,7 @@ const Ff=.8,Nf=150,Of=new Ci(0,1,0),Qf=.01,kf=.001,Gf="not-presenting",Hf="sessi
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const tb=new Map([[Zv.Repeat,at],[Zv.ClampToEdge,ot],[Zv.MirroredRepeat,lt]]),eb=new Map([[at,Zv.Repeat],[ot,Zv.ClampToEdge],[lt,Zv.MirroredRepeat]]),ib=new Map([[$v.Nearest,ct],[$v.Linear,dt],[$v.NearestMipmapNearest,ht],[$v.LinearMipmapNearest,pt],[$v.NearestMipmapLinear,ut],[$v.LinearMipmapLinear,At]]),nb=new Map([[ct,$v.Nearest],[dt,$v.Linear],[ht,$v.NearestMipmapNearest],[pt,$v.LinearMipmapNearest],[ut,$v.NearestMipmapLinear],[At,$v.LinearMipmapLinear]]),sb=new Map([[$v.Nearest,ct],[$v.Linear,dt]]),rb=new Map([[ct,$v.Nearest],[dt,$v.Linear]]),ab=t=>nb.has(t),ob=t=>rb.has(t),lb=t=>eb.has(t),cb=Symbol("threeTexture"),hb=Symbol("threeTextures"),ub=Symbol("setProperty");class db extends Wv{get[cb](){var t;return null===(t=this[zv])||void 0===t?void 0:t.values().next().value}get[hb](){return this[zv]}constructor(t,e){super(t,new Set(e?[e]:[]))}get name(){return this[cb].name||""}get minFilter(){return nb.get(this[cb].minFilter)}get magFilter(){return rb.get(this[cb].magFilter)}get wrapS(){return eb.get(this[cb].wrapS)}get wrapT(){return eb.get(this[cb].wrapT)}get rotation(){return this[cb].rotation}get scale(){return Vx(this[cb].repeat)}get offset(){return Vx(this[cb].offset)}setMinFilter(t){this[ub]("minFilter",ib.get(t))}setMagFilter(t){this[ub]("magFilter",sb.get(t))}setWrapS(t){this[ub]("wrapS",tb.get(t))}setWrapT(t){this[ub]("wrapT",tb.get(t))}setRotation(t){null==t&&(t=0),this[ub]("rotation",t)}setScale(t){null==t&&(t={u:1,v:1}),this[ub]("repeat",new $e(t.u,t.v))}setOffset(t){null==t&&(t={u:0,v:0}),this[ub]("offset",new $e(t.u,t.v))}[ub](t,e){if(((t,e)=>{switch(t){case"minFilter":return ab(e);case"magFilter":return ob(e);case"wrapS":case"wrapT":return lb(e);case"rotation":case"repeat":case"offset":return!0;default:throw new Error(`Cannot configure property "${t}" on Sampler`)}})(t,e))for(const i of this[hb])i[t]=e,i.needsUpdate=!0;this[Vv]()}}
const Zv=new Map([[$v.Repeat,at],[$v.ClampToEdge,ot],[$v.MirroredRepeat,lt]]),tb=new Map([[at,$v.Repeat],[ot,$v.ClampToEdge],[lt,$v.MirroredRepeat]]),eb=new Map([[Jv.Nearest,ct],[Jv.Linear,dt],[Jv.NearestMipmapNearest,ht],[Jv.LinearMipmapNearest,pt],[Jv.NearestMipmapLinear,ut],[Jv.LinearMipmapLinear,At]]),ib=new Map([[ct,Jv.Nearest],[dt,Jv.Linear],[ht,Jv.NearestMipmapNearest],[pt,Jv.LinearMipmapNearest],[ut,Jv.NearestMipmapLinear],[At,Jv.LinearMipmapLinear]]),nb=new Map([[Jv.Nearest,ct],[Jv.Linear,dt]]),sb=new Map([[ct,Jv.Nearest],[dt,Jv.Linear]]),rb=t=>ib.has(t),ab=t=>sb.has(t),ob=t=>tb.has(t),lb=Symbol("threeTexture"),cb=Symbol("threeTextures"),hb=Symbol("setProperty");class ub extends Vv{get[lb](){var t;return null===(t=this[Hv])||void 0===t?void 0:t.values().next().value}get[cb](){return this[Hv]}constructor(t,e){super(t,new Set(e?[e]:[]))}get name(){return this[lb].name||""}get minFilter(){return ib.get(this[lb].minFilter)}get magFilter(){return sb.get(this[lb].magFilter)}get wrapS(){return tb.get(this[lb].wrapS)}get wrapT(){return tb.get(this[lb].wrapT)}get rotation(){return this[lb].rotation}get scale(){return zx(this[lb].repeat)}get offset(){return zx(this[lb].offset)}setMinFilter(t){this[hb]("minFilter",eb.get(t))}setMagFilter(t){this[hb]("magFilter",nb.get(t))}setWrapS(t){this[hb]("wrapS",Zv.get(t))}setWrapT(t){this[hb]("wrapT",Zv.get(t))}setRotation(t){null==t&&(t=0),this[hb]("rotation",t)}setScale(t){null==t&&(t={u:1,v:1}),this[hb]("repeat",new $e(t.u,t.v))}setOffset(t){null==t&&(t={u:0,v:0}),this[hb]("offset",new $e(t.u,t.v))}[hb](t,e){if(((t,e)=>{switch(t){case"minFilter":return rb(e);case"magFilter":return ab(e);case"wrapS":case"wrapT":return ob(e);case"rotation":case"repeat":case"offset":return!0;default:throw new Error(`Cannot configure property "${t}" on Sampler`)}})(t,e))for(const i of this[cb])i[t]=e,i.needsUpdate=!0;this[zv]()}}
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -842,7 +842,7 @@ const tb=new Map([[Zv.Repeat,at],[Zv.ClampToEdge,ot],[Zv.MirroredRepeat,lt]]),eb
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const pb=Symbol("image"),Ab=Symbol("sampler"),mb=Symbol("threeTexture");class gb extends Wv{get[mb](){var t;return null===(t=this[zv])||void 0===t?void 0:t.values().next().value}constructor(t,e){super(t,new Set(e?[e]:[])),this[Ab]=new db(t,e),this[pb]=new Jv(t,e)}get name(){return this[mb].name||""}set name(t){for(const e of this[zv])e.name=t}get sampler(){return this[Ab]}get source(){return this[pb]}}
*/const db=Symbol("image"),pb=Symbol("sampler"),Ab=Symbol("threeTexture");class mb extends Vv{get[Ab](){var t;return null===(t=this[Hv])||void 0===t?void 0:t.values().next().value}constructor(t,e){super(t,new Set(e?[e]:[])),this[pb]=new ub(t,e),this[db]=new Kv(t,e)}get name(){return this[Ab].name||""}set name(t){for(const e of this[Hv])e.name=t}get sampler(){return this[pb]}get source(){return this[db]}}
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -856,7 +856,7 @@ const tb=new Map([[Zv.Repeat,at],[Zv.ClampToEdge,ot],[Zv.MirroredRepeat,lt]]),eb
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var fb,vb,bb;const yb=Symbol("texture"),xb=Symbol("transform"),_b=Symbol("materials"),Eb=Symbol("usage"),Sb=Symbol("onUpdate"),Cb=Symbol("activeVideo");var wb;!function(t){t[t.Base=0]="Base",t[t.MetallicRoughness=1]="MetallicRoughness",t[t.Normal=2]="Normal",t[t.Occlusion=3]="Occlusion",t[t.Emissive=4]="Emissive",t[t.Clearcoat=5]="Clearcoat",t[t.ClearcoatRoughness=6]="ClearcoatRoughness",t[t.ClearcoatNormal=7]="ClearcoatNormal",t[t.SheenColor=8]="SheenColor",t[t.SheenRoughness=9]="SheenRoughness",t[t.Transmission=10]="Transmission",t[t.Thickness=11]="Thickness",t[t.Specular=12]="Specular",t[t.SpecularColor=13]="SpecularColor",t[t.Iridescence=14]="Iridescence",t[t.IridescenceThickness=15]="IridescenceThickness",t[t.Anisotropy=16]="Anisotropy"}(wb||(wb={}));class Ib{constructor(t,e,i,n){this[fb]=null,this[vb]={rotation:0,scale:new $e(1,1),offset:new $e(0,0)},this[bb]=!1,i&&(this[xb].rotation=i.rotation,this[xb].scale.copy(i.repeat),this[xb].offset.copy(i.offset),this[yb]=new gb(t,i)),this[Sb]=t,this[_b]=n,this[Eb]=e}get texture(){return this[yb]}setTexture(t){var e,i;const n=null!=t?t.source[Yv]:null,s=null===(e=this[yb])||void 0===e?void 0:e.source[Yv];if(null!=s&&s.isVideoTexture?this[Cb]=!1:(null===(i=this[yb])||void 0===i?void 0:i.source.animation)&&this[yb].source.animation.removeEventListener("enterFrame",this[Sb]),this[yb]=t,null!=n&&n.isVideoTexture){const t=n.image;if(this[Cb]=!0,null!=t.requestVideoFrameCallback){const e=()=>{this[Cb]&&(this[Sb](),t.requestVideoFrameCallback(e))};t.requestVideoFrameCallback(e)}else{const t=()=>{this[Cb]&&(this[Sb](),requestAnimationFrame(t))};requestAnimationFrame(t)}}else null!=(null==t?void 0:t.source.animation)&&t.source.animation.addEventListener("enterFrame",this[Sb]);let r=Ee;if(this[_b])for(const t of this[_b]){switch(this[Eb]){case wb.Base:t.map=n;break;case wb.MetallicRoughness:r=Se,t.metalnessMap=n,t.roughnessMap=n;break;case wb.Normal:r=Se,t.normalMap=n;break;case wb.Occlusion:r=Se,t.aoMap=n;break;case wb.Emissive:t.emissiveMap=n;break;case wb.Clearcoat:t.clearcoatMap=n;break;case wb.ClearcoatRoughness:t.clearcoatRoughnessMap=n;break;case wb.ClearcoatNormal:t.clearcoatNormalMap=n;break;case wb.SheenColor:t.sheenColorMap=n;break;case wb.SheenRoughness:t.sheenRoughnessMap=n;break;case wb.Transmission:t.transmissionMap=n;break;case wb.Thickness:t.thicknessMap=n;break;case wb.Specular:t.specularIntensityMap=n;break;case wb.SpecularColor:t.specularColorMap=n;break;case wb.Iridescence:t.iridescenceMap=n;break;case wb.IridescenceThickness:t.iridescenceThicknessMap=n;break;case wb.Anisotropy:t.anisotropyMap=n}t.needsUpdate=!0}n&&(n.colorSpace=r,n.rotation=this[xb].rotation,n.repeat=this[xb].scale,n.offset=this[xb].offset),this[Sb]()}}fb=yb,vb=xb,bb=Cb;
*/var gb,fb,vb;const bb=Symbol("texture"),yb=Symbol("transform"),xb=Symbol("materials"),_b=Symbol("usage"),Eb=Symbol("onUpdate"),Sb=Symbol("activeVideo");var Cb;!function(t){t[t.Base=0]="Base",t[t.MetallicRoughness=1]="MetallicRoughness",t[t.Normal=2]="Normal",t[t.Occlusion=3]="Occlusion",t[t.Emissive=4]="Emissive",t[t.Clearcoat=5]="Clearcoat",t[t.ClearcoatRoughness=6]="ClearcoatRoughness",t[t.ClearcoatNormal=7]="ClearcoatNormal",t[t.SheenColor=8]="SheenColor",t[t.SheenRoughness=9]="SheenRoughness",t[t.Transmission=10]="Transmission",t[t.Thickness=11]="Thickness",t[t.Specular=12]="Specular",t[t.SpecularColor=13]="SpecularColor",t[t.Iridescence=14]="Iridescence",t[t.IridescenceThickness=15]="IridescenceThickness",t[t.Anisotropy=16]="Anisotropy"}(Cb||(Cb={}));class wb{constructor(t,e,i,n){this[gb]=null,this[fb]={rotation:0,scale:new $e(1,1),offset:new $e(0,0)},this[vb]=!1,i&&(this[yb].rotation=i.rotation,this[yb].scale.copy(i.repeat),this[yb].offset.copy(i.offset),this[bb]=new mb(t,i)),this[Eb]=t,this[xb]=n,this[_b]=e}get texture(){return this[bb]}setTexture(t){var e,i;const n=null!=t?t.source[Xv]:null,s=null===(e=this[bb])||void 0===e?void 0:e.source[Xv];if(null!=s&&s.isVideoTexture?this[Sb]=!1:(null===(i=this[bb])||void 0===i?void 0:i.source.animation)&&this[bb].source.animation.removeEventListener("enterFrame",this[Eb]),this[bb]=t,null!=n&&n.isVideoTexture){const t=n.image;if(this[Sb]=!0,null!=t.requestVideoFrameCallback){const e=()=>{this[Sb]&&(this[Eb](),t.requestVideoFrameCallback(e))};t.requestVideoFrameCallback(e)}else{const t=()=>{this[Sb]&&(this[Eb](),requestAnimationFrame(t))};requestAnimationFrame(t)}}else null!=(null==t?void 0:t.source.animation)&&t.source.animation.addEventListener("enterFrame",this[Eb]);let r=Ee;if(this[xb])for(const t of this[xb]){switch(this[_b]){case Cb.Base:t.map=n;break;case Cb.MetallicRoughness:r=Se,t.metalnessMap=n,t.roughnessMap=n;break;case Cb.Normal:r=Se,t.normalMap=n;break;case Cb.Occlusion:r=Se,t.aoMap=n;break;case Cb.Emissive:t.emissiveMap=n;break;case Cb.Clearcoat:t.clearcoatMap=n;break;case Cb.ClearcoatRoughness:t.clearcoatRoughnessMap=n;break;case Cb.ClearcoatNormal:t.clearcoatNormalMap=n;break;case Cb.SheenColor:t.sheenColorMap=n;break;case Cb.SheenRoughness:t.sheenRoughnessMap=n;break;case Cb.Transmission:t.transmissionMap=n;break;case Cb.Thickness:t.thicknessMap=n;break;case Cb.Specular:t.specularIntensityMap=n;break;case Cb.SpecularColor:t.specularColorMap=n;break;case Cb.Iridescence:t.iridescenceMap=n;break;case Cb.IridescenceThickness:t.iridescenceThicknessMap=n;break;case Cb.Anisotropy:t.anisotropyMap=n}t.needsUpdate=!0}n&&(n.colorSpace=r,n.rotation=this[yb].rotation,n.repeat=this[yb].scale,n.offset=this[yb].offset),this[Eb]()}}gb=bb,fb=yb,vb=Sb;
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -871,7 +871,7 @@ const tb=new Map([[Zv.Repeat,at],[Zv.ClampToEdge,ot],[Zv.MirroredRepeat,lt]]),eb
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const Mb=Symbol("threeMaterial"),Tb=Symbol("threeMaterials"),Bb=Symbol("baseColorTexture"),Rb=Symbol("metallicRoughnessTexture");class Db extends Wv{get[Tb](){return this[zv]}get[Mb](){var t;return null===(t=this[zv])||void 0===t?void 0:t.values().next().value}constructor(t,e){super(t,e);const{map:i,metalnessMap:n}=e.values().next().value;this[Bb]=new Ib(t,wb.Base,i,e),this[Rb]=new Ib(t,wb.MetallicRoughness,n,e)}get baseColorFactor(){const t=[0,0,0,this[Mb].opacity];return this[Mb].color.toArray(t),t}get metallicFactor(){return this[Mb].metalness}get roughnessFactor(){return this[Mb].roughness}get baseColorTexture(){return this[Bb]}get metallicRoughnessTexture(){return this[Rb]}setBaseColorFactor(t){const e=new Xn;t instanceof Array?e.fromArray(t):e.set(t);for(const i of this[Tb])i.color.set(e),t instanceof Array&&t.length>3?i.opacity=t[3]:(t=[0,0,0,i.opacity],e.toArray(t));this[Vv]()}setMetallicFactor(t){for(const e of this[Tb])e.metalness=t;this[Vv]()}setRoughnessFactor(t){for(const e of this[Tb])e.roughness=t;this[Vv]()}}
const Ib=Symbol("threeMaterial"),Mb=Symbol("threeMaterials"),Tb=Symbol("baseColorTexture"),Bb=Symbol("metallicRoughnessTexture");class Rb extends Vv{get[Mb](){return this[Hv]}get[Ib](){var t;return null===(t=this[Hv])||void 0===t?void 0:t.values().next().value}constructor(t,e){super(t,e);const{map:i,metalnessMap:n}=e.values().next().value;this[Tb]=new wb(t,Cb.Base,i,e),this[Bb]=new wb(t,Cb.MetallicRoughness,n,e)}get baseColorFactor(){const t=[0,0,0,this[Ib].opacity];return this[Ib].color.toArray(t),t}get metallicFactor(){return this[Ib].metalness}get roughnessFactor(){return this[Ib].roughness}get baseColorTexture(){return this[Tb]}get metallicRoughnessTexture(){return this[Bb]}setBaseColorFactor(t){const e=new Xn;t instanceof Array?e.fromArray(t):e.set(t);for(const i of this[Mb])i.color.set(e),t instanceof Array&&t.length>3?i.opacity=t[3]:(t=[0,0,0,i.opacity],e.toArray(t));this[zv]()}setMetallicFactor(t){for(const e of this[Mb])e.metalness=t;this[zv]()}setRoughnessFactor(t){for(const e of this[Mb])e.roughness=t;this[zv]()}}
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -885,7 +885,7 @@ const Mb=Symbol("threeMaterial"),Tb=Symbol("threeMaterials"),Bb=Symbol("baseColo
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var Lb,Pb;const Ub=Symbol("pbrMetallicRoughness"),Fb=Symbol("normalTexture"),Nb=Symbol("occlusionTexture"),Ob=Symbol("emissiveTexture"),Qb=Symbol("backingThreeMaterial"),kb=Symbol("applyAlphaCutoff"),Gb=Symbol("getAlphaMode"),Hb=Symbol("lazyLoadGLTFInfo"),zb=Symbol("initialize"),Vb=Symbol("getLoadedMaterial"),Wb=Symbol("ensureMaterialIsLoaded"),qb=Symbol("gltfIndex"),jb=Symbol("setActive"),Xb=Symbol("variantIndices"),Yb=Symbol("isActive"),Kb=Symbol("modelVariants"),Jb=Symbol("name"),$b=Symbol("pbrTextures");class Zb extends Wv{get[(Lb=Xb,Pb=$b,Qb)](){return this[zv].values().next().value}constructor(t,e,i,n,s,r,a=void 0){super(t,s),this[Lb]=new Set,this[Pb]=new Map,this[qb]=e,this[Yb]=i,this[Kb]=n,this[Jb]=r,null==a?this[zb]():this[Hb]=a}[zb](){const t=this[Vv],e=this[zv];this[Ub]=new Db(t,e);const{normalMap:i,aoMap:n,emissiveMap:s}=e.values().next().value;this[Fb]=new Ib(t,wb.Normal,i,e),this[Nb]=new Ib(t,wb.Occlusion,n,e),this[Ob]=new Ib(t,wb.Emissive,s,e);const r=i=>{this[$b].set(i,new Ib(t,i,null,e))};r(wb.Clearcoat),r(wb.ClearcoatRoughness),r(wb.ClearcoatNormal),r(wb.SheenColor),r(wb.SheenRoughness),r(wb.Transmission),r(wb.Thickness),r(wb.Specular),r(wb.SpecularColor),r(wb.Iridescence),r(wb.IridescenceThickness),r(wb.Anisotropy)}async[Vb](){if(null!=this[Hb]){const t=await this[Hb].doLazyLoad();return this[zb](),this[Hb]=void 0,this.ensureLoaded=async()=>{},t}return null}colorFromRgb(t){const e=new Xn;return t instanceof Array?e.fromArray(t):e.set(t),e}[Wb](){if(null!=this[Hb])throw new Error(`Material "${this.name}" has not been loaded, call 'await\n myMaterial.ensureLoaded()' before using an unloaded material.`)}async ensureLoaded(){await this[Vb]()}get isLoaded(){return null==this[Hb]}get isActive(){return this[Yb]}[jb](t){this[Yb]=t}get name(){return this[Jb]||""}set name(t){if(this[Jb]=t,null!=this[zv])for(const e of this[zv])e.name=t}get pbrMetallicRoughness(){return this[Wb](),this[Ub]}get normalTexture(){return this[Wb](),this[Fb]}get occlusionTexture(){return this[Wb](),this[Nb]}get emissiveTexture(){return this[Wb](),this[Ob]}get emissiveFactor(){return this[Wb](),this[Qb].emissive.toArray()}get index(){return this[qb]}hasVariant(t){const e=this[Kb].get(t);return null!=e&&this[Xb].has(e.index)}setEmissiveFactor(t){this[Wb]();const e=this.colorFromRgb(t);for(const t of this[zv])t.emissive.set(e);this[Vv]()}[Gb](){return this[Qb].transparent?"BLEND":this[Qb].alphaTest>0?"MASK":"OPAQUE"}[kb](){this[Wb]();for(const t of this[zv])"MASK"===this[Gb]()?null==t.alphaTest&&(t.alphaTest=.5):t.alphaTest=void 0,t.needsUpdate=!0}setAlphaCutoff(t){this[Wb]();for(const e of this[zv])e.alphaTest=t,e.needsUpdate=!0;this[kb](),this[Vv]()}getAlphaCutoff(){return this[Wb](),this[Qb].alphaTest}setDoubleSided(t){this[Wb]();for(const e of this[zv])e.side=t?2:0,e.needsUpdate=!0;this[Vv]()}getDoubleSided(){return this[Wb](),2==this[Qb].side}setAlphaMode(t){this[Wb]();const e=(t,e)=>{t.transparent=e,t.depthWrite=!e};for(const i of this[zv])e(i,"BLEND"===t),i.alphaTest="MASK"===t?.5:void 0,i.needsUpdate=!0;this[Vv]()}getAlphaMode(){return this[Wb](),this[Gb]()}get emissiveStrength(){return this[Wb](),this[Qb].emissiveIntensity}setEmissiveStrength(t){this[Wb]();for(const e of this[zv])e.emissiveIntensity=t;this[Vv]()}get clearcoatFactor(){return this[Wb](),this[Qb].clearcoat}get clearcoatRoughnessFactor(){return this[Wb](),this[Qb].clearcoatRoughness}get clearcoatTexture(){return this[Wb](),this[$b].get(wb.Clearcoat)}get clearcoatRoughnessTexture(){return this[Wb](),this[$b].get(wb.ClearcoatRoughness)}get clearcoatNormalTexture(){return this[Wb](),this[$b].get(wb.ClearcoatNormal)}get clearcoatNormalScale(){return this[Wb](),this[Qb].clearcoatNormalScale.x}setClearcoatFactor(t){this[Wb]();for(const e of this[zv])e.clearcoat=t;this[Vv]()}setClearcoatRoughnessFactor(t){this[Wb]();for(const e of this[zv])e.clearcoatRoughness=t;this[Vv]()}setClearcoatNormalScale(t){this[Wb]();for(const e of this[zv])e.clearcoatNormalScale=new $e(t,t);this[Vv]()}get ior(){return this[Wb](),this[Qb].ior}setIor(t){this[Wb]();for(const e of this[zv])e.ior=t;this[Vv]()}get sheenColorFactor(){return this[Wb](),this[Qb].sheenColor.toArray()}get sheenColorTexture(){return this[Wb](),this[$b].get(wb.SheenColor)}get sheenRoughnessFactor(){return this[Wb](),this[Qb].sheenRoughness}get sheenRoughnessTexture(){return this[Wb](),this[$b].get(wb.SheenRoughness)}setSheenColorFactor(t){this[Wb]();const e=this.colorFromRgb(t);for(const t of this[zv])t.sheenColor.set(e),t.sheen=1;this[Vv]()}setSheenRoughnessFactor(t){this[Wb]();for(const e of this[zv])e.sheenRoughness=t,e.sheen=1;this[Vv]()}get transmissionFactor(){return this[Wb](),this[Qb].transmission}get transmissionTexture(){return this[Wb](),this[$b].get(wb.Transmission)}setTransmissionFactor(t){this[Wb]();for(const e of this[zv])e.transmission=t;this[Vv]()}get thicknessFactor(){return this[Wb](),this[Qb].thickness}get thicknessTexture(){return this[Wb](),this[$b].get(wb.Thickness)}get attenuationDLine truncated
*/var Db,Lb;const Pb=Symbol("pbrMetallicRoughness"),Ub=Symbol("normalTexture"),Fb=Symbol("occlusionTexture"),Nb=Symbol("emissiveTexture"),Ob=Symbol("backingThreeMaterial"),Qb=Symbol("applyAlphaCutoff"),kb=Symbol("getAlphaMode"),Gb=Symbol("lazyLoadGLTFInfo"),Hb=Symbol("initialize"),zb=Symbol("getLoadedMaterial"),Vb=Symbol("ensureMaterialIsLoaded"),Wb=Symbol("gltfIndex"),qb=Symbol("setActive"),jb=Symbol("variantIndices"),Xb=Symbol("isActive"),Yb=Symbol("modelVariants"),Kb=Symbol("name"),Jb=Symbol("pbrTextures");class $b extends Vv{get[(Db=jb,Lb=Jb,Ob)](){return this[Hv].values().next().value}constructor(t,e,i,n,s,r,a=void 0){super(t,s),this[Db]=new Set,this[Lb]=new Map,this[Wb]=e,this[Xb]=i,this[Yb]=n,this[Kb]=r,null==a?this[Hb]():this[Gb]=a}[Hb](){const t=this[zv],e=this[Hv];this[Pb]=new Rb(t,e);const{normalMap:i,aoMap:n,emissiveMap:s}=e.values().next().value;this[Ub]=new wb(t,Cb.Normal,i,e),this[Fb]=new wb(t,Cb.Occlusion,n,e),this[Nb]=new wb(t,Cb.Emissive,s,e);const r=i=>{this[Jb].set(i,new wb(t,i,null,e))};r(Cb.Clearcoat),r(Cb.ClearcoatRoughness),r(Cb.ClearcoatNormal),r(Cb.SheenColor),r(Cb.SheenRoughness),r(Cb.Transmission),r(Cb.Thickness),r(Cb.Specular),r(Cb.SpecularColor),r(Cb.Iridescence),r(Cb.IridescenceThickness),r(Cb.Anisotropy)}async[zb](){if(null!=this[Gb]){const t=await this[Gb].doLazyLoad();return this[Hb](),this[Gb]=void 0,this.ensureLoaded=async()=>{},t}return null}colorFromRgb(t){const e=new Xn;return t instanceof Array?e.fromArray(t):e.set(t),e}[Vb](){if(null!=this[Gb])throw new Error(`Material "${this.name}" has not been loaded, call 'await\n myMaterial.ensureLoaded()' before using an unloaded material.`)}async ensureLoaded(){await this[zb]()}get isLoaded(){return null==this[Gb]}get isActive(){return this[Xb]}[qb](t){this[Xb]=t}get name(){return this[Kb]||""}set name(t){if(this[Kb]=t,null!=this[Hv])for(const e of this[Hv])e.name=t}get pbrMetallicRoughness(){return this[Vb](),this[Pb]}get normalTexture(){return this[Vb](),this[Ub]}get occlusionTexture(){return this[Vb](),this[Fb]}get emissiveTexture(){return this[Vb](),this[Nb]}get emissiveFactor(){return this[Vb](),this[Ob].emissive.toArray()}get index(){return this[Wb]}hasVariant(t){const e=this[Yb].get(t);return null!=e&&this[jb].has(e.index)}setEmissiveFactor(t){this[Vb]();const e=this.colorFromRgb(t);for(const t of this[Hv])t.emissive.set(e);this[zv]()}[kb](){return this[Ob].transparent?"BLEND":this[Ob].alphaTest>0?"MASK":"OPAQUE"}[Qb](){this[Vb]();for(const t of this[Hv])"MASK"===this[kb]()?null==t.alphaTest&&(t.alphaTest=.5):t.alphaTest=void 0,t.needsUpdate=!0}setAlphaCutoff(t){this[Vb]();for(const e of this[Hv])e.alphaTest=t,e.needsUpdate=!0;this[Qb](),this[zv]()}getAlphaCutoff(){return this[Vb](),this[Ob].alphaTest}setDoubleSided(t){this[Vb]();for(const e of this[Hv])e.side=t?2:0,e.needsUpdate=!0;this[zv]()}getDoubleSided(){return this[Vb](),2==this[Ob].side}setAlphaMode(t){this[Vb]();const e=(t,e)=>{t.transparent=e,t.depthWrite=!e};for(const i of this[Hv])e(i,"BLEND"===t),i.alphaTest="MASK"===t?.5:void 0,i.needsUpdate=!0;this[zv]()}getAlphaMode(){return this[Vb](),this[kb]()}get emissiveStrength(){return this[Vb](),this[Ob].emissiveIntensity}setEmissiveStrength(t){this[Vb]();for(const e of this[Hv])e.emissiveIntensity=t;this[zv]()}get clearcoatFactor(){return this[Vb](),this[Ob].clearcoat}get clearcoatRoughnessFactor(){return this[Vb](),this[Ob].clearcoatRoughness}get clearcoatTexture(){return this[Vb](),this[Jb].get(Cb.Clearcoat)}get clearcoatRoughnessTexture(){return this[Vb](),this[Jb].get(Cb.ClearcoatRoughness)}get clearcoatNormalTexture(){return this[Vb](),this[Jb].get(Cb.ClearcoatNormal)}get clearcoatNormalScale(){return this[Vb](),this[Ob].clearcoatNormalScale.x}setClearcoatFactor(t){this[Vb]();for(const e of this[Hv])e.clearcoat=t;this[zv]()}setClearcoatRoughnessFactor(t){this[Vb]();for(const e of this[Hv])e.clearcoatRoughness=t;this[zv]()}setClearcoatNormalScale(t){this[Vb]();for(const e of this[Hv])e.clearcoatNormalScale=new $e(t,t);this[zv]()}get ior(){return this[Vb](),this[Ob].ior}setIor(t){this[Vb]();for(const e of this[Hv])e.ior=t;this[zv]()}get sheenColorFactor(){return this[Vb](),this[Ob].sheenColor.toArray()}get sheenColorTexture(){return this[Vb](),this[Jb].get(Cb.SheenColor)}get sheenRoughnessFactor(){return this[Vb](),this[Ob].sheenRoughness}get sheenRoughnessTexture(){return this[Vb](),this[Jb].get(Cb.SheenRoughness)}setSheenColorFactor(t){this[Vb]();const e=this.colorFromRgb(t);for(const t of this[Hv])t.sheenColor.set(e),t.sheen=1;this[zv]()}setSheenRoughnessFactor(t){this[Vb]();for(const e of this[Hv])e.sheenRoughness=t,e.sheen=1;this[zv]()}get transmissionFactor(){return this[Vb](),this[Ob].transmission}get transmissionTexture(){return this[Vb](),this[Jb].get(Cb.Transmission)}setTransmissionFactor(t){this[Vb]();for(const e of this[Hv])e.transmission=t;this[zv]()}get thicknessFactor(){return this[Vb](),this[Ob].thickness}get thicknessTexture(){return this[Vb](),this[Jb].get(Cb.Thickness)}get attenuationDLine truncated
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -899,7 +899,7 @@ const Mb=Symbol("threeMaterial"),Tb=Symbol("threeMaterials"),Bb=Symbol("baseColo
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var iy,ny,sy,ry,ay,oy;const ly=Symbol("materials"),cy=Symbol("hierarchy"),hy=Symbol("roots"),uy=Symbol("primitives"),dy=Symbol("prepareVariantsForExport"),py=Symbol("switchVariant"),Ay=Symbol("materialFromPoint"),my=Symbol("nodeFromPoint"),gy=Symbol("nodeFromIndex"),fy=Symbol("variantData"),vy=Symbol("availableVariants"),by=Symbol("modelOnUpdate"),yy=Symbol("cloneMaterial");class xy{constructor(t,e,i,n){this.gltf=t,this.gltfElementMap=e,this.mapKey=i,this.doLazyLoad=n}}class _y{constructor(t,e=()=>{}){this[iy]=new Array,this[ny]=new Array,this[sy]=new Array,this[ry]=new Array,this[ay]=()=>{},this[oy]=new Map,this[by]=e;const{gltf:i,threeGLTF:n,gltfElementMap:s}=t;for(const[t,r]of i.materials.entries()){const a=s.get(r);if(null!=a)this[ly].push(new Zb(e,t,!0,this[fy],a,r.name));else{const a=(i.materials||[])[t],o=new Set;s.set(a,o);const l=async()=>{const e=await n.parser.getDependency("material",t);return o.add(e),e};this[ly].push(new Zb(e,t,!1,this[fy],o,r.name,new xy(i,s,a,l)))}}const r=new Map,a=new Array;for(const t of n.scene.children)a.push(t);for(;a.length>0;){const e=a.pop();let i=null;e instanceof Ms?(i=new ey(e,this.materials,this[fy],t),this[uy].push(i)):i=new ty(e.name);const n=r.get(e);null!=n?n.children.push(i):this[hy].push(i),this[cy].push(i);for(const t of e.children)a.push(t),r.set(e,i)}}get materials(){return this[ly]}[(iy=ly,ny=cy,sy=hy,ry=uy,ay=by,oy=fy,vy)](){const t=Array.from(this[fy].values());return t.sort(((t,e)=>t.index-e.index)),t.map((t=>t.name))}getMaterialByName(t){const e=this[ly].filter((e=>e.name===t));return e.length>0?e[0]:null}[gy](t,e){const i=this[cy].find((i=>{if(i instanceof ey){const{meshes:n,primitives:s}=i.mesh.userData.associations;if(n==t&&s==e)return!0}return!1}));return null==i?null:i}[my](t){return this[cy].find((e=>{if(e instanceof ey){if(e.mesh===t.object)return!0}return!1}))}[Ay](t){return this[my](t).getActiveMaterial()}async[py](t){for(const e of this[uy])await e.enableVariant(t);for(const t of this.materials)t[jb](!1);for(const t of this[uy])this.materials[t.getActiveMaterial().index][jb](!0)}async[dy](){const t=new Array;for(const e of this[uy])t.push(e.instantiateVariants());await Promise.all(t)}[yy](t,e){const i=this.materials[t];i.isLoaded||console.error("Cloning an unloaded material,\n call 'material.ensureLoaded() before cloning the material.");const n=i[zv],s=new Set;for(const[t,i]of n.entries()){const r=i.clone();r.name=e+(n.size>1?"_inst"+t:""),s.add(r)}const r=new Zb(this[by],this[ly].length,!1,this[fy],s,e);return this[ly].push(r),r}createMaterialInstanceForVariant(t,e,i,n=!0){let s=null;for(const n of this[uy]){const r=this[fy].get(i);null!=r&&n.variantInfo.has(r.index)||null!=n.getMaterial(t)&&(this.hasVariant(i)||this.createVariant(i),null==s&&(s=this[yy](t,e)),n.addVariant(s,i))}if(n&&null!=s){s[jb](!0),this.materials[t][jb](!1);for(const t of this[uy])t.enableVariant(i)}return s}createVariant(t){this[fy].has(t)?console.warn(`Variant '${t}'' already exists`):this[fy].set(t,{name:t,index:this[fy].size})}hasVariant(t){return this[fy].has(t)}setMaterialToVariant(t,e){if(null!=this[vy]().find((t=>t===e)))if(t<0||t>=this.materials.length)console.error("setMaterialToVariant(): materialIndex is out of bounds.");else for(const i of this[uy]){const n=i.getMaterial(t);null!=n&&i.addVariant(n,e)}else console.warn(`Can't add material to '${e}', the variant does not exist.'`)}updateVariantName(t,e){const i=this[fy].get(t);null!=i&&(i.name=e,this[fy].set(e,i),this[fy].delete(t))}deleteVariant(t){const e=this[fy].get(t);if(null!=e){for(const i of this.materials)i.hasVariant(t)&&i[Xb].delete(e.index);for(const t of this[uy])t.deleteVariant(e.index);this[fy].delete(t)}}}
*/var ey,iy,ny,sy,ry,ay;const oy=Symbol("materials"),ly=Symbol("hierarchy"),cy=Symbol("roots"),hy=Symbol("primitives"),uy=Symbol("prepareVariantsForExport"),dy=Symbol("switchVariant"),py=Symbol("materialFromPoint"),Ay=Symbol("nodeFromPoint"),my=Symbol("nodeFromIndex"),gy=Symbol("variantData"),fy=Symbol("availableVariants"),vy=Symbol("modelOnUpdate"),by=Symbol("cloneMaterial");class yy{constructor(t,e,i,n){this.gltf=t,this.gltfElementMap=e,this.mapKey=i,this.doLazyLoad=n}}class xy{constructor(t,e=()=>{}){this[ey]=new Array,this[iy]=new Array,this[ny]=new Array,this[sy]=new Array,this[ry]=()=>{},this[ay]=new Map,this[vy]=e;const{gltf:i,threeGLTF:n,gltfElementMap:s}=t;for(const[t,r]of i.materials.entries()){const a=s.get(r);if(null!=a)this[oy].push(new $b(e,t,!0,this[gy],a,r.name));else{const a=(i.materials||[])[t],o=new Set;s.set(a,o);const l=async()=>{const e=await n.parser.getDependency("material",t);return o.add(e),e};this[oy].push(new $b(e,t,!1,this[gy],o,r.name,new yy(i,s,a,l)))}}const r=new Map,a=new Array;for(const t of n.scene.children)a.push(t);for(;a.length>0;){const e=a.pop();let i=null;e instanceof Ms?(i=new ty(e,this.materials,this[gy],t),this[hy].push(i)):i=new Zb(e.name);const n=r.get(e);null!=n?n.children.push(i):this[cy].push(i),this[ly].push(i);for(const t of e.children)a.push(t),r.set(e,i)}}get materials(){return this[oy]}[(ey=oy,iy=ly,ny=cy,sy=hy,ry=vy,ay=gy,fy)](){const t=Array.from(this[gy].values());return t.sort(((t,e)=>t.index-e.index)),t.map((t=>t.name))}getMaterialByName(t){const e=this[oy].filter((e=>e.name===t));return e.length>0?e[0]:null}[my](t,e){const i=this[ly].find((i=>{if(i instanceof ty){const{meshes:n,primitives:s}=i.mesh.userData.associations;if(n==t&&s==e)return!0}return!1}));return null==i?null:i}[Ay](t){return this[ly].find((e=>{if(e instanceof ty){if(e.mesh===t.object)return!0}return!1}))}[py](t){return this[Ay](t).getActiveMaterial()}async[dy](t){for(const e of this[hy])await e.enableVariant(t);for(const t of this.materials)t[qb](!1);for(const t of this[hy])this.materials[t.getActiveMaterial().index][qb](!0)}async[uy](){const t=new Array;for(const e of this[hy])t.push(e.instantiateVariants());await Promise.all(t)}[by](t,e){const i=this.materials[t];i.isLoaded||console.error("Cloning an unloaded material,\n call 'material.ensureLoaded() before cloning the material.");const n=i[Hv],s=new Set;for(const[t,i]of n.entries()){const r=i.clone();r.name=e+(n.size>1?"_inst"+t:""),s.add(r)}const r=new $b(this[vy],this[oy].length,!1,this[gy],s,e);return this[oy].push(r),r}createMaterialInstanceForVariant(t,e,i,n=!0){let s=null;for(const n of this[hy]){const r=this[gy].get(i);null!=r&&n.variantInfo.has(r.index)||null!=n.getMaterial(t)&&(this.hasVariant(i)||this.createVariant(i),null==s&&(s=this[by](t,e)),n.addVariant(s,i))}if(n&&null!=s){s[qb](!0),this.materials[t][qb](!1);for(const t of this[hy])t.enableVariant(i)}return s}createVariant(t){this[gy].has(t)?console.warn(`Variant '${t}'' already exists`):this[gy].set(t,{name:t,index:this[gy].size})}hasVariant(t){return this[gy].has(t)}setMaterialToVariant(t,e){if(null!=this[fy]().find((t=>t===e)))if(t<0||t>=this.materials.length)console.error("setMaterialToVariant(): materialIndex is out of bounds.");else for(const i of this[hy]){const n=i.getMaterial(t);null!=n&&i.addVariant(n,e)}else console.warn(`Can't add material to '${e}', the variant does not exist.'`)}updateVariantName(t,e){const i=this[gy].get(t);null!=i&&(i.name=e,this[gy].set(e,i),this[gy].delete(t))}deleteVariant(t){const e=this[gy].get(t);if(null!=e){for(const i of this.materials)i.hasVariant(t)&&i[jb].delete(e.index);for(const t of this[hy])t.deleteVariant(e.index);this[gy].delete(t)}}}
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -913,7 +913,7 @@ const Mb=Symbol("threeMaterial"),Tb=Symbol("threeMaterials"),Bb=Symbol("baseColo
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var Ey=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const Sy=Symbol("currentGLTF"),Cy=Symbol("originalGltfJson"),wy=Symbol("model"),Iy=Symbol("getOnUpdateMethod"),My=Symbol("buildTexture");
*/var _y=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const Ey=Symbol("currentGLTF"),Sy=Symbol("originalGltfJson"),Cy=Symbol("model"),wy=Symbol("getOnUpdateMethod"),Iy=Symbol("buildTexture");
/* @license
* Copyright 2023 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -928,7 +928,7 @@ const Mb=Symbol("threeMaterial"),Tb=Symbol("threeMaterials"),Bb=Symbol("baseColo
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class Ty extends Ms{constructor(){super(void 0,new $n({depthWrite:!1})),this.height=0,this.radius=0,this.resolution=0,this.userData.noHit=!0}get map(){return this.material.map}set map(t){this.material.map=t}isUsable(){return this.height>0&&this.radius>0&&null!=this.geometry&&null!=this.map}updateGeometry(t=this.height,e=this.radius,i=128){t==this.height&&e==this.radius&&i==this.resolution||(this.height=t,this.radius=e,this.resolution=i,t>0&&e>0&&(this.geometry.dispose(),this.geometry=function(t,e,i){const n=new Ka(e,2*i,i);n.scale(1,1,-1);const s=n.getAttribute("position"),r=new Ci;for(let e=0;e<s.count;++e)if(r.fromBufferAttribute(s,e),r.y<0){const i=3*-t/2,n=r.y<i?-t/r.y:1-r.y*r.y/(3*i*i);r.multiplyScalar(n),r.toArray(s.array,3*e)}return s.needsUpdate=!0,n}
class My extends Ms{constructor(){super(void 0,new $n({depthWrite:!1})),this.height=0,this.radius=0,this.resolution=0,this.userData.noHit=!0}get map(){return this.material.map}set map(t){this.material.map=t}isUsable(){return this.height>0&&this.radius>0&&null!=this.geometry&&null!=this.map}updateGeometry(t=this.height,e=this.radius,i=128){t==this.height&&e==this.radius&&i==this.resolution||(this.height=t,this.radius=e,this.resolution=i,t>0&&e>0&&(this.geometry.dispose(),this.geometry=function(t,e,i){const n=new Ka(e,2*i,i);n.scale(1,1,-1);const s=n.getAttribute("position"),r=new Ci;for(let e=0;e<s.count;++e)if(r.fromBufferAttribute(s,e),r.y<0){const i=3*-t/2,n=r.y<i?-t/r.y:1-r.y*r.y/(3*i*i);r.multiplyScalar(n),r.toArray(s.array,3*e)}return s.needsUpdate=!0,n}
/* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -942,7 +942,7 @@ class Ty extends Ms{constructor(){super(void 0,new $n({depthWrite:!1})),this.hei
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/(t,e,i)))}}const By=new Ci,Ry=new Ci,Dy=new Ci,Ly=new Ze,Py=new zn,Uy=new Si;class Fy extends hA{constructor(t){super(document.createElement("div")),this.normal=new Ci(0,1,0),this.initialized=!1,this.referenceCount=1,this.pivot=document.createElement("div"),this.slot=document.createElement("slot"),this.element.classList.add("annotation-wrapper"),this.slot.name=t.name,this.element.appendChild(this.pivot),this.pivot.appendChild(this.slot),this.updatePosition(t.position),this.updateNormal(t.normal),this.surface=t.surface}get facingCamera(){return!this.element.classList.contains("hide")}show(){this.facingCamera&&this.initialized||this.updateVisibility(!0)}hide(){!this.facingCamera&&this.initialized||this.updateVisibility(!1)}increment(){this.referenceCount++}decrement(){return this.referenceCount>0&&--this.referenceCount,0===this.referenceCount}updatePosition(t){if(null==t)return;const e=Sm(t)[0].terms;for(let t=0;t<3;++t)this.position.setComponent(t,Um(e[t]).number);this.updateMatrixWorld()}updateNormal(t){if(null==t)return;const e=Sm(t)[0].terms;for(let t=0;t<3;++t)this.normal.setComponent(t,e[t].number)}updateSurface(){const{mesh:t,tri:e,bary:i}=this;if(null==t||null==e||null==i)return;t.getVertexPosition(e.x,By),t.getVertexPosition(e.y,Ry),t.getVertexPosition(e.z,Dy),By.toArray(Ly.elements,0),Ry.toArray(Ly.elements,3),Dy.toArray(Ly.elements,6),this.position.copy(i).applyMatrix3(Ly);const n=this.parent;n.worldToLocal(t.localToWorld(this.position)),Py.set(By,Ry,Dy),Py.getNormal(this.normal).transformDirection(t.matrixWorld);const s=n.parent;Uy.setFromAxisAngle(By.set(0,1,0),-s.rotation.y),this.normal.applyQuaternion(Uy)}orient(t){this.pivot.style.transform=`rotate(${t}rad)`}updateVisibility(t){this.element.classList.toggle("hide",!t),this.slot.assignedNodes().forEach((e=>{if(e.nodeType!==Node.ELEMENT_NODE)return;const i=e,n=i.dataset.visibilityAttribute;if(null!=n){const e=`data-${n}`;i.toggleAttribute(e,t)}i.dispatchEvent(new CustomEvent("hotspot-visibility",{detail:{visible:t}}))})),this.initialized=!0}}const Ny={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform float h;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 sum = vec4( 0.0 );\n\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n\t\t\tgl_FragColor = sum;\n\n\t\t}"},Oy={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform float v;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 sum = vec4( 0.0 );\n\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\n\n\t\t\tgl_FragColor = sum;\n\n\t\t}"};function Qy(t,e,i){return(1-i)*t+i*e}
*/(t,e,i)))}}const Ty=new Ci,By=new Ci,Ry=new Ci,Dy=new Ze,Ly=new zn,Py=new Si;class Uy extends hA{constructor(t){super(document.createElement("div")),this.normal=new Ci(0,1,0),this.initialized=!1,this.referenceCount=1,this.pivot=document.createElement("div"),this.slot=document.createElement("slot"),this.element.classList.add("annotation-wrapper"),this.slot.name=t.name,this.element.appendChild(this.pivot),this.pivot.appendChild(this.slot),this.updatePosition(t.position),this.updateNormal(t.normal),this.surface=t.surface}get facingCamera(){return!this.element.classList.contains("hide")}show(){this.facingCamera&&this.initialized||this.updateVisibility(!0)}hide(){!this.facingCamera&&this.initialized||this.updateVisibility(!1)}increment(){this.referenceCount++}decrement(){return this.referenceCount>0&&--this.referenceCount,0===this.referenceCount}updatePosition(t){if(null==t)return;const e=Sm(t)[0].terms;for(let t=0;t<3;++t)this.position.setComponent(t,Um(e[t]).number);this.updateMatrixWorld()}updateNormal(t){if(null==t)return;const e=Sm(t)[0].terms;for(let t=0;t<3;++t)this.normal.setComponent(t,e[t].number)}updateSurface(){const{mesh:t,tri:e,bary:i}=this;if(null==t||null==e||null==i)return;t.getVertexPosition(e.x,Ty),t.getVertexPosition(e.y,By),t.getVertexPosition(e.z,Ry),Ty.toArray(Dy.elements,0),By.toArray(Dy.elements,3),Ry.toArray(Dy.elements,6),this.position.copy(i).applyMatrix3(Dy);const n=this.parent;n.worldToLocal(t.localToWorld(this.position)),Ly.set(Ty,By,Ry),Ly.getNormal(this.normal).transformDirection(t.matrixWorld);const s=n.parent;Py.setFromAxisAngle(Ty.set(0,1,0),-s.rotation.y),this.normal.applyQuaternion(Py)}orient(t){this.pivot.style.transform=`rotate(${t}rad)`}updateVisibility(t){this.element.classList.toggle("hide",!t),this.slot.assignedNodes().forEach((e=>{if(e.nodeType!==Node.ELEMENT_NODE)return;const i=e,n=i.dataset.visibilityAttribute;if(null!=n){const e=`data-${n}`;i.toggleAttribute(e,t)}i.dispatchEvent(new CustomEvent("hotspot-visibility",{detail:{visible:t}}))})),this.initialized=!0}}const Fy={name:"HorizontalBlurShader",uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform float h;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 sum = vec4( 0.0 );\n\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;\n\n\t\t\tgl_FragColor = sum;\n\n\t\t}"},Ny={name:"VerticalBlurShader",uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform float v;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 sum = vec4( 0.0 );\n\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;\n\t\t\tsum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;\n\n\t\t\tgl_FragColor = sum;\n\n\t\t}"};function Oy(t,e,i){return(1-i)*t+i*e}
/* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -956,7 +956,7 @@ class Ty extends Ms{constructor(){super(void 0,new $n({depthWrite:!1})),this.hei
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class ky extends Tn{constructor(t,e,i){super(),this.camera=new Ho,this.renderTarget=null,this.renderTargetBlur=null,this.depthMaterial=new Za,this.horizontalBlurMaterial=new Us(Ny),this.verticalBlurMaterial=new Us(Oy),this.intensity=0,this.softness=1,this.boundingBox=new Mi,this.size=new Ci,this.maxDimension=0,this.isAnimated=!1,this.needsUpdate=!1;const{camera:n}=this;n.rotation.x=Math.PI/2,n.left=-.5,n.right=.5,n.bottom=-.5,n.top=.5,this.add(n);const s=new Xa,r=new $n({opacity:1,transparent:!0,side:1});this.floor=new Ms(s,r),this.floor.userData.noHit=!0,n.add(this.floor),this.blurPlane=new Ms(s),this.blurPlane.visible=!1,n.add(this.blurPlane),t.target.add(this),this.depthMaterial.onBeforeCompile=function(t){t.fragmentShader=t.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * opacity );")},this.depthMaterial.side=2,this.horizontalBlurMaterial.depthTest=!1,this.verticalBlurMaterial.depthTest=!1,this.setScene(t,e,i)}setScene(t,e,i){const{boundingBox:n,size:s,rotation:r,position:a}=this;if(this.isAnimated=t.animationNames.length>0,this.boundingBox.copy(t.boundingBox),this.size.copy(t.size),this.maxDimension=Math.max(s.x,s.y,s.z)*(this.isAnimated?2:1),this.boundingBox.getCenter(a),"back"===i){const{min:t,max:e}=n;[t.y,t.z]=[t.z,t.y],[e.y,e.z]=[e.z,e.y],[s.y,s.z]=[s.z,s.y],r.x=Math.PI/2,r.y=Math.PI}else r.x=0,r.y=0;if(this.isAnimated){const t=n.min.y,e=n.max.y;s.y=this.maxDimension,n.expandByVector(s.subScalar(this.maxDimension).multiplyScalar(-.5)),n.min.y=t,n.max.y=e,s.set(this.maxDimension,e-t,this.maxDimension)}"bottom"===i?a.y=n.min.y:a.z=n.min.y,this.setSoftness(e)}setSoftness(t){this.softness=t;const{size:e,camera:i}=this,n=this.isAnimated?2:1,s=n*Math.pow(2,9-3*t);this.setMapSize(s);const r=e.y/2,a=e.y*n;i.near=0,i.far=Qy(a,r,t),this.depthMaterial.opacity=1/t,i.updateProjectionMatrix(),this.setIntensity(this.intensity),this.setOffset(0)}setMapSize(t){const{size:e}=this;this.isAnimated&&(t*=2);const i=Math.floor(e.x>e.z?t:t*e.x/e.z),n=Math.floor(e.x>e.z?t*e.z/e.x:t),s=10+i,r=10+n;if(null==this.renderTarget||this.renderTarget.width===s&&this.renderTarget.height===r||(this.renderTarget.dispose(),this.renderTarget=null,this.renderTargetBlur.dispose(),this.renderTargetBlur=null),null==this.renderTarget){const t={format:It};this.renderTarget=new xi(s,r,t),this.renderTargetBlur=new xi(s,r,t),this.floor.material.map=this.renderTarget.texture}this.camera.scale.set(e.x*(1+10/i),e.z*(1+10/n),1),this.needsUpdate=!0}setIntensity(t){this.intensity=t,t>0?(this.visible=!0,this.floor.visible=!0,this.floor.material.opacity=t*Qy(.3,1,this.softness*this.softness)):(this.visible=!1,this.floor.visible=!1)}getIntensity(){return this.intensity}setOffset(t){this.floor.position.z=-t+this.gap()}gap(){return.001*this.maxDimension}render(t,e){e.overrideMaterial=this.depthMaterial;const i=t.getClearAlpha();t.setClearAlpha(0),this.floor.visible=!1;const n=t.xr.enabled;t.xr.enabled=!1;const s=t.getRenderTarget();t.setRenderTarget(this.renderTarget),t.render(e,this.camera),e.overrideMaterial=null,this.floor.visible=!0,this.blurShadow(t),t.xr.enabled=n,t.setRenderTarget(s),t.setClearAlpha(i)}blurShadow(t){const{camera:e,horizontalBlurMaterial:i,verticalBlurMaterial:n,renderTarget:s,renderTargetBlur:r,blurPlane:a}=this;a.visible=!0,a.material=i,i.uniforms.h.value=1/this.renderTarget.width,i.uniforms.tDiffuse.value=this.renderTarget.texture,t.setRenderTarget(r),t.render(a,e),a.material=n,n.uniforms.v.value=1/this.renderTarget.height,n.uniforms.tDiffuse.value=this.renderTargetBlur.texture,t.setRenderTarget(s),t.render(a,e),a.visible=!1}dispose(){null!=this.renderTarget&&this.renderTarget.dispose(),null!=this.renderTargetBlur&&this.renderTargetBlur.dispose(),this.depthMaterial.dispose(),this.horizontalBlurMaterial.dispose(),this.verticalBlurMaterial.dispose(),this.floor.material.dispose(),this.floor.geometry.dispose(),this.blurPlane.geometry.dispose(),this.removeFromParent()}}
*/class Qy extends Tn{constructor(t,e,i){super(),this.camera=new Ho,this.renderTarget=null,this.renderTargetBlur=null,this.depthMaterial=new Za,this.horizontalBlurMaterial=new Us(Fy),this.verticalBlurMaterial=new Us(Ny),this.intensity=0,this.softness=1,this.boundingBox=new Mi,this.size=new Ci,this.maxDimension=0,this.isAnimated=!1,this.needsUpdate=!1;const{camera:n}=this;n.rotation.x=Math.PI/2,n.left=-.5,n.right=.5,n.bottom=-.5,n.top=.5,this.add(n);const s=new Xa,r=new $n({opacity:1,transparent:!0,side:1});this.floor=new Ms(s,r),this.floor.userData.noHit=!0,n.add(this.floor),this.blurPlane=new Ms(s),this.blurPlane.visible=!1,n.add(this.blurPlane),t.target.add(this),this.depthMaterial.onBeforeCompile=function(t){t.fragmentShader=t.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * opacity );")},this.depthMaterial.side=2,this.horizontalBlurMaterial.depthTest=!1,this.verticalBlurMaterial.depthTest=!1,this.setScene(t,e,i)}setScene(t,e,i){const{boundingBox:n,size:s,rotation:r,position:a}=this;if(this.isAnimated=t.animationNames.length>0,this.boundingBox.copy(t.boundingBox),this.size.copy(t.size),this.maxDimension=Math.max(s.x,s.y,s.z)*(this.isAnimated?2:1),this.boundingBox.getCenter(a),"back"===i){const{min:t,max:e}=n;[t.y,t.z]=[t.z,t.y],[e.y,e.z]=[e.z,e.y],[s.y,s.z]=[s.z,s.y],r.x=Math.PI/2,r.y=Math.PI}else r.x=0,r.y=0;if(this.isAnimated){const t=n.min.y,e=n.max.y;s.y=this.maxDimension,n.expandByVector(s.subScalar(this.maxDimension).multiplyScalar(-.5)),n.min.y=t,n.max.y=e,s.set(this.maxDimension,e-t,this.maxDimension)}"bottom"===i?a.y=n.min.y:a.z=n.min.y,this.setSoftness(e)}setSoftness(t){this.softness=t;const{size:e,camera:i}=this,n=this.isAnimated?2:1,s=n*Math.pow(2,9-3*t);this.setMapSize(s);const r=e.y/2,a=e.y*n;i.near=0,i.far=Oy(a,r,t),this.depthMaterial.opacity=1/t,i.updateProjectionMatrix(),this.setIntensity(this.intensity),this.setOffset(0)}setMapSize(t){const{size:e}=this;this.isAnimated&&(t*=2);const i=Math.floor(e.x>e.z?t:t*e.x/e.z),n=Math.floor(e.x>e.z?t*e.z/e.x:t),s=10+i,r=10+n;if(null==this.renderTarget||this.renderTarget.width===s&&this.renderTarget.height===r||(this.renderTarget.dispose(),this.renderTarget=null,this.renderTargetBlur.dispose(),this.renderTargetBlur=null),null==this.renderTarget){const t={format:It};this.renderTarget=new xi(s,r,t),this.renderTargetBlur=new xi(s,r,t),this.floor.material.map=this.renderTarget.texture}this.camera.scale.set(e.x*(1+10/i),e.z*(1+10/n),1),this.needsUpdate=!0}setIntensity(t){this.intensity=t,t>0?(this.visible=!0,this.floor.visible=!0,this.floor.material.opacity=t*Oy(.3,1,this.softness*this.softness)):(this.visible=!1,this.floor.visible=!1)}getIntensity(){return this.intensity}setOffset(t){this.floor.position.z=-t+this.gap()}gap(){return.001*this.maxDimension}render(t,e){e.overrideMaterial=this.depthMaterial;const i=t.getClearAlpha();t.setClearAlpha(0),this.floor.visible=!1;const n=t.xr.enabled;t.xr.enabled=!1;const s=t.getRenderTarget();t.setRenderTarget(this.renderTarget),t.render(e,this.camera),e.overrideMaterial=null,this.floor.visible=!0,this.blurShadow(t),t.xr.enabled=n,t.setRenderTarget(s),t.setClearAlpha(i)}blurShadow(t){const{camera:e,horizontalBlurMaterial:i,verticalBlurMaterial:n,renderTarget:s,renderTargetBlur:r,blurPlane:a}=this;a.visible=!0,a.material=i,i.uniforms.h.value=1/this.renderTarget.width,i.uniforms.tDiffuse.value=this.renderTarget.texture,t.setRenderTarget(r),t.render(a,e),a.material=n,n.uniforms.v.value=1/this.renderTarget.height,n.uniforms.tDiffuse.value=this.renderTargetBlur.texture,t.setRenderTarget(s),t.render(a,e),a.visible=!1}dispose(){null!=this.renderTarget&&this.renderTarget.dispose(),null!=this.renderTargetBlur&&this.renderTargetBlur.dispose(),this.depthMaterial.dispose(),this.horizontalBlurMaterial.dispose(),this.verticalBlurMaterial.dispose(),this.floor.material.dispose(),this.floor.geometry.dispose(),this.blurPlane.geometry.dispose(),this.removeFromParent()}}
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -970,7 +970,7 @@ class Ty extends Ms{constructor(){super(void 0,new $n({depthWrite:!1})),this.hei
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const Gy=new Ci,Hy=new Ci,zy=new Ci,Vy=new class{constructor(t,e,i=0,n=1/0){this.ray=new tn(t,e),this.near=i,this.far=n,this.camera=null,this.layers=new pn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return ol.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(ol),this}intersectObject(t,e=!0,i=[]){return cl(t,this,i,e),i.sort(ll),i}intersectObjects(t,e=!0,i=[]){for(let n=0,s=t.length;n<s;n++)cl(t[n],this,i,e);return i.sort(ll),i}},Wy=new Ci,qy=new $e;class jy extends Xs{constructor({canvas:t,element:e,width:i,height:n}){super(),this.annotationRenderer=new gA,this.effectRenderer=null,this.schemaElement=document.createElement("script"),this.width=1,this.height=1,this.aspect=1,this.scaleStep=0,this.renderCount=0,this.externalRenderer=null,this.appendedAnimations=[],this.markedAnimations=[],this.camera=new ks(45,1,.1,100),this.xrCamera=null,this.url=null,this.pivot=new Tn,this.target=new Tn,this.animationNames=[],this.boundingBox=new Mi,this.boundingSphere=new qi,this.size=new Ci,this.idealAspect=0,this.framedFoVDeg=0,this.shadow=null,this.shadowIntensity=0,this.shadowSoftness=1,this.bakedShadows=new Set,this.exposure=1,this.toneMapping=7,this.canScale=!0,this.isDirty=!1,this.goalTarget=new Ci,this.targetDamperX=new vm,this.targetDamperY=new vm,this.targetDamperZ=new vm,this._currentGLTF=null,this._model=null,this.cancelPendingSourceChange=null,this.animationsByName=new Map,this.currentAnimationAction=null,this.groundedSkybox=new Ty,this.name="ModelScene",this.element=e,this.canvas=t,this.camera=new ks(45,1,.1,100),this.camera.name="MainCamera",this.add(this.pivot),this.pivot.name="Pivot",this.pivot.add(this.target),this.setSize(i,n),this.target.name="Target",this.mixer=new al(this.target);const{domElement:s}=this.annotationRenderer,{style:r}=s;r.display="none",r.pointerEvents="none",r.position="absolute",r.top="0",this.element.shadowRoot.querySelector(".default").appendChild(s),this.schemaElement.setAttribute("type","application/ld+json")}get context(){return this.canvas.getContext("2d")}getCamera(){return null!=this.xrCamera?this.xrCamera:this.camera}queueRender(){this.isDirty=!0}shouldRender(){return this.isDirty}hasRendered(){this.isDirty=!1}forceRescale(){this.scaleStep=-1,this.queueRender()}async setObject(t){this.reset(),this._model=t,this.target.add(t),await this.setupScene()}async setSource(t,e=()=>{}){if(!t||t===this.url)return void e(1);if(this.reset(),this.url=t,null!=this.externalRenderer){const t=await this.externalRenderer.load(e);return this.boundingSphere.radius=t.framedRadius,void(this.idealAspect=t.fieldOfViewAspect)}let i;null!=this.cancelPendingSourceChange&&(this.cancelPendingSourceChange(),this.cancelPendingSourceChange=null);try{i=await new Promise((async(i,n)=>{this.cancelPendingSourceChange=()=>n();try{i(await this.element[Ox].loader.load(t,this.element,e))}catch(t){n(t)}}))}catch(t){if(null==t)return;throw t}this.cancelPendingSourceChange=null,this.reset(),this.url=t,this._currentGLTF=i,null!=i&&(this._model=i.scene,this.target.add(i.scene));const{animations:n}=i,s=new Map,r=[];for(const t of n)s.set(t.name,t),r.push(t.name);this.animations=n,this.animationsByName=s,this.animationNames=r,await this.setupScene()}async setupScene(){this.applyTransform(),this.updateBoundingBox(),await this.updateFraming(),this.updateShadow(),this.setShadowIntensity(this.shadowIntensity),this.setGroundedSkybox()}reset(){this.url=null,this.renderCount=0,this.queueRender(),null!=this.shadow&&this.shadow.setIntensity(0),this.bakedShadows.clear();const{_model:t}=this;null!=t&&(t.removeFromParent(),this._model=null);const e=this._currentGLTF;null!=e&&(e.dispose(),this._currentGLTF=null),null!=this.currentAnimationAction&&(this.currentAnimationAction.stop(),this.currentAnimationAction=null),this.mixer.stopAllAction(),this.mixer.uncacheRoot(this)}dispose(){this.reset(),null!=this.shadow&&(this.shadow.dispose(),this.shadow=null),this.element[Sy]=null,this.element[Cy]=null,this.element[wy]=null}get currentGLTF(){return this._currentGLTF}setSize(t,e){if(this.width!==t||this.height!==e){if(this.width=Math.max(t,1),this.height=Math.max(e,1),this.annotationRenderer.setSize(t,e),this.aspect=this.width/this.height,null!=this.externalRenderer){const i=window.devicePixelRatio;this.externalRenderer.resize(t*i,e*i)}this.queueRender()}}markBakedShadow(t){t.userData.noHit=!0,this.bakedShadows.add(t)}unmarkBakedShadow(t){t.userLine truncated
*/const ky=new Ci,Gy=new Ci,Hy=new Ci,zy=new class{constructor(t,e,i=0,n=1/0){this.ray=new tn(t,e),this.near=i,this.far=n,this.camera=null,this.layers=new pn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return ol.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(ol),this}intersectObject(t,e=!0,i=[]){return cl(t,this,i,e),i.sort(ll),i}intersectObjects(t,e=!0,i=[]){for(let n=0,s=t.length;n<s;n++)cl(t[n],this,i,e);return i.sort(ll),i}},Vy=new Ci,Wy=new $e;class qy extends Xs{constructor({canvas:t,element:e,width:i,height:n}){super(),this.annotationRenderer=new gA,this.effectRenderer=null,this.schemaElement=document.createElement("script"),this.width=1,this.height=1,this.aspect=1,this.scaleStep=0,this.renderCount=0,this.externalRenderer=null,this.appendedAnimations=[],this.markedAnimations=[],this.camera=new ks(45,1,.1,100),this.xrCamera=null,this.url=null,this.pivot=new Tn,this.target=new Tn,this.animationNames=[],this.boundingBox=new Mi,this.boundingSphere=new qi,this.size=new Ci,this.idealAspect=0,this.framedFoVDeg=0,this.shadow=null,this.shadowIntensity=0,this.shadowSoftness=1,this.bakedShadows=new Set,this.exposure=1,this.toneMapping=7,this.canScale=!0,this.isDirty=!1,this.goalTarget=new Ci,this.targetDamperX=new vm,this.targetDamperY=new vm,this.targetDamperZ=new vm,this._currentGLTF=null,this._model=null,this.cancelPendingSourceChange=null,this.animationsByName=new Map,this.currentAnimationAction=null,this.groundedSkybox=new My,this.name="ModelScene",this.element=e,this.canvas=t,this.camera=new ks(45,1,.1,100),this.camera.name="MainCamera",this.add(this.pivot),this.pivot.name="Pivot",this.pivot.add(this.target),this.setSize(i,n),this.target.name="Target",this.mixer=new al(this.target);const{domElement:s}=this.annotationRenderer,{style:r}=s;r.display="none",r.pointerEvents="none",r.position="absolute",r.top="0",this.element.shadowRoot.querySelector(".default").appendChild(s),this.schemaElement.setAttribute("type","application/ld+json")}get context(){return this.canvas.getContext("2d")}getCamera(){return null!=this.xrCamera?this.xrCamera:this.camera}queueRender(){this.isDirty=!0}shouldRender(){return this.isDirty}hasRendered(){this.isDirty=!1}forceRescale(){this.scaleStep=-1,this.queueRender()}async setObject(t){this.reset(),this._model=t,this.target.add(t),await this.setupScene()}async setSource(t,e=()=>{}){if(!t||t===this.url)return void e(1);if(this.reset(),this.url=t,null!=this.externalRenderer){const t=await this.externalRenderer.load(e);return this.boundingSphere.radius=t.framedRadius,void(this.idealAspect=t.fieldOfViewAspect)}let i;null!=this.cancelPendingSourceChange&&(this.cancelPendingSourceChange(),this.cancelPendingSourceChange=null);try{i=await new Promise((async(i,n)=>{this.cancelPendingSourceChange=()=>n();try{i(await this.element[Nx].loader.load(t,this.element,e))}catch(t){n(t)}}))}catch(t){if(null==t)return;throw t}this.cancelPendingSourceChange=null,this.reset(),this.url=t,this._currentGLTF=i,null!=i&&(this._model=i.scene,this.target.add(i.scene));const{animations:n}=i,s=new Map,r=[];for(const t of n)s.set(t.name,t),r.push(t.name);this.animations=n,this.animationsByName=s,this.animationNames=r,await this.setupScene()}async setupScene(){this.applyTransform(),this.updateBoundingBox(),await this.updateFraming(),this.updateShadow(),this.setShadowIntensity(this.shadowIntensity),this.setGroundedSkybox()}reset(){this.url=null,this.renderCount=0,this.queueRender(),null!=this.shadow&&this.shadow.setIntensity(0),this.bakedShadows.clear();const{_model:t}=this;null!=t&&(t.removeFromParent(),this._model=null);const e=this._currentGLTF;null!=e&&(e.dispose(),this._currentGLTF=null),null!=this.currentAnimationAction&&(this.currentAnimationAction.stop(),this.currentAnimationAction=null),this.mixer.stopAllAction(),this.mixer.uncacheRoot(this)}dispose(){this.reset(),null!=this.shadow&&(this.shadow.dispose(),this.shadow=null),this.element[Ey]=null,this.element[Sy]=null,this.element[Cy]=null}get currentGLTF(){return this._currentGLTF}setSize(t,e){if(this.width!==t||this.height!==e){if(this.width=Math.max(t,1),this.height=Math.max(e,1),this.annotationRenderer.setSize(t,e),this.aspect=this.width/this.height,null!=this.externalRenderer){const i=window.devicePixelRatio;this.externalRenderer.resize(t*i,e*i)}this.queueRender()}}markBakedShadow(t){t.userData.noHit=!0,this.bakedShadows.add(t)}unmarkBakedShadow(t){t.userLine truncated
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -984,7 +984,7 @@ class Ty extends Ms{constructor(){super(void 0,new $n({depthWrite:!1})),this.hei
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class Xy extends EventTarget{constructor(){super(...arguments),this.ongoingActivities=new Set,this.totalProgress=0}get ongoingActivityCount(){return this.ongoingActivities.size}beginActivity(t){const e={progress:0,completed:!1};return this.ongoingActivities.add(e),1===this.ongoingActivityCount&&this.announceTotalProgress(e,0,t),i=>{let n;return n=Math.max(Ku(i,0,1),e.progress),n!==e.progress&&this.announceTotalProgress(e,n,t),e.progress}}announceTotalProgress(t,e,i){let n=0,s=0;1==e&&(t.completed=!0);for(const t of this.ongoingActivities){const{progress:e}=t;n+=1-e,t.completed&&s++}const r=t.progress;t.progress=e,this.totalProgress+=(e-r)*(1-this.totalProgress)/n;const a=s===this.ongoingActivityCount?1:this.totalProgress;this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:a,reason:i}})),s===this.ongoingActivityCount&&(this.totalProgress=0,this.ongoingActivities.clear())}}
*/class jy extends EventTarget{constructor(){super(...arguments),this.ongoingActivities=new Set,this.totalProgress=0}get ongoingActivityCount(){return this.ongoingActivities.size}beginActivity(t){const e={progress:0,completed:!1};return this.ongoingActivities.add(e),1===this.ongoingActivityCount&&this.announceTotalProgress(e,0,t),i=>{let n;return n=Math.max(Ku(i,0,1),e.progress),n!==e.progress&&this.announceTotalProgress(e,n,t),e.progress}}announceTotalProgress(t,e,i){let n=0,s=0;1==e&&(t.completed=!0);for(const t of this.ongoingActivities){const{progress:e}=t;n+=1-e,t.completed&&s++}const r=t.progress;t.progress=e,this.totalProgress+=(e-r)*(1-this.totalProgress)/n;const a=s===this.ongoingActivityCount?1:this.totalProgress;this.dispatchEvent(new CustomEvent("progress",{detail:{totalProgress:a,reason:i}})),s===this.ongoingActivityCount&&(this.totalProgress=0,this.ongoingActivities.clear())}}
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -998,7 +998,7 @@ class Ty extends Ms{constructor(){super(void 0,new $n({depthWrite:!1})),this.hei
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var Yy,Ky,Jy,$y,Zy,tx,ex,ix,nx,sx,rx,ax,ox,lx=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const cx=document.createElement("canvas"),hx=Symbol("fallbackResizeHandler"),ux=Symbol("defaultAriaLabel"),dx=Symbol("resizeObserver"),px=Symbol("clearModelTimeout"),Ax=Symbol("onContextLost"),mx=Symbol("loaded"),gx=Symbol("status"),fx=Symbol("onFocus"),vx=Symbol("onBlur"),bx=Symbol("updateSize"),yx=Symbol("intersectionObserver"),xx=Symbol("isElementInViewport"),_x=Symbol("announceModelVisibility"),Ex=Symbol("ariaLabel"),Sx=Symbol("altDefaulted"),Cx=Symbol("statusElement"),wx=Symbol("updateStatus"),Ix=Symbol("loadedTime"),Mx=Symbol("updateSource"),Tx=Symbol("markLoaded"),Bx=Symbol("container"),Rx=Symbol("input"),Dx=Symbol("canvas"),Lx=Symbol("scene"),Px=Symbol("needsRender"),Ux=Symbol("tick"),Fx=Symbol("onModelLoad"),Nx=Symbol("onResize"),Ox=Symbol("renderer"),Qx=Symbol("progressTracker"),kx=Symbol("getLoaded"),Gx=Symbol("getModelIsVisible"),Hx=Symbol("shouldAttemptPreload"),zx=t=>({x:t.x,y:t.y,z:t.z,toString(){return`${this.x}m ${this.y}m ${this.z}m`}}),Vx=t=>({u:t.x,v:t.y,toString(){return`${this.u} ${this.v}`}});class Wx extends y{static get is(){return"model-viewer"}static set modelCacheSize(t){cA[oA].evictionThreshold=t}static get modelCacheSize(){return cA[oA].evictionThreshold}static set minimumRenderScale(t){t>1&&console.warn("<model-viewer> minimumRenderScale has been clamped to a maximum value of 1."),t<=0&&console.warn("<model-viewer> minimumRenderScale has been clamped to a minimum value of 0.25."),Hv.singleton.minScale=t}static get minimumRenderScale(){return Hv.singleton.minScale}get loaded(){return this[kx]()}get[(Yy=xx,Ky=mx,Jy=Ix,$y=gx,Zy=px,tx=hx,ex=_x,ix=dx,nx=yx,sx=Qx,Ox)](){return Hv.singleton}get modelIsVisible(){return this[Gx]()}constructor(){super(),this.alt=null,this.src=null,this.withCredentials=!1,this.generateSchema=!1,this[Yy]=!1,this[Ky]=!1,this[Jy]=0,this[$y]="",this[Zy]=null,this[tx]=Yu((()=>{const t=this.getBoundingClientRect();this[bx](t)}),50),this[ex]=Yu((t=>{const e=this.modelIsVisible;e!==t&&this.dispatchEvent(new CustomEvent("model-visibility",{detail:{visible:e}}))}),0),this[ix]=null,this[nx]=null,this[sx]=new Xy,this[rx]=()=>{this[Cx].textContent=this[gx]},this[ax]=()=>{this[Cx].textContent=""},this[ox]=t=>{this.dispatchEvent(new CustomEvent("error",{detail:{type:"webglcontextlost",sourceError:t.sourceEvent}}))},this.attachShadow({mode:"open"});const t=this.shadowRoot;let e,i;if((t=>{Ru(nd,t)})(t),this[Bx]=t.querySelector(".container"),this[Rx]=t.querySelector(".userInput"),this[Dx]=t.querySelector("canvas"),this[Cx]=t.querySelector("#status"),this[ux]=this[Rx].getAttribute("aria-label"),this.isConnected){const t=this.getBoundingClientRect();e=t.width,i=t.height}else e=300,i=150;this[Lx]=new jy({canvas:this[Dx],element:this,width:e,height:i}),Promise.resolve().then((()=>{this[bx](this.getBoundingClientRect())})),Fu&&(this[dx]=new ResizeObserver((t=>{if(!this[Ox].isPresenting)for(let e of t)e.target===this&&this[bx](e.contentRect)}))),Nu?this[yx]=new IntersectionObserver((t=>{for(let e of t)if(e.target===this){const t=this.modelIsVisible;this[xx]=e.isIntersecting,this[_x](t),this[xx]&&!this.loaded&&this[Mx]()}}),{root:null,rootMargin:"0px",threshold:1e-5}):this[xx]=!0}connectedCallback(){super.connectedCallback&&super.connectedCallback(),Fu?this[dx].observe(this):self.addEventListener("resize",this[hx]),Nu&&this[yx].observe(this),this.addEventListener("focus",this[fx]),this.addEventListener("blur",this[vx]);const t=this[Ox];t.addEventListener("contextlost",this[Ax]),t.registerScene(this[Lx]),null!=this[px]&&(self.clearTimeout(this[px]),this[px]=null,this.requestUpdate("src",null))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),Fu?this[dx].unobserve(this):self.removeEventListener("resize",this[hx]),Nu&&this[yx].unobserve(this),this.removeEventListener("focus",this[fx]),this.removeEventListener("blur",this[vx]);const t=this[Ox];t.removeEventListener("contextlost",this[Ax]),t.unregisterScene(this[Lx]),this[px]=self.setTimeout((()=>{this[Lx].dispose(),this[px]=null}),10)}updated(t){super.updated(t),t.has("src")&&(null==this.src?(this[mx]=!1,this[Ix]=0,this[Lx].reset()):this.src!==this[Lx].url&&(this[mx]=!1,this[Ix]=0,this[Mx]())),t.has("alt")&&this[Rx].setAttribute("aria-label",this[Ex]),t.has("generateSchema")&&(this.generateSchema?this[Lx].updateSchema(this.src):this[Lx].updateSchema(null))}toDataURL(t,e){return this[Ox].displayCanvas(this[Lx]).toDataURL(t,e)}async toBlob(t){const e=t?t.mimeType:void 0,i=t?t.qualityArgument:void 0,n=t?t.idealAspect:void 0,{width:s,height:r,idealAspect:a,aspect:o}=this[Lx],{dpr:l,scaleFactor:c}=this[Ox];let h=s*c*l,u=r*c*l,d=0,p=0;if(!0===n)if(a>o){const t=u;u=Math.round(h/a),p=(t-u)/2}else{const t=h;h=Math.round(u*a),d=(t-h)/2}cx.width=Line truncated
*/var Xy,Yy,Ky,Jy,$y,Zy,tx,ex,ix,nx,sx,rx,ax,ox=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const lx=document.createElement("canvas"),cx=Symbol("fallbackResizeHandler"),hx=Symbol("defaultAriaLabel"),ux=Symbol("resizeObserver"),dx=Symbol("clearModelTimeout"),px=Symbol("onContextLost"),Ax=Symbol("loaded"),mx=Symbol("status"),gx=Symbol("onFocus"),fx=Symbol("onBlur"),vx=Symbol("updateSize"),bx=Symbol("intersectionObserver"),yx=Symbol("isElementInViewport"),xx=Symbol("announceModelVisibility"),_x=Symbol("ariaLabel"),Ex=Symbol("altDefaulted"),Sx=Symbol("statusElement"),Cx=Symbol("updateStatus"),wx=Symbol("loadedTime"),Ix=Symbol("updateSource"),Mx=Symbol("markLoaded"),Tx=Symbol("container"),Bx=Symbol("input"),Rx=Symbol("canvas"),Dx=Symbol("scene"),Lx=Symbol("needsRender"),Px=Symbol("tick"),Ux=Symbol("onModelLoad"),Fx=Symbol("onResize"),Nx=Symbol("renderer"),Ox=Symbol("progressTracker"),Qx=Symbol("getLoaded"),kx=Symbol("getModelIsVisible"),Gx=Symbol("shouldAttemptPreload"),Hx=t=>({x:t.x,y:t.y,z:t.z,toString(){return`${this.x}m ${this.y}m ${this.z}m`}}),zx=t=>({u:t.x,v:t.y,toString(){return`${this.u} ${this.v}`}});class Vx extends y{static get is(){return"model-viewer"}static set modelCacheSize(t){cA[oA].evictionThreshold=t}static get modelCacheSize(){return cA[oA].evictionThreshold}static set minimumRenderScale(t){t>1&&console.warn("<model-viewer> minimumRenderScale has been clamped to a maximum value of 1."),t<=0&&console.warn("<model-viewer> minimumRenderScale has been clamped to a minimum value of 0.25."),Gv.singleton.minScale=t}static get minimumRenderScale(){return Gv.singleton.minScale}get loaded(){return this[Qx]()}get[(Xy=yx,Yy=Ax,Ky=wx,Jy=mx,$y=dx,Zy=cx,tx=xx,ex=ux,ix=bx,nx=Ox,Nx)](){return Gv.singleton}get modelIsVisible(){return this[kx]()}constructor(){super(),this.alt=null,this.src=null,this.withCredentials=!1,this.generateSchema=!1,this[Xy]=!1,this[Yy]=!1,this[Ky]=0,this[Jy]="",this[$y]=null,this[Zy]=Yu((()=>{const t=this.getBoundingClientRect();this[vx](t)}),50),this[tx]=Yu((t=>{const e=this.modelIsVisible;e!==t&&this.dispatchEvent(new CustomEvent("model-visibility",{detail:{visible:e}}))}),0),this[ex]=null,this[ix]=null,this[nx]=new jy,this[sx]=()=>{this[Sx].textContent=this[mx]},this[rx]=()=>{this[Sx].textContent=""},this[ax]=t=>{this.dispatchEvent(new CustomEvent("error",{detail:{type:"webglcontextlost",sourceError:t.sourceEvent}}))},this.attachShadow({mode:"open"});const t=this.shadowRoot;let e,i;if((t=>{Ru(nd,t)})(t),this[Tx]=t.querySelector(".container"),this[Bx]=t.querySelector(".userInput"),this[Rx]=t.querySelector("canvas"),this[Sx]=t.querySelector("#status"),this[hx]=this[Bx].getAttribute("aria-label"),this.isConnected){const t=this.getBoundingClientRect();e=t.width,i=t.height}else e=300,i=150;this[Dx]=new qy({canvas:this[Rx],element:this,width:e,height:i}),Promise.resolve().then((()=>{this[vx](this.getBoundingClientRect())})),Fu&&(this[ux]=new ResizeObserver((t=>{if(!this[Nx].isPresenting)for(let e of t)e.target===this&&this[vx](e.contentRect)}))),Nu?this[bx]=new IntersectionObserver((t=>{for(let e of t)if(e.target===this){const t=this.modelIsVisible;this[yx]=e.isIntersecting,this[xx](t),this[yx]&&!this.loaded&&this[Ix]()}}),{root:null,rootMargin:"0px",threshold:1e-5}):this[yx]=!0}connectedCallback(){super.connectedCallback&&super.connectedCallback(),Fu?this[ux].observe(this):self.addEventListener("resize",this[cx]),Nu&&this[bx].observe(this),this.addEventListener("focus",this[gx]),this.addEventListener("blur",this[fx]);const t=this[Nx];t.addEventListener("contextlost",this[px]),t.registerScene(this[Dx]),null!=this[dx]&&(self.clearTimeout(this[dx]),this[dx]=null,this.requestUpdate("src",null))}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),Fu?this[ux].unobserve(this):self.removeEventListener("resize",this[cx]),Nu&&this[bx].unobserve(this),this.removeEventListener("focus",this[gx]),this.removeEventListener("blur",this[fx]);const t=this[Nx];t.removeEventListener("contextlost",this[px]),t.unregisterScene(this[Dx]),this[dx]=self.setTimeout((()=>{this[Dx].dispose(),this[dx]=null}),10)}updated(t){super.updated(t),t.has("src")&&(null==this.src?(this[Ax]=!1,this[wx]=0,this[Dx].reset()):this.src!==this[Dx].url&&(this[Ax]=!1,this[wx]=0,this[Ix]())),t.has("alt")&&this[Bx].setAttribute("aria-label",this[_x]),t.has("generateSchema")&&(this.generateSchema?this[Dx].updateSchema(this.src):this[Dx].updateSchema(null))}toDataURL(t,e){return this[Nx].displayCanvas(this[Dx]).toDataURL(t,e)}async toBlob(t){const e=t?t.mimeType:void 0,i=t?t.qualityArgument:void 0,n=t?t.idealAspect:void 0,{width:s,height:r,idealAspect:a,aspect:o}=this[Dx],{dpr:l,scaleFactor:c}=this[Nx];let h=s*c*l,u=r*c*l,d=0,p=0;if(!0===n)if(a>o){const t=u;u=Math.round(h/a),p=(t-u)/2}else{const t=h;h=Math.round(u*a),d=(t-h)/2}lx.width=Line truncated
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -1013,14 +1013,14 @@ class Ty extends Ms{constructor(){super(void 0,new $n({depthWrite:!1})),this.hei
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var qx=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const jx=Symbol("changeAnimation"),Xx=Symbol("appendAnimation"),Yx=Symbol("detachAnimation"),Kx=Symbol("paused"),Jx={repetitions:1/0,pingpong:!1},$x={pingpong:!1,repetitions:null,weight:1,timeScale:1,fade:!1,warp:!1,relativeWarp:!0,time:null},Zx={fade:!0},t_=Symbol("hotspotMap"),e_=Symbol("mutationCallback"),i_=Symbol("observer"),n_=Symbol("addHotspot"),s_=Symbol("removeHotspot"),r_=new en;
var Wx=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const qx=Symbol("changeAnimation"),jx=Symbol("appendAnimation"),Xx=Symbol("detachAnimation"),Yx=Symbol("paused"),Kx={repetitions:1/0,pingpong:!1},Jx={pingpong:!1,repetitions:null,weight:1,timeScale:1,fade:!1,warp:!1,relativeWarp:!0,time:null},$x={fade:!0},Zx=Symbol("hotspotMap"),t_=Symbol("mutationCallback"),e_=Symbol("observer"),i_=Symbol("addHotspot"),n_=Symbol("removeHotspot"),s_=new en;
/*!
fflate - fast JavaScript compression/decompression
<https://101arrowz.github.io/fflate>
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
version 0.8.2
*/
var a_=Uint8Array,o_=Uint16Array,l_=Int32Array,c_=new a_([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h_=new a_([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u_=new a_([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d_=function(t,e){for(var i=new o_(31),n=0;n<31;++n)i[n]=e+=1<<t[n-1];var s=new l_(i[30]);for(n=1;n<30;++n)for(var r=i[n];r<i[n+1];++r)s[r]=r-i[n]<<5|n;return{b:i,r:s}},p_=d_(c_,2),A_=p_.b,m_=p_.r;A_[28]=258,m_[258]=28;for(var g_=d_(h_,0).r,f_=new o_(32768),v_=0;v_<32768;++v_){var b_=(43690&v_)>>1|(21845&v_)<<1;b_=(61680&(b_=(52428&b_)>>2|(13107&b_)<<2))>>4|(3855&b_)<<4,f_[v_]=((65280&b_)>>8|(255&b_)<<8)>>1}var y_=function(t,e,i){for(var n=t.length,s=0,r=new o_(e);s<n;++s)t[s]&&++r[t[s]-1];var a,o=new o_(e);for(s=1;s<e;++s)o[s]=o[s-1]+r[s-1]<<1;if(i){a=new o_(1<<e);var l=15-e;for(s=0;s<n;++s)if(t[s])for(var c=s<<4|t[s],h=e-t[s],u=o[t[s]-1]++<<h,d=u|(1<<h)-1;u<=d;++u)a[f_[u]>>l]=c}else for(a=new o_(n),s=0;s<n;++s)t[s]&&(a[s]=f_[o[t[s]-1]++]>>15-t[s]);return a},x_=new a_(288);for(v_=0;v_<144;++v_)x_[v_]=8;for(v_=144;v_<256;++v_)x_[v_]=9;for(v_=256;v_<280;++v_)x_[v_]=7;for(v_=280;v_<288;++v_)x_[v_]=8;var __=new a_(32);for(v_=0;v_<32;++v_)__[v_]=5;var E_=y_(x_,9,0),S_=y_(__,5,0),C_=function(t){return(t+7)/8|0},w_=function(t,e,i){return(null==i||i>t.length)&&(i=t.length),new a_(t.subarray(e,i))},I_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],M_=function(t,e,i){var n=new Error(e||I_[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,M_),!i)throw n;return n},T_=function(t,e,i){i<<=7&e;var n=e/8|0;t[n]|=i,t[n+1]|=i>>8},B_=function(t,e,i){i<<=7&e;var n=e/8|0;t[n]|=i,t[n+1]|=i>>8,t[n+2]|=i>>16},R_=function(t,e){for(var i=[],n=0;n<t.length;++n)t[n]&&i.push({s:n,f:t[n]});var s=i.length,r=i.slice();if(!s)return{t:O_,l:0};if(1==s){var a=new a_(i[0].s+1);return a[i[0].s]=1,{t:a,l:1}}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],c=0,h=1,u=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=s-1;)o=i[i[c].f<i[u].f?c++:u++],l=i[c!=h&&i[c].f<i[u].f?c++:u++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var d=r[0].s;for(n=1;n<s;++n)r[n].s>d&&(d=r[n].s);var p=new o_(d+1),A=D_(i[h-1],p,0);if(A>e){n=0;var m=0,g=A-e,f=1<<g;for(r.sort((function(t,e){return p[e.s]-p[t.s]||t.f-e.f}));n<s;++n){var v=r[n].s;if(!(p[v]>e))break;m+=f-(1<<A-p[v]),p[v]=e}for(m>>=g;m>0;){var b=r[n].s;p[b]<e?m-=1<<e-p[b]++-1:++n}for(;n>=0&&m;--n){var y=r[n].s;p[y]==e&&(--p[y],++m)}A=e}return{t:new a_(p),l:A}},D_=function(t,e,i){return-1==t.s?Math.max(D_(t.l,e,i+1),D_(t.r,e,i+1)):e[t.s]=i},L_=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new o_(++e),n=0,s=t[0],r=1,a=function(t){i[n++]=t},o=1;o<=e;++o)if(t[o]==s&&o!=e)++r;else{if(!s&&r>2){for(;r>138;r-=138)a(32754);r>2&&(a(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(a(s),--r;r>6;r-=6)a(8304);r>2&&(a(r-3<<5|8208),r=0)}for(;r--;)a(s);r=1,s=t[o]}return{c:i.subarray(0,n),n:e}},P_=function(t,e){for(var i=0,n=0;n<e.length;++n)i+=t[n]*e[n];return i},U_=function(t,e,i){var n=i.length,s=C_(e+2);t[s]=255&n,t[s+1]=n>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var r=0;r<n;++r)t[s+r+4]=i[r];return 8*(s+4+n)},F_=function(t,e,i,n,s,r,a,o,l,c,h){T_(e,h++,i),++s[256];for(var u=R_(s,15),d=u.t,p=u.l,A=R_(r,15),m=A.t,g=A.l,f=L_(d),v=f.c,b=f.n,y=L_(m),x=y.c,_=y.n,E=new o_(19),S=0;S<v.length;++S)++E[31&v[S]];for(S=0;S<x.length;++S)++E[31&x[S]];for(var C=R_(E,7),w=C.t,I=C.l,M=19;M>4&&!w[u_[M-1]];--M);var T,B,R,D,L=c+5<<3,P=P_(s,x_)+P_(r,__)+a,U=P_(s,d)+P_(r,m)+a+14+3*M+P_(E,w)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&L<=P&&L<=U)return U_(e,h,t.subarray(l,l+c));if(T_(e,h,1+(U<P)),h+=2,U<P){T=y_(d,p,0),B=d,R=y_(m,g,0),D=m;var F=y_(w,I,0);T_(e,h,b-257),T_(e,h+5,_-1),T_(e,h+10,M-4),h+=14;for(S=0;S<M;++S)T_(e,h+3*S,w[u_[S]]);h+=3*M;for(var N=[v,x],O=0;O<2;++O){var Q=N[O];for(S=0;S<Q.length;++S){var k=31&Q[S];T_(e,h,F[k]),h+=w[k],k>15&&(T_(e,h,Q[S]>>5&127),h+=Q[S]>>12)}}}else T=E_,B=x_,R=S_,D=__;for(S=0;S<o;++S){var G=n[S];if(G>255){B_(e,h,T[(k=G>>18&31)+257]),h+=B[k+257],k>7&&(T_(e,h,G>>23&31),h+=c_[k]);var H=31&G;B_(e,h,R[H]),h+=D[H],H>3&&(B_(e,h,G>>5&8191),h+=h_[H])}else B_(e,h,T[G]),h+=B[G]}return B_(e,h,T[256]),h+B[256]},N_=new l_([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),O_=new a_(0),Q_=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var i=e,n=9;--n;)i=(1&i&&-306674912)^i>>>1;t[e]=i}return t}(),k_=function(){var t=-1;return{p:function(e){for(var i=t,n=0;n<e.length;++n)i=Q_[255&i^e[n]]^i>>>8;t=i},d:function(){return~t}}},G_=function(t,e,i,n,s){if(!s&&(s={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),a=new a_(r.length+t.length);a.set(r),a.set(t,r.length),t=a,s.w=r.length}return function(t,e,i,n,s,r){var a=r.z||t.length,o=new a_(n+a+5*(1+Math.ceil(a/7e3))+s),l=o.subarray(n,Line truncated
var r_=Uint8Array,a_=Uint16Array,o_=Int32Array,l_=new r_([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),c_=new r_([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),h_=new r_([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),u_=function(t,e){for(var i=new a_(31),n=0;n<31;++n)i[n]=e+=1<<t[n-1];var s=new o_(i[30]);for(n=1;n<30;++n)for(var r=i[n];r<i[n+1];++r)s[r]=r-i[n]<<5|n;return{b:i,r:s}},d_=u_(l_,2),p_=d_.b,A_=d_.r;p_[28]=258,A_[258]=28;for(var m_=u_(c_,0).r,g_=new a_(32768),f_=0;f_<32768;++f_){var v_=(43690&f_)>>1|(21845&f_)<<1;v_=(61680&(v_=(52428&v_)>>2|(13107&v_)<<2))>>4|(3855&v_)<<4,g_[f_]=((65280&v_)>>8|(255&v_)<<8)>>1}var b_=function(t,e,i){for(var n=t.length,s=0,r=new a_(e);s<n;++s)t[s]&&++r[t[s]-1];var a,o=new a_(e);for(s=1;s<e;++s)o[s]=o[s-1]+r[s-1]<<1;if(i){a=new a_(1<<e);var l=15-e;for(s=0;s<n;++s)if(t[s])for(var c=s<<4|t[s],h=e-t[s],u=o[t[s]-1]++<<h,d=u|(1<<h)-1;u<=d;++u)a[g_[u]>>l]=c}else for(a=new a_(n),s=0;s<n;++s)t[s]&&(a[s]=g_[o[t[s]-1]++]>>15-t[s]);return a},y_=new r_(288);for(f_=0;f_<144;++f_)y_[f_]=8;for(f_=144;f_<256;++f_)y_[f_]=9;for(f_=256;f_<280;++f_)y_[f_]=7;for(f_=280;f_<288;++f_)y_[f_]=8;var x_=new r_(32);for(f_=0;f_<32;++f_)x_[f_]=5;var __=b_(y_,9,0),E_=b_(x_,5,0),S_=function(t){return(t+7)/8|0},C_=function(t,e,i){return(null==i||i>t.length)&&(i=t.length),new r_(t.subarray(e,i))},w_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],I_=function(t,e,i){var n=new Error(e||w_[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,I_),!i)throw n;return n},M_=function(t,e,i){i<<=7&e;var n=e/8|0;t[n]|=i,t[n+1]|=i>>8},T_=function(t,e,i){i<<=7&e;var n=e/8|0;t[n]|=i,t[n+1]|=i>>8,t[n+2]|=i>>16},B_=function(t,e){for(var i=[],n=0;n<t.length;++n)t[n]&&i.push({s:n,f:t[n]});var s=i.length,r=i.slice();if(!s)return{t:N_,l:0};if(1==s){var a=new r_(i[0].s+1);return a[i[0].s]=1,{t:a,l:1}}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],c=0,h=1,u=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=s-1;)o=i[i[c].f<i[u].f?c++:u++],l=i[c!=h&&i[c].f<i[u].f?c++:u++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var d=r[0].s;for(n=1;n<s;++n)r[n].s>d&&(d=r[n].s);var p=new a_(d+1),A=R_(i[h-1],p,0);if(A>e){n=0;var m=0,g=A-e,f=1<<g;for(r.sort((function(t,e){return p[e.s]-p[t.s]||t.f-e.f}));n<s;++n){var v=r[n].s;if(!(p[v]>e))break;m+=f-(1<<A-p[v]),p[v]=e}for(m>>=g;m>0;){var b=r[n].s;p[b]<e?m-=1<<e-p[b]++-1:++n}for(;n>=0&&m;--n){var y=r[n].s;p[y]==e&&(--p[y],++m)}A=e}return{t:new r_(p),l:A}},R_=function(t,e,i){return-1==t.s?Math.max(R_(t.l,e,i+1),R_(t.r,e,i+1)):e[t.s]=i},D_=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new a_(++e),n=0,s=t[0],r=1,a=function(t){i[n++]=t},o=1;o<=e;++o)if(t[o]==s&&o!=e)++r;else{if(!s&&r>2){for(;r>138;r-=138)a(32754);r>2&&(a(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(a(s),--r;r>6;r-=6)a(8304);r>2&&(a(r-3<<5|8208),r=0)}for(;r--;)a(s);r=1,s=t[o]}return{c:i.subarray(0,n),n:e}},L_=function(t,e){for(var i=0,n=0;n<e.length;++n)i+=t[n]*e[n];return i},P_=function(t,e,i){var n=i.length,s=S_(e+2);t[s]=255&n,t[s+1]=n>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var r=0;r<n;++r)t[s+r+4]=i[r];return 8*(s+4+n)},U_=function(t,e,i,n,s,r,a,o,l,c,h){M_(e,h++,i),++s[256];for(var u=B_(s,15),d=u.t,p=u.l,A=B_(r,15),m=A.t,g=A.l,f=D_(d),v=f.c,b=f.n,y=D_(m),x=y.c,_=y.n,E=new a_(19),S=0;S<v.length;++S)++E[31&v[S]];for(S=0;S<x.length;++S)++E[31&x[S]];for(var C=B_(E,7),w=C.t,I=C.l,M=19;M>4&&!w[h_[M-1]];--M);var T,B,R,D,L=c+5<<3,P=L_(s,y_)+L_(r,x_)+a,U=L_(s,d)+L_(r,m)+a+14+3*M+L_(E,w)+2*E[16]+3*E[17]+7*E[18];if(l>=0&&L<=P&&L<=U)return P_(e,h,t.subarray(l,l+c));if(M_(e,h,1+(U<P)),h+=2,U<P){T=b_(d,p,0),B=d,R=b_(m,g,0),D=m;var F=b_(w,I,0);M_(e,h,b-257),M_(e,h+5,_-1),M_(e,h+10,M-4),h+=14;for(S=0;S<M;++S)M_(e,h+3*S,w[h_[S]]);h+=3*M;for(var N=[v,x],O=0;O<2;++O){var Q=N[O];for(S=0;S<Q.length;++S){var k=31&Q[S];M_(e,h,F[k]),h+=w[k],k>15&&(M_(e,h,Q[S]>>5&127),h+=Q[S]>>12)}}}else T=__,B=y_,R=E_,D=x_;for(S=0;S<o;++S){var G=n[S];if(G>255){T_(e,h,T[(k=G>>18&31)+257]),h+=B[k+257],k>7&&(M_(e,h,G>>23&31),h+=l_[k]);var H=31&G;T_(e,h,R[H]),h+=D[H],H>3&&(T_(e,h,G>>5&8191),h+=c_[H])}else T_(e,h,T[G]),h+=B[G]}return T_(e,h,T[256]),h+B[256]},F_=new o_([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),N_=new r_(0),O_=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var i=e,n=9;--n;)i=(1&i&&-306674912)^i>>>1;t[e]=i}return t}(),Q_=function(){var t=-1;return{p:function(e){for(var i=t,n=0;n<e.length;++n)i=O_[255&i^e[n]]^i>>>8;t=i},d:function(){return~t}}},k_=function(t,e,i,n,s){if(!s&&(s={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),a=new r_(r.length+t.length);a.set(r),a.set(t,r.length),t=a,s.w=r.length}return function(t,e,i,n,s,r){var a=r.z||t.length,o=new r_(n+a+5*(1+Math.ceil(a/7e3))+s),l=o.subarray(n,Line truncated
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -1034,7 +1034,7 @@ var a_=Uint8Array,o_=Uint16Array,l_=Int32Array,c_=new a_([0,0,0,0,0,0,0,0,1,1,1,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/(t))})),s+="\n\t\t}\n\t}\n}\n\n",s+=function(t,e,i=!1){const n=[];for(const s in t){const r=t[s];n.push(aE(r,e,i))}return`def "Materials"\n{\n${n.join("")}\n}\n\n`}(r,a,e.quickLookCompatible),i[n]=X_(s),s=null;for(const t in a){let n=a[t];if(!0===n.isCompressedTexture){if(null===this.textureUtils)throw new Error("THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.");n=await this.textureUtils.decompress(n)}const s=Z_(n.image,n.flipY,e.maxTextureSize),r=await new Promise((t=>s.toBlob(t,"image/png",1)));i[`textures/Texture_${t}.png`]=new Uint8Array(await r.arrayBuffer())}let o=0;for(const t in i){const e=i[t];o+=34+t.length;const n=63&o;if(4!==n){const s=new Uint8Array(64-n);i[t]=[e,{extra:{12345:s}}]}o=e.length}return J_(i,{level:0})}}function Z_(t,e,i){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=i/Math.max(t.width,t.height),s=document.createElement("canvas");s.width=t.width*Math.min(1,n),s.height=t.height*Math.min(1,n);const r=s.getContext("2d");return!0===e&&(r.translate(0,s.height),r.scale(1,-1)),r.drawImage(t,0,0,s.width,s.height),s}throw new Error("THREE.USDZExporter: No valid image data found. Unable to process texture.")}const tE=7;function eE(){return'#usda 1.0\n(\n\tcustomLayerData = {\n\t\tstring creator = "Three.js USDZExporter"\n\t}\n\tdefaultPrim = "Root"\n\tmetersPerUnit = 1\n\tupAxis = "Y"\n)\n\n'}function iE(t){const e=t.elements;return`( ${nE(e,0)}, ${nE(e,4)}, ${nE(e,8)}, ${nE(e,12)} )`}function nE(t,e){return`(${t[e+0]}, ${t[e+1]}, ${t[e+2]}, ${t[e+3]})`}function sE(t,e){if(void 0===t)return console.warn("USDZExporter: Normals missing."),Array(e).fill("(0, 0, 0)").join(", ");const i=[];for(let e=0;e<t.count;e++){const n=t.getX(e),s=t.getY(e),r=t.getZ(e);i.push(`(${n.toPrecision(tE)}, ${s.toPrecision(tE)}, ${r.toPrecision(tE)})`)}return i.join(", ")}function rE(t){const e=[];for(let i=0;i<t.count;i++){const n=t.getX(i),s=t.getY(i);e.push(`(${n.toPrecision(tE)}, ${1-s.toPrecision(tE)})`)}return e.join(", ")}function aE(t,e,i=!1){const n="\t\t\t",s=[],r=[];function a(n,s,r){const a=n.source.id+"_"+n.flipY;e[a]=n;const o=n.channel>0?"st"+n.channel:"st",l={1e3:"repeat",1001:"clamp",1002:"mirror"},c=n.repeat.clone(),h=n.offset.clone(),u=n.rotation,d=Math.sin(u),p=Math.cos(u);return h.y=1-h.y-c.y,i?(h.x=h.x/c.x,h.y=h.y/c.y,h.x+=d/c.x,h.y+=p-1):(h.x+=d*c.x,h.y+=(1-p)*c.y),`\n\t\tdef Shader "PrimvarReader_${s}"\n\t\t{\n\t\t\tuniform token info:id = "UsdPrimvarReader_float2"\n\t\t\tfloat2 inputs:fallback = (0.0, 0.0)\n\t\t\ttoken inputs:varname = "${o}"\n\t\t\tfloat2 outputs:result\n\t\t}\n\n\t\tdef Shader "Transform2d_${s}"\n\t\t{\n\t\t\tuniform token info:id = "UsdTransform2d"\n\t\t\ttoken inputs:in.connect = </Materials/Material_${t.id}/PrimvarReader_${s}.outputs:result>\n\t\t\tfloat inputs:rotation = ${(u*(180/Math.PI)).toFixed(tE)}\n\t\t\tfloat2 inputs:scale = ${lE(c)}\n\t\t\tfloat2 inputs:translation = ${lE(h)}\n\t\t\tfloat2 outputs:result\n\t\t}\n\n\t\tdef Shader "Texture_${n.id}_${s}"\n\t\t{\n\t\t\tuniform token info:id = "UsdUVTexture"\n\t\t\tasset inputs:file = @textures/Texture_${a}.png@\n\t\t\tfloat2 inputs:st.connect = </Materials/Material_${t.id}/Transform2d_${s}.outputs:result>\n\t\t\t${void 0!==r?"float4 inputs:scale = "+function(t){return`(${t.r}, ${t.g}, ${t.b}, 1.0)`}(r):""}\n\t\t\ttoken inputs:sourceColorSpace = "${n.colorSpace===_e?"raw":"sRGB"}"\n\t\t\ttoken inputs:wrapS = "${l[n.wrapS]}"\n\t\t\ttoken inputs:wrapT = "${l[n.wrapT]}"\n\t\t\tfloat outputs:r\n\t\t\tfloat outputs:g\n\t\t\tfloat outputs:b\n\t\t\tfloat3 outputs:rgb\n\t\t\t${t.transparent||t.alphaTest>0?"float outputs:a":""}\n\t\t}`}return 2===t.side&&console.warn("THREE.USDZExporter: USDZ does not support double sided materials",t),null!==t.map?(s.push(`${n}color3f inputs:diffuseColor.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:rgb>`),t.transparent?s.push(`${n}float inputs:opacity.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:a>`):t.alphaTest>0&&(s.push(`${n}float inputs:opacity.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:a>`),s.push(`${n}float inputs:opacityThreshold = ${t.alphaTest}`)),r.push(a(t.map,"diffuse",t.color))):s.push(`${n}color3f inputs:diffuseColor = ${oE(t.color)}`),null!==t.emissiveMap?(s.push(`${n}color3f inputs:emissiveColor.connect = </Materials/Material_${t.id}/Texture_${t.emissiveMap.id}_emissive.outputs:rgb>`),r.push(a(t.emissiveMap,"emissive",new Xn(t.emissive.r*t.emissiveIntensity,t.emissive.g*t.emissiveIntensity,t.emissive.b*t.emissiveIntensity)))):t.emissive.getHex()>0&&s.push(`${n}color3f inputs:emissiveColor = ${oE(t.emissive)}`),null!==t.normalMap&&(s.push(`${n}normal3f inputs:normal.connect = </Materials/Material_${t.id}/Texture_${t.noLine truncated
*/(t))})),s+="\n\t\t}\n\t}\n}\n\n",s+=function(t,e,i=!1){const n=[];for(const s in t){const r=t[s];n.push(rE(r,e,i))}return`def "Materials"\n{\n${n.join("")}\n}\n\n`}(r,a,e.quickLookCompatible),i[n]=j_(s),s=null;for(const t in a){let n=a[t];if(!0===n.isCompressedTexture){if(null===this.textureUtils)throw new Error("THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.");n=await this.textureUtils.decompress(n)}const s=$_(n.image,n.flipY,e.maxTextureSize),r=await new Promise((t=>s.toBlob(t,"image/png",1)));i[`textures/Texture_${t}.png`]=new Uint8Array(await r.arrayBuffer())}let o=0;for(const t in i){const e=i[t];o+=34+t.length;const n=63&o;if(4!==n){const s=new Uint8Array(64-n);i[t]=[e,{extra:{12345:s}}]}o=e.length}return K_(i,{level:0})}}function $_(t,e,i){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=i/Math.max(t.width,t.height),s=document.createElement("canvas");s.width=t.width*Math.min(1,n),s.height=t.height*Math.min(1,n);const r=s.getContext("2d");return!0===e&&(r.translate(0,s.height),r.scale(1,-1)),r.drawImage(t,0,0,s.width,s.height),s}throw new Error("THREE.USDZExporter: No valid image data found. Unable to process texture.")}const Z_=7;function tE(){return'#usda 1.0\n(\n\tcustomLayerData = {\n\t\tstring creator = "Three.js USDZExporter"\n\t}\n\tdefaultPrim = "Root"\n\tmetersPerUnit = 1\n\tupAxis = "Y"\n)\n\n'}function eE(t){const e=t.elements;return`( ${iE(e,0)}, ${iE(e,4)}, ${iE(e,8)}, ${iE(e,12)} )`}function iE(t,e){return`(${t[e+0]}, ${t[e+1]}, ${t[e+2]}, ${t[e+3]})`}function nE(t,e){if(void 0===t)return console.warn("USDZExporter: Normals missing."),Array(e).fill("(0, 0, 0)").join(", ");const i=[];for(let e=0;e<t.count;e++){const n=t.getX(e),s=t.getY(e),r=t.getZ(e);i.push(`(${n.toPrecision(Z_)}, ${s.toPrecision(Z_)}, ${r.toPrecision(Z_)})`)}return i.join(", ")}function sE(t){const e=[];for(let i=0;i<t.count;i++){const n=t.getX(i),s=t.getY(i);e.push(`(${n.toPrecision(Z_)}, ${1-s.toPrecision(Z_)})`)}return e.join(", ")}function rE(t,e,i=!1){const n="\t\t\t",s=[],r=[];function a(n,s,r){const a=n.source.id+"_"+n.flipY;e[a]=n;const o=n.channel>0?"st"+n.channel:"st",l={1e3:"repeat",1001:"clamp",1002:"mirror"},c=n.repeat.clone(),h=n.offset.clone(),u=n.rotation,d=Math.sin(u),p=Math.cos(u);return h.y=1-h.y-c.y,i?(h.x=h.x/c.x,h.y=h.y/c.y,h.x+=d/c.x,h.y+=p-1):(h.x+=d*c.x,h.y+=(1-p)*c.y),`\n\t\tdef Shader "PrimvarReader_${s}"\n\t\t{\n\t\t\tuniform token info:id = "UsdPrimvarReader_float2"\n\t\t\tfloat2 inputs:fallback = (0.0, 0.0)\n\t\t\ttoken inputs:varname = "${o}"\n\t\t\tfloat2 outputs:result\n\t\t}\n\n\t\tdef Shader "Transform2d_${s}"\n\t\t{\n\t\t\tuniform token info:id = "UsdTransform2d"\n\t\t\ttoken inputs:in.connect = </Materials/Material_${t.id}/PrimvarReader_${s}.outputs:result>\n\t\t\tfloat inputs:rotation = ${(u*(180/Math.PI)).toFixed(Z_)}\n\t\t\tfloat2 inputs:scale = ${oE(c)}\n\t\t\tfloat2 inputs:translation = ${oE(h)}\n\t\t\tfloat2 outputs:result\n\t\t}\n\n\t\tdef Shader "Texture_${n.id}_${s}"\n\t\t{\n\t\t\tuniform token info:id = "UsdUVTexture"\n\t\t\tasset inputs:file = @textures/Texture_${a}.png@\n\t\t\tfloat2 inputs:st.connect = </Materials/Material_${t.id}/Transform2d_${s}.outputs:result>\n\t\t\t${void 0!==r?"float4 inputs:scale = "+function(t){return`(${t.r}, ${t.g}, ${t.b}, 1.0)`}(r):""}\n\t\t\ttoken inputs:sourceColorSpace = "${n.colorSpace===_e?"raw":"sRGB"}"\n\t\t\ttoken inputs:wrapS = "${l[n.wrapS]}"\n\t\t\ttoken inputs:wrapT = "${l[n.wrapT]}"\n\t\t\tfloat outputs:r\n\t\t\tfloat outputs:g\n\t\t\tfloat outputs:b\n\t\t\tfloat3 outputs:rgb\n\t\t\t${t.transparent||t.alphaTest>0?"float outputs:a":""}\n\t\t}`}return 2===t.side&&console.warn("THREE.USDZExporter: USDZ does not support double sided materials",t),null!==t.map?(s.push(`${n}color3f inputs:diffuseColor.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:rgb>`),t.transparent?s.push(`${n}float inputs:opacity.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:a>`):t.alphaTest>0&&(s.push(`${n}float inputs:opacity.connect = </Materials/Material_${t.id}/Texture_${t.map.id}_diffuse.outputs:a>`),s.push(`${n}float inputs:opacityThreshold = ${t.alphaTest}`)),r.push(a(t.map,"diffuse",t.color))):s.push(`${n}color3f inputs:diffuseColor = ${aE(t.color)}`),null!==t.emissiveMap?(s.push(`${n}color3f inputs:emissiveColor.connect = </Materials/Material_${t.id}/Texture_${t.emissiveMap.id}_emissive.outputs:rgb>`),r.push(a(t.emissiveMap,"emissive",new Xn(t.emissive.r*t.emissiveIntensity,t.emissive.g*t.emissiveIntensity,t.emissive.b*t.emissiveIntensity)))):t.emissive.getHex()>0&&s.push(`${n}color3f inputs:emissiveColor = ${aE(t.emissive)}`),null!==t.normalMap&&(s.push(`${n}normal3f inputs:normal.connect = </Materials/Material_${t.id}/Texture_${t.noLine truncated
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -1049,7 +1049,7 @@ var a_=Uint8Array,o_=Uint16Array,l_=Int32Array,c_=new a_([0,0,0,0,0,0,0,0,1,1,1,
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var cE=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let hE=!1,uE=!1;const dE="#model-viewer-no-ar-fallback",pE=(AE=["quick-look","scene-viewer","webxr","none"],t=>{try{const e=Sm(t),i=(e.length?e[0].terms:[]).filter((t=>t&&"ident"===t.type)).map((t=>t.value)).filter((t=>AE.indexOf(t)>-1));return new Set(i)}catch(t){}return new Set});var AE;const mE="quick-look",gE="scene-viewer",fE="webxr",vE="none",bE=Symbol("arButtonContainer"),yE=Symbol("enterARWithWebXR"),xE=Symbol("openSceneViewer"),_E=Symbol("openIOSARQuickLook"),EE=Symbol("canActivateAR"),SE=Symbol("arMode"),CE=Symbol("arModes"),wE=Symbol("arAnchor"),IE=Symbol("preload"),ME=Symbol("onARButtonContainerClick"),TE=Symbol("onARStatus"),BE=Symbol("onARTracking"),RE=Symbol("onARTap"),DE=Symbol("selectARMode"),LE=Symbol("triggerLoad");
var lE=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let cE=!1,hE=!1;const uE="#model-viewer-no-ar-fallback",dE=(pE=["quick-look","scene-viewer","webxr","none"],t=>{try{const e=Sm(t),i=(e.length?e[0].terms:[]).filter((t=>t&&"ident"===t.type)).map((t=>t.value)).filter((t=>pE.indexOf(t)>-1));return new Set(i)}catch(t){}return new Set});var pE;const AE="quick-look",mE="scene-viewer",gE="webxr",fE="none",vE=Symbol("arButtonContainer"),bE=Symbol("enterARWithWebXR"),yE=Symbol("openSceneViewer"),xE=Symbol("openIOSARQuickLook"),_E=Symbol("canActivateAR"),EE=Symbol("arMode"),SE=Symbol("arModes"),CE=Symbol("arAnchor"),wE=Symbol("preload"),IE=Symbol("onARButtonContainerClick"),ME=Symbol("onARStatus"),TE=Symbol("onARTracking"),BE=Symbol("onARTap"),RE=Symbol("selectARMode"),DE=Symbol("triggerLoad");
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -1064,7 +1064,7 @@ var cE=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var PE=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const UE="auto",FE="auto",NE="eager",OE=Symbol("defaultProgressBarElement"),QE=Symbol("posterContainerElement"),kE=Symbol("defaultPosterElement"),GE=Symbol("shouldDismissPoster"),HE=Symbol("hidePoster"),zE=Symbol("modelIsRevealed"),VE=Symbol("updateProgressBar"),WE=Symbol("ariaLabelCallToAction"),qE=Symbol("onProgress");
var LE=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const PE="auto",UE="auto",FE="eager",NE=Symbol("defaultProgressBarElement"),OE=Symbol("posterContainerElement"),QE=Symbol("defaultPosterElement"),kE=Symbol("shouldDismissPoster"),GE=Symbol("hidePoster"),HE=Symbol("modelIsRevealed"),zE=Symbol("updateProgressBar"),VE=Symbol("ariaLabelCallToAction"),WE=Symbol("onProgress");
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
@@ -1079,5 +1079,5 @@ var PE=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var jE=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const XE=Math.PI/32,YE={basis:[Lm(Em(XE,"rad"))],keywords:{auto:[null]}},KE=Symbol("autoRotateStartTime"),JE=Symbol("radiansPerSecond"),$E=Symbol("syncRotationRate"),ZE=Symbol("onCameraChange"),tS=(t=>{var e,i,n;class s extends t{constructor(){super(...arguments),this[e]=new Map,this[i]=t=>{t.forEach((t=>{t instanceof MutationRecord&&"childList"!==t.type||(t.addedNodes.forEach((t=>{this[n_](t)})),t.removedNodes.forEach((t=>{this[s_](t)})),this[Px]())}))},this[n]=new MutationObserver(this[e_])}connectedCallback(){super.connectedCallback();for(let t=0;t<this.children.length;++t)this[n_](this.children[t]);const{ShadyDOM:t}=self;null==t?this[i_].observe(this,{childList:!0}):this[i_]=t.observeChildren(this,this[e_])}disconnectedCallback(){super.disconnectedCallback();const{ShadyDOM:t}=self;null==t?this[i_].disconnect():t.unobserveChildren(this[i_])}[(e=t_,i=e_,n=i_,Fx)](){super[Fx]();const t=this[Lx];t.forHotspots((e=>{t.updateSurfaceHotspot(e)}))}[Ux](t,e){super[Ux](t,e);const i=this[Lx],{annotationRenderer:n}=i,s=i.getCamera();i.shouldRender()&&(i.animateSurfaceHotspots(),i.updateHotspotsVisibility(s.position),n.domElement.style.display="",n.render(i,s))}updateHotspot(t){const e=this[t_].get(t.name);null!=e&&(e.updatePosition(t.position),e.updateNormal(t.normal),e.surface=t.surface,this[Lx].updateSurfaceHotspot(e),this[Px]())}queryHotspot(t){const e=this[t_].get(t);if(null==e)return null;const i=zx(e.position),n=zx(e.normal),s=e.facingCamera,r=this[Lx],a=r.getCamera(),o=new Ci;o.setFromMatrixPosition(e.matrixWorld),o.project(a);const l=r.width/2,c=r.height/2;o.x=o.x*l+l,o.y=-o.y*c+c;const h=zx(new Ci(o.x,o.y,o.z));return Number.isFinite(h.x)&&Number.isFinite(h.y)?{position:i,normal:n,canvasPosition:h,facingCamera:s}:null}positionAndNormalFromPoint(t,e){const i=this[Lx],n=i.getNDC(t,e),s=i.positionAndNormalFromPoint(n);if(null==s)return null;r_.copy(i.target.matrixWorld).invert();const r=zx(s.position.applyMatrix4(r_)),a=zx(s.normal.transformDirection(r_));let o=null;return null!=s.uv&&(o=Vx(s.uv)),{position:r,normal:a,uv:o}}surfaceFromPoint(t,e){const i=this[Lx],n=i.getNDC(t,e);return i.surfaceFromPoint(n)}[n_](t){if(!(t instanceof HTMLElement&&0===t.slot.indexOf("hotspot")))return;let e=this[t_].get(t.slot);null!=e?e.increment():(e=new Fy({name:t.slot,position:t.dataset.position,normal:t.dataset.normal,surface:t.dataset.surface}),this[t_].set(t.slot,e),this[Lx].addHotspot(e)),this[Lx].queueRender()}[s_](t){if(!(t instanceof HTMLElement))return;const e=this[t_].get(t.slot);e&&(e.decrement()&&(this[Lx].removeHotspot(e),this[t_].delete(t.slot)),this[Lx].queueRender())}}return s})((t=>{var e,i,n;class s extends t{constructor(){super(...arguments),this[e]=void 0,this[i]=null,this[n]=null,this.variantName=null,this.orientation="0 0 0",this.scale="1 1 1"}get model(){return this[wy]}get availableVariants(){return this.model?this.model[vy]():[]}get originalGltfJson(){return this[Cy]}[(e=wy,i=Sy,n=Cy,Iy)](){return()=>{this[Px]()}}[My](t){return t.colorSpace=Ee,t.wrapS=at,t.wrapT=at,new gb(this[Iy](),t)}async createTexture(t,e="image/png"){const{textureUtils:i}=this[Ox],n=await i.loadImage(t,this.withCredentials);return n.userData.mimeType=e,this[My](n)}async createLottieTexture(t,e=1){const{textureUtils:i}=this[Ox],n=await i.loadLottie(t,e,this.withCredentials);return this[My](n)}createVideoTexture(t){const e=document.createElement("video");e.crossOrigin=this.withCredentials?"use-credentials":"anonymous",e.src=t,e.muted=!0,e.playsInline=!0,e.loop=!0,e.play();const i=new Kr(e);return this[My](i)}createCanvasTexture(){const t=document.createElement("canvas"),e=new ta(t);return this[My](e)}async updated(t){if(super.updated(t),t.has("variantName")){const t=this[Qx].beginActivity("variant-update");t(.1);const e=this[wy],{variantName:i}=this;null!=e&&(await e[py](i),this[Px](),this.dispatchEvent(new CustomEvent("variant-applied"))),t(1)}if(t.has("orientation")||t.has("scale")){if(!this.loaded)return;const t=this[Lx];t.applyTransform(),t.updateBoundingBox(),t.updateShadow(),this[Ox].arRenderer.onUpdateScene(),this[Px]()}}[Fx](){super[Fx]();const{currentGLTF:t}=this[Lx];if(null!=t){const{correlatedSceneGraph:e}=t;null!=e&&t!==this[Sy]&&(this[wy]=new _y(e,this[Iy]()),this[Cy]=JSON.parse(JSON.stringify(e.gltf))),"variants"in t.userData&&this.requestUpdate("variantName")}this[Sy]=t}async exportScene(t){const e=this[Lx];return new Promise((async(i,n)=>{const s={binary:!0,onlyVisible:!0,maxTextureSize:1/0,includeCustomExtensions:!1,forceIndices:!1};Object.assign(s,t),s.animations=e.animations,s.truncateDrawRange=!0;const r=e.shadow;let a=!1;null!=r&&(a=r.visible,r.visible=!1),await this[wy][dy]();(new bA).register((t=>new mm(t))).parse(e.model,(t=>i(new Blob([s.binary?t:JSON.stringify(t)],{type:s.binary?"aLine truncated
var qE=function(t,e,i,n){for(var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const jE=Math.PI/32,XE={basis:[Lm(Em(jE,"rad"))],keywords:{auto:[null]}},YE=Symbol("autoRotateStartTime"),KE=Symbol("radiansPerSecond"),JE=Symbol("syncRotationRate"),$E=Symbol("onCameraChange"),ZE=(t=>{var e,i,n;class s extends t{constructor(){super(...arguments),this[e]=new Map,this[i]=t=>{t.forEach((t=>{t instanceof MutationRecord&&"childList"!==t.type||(t.addedNodes.forEach((t=>{this[i_](t)})),t.removedNodes.forEach((t=>{this[n_](t)})),this[Lx]())}))},this[n]=new MutationObserver(this[t_])}connectedCallback(){super.connectedCallback();for(let t=0;t<this.children.length;++t)this[i_](this.children[t]);const{ShadyDOM:t}=self;null==t?this[e_].observe(this,{childList:!0}):this[e_]=t.observeChildren(this,this[t_])}disconnectedCallback(){super.disconnectedCallback();const{ShadyDOM:t}=self;null==t?this[e_].disconnect():t.unobserveChildren(this[e_])}[(e=Zx,i=t_,n=e_,Ux)](){super[Ux]();const t=this[Dx];t.forHotspots((e=>{t.updateSurfaceHotspot(e)}))}[Px](t,e){super[Px](t,e);const i=this[Dx],{annotationRenderer:n}=i,s=i.getCamera();i.shouldRender()&&(i.animateSurfaceHotspots(),i.updateHotspotsVisibility(s.position),n.domElement.style.display="",n.render(i,s))}updateHotspot(t){const e=this[Zx].get(t.name);null!=e&&(e.updatePosition(t.position),e.updateNormal(t.normal),e.surface=t.surface,this[Dx].updateSurfaceHotspot(e),this[Lx]())}queryHotspot(t){const e=this[Zx].get(t);if(null==e)return null;const i=Hx(e.position),n=Hx(e.normal),s=e.facingCamera,r=this[Dx],a=r.getCamera(),o=new Ci;o.setFromMatrixPosition(e.matrixWorld),o.project(a);const l=r.width/2,c=r.height/2;o.x=o.x*l+l,o.y=-o.y*c+c;const h=Hx(new Ci(o.x,o.y,o.z));return Number.isFinite(h.x)&&Number.isFinite(h.y)?{position:i,normal:n,canvasPosition:h,facingCamera:s}:null}positionAndNormalFromPoint(t,e){const i=this[Dx],n=i.getNDC(t,e),s=i.positionAndNormalFromPoint(n);if(null==s)return null;s_.copy(i.target.matrixWorld).invert();const r=Hx(s.position.applyMatrix4(s_)),a=Hx(s.normal.transformDirection(s_));let o=null;return null!=s.uv&&(o=zx(s.uv)),{position:r,normal:a,uv:o}}surfaceFromPoint(t,e){const i=this[Dx],n=i.getNDC(t,e);return i.surfaceFromPoint(n)}[i_](t){if(!(t instanceof HTMLElement&&0===t.slot.indexOf("hotspot")))return;let e=this[Zx].get(t.slot);null!=e?e.increment():(e=new Uy({name:t.slot,position:t.dataset.position,normal:t.dataset.normal,surface:t.dataset.surface}),this[Zx].set(t.slot,e),this[Dx].addHotspot(e)),this[Dx].queueRender()}[n_](t){if(!(t instanceof HTMLElement))return;const e=this[Zx].get(t.slot);e&&(e.decrement()&&(this[Dx].removeHotspot(e),this[Zx].delete(t.slot)),this[Dx].queueRender())}}return s})((t=>{var e,i,n;class s extends t{constructor(){super(...arguments),this[e]=void 0,this[i]=null,this[n]=null,this.variantName=null,this.orientation="0 0 0",this.scale="1 1 1"}get model(){return this[Cy]}get availableVariants(){return this.model?this.model[fy]():[]}get originalGltfJson(){return this[Sy]}[(e=Cy,i=Ey,n=Sy,wy)](){return()=>{this[Lx]()}}[Iy](t){return t.colorSpace=Ee,t.wrapS=at,t.wrapT=at,new mb(this[wy](),t)}async createTexture(t,e="image/png"){const{textureUtils:i}=this[Nx],n=await i.loadImage(t,this.withCredentials);return n.userData.mimeType=e,this[Iy](n)}async createLottieTexture(t,e=1){const{textureUtils:i}=this[Nx],n=await i.loadLottie(t,e,this.withCredentials);return this[Iy](n)}createVideoTexture(t){const e=document.createElement("video");e.crossOrigin=this.withCredentials?"use-credentials":"anonymous",e.src=t,e.muted=!0,e.playsInline=!0,e.loop=!0,e.play();const i=new Kr(e);return this[Iy](i)}createCanvasTexture(){const t=document.createElement("canvas"),e=new ta(t);return this[Iy](e)}async updated(t){if(super.updated(t),t.has("variantName")){const t=this[Ox].beginActivity("variant-update");t(.1);const e=this[Cy],{variantName:i}=this;null!=e&&(await e[dy](i),this[Lx](),this.dispatchEvent(new CustomEvent("variant-applied"))),t(1)}if(t.has("orientation")||t.has("scale")){if(!this.loaded)return;const t=this[Dx];t.applyTransform(),t.updateBoundingBox(),t.updateShadow(),this[Nx].arRenderer.onUpdateScene(),this[Lx]()}}[Ux](){super[Ux]();const{currentGLTF:t}=this[Dx];if(null!=t){const{correlatedSceneGraph:e}=t;null!=e&&t!==this[Ey]&&(this[Cy]=new xy(e,this[wy]()),this[Sy]=JSON.parse(JSON.stringify(e.gltf))),"variants"in t.userData&&this.requestUpdate("variantName")}this[Ey]=t}async exportScene(t){const e=this[Dx];return new Promise((async(i,n)=>{const s={binary:!0,onlyVisible:!0,maxTextureSize:1/0,includeCustomExtensions:!1,forceIndices:!1};Object.assign(s,t),s.animations=e.animations,s.truncateDrawRange=!0;const r=e.shadow;let a=!1;null!=r&&(a=r.visible,r.visible=!1),await this[Cy][uy]();(new bA).register((t=>new mm(t))).parse(e.model,(t=>i(new Blob([s.binary?t:JSON.stringify(t)],{type:s.binary?"aLine truncated
//# sourceMappingURL=model-viewer.min.js.map