@shopware-ag/dive 2.0.1-beta.5 → 2.0.1-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chunks/ARSystem-D27w7Pck.mjs +208 -0
- package/build/chunks/ARSystem-_0cLAxyG.cjs +1 -0
- package/build/{src/modules/animation/AnimationSystem.mjs → chunks/AnimationSystem-Bf-xhqRe.mjs} +24 -18
- package/build/chunks/AnimationSystem-DFUYMNpj.cjs +1 -0
- package/build/{src/modules/asset/exporter/AssetExporter.cjs → chunks/AssetExporter-CAqADFbL.cjs} +1 -1
- package/build/{src/modules/asset/exporter/AssetExporter.mjs → chunks/AssetExporter-ClYQ4gnb.mjs} +2 -2
- package/build/{src/modules/asset/loader/AssetLoader.mjs → chunks/AssetLoader-BewzFwHi.mjs} +6 -6
- package/build/chunks/AssetLoader-Bq-Ekxil.cjs +4 -0
- package/build/chunks/AxisCamera-CUb3g8WX.cjs +1 -0
- package/build/chunks/AxisCamera-lXJLIPLK.mjs +39 -0
- package/build/chunks/AxisHelperColors-BrGqktN5.cjs +1 -0
- package/build/chunks/AxisHelperColors-JLBHYQDi.mjs +9 -0
- package/build/chunks/MediaCreator-CEWeS42n.cjs +1 -0
- package/build/{src/modules/mediacreator/MediaCreator.mjs → chunks/MediaCreator-psLAAyJA.mjs} +1 -1
- package/build/chunks/ModuleRegistry-CBfx1EVd.mjs +13 -0
- package/build/chunks/ModuleRegistry-CDIxOzgZ.cjs +1 -0
- package/build/chunks/OrbitController-B8VkQV1e.cjs +1 -0
- package/build/chunks/OrbitController-CXu1ko6E.mjs +462 -0
- package/build/chunks/{PerspectiveCamera-sm4_81KJ.mjs → PerspectiveCamera-PMJPzAn3.mjs} +2 -2
- package/build/chunks/SelectTool-9eiKZXT4.cjs +1 -0
- package/build/chunks/{SelectTool-DmuTopJx.mjs → SelectTool-DLXheZay.mjs} +23 -18
- package/build/{src/modules/state/State.mjs → chunks/State-BNgqNPrs.mjs} +2 -2
- package/build/{src/modules/state/State.cjs → chunks/State-Mvu0hG-n.cjs} +1 -1
- package/build/{src/modules/toolbox/Toolbox.mjs → chunks/Toolbox-DKuyL8n5.mjs} +1 -1
- package/build/chunks/Toolbox-qFN47t2F.cjs +1 -0
- package/build/chunks/findInterface-C6mrvf_t.cjs +1 -0
- package/build/chunks/findInterface-DbJ5qzbc.mjs +11 -0
- package/build/chunks/index-C_uFFwT2.mjs +5 -0
- package/build/chunks/index-DAwIH9xh.cjs +1 -0
- package/build/chunks/package-CHgGmFCa.cjs +1 -0
- package/build/chunks/package-CIkS9WF6.mjs +39 -0
- package/build/dive.cjs +2 -2
- package/build/dive.mjs +588 -1057
- package/build/modules/animation/index.cjs +1 -0
- package/build/modules/animation/index.d.ts +2 -0
- package/build/modules/animation/index.mjs +5 -0
- package/build/modules/ar/index.cjs +1 -0
- package/build/modules/ar/index.d.ts +2 -0
- package/build/modules/ar/index.mjs +11 -0
- package/build/modules/assetconverter/index.cjs +1 -0
- package/build/modules/assetconverter/index.d.ts +2 -0
- package/build/modules/assetconverter/index.mjs +4 -0
- package/build/modules/assetexporter/index.cjs +1 -0
- package/build/modules/assetexporter/index.d.ts +2 -0
- package/build/modules/assetexporter/index.mjs +4 -0
- package/build/modules/assetloader/index.cjs +1 -0
- package/build/modules/assetloader/index.d.ts +2 -0
- package/build/modules/assetloader/index.mjs +4 -0
- package/build/modules/axiscamera/index.cjs +1 -0
- package/build/modules/axiscamera/index.d.ts +2 -0
- package/build/modules/axiscamera/index.mjs +4 -0
- package/build/modules/controller/index.cjs +1 -0
- package/build/modules/controller/index.d.ts +2 -0
- package/build/modules/controller/index.mjs +5 -0
- package/build/modules/mediacreator/index.cjs +1 -0
- package/build/modules/mediacreator/index.d.ts +2 -0
- package/build/modules/mediacreator/index.mjs +4 -0
- package/build/modules/state/index.cjs +1 -0
- package/build/modules/state/index.d.ts +2 -0
- package/build/modules/state/index.mjs +39 -0
- package/build/modules/systeminfo/index.cjs +1 -0
- package/build/modules/systeminfo/index.d.ts +2 -0
- package/build/{src/modules/systeminfo/SystemInfo.mjs → modules/systeminfo/index.mjs} +48 -27
- package/build/modules/toolbox/index.cjs +1 -0
- package/build/modules/toolbox/index.d.ts +2 -0
- package/build/modules/toolbox/index.mjs +10 -0
- package/build/src/engine/index.d.ts +6 -0
- package/build/src/engine/renderer/Renderer.d.ts +47 -7
- package/build/src/events/index.d.ts +1 -0
- package/build/src/index.d.ts +2 -1
- package/build/src/modules/ModuleRegistry.d.ts +3 -3
- package/build/src/modules/animation/index.d.ts +2 -0
- package/build/src/modules/ar/ARSystem.d.ts +0 -20
- package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +8 -0
- package/build/src/modules/ar/error/ar-errors.d.ts +18 -0
- package/build/src/modules/ar/index.d.ts +4 -0
- package/build/src/modules/ar/sceneviewer/SceneViewer.d.ts +10 -0
- package/build/src/modules/ar/webxr/raycaster/WebXRRaycaster.d.ts +1 -1
- package/build/src/modules/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
- package/build/src/modules/{asset/converter → assetconverter}/AssetConverter.d.ts +3 -3
- package/build/src/modules/assetconverter/index.d.ts +1 -0
- package/build/src/modules/{asset/exporter → assetexporter}/AssetExporter.d.ts +1 -1
- package/build/src/modules/assetexporter/index.d.ts +1 -0
- package/build/src/modules/assetloader/index.d.ts +1 -0
- package/build/src/modules/axiscamera/index.d.ts +1 -0
- package/build/src/modules/controller/index.d.ts +1 -0
- package/build/src/modules/mediacreator/index.d.ts +1 -0
- package/build/src/modules/state/index.d.ts +4 -0
- package/build/src/modules/state/types/ActionTypes.d.ts +1 -1
- package/build/src/modules/systeminfo/SystemInfo.d.ts +21 -0
- package/build/src/modules/systeminfo/index.d.ts +1 -0
- package/build/src/modules/toolbox/index.d.ts +4 -0
- package/build/src/modules/toolbox/select/SelectTool.d.ts +0 -3
- package/build/src/modules/toolbox/transform/TransformTool.d.ts +0 -3
- package/package.json +47 -37
- package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +0 -1
- package/build/chunks/ModuleRegistry-RSub8W0G.mjs +0 -13
- package/build/chunks/SelectTool-C7nerV4P.cjs +0 -1
- package/build/chunks/findInterface-BEdL2iUQ.cjs +0 -1
- package/build/chunks/findInterface-OrXgmwxj.mjs +0 -18
- package/build/chunks/index-C7Wx_9uY.mjs +0 -33
- package/build/chunks/index-MNP0K5dt.cjs +0 -1
- package/build/chunks/package-DeBkqggW.mjs +0 -39
- package/build/chunks/package-o6as1hwQ.cjs +0 -1
- package/build/src/error/ar-compatibility/ar-compatibility-error.d.ts +0 -12
- package/build/src/modules/animation/AnimationSystem.cjs +0 -1
- package/build/src/modules/ar/ARSystem.cjs +0 -1
- package/build/src/modules/ar/ARSystem.mjs +0 -163
- package/build/src/modules/asset/loader/AssetLoader.cjs +0 -4
- package/build/src/modules/mediacreator/MediaCreator.cjs +0 -1
- package/build/src/modules/systeminfo/SystemInfo.cjs +0 -1
- package/build/src/modules/toolbox/Toolbox.cjs +0 -1
- /package/build/{src/modules/asset/converter/AssetConverter.cjs → chunks/AssetConverter-BTAb23e8.cjs} +0 -0
- /package/build/{src/modules/asset/converter/AssetConverter.mjs → chunks/AssetConverter-D-qOTLs1.mjs} +0 -0
- /package/build/src/{modules/events → events}/EventExecutor.d.ts +0 -0
- /package/build/src/modules/{asset/loader → assetloader}/AssetLoader.d.ts +0 -0
- /package/build/src/modules/{asset → assetloader}/draco/DracoLoader.d.ts +0 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var k = (o, e, r) => e in o ? d(o, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[e] = r;
|
|
3
|
+
var l = (o, e, r) => k(o, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { SystemInfo as s, EBrowser as f } from "../modules/systeminfo/index.mjs";
|
|
5
|
+
import { E as u } from "./index-C_uFFwT2.mjs";
|
|
6
|
+
import { AssetConverter as h } from "./AssetConverter-D-qOTLs1.mjs";
|
|
7
|
+
import { AssetLoader as S } from "./AssetLoader-BewzFwHi.mjs";
|
|
8
|
+
import { AssetExporter as w } from "./AssetExporter-ClYQ4gnb.mjs";
|
|
9
|
+
class c extends Error {
|
|
10
|
+
constructor(r, t) {
|
|
11
|
+
super(r);
|
|
12
|
+
l(this, "type");
|
|
13
|
+
this.name = this.constructor.name, this.type = t, Object.setPrototypeOf(this, new.target.prototype);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class R extends c {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(
|
|
19
|
+
"AR features are not supported on desktop platforms.",
|
|
20
|
+
"ar-desktop-platform-error"
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class g extends c {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(
|
|
27
|
+
"ARQuickLook on iOS is only available in Safari.",
|
|
28
|
+
"ar-not-safari-on-ios-error"
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class y extends c {
|
|
33
|
+
constructor(e, r) {
|
|
34
|
+
super(
|
|
35
|
+
`ARQuickLook requires iOS version ${r} or later. Current version: ${e}.`,
|
|
36
|
+
"ar-ios-version-too-low-error"
|
|
37
|
+
), this.currentVersion = e, this.requiredVersion = r;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
class m extends c {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(
|
|
43
|
+
"An unknown ARQuickLook compatibility error occurred.",
|
|
44
|
+
"ar-quicklook-unknown-error"
|
|
45
|
+
// Updated type to be more specific
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const p = 12;
|
|
50
|
+
class A {
|
|
51
|
+
constructor() {
|
|
52
|
+
l(this, "converter", new h(
|
|
53
|
+
new S(),
|
|
54
|
+
new w()
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Launches AR using ARQuickLook (iOS-specific implementation)
|
|
59
|
+
*
|
|
60
|
+
* @param uri - The URI of the 3D model to display in AR
|
|
61
|
+
* @param options - Optional configuration for the AR experience
|
|
62
|
+
* @returns Promise that resolves when ARQuickLook is launched successfully
|
|
63
|
+
* @throws Error if ARQuickLook is not supported on the device
|
|
64
|
+
*/
|
|
65
|
+
async launch(e, r) {
|
|
66
|
+
if (s.getBrowser() !== f.SAFARI)
|
|
67
|
+
return Promise.reject(new g());
|
|
68
|
+
const t = s.getIOSVersion();
|
|
69
|
+
if (t && t.major < p)
|
|
70
|
+
return Promise.reject(
|
|
71
|
+
new y(
|
|
72
|
+
t.full,
|
|
73
|
+
p
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
if (!t)
|
|
77
|
+
return Promise.reject(new m());
|
|
78
|
+
if (!s.getSupportsARQuickLook())
|
|
79
|
+
return Promise.reject(new m());
|
|
80
|
+
const n = await this.convertToUSDZ(e, r);
|
|
81
|
+
return this.launchARQuickLook(n, r);
|
|
82
|
+
}
|
|
83
|
+
async convertToUSDZ(e, r) {
|
|
84
|
+
const t = await this.converter.convert(e).to("usdz", {
|
|
85
|
+
quickLookCompatible: !0,
|
|
86
|
+
ar: {
|
|
87
|
+
anchoring: { type: "plane" },
|
|
88
|
+
planeAnchoring: {
|
|
89
|
+
alignment: (r == null ? void 0 : r.arPlacement) === "vertical" ? "vertical" : "horizontal"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}), n = new Blob([t], { type: "model/vnd.usdz+zip" });
|
|
93
|
+
return URL.createObjectURL(n);
|
|
94
|
+
}
|
|
95
|
+
launchARQuickLook(e, r) {
|
|
96
|
+
return new Promise((t) => {
|
|
97
|
+
(r == null ? void 0 : r.arScale) === "fixed" && (e = e.concat("#allowsContentScaling=0"));
|
|
98
|
+
const n = document.createElement("a");
|
|
99
|
+
n.innerHTML = "<picture></picture>", n.rel = "ar", n.href = e, n.download = "scene.usdz", t(), n.click();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
class _ {
|
|
104
|
+
/**
|
|
105
|
+
* Launches AR using SceneViewer (Android-specific implementation)
|
|
106
|
+
* Note: SceneViewer is supported on all Android devices. If ARCore is not installed,
|
|
107
|
+
* the model will be displayed in 3D view mode instead of AR mode.
|
|
108
|
+
*
|
|
109
|
+
* @param uri - The URI of the 3D model to display in AR
|
|
110
|
+
* @param options - Optional configuration for the AR experience
|
|
111
|
+
* @returns Promise that resolves when SceneViewer is launched successfully
|
|
112
|
+
* @throws Error if there's an issue launching SceneViewer
|
|
113
|
+
*/
|
|
114
|
+
launch(e, r) {
|
|
115
|
+
const t = self.location.toString(), n = document.createElement("a"), a = this._createParams(t, e, r), i = this._createIntent(t, e, a);
|
|
116
|
+
n.setAttribute("href", i), n.click();
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Creates the base URL parameters for SceneViewer
|
|
120
|
+
* @param location Current page location URL
|
|
121
|
+
* @returns URLSearchParams with base configuration
|
|
122
|
+
*/
|
|
123
|
+
_createParams(e, r, t) {
|
|
124
|
+
const n = new URL(r, e), a = new URLSearchParams(n.search);
|
|
125
|
+
return a.set("mode", "ar_preferred"), this._applyScaleOption(a, t), this._applyPlacementOption(a, t), this._applySoundOption(a, e), this._applyLinkOption(a, e), a;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Applies the scale option to the parameters
|
|
129
|
+
* If scale is set to 'fixed', the model will not be resizable in AR
|
|
130
|
+
* @param params URLSearchParams to modify
|
|
131
|
+
*/
|
|
132
|
+
_applyScaleOption(e, r) {
|
|
133
|
+
(r == null ? void 0 : r.arScale) === "fixed" && e.set("resizable", "false");
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Applies the placement option to the parameters
|
|
137
|
+
* If placement is set to 'vertical', vertical placement will be enabled
|
|
138
|
+
* @param params URLSearchParams to modify
|
|
139
|
+
*/
|
|
140
|
+
_applyPlacementOption(e, r) {
|
|
141
|
+
(r == null ? void 0 : r.arPlacement) === "vertical" && e.set("enable_vertical_placement", "true");
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Applies the sound option to the parameters if present
|
|
145
|
+
* This will resolve any relative sound URLs to absolute URLs
|
|
146
|
+
* @param params URLSearchParams to modify
|
|
147
|
+
* @param location Current page location URL
|
|
148
|
+
*/
|
|
149
|
+
_applySoundOption(e, r) {
|
|
150
|
+
if (e.has("sound")) {
|
|
151
|
+
const t = new URL(e.get("sound"), r);
|
|
152
|
+
e.set("sound", t.toString());
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Applies the link option to the parameters if present
|
|
157
|
+
* This will resolve any relative link URLs to absolute URLs
|
|
158
|
+
* @param params URLSearchParams to modify
|
|
159
|
+
* @param location Current page location URL
|
|
160
|
+
*/
|
|
161
|
+
_applyLinkOption(e, r) {
|
|
162
|
+
if (e.has("link")) {
|
|
163
|
+
const t = new URL(e.get("link"), r);
|
|
164
|
+
e.set("link", t.toString());
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Creates the Android Intent URL for SceneViewer
|
|
169
|
+
* @param params URLSearchParams containing all configuration
|
|
170
|
+
* @param location Current page location URL
|
|
171
|
+
* @returns The complete Intent URL
|
|
172
|
+
*/
|
|
173
|
+
_createIntent(e, r, t) {
|
|
174
|
+
const n = new URL(e), a = new URL(r, e), i = "#model-viewer-no-ar-fallback";
|
|
175
|
+
return n.hash = i, `intent://arvr.google.com/scene-viewer/1.2?${t.toString() + "&file=" + a.toString()}#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(
|
|
176
|
+
n.toString()
|
|
177
|
+
)};end;`;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
class L {
|
|
181
|
+
/**
|
|
182
|
+
* Launches an AR experience using the appropriate platform-specific implementation
|
|
183
|
+
*
|
|
184
|
+
* @param uri - The URI of the 3D model to display in AR
|
|
185
|
+
* @param options - Optional configuration for the AR experience
|
|
186
|
+
* @returns Promise that resolves when AR is launched successfully
|
|
187
|
+
* @throws Error if AR is not supported on the current platform
|
|
188
|
+
*/
|
|
189
|
+
async launch(e, r) {
|
|
190
|
+
const t = s.getSystem();
|
|
191
|
+
return t === u.IOS ? new A().launch(e, r) : t === u.ANDROID ? new _().launch(e, r) : Promise.reject(new R());
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
195
|
+
__proto__: null,
|
|
196
|
+
ARSystem: L
|
|
197
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
198
|
+
export {
|
|
199
|
+
L as A,
|
|
200
|
+
_ as S,
|
|
201
|
+
A as a,
|
|
202
|
+
c as b,
|
|
203
|
+
R as c,
|
|
204
|
+
g as d,
|
|
205
|
+
y as e,
|
|
206
|
+
m as f,
|
|
207
|
+
I as g
|
|
208
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var w=Object.defineProperty;var A=(o,e,r)=>e in o?w(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r;var l=(o,e,r)=>A(o,typeof e!="symbol"?e+"":e,r);const c=require("../modules/systeminfo/index.cjs"),m=require("./index-DAwIH9xh.cjs"),y=require("./AssetConverter-BTAb23e8.cjs"),_=require("./AssetLoader-Bq-Ekxil.cjs"),L=require("./AssetExporter-CAqADFbL.cjs");class a extends Error{constructor(r,t){super(r);l(this,"type");this.name=this.constructor.name,this.type=t,Object.setPrototypeOf(this,new.target.prototype)}}class d extends a{constructor(){super("AR features are not supported on desktop platforms.","ar-desktop-platform-error")}}class S extends a{constructor(){super("ARQuickLook on iOS is only available in Safari.","ar-not-safari-on-ios-error")}}class f extends a{constructor(e,r){super(`ARQuickLook requires iOS version ${r} or later. Current version: ${e}.`,"ar-ios-version-too-low-error"),this.currentVersion=e,this.requiredVersion=r}}class u extends a{constructor(){super("An unknown ARQuickLook compatibility error occurred.","ar-quicklook-unknown-error")}}const k=12;class p{constructor(){l(this,"converter",new y.AssetConverter(new _.AssetLoader,new L.AssetExporter))}async launch(e,r){if(c.SystemInfo.getBrowser()!==c.EBrowser.SAFARI)return Promise.reject(new S);const t=c.SystemInfo.getIOSVersion();if(t&&t.major<k)return Promise.reject(new f(t.full,k));if(!t)return Promise.reject(new u);if(!c.SystemInfo.getSupportsARQuickLook())return Promise.reject(new u);const n=await this.convertToUSDZ(e,r);return this.launchARQuickLook(n,r)}async convertToUSDZ(e,r){const t=await this.converter.convert(e).to("usdz",{quickLookCompatible:!0,ar:{anchoring:{type:"plane"},planeAnchoring:{alignment:(r==null?void 0:r.arPlacement)==="vertical"?"vertical":"horizontal"}}}),n=new Blob([t],{type:"model/vnd.usdz+zip"});return URL.createObjectURL(n)}launchARQuickLook(e,r){return new Promise(t=>{(r==null?void 0:r.arScale)==="fixed"&&(e=e.concat("#allowsContentScaling=0"));const n=document.createElement("a");n.innerHTML="<picture></picture>",n.rel="ar",n.href=e,n.download="scene.usdz",t(),n.click()})}}class h{launch(e,r){const t=self.location.toString(),n=document.createElement("a"),s=this._createParams(t,e,r),i=this._createIntent(t,e,s);n.setAttribute("href",i),n.click()}_createParams(e,r,t){const n=new URL(r,e),s=new URLSearchParams(n.search);return s.set("mode","ar_preferred"),this._applyScaleOption(s,t),this._applyPlacementOption(s,t),this._applySoundOption(s,e),this._applyLinkOption(s,e),s}_applyScaleOption(e,r){(r==null?void 0:r.arScale)==="fixed"&&e.set("resizable","false")}_applyPlacementOption(e,r){(r==null?void 0:r.arPlacement)==="vertical"&&e.set("enable_vertical_placement","true")}_applySoundOption(e,r){if(e.has("sound")){const t=new URL(e.get("sound"),r);e.set("sound",t.toString())}}_applyLinkOption(e,r){if(e.has("link")){const t=new URL(e.get("link"),r);e.set("link",t.toString())}}_createIntent(e,r,t){const n=new URL(e),s=new URL(r,e),i="#model-viewer-no-ar-fallback";return n.hash=i,`intent://arvr.google.com/scene-viewer/1.2?${t.toString()+"&file="+s.toString()}#Intent;scheme=https;package=com.google.android.googlequicksearchbox;action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(n.toString())};end;`}}class R{async launch(e,r){const t=c.SystemInfo.getSystem();return t===m.ESystem.IOS?new p().launch(e,r):t===m.ESystem.ANDROID?new h().launch(e,r):Promise.reject(new d)}}const g=Object.freeze(Object.defineProperty({__proto__:null,ARSystem:R},Symbol.toStringTag,{value:"Module"}));exports.ARDesktopPlatformError=d;exports.ARError=a;exports.ARQuickLook=p;exports.ARQuickLookNotSafariError=S;exports.ARQuickLookUnknownError=u;exports.ARQuickLookVersionMismatchError=f;exports.ARSystem=R;exports.ARSystem$1=g;exports.SceneViewer=h;
|
package/build/{src/modules/animation/AnimationSystem.mjs → chunks/AnimationSystem-Bf-xhqRe.mjs}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var h = (a, t, e) => t in a ? d(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var i = (a, t, e) => h(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { update as u, Tween as r, Easing as _ } from "@tweenjs/tween.js";
|
|
5
|
-
import { EventDispatcher as g, MathUtils as
|
|
6
|
-
class
|
|
7
|
-
constructor(e,
|
|
5
|
+
import { EventDispatcher as g, MathUtils as c } from "three";
|
|
6
|
+
class y extends g {
|
|
7
|
+
constructor(e, p, n, s) {
|
|
8
8
|
super();
|
|
9
|
-
i(this, "_uuid",
|
|
9
|
+
i(this, "_uuid", c.generateUUID());
|
|
10
10
|
i(this, "_playing", !1);
|
|
11
11
|
i(this, "_stopped", !1);
|
|
12
12
|
i(this, "_completed", !1);
|
|
13
|
-
this.object = e, this.to =
|
|
13
|
+
this.object = e, this.to = p, this.duration = n, this.options = s;
|
|
14
14
|
}
|
|
15
15
|
get uuid() {
|
|
16
16
|
return this._uuid;
|
|
@@ -34,9 +34,9 @@ class w extends g {
|
|
|
34
34
|
return this._playing = !1, this._stopped = !0, this.dispatchEvent({ type: "stop", target: this }), this;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
class
|
|
37
|
+
class w {
|
|
38
38
|
constructor() {
|
|
39
|
-
i(this, "uuid",
|
|
39
|
+
i(this, "uuid", c.generateUUID());
|
|
40
40
|
i(this, "_callbackMap", /* @__PURE__ */ new Map());
|
|
41
41
|
i(this, "_tweens", /* @__PURE__ */ new Map());
|
|
42
42
|
}
|
|
@@ -48,9 +48,9 @@ class M {
|
|
|
48
48
|
* @param options - The options for the animation.
|
|
49
49
|
* @returns The animator.
|
|
50
50
|
*/
|
|
51
|
-
createAnimator(t, e,
|
|
51
|
+
createAnimator(t, e, p, n) {
|
|
52
52
|
var o, l;
|
|
53
|
-
const s = new
|
|
53
|
+
const s = new y(t, e, p, n);
|
|
54
54
|
return this._callbackMap.set(s.uuid, {
|
|
55
55
|
onUpdate: ((o = s.options) == null ? void 0 : o.onUpdate) ?? (() => {
|
|
56
56
|
}),
|
|
@@ -75,13 +75,13 @@ class M {
|
|
|
75
75
|
return new r(t);
|
|
76
76
|
}
|
|
77
77
|
_setupTween(t) {
|
|
78
|
-
var
|
|
79
|
-
const e = new r(t.object).to(t.to, t.duration).easing(((
|
|
78
|
+
var p;
|
|
79
|
+
const e = new r(t.object).to(t.to, t.duration).easing(((p = t.options) == null ? void 0 : p.easing) ?? _.Quadratic.Out).onUpdate((n, s) => {
|
|
80
80
|
var o;
|
|
81
|
-
(o = this._callbackMap.get(t.uuid)) == null || o.onUpdate(
|
|
82
|
-
}).onComplete((
|
|
81
|
+
(o = this._callbackMap.get(t.uuid)) == null || o.onUpdate(n, s);
|
|
82
|
+
}).onComplete((n) => {
|
|
83
83
|
var s;
|
|
84
|
-
(s = this._callbackMap.get(t.uuid)) == null || s.onComplete(
|
|
84
|
+
(s = this._callbackMap.get(t.uuid)) == null || s.onComplete(n);
|
|
85
85
|
});
|
|
86
86
|
t.addEventListener("play", () => {
|
|
87
87
|
e.start();
|
|
@@ -90,6 +90,12 @@ class M {
|
|
|
90
90
|
}), this._tweens.set(t.uuid, e);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
const M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
94
|
+
__proto__: null,
|
|
95
|
+
AnimationSystem: w
|
|
96
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
93
97
|
export {
|
|
94
|
-
|
|
98
|
+
w as A,
|
|
99
|
+
y as a,
|
|
100
|
+
M as b
|
|
95
101
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var d=Object.defineProperty;var _=(n,t,e)=>t in n?d(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>_(n,typeof t!="symbol"?t+"":t,e);const l=require("@tweenjs/tween.js"),r=require("three");class h extends r.EventDispatcher{constructor(e,p,a,s){super();i(this,"_uuid",r.MathUtils.generateUUID());i(this,"_playing",!1);i(this,"_stopped",!1);i(this,"_completed",!1);this.object=e,this.to=p,this.duration=a,this.options=s}get uuid(){return this._uuid}get playing(){return this._playing}get stopped(){return this._stopped}get completed(){return this._completed}dispose(){this._playing=!1,this._stopped=!1,this._completed=!1}play(){return this._playing=!0,this._stopped=!1,this.dispatchEvent({type:"play",target:this}),console.log("play",this),this}stop(){return this._playing=!1,this._stopped=!0,this.dispatchEvent({type:"stop",target:this}),this}}class u{constructor(){i(this,"uuid",r.MathUtils.generateUUID());i(this,"_callbackMap",new Map);i(this,"_tweens",new Map)}createAnimator(t,e,p,a){var o,c;const s=new h(t,e,p,a);return this._callbackMap.set(s.uuid,{onUpdate:((o=s.options)==null?void 0:o.onUpdate)??(()=>{}),onComplete:((c=s.options)==null?void 0:c.onComplete)??(()=>{})}),this._setupTween(s),s}unregister(t){if(!this._callbackMap.has(t)){console.warn(`Animator with uuid ${t} not registered`);return}this._callbackMap.delete(t),this._tweens.delete(t)}dispose(){this._callbackMap.clear(),this._tweens.clear()}tick(){l.update()}animate(t){return new l.Tween(t)}_setupTween(t){var p;const e=new l.Tween(t.object).to(t.to,t.duration).easing(((p=t.options)==null?void 0:p.easing)??l.Easing.Quadratic.Out).onUpdate((a,s)=>{var o;(o=this._callbackMap.get(t.uuid))==null||o.onUpdate(a,s)}).onComplete(a=>{var s;(s=this._callbackMap.get(t.uuid))==null||s.onComplete(a)});t.addEventListener("play",()=>{e.start()}),t.addEventListener("stop",()=>{e.stop()}),this._tweens.set(t.uuid,e)}}const g=Object.freeze(Object.defineProperty({__proto__:null,AnimationSystem:u},Symbol.toStringTag,{value:"Module"}));exports.AnimationSystem=u;exports.AnimationSystem$1=g;exports.Animator=h;
|
package/build/{src/modules/asset/exporter/AssetExporter.cjs → chunks/AssetExporter-CAqADFbL.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var ue=Object.defineProperty;var le=(n,e,s)=>e in n?ue(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s;var H=(n,e,s)=>le(n,typeof e!="symbol"?e+"":e,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("three"),K=require("
|
|
1
|
+
"use strict";var ue=Object.defineProperty;var le=(n,e,s)=>e in n?ue(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s;var H=(n,e,s)=>le(n,typeof e!="symbol"?e+"":e,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("three"),K=require("./fflate.module-DHdJvhNh.cjs"),L=require("./parse-error-Bd09D_1L.cjs");let $,V,C,D;function k(n,e=1/0,s=null){V||(V=new d.PlaneGeometry(2,2,1,1)),C||(C=new d.ShaderMaterial({uniforms:{blitTexture:new d.Uniform(n)},vertexShader:`
|
|
2
2
|
varying vec2 vUv;
|
|
3
3
|
void main(){
|
|
4
4
|
vUv = uv;
|
package/build/{src/modules/asset/exporter/AssetExporter.mjs → chunks/AssetExporter-ClYQ4gnb.mjs}
RENAMED
|
@@ -2,8 +2,8 @@ var Te = Object.defineProperty;
|
|
|
2
2
|
var Me = (n, e, s) => e in n ? Te(n, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[e] = s;
|
|
3
3
|
var Y = (n, e, s) => Me(n, typeof e != "symbol" ? e + "" : e, s);
|
|
4
4
|
import { PlaneGeometry as ye, ShaderMaterial as we, Uniform as Ee, SRGBColorSpace as ue, Mesh as be, PerspectiveCamera as Ae, Scene as Z, WebGLRenderer as Ie, CanvasTexture as Re, Color as _e, Matrix4 as le, Vector3 as B, Quaternion as Se, BufferAttribute as L, CompressedTexture as j, Source as Ne, NoColorSpace as fe, MathUtils as q, RGBAFormat as Le, DoubleSide as pe, PropertyBinding as H, InterpolateDiscrete as ve, NearestFilter as Ce, NearestMipmapNearestFilter as Ue, NearestMipmapLinearFilter as Fe, LinearFilter as $e, LinearMipmapNearestFilter as Oe, LinearMipmapLinearFilter as Pe, ClampToEdgeWrapping as De, RepeatWrapping as Ge, MirroredRepeatWrapping as ke, InterpolateLinear as ze } from "three";
|
|
5
|
-
import { s as he, z as Be } from "
|
|
6
|
-
import { F as He, P as N } from "
|
|
5
|
+
import { s as he, z as Be } from "./fflate.module-xyO_T3Zm.mjs";
|
|
6
|
+
import { F as He, P as N } from "./parse-error-BFRJyIxM.mjs";
|
|
7
7
|
let O, K, C, G;
|
|
8
8
|
function z(n, e = 1 / 0, s = null) {
|
|
9
9
|
K || (K = new ye(2, 2, 1, 1)), C || (C = new we({
|
|
@@ -2,9 +2,9 @@ var ve = Object.defineProperty;
|
|
|
2
2
|
var Be = (d, e, t) => e in d ? ve(d, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[e] = t;
|
|
3
3
|
var v = (d, e, t) => Be(d, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { TrianglesDrawMode as je, TriangleFanDrawMode as re, TriangleStripDrawMode as be, Loader as ae, LoaderUtils as X, FileLoader as K, MeshPhysicalMaterial as D, Vector2 as q, Color as U, LinearSRGBColorSpace as O, SRGBColorSpace as N, SpotLight as Ke, PointLight as Ve, DirectionalLight as We, Matrix4 as Y, Vector3 as B, Quaternion as Le, InstancedMesh as Xe, InstancedBufferAttribute as ze, Object3D as ce, TextureLoader as Me, ImageBitmapLoader as qe, BufferAttribute as P, InterleavedBuffer as Ye, InterleavedBufferAttribute as Je, LinearMipmapLinearFilter as Ie, NearestMipmapLinearFilter as Qe, LinearMipmapNearestFilter as Ze, NearestMipmapNearestFilter as $e, LinearFilter as Ce, NearestFilter as et, RepeatWrapping as J, MirroredRepeatWrapping as Ne, ClampToEdgeWrapping as Oe, PointsMaterial as tt, Material as Z, LineBasicMaterial as nt, MeshStandardMaterial as De, DoubleSide as st, MeshBasicMaterial as W, PropertyBinding as rt, BufferGeometry as ue, SkinnedMesh as ot, Mesh as Pe, LineSegments as it, Line as at, LineLoop as ct, Points as ut, Group as z, PerspectiveCamera as lt, MathUtils as ft, OrthographicCamera as dt, Skeleton as ht, AnimationClip as pt, Bone as mt, InterpolateDiscrete as gt, InterpolateLinear as ke, Texture as de, VectorKeyframeTrack as he, NumberKeyframeTrack as pe, QuaternionKeyframeTrack as me, ColorManagement as ge, FrontSide as At, Interpolant as Tt, Box3 as yt, Sphere as Rt, NoColorSpace as H } from "three";
|
|
5
|
-
import { u as xt, a as Ae } from "
|
|
6
|
-
import { N as Te, g as _t, i as wt, S as Et } from "
|
|
7
|
-
import { F as ye, P as Re } from "
|
|
5
|
+
import { u as xt, a as Ae } from "./fflate.module-xyO_T3Zm.mjs";
|
|
6
|
+
import { N as Te, g as _t, i as wt, S as Et } from "./FileTypes-DuVGjbcR.mjs";
|
|
7
|
+
import { F as ye, P as Re } from "./parse-error-BFRJyIxM.mjs";
|
|
8
8
|
function xe(d, e) {
|
|
9
9
|
if (e === je)
|
|
10
10
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), d;
|
|
@@ -2241,10 +2241,10 @@ function ln() {
|
|
|
2241
2241
|
}
|
|
2242
2242
|
}
|
|
2243
2243
|
const se = {
|
|
2244
|
-
LOAD_DRACO_JS_DECODER: async () => (await import("
|
|
2245
|
-
LOAD_DRACO_WASM_WRAPPER: async () => (await import("
|
|
2244
|
+
LOAD_DRACO_JS_DECODER: async () => (await import("./draco_decoder-CEzwqP9o.mjs")).default,
|
|
2245
|
+
LOAD_DRACO_WASM_WRAPPER: async () => (await import("./draco_wasm_wrapper-yQy2VLhb.mjs")).default,
|
|
2246
2246
|
LOAD_DRACO_WASM_DECODER: async () => {
|
|
2247
|
-
const d = (await import("
|
|
2247
|
+
const d = (await import("./draco_decoder-DtHHc5d0.mjs")).default;
|
|
2248
2248
|
return await (await fetch(d)).arrayBuffer();
|
|
2249
2249
|
}
|
|
2250
2250
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var ie=Object.defineProperty;var ae=(h,e,t)=>e in h?ie(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t;var k=(h,e,t)=>ae(h,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("three"),v=require("./fflate.module-DHdJvhNh.cjs"),G=require("./FileTypes-DzVpDu_p.cjs"),B=require("./parse-error-Bd09D_1L.cjs");function Q(h,e){if(e===f.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),h;if(e===f.TriangleFanDrawMode||e===f.TriangleStripDrawMode){let t=h.getIndex();if(t===null){const s=[],a=h.getAttribute("position");if(a!==void 0){for(let i=0;i<a.count;i++)s.push(i);h.setIndex(s),t=h.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),h}const o=t.count-2,n=[];if(e===f.TriangleFanDrawMode)for(let s=1;s<=o;s++)n.push(t.getX(0)),n.push(t.getX(s)),n.push(t.getX(s+1));else for(let s=0;s<o;s++)s%2===0?(n.push(t.getX(s)),n.push(t.getX(s+1)),n.push(t.getX(s+2))):(n.push(t.getX(s+2)),n.push(t.getX(s+1)),n.push(t.getX(s)));n.length/3!==o&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const r=h.clone();return r.setIndex(n),r.clearGroups(),r}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),h}class ce extends f.Loader{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new he(t)}),this.register(function(t){return new Se(t)}),this.register(function(t){return new _e(t)}),this.register(function(t){return new we(t)}),this.register(function(t){return new me(t)}),this.register(function(t){return new ge(t)}),this.register(function(t){return new Ae(t)}),this.register(function(t){return new Te(t)}),this.register(function(t){return new de(t)}),this.register(function(t){return new ye(t)}),this.register(function(t){return new pe(t)}),this.register(function(t){return new xe(t)}),this.register(function(t){return new Re(t)}),this.register(function(t){return new ue(t)}),this.register(function(t){return new Le(t)}),this.register(function(t){return new Ee(t)})}load(e,t,o,n){const r=this;let s;if(this.resourcePath!=="")s=this.resourcePath;else if(this.path!==""){const c=f.LoaderUtils.extractUrlBase(e);s=f.LoaderUtils.resolveURL(c,this.path)}else s=f.LoaderUtils.extractUrlBase(e);this.manager.itemStart(e);const a=function(c){n?n(c):console.error(c),r.manager.itemError(e),r.manager.itemEnd(e)},i=new f.FileLoader(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,function(c){try{r.parse(c,s,function(l){t(l),r.manager.itemEnd(e)},a)}catch(l){a(l)}},o,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,o,n){let r;const s={},a={},i=new TextDecoder;if(typeof e=="string")r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(i.decode(new Uint8Array(e,0,4))===ne){try{s[b.KHR_BINARY_GLTF]=new be(e)}catch(u){n&&n(u);return}r=JSON.parse(s[b.KHR_BINARY_GLTF].content)}else r=JSON.parse(i.decode(e));else r=e;if(r.asset===void 0||r.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const c=new He(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let l=0;l<this.pluginCallbacks.length;l++){const u=this.pluginCallbacks[l](c);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[u.name]=u,s[u.name]=!0}if(r.extensionsUsed)for(let l=0;l<r.extensionsUsed.length;++l){const u=r.extensionsUsed[l],d=r.extensionsRequired||[];switch(u){case b.KHR_MATERIALS_UNLIT:s[u]=new fe;break;case b.KHR_DRACO_MESH_COMPRESSION:s[u]=new Me(r,this.dracoLoader);break;case b.KHR_TEXTURE_TRANSFORM:s[u]=new Ce;break;case b.KHR_MESH_QUANTIZATION:s[u]=new Ie;break;default:d.indexOf(u)>=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(s),c.setPlugins(a),c.parse(o,n)}parseAsync(e,t){const o=this;return new Promise(function(n,r){o.parse(e,t,n,r)})}}function le(){let h={};return{get:function(e){return h[e]},add:function(e,t){h[e]=t},remove:function(e){delete h[e]},removeAll:function(){h={}}}}const b={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class ue{constructor(e){this.parser=e,this.name=b.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let o=0,n=t.length;o<n;o++){const r=t[o];r.extensions&&r.extensions[this.name]&&r.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,o="light:"+e;let n=t.cache.get(o);if(n)return n;const r=t.json,i=((r.extensions&&r.extensions[this.name]||{}).lights||[])[e];let c;const l=new f.Color(16777215);i.color!==void 0&&l.setRGB(i.color[0],i.color[1],i.color[2],f.LinearSRGBColorSpace);const u=i.range!==void 0?i.range:0;switch(i.type){case"directional":c=new f.DirectionalLight(l),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new f.PointLight(l),c.distance=u;break;case"spot":c=new f.SpotLight(l),c.distance=u,i.spot=i.spot||{},i.spot.innerConeAngle=i.spot.innerConeAngle!==void 0?i.spot.innerConeAngle:0,i.spot.outerConeAngle=i.spot.outerConeAngle!==void 0?i.spot.outerConeAngle:Math.PI/4,c.angle=i.spot.outerConeAngle,c.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+i.type)}return c.position.set(0,0,0),c.decay=2,O(c,i),i.intensity!==void 0&&(c.intensity=i.intensity),c.name=t.createUniqueName(i.name||"light_"+e),n=Promise.resolve(c),t.cache.add(o,n),n}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,o=this.parser,r=o.json.nodes[e],a=(r.extensions&&r.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(i){return o._getNodeRef(t.cache,a,i)})}}class fe{constructor(){this.name=b.KHR_MATERIALS_UNLIT}getMaterialType(){return f.MeshBasicMaterial}extendParams(e,t,o){const n=[];e.color=new f.Color(1,1,1),e.opacity=1;const r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){const s=r.baseColorFactor;e.color.setRGB(s[0],s[1],s[2],f.LinearSRGBColorSpace),e.opacity=s[3]}r.baseColorTexture!==void 0&&n.push(o.assignTexture(e,"map",r.baseColorTexture,f.SRGBColorSpace))}return Promise.all(n)}}class de{constructor(e){this.parser=e,this.name=b.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name].emissiveStrength;return r!==void 0&&(t.emissiveIntensity=r),Promise.resolve()}}class he{constructor(e){this.parser=e,this.name=b.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const o=this.parser.json.materials[e];return!o.extensions||!o.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const o=this.parser,n=o.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];if(s.clearcoatFactor!==void 0&&(t.clearcoat=s.clearcoatFactor),s.clearcoatTexture!==void 0&&r.push(o.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),s.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),s.clearcoatRoughnessTexture!==void 0&&r.push(o.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),s.clearcoatNormalTexture!==void 0&&(r.push(o.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),s.clearcoatNormalTexture.scale!==void 0)){const a=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new f.Vector2(a,a)}return Promise.all(r)}}class pe{constructor(e){this.parser=e,this.name=b.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const o=this.parser.json.materials[e];return!o.extensions||!o.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const o=this.parser,n=o.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];return s.iridescenceFactor!==void 0&&(t.iridescence=s.iridescenceFactor),s.iridescenceTexture!==void 0&&r.push(o.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),s.iridescenceIor!==void 0&&(t.iridescenceIOR=s.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),s.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),s.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),s.iridescenceThicknessTexture!==void 0&&r.push(o.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(r)}}class me{constructor(e){this.parser=e,this.name=b.KHR_MATERIALS_SHEEN}getMaterialType(e){const o=this.parser.json.materials[e];return!o.extensions||!o.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const o=this.parser,n=o.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[];t.sheenColor=new f.Color(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=n.extensions[this.name];if(s.sheenColorFactor!==void 0){const a=s.sheenColorFactor;t.sheenColor.setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace)}return s.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=s.sheenRoughnessFactor),s.sheenColorTexture!==void 0&&r.push(o.assignTexture(t,"sheenColorMap",s.sheenColorTexture,f.SRGBColorSpace)),s.sheenRoughnessTexture!==void 0&&r.push(o.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(r)}}class ge{constructor(e){this.parser=e,this.name=b.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const o=this.parser.json.materials[e];return!o.extensions||!o.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const o=this.parser,n=o.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];return s.transmissionFactor!==void 0&&(t.transmission=s.transmissionFactor),s.transmissionTexture!==void 0&&r.push(o.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(r)}}class Ae{constructor(e){this.parser=e,this.name=b.KHR_MATERIALS_VOLUME}getMaterialType(e){const o=this.parser.json.materials[e];return!o.extensions||!o.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const o=this.parser,n=o.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];t.thickness=s.thicknessFactor!==void 0?s.thicknessFactor:0,s.thicknessTexture!==void 0&&r.push(o.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||1/0;const a=s.attenuationColor||[1,1,1];return t.attenuationColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),Promise.all(r)}}class Te{constructor(e){this.parser=e,this.name=b.KHR_MATERIALS_IOR}getMaterialType(e){const o=this.parser.json.materials[e];return!o.extensions||!o.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}}class ye{constructor(e){this.parser=e,this.name=b.KHR_MATERIALS_SPECULAR}getMaterialType(e){const o=this.parser.json.materials[e];return!o.extensions||!o.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const o=this.parser,n=o.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];t.specularIntensity=s.specularFactor!==void 0?s.specularFactor:1,s.specularTexture!==void 0&&r.push(o.assignTexture(t,"specularIntensityMap",s.specularTexture));const a=s.specularColorFactor||[1,1,1];return t.specularColor=new f.Color().setRGB(a[0],a[1],a[2],f.LinearSRGBColorSpace),s.specularColorTexture!==void 0&&r.push(o.assignTexture(t,"specularColorMap",s.specularColorTexture,f.SRGBColorSpace)),Promise.all(r)}}class Re{constructor(e){this.parser=e,this.name=b.EXT_MATERIALS_BUMP}getMaterialType(e){const o=this.parser.json.materials[e];return!o.extensions||!o.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const o=this.parser,n=o.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];return t.bumpScale=s.bumpFactor!==void 0?s.bumpFactor:1,s.bumpTexture!==void 0&&r.push(o.assignTexture(t,"bumpMap",s.bumpTexture)),Promise.all(r)}}class xe{constructor(e){this.parser=e,this.name=b.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const o=this.parser.json.materials[e];return!o.extensions||!o.extensions[this.name]?null:f.MeshPhysicalMaterial}extendMaterialParams(e,t){const o=this.parser,n=o.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];return s.anisotropyStrength!==void 0&&(t.anisotropy=s.anisotropyStrength),s.anisotropyRotation!==void 0&&(t.anisotropyRotation=s.anisotropyRotation),s.anisotropyTexture!==void 0&&r.push(o.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(r)}}class Se{constructor(e){this.parser=e,this.name=b.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,o=t.json,n=o.textures[e];if(!n.extensions||!n.extensions[this.name])return null;const r=n.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(o.extensionsRequired&&o.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,r.source,s)}}class _e{constructor(e){this.parser=e,this.name=b.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,o=this.parser,n=o.json,r=n.textures[e];if(!r.extensions||!r.extensions[t])return null;const s=r.extensions[t],a=n.images[s.source];let i=o.textureLoader;if(a.uri){const c=o.options.manager.getHandler(a.uri);c!==null&&(i=c)}return this.detectSupport().then(function(c){if(c)return o.loadTextureImage(e,s.source,i);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return o.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class we{constructor(e){this.parser=e,this.name=b.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,o=this.parser,n=o.json,r=n.textures[e];if(!r.extensions||!r.extensions[t])return null;const s=r.extensions[t],a=n.images[s.source];let i=o.textureLoader;if(a.uri){const c=o.options.manager.getHandler(a.uri);c!==null&&(i=c)}return this.detectSupport().then(function(c){if(c)return o.loadTextureImage(e,s.source,i);if(n.extensionsRequired&&n.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return o.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class Le{constructor(e){this.name=b.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,o=t.bufferViews[e];if(o.extensions&&o.extensions[this.name]){const n=o.extensions[this.name],r=this.parser.getDependency("buffer",n.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return r.then(function(a){const i=n.byteOffset||0,c=n.byteLength||0,l=n.count,u=n.byteStride,d=new Uint8Array(a,i,c);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(l,u,d,n.mode,n.filter).then(function(g){return g.buffer}):s.ready.then(function(){const g=new ArrayBuffer(l*u);return s.decodeGltfBuffer(new Uint8Array(g),l,u,d,n.mode,n.filter),g})})}else return null}}class Ee{constructor(e){this.name=b.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,o=t.nodes[e];if(!o.extensions||!o.extensions[this.name]||o.mesh===void 0)return null;const n=t.meshes[o.mesh];for(const c of n.primitives)if(c.mode!==N.TRIANGLES&&c.mode!==N.TRIANGLE_STRIP&&c.mode!==N.TRIANGLE_FAN&&c.mode!==void 0)return null;const s=o.extensions[this.name].attributes,a=[],i={};for(const c in s)a.push(this.parser.getDependency("accessor",s[c]).then(l=>(i[c]=l,i[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const l=c.pop(),u=l.isGroup?l.children:[l],d=c[0].count,g=[];for(const y of u){const S=new f.Matrix4,R=new f.Vector3,x=new f.Quaternion,L=new f.Vector3(1,1,1),E=new f.InstancedMesh(y.geometry,y.material,d);for(let _=0;_<d;_++)i.TRANSLATION&&R.fromBufferAttribute(i.TRANSLATION,_),i.ROTATION&&x.fromBufferAttribute(i.ROTATION,_),i.SCALE&&L.fromBufferAttribute(i.SCALE,_),E.setMatrixAt(_,S.compose(R,x,L));for(const _ in i)if(_==="_COLOR_0"){const C=i[_];E.instanceColor=new f.InstancedBufferAttribute(C.array,C.itemSize,C.normalized)}else _!=="TRANSLATION"&&_!=="ROTATION"&&_!=="SCALE"&&y.geometry.setAttribute(_,i[_]);f.Object3D.prototype.copy.call(E,y),this.parser.assignFinalMaterial(E),g.push(E)}return l.isGroup?(l.clear(),l.add(...g),l):g[0]}))}}const ne="glTF",U=12,Z={JSON:1313821514,BIN:5130562};class be{constructor(e){this.name=b.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,U),o=new TextDecoder;if(this.header={magic:o.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==ne)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-U,r=new DataView(e,U);let s=0;for(;s<n;){const a=r.getUint32(s,!0);s+=4;const i=r.getUint32(s,!0);if(s+=4,i===Z.JSON){const c=new Uint8Array(e,U+s,a);this.content=o.decode(c)}else if(i===Z.BIN){const c=U+s;this.body=e.slice(c,c+a)}s+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Me{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=b.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const o=this.json,n=this.dracoLoader,r=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,a={},i={},c={};for(const l in s){const u=q[l]||l.toLowerCase();a[u]=s[l]}for(const l in e.attributes){const u=q[l]||l.toLowerCase();if(s[l]!==void 0){const d=o.accessors[e.attributes[l]],g=F[d.componentType];c[u]=g.name,i[u]=d.normalized===!0}}return t.getDependency("bufferView",r).then(function(l){return new Promise(function(u,d){n.decodeDracoFile(l,function(g){for(const y in g.attributes){const S=g.attributes[y],R=i[y];R!==void 0&&(S.normalized=R)}u(g)},a,c,f.LinearSRGBColorSpace,d)})})}}class Ce{constructor(){this.name=b.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class Ie{constructor(){this.name=b.KHR_MESH_QUANTIZATION}}class se extends f.Interpolant{constructor(e,t,o,n){super(e,t,o,n)}copySampleValue_(e){const t=this.resultBuffer,o=this.sampleValues,n=this.valueSize,r=e*n*3+n;for(let s=0;s!==n;s++)t[s]=o[r+s];return t}interpolate_(e,t,o,n){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,i=a*2,c=a*3,l=n-t,u=(o-t)/l,d=u*u,g=d*u,y=e*c,S=y-c,R=-2*g+3*d,x=g-d,L=1-R,E=x-d+u;for(let _=0;_!==a;_++){const C=s[S+_+a],I=s[S+_+i]*l,M=s[y+_+a],p=s[y+_]*l;r[_]=L*C+E*I+R*M+x*p}return r}}const Ne=new f.Quaternion;class De extends se{interpolate_(e,t,o,n){const r=super.interpolate_(e,t,o,n);return Ne.fromArray(r).normalize().toArray(r),r}}const N={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},F={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},$={9728:f.NearestFilter,9729:f.LinearFilter,9984:f.NearestMipmapNearestFilter,9985:f.LinearMipmapNearestFilter,9986:f.NearestMipmapLinearFilter,9987:f.LinearMipmapLinearFilter},ee={33071:f.ClampToEdgeWrapping,33648:f.MirroredRepeatWrapping,10497:f.RepeatWrapping},j={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},q={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},D={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Oe={CUBICSPLINE:void 0,LINEAR:f.InterpolateLinear,STEP:f.InterpolateDiscrete},K={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function Pe(h){return h.DefaultMaterial===void 0&&(h.DefaultMaterial=new f.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:f.FrontSide})),h.DefaultMaterial}function P(h,e,t){for(const o in t.extensions)h[o]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[o]=t.extensions[o])}function O(h,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(h.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function ke(h,e,t){let o=!1,n=!1,r=!1;for(let c=0,l=e.length;c<l;c++){const u=e[c];if(u.POSITION!==void 0&&(o=!0),u.NORMAL!==void 0&&(n=!0),u.COLOR_0!==void 0&&(r=!0),o&&n&&r)break}if(!o&&!n&&!r)return Promise.resolve(h);const s=[],a=[],i=[];for(let c=0,l=e.length;c<l;c++){const u=e[c];if(o){const d=u.POSITION!==void 0?t.getDependency("accessor",u.POSITION):h.attributes.position;s.push(d)}if(n){const d=u.NORMAL!==void 0?t.getDependency("accessor",u.NORMAL):h.attributes.normal;a.push(d)}if(r){const d=u.COLOR_0!==void 0?t.getDependency("accessor",u.COLOR_0):h.attributes.color;i.push(d)}}return Promise.all([Promise.all(s),Promise.all(a),Promise.all(i)]).then(function(c){const l=c[0],u=c[1],d=c[2];return o&&(h.morphAttributes.position=l),n&&(h.morphAttributes.normal=u),r&&(h.morphAttributes.color=d),h.morphTargetsRelative=!0,h})}function Fe(h,e){if(h.updateMorphTargets(),e.weights!==void 0)for(let t=0,o=e.weights.length;t<o;t++)h.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(h.morphTargetInfluences.length===t.length){h.morphTargetDictionary={};for(let o=0,n=t.length;o<n;o++)h.morphTargetDictionary[t[o]]=o}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Ge(h){let e;const t=h.extensions&&h.extensions[b.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+V(t.attributes):e=h.indices+":"+V(h.attributes)+":"+h.mode,h.targets!==void 0)for(let o=0,n=h.targets.length;o<n;o++)e+=":"+V(h.targets[o]);return e}function V(h){let e="";const t=Object.keys(h).sort();for(let o=0,n=t.length;o<n;o++)e+=t[o]+":"+h[t[o]]+";";return e}function z(h){switch(h){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function Ue(h){return h.search(/\.jpe?g($|\?)/i)>0||h.search(/^data\:image\/jpeg/)===0?"image/jpeg":h.search(/\.webp($|\?)/i)>0||h.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const Be=new f.Matrix4;class He{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new le,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let o=!1,n=!1,r=-1;typeof navigator<"u"&&(o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,n=navigator.userAgent.indexOf("Firefox")>-1,r=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||o||n&&r<98?this.textureLoader=new f.TextureLoader(this.options.manager):this.textureLoader=new f.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new f.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const o=this,n=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(s){return s._markDefs&&s._markDefs()}),Promise.all(this._invokeAll(function(s){return s.beforeRoot&&s.beforeRoot()})).then(function(){return Promise.all([o.getDependencies("scene"),o.getDependencies("animation"),o.getDependencies("camera")])}).then(function(s){const a={scene:s[0][n.scene||0],scenes:s[0],animations:s[1],cameras:s[2],asset:n.asset,parser:o,userData:{}};return P(r,a,n),O(a,n),Promise.all(o._invokeAll(function(i){return i.afterRoot&&i.afterRoot(a)})).then(function(){for(const i of a.scenes)i.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],o=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){const s=t[n].joints;for(let a=0,i=s.length;a<i;a++)e[s[a]].isBone=!0}for(let n=0,r=e.length;n<r;n++){const s=e[n];s.mesh!==void 0&&(this._addNodeRef(this.meshCache,s.mesh),s.skin!==void 0&&(o[s.mesh].isSkinnedMesh=!0)),s.camera!==void 0&&this._addNodeRef(this.cameraCache,s.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,o){if(e.refs[t]<=1)return o;const n=o.clone(),r=(s,a)=>{const i=this.associations.get(s);i!=null&&this.associations.set(a,i);for(const[c,l]of s.children.entries())r(l,a.children[c])};return r(o,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let o=0;o<t.length;o++){const n=e(t[o]);if(n)return n}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const o=[];for(let n=0;n<t.length;n++){const r=e(t[n]);r&&o.push(r)}return o}getDependency(e,t){const o=e+":"+t;let n=this.cache.get(o);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(r){return r.loadNode&&r.loadNode(t)});break;case"mesh":n=this._invokeOne(function(r){return r.loadMesh&&r.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(r){return r.loadBufferView&&r.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(r){return r.loadMaterial&&r.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(r){return r.loadTexture&&r.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(r){return r.loadAnimation&&r.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(n=this._invokeOne(function(r){return r!=this&&r.getDependency&&r.getDependency(e,t)}),!n)throw new Error("Unknown type: "+e);break}this.cache.add(o,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){const o=this,n=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(n.map(function(r,s){return o.getDependency(e,s)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],o=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[b.KHR_BINARY_GLTF].body);const n=this.options;return new Promise(function(r,s){o.load(f.LoaderUtils.resolveURL(t.uri,n.path),r,void 0,function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(o){const n=t.byteLength||0,r=t.byteOffset||0;return o.slice(r,r+n)})}loadAccessor(e){const t=this,o=this.json,n=this.json.accessors[e];if(n.bufferView===void 0&&n.sparse===void 0){const s=j[n.type],a=F[n.componentType],i=n.normalized===!0,c=new a(n.count*s);return Promise.resolve(new f.BufferAttribute(c,s,i))}const r=[];return n.bufferView!==void 0?r.push(this.getDependency("bufferView",n.bufferView)):r.push(null),n.sparse!==void 0&&(r.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(r).then(function(s){const a=s[0],i=j[n.type],c=F[n.componentType],l=c.BYTES_PER_ELEMENT,u=l*i,d=n.byteOffset||0,g=n.bufferView!==void 0?o.bufferViews[n.bufferView].byteStride:void 0,y=n.normalized===!0;let S,R;if(g&&g!==u){const x=Math.floor(d/g),L="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+x+":"+n.count;let E=t.cache.get(L);E||(S=new c(a,x*g,n.count*g/l),E=new f.InterleavedBuffer(S,g/l),t.cache.add(L,E)),R=new f.InterleavedBufferAttribute(E,i,d%g/l,y)}else a===null?S=new c(n.count*i):S=new c(a,d,n.count*i),R=new f.BufferAttribute(S,i,y);if(n.sparse!==void 0){const x=j.SCALAR,L=F[n.sparse.indices.componentType],E=n.sparse.indices.byteOffset||0,_=n.sparse.values.byteOffset||0,C=new L(s[1],E,n.sparse.count*x),I=new c(s[2],_,n.sparse.count*i);a!==null&&(R=new f.BufferAttribute(R.array.slice(),R.itemSize,R.normalized));for(let M=0,p=C.length;M<p;M++){const m=C[M];if(R.setX(m,I[M*i]),i>=2&&R.setY(m,I[M*i+1]),i>=3&&R.setZ(m,I[M*i+2]),i>=4&&R.setW(m,I[M*i+3]),i>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return R})}loadTexture(e){const t=this.json,o=this.options,r=t.textures[e].source,s=t.images[r];let a=this.textureLoader;if(s.uri){const i=o.manager.getHandler(s.uri);i!==null&&(a=i)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,o){const n=this,r=this.json,s=r.textures[e],a=r.images[t],i=(a.uri||a.bufferView)+":"+s.sampler;if(this.textureCache[i])return this.textureCache[i];const c=this.loadImageSource(t,o).then(function(l){l.flipY=!1,l.name=s.name||a.name||"",l.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(l.name=a.uri);const d=(r.samplers||{})[s.sampler]||{};return l.magFilter=$[d.magFilter]||f.LinearFilter,l.minFilter=$[d.minFilter]||f.LinearMipmapLinearFilter,l.wrapS=ee[d.wrapS]||f.RepeatWrapping,l.wrapT=ee[d.wrapT]||f.RepeatWrapping,n.associations.set(l,{textures:e}),l}).catch(function(){return null});return this.textureCache[i]=c,c}loadImageSource(e,t){const o=this,n=this.json,r=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(u=>u.clone());const s=n.images[e],a=self.URL||self.webkitURL;let i=s.uri||"",c=!1;if(s.bufferView!==void 0)i=o.getDependency("bufferView",s.bufferView).then(function(u){c=!0;const d=new Blob([u],{type:s.mimeType});return i=a.createObjectURL(d),i});else if(s.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const l=Promise.resolve(i).then(function(u){return new Promise(function(d,g){let y=d;t.isImageBitmapLoader===!0&&(y=function(S){const R=new f.Texture(S);R.needsUpdate=!0,d(R)}),t.load(f.LoaderUtils.resolveURL(u,r.path),y,void 0,g)})}).then(function(u){return c===!0&&a.revokeObjectURL(i),u.userData.mimeType=s.mimeType||Ue(s.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",i),u});return this.sourceCache[e]=l,l}assignTexture(e,t,o,n){const r=this;return this.getDependency("texture",o.index).then(function(s){if(!s)return null;if(o.texCoord!==void 0&&o.texCoord>0&&(s=s.clone(),s.channel=o.texCoord),r.extensions[b.KHR_TEXTURE_TRANSFORM]){const a=o.extensions!==void 0?o.extensions[b.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const i=r.associations.get(s);s=r.extensions[b.KHR_TEXTURE_TRANSFORM].extendTexture(s,a),r.associations.set(s,i)}}return n!==void 0&&(s.colorSpace=n),e[t]=s,s})}assignFinalMaterial(e){const t=e.geometry;let o=e.material;const n=t.attributes.tangent===void 0,r=t.attributes.color!==void 0,s=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+o.uuid;let i=this.cache.get(a);i||(i=new f.PointsMaterial,f.Material.prototype.copy.call(i,o),i.color.copy(o.color),i.map=o.map,i.sizeAttenuation=!1,this.cache.add(a,i)),o=i}else if(e.isLine){const a="LineBasicMaterial:"+o.uuid;let i=this.cache.get(a);i||(i=new f.LineBasicMaterial,f.Material.prototype.copy.call(i,o),i.color.copy(o.color),i.map=o.map,this.cache.add(a,i)),o=i}if(n||r||s){let a="ClonedMaterial:"+o.uuid+":";n&&(a+="derivative-tangents:"),r&&(a+="vertex-colors:"),s&&(a+="flat-shading:");let i=this.cache.get(a);i||(i=o.clone(),r&&(i.vertexColors=!0),s&&(i.flatShading=!0),n&&(i.normalScale&&(i.normalScale.y*=-1),i.clearcoatNormalScale&&(i.clearcoatNormalScale.y*=-1)),this.cache.add(a,i),this.associations.set(i,this.associations.get(o))),o=i}e.material=o}getMaterialType(){return f.MeshStandardMaterial}loadMaterial(e){const t=this,o=this.json,n=this.extensions,r=o.materials[e];let s;const a={},i=r.extensions||{},c=[];if(i[b.KHR_MATERIALS_UNLIT]){const u=n[b.KHR_MATERIALS_UNLIT];s=u.getMaterialType(),c.push(u.extendParams(a,r,t))}else{const u=r.pbrMetallicRoughness||{};if(a.color=new f.Color(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){const d=u.baseColorFactor;a.color.setRGB(d[0],d[1],d[2],f.LinearSRGBColorSpace),a.opacity=d[3]}u.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",u.baseColorTexture,f.SRGBColorSpace)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),s=this._invokeOne(function(d){return d.getMaterialType&&d.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(d){return d.extendMaterialParams&&d.extendMaterialParams(e,a)})))}r.doubleSided===!0&&(a.side=f.DoubleSide);const l=r.alphaMode||K.OPAQUE;if(l===K.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,l===K.MASK&&(a.alphaTest=r.alphaCutoff!==void 0?r.alphaCutoff:.5)),r.normalTexture!==void 0&&s!==f.MeshBasicMaterial&&(c.push(t.assignTexture(a,"normalMap",r.normalTexture)),a.normalScale=new f.Vector2(1,1),r.normalTexture.scale!==void 0)){const u=r.normalTexture.scale;a.normalScale.set(u,u)}if(r.occlusionTexture!==void 0&&s!==f.MeshBasicMaterial&&(c.push(t.assignTexture(a,"aoMap",r.occlusionTexture)),r.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=r.occlusionTexture.strength)),r.emissiveFactor!==void 0&&s!==f.MeshBasicMaterial){const u=r.emissiveFactor;a.emissive=new f.Color().setRGB(u[0],u[1],u[2],f.LinearSRGBColorSpace)}return r.emissiveTexture!==void 0&&s!==f.MeshBasicMaterial&&c.push(t.assignTexture(a,"emissiveMap",r.emissiveTexture,f.SRGBColorSpace)),Promise.all(c).then(function(){const u=new s(a);return r.name&&(u.name=r.name),O(u,r),t.associations.set(u,{materials:e}),r.extensions&&P(n,u,r),u})}createUniqueName(e){const t=f.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,o=this.extensions,n=this.primitiveCache;function r(a){return o[b.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(i){return te(i,a,t)})}const s=[];for(let a=0,i=e.length;a<i;a++){const c=e[a],l=Ge(c),u=n[l];if(u)s.push(u.promise);else{let d;c.extensions&&c.extensions[b.KHR_DRACO_MESH_COMPRESSION]?d=r(c):d=te(new f.BufferGeometry,c,t),n[l]={primitive:c,promise:d},s.push(d)}}return Promise.all(s)}loadMesh(e){const t=this,o=this.json,n=this.extensions,r=o.meshes[e],s=r.primitives,a=[];for(let i=0,c=s.length;i<c;i++){const l=s[i].material===void 0?Pe(this.cache):this.getDependency("material",s[i].material);a.push(l)}return a.push(t.loadGeometries(s)),Promise.all(a).then(function(i){const c=i.slice(0,i.length-1),l=i[i.length-1],u=[];for(let g=0,y=l.length;g<y;g++){const S=l[g],R=s[g];let x;const L=c[g];if(R.mode===N.TRIANGLES||R.mode===N.TRIANGLE_STRIP||R.mode===N.TRIANGLE_FAN||R.mode===void 0)x=r.isSkinnedMesh===!0?new f.SkinnedMesh(S,L):new f.Mesh(S,L),x.isSkinnedMesh===!0&&x.normalizeSkinWeights(),R.mode===N.TRIANGLE_STRIP?x.geometry=Q(x.geometry,f.TriangleStripDrawMode):R.mode===N.TRIANGLE_FAN&&(x.geometry=Q(x.geometry,f.TriangleFanDrawMode));else if(R.mode===N.LINES)x=new f.LineSegments(S,L);else if(R.mode===N.LINE_STRIP)x=new f.Line(S,L);else if(R.mode===N.LINE_LOOP)x=new f.LineLoop(S,L);else if(R.mode===N.POINTS)x=new f.Points(S,L);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+R.mode);Object.keys(x.geometry.morphAttributes).length>0&&Fe(x,r),x.name=t.createUniqueName(r.name||"mesh_"+e),O(x,r),R.extensions&&P(n,x,R),t.assignFinalMaterial(x),u.push(x)}for(let g=0,y=u.length;g<y;g++)t.associations.set(u[g],{meshes:e,primitives:g});if(u.length===1)return r.extensions&&P(n,u[0],r),u[0];const d=new f.Group;r.extensions&&P(n,d,r),t.associations.set(d,{meshes:e});for(let g=0,y=u.length;g<y;g++)d.add(u[g]);return d})}loadCamera(e){let t;const o=this.json.cameras[e],n=o[o.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return o.type==="perspective"?t=new f.PerspectiveCamera(f.MathUtils.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):o.type==="orthographic"&&(t=new f.OrthographicCamera(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),o.name&&(t.name=this.createUniqueName(o.name)),O(t,o),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],o=[];for(let n=0,r=t.joints.length;n<r;n++)o.push(this._loadNodeShallow(t.joints[n]));return t.inverseBindMatrices!==void 0?o.push(this.getDependency("accessor",t.inverseBindMatrices)):o.push(null),Promise.all(o).then(function(n){const r=n.pop(),s=n,a=[],i=[];for(let c=0,l=s.length;c<l;c++){const u=s[c];if(u){a.push(u);const d=new f.Matrix4;r!==null&&d.fromArray(r.array,c*16),i.push(d)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[c])}return new f.Skeleton(a,i)})}loadAnimation(e){const t=this.json,o=this,n=t.animations[e],r=n.name?n.name:"animation_"+e,s=[],a=[],i=[],c=[],l=[];for(let u=0,d=n.channels.length;u<d;u++){const g=n.channels[u],y=n.samplers[g.sampler],S=g.target,R=S.node,x=n.parameters!==void 0?n.parameters[y.input]:y.input,L=n.parameters!==void 0?n.parameters[y.output]:y.output;S.node!==void 0&&(s.push(this.getDependency("node",R)),a.push(this.getDependency("accessor",x)),i.push(this.getDependency("accessor",L)),c.push(y),l.push(S))}return Promise.all([Promise.all(s),Promise.all(a),Promise.all(i),Promise.all(c),Promise.all(l)]).then(function(u){const d=u[0],g=u[1],y=u[2],S=u[3],R=u[4],x=[];for(let L=0,E=d.length;L<E;L++){const _=d[L],C=g[L],I=y[L],M=S[L],p=R[L];if(_===void 0)continue;_.updateMatrix&&_.updateMatrix();const m=o._createAnimationTracks(_,C,I,M,p);if(m)for(let A=0;A<m.length;A++)x.push(m[A])}return new f.AnimationClip(r,void 0,x)})}createNodeMesh(e){const t=this.json,o=this,n=t.nodes[e];return n.mesh===void 0?null:o.getDependency("mesh",n.mesh).then(function(r){const s=o._getNodeRef(o.meshCache,n.mesh,r);return n.weights!==void 0&&s.traverse(function(a){if(a.isMesh)for(let i=0,c=n.weights.length;i<c;i++)a.morphTargetInfluences[i]=n.weights[i]}),s})}loadNode(e){const t=this.json,o=this,n=t.nodes[e],r=o._loadNodeShallow(e),s=[],a=n.children||[];for(let c=0,l=a.length;c<l;c++)s.push(o.getDependency("node",a[c]));const i=n.skin===void 0?Promise.resolve(null):o.getDependency("skin",n.skin);return Promise.all([r,Promise.all(s),i]).then(function(c){const l=c[0],u=c[1],d=c[2];d!==null&&l.traverse(function(g){g.isSkinnedMesh&&g.bind(d,Be)});for(let g=0,y=u.length;g<y;g++)l.add(u[g]);return l})}_loadNodeShallow(e){const t=this.json,o=this.extensions,n=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const r=t.nodes[e],s=r.name?n.createUniqueName(r.name):"",a=[],i=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return i&&a.push(i),r.camera!==void 0&&a.push(n.getDependency("camera",r.camera).then(function(c){return n._getNodeRef(n.cameraCache,r.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){a.push(c)}),this.nodeCache[e]=Promise.all(a).then(function(c){let l;if(r.isBone===!0?l=new f.Bone:c.length>1?l=new f.Group:c.length===1?l=c[0]:l=new f.Object3D,l!==c[0])for(let u=0,d=c.length;u<d;u++)l.add(c[u]);if(r.name&&(l.userData.name=r.name,l.name=s),O(l,r),r.extensions&&P(o,l,r),r.matrix!==void 0){const u=new f.Matrix4;u.fromArray(r.matrix),l.applyMatrix4(u)}else r.translation!==void 0&&l.position.fromArray(r.translation),r.rotation!==void 0&&l.quaternion.fromArray(r.rotation),r.scale!==void 0&&l.scale.fromArray(r.scale);return n.associations.has(l)||n.associations.set(l,{}),n.associations.get(l).nodes=e,l}),this.nodeCache[e]}loadScene(e){const t=this.extensions,o=this.json.scenes[e],n=this,r=new f.Group;o.name&&(r.name=n.createUniqueName(o.name)),O(r,o),o.extensions&&P(t,r,o);const s=o.nodes||[],a=[];for(let i=0,c=s.length;i<c;i++)a.push(n.getDependency("node",s[i]));return Promise.all(a).then(function(i){for(let l=0,u=i.length;l<u;l++)r.add(i[l]);const c=l=>{const u=new Map;for(const[d,g]of n.associations)(d instanceof f.Material||d instanceof f.Texture)&&u.set(d,g);return l.traverse(d=>{const g=n.associations.get(d);g!=null&&u.set(d,g)}),u};return n.associations=c(r),r})}_createAnimationTracks(e,t,o,n,r){const s=[],a=e.name?e.name:e.uuid,i=[];D[r.path]===D.weights?e.traverse(function(d){d.morphTargetInfluences&&i.push(d.name?d.name:d.uuid)}):i.push(a);let c;switch(D[r.path]){case D.weights:c=f.NumberKeyframeTrack;break;case D.rotation:c=f.QuaternionKeyframeTrack;break;case D.position:case D.scale:c=f.VectorKeyframeTrack;break;default:switch(o.itemSize){case 1:c=f.NumberKeyframeTrack;break;case 2:case 3:default:c=f.VectorKeyframeTrack;break}break}const l=n.interpolation!==void 0?Oe[n.interpolation]:f.InterpolateLinear,u=this._getArrayFromAccessor(o);for(let d=0,g=i.length;d<g;d++){const y=new c(i[d]+"."+D[r.path],t.array,u,l);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(y),s.push(y)}return s}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const o=z(t.constructor),n=new Float32Array(t.length);for(let r=0,s=t.length;r<s;r++)n[r]=t[r]*o;t=n}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(o){const n=this instanceof f.QuaternionKeyframeTrack?De:se;return new n(this.times,this.values,this.getValueSize()/3,o)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function ve(h,e,t){const o=e.attributes,n=new f.Box3;if(o.POSITION!==void 0){const a=t.json.accessors[o.POSITION],i=a.min,c=a.max;if(i!==void 0&&c!==void 0){if(n.set(new f.Vector3(i[0],i[1],i[2]),new f.Vector3(c[0],c[1],c[2])),a.normalized){const l=z(F[a.componentType]);n.min.multiplyScalar(l),n.max.multiplyScalar(l)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const r=e.targets;if(r!==void 0){const a=new f.Vector3,i=new f.Vector3;for(let c=0,l=r.length;c<l;c++){const u=r[c];if(u.POSITION!==void 0){const d=t.json.accessors[u.POSITION],g=d.min,y=d.max;if(g!==void 0&&y!==void 0){if(i.setX(Math.max(Math.abs(g[0]),Math.abs(y[0]))),i.setY(Math.max(Math.abs(g[1]),Math.abs(y[1]))),i.setZ(Math.max(Math.abs(g[2]),Math.abs(y[2]))),d.normalized){const S=z(F[d.componentType]);i.multiplyScalar(S)}a.max(i)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}h.boundingBox=n;const s=new f.Sphere;n.getCenter(s.center),s.radius=n.min.distanceTo(n.max)/2,h.boundingSphere=s}function te(h,e,t){const o=e.attributes,n=[];function r(s,a){return t.getDependency("accessor",s).then(function(i){h.setAttribute(a,i)})}for(const s in o){const a=q[s]||s.toLowerCase();a in h.attributes||n.push(r(o[s],a))}if(e.indices!==void 0&&!h.index){const s=t.getDependency("accessor",e.indices).then(function(a){h.setIndex(a)});n.push(s)}return f.ColorManagement.workingColorSpace!==f.LinearSRGBColorSpace&&"COLOR_0"in o&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${f.ColorManagement.workingColorSpace}" not supported.`),O(h,e),ve(h,e,t),Promise.all(n).then(function(){return e.targets!==void 0?ke(h,e.targets,t):h})}class je{parse(e){const t={},o=e.split(`
|
|
2
|
+
`);let n=null,r=t;const s=[t];for(const a of o)if(a.includes("=")){const i=a.split("="),c=i[0].trim(),l=i[1].trim();if(l.endsWith("{")){const u={};s.push(u),r[c]=u,r=u}else r[c]=l}else if(a.endsWith("{")){const i=r[n]||{};s.push(i),r[n]=i,r=i}else if(a.endsWith("}")){if(s.pop(),s.length===0)continue;r=s[s.length-1]}else if(a.endsWith("(")){const i={};s.push(i),n=a.split("(")[0].trim()||n,r[n]=i,r=i}else a.endsWith(")")?(s.pop(),r=s[s.length-1]):n=a.trim();return t}}class Ke extends f.Loader{constructor(e){super(e)}load(e,t,o,n){const r=this,s=new f.FileLoader(r.manager);s.setPath(r.path),s.setResponseType("arraybuffer"),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(e,function(a){try{t(r.parse(a))}catch(i){n?n(i):console.error(i),r.manager.itemError(e)}},o,n)}parse(e){const t=new je;function o(p){const m={};new f.FileLoader().setResponseType("arraybuffer");for(const T in p){if(T.endsWith("png")){const w=new Blob([p[T]],{type:{type:"image/png"}});m[T]=URL.createObjectURL(w)}if(T.endsWith("usd")||T.endsWith("usda")){if(n(p[T])){console.warn("THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.");continue}const w=v.strFromU8(p[T]);m[T]=t.parse(w)}}return m}function n(p){const m=p.slice(0,7),A=new Uint8Array([80,88,82,45,85,83,68,67]);return m.every((T,w)=>T===A[w])}function r(p){if(p.length<1)return;const m=Object.keys(p)[0];let A=!1;if(m.endsWith("usda"))return p[m];if(m.endsWith("usdc"))A=!0;else if(m.endsWith("usd"))if(n(p[m]))A=!0;else return p[m];A&&console.warn("THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.")}const s=v.unzipSync(new Uint8Array(e)),a=o(s),i=r(s);if(i===void 0)return console.warn("THREE.USDZLoader: No usda file found."),new f.Group;const c=v.strFromU8(i),l=t.parse(c);function u(p){if(p){if("prepend references"in p){const A=p["prepend references"].split("@"),T=A[1].replace(/^.\//,""),w=A[2].replace(/^<\//,"").replace(/>$/,"");return d(a[T],w)}return d(p)}}function d(p,m){if(p){if(m!==void 0){const A=`def Mesh "${m}"`;if(A in p)return p[A]}for(const A in p){const T=p[A];if(A.startsWith("def Mesh"))return"point3f[] points"in p&&(T["point3f[] points"]=p["point3f[] points"]),"texCoord2f[] primvars:st"in p&&(T["texCoord2f[] primvars:st"]=p["texCoord2f[] primvars:st"]),"int[] primvars:st:indices"in p&&(T["int[] primvars:st:indices"]=p["int[] primvars:st:indices"]),T;if(typeof T=="object"){const w=d(T);if(w)return w}}}}function g(p){if(!p)return;let m=new f.BufferGeometry;if("int[] faceVertexIndices"in p){const A=JSON.parse(p["int[] faceVertexIndices"]);m.setIndex(A)}if("point3f[] points"in p){const A=JSON.parse(p["point3f[] points"].replace(/[()]*/g,"")),T=new f.BufferAttribute(new Float32Array(A),3);m.setAttribute("position",T)}if("normal3f[] normals"in p){const A=JSON.parse(p["normal3f[] normals"].replace(/[()]*/g,"")),T=new f.BufferAttribute(new Float32Array(A),3);m.setAttribute("normal",T)}else m.computeVertexNormals();if("float2[] primvars:st"in p&&(p["texCoord2f[] primvars:st"]=p["float2[] primvars:st"]),"texCoord2f[] primvars:st"in p){const A=JSON.parse(p["texCoord2f[] primvars:st"].replace(/[()]*/g,"")),T=new f.BufferAttribute(new Float32Array(A),2);if("int[] primvars:st:indices"in p){m=m.toNonIndexed();const w=JSON.parse(p["int[] primvars:st:indices"]);m.setAttribute("uv",y(T,w))}else m.setAttribute("uv",T)}return m}function y(p,m){const A=p.array,T=p.itemSize,w=new A.constructor(m.length*T);let Y=0,re=0;for(let H=0,oe=m.length;H<oe;H++){Y=m[H]*T;for(let J=0;J<T;J++)w[re++]=A[Y++]}return new f.BufferAttribute(w,T)}function S(p){if(p){if("rel material:binding"in p){const T=p["rel material:binding"].replace(/^<\//,"").replace(/>$/,"").split("/");return R(l,` "${T[1]}"`)}return R(p)}}function R(p,m=""){for(const A in p){const T=p[A];if(A.startsWith("def Material"+m))return T;if(typeof T=="object"){const w=R(T,m);if(w)return w}}}function x(p,m){m["float inputs:rotation"]&&(p.rotation=parseFloat(m["float inputs:rotation"])),m["float2 inputs:scale"]&&(p.repeat=new f.Vector2().fromArray(JSON.parse("["+m["float2 inputs:scale"].replace(/[()]*/g,"")+"]"))),m["float2 inputs:translation"]&&(p.offset=new f.Vector2().fromArray(JSON.parse("["+m["float2 inputs:translation"].replace(/[()]*/g,"")+"]")))}function L(p){const m=new f.MeshPhysicalMaterial;if(p!==void 0){if('def Shader "PreviewSurface"'in p){const A=p['def Shader "PreviewSurface"'];if("color3f inputs:diffuseColor.connect"in A){const T=A["color3f inputs:diffuseColor.connect"],w=E(l,/(\w+).output/.exec(T)[1]);m.map=_(w),m.map.colorSpace=f.SRGBColorSpace,'def Shader "Transform2d_diffuse"'in p&&x(m.map,p['def Shader "Transform2d_diffuse"'])}else if("color3f inputs:diffuseColor"in A){const T=A["color3f inputs:diffuseColor"].replace(/[()]*/g,"");m.color.fromArray(JSON.parse("["+T+"]"))}if("color3f inputs:emissiveColor.connect"in A){const T=A["color3f inputs:emissiveColor.connect"],w=E(l,/(\w+).output/.exec(T)[1]);m.emissiveMap=_(w),m.emissiveMap.colorSpace=f.SRGBColorSpace,m.emissive.set(16777215),'def Shader "Transform2d_emissive"'in p&&x(m.emissiveMap,p['def Shader "Transform2d_emissive"'])}else if("color3f inputs:emissiveColor"in A){const T=A["color3f inputs:emissiveColor"].replace(/[()]*/g,"");m.emissive.fromArray(JSON.parse("["+T+"]"))}if("normal3f inputs:normal.connect"in A){const T=A["normal3f inputs:normal.connect"],w=E(l,/(\w+).output/.exec(T)[1]);m.normalMap=_(w),m.normalMap.colorSpace=f.NoColorSpace,'def Shader "Transform2d_normal"'in p&&x(m.normalMap,p['def Shader "Transform2d_normal"'])}if("float inputs:roughness.connect"in A){const T=A["float inputs:roughness.connect"],w=E(l,/(\w+).output/.exec(T)[1]);m.roughness=1,m.roughnessMap=_(w),m.roughnessMap.colorSpace=f.NoColorSpace,'def Shader "Transform2d_roughness"'in p&&x(m.roughnessMap,p['def Shader "Transform2d_roughness"'])}else"float inputs:roughness"in A&&(m.roughness=parseFloat(A["float inputs:roughness"]));if("float inputs:metallic.connect"in A){const T=A["float inputs:metallic.connect"],w=E(l,/(\w+).output/.exec(T)[1]);m.metalness=1,m.metalnessMap=_(w),m.metalnessMap.colorSpace=f.NoColorSpace,'def Shader "Transform2d_metallic"'in p&&x(m.metalnessMap,p['def Shader "Transform2d_metallic"'])}else"float inputs:metallic"in A&&(m.metalness=parseFloat(A["float inputs:metallic"]));if("float inputs:clearcoat.connect"in A){const T=A["float inputs:clearcoat.connect"],w=E(l,/(\w+).output/.exec(T)[1]);m.clearcoat=1,m.clearcoatMap=_(w),m.clearcoatMap.colorSpace=f.NoColorSpace,'def Shader "Transform2d_clearcoat"'in p&&x(m.clearcoatMap,p['def Shader "Transform2d_clearcoat"'])}else"float inputs:clearcoat"in A&&(m.clearcoat=parseFloat(A["float inputs:clearcoat"]));if("float inputs:clearcoatRoughness.connect"in A){const T=A["float inputs:clearcoatRoughness.connect"],w=E(l,/(\w+).output/.exec(T)[1]);m.clearcoatRoughness=1,m.clearcoatRoughnessMap=_(w),m.clearcoatRoughnessMap.colorSpace=f.NoColorSpace,'def Shader "Transform2d_clearcoatRoughness"'in p&&x(m.clearcoatRoughnessMap,p['def Shader "Transform2d_clearcoatRoughness"'])}else"float inputs:clearcoatRoughness"in A&&(m.clearcoatRoughness=parseFloat(A["float inputs:clearcoatRoughness"]));if("float inputs:ior"in A&&(m.ior=parseFloat(A["float inputs:ior"])),"float inputs:occlusion.connect"in A){const T=A["float inputs:occlusion.connect"],w=E(l,/(\w+).output/.exec(T)[1]);m.aoMap=_(w),m.aoMap.colorSpace=f.NoColorSpace,'def Shader "Transform2d_occlusion"'in p&&x(m.aoMap,p['def Shader "Transform2d_occlusion"'])}}if('def Shader "diffuseColor_texture"'in p){const A=p['def Shader "diffuseColor_texture"'];m.map=_(A),m.map.colorSpace=f.SRGBColorSpace}if('def Shader "normal_texture"'in p){const A=p['def Shader "normal_texture"'];m.normalMap=_(A),m.normalMap.colorSpace=f.NoColorSpace}}return m}function E(p,m){for(const A in p){const T=p[A];if(A.startsWith(`def Shader "${m}"`))return T;if(typeof T=="object"){const w=E(T,m);if(w)return w}}}function _(p){if("asset inputs:file"in p){const m=p["asset inputs:file"].replace(/@*/g,""),T=new f.TextureLoader().load(a[m]),w={'"clamp"':f.ClampToEdgeWrapping,'"mirror"':f.MirroredRepeatWrapping,'"repeat"':f.RepeatWrapping};return"token inputs:wrapS"in p&&(T.wrapS=w[p["token inputs:wrapS"]]),"token inputs:wrapT"in p&&(T.wrapT=w[p["token inputs:wrapT"]]),T}return null}function C(p){const m=g(u(p)),A=L(S(p)),T=m?new f.Mesh(m,A):new f.Object3D;if("matrix4d xformOp:transform"in p){const w=JSON.parse("["+p["matrix4d xformOp:transform"].replace(/[()]*/g,"")+"]");T.matrix.fromArray(w),T.matrix.decompose(T.position,T.quaternion,T.scale)}return T}function I(p,m){for(const A in p)if(A.startsWith("def Scope"))I(p[A],m);else if(A.startsWith("def Xform")){const T=C(p[A]);/def Xform "(\w+)"/.test(A)&&(T.name=/def Xform "(\w+)"/.exec(A)[1]),m.add(T),I(p[A],T)}}const M=new f.Group;return I(l,M),M}}const W=new WeakMap;class Ve extends f.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,o,n){const r=new f.FileLoader(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,s=>{this.parse(s,t,n)},o,n)}parse(e,t,o=()=>{}){this.decodeDracoFile(e,t,null,null,f.SRGBColorSpace).catch(o)}decodeDracoFile(e,t,o,n,r=f.LinearSRGBColorSpace,s=()=>{}){const a={attributeIDs:o||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!o,vertexColorSpace:r};return this.decodeGeometry(e,a).then(t).catch(s)}decodeGeometry(e,t){const o=JSON.stringify(t);if(W.has(e)){const i=W.get(e);if(i.key===o)return i.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n;const r=this.workerNextTaskID++,s=e.byteLength,a=this._getWorker(r,s).then(i=>(n=i,new Promise((c,l)=>{n._callbacks[r]={resolve:c,reject:l},n.postMessage({type:"decode",id:r,taskConfig:t,buffer:e},[e])}))).then(i=>this._createGeometry(i.geometry));return a.catch(()=>!0).then(()=>{n&&r&&this._releaseTask(n,r)}),W.set(e,{key:o,promise:a}),a}_createGeometry(e){const t=new f.BufferGeometry;e.index&&t.setIndex(new f.BufferAttribute(e.index.array,1));for(let o=0;o<e.attributes.length;o++){const n=e.attributes[o],r=n.name,s=n.array,a=n.itemSize,i=new f.BufferAttribute(s,a);r==="color"&&(this._assignVertexColorSpace(i,n.vertexColorSpace),i.normalized=!(s instanceof Float32Array)),t.setAttribute(r,i)}return t}_assignVertexColorSpace(e,t){if(t!==f.SRGBColorSpace)return;const o=new f.Color;for(let n=0,r=e.count;n<r;n++)o.fromBufferAttribute(e,n).convertSRGBToLinear(),e.setXYZ(n,o.r,o.g,o.b)}_loadLibrary(e,t){const o=new f.FileLoader(this.manager);return o.setPath(this.decoderPath),o.setResponseType(t),o.setWithCredentials(this.withCredentials),new Promise((n,r)=>{o.load(e,n,void 0,r)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(o=>{const n=o[0];e||(this.decoderConfig.wasmBinary=o[1]);const r=We.toString(),s=["/* draco decoder */",n,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join(`
|
|
3
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(r){const s=r.data;switch(s.type){case"decode":n._callbacks[s.id].resolve(s);break;case"error":n._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,r){return n._taskLoad>r._taskLoad?-1:1});const o=this.workerPool[this.workerPool.length-1];return o._taskCosts[e]=t,o._taskLoad+=t,o})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}}function We(){let h,e;onmessage=function(s){const a=s.data;switch(a.type){case"init":h=a.decoderConfig,e=new Promise(function(l){h.onModuleLoaded=function(u){l({draco:u})},DracoDecoderModule(h)});break;case"decode":const i=a.buffer,c=a.taskConfig;e.then(l=>{const u=l.draco,d=new u.Decoder;try{const g=t(u,d,new Int8Array(i),c),y=g.attributes.map(S=>S.array.buffer);g.index&&y.push(g.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:g},y)}catch(g){console.error(g),self.postMessage({type:"error",id:a.id,error:g.message})}finally{u.destroy(d)}});break}};function t(s,a,i,c){const l=c.attributeIDs,u=c.attributeTypes;let d,g;const y=a.GetEncodedGeometryType(i);if(y===s.TRIANGULAR_MESH)d=new s.Mesh,g=a.DecodeArrayToMesh(i,i.byteLength,d);else if(y===s.POINT_CLOUD)d=new s.PointCloud,g=a.DecodeArrayToPointCloud(i,i.byteLength,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!g.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+g.error_msg());const S={index:null,attributes:[]};for(const R in l){const x=self[u[R]];let L,E;if(c.useUniqueIDs)E=l[R],L=a.GetAttributeByUniqueId(d,E);else{if(E=a.GetAttributeId(d,s[l[R]]),E===-1)continue;L=a.GetAttribute(d,E)}const _=n(s,a,d,R,x,L);R==="color"&&(_.vertexColorSpace=c.vertexColorSpace),S.attributes.push(_)}return y===s.TRIANGULAR_MESH&&(S.index=o(s,a,d)),s.destroy(d),S}function o(s,a,i){const l=i.num_faces()*3,u=l*4,d=s._malloc(u);a.GetTrianglesUInt32Array(i,u,d);const g=new Uint32Array(s.HEAPF32.buffer,d,l).slice();return s._free(d),{array:g,itemSize:1}}function n(s,a,i,c,l,u){const d=u.num_components(),y=i.num_points()*d,S=y*l.BYTES_PER_ELEMENT,R=r(s,l),x=s._malloc(S);a.GetAttributeDataArrayForAllPoints(i,u,R,S,x);const L=new l(s.HEAPF32.buffer,x,y).slice();return s._free(x),{name:c,array:L,itemSize:d}}function r(s,a){switch(a){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}function Xe(){let h,e;onmessage=function(s){const a=s.data;switch(a.type){case"init":h=a.decoderConfig,e=new Promise(function(l){h.onModuleLoaded=function(u){l({draco:u})},DracoDecoderModule(h)});break;case"decode":const i=a.buffer,c=a.taskConfig;e.then(l=>{const u=l.draco,d=new u.Decoder;try{const g=t(u,d,new Int8Array(i),c),y=g.attributes.map(S=>S.array.buffer);g.index&&y.push(g.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:g},y)}catch(g){console.error(g),self.postMessage({type:"error",id:a.id,error:g.message})}finally{u.destroy(d)}});break}};function t(s,a,i,c){const l=c.attributeIDs,u=c.attributeTypes;let d,g;const y=a.GetEncodedGeometryType(i);if(y===s.TRIANGULAR_MESH)d=new s.Mesh,g=a.DecodeArrayToMesh(i,i.byteLength,d);else if(y===s.POINT_CLOUD)d=new s.PointCloud,g=a.DecodeArrayToPointCloud(i,i.byteLength,d);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!g.ok()||d.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+g.error_msg());const S={index:null,attributes:[]};for(const R in l){const x=self[u[R]];let L,E;if(c.useUniqueIDs)E=l[R],L=a.GetAttributeByUniqueId(d,E);else{if(E=a.GetAttributeId(d,s[l[R]]),E===-1)continue;L=a.GetAttribute(d,E)}const _=n(s,a,d,R,x,L);R==="color"&&(_.vertexColorSpace=c.vertexColorSpace),S.attributes.push(_)}return y===s.TRIANGULAR_MESH&&(S.index=o(s,a,d)),s.destroy(d),S}function o(s,a,i){const l=i.num_faces()*3,u=l*4,d=s._malloc(u);a.GetTrianglesUInt32Array(i,u,d);const g=new Uint32Array(s.HEAPF32.buffer,d,l).slice();return s._free(d),{array:g,itemSize:1}}function n(s,a,i,c,l,u){const d=u.num_components(),y=i.num_points()*d,S=y*l.BYTES_PER_ELEMENT,R=r(s,l),x=s._malloc(S);a.GetAttributeDataArrayForAllPoints(i,u,R,S,x);const L=new l(s.HEAPF32.buffer,x,y).slice();return s._free(x),{name:c,array:L,itemSize:d}}function r(s,a){switch(a){case Float32Array:return s.DT_FLOAT32;case Int8Array:return s.DT_INT8;case Int16Array:return s.DT_INT16;case Int32Array:return s.DT_INT32;case Uint8Array:return s.DT_UINT8;case Uint16Array:return s.DT_UINT16;case Uint32Array:return s.DT_UINT32}}}const X={LOAD_DRACO_JS_DECODER:async()=>(await Promise.resolve().then(()=>require("./draco_decoder-DvYjcLz_.cjs"))).default,LOAD_DRACO_WASM_WRAPPER:async()=>(await Promise.resolve().then(()=>require("./draco_wasm_wrapper-FoEVV9af.cjs"))).default,LOAD_DRACO_WASM_DECODER:async()=>{const h=(await Promise.resolve().then(()=>require("./draco_decoder-Bh9flJPu.cjs"))).default;return await(await fetch(h)).arrayBuffer()}};class qe extends Ve{constructor(){super(...arguments);k(this,"decoderPending",null);k(this,"decoderConfig",{type:"js",wasmBinary:null});k(this,"workerSourceURL","")}async _initDecoder(){if(this.decoderPending)return this.decoderPending;const t=typeof WebAssembly!="object"||this.decoderConfig.type==="js",o=[];return t?o.push(X.LOAD_DRACO_JS_DECODER()):(o.push(X.LOAD_DRACO_WASM_WRAPPER()),o.push(X.LOAD_DRACO_WASM_DECODER())),this.decoderPending=Promise.all(o).then(n=>{const r=n[0];t||(this.decoderConfig.wasmBinary=n[1]);const s=Xe.toString(),a=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(`
|
|
4
|
+
`);this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending}}class ze{constructor(){k(this,"_gltfLoader");k(this,"_usdzLoader");const e=new qe;e.setDecoderConfig({type:"wasm"}),this._gltfLoader=new ce,this._gltfLoader.setDRACOLoader(e),this._usdzLoader=new Ke}async _loadFile(e){const t=await fetch(e);if(!t.ok)throw new G.NetworkError(e,`Failed to fetch file from ${e}`);try{return await t.arrayBuffer()}catch{throw new G.NetworkError(e,`Failed to fetch file from ${e}`)}}async load(e){const t=G.getFileTypeFromUri(e);if(t.length===0)throw new B.FileTypeError("No file extension found in URI","");if(!G.isFileTypeSupported(t))throw new B.FileTypeError(`Unsupported file type: ${t}. Supported types: ${G.SUPPORTED_FILE_TYPES.join(", ")}`,t);const o=await this._loadFile(e);try{switch(t){case"glb":case"gltf":return(await this._gltfLoader.parseAsync(o,"")).scene;case"usdz":return await this._usdzLoader.parse(o)}}catch(n){throw n instanceof Error?new B.ParseError(`Failed to parse ${t} file: ${n.message}`,n):new B.ParseError(`Failed to parse ${t} file`)}}}exports.AssetLoader=ze;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var x=Object.defineProperty;var p=(t,r,e)=>r in t?x(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e;var i=(t,r,e)=>p(t,typeof r!="symbol"?r+"":r,e);const s=require("three"),d=require("three-spritetext"),a=require("./VisibilityLayerMask-BI7jPKdx.cjs"),o=require("./AxisHelperColors-BrGqktN5.cjs");class A extends s.OrthographicCamera{constructor(e,_,c){super(-1,1,1,-1,.1,100);i(this,"axesHelper");i(this,"_renderer");i(this,"_scene");i(this,"_camera");i(this,"_restoreViewport",new s.Vector4);this.layers.mask=a.COORDINATE_LAYER_MASK,this.axesHelper=new s.AxesHelper(.5),this.axesHelper.layers.mask=a.COORDINATE_LAYER_MASK,this.axesHelper.material.depthTest=!1,this.axesHelper.position.set(0,0,-1),this.axesHelper.setColors(new s.Color(o.AxesColorRed),new s.Color(o.AxesColorGreen),new s.Color(o.AxesColorBlue));const n=new d("X",.2,o.AxesColorRedLetter),l=new d("Y",.2,o.AxesColorGreenLetter),h=new d("Z",.2,o.AxesColorBlueLetter);n.layers.mask=a.COORDINATE_LAYER_MASK,l.layers.mask=a.COORDINATE_LAYER_MASK,h.layers.mask=a.COORDINATE_LAYER_MASK,n.position.set(.7,0,0),l.position.set(0,.7,0),h.position.set(0,0,.7),this.axesHelper.add(n),this.axesHelper.add(l),this.axesHelper.add(h),this.add(this.axesHelper),this._renderer=e,this._scene=_,this._camera=c,this._scene.add(this)}tick(){const e=this._scene.background;this._scene.background=null,this._renderer.webglrenderer.getViewport(this._restoreViewport),this._renderer.webglrenderer.setViewport(0,0,150,150),this._renderer.webglrenderer.autoClear=!1,this.setFromCameraMatrix(this._camera.matrix),this._renderer.webglrenderer.render(this._scene,this),this._renderer.webglrenderer.setViewport(this._restoreViewport),this._renderer.webglrenderer.autoClear=!0,this._scene.background=e}dispose(){this._scene.remove(this)}setFromCameraMatrix(e){this.axesHelper.rotation.setFromRotationMatrix(new s.Matrix4().extractRotation(e).invert())}}exports.DIVEAxisCamera=A;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var c = (s, r, e) => r in s ? x(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
|
|
3
|
+
var t = (s, r, e) => c(s, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { OrthographicCamera as m, Vector4 as _, AxesHelper as w, Color as l, Matrix4 as C } from "three";
|
|
5
|
+
import h from "three-spritetext";
|
|
6
|
+
import { C as a } from "./VisibilityLayerMask-CXgt1fJc.mjs";
|
|
7
|
+
import { A as g, a as u, b as A, c as H, d as b, e as k } from "./AxisHelperColors-JLBHYQDi.mjs";
|
|
8
|
+
class L extends m {
|
|
9
|
+
constructor(e, d, p) {
|
|
10
|
+
super(-1, 1, 1, -1, 0.1, 100);
|
|
11
|
+
t(this, "axesHelper");
|
|
12
|
+
t(this, "_renderer");
|
|
13
|
+
t(this, "_scene");
|
|
14
|
+
t(this, "_camera");
|
|
15
|
+
t(this, "_restoreViewport", new _());
|
|
16
|
+
this.layers.mask = a, this.axesHelper = new w(0.5), this.axesHelper.layers.mask = a, this.axesHelper.material.depthTest = !1, this.axesHelper.position.set(0, 0, -1), this.axesHelper.setColors(
|
|
17
|
+
new l(g),
|
|
18
|
+
new l(u),
|
|
19
|
+
new l(A)
|
|
20
|
+
);
|
|
21
|
+
const o = new h("X", 0.2, H), i = new h("Y", 0.2, b), n = new h("Z", 0.2, k);
|
|
22
|
+
o.layers.mask = a, i.layers.mask = a, n.layers.mask = a, o.position.set(0.7, 0, 0), i.position.set(0, 0.7, 0), n.position.set(0, 0, 0.7), this.axesHelper.add(o), this.axesHelper.add(i), this.axesHelper.add(n), this.add(this.axesHelper), this._renderer = e, this._scene = d, this._camera = p, this._scene.add(this);
|
|
23
|
+
}
|
|
24
|
+
tick() {
|
|
25
|
+
const e = this._scene.background;
|
|
26
|
+
this._scene.background = null, this._renderer.webglrenderer.getViewport(this._restoreViewport), this._renderer.webglrenderer.setViewport(0, 0, 150, 150), this._renderer.webglrenderer.autoClear = !1, this.setFromCameraMatrix(this._camera.matrix), this._renderer.webglrenderer.render(this._scene, this), this._renderer.webglrenderer.setViewport(this._restoreViewport), this._renderer.webglrenderer.autoClear = !0, this._scene.background = e;
|
|
27
|
+
}
|
|
28
|
+
dispose() {
|
|
29
|
+
this._scene.remove(this);
|
|
30
|
+
}
|
|
31
|
+
setFromCameraMatrix(e) {
|
|
32
|
+
this.axesHelper.rotation.setFromRotationMatrix(
|
|
33
|
+
new C().extractRotation(e).invert()
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
L as D
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e="#c20017",o="#00ab26",r="#0081d4",s=e,t=o,l=r;exports.AxesColorBlue=l;exports.AxesColorBlueLetter=r;exports.AxesColorGreen=t;exports.AxesColorGreenLetter=o;exports.AxesColorRed=s;exports.AxesColorRedLetter=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _=Object.defineProperty;var d=(t,e,r)=>e in t?_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var n=(t,e,r)=>d(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./PerspectiveCamera-BByyG5R4.cjs");class h{constructor(e,r,o){n(this,"_renderer");n(this,"_scene");n(this,"_controller");this._renderer=e,this._scene=r,this._controller=o}generateMedia(e,r,o,s){const c=this._controller.object.position.clone(),l=this._controller.object.quaternion.clone();this._renderer.onResize(o,s),this._controller.object.onResize(o,s),this._controller.object.position.copy(e),this._controller.target.copy(r),this._controller.update();const a=this.drawCanvas().toDataURL();return this._controller.object.position.copy(c),this._controller.object.quaternion.copy(l),a}drawCanvas(e){const r=this._renderer.webglrenderer.domElement;e&&(this._renderer.webglrenderer.domElement=e),this._controller.object.layers.mask=i.DIVEPerspectiveCamera.LIVE_VIEW_LAYER_MASK,this._renderer.webglrenderer.render(this._scene,this._controller.object),this._controller.object.layers.mask=i.DIVEPerspectiveCamera.EDITOR_VIEW_LAYER_MASK;const o=this._renderer.webglrenderer.domElement;return e&&(this._renderer.webglrenderer.domElement=r),o}}exports.MediaCreator=h;
|
package/build/{src/modules/mediacreator/MediaCreator.mjs → chunks/MediaCreator-psLAAyJA.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var a = Object.defineProperty;
|
|
2
2
|
var d = (t, e, r) => e in t ? a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var n = (t, e, r) => d(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import {
|
|
4
|
+
import { D as i } from "./PerspectiveCamera-PMJPzAn3.mjs";
|
|
5
5
|
class m {
|
|
6
6
|
constructor(e, r, o) {
|
|
7
7
|
n(this, "_renderer");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const a = {
|
|
2
|
+
AnimationSystem: async () => (await import("./AnimationSystem-Bf-xhqRe.mjs").then((t) => t.b)).AnimationSystem,
|
|
3
|
+
ARSystem: async () => (await import("./ARSystem-D27w7Pck.mjs").then((t) => t.g)).ARSystem,
|
|
4
|
+
AssetConverter: async () => (await import("./AssetConverter-D-qOTLs1.mjs")).AssetConverter,
|
|
5
|
+
AssetExporter: async () => (await import("./AssetExporter-ClYQ4gnb.mjs")).AssetExporter,
|
|
6
|
+
AssetLoader: async () => (await import("./AssetLoader-BewzFwHi.mjs")).AssetLoader,
|
|
7
|
+
MediaCreator: async () => (await import("./MediaCreator-psLAAyJA.mjs")).MediaCreator,
|
|
8
|
+
State: async () => (await import("./State-BNgqNPrs.mjs")).State,
|
|
9
|
+
Toolbox: async () => (await import("./Toolbox-DKuyL8n5.mjs")).Toolbox
|
|
10
|
+
}, e = async (t) => await a[t]();
|
|
11
|
+
export {
|
|
12
|
+
e as g
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t={AnimationSystem:async()=>(await Promise.resolve().then(()=>require("./AnimationSystem-DFUYMNpj.cjs")).then(e=>e.AnimationSystem$1)).AnimationSystem,ARSystem:async()=>(await Promise.resolve().then(()=>require("./ARSystem-_0cLAxyG.cjs")).then(e=>e.ARSystem$1)).ARSystem,AssetConverter:async()=>(await Promise.resolve().then(()=>require("./AssetConverter-BTAb23e8.cjs"))).AssetConverter,AssetExporter:async()=>(await Promise.resolve().then(()=>require("./AssetExporter-CAqADFbL.cjs"))).AssetExporter,AssetLoader:async()=>(await Promise.resolve().then(()=>require("./AssetLoader-Bq-Ekxil.cjs"))).AssetLoader,MediaCreator:async()=>(await Promise.resolve().then(()=>require("./MediaCreator-CEWeS42n.cjs"))).MediaCreator,State:async()=>(await Promise.resolve().then(()=>require("./State-Mvu0hG-n.cjs"))).State,Toolbox:async()=>(await Promise.resolve().then(()=>require("./Toolbox-qFN47t2F.cjs"))).Toolbox},r=async e=>await t[e]();exports.getModule=r;
|