@ericchen1990/pano-view 3.0.0 → 3.1.1
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/README.md +50 -4
- package/README.zh-CN.md +47 -4
- package/dist/index.cjs +1145 -957
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +34 -8
- package/dist/index.d.ts +34 -8
- package/dist/index.mjs +548 -360
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +0 -34
- package/package.json +12 -3
package/dist/index.mjs
CHANGED
|
@@ -40,7 +40,7 @@ var require_howler = __commonJS({
|
|
|
40
40
|
* @return {Howler}
|
|
41
41
|
*/
|
|
42
42
|
init: function() {
|
|
43
|
-
var self = this ||
|
|
43
|
+
var self = this || Howler4;
|
|
44
44
|
self._counter = 1e3;
|
|
45
45
|
self._html5AudioPool = [];
|
|
46
46
|
self.html5PoolSize = 10;
|
|
@@ -65,7 +65,7 @@ var require_howler = __commonJS({
|
|
|
65
65
|
* @return {Howler/Float} Returns self or current volume.
|
|
66
66
|
*/
|
|
67
67
|
volume: function(vol) {
|
|
68
|
-
var self = this ||
|
|
68
|
+
var self = this || Howler4;
|
|
69
69
|
vol = parseFloat(vol);
|
|
70
70
|
if (!self.ctx) {
|
|
71
71
|
setupAudioContext();
|
|
@@ -76,7 +76,7 @@ var require_howler = __commonJS({
|
|
|
76
76
|
return self;
|
|
77
77
|
}
|
|
78
78
|
if (self.usingWebAudio) {
|
|
79
|
-
self.masterGain.gain.setValueAtTime(vol,
|
|
79
|
+
self.masterGain.gain.setValueAtTime(vol, Howler4.ctx.currentTime);
|
|
80
80
|
}
|
|
81
81
|
for (var i = 0; i < self._howls.length; i++) {
|
|
82
82
|
if (!self._howls[i]._webAudio) {
|
|
@@ -98,13 +98,13 @@ var require_howler = __commonJS({
|
|
|
98
98
|
* @param {Boolean} muted Is muted or not.
|
|
99
99
|
*/
|
|
100
100
|
mute: function(muted) {
|
|
101
|
-
var self = this ||
|
|
101
|
+
var self = this || Howler4;
|
|
102
102
|
if (!self.ctx) {
|
|
103
103
|
setupAudioContext();
|
|
104
104
|
}
|
|
105
105
|
self._muted = muted;
|
|
106
106
|
if (self.usingWebAudio) {
|
|
107
|
-
self.masterGain.gain.setValueAtTime(muted ? 0 : self._volume,
|
|
107
|
+
self.masterGain.gain.setValueAtTime(muted ? 0 : self._volume, Howler4.ctx.currentTime);
|
|
108
108
|
}
|
|
109
109
|
for (var i = 0; i < self._howls.length; i++) {
|
|
110
110
|
if (!self._howls[i]._webAudio) {
|
|
@@ -123,7 +123,7 @@ var require_howler = __commonJS({
|
|
|
123
123
|
* Handle stopping all sounds globally.
|
|
124
124
|
*/
|
|
125
125
|
stop: function() {
|
|
126
|
-
var self = this ||
|
|
126
|
+
var self = this || Howler4;
|
|
127
127
|
for (var i = 0; i < self._howls.length; i++) {
|
|
128
128
|
self._howls[i].stop();
|
|
129
129
|
}
|
|
@@ -134,7 +134,7 @@ var require_howler = __commonJS({
|
|
|
134
134
|
* @return {Howler}
|
|
135
135
|
*/
|
|
136
136
|
unload: function() {
|
|
137
|
-
var self = this ||
|
|
137
|
+
var self = this || Howler4;
|
|
138
138
|
for (var i = self._howls.length - 1; i >= 0; i--) {
|
|
139
139
|
self._howls[i].unload();
|
|
140
140
|
}
|
|
@@ -151,14 +151,14 @@ var require_howler = __commonJS({
|
|
|
151
151
|
* @return {Boolean}
|
|
152
152
|
*/
|
|
153
153
|
codecs: function(ext) {
|
|
154
|
-
return (this ||
|
|
154
|
+
return (this || Howler4)._codecs[ext.replace(/^x-/, "")];
|
|
155
155
|
},
|
|
156
156
|
/**
|
|
157
157
|
* Setup various state values for global tracking.
|
|
158
158
|
* @return {Howler}
|
|
159
159
|
*/
|
|
160
160
|
_setup: function() {
|
|
161
|
-
var self = this ||
|
|
161
|
+
var self = this || Howler4;
|
|
162
162
|
self.state = self.ctx ? self.ctx.state || "suspended" : "suspended";
|
|
163
163
|
self._autoSuspend();
|
|
164
164
|
if (!self.usingWebAudio) {
|
|
@@ -192,7 +192,7 @@ var require_howler = __commonJS({
|
|
|
192
192
|
* @return {Howler}
|
|
193
193
|
*/
|
|
194
194
|
_setupCodecs: function() {
|
|
195
|
-
var self = this ||
|
|
195
|
+
var self = this || Howler4;
|
|
196
196
|
var audioTest = null;
|
|
197
197
|
try {
|
|
198
198
|
audioTest = typeof Audio !== "undefined" ? new Audio() : null;
|
|
@@ -235,7 +235,7 @@ var require_howler = __commonJS({
|
|
|
235
235
|
* @return {Howler}
|
|
236
236
|
*/
|
|
237
237
|
_unlockAudio: function() {
|
|
238
|
-
var self = this ||
|
|
238
|
+
var self = this || Howler4;
|
|
239
239
|
if (self._audioUnlocked || !self.ctx) {
|
|
240
240
|
return;
|
|
241
241
|
}
|
|
@@ -305,7 +305,7 @@ var require_howler = __commonJS({
|
|
|
305
305
|
* @return {Audio} HTML5 Audio object.
|
|
306
306
|
*/
|
|
307
307
|
_obtainHtml5Audio: function() {
|
|
308
|
-
var self = this ||
|
|
308
|
+
var self = this || Howler4;
|
|
309
309
|
if (self._html5AudioPool.length) {
|
|
310
310
|
return self._html5AudioPool.pop();
|
|
311
311
|
}
|
|
@@ -322,7 +322,7 @@ var require_howler = __commonJS({
|
|
|
322
322
|
* @return {Howler}
|
|
323
323
|
*/
|
|
324
324
|
_releaseHtml5Audio: function(audio) {
|
|
325
|
-
var self = this ||
|
|
325
|
+
var self = this || Howler4;
|
|
326
326
|
if (audio._unlocked) {
|
|
327
327
|
self._html5AudioPool.push(audio);
|
|
328
328
|
}
|
|
@@ -335,7 +335,7 @@ var require_howler = __commonJS({
|
|
|
335
335
|
*/
|
|
336
336
|
_autoSuspend: function() {
|
|
337
337
|
var self = this;
|
|
338
|
-
if (!self.autoSuspend || !self.ctx || typeof self.ctx.suspend === "undefined" || !
|
|
338
|
+
if (!self.autoSuspend || !self.ctx || typeof self.ctx.suspend === "undefined" || !Howler4.usingWebAudio) {
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
341
|
for (var i = 0; i < self._howls.length; i++) {
|
|
@@ -373,7 +373,7 @@ var require_howler = __commonJS({
|
|
|
373
373
|
*/
|
|
374
374
|
_autoResume: function() {
|
|
375
375
|
var self = this;
|
|
376
|
-
if (!self.ctx || typeof self.ctx.resume === "undefined" || !
|
|
376
|
+
if (!self.ctx || typeof self.ctx.resume === "undefined" || !Howler4.usingWebAudio) {
|
|
377
377
|
return;
|
|
378
378
|
}
|
|
379
379
|
if (self.state === "running" && self.ctx.state !== "interrupted" && self._suspendTimer) {
|
|
@@ -396,7 +396,7 @@ var require_howler = __commonJS({
|
|
|
396
396
|
return self;
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
|
-
var
|
|
399
|
+
var Howler4 = new HowlerGlobal2();
|
|
400
400
|
var Howl3 = function(o) {
|
|
401
401
|
var self = this;
|
|
402
402
|
if (!o.src || o.src.length === 0) {
|
|
@@ -413,7 +413,7 @@ var require_howler = __commonJS({
|
|
|
413
413
|
*/
|
|
414
414
|
init: function(o) {
|
|
415
415
|
var self = this;
|
|
416
|
-
if (!
|
|
416
|
+
if (!Howler4.ctx) {
|
|
417
417
|
setupAudioContext();
|
|
418
418
|
}
|
|
419
419
|
self._autoplay = o.autoplay || false;
|
|
@@ -452,11 +452,11 @@ var require_howler = __commonJS({
|
|
|
452
452
|
self._onseek = o.onseek ? [{ fn: o.onseek }] : [];
|
|
453
453
|
self._onunlock = o.onunlock ? [{ fn: o.onunlock }] : [];
|
|
454
454
|
self._onresume = [];
|
|
455
|
-
self._webAudio =
|
|
456
|
-
if (typeof
|
|
457
|
-
|
|
455
|
+
self._webAudio = Howler4.usingWebAudio && !self._html5;
|
|
456
|
+
if (typeof Howler4.ctx !== "undefined" && Howler4.ctx && Howler4.autoUnlock) {
|
|
457
|
+
Howler4._unlockAudio();
|
|
458
458
|
}
|
|
459
|
-
|
|
459
|
+
Howler4._howls.push(self);
|
|
460
460
|
if (self._autoplay) {
|
|
461
461
|
self._queue.push({
|
|
462
462
|
event: "play",
|
|
@@ -477,7 +477,7 @@ var require_howler = __commonJS({
|
|
|
477
477
|
load: function() {
|
|
478
478
|
var self = this;
|
|
479
479
|
var url = null;
|
|
480
|
-
if (
|
|
480
|
+
if (Howler4.noAudio) {
|
|
481
481
|
self._emit("loaderror", null, "No audio support.");
|
|
482
482
|
return;
|
|
483
483
|
}
|
|
@@ -505,7 +505,7 @@ var require_howler = __commonJS({
|
|
|
505
505
|
if (!ext) {
|
|
506
506
|
console.warn('No file extension was found. Consider using the "format" property or specify an extension.');
|
|
507
507
|
}
|
|
508
|
-
if (ext &&
|
|
508
|
+
if (ext && Howler4.codecs(ext)) {
|
|
509
509
|
url = self._src[i];
|
|
510
510
|
break;
|
|
511
511
|
}
|
|
@@ -583,7 +583,7 @@ var require_howler = __commonJS({
|
|
|
583
583
|
return sound._id;
|
|
584
584
|
}
|
|
585
585
|
if (self._webAudio) {
|
|
586
|
-
|
|
586
|
+
Howler4._autoResume();
|
|
587
587
|
}
|
|
588
588
|
var seek = Math.max(0, sound._seek > 0 ? sound._seek : self._sprite[sprite][0] / 1e3);
|
|
589
589
|
var duration = Math.max(0, (self._sprite[sprite][0] + self._sprite[sprite][1]) / 1e3 - seek);
|
|
@@ -610,8 +610,8 @@ var require_howler = __commonJS({
|
|
|
610
610
|
setParams();
|
|
611
611
|
self._refreshBuffer(sound);
|
|
612
612
|
var vol = sound._muted || self._muted ? 0 : sound._volume;
|
|
613
|
-
node.gain.setValueAtTime(vol,
|
|
614
|
-
sound._playStart =
|
|
613
|
+
node.gain.setValueAtTime(vol, Howler4.ctx.currentTime);
|
|
614
|
+
sound._playStart = Howler4.ctx.currentTime;
|
|
615
615
|
if (typeof node.bufferSource.start === "undefined") {
|
|
616
616
|
sound._loop ? node.bufferSource.noteGrainOn(0, seek, 86400) : node.bufferSource.noteGrainOn(0, seek, duration);
|
|
617
617
|
} else {
|
|
@@ -627,7 +627,7 @@ var require_howler = __commonJS({
|
|
|
627
627
|
}, 0);
|
|
628
628
|
}
|
|
629
629
|
};
|
|
630
|
-
if (
|
|
630
|
+
if (Howler4.state === "running" && Howler4.ctx.state !== "interrupted") {
|
|
631
631
|
playWebAudio();
|
|
632
632
|
} else {
|
|
633
633
|
self._playLock = true;
|
|
@@ -637,8 +637,8 @@ var require_howler = __commonJS({
|
|
|
637
637
|
} else {
|
|
638
638
|
var playHtml5 = function() {
|
|
639
639
|
node.currentTime = seek;
|
|
640
|
-
node.muted = sound._muted || self._muted ||
|
|
641
|
-
node.volume = sound._volume *
|
|
640
|
+
node.muted = sound._muted || self._muted || Howler4._muted || node.muted;
|
|
641
|
+
node.volume = sound._volume * Howler4.volume();
|
|
642
642
|
node.playbackRate = sound._rate;
|
|
643
643
|
try {
|
|
644
644
|
var play = node.play();
|
|
@@ -686,7 +686,7 @@ var require_howler = __commonJS({
|
|
|
686
686
|
node.src = self._src;
|
|
687
687
|
node.load();
|
|
688
688
|
}
|
|
689
|
-
var loadedNoReadyState = window && window.ejecta || !node.readyState &&
|
|
689
|
+
var loadedNoReadyState = window && window.ejecta || !node.readyState && Howler4._navigator.isCocoonJS;
|
|
690
690
|
if (node.readyState >= 3 || loadedNoReadyState) {
|
|
691
691
|
playHtml5();
|
|
692
692
|
} else {
|
|
@@ -695,9 +695,9 @@ var require_howler = __commonJS({
|
|
|
695
695
|
var listener = function() {
|
|
696
696
|
self._state = "loaded";
|
|
697
697
|
playHtml5();
|
|
698
|
-
node.removeEventListener(
|
|
698
|
+
node.removeEventListener(Howler4._canPlayEvent, listener, false);
|
|
699
699
|
};
|
|
700
|
-
node.addEventListener(
|
|
700
|
+
node.addEventListener(Howler4._canPlayEvent, listener, false);
|
|
701
701
|
self._clearTimer(sound._id);
|
|
702
702
|
}
|
|
703
703
|
}
|
|
@@ -835,9 +835,9 @@ var require_howler = __commonJS({
|
|
|
835
835
|
self._stopFade(sound._id);
|
|
836
836
|
}
|
|
837
837
|
if (self._webAudio && sound._node) {
|
|
838
|
-
sound._node.gain.setValueAtTime(muted ? 0 : sound._volume,
|
|
838
|
+
sound._node.gain.setValueAtTime(muted ? 0 : sound._volume, Howler4.ctx.currentTime);
|
|
839
839
|
} else if (sound._node) {
|
|
840
|
-
sound._node.muted =
|
|
840
|
+
sound._node.muted = Howler4._muted ? true : muted;
|
|
841
841
|
}
|
|
842
842
|
self._emit("mute", sound._id);
|
|
843
843
|
}
|
|
@@ -893,9 +893,9 @@ var require_howler = __commonJS({
|
|
|
893
893
|
self._stopFade(id[i]);
|
|
894
894
|
}
|
|
895
895
|
if (self._webAudio && sound._node && !sound._muted) {
|
|
896
|
-
sound._node.gain.setValueAtTime(vol,
|
|
896
|
+
sound._node.gain.setValueAtTime(vol, Howler4.ctx.currentTime);
|
|
897
897
|
} else if (sound._node && !sound._muted) {
|
|
898
|
-
sound._node.volume = vol *
|
|
898
|
+
sound._node.volume = vol * Howler4.volume();
|
|
899
899
|
}
|
|
900
900
|
self._emit("volume", sound._id);
|
|
901
901
|
}
|
|
@@ -937,7 +937,7 @@ var require_howler = __commonJS({
|
|
|
937
937
|
self._stopFade(ids[i]);
|
|
938
938
|
}
|
|
939
939
|
if (self._webAudio && !sound._muted) {
|
|
940
|
-
var currentTime =
|
|
940
|
+
var currentTime = Howler4.ctx.currentTime;
|
|
941
941
|
var end = currentTime + len / 1e3;
|
|
942
942
|
sound._volume = from;
|
|
943
943
|
sound._node.gain.setValueAtTime(from, currentTime);
|
|
@@ -1003,7 +1003,7 @@ var require_howler = __commonJS({
|
|
|
1003
1003
|
var sound = self._soundById(id);
|
|
1004
1004
|
if (sound && sound._interval) {
|
|
1005
1005
|
if (self._webAudio) {
|
|
1006
|
-
sound._node.gain.cancelScheduledValues(
|
|
1006
|
+
sound._node.gain.cancelScheduledValues(Howler4.ctx.currentTime);
|
|
1007
1007
|
}
|
|
1008
1008
|
clearInterval(sound._interval);
|
|
1009
1009
|
sound._interval = null;
|
|
@@ -1105,11 +1105,11 @@ var require_howler = __commonJS({
|
|
|
1105
1105
|
if (sound) {
|
|
1106
1106
|
if (self.playing(id[i])) {
|
|
1107
1107
|
sound._rateSeek = self.seek(id[i]);
|
|
1108
|
-
sound._playStart = self._webAudio ?
|
|
1108
|
+
sound._playStart = self._webAudio ? Howler4.ctx.currentTime : sound._playStart;
|
|
1109
1109
|
}
|
|
1110
1110
|
sound._rate = rate;
|
|
1111
1111
|
if (self._webAudio && sound._node && sound._node.bufferSource) {
|
|
1112
|
-
sound._node.bufferSource.playbackRate.setValueAtTime(rate,
|
|
1112
|
+
sound._node.bufferSource.playbackRate.setValueAtTime(rate, Howler4.ctx.currentTime);
|
|
1113
1113
|
} else if (sound._node) {
|
|
1114
1114
|
sound._node.playbackRate = rate;
|
|
1115
1115
|
}
|
|
@@ -1203,7 +1203,7 @@ var require_howler = __commonJS({
|
|
|
1203
1203
|
}
|
|
1204
1204
|
} else {
|
|
1205
1205
|
if (self._webAudio) {
|
|
1206
|
-
var realTime = self.playing(id) ?
|
|
1206
|
+
var realTime = self.playing(id) ? Howler4.ctx.currentTime - sound._playStart : 0;
|
|
1207
1207
|
var rateSeek = sound._rateSeek ? sound._rateSeek - sound._seek : 0;
|
|
1208
1208
|
return sound._seek + (rateSeek + realTime * Math.abs(sound._rate));
|
|
1209
1209
|
} else {
|
|
@@ -1266,20 +1266,20 @@ var require_howler = __commonJS({
|
|
|
1266
1266
|
if (!self._webAudio) {
|
|
1267
1267
|
self._clearSound(sounds[i]._node);
|
|
1268
1268
|
sounds[i]._node.removeEventListener("error", sounds[i]._errorFn, false);
|
|
1269
|
-
sounds[i]._node.removeEventListener(
|
|
1269
|
+
sounds[i]._node.removeEventListener(Howler4._canPlayEvent, sounds[i]._loadFn, false);
|
|
1270
1270
|
sounds[i]._node.removeEventListener("ended", sounds[i]._endFn, false);
|
|
1271
|
-
|
|
1271
|
+
Howler4._releaseHtml5Audio(sounds[i]._node);
|
|
1272
1272
|
}
|
|
1273
1273
|
delete sounds[i]._node;
|
|
1274
1274
|
self._clearTimer(sounds[i]._id);
|
|
1275
1275
|
}
|
|
1276
|
-
var index =
|
|
1276
|
+
var index = Howler4._howls.indexOf(self);
|
|
1277
1277
|
if (index >= 0) {
|
|
1278
|
-
|
|
1278
|
+
Howler4._howls.splice(index, 1);
|
|
1279
1279
|
}
|
|
1280
1280
|
var remCache = true;
|
|
1281
|
-
for (i = 0; i <
|
|
1282
|
-
if (
|
|
1281
|
+
for (i = 0; i < Howler4._howls.length; i++) {
|
|
1282
|
+
if (Howler4._howls[i]._src === self._src || self._src.indexOf(Howler4._howls[i]._src) >= 0) {
|
|
1283
1283
|
remCache = false;
|
|
1284
1284
|
break;
|
|
1285
1285
|
}
|
|
@@ -1287,7 +1287,7 @@ var require_howler = __commonJS({
|
|
|
1287
1287
|
if (cache && remCache) {
|
|
1288
1288
|
delete cache[self._src];
|
|
1289
1289
|
}
|
|
1290
|
-
|
|
1290
|
+
Howler4.noAudio = false;
|
|
1291
1291
|
self._state = "unloaded";
|
|
1292
1292
|
self._sounds = [];
|
|
1293
1293
|
self = null;
|
|
@@ -1420,7 +1420,7 @@ var require_howler = __commonJS({
|
|
|
1420
1420
|
self._emit("play", sound._id);
|
|
1421
1421
|
sound._seek = sound._start || 0;
|
|
1422
1422
|
sound._rateSeek = 0;
|
|
1423
|
-
sound._playStart =
|
|
1423
|
+
sound._playStart = Howler4.ctx.currentTime;
|
|
1424
1424
|
var timeout = (sound._stop - sound._start) * 1e3 / Math.abs(sound._rate);
|
|
1425
1425
|
self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout);
|
|
1426
1426
|
}
|
|
@@ -1431,7 +1431,7 @@ var require_howler = __commonJS({
|
|
|
1431
1431
|
sound._rateSeek = 0;
|
|
1432
1432
|
self._clearTimer(sound._id);
|
|
1433
1433
|
self._cleanBuffer(sound._node);
|
|
1434
|
-
|
|
1434
|
+
Howler4._autoSuspend();
|
|
1435
1435
|
}
|
|
1436
1436
|
if (!self._webAudio && !loop) {
|
|
1437
1437
|
self.stop(sound._id, true);
|
|
@@ -1539,7 +1539,7 @@ var require_howler = __commonJS({
|
|
|
1539
1539
|
*/
|
|
1540
1540
|
_refreshBuffer: function(sound) {
|
|
1541
1541
|
var self = this;
|
|
1542
|
-
sound._node.bufferSource =
|
|
1542
|
+
sound._node.bufferSource = Howler4.ctx.createBufferSource();
|
|
1543
1543
|
sound._node.bufferSource.buffer = cache[self._src];
|
|
1544
1544
|
if (sound._panner) {
|
|
1545
1545
|
sound._node.bufferSource.connect(sound._panner);
|
|
@@ -1551,7 +1551,7 @@ var require_howler = __commonJS({
|
|
|
1551
1551
|
sound._node.bufferSource.loopStart = sound._start || 0;
|
|
1552
1552
|
sound._node.bufferSource.loopEnd = sound._stop || 0;
|
|
1553
1553
|
}
|
|
1554
|
-
sound._node.bufferSource.playbackRate.setValueAtTime(sound._rate,
|
|
1554
|
+
sound._node.bufferSource.playbackRate.setValueAtTime(sound._rate, Howler4.ctx.currentTime);
|
|
1555
1555
|
return self;
|
|
1556
1556
|
},
|
|
1557
1557
|
/**
|
|
@@ -1561,16 +1561,16 @@ var require_howler = __commonJS({
|
|
|
1561
1561
|
*/
|
|
1562
1562
|
_cleanBuffer: function(node) {
|
|
1563
1563
|
var self = this;
|
|
1564
|
-
var isIOS =
|
|
1564
|
+
var isIOS = Howler4._navigator && Howler4._navigator.vendor.indexOf("Apple") >= 0;
|
|
1565
1565
|
if (!node.bufferSource) {
|
|
1566
1566
|
return self;
|
|
1567
1567
|
}
|
|
1568
|
-
if (
|
|
1568
|
+
if (Howler4._scratchBuffer && node.bufferSource) {
|
|
1569
1569
|
node.bufferSource.onended = null;
|
|
1570
1570
|
node.bufferSource.disconnect(0);
|
|
1571
1571
|
if (isIOS) {
|
|
1572
1572
|
try {
|
|
1573
|
-
node.bufferSource.buffer =
|
|
1573
|
+
node.bufferSource.buffer = Howler4._scratchBuffer;
|
|
1574
1574
|
} catch (e) {
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
@@ -1583,7 +1583,7 @@ var require_howler = __commonJS({
|
|
|
1583
1583
|
* @param {Object} node Audio node to clear.
|
|
1584
1584
|
*/
|
|
1585
1585
|
_clearSound: function(node) {
|
|
1586
|
-
var checkIE = /MSIE |Trident\//.test(
|
|
1586
|
+
var checkIE = /MSIE |Trident\//.test(Howler4._navigator && Howler4._navigator.userAgent);
|
|
1587
1587
|
if (!checkIE) {
|
|
1588
1588
|
node.src = "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA";
|
|
1589
1589
|
}
|
|
@@ -1609,7 +1609,7 @@ var require_howler = __commonJS({
|
|
|
1609
1609
|
self._paused = true;
|
|
1610
1610
|
self._ended = true;
|
|
1611
1611
|
self._sprite = "__default";
|
|
1612
|
-
self._id = ++
|
|
1612
|
+
self._id = ++Howler4._counter;
|
|
1613
1613
|
parent._sounds.push(self);
|
|
1614
1614
|
self.create();
|
|
1615
1615
|
return self;
|
|
@@ -1621,23 +1621,23 @@ var require_howler = __commonJS({
|
|
|
1621
1621
|
create: function() {
|
|
1622
1622
|
var self = this;
|
|
1623
1623
|
var parent = self._parent;
|
|
1624
|
-
var volume =
|
|
1624
|
+
var volume = Howler4._muted || self._muted || self._parent._muted ? 0 : self._volume;
|
|
1625
1625
|
if (parent._webAudio) {
|
|
1626
|
-
self._node = typeof
|
|
1627
|
-
self._node.gain.setValueAtTime(volume,
|
|
1626
|
+
self._node = typeof Howler4.ctx.createGain === "undefined" ? Howler4.ctx.createGainNode() : Howler4.ctx.createGain();
|
|
1627
|
+
self._node.gain.setValueAtTime(volume, Howler4.ctx.currentTime);
|
|
1628
1628
|
self._node.paused = true;
|
|
1629
|
-
self._node.connect(
|
|
1630
|
-
} else if (!
|
|
1631
|
-
self._node =
|
|
1629
|
+
self._node.connect(Howler4.masterGain);
|
|
1630
|
+
} else if (!Howler4.noAudio) {
|
|
1631
|
+
self._node = Howler4._obtainHtml5Audio();
|
|
1632
1632
|
self._errorFn = self._errorListener.bind(self);
|
|
1633
1633
|
self._node.addEventListener("error", self._errorFn, false);
|
|
1634
1634
|
self._loadFn = self._loadListener.bind(self);
|
|
1635
|
-
self._node.addEventListener(
|
|
1635
|
+
self._node.addEventListener(Howler4._canPlayEvent, self._loadFn, false);
|
|
1636
1636
|
self._endFn = self._endListener.bind(self);
|
|
1637
1637
|
self._node.addEventListener("ended", self._endFn, false);
|
|
1638
1638
|
self._node.src = parent._src;
|
|
1639
1639
|
self._node.preload = parent._preload === true ? "auto" : parent._preload;
|
|
1640
|
-
self._node.volume = volume *
|
|
1640
|
+
self._node.volume = volume * Howler4.volume();
|
|
1641
1641
|
self._node.load();
|
|
1642
1642
|
}
|
|
1643
1643
|
return self;
|
|
@@ -1658,7 +1658,7 @@ var require_howler = __commonJS({
|
|
|
1658
1658
|
self._paused = true;
|
|
1659
1659
|
self._ended = true;
|
|
1660
1660
|
self._sprite = "__default";
|
|
1661
|
-
self._id = ++
|
|
1661
|
+
self._id = ++Howler4._counter;
|
|
1662
1662
|
return self;
|
|
1663
1663
|
},
|
|
1664
1664
|
/**
|
|
@@ -1684,7 +1684,7 @@ var require_howler = __commonJS({
|
|
|
1684
1684
|
parent._emit("load");
|
|
1685
1685
|
parent._loadQueue();
|
|
1686
1686
|
}
|
|
1687
|
-
self._node.removeEventListener(
|
|
1687
|
+
self._node.removeEventListener(Howler4._canPlayEvent, self._loadFn, false);
|
|
1688
1688
|
},
|
|
1689
1689
|
/**
|
|
1690
1690
|
* HTML5 Audio ended listener callback.
|
|
@@ -1766,10 +1766,10 @@ var require_howler = __commonJS({
|
|
|
1766
1766
|
error();
|
|
1767
1767
|
}
|
|
1768
1768
|
};
|
|
1769
|
-
if (typeof Promise !== "undefined" &&
|
|
1770
|
-
|
|
1769
|
+
if (typeof Promise !== "undefined" && Howler4.ctx.decodeAudioData.length === 1) {
|
|
1770
|
+
Howler4.ctx.decodeAudioData(arraybuffer).then(success).catch(error);
|
|
1771
1771
|
} else {
|
|
1772
|
-
|
|
1772
|
+
Howler4.ctx.decodeAudioData(arraybuffer, success, error);
|
|
1773
1773
|
}
|
|
1774
1774
|
};
|
|
1775
1775
|
var loadSound = function(self, buffer) {
|
|
@@ -1786,59 +1786,59 @@ var require_howler = __commonJS({
|
|
|
1786
1786
|
}
|
|
1787
1787
|
};
|
|
1788
1788
|
var setupAudioContext = function() {
|
|
1789
|
-
if (!
|
|
1789
|
+
if (!Howler4.usingWebAudio) {
|
|
1790
1790
|
return;
|
|
1791
1791
|
}
|
|
1792
1792
|
try {
|
|
1793
1793
|
if (typeof AudioContext !== "undefined") {
|
|
1794
|
-
|
|
1794
|
+
Howler4.ctx = new AudioContext();
|
|
1795
1795
|
} else if (typeof webkitAudioContext !== "undefined") {
|
|
1796
|
-
|
|
1796
|
+
Howler4.ctx = new webkitAudioContext();
|
|
1797
1797
|
} else {
|
|
1798
|
-
|
|
1798
|
+
Howler4.usingWebAudio = false;
|
|
1799
1799
|
}
|
|
1800
1800
|
} catch (e) {
|
|
1801
|
-
|
|
1801
|
+
Howler4.usingWebAudio = false;
|
|
1802
1802
|
}
|
|
1803
|
-
if (!
|
|
1804
|
-
|
|
1803
|
+
if (!Howler4.ctx) {
|
|
1804
|
+
Howler4.usingWebAudio = false;
|
|
1805
1805
|
}
|
|
1806
|
-
var iOS = /iP(hone|od|ad)/.test(
|
|
1807
|
-
var appVersion =
|
|
1806
|
+
var iOS = /iP(hone|od|ad)/.test(Howler4._navigator && Howler4._navigator.platform);
|
|
1807
|
+
var appVersion = Howler4._navigator && Howler4._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);
|
|
1808
1808
|
var version = appVersion ? parseInt(appVersion[1], 10) : null;
|
|
1809
1809
|
if (iOS && version && version < 9) {
|
|
1810
|
-
var safari = /safari/.test(
|
|
1811
|
-
if (
|
|
1812
|
-
|
|
1810
|
+
var safari = /safari/.test(Howler4._navigator && Howler4._navigator.userAgent.toLowerCase());
|
|
1811
|
+
if (Howler4._navigator && !safari) {
|
|
1812
|
+
Howler4.usingWebAudio = false;
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
1815
|
-
if (
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1815
|
+
if (Howler4.usingWebAudio) {
|
|
1816
|
+
Howler4.masterGain = typeof Howler4.ctx.createGain === "undefined" ? Howler4.ctx.createGainNode() : Howler4.ctx.createGain();
|
|
1817
|
+
Howler4.masterGain.gain.setValueAtTime(Howler4._muted ? 0 : Howler4._volume, Howler4.ctx.currentTime);
|
|
1818
|
+
Howler4.masterGain.connect(Howler4.ctx.destination);
|
|
1819
1819
|
}
|
|
1820
|
-
|
|
1820
|
+
Howler4._setup();
|
|
1821
1821
|
};
|
|
1822
1822
|
if (typeof define === "function" && define.amd) {
|
|
1823
1823
|
define([], function() {
|
|
1824
1824
|
return {
|
|
1825
|
-
Howler:
|
|
1825
|
+
Howler: Howler4,
|
|
1826
1826
|
Howl: Howl3
|
|
1827
1827
|
};
|
|
1828
1828
|
});
|
|
1829
1829
|
}
|
|
1830
1830
|
if (typeof exports !== "undefined") {
|
|
1831
|
-
exports.Howler =
|
|
1831
|
+
exports.Howler = Howler4;
|
|
1832
1832
|
exports.Howl = Howl3;
|
|
1833
1833
|
}
|
|
1834
1834
|
if (typeof global !== "undefined") {
|
|
1835
1835
|
global.HowlerGlobal = HowlerGlobal2;
|
|
1836
|
-
global.Howler =
|
|
1836
|
+
global.Howler = Howler4;
|
|
1837
1837
|
global.Howl = Howl3;
|
|
1838
1838
|
global.Sound = Sound2;
|
|
1839
1839
|
} else if (typeof window !== "undefined") {
|
|
1840
1840
|
window.HowlerGlobal = HowlerGlobal2;
|
|
1841
|
-
window.Howler =
|
|
1841
|
+
window.Howler = Howler4;
|
|
1842
1842
|
window.Howl = Howl3;
|
|
1843
1843
|
window.Sound = Sound2;
|
|
1844
1844
|
}
|
|
@@ -2452,6 +2452,7 @@ var DEFAULT_ROTATE_DAMPING = 14;
|
|
|
2452
2452
|
var DEFAULT_ZOOM_DAMPING = 16;
|
|
2453
2453
|
var DEFAULT_FRICTION_STOP = 0.01;
|
|
2454
2454
|
var VIEW_SETTLE_EPSILON = 1e-3;
|
|
2455
|
+
var DEFAULT_NAVIGATION_DURATION = 700;
|
|
2455
2456
|
var PanoramaViewContext = createContext3(null);
|
|
2456
2457
|
function clamp(value, min, max) {
|
|
2457
2458
|
return Math.max(min, Math.min(max, value));
|
|
@@ -2471,6 +2472,15 @@ function resolveDamping(value, fallback) {
|
|
|
2471
2472
|
function resolveFrictionStop(value) {
|
|
2472
2473
|
return Number.isFinite(value) && value >= 0 ? value : DEFAULT_FRICTION_STOP;
|
|
2473
2474
|
}
|
|
2475
|
+
function resolveNavigationDuration(value) {
|
|
2476
|
+
return Number.isFinite(value) && value >= 0 ? value : DEFAULT_NAVIGATION_DURATION;
|
|
2477
|
+
}
|
|
2478
|
+
function applyNavigationEasing(progress, easing) {
|
|
2479
|
+
if (easing === "linear") {
|
|
2480
|
+
return progress;
|
|
2481
|
+
}
|
|
2482
|
+
return progress < 0.5 ? 4 * progress * progress * progress : 1 - Math.pow(-2 * progress + 2, 3) / 2;
|
|
2483
|
+
}
|
|
2474
2484
|
function viewsEqual(a, b) {
|
|
2475
2485
|
return a.yaw === b.yaw && a.pitch === b.pitch && a.fov === b.fov;
|
|
2476
2486
|
}
|
|
@@ -2504,13 +2514,14 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2504
2514
|
const xrEulerRef = useRef(new Euler(0, 0, 0, "YXZ"));
|
|
2505
2515
|
const minFovRef = useRef(minFov);
|
|
2506
2516
|
const maxFovRef = useRef(maxFov);
|
|
2517
|
+
const activeNavigationRef = useRef(null);
|
|
2507
2518
|
optionsRef.current = options;
|
|
2508
2519
|
eventBusRef.current = eventBus;
|
|
2509
2520
|
xrSessionRef.current = xrSession;
|
|
2510
2521
|
minFovRef.current = minFov;
|
|
2511
2522
|
maxFovRef.current = maxFov;
|
|
2512
2523
|
const hasInertia = () => yawVelocityRef.current !== 0 || pitchVelocityRef.current !== 0 || zoomVelocityRef.current !== 0;
|
|
2513
|
-
const isUserInteracting = () => mouseActiveRef.current || touchActiveRef.current || keyboardActiveRef.current || gyroActiveRef.current || interactionLockCountRef.current > 0 || xrSessionRef.current != null || hasInertia();
|
|
2524
|
+
const isUserInteracting = () => mouseActiveRef.current || touchActiveRef.current || keyboardActiveRef.current || gyroActiveRef.current || interactionLockCountRef.current > 0 || xrSessionRef.current != null || activeNavigationRef.current != null || hasInertia();
|
|
2514
2525
|
const syncInteracting = () => {
|
|
2515
2526
|
interactingRef.current = mouseActiveRef.current || touchActiveRef.current;
|
|
2516
2527
|
};
|
|
@@ -2552,6 +2563,14 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2552
2563
|
zoomVelocityRef.current = 0;
|
|
2553
2564
|
lastVelocitySampleAtRef.current = null;
|
|
2554
2565
|
};
|
|
2566
|
+
const cancelNavigation = () => {
|
|
2567
|
+
const navigation = activeNavigationRef.current;
|
|
2568
|
+
if (!navigation) {
|
|
2569
|
+
return;
|
|
2570
|
+
}
|
|
2571
|
+
activeNavigationRef.current = null;
|
|
2572
|
+
navigation.resolve({ status: "cancelled" });
|
|
2573
|
+
};
|
|
2555
2574
|
const markDirty = () => {
|
|
2556
2575
|
dirtyRef.current = true;
|
|
2557
2576
|
settledRef.current = false;
|
|
@@ -2564,6 +2583,7 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2564
2583
|
}
|
|
2565
2584
|
};
|
|
2566
2585
|
const acquireInteractionLock = () => {
|
|
2586
|
+
cancelNavigation();
|
|
2567
2587
|
interactionLockCountRef.current += 1;
|
|
2568
2588
|
stopVelocity();
|
|
2569
2589
|
if (mouseActiveRef.current) {
|
|
@@ -2588,6 +2608,7 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2588
2608
|
};
|
|
2589
2609
|
};
|
|
2590
2610
|
const setView = (view, setOptions) => {
|
|
2611
|
+
cancelNavigation();
|
|
2591
2612
|
const nextView = hardConstrainView(view);
|
|
2592
2613
|
if (gyroActiveRef.current) {
|
|
2593
2614
|
gyroOffsetRef.current = {
|
|
@@ -2602,7 +2623,66 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2602
2623
|
}
|
|
2603
2624
|
markDirty();
|
|
2604
2625
|
};
|
|
2626
|
+
const startNavigation = (targetInput, options2) => {
|
|
2627
|
+
cancelNavigation();
|
|
2628
|
+
if (xrSessionRef.current != null || gyroActiveRef.current || interactionLockCountRef.current > 0) {
|
|
2629
|
+
return Promise.resolve({ status: "cancelled" });
|
|
2630
|
+
}
|
|
2631
|
+
const from = { ...viewRef.current };
|
|
2632
|
+
const safeTargetInput = {
|
|
2633
|
+
yaw: targetInput.yaw !== void 0 && Number.isFinite(targetInput.yaw) ? targetInput.yaw : from.yaw,
|
|
2634
|
+
pitch: targetInput.pitch !== void 0 && Number.isFinite(targetInput.pitch) ? targetInput.pitch : from.pitch,
|
|
2635
|
+
fov: targetInput.fov !== void 0 && Number.isFinite(targetInput.fov) ? targetInput.fov : from.fov
|
|
2636
|
+
};
|
|
2637
|
+
const target = hardConstrainView(safeTargetInput, from);
|
|
2638
|
+
const duration = resolveNavigationDuration(options2?.duration);
|
|
2639
|
+
const rawYawDelta = targetInput.yaw !== void 0 && Number.isFinite(targetInput.yaw) ? safeTargetInput.yaw - from.yaw : 0;
|
|
2640
|
+
const yawDelta = options2?.shortestPath === false ? rawYawDelta : shortestYawDelta(from.yaw, target.yaw);
|
|
2641
|
+
stopVelocity();
|
|
2642
|
+
targetViewRef.current = target;
|
|
2643
|
+
markDirty();
|
|
2644
|
+
if (duration === 0) {
|
|
2645
|
+
viewRef.current = target;
|
|
2646
|
+
return Promise.resolve({ status: "completed" });
|
|
2647
|
+
}
|
|
2648
|
+
return new Promise((resolve) => {
|
|
2649
|
+
activeNavigationRef.current = {
|
|
2650
|
+
from,
|
|
2651
|
+
target,
|
|
2652
|
+
yawDelta,
|
|
2653
|
+
startedAt: performance.now(),
|
|
2654
|
+
duration,
|
|
2655
|
+
easing: options2?.easing,
|
|
2656
|
+
resolve
|
|
2657
|
+
};
|
|
2658
|
+
});
|
|
2659
|
+
};
|
|
2660
|
+
const lookTo = (position, options2) => startNavigation(
|
|
2661
|
+
{
|
|
2662
|
+
yaw: position.yaw,
|
|
2663
|
+
pitch: position.pitch,
|
|
2664
|
+
fov: options2?.fov ?? viewRef.current.fov
|
|
2665
|
+
},
|
|
2666
|
+
options2
|
|
2667
|
+
);
|
|
2668
|
+
const moveTo = (position, options2) => startNavigation(
|
|
2669
|
+
{
|
|
2670
|
+
yaw: position.yaw,
|
|
2671
|
+
pitch: position.pitch,
|
|
2672
|
+
fov: viewRef.current.fov
|
|
2673
|
+
},
|
|
2674
|
+
options2
|
|
2675
|
+
);
|
|
2676
|
+
const zoomTo = (fov, options2) => startNavigation(
|
|
2677
|
+
{
|
|
2678
|
+
yaw: viewRef.current.yaw,
|
|
2679
|
+
pitch: viewRef.current.pitch,
|
|
2680
|
+
fov
|
|
2681
|
+
},
|
|
2682
|
+
options2
|
|
2683
|
+
);
|
|
2605
2684
|
const applyViewDelta = (delta, applyOptions) => {
|
|
2685
|
+
cancelNavigation();
|
|
2606
2686
|
if (interactionLockCountRef.current > 0 || xrSessionRef.current != null) {
|
|
2607
2687
|
return false;
|
|
2608
2688
|
}
|
|
@@ -2653,10 +2733,16 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2653
2733
|
getTargetView: () => ({ ...targetViewRef.current }),
|
|
2654
2734
|
setView,
|
|
2655
2735
|
reset: () => setView(initialViewRef.current),
|
|
2736
|
+
lookTo,
|
|
2737
|
+
moveTo,
|
|
2738
|
+
zoomTo,
|
|
2656
2739
|
applyViewDelta,
|
|
2657
2740
|
setKeyboardActive: (active) => {
|
|
2658
2741
|
const wasActive = keyboardActiveRef.current;
|
|
2659
2742
|
keyboardActiveRef.current = active;
|
|
2743
|
+
if (active) {
|
|
2744
|
+
cancelNavigation();
|
|
2745
|
+
}
|
|
2660
2746
|
if (active && !wasActive) {
|
|
2661
2747
|
eventBusRef.current.emit("viewinteractionstart", {
|
|
2662
2748
|
source: "keyboard"
|
|
@@ -2674,6 +2760,9 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2674
2760
|
} else {
|
|
2675
2761
|
touchActiveRef.current = active;
|
|
2676
2762
|
}
|
|
2763
|
+
if (active) {
|
|
2764
|
+
cancelNavigation();
|
|
2765
|
+
}
|
|
2677
2766
|
syncInteracting();
|
|
2678
2767
|
if (active && !wasActive) {
|
|
2679
2768
|
eventBusRef.current.emit("viewinteractionstart", { source });
|
|
@@ -2690,6 +2779,9 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2690
2779
|
isInteractionLocked: () => interactionLockCountRef.current > 0,
|
|
2691
2780
|
isUserInteracting,
|
|
2692
2781
|
setGyroActive: (active) => {
|
|
2782
|
+
if (active) {
|
|
2783
|
+
cancelNavigation();
|
|
2784
|
+
}
|
|
2693
2785
|
gyroActiveRef.current = active;
|
|
2694
2786
|
gyroOffsetRef.current = { yaw: 0, pitch: 0 };
|
|
2695
2787
|
stopVelocity();
|
|
@@ -2726,7 +2818,7 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2726
2818
|
acquireInteractionLock,
|
|
2727
2819
|
applyAutoRotation: (yawDelta) => {
|
|
2728
2820
|
const inertiaFinished = yawVelocityRef.current === 0 && pitchVelocityRef.current === 0 && zoomVelocityRef.current === 0;
|
|
2729
|
-
if (!Number.isFinite(yawDelta) || xrSessionRef.current != null || gyroActiveRef.current || interactionLockCountRef.current > 0 || interactingRef.current || keyboardActiveRef.current || !inertiaFinished) {
|
|
2821
|
+
if (!Number.isFinite(yawDelta) || xrSessionRef.current != null || activeNavigationRef.current != null || gyroActiveRef.current || interactionLockCountRef.current > 0 || interactingRef.current || keyboardActiveRef.current || !inertiaFinished) {
|
|
2730
2822
|
return false;
|
|
2731
2823
|
}
|
|
2732
2824
|
targetViewRef.current.yaw += yawDelta;
|
|
@@ -2736,6 +2828,12 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2736
2828
|
}),
|
|
2737
2829
|
[]
|
|
2738
2830
|
);
|
|
2831
|
+
useEffect(
|
|
2832
|
+
() => () => {
|
|
2833
|
+
cancelNavigation();
|
|
2834
|
+
},
|
|
2835
|
+
[]
|
|
2836
|
+
);
|
|
2739
2837
|
useEffect(() => {
|
|
2740
2838
|
initialViewRef.current = { ...initialView };
|
|
2741
2839
|
setView(initialView);
|
|
@@ -2745,6 +2843,7 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2745
2843
|
return;
|
|
2746
2844
|
}
|
|
2747
2845
|
if (xrSessionRef.current && gl.xr.isPresenting) {
|
|
2846
|
+
cancelNavigation();
|
|
2748
2847
|
const xrCamera = gl.xr.getCamera();
|
|
2749
2848
|
xrEulerRef.current.setFromQuaternion(xrCamera.quaternion, "YXZ");
|
|
2750
2849
|
const nextView2 = {
|
|
@@ -2765,6 +2864,48 @@ var PanoramaViewRuntime = forwardRef(function PanoramaViewRuntime2({ initialView
|
|
|
2765
2864
|
}
|
|
2766
2865
|
return;
|
|
2767
2866
|
}
|
|
2867
|
+
const navigation = activeNavigationRef.current;
|
|
2868
|
+
if (navigation) {
|
|
2869
|
+
const progress = Math.min(
|
|
2870
|
+
1,
|
|
2871
|
+
Math.max(0, (performance.now() - navigation.startedAt) / navigation.duration)
|
|
2872
|
+
);
|
|
2873
|
+
const easedProgress = applyNavigationEasing(progress, navigation.easing);
|
|
2874
|
+
const nextView2 = {
|
|
2875
|
+
yaw: normalizeYaw(navigation.from.yaw + navigation.yawDelta * easedProgress),
|
|
2876
|
+
pitch: navigation.from.pitch + (navigation.target.pitch - navigation.from.pitch) * easedProgress,
|
|
2877
|
+
fov: navigation.from.fov + (navigation.target.fov - navigation.from.fov) * easedProgress
|
|
2878
|
+
};
|
|
2879
|
+
const completed = progress === 1;
|
|
2880
|
+
viewRef.current = completed ? { ...navigation.target } : nextView2;
|
|
2881
|
+
eulerRef.current.set(
|
|
2882
|
+
MathUtils.degToRad(viewRef.current.pitch),
|
|
2883
|
+
MathUtils.degToRad(-viewRef.current.yaw),
|
|
2884
|
+
MathUtils.degToRad(cameraRollRef.current),
|
|
2885
|
+
"YXZ"
|
|
2886
|
+
);
|
|
2887
|
+
camera.quaternion.setFromEuler(eulerRef.current);
|
|
2888
|
+
camera.fov = viewRef.current.fov;
|
|
2889
|
+
camera.updateProjectionMatrix();
|
|
2890
|
+
camera.updateMatrixWorld();
|
|
2891
|
+
const emittedView = { ...viewRef.current };
|
|
2892
|
+
const lastEmitted2 = lastEmittedViewRef.current;
|
|
2893
|
+
if (!lastEmitted2 || !viewsEqual(lastEmitted2, emittedView)) {
|
|
2894
|
+
lastEmittedViewRef.current = emittedView;
|
|
2895
|
+
eventBusRef.current.emit("viewchange", emittedView);
|
|
2896
|
+
}
|
|
2897
|
+
if (completed) {
|
|
2898
|
+
activeNavigationRef.current = null;
|
|
2899
|
+
settledRef.current = true;
|
|
2900
|
+
eventBusRef.current.emit("viewsettled", emittedView);
|
|
2901
|
+
navigation.resolve({ status: "completed" });
|
|
2902
|
+
dirtyRef.current = false;
|
|
2903
|
+
} else {
|
|
2904
|
+
settledRef.current = false;
|
|
2905
|
+
dirtyRef.current = true;
|
|
2906
|
+
}
|
|
2907
|
+
return;
|
|
2908
|
+
}
|
|
2768
2909
|
const frictionStop = resolveFrictionStop(optionsRef.current.frictionStop);
|
|
2769
2910
|
const inertiaEnabled = optionsRef.current.inertia !== false;
|
|
2770
2911
|
if (!interactingRef.current && !gyroActiveRef.current && inertiaEnabled) {
|
|
@@ -3115,6 +3256,30 @@ function useHotspotAccessibilityLayer() {
|
|
|
3115
3256
|
return { controls, registry };
|
|
3116
3257
|
}
|
|
3117
3258
|
|
|
3259
|
+
// src/hotspot/target-registry.ts
|
|
3260
|
+
import { createContext as createContext6 } from "react";
|
|
3261
|
+
var HotspotTargetRegistryContext = createContext6(
|
|
3262
|
+
null
|
|
3263
|
+
);
|
|
3264
|
+
function createHotspotTargetRegistry() {
|
|
3265
|
+
const targets = /* @__PURE__ */ new Map();
|
|
3266
|
+
return {
|
|
3267
|
+
getPosition: (id) => {
|
|
3268
|
+
const target = targets.get(id);
|
|
3269
|
+
return target ? { ...target.position } : null;
|
|
3270
|
+
},
|
|
3271
|
+
register: (id, position) => {
|
|
3272
|
+
const token = Symbol(id);
|
|
3273
|
+
targets.set(id, { token, position: { ...position } });
|
|
3274
|
+
return () => {
|
|
3275
|
+
if (targets.get(id)?.token === token) {
|
|
3276
|
+
targets.delete(id);
|
|
3277
|
+
}
|
|
3278
|
+
};
|
|
3279
|
+
}
|
|
3280
|
+
};
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3118
3283
|
// src/keyboard-controls.tsx
|
|
3119
3284
|
import { useFrame as useFrame3, useThree as useThree2 } from "@react-three/fiber";
|
|
3120
3285
|
import { useContext as useContext4, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef4 } from "react";
|
|
@@ -3532,7 +3697,7 @@ function MouseControls({
|
|
|
3532
3697
|
}
|
|
3533
3698
|
|
|
3534
3699
|
// src/pano-filter/host.ts
|
|
3535
|
-
import { createContext as
|
|
3700
|
+
import { createContext as createContext7, useContext as useContext6, useSyncExternalStore } from "react";
|
|
3536
3701
|
|
|
3537
3702
|
// src/pano-filter/presets.ts
|
|
3538
3703
|
var PANO_FILTER_PRESETS = [
|
|
@@ -3573,7 +3738,7 @@ function isPanoFilterActive(snapshot) {
|
|
|
3573
3738
|
}
|
|
3574
3739
|
|
|
3575
3740
|
// src/pano-filter/host.ts
|
|
3576
|
-
var PanoFilterHostContext =
|
|
3741
|
+
var PanoFilterHostContext = createContext7(null);
|
|
3577
3742
|
function createPanoFilterHost() {
|
|
3578
3743
|
return {
|
|
3579
3744
|
snapshot: { ...DEFAULT_PANO_FILTER_SNAPSHOT },
|
|
@@ -3642,9 +3807,9 @@ function isProduction2() {
|
|
|
3642
3807
|
}
|
|
3643
3808
|
|
|
3644
3809
|
// src/media-activation.tsx
|
|
3645
|
-
|
|
3646
|
-
import {
|
|
3647
|
-
var PanoMediaActivationHostContext =
|
|
3810
|
+
var import_howler2 = __toESM(require_howler());
|
|
3811
|
+
import { createContext as createContext8, useContext as useContext7, useEffect as useEffect6, useRef as useRef6 } from "react";
|
|
3812
|
+
var PanoMediaActivationHostContext = createContext8(null);
|
|
3648
3813
|
function createPanoMediaActivationHost() {
|
|
3649
3814
|
return { intents: /* @__PURE__ */ new Set(), listeners: /* @__PURE__ */ new Set(), revision: 0 };
|
|
3650
3815
|
}
|
|
@@ -3666,6 +3831,15 @@ function subscribePanoMediaActivation(host, listener) {
|
|
|
3666
3831
|
function hasPanoMediaActivationIntent(host) {
|
|
3667
3832
|
return host.intents.size > 0;
|
|
3668
3833
|
}
|
|
3834
|
+
function needsMediaGesture() {
|
|
3835
|
+
if (typeof navigator !== "undefined" && navigator.userActivation?.hasBeenActive) {
|
|
3836
|
+
return false;
|
|
3837
|
+
}
|
|
3838
|
+
if (import_howler2.Howler.ctx?.state === "running") {
|
|
3839
|
+
return false;
|
|
3840
|
+
}
|
|
3841
|
+
return true;
|
|
3842
|
+
}
|
|
3669
3843
|
function usePanoMediaActivationIntent(required) {
|
|
3670
3844
|
const host = useContext7(PanoMediaActivationHostContext);
|
|
3671
3845
|
const keyRef = useRef6(null);
|
|
@@ -3685,27 +3859,10 @@ function usePanoMediaActivationIntent(required) {
|
|
|
3685
3859
|
};
|
|
3686
3860
|
}, [host, required]);
|
|
3687
3861
|
}
|
|
3688
|
-
function PanoMediaActivationOverlay({
|
|
3689
|
-
ariaLabel = "Enable sound",
|
|
3690
|
-
className,
|
|
3691
|
-
message = "Tap to enable sound",
|
|
3692
|
-
onActivate
|
|
3693
|
-
}) {
|
|
3694
|
-
return /* @__PURE__ */ jsx2("div", { className: cn("pano-media-activation", className), children: /* @__PURE__ */ jsx2(
|
|
3695
|
-
"button",
|
|
3696
|
-
{
|
|
3697
|
-
"aria-label": ariaLabel,
|
|
3698
|
-
className: "pano-media-activation-button",
|
|
3699
|
-
onClick: onActivate,
|
|
3700
|
-
type: "button",
|
|
3701
|
-
children: message
|
|
3702
|
-
}
|
|
3703
|
-
) });
|
|
3704
|
-
}
|
|
3705
3862
|
|
|
3706
3863
|
// src/pano-context-menu.tsx
|
|
3707
3864
|
import {
|
|
3708
|
-
createContext as
|
|
3865
|
+
createContext as createContext9,
|
|
3709
3866
|
useCallback as useCallback2,
|
|
3710
3867
|
useContext as useContext8,
|
|
3711
3868
|
useEffect as useEffect7,
|
|
@@ -3715,11 +3872,11 @@ import {
|
|
|
3715
3872
|
useRef as useRef7,
|
|
3716
3873
|
useState as useState2
|
|
3717
3874
|
} from "react";
|
|
3718
|
-
import { jsx as
|
|
3875
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
3719
3876
|
var DEFAULT_ICON_SIZE = 16;
|
|
3720
3877
|
var MENU_EDGE_PADDING = 8;
|
|
3721
3878
|
var MIN_PANO_CONTEXT_MENU_BACKGROUND_OPACITY = 0.4;
|
|
3722
|
-
var PanoContextMenuOverlayContext =
|
|
3879
|
+
var PanoContextMenuOverlayContext = createContext9(null);
|
|
3723
3880
|
var DEFAULT_APPEARANCE = {
|
|
3724
3881
|
background: "#161616",
|
|
3725
3882
|
color: "#f4f4f4",
|
|
@@ -3889,7 +4046,7 @@ function DefaultContextMenuPanel({
|
|
|
3889
4046
|
style: panelStyle,
|
|
3890
4047
|
tabIndex: -1,
|
|
3891
4048
|
children: [
|
|
3892
|
-
/* @__PURE__ */
|
|
4049
|
+
/* @__PURE__ */ jsx2(
|
|
3893
4050
|
"div",
|
|
3894
4051
|
{
|
|
3895
4052
|
"aria-hidden": true,
|
|
@@ -3901,9 +4058,9 @@ function DefaultContextMenuPanel({
|
|
|
3901
4058
|
}
|
|
3902
4059
|
}
|
|
3903
4060
|
),
|
|
3904
|
-
/* @__PURE__ */
|
|
4061
|
+
/* @__PURE__ */ jsx2("div", { className: "pano-context-menu-items", children: visibleItems.map((item, index) => {
|
|
3905
4062
|
if (!isActionItem(item)) {
|
|
3906
|
-
return /* @__PURE__ */
|
|
4063
|
+
return /* @__PURE__ */ jsx2(
|
|
3907
4064
|
"div",
|
|
3908
4065
|
{
|
|
3909
4066
|
"aria-hidden": true,
|
|
@@ -3920,7 +4077,7 @@ function DefaultContextMenuPanel({
|
|
|
3920
4077
|
);
|
|
3921
4078
|
}
|
|
3922
4079
|
const disabled = item.disabled === true;
|
|
3923
|
-
const iconNode = item.icon ?? (item.image ? /* @__PURE__ */
|
|
4080
|
+
const iconNode = item.icon ?? (item.image ? /* @__PURE__ */ jsx2(
|
|
3924
4081
|
"img",
|
|
3925
4082
|
{
|
|
3926
4083
|
alt: item.imageAlt ?? "",
|
|
@@ -3970,7 +4127,7 @@ function DefaultContextMenuPanel({
|
|
|
3970
4127
|
tabIndex: disabled ? -1 : activeIndex === index ? 0 : -1,
|
|
3971
4128
|
type: "button",
|
|
3972
4129
|
children: [
|
|
3973
|
-
/* @__PURE__ */
|
|
4130
|
+
/* @__PURE__ */ jsx2(
|
|
3974
4131
|
"span",
|
|
3975
4132
|
{
|
|
3976
4133
|
"aria-hidden": true,
|
|
@@ -3982,7 +4139,7 @@ function DefaultContextMenuPanel({
|
|
|
3982
4139
|
children: iconNode
|
|
3983
4140
|
}
|
|
3984
4141
|
),
|
|
3985
|
-
/* @__PURE__ */
|
|
4142
|
+
/* @__PURE__ */ jsx2("span", { style: { flex: 1 }, children: item.label })
|
|
3986
4143
|
]
|
|
3987
4144
|
},
|
|
3988
4145
|
item.id
|
|
@@ -4035,7 +4192,7 @@ function PositionedMenuShell({
|
|
|
4035
4192
|
top: Math.min(Math.max(rawTop, MENU_EDGE_PADDING), maxTop)
|
|
4036
4193
|
});
|
|
4037
4194
|
}, [clientX, clientY, overlayElement, children, viewportRevision]);
|
|
4038
|
-
return /* @__PURE__ */
|
|
4195
|
+
return /* @__PURE__ */ jsx2(
|
|
4039
4196
|
"div",
|
|
4040
4197
|
{
|
|
4041
4198
|
className: "pano-context-menu-shell",
|
|
@@ -4094,7 +4251,7 @@ function usePanoContextMenuOverlay() {
|
|
|
4094
4251
|
document.removeEventListener("keydown", handleKeyDown);
|
|
4095
4252
|
};
|
|
4096
4253
|
}, [session2]);
|
|
4097
|
-
const overlay = /* @__PURE__ */
|
|
4254
|
+
const overlay = /* @__PURE__ */ jsx2(
|
|
4098
4255
|
"div",
|
|
4099
4256
|
{
|
|
4100
4257
|
ref: setOverlayNode,
|
|
@@ -4105,7 +4262,7 @@ function usePanoContextMenuOverlay() {
|
|
|
4105
4262
|
position: "absolute",
|
|
4106
4263
|
zIndex: 20
|
|
4107
4264
|
},
|
|
4108
|
-
children: session2 ? /* @__PURE__ */
|
|
4265
|
+
children: session2 ? /* @__PURE__ */ jsx2(
|
|
4109
4266
|
PositionedMenuShell,
|
|
4110
4267
|
{
|
|
4111
4268
|
clientX: session2.event.clientX,
|
|
@@ -4198,9 +4355,9 @@ function PanoContextMenu({
|
|
|
4198
4355
|
view,
|
|
4199
4356
|
render: () => {
|
|
4200
4357
|
if (hasCustomChildren && current.children) {
|
|
4201
|
-
return /* @__PURE__ */
|
|
4358
|
+
return /* @__PURE__ */ jsx2("div", { "data-pano-context-menu": true, style: { pointerEvents: "auto" }, children: current.children({ event, view, close }) });
|
|
4202
4359
|
}
|
|
4203
|
-
return /* @__PURE__ */
|
|
4360
|
+
return /* @__PURE__ */ jsx2(
|
|
4204
4361
|
DefaultContextMenuPanel,
|
|
4205
4362
|
{
|
|
4206
4363
|
appearance: current.appearance,
|
|
@@ -4251,14 +4408,14 @@ function ResetViewIcon() {
|
|
|
4251
4408
|
viewBox: "0 0 16 16",
|
|
4252
4409
|
width: "100%",
|
|
4253
4410
|
children: [
|
|
4254
|
-
/* @__PURE__ */
|
|
4255
|
-
/* @__PURE__ */
|
|
4411
|
+
/* @__PURE__ */ jsx2("path", { d: "M3.5 6.5A4.5 4.5 0 1 1 4 10" }),
|
|
4412
|
+
/* @__PURE__ */ jsx2("path", { d: "M3.5 3.5v3h3" })
|
|
4256
4413
|
]
|
|
4257
4414
|
}
|
|
4258
4415
|
);
|
|
4259
4416
|
}
|
|
4260
4417
|
function FullscreenIcon() {
|
|
4261
|
-
return /* @__PURE__ */
|
|
4418
|
+
return /* @__PURE__ */ jsx2(
|
|
4262
4419
|
"svg",
|
|
4263
4420
|
{
|
|
4264
4421
|
"aria-hidden": true,
|
|
@@ -4270,12 +4427,12 @@ function FullscreenIcon() {
|
|
|
4270
4427
|
strokeWidth: "1.75",
|
|
4271
4428
|
viewBox: "0 0 16 16",
|
|
4272
4429
|
width: "100%",
|
|
4273
|
-
children: /* @__PURE__ */
|
|
4430
|
+
children: /* @__PURE__ */ jsx2("path", { d: "M3 6V3h3M10 3h3v3M13 10v3h-3M6 13H3v-3" })
|
|
4274
4431
|
}
|
|
4275
4432
|
);
|
|
4276
4433
|
}
|
|
4277
4434
|
function ExitFullscreenIcon() {
|
|
4278
|
-
return /* @__PURE__ */
|
|
4435
|
+
return /* @__PURE__ */ jsx2(
|
|
4279
4436
|
"svg",
|
|
4280
4437
|
{
|
|
4281
4438
|
"aria-hidden": true,
|
|
@@ -4287,7 +4444,7 @@ function ExitFullscreenIcon() {
|
|
|
4287
4444
|
strokeWidth: "1.75",
|
|
4288
4445
|
viewBox: "0 0 16 16",
|
|
4289
4446
|
width: "100%",
|
|
4290
|
-
children: /* @__PURE__ */
|
|
4447
|
+
children: /* @__PURE__ */ jsx2("path", { d: "M6 3v3H3M10 3v3h3M3 10h3v3M10 10h3v3" })
|
|
4291
4448
|
}
|
|
4292
4449
|
);
|
|
4293
4450
|
}
|
|
@@ -4296,7 +4453,7 @@ function createPanoContextMenuPresets(actions) {
|
|
|
4296
4453
|
const resetView = {
|
|
4297
4454
|
id: "pano-reset-view",
|
|
4298
4455
|
label: "Reset view",
|
|
4299
|
-
icon: /* @__PURE__ */
|
|
4456
|
+
icon: /* @__PURE__ */ jsx2(ResetViewIcon, {}),
|
|
4300
4457
|
onSelect: () => {
|
|
4301
4458
|
actions.reset();
|
|
4302
4459
|
}
|
|
@@ -4304,7 +4461,7 @@ function createPanoContextMenuPresets(actions) {
|
|
|
4304
4461
|
const fullscreen = {
|
|
4305
4462
|
id: "pano-fullscreen",
|
|
4306
4463
|
label: isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
4307
|
-
icon: isFullscreen ? /* @__PURE__ */
|
|
4464
|
+
icon: isFullscreen ? /* @__PURE__ */ jsx2(ExitFullscreenIcon, {}) : /* @__PURE__ */ jsx2(FullscreenIcon, {}),
|
|
4308
4465
|
onSelect: () => {
|
|
4309
4466
|
actions.toggleFullscreen();
|
|
4310
4467
|
}
|
|
@@ -4397,19 +4554,19 @@ function composePanoContextMenuItems(props, presets) {
|
|
|
4397
4554
|
...resolvePanoContextMenuEntries(props.append ?? [], presets)
|
|
4398
4555
|
];
|
|
4399
4556
|
}
|
|
4400
|
-
var PanoContextMenuActionsContext =
|
|
4557
|
+
var PanoContextMenuActionsContext = createContext9(null);
|
|
4401
4558
|
|
|
4402
4559
|
// src/pano-cursor.tsx
|
|
4403
4560
|
import { useThree as useThree4 } from "@react-three/fiber";
|
|
4404
4561
|
import {
|
|
4405
|
-
createContext as
|
|
4562
|
+
createContext as createContext10,
|
|
4406
4563
|
useCallback as useCallback3,
|
|
4407
4564
|
useContext as useContext9,
|
|
4408
4565
|
useEffect as useEffect8,
|
|
4409
4566
|
useMemo as useMemo4,
|
|
4410
4567
|
useRef as useRef8
|
|
4411
4568
|
} from "react";
|
|
4412
|
-
import { jsx as
|
|
4569
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
4413
4570
|
var DEFAULT_PANO_CURSORS = {
|
|
4414
4571
|
default: "grab",
|
|
4415
4572
|
dragging: "grabbing",
|
|
@@ -4423,7 +4580,7 @@ var LAYER_PRIORITY = {
|
|
|
4423
4580
|
hotspotDragging: 3,
|
|
4424
4581
|
hidden: 4
|
|
4425
4582
|
};
|
|
4426
|
-
var PanoCursorContext =
|
|
4583
|
+
var PanoCursorContext = createContext10(null);
|
|
4427
4584
|
function usePanoCursor() {
|
|
4428
4585
|
return useContext9(PanoCursorContext);
|
|
4429
4586
|
}
|
|
@@ -4551,7 +4708,7 @@ function PanoCursorController({
|
|
|
4551
4708
|
release(PANO_DRAG_CLAIM_ID);
|
|
4552
4709
|
};
|
|
4553
4710
|
}, [claim, eventBus, release]);
|
|
4554
|
-
return /* @__PURE__ */
|
|
4711
|
+
return /* @__PURE__ */ jsx3(PanoCursorContext.Provider, { value: api, children });
|
|
4555
4712
|
}
|
|
4556
4713
|
|
|
4557
4714
|
// src/pano-events.tsx
|
|
@@ -4912,7 +5069,7 @@ var DEFAULT_PANORAMA_CAMERA_NEAR = 0.1;
|
|
|
4912
5069
|
var DEFAULT_PANORAMA_CAMERA_FAR = DEFAULT_PANORAMA_RADIUS * 2;
|
|
4913
5070
|
|
|
4914
5071
|
// src/panorama-event-surface.tsx
|
|
4915
|
-
import { jsx as
|
|
5072
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
4916
5073
|
var EVENT_SURFACE_RADIUS = DEFAULT_PANORAMA_RADIUS - 1;
|
|
4917
5074
|
function makePanoramaPointerEvent(event) {
|
|
4918
5075
|
const nativeEvent = event.nativeEvent;
|
|
@@ -4980,8 +5137,8 @@ function PanoramaEventSurface() {
|
|
|
4980
5137
|
onPointerUp: (event) => emit("pointerup", event),
|
|
4981
5138
|
onPointerMove: (event) => emit("pointermove", event),
|
|
4982
5139
|
children: [
|
|
4983
|
-
/* @__PURE__ */
|
|
4984
|
-
/* @__PURE__ */
|
|
5140
|
+
/* @__PURE__ */ jsx4("sphereGeometry", { args: [EVENT_SURFACE_RADIUS, 64, 32] }),
|
|
5141
|
+
/* @__PURE__ */ jsx4(
|
|
4985
5142
|
"meshBasicMaterial",
|
|
4986
5143
|
{
|
|
4987
5144
|
colorWrite: false,
|
|
@@ -4998,8 +5155,8 @@ function PanoramaEventSurface() {
|
|
|
4998
5155
|
}
|
|
4999
5156
|
|
|
5000
5157
|
// src/scenes-host.ts
|
|
5001
|
-
import { createContext as
|
|
5002
|
-
var ScenesHostContext =
|
|
5158
|
+
import { createContext as createContext11 } from "react";
|
|
5159
|
+
var ScenesHostContext = createContext11(null);
|
|
5003
5160
|
function createScenesHost() {
|
|
5004
5161
|
return {
|
|
5005
5162
|
controller: null,
|
|
@@ -5162,9 +5319,9 @@ function TouchControls({
|
|
|
5162
5319
|
}
|
|
5163
5320
|
|
|
5164
5321
|
// src/video/chrome-overlay.tsx
|
|
5165
|
-
import { createContext as
|
|
5166
|
-
import { jsx as
|
|
5167
|
-
var PanoChromeOverlayContext =
|
|
5322
|
+
import { createContext as createContext12, useCallback as useCallback4, useMemo as useMemo5, useState as useState3 } from "react";
|
|
5323
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
5324
|
+
var PanoChromeOverlayContext = createContext12(null);
|
|
5168
5325
|
function usePanoChromeOverlay() {
|
|
5169
5326
|
const [overlayElement, setOverlayElement] = useState3(
|
|
5170
5327
|
null
|
|
@@ -5176,7 +5333,7 @@ function usePanoChromeOverlay() {
|
|
|
5176
5333
|
() => ({ overlayElement }),
|
|
5177
5334
|
[overlayElement]
|
|
5178
5335
|
);
|
|
5179
|
-
const overlay = /* @__PURE__ */
|
|
5336
|
+
const overlay = /* @__PURE__ */ jsx5(
|
|
5180
5337
|
"div",
|
|
5181
5338
|
{
|
|
5182
5339
|
className: "pano-chrome-overlay",
|
|
@@ -5188,9 +5345,9 @@ function usePanoChromeOverlay() {
|
|
|
5188
5345
|
}
|
|
5189
5346
|
|
|
5190
5347
|
// src/video/host.ts
|
|
5191
|
-
import { createContext as
|
|
5192
|
-
var PanoVideoHostContext =
|
|
5193
|
-
var DefaultPanoVideoControlsContext =
|
|
5348
|
+
import { createContext as createContext13, useContext as useContext13 } from "react";
|
|
5349
|
+
var PanoVideoHostContext = createContext13(null);
|
|
5350
|
+
var DefaultPanoVideoControlsContext = createContext13(false);
|
|
5194
5351
|
function createPanoVideoHost() {
|
|
5195
5352
|
return {
|
|
5196
5353
|
controller: null,
|
|
@@ -5253,7 +5410,7 @@ import { useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
|
5253
5410
|
|
|
5254
5411
|
// src/video/pano-video-captions.tsx
|
|
5255
5412
|
import { useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
5256
|
-
import { jsx as
|
|
5413
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
5257
5414
|
var DEFAULT_PANO_VIDEO_CAPTION_APPEARANCE = {
|
|
5258
5415
|
color: "#ffffff",
|
|
5259
5416
|
background: "rgba(0, 0, 0, 0.55)",
|
|
@@ -5301,13 +5458,13 @@ function PanoVideoCaptionsOverlay({
|
|
|
5301
5458
|
textShadow: snapshot.captionAppearance.textShadow,
|
|
5302
5459
|
whiteSpace: "pre-wrap"
|
|
5303
5460
|
};
|
|
5304
|
-
return /* @__PURE__ */
|
|
5461
|
+
return /* @__PURE__ */ jsx6(
|
|
5305
5462
|
"div",
|
|
5306
5463
|
{
|
|
5307
5464
|
className: "pano-video-captions",
|
|
5308
5465
|
"data-pano-video-captions": "",
|
|
5309
5466
|
style: wrapperStyle,
|
|
5310
|
-
children: /* @__PURE__ */
|
|
5467
|
+
children: /* @__PURE__ */ jsx6("div", { style: textStyle, children: snapshot.captionText })
|
|
5311
5468
|
}
|
|
5312
5469
|
);
|
|
5313
5470
|
}
|
|
@@ -5459,7 +5616,7 @@ function cueText(cue) {
|
|
|
5459
5616
|
}
|
|
5460
5617
|
|
|
5461
5618
|
// src/video/pano-video-controls.tsx
|
|
5462
|
-
import { Fragment, jsx as
|
|
5619
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
5463
5620
|
var DEFAULT_PANO_VIDEO_CONTROLS_APPEARANCE = {
|
|
5464
5621
|
background: "rgba(16, 16, 16, 0.88)",
|
|
5465
5622
|
color: "#f4f4f4",
|
|
@@ -5520,7 +5677,7 @@ function volumeFromClientY(clientY, track) {
|
|
|
5520
5677
|
return Math.max(0, Math.min(1, (rect.bottom - clientY) / rect.height));
|
|
5521
5678
|
}
|
|
5522
5679
|
function Icon({ path }) {
|
|
5523
|
-
return /* @__PURE__ */
|
|
5680
|
+
return /* @__PURE__ */ jsx7(
|
|
5524
5681
|
"svg",
|
|
5525
5682
|
{
|
|
5526
5683
|
"aria-hidden": true,
|
|
@@ -5532,7 +5689,7 @@ function Icon({ path }) {
|
|
|
5532
5689
|
strokeWidth: "1.75",
|
|
5533
5690
|
viewBox: "0 0 16 16",
|
|
5534
5691
|
width: "16",
|
|
5535
|
-
children: /* @__PURE__ */
|
|
5692
|
+
children: /* @__PURE__ */ jsx7("path", { d: path })
|
|
5536
5693
|
}
|
|
5537
5694
|
);
|
|
5538
5695
|
}
|
|
@@ -5544,7 +5701,7 @@ function ChromeButton({
|
|
|
5544
5701
|
label,
|
|
5545
5702
|
onClick
|
|
5546
5703
|
}) {
|
|
5547
|
-
return /* @__PURE__ */
|
|
5704
|
+
return /* @__PURE__ */ jsx7(
|
|
5548
5705
|
"button",
|
|
5549
5706
|
{
|
|
5550
5707
|
"aria-label": label,
|
|
@@ -5570,14 +5727,14 @@ function ChromeMenu({
|
|
|
5570
5727
|
labelledBy,
|
|
5571
5728
|
items
|
|
5572
5729
|
}) {
|
|
5573
|
-
return /* @__PURE__ */
|
|
5730
|
+
return /* @__PURE__ */ jsx7(
|
|
5574
5731
|
ChromeMenuSurface,
|
|
5575
5732
|
{
|
|
5576
5733
|
appearance,
|
|
5577
5734
|
id,
|
|
5578
5735
|
labelledBy,
|
|
5579
5736
|
role: "menu",
|
|
5580
|
-
children: items.map((item) => /* @__PURE__ */
|
|
5737
|
+
children: items.map((item) => /* @__PURE__ */ jsx7(
|
|
5581
5738
|
ChromeMenuRadioItem,
|
|
5582
5739
|
{
|
|
5583
5740
|
active: item.active,
|
|
@@ -5597,7 +5754,7 @@ function ChromeMenuSurface({
|
|
|
5597
5754
|
labelledBy,
|
|
5598
5755
|
role
|
|
5599
5756
|
}) {
|
|
5600
|
-
return /* @__PURE__ */
|
|
5757
|
+
return /* @__PURE__ */ jsx7(
|
|
5601
5758
|
"div",
|
|
5602
5759
|
{
|
|
5603
5760
|
"aria-labelledby": labelledBy,
|
|
@@ -5621,7 +5778,7 @@ function ChromeMenuRadioItem({
|
|
|
5621
5778
|
label,
|
|
5622
5779
|
onClick
|
|
5623
5780
|
}) {
|
|
5624
|
-
return /* @__PURE__ */
|
|
5781
|
+
return /* @__PURE__ */ jsx7(
|
|
5625
5782
|
"button",
|
|
5626
5783
|
{
|
|
5627
5784
|
"aria-checked": active,
|
|
@@ -5661,7 +5818,7 @@ function ChromeMenuActionItem({
|
|
|
5661
5818
|
},
|
|
5662
5819
|
type: "button",
|
|
5663
5820
|
children: [
|
|
5664
|
-
/* @__PURE__ */
|
|
5821
|
+
/* @__PURE__ */ jsx7("span", { children: label }),
|
|
5665
5822
|
secondary
|
|
5666
5823
|
]
|
|
5667
5824
|
}
|
|
@@ -5670,10 +5827,10 @@ function ChromeMenuActionItem({
|
|
|
5670
5827
|
function ChromeMenuSectionLabel({
|
|
5671
5828
|
children
|
|
5672
5829
|
}) {
|
|
5673
|
-
return /* @__PURE__ */
|
|
5830
|
+
return /* @__PURE__ */ jsx7("div", { className: "pano-video-chrome-menu-label", children });
|
|
5674
5831
|
}
|
|
5675
5832
|
function ChromeMenuDivider() {
|
|
5676
|
-
return /* @__PURE__ */
|
|
5833
|
+
return /* @__PURE__ */ jsx7("div", { className: "pano-video-chrome-menu-divider" });
|
|
5677
5834
|
}
|
|
5678
5835
|
function CaptionsMenu({
|
|
5679
5836
|
appearance,
|
|
@@ -5686,7 +5843,7 @@ function CaptionsMenu({
|
|
|
5686
5843
|
panel,
|
|
5687
5844
|
snapshot
|
|
5688
5845
|
}) {
|
|
5689
|
-
return /* @__PURE__ */
|
|
5846
|
+
return /* @__PURE__ */ jsx7(
|
|
5690
5847
|
ChromeMenuSurface,
|
|
5691
5848
|
{
|
|
5692
5849
|
appearance,
|
|
@@ -5695,7 +5852,7 @@ function CaptionsMenu({
|
|
|
5695
5852
|
role: "menu",
|
|
5696
5853
|
children: panel === "tracks" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
5697
5854
|
/* @__PURE__ */ jsxs3("div", { className: "pano-video-chrome-menu-list", children: [
|
|
5698
|
-
/* @__PURE__ */
|
|
5855
|
+
/* @__PURE__ */ jsx7(
|
|
5699
5856
|
ChromeMenuRadioItem,
|
|
5700
5857
|
{
|
|
5701
5858
|
active: snapshot.trackId === null,
|
|
@@ -5708,7 +5865,7 @@ function CaptionsMenu({
|
|
|
5708
5865
|
),
|
|
5709
5866
|
snapshot.tracks.map((track) => {
|
|
5710
5867
|
const trackItemId = panoVideoTrackId(track);
|
|
5711
|
-
return /* @__PURE__ */
|
|
5868
|
+
return /* @__PURE__ */ jsx7(
|
|
5712
5869
|
ChromeMenuRadioItem,
|
|
5713
5870
|
{
|
|
5714
5871
|
active: snapshot.trackId === trackItemId,
|
|
@@ -5722,29 +5879,29 @@ function CaptionsMenu({
|
|
|
5722
5879
|
);
|
|
5723
5880
|
})
|
|
5724
5881
|
] }),
|
|
5725
|
-
/* @__PURE__ */
|
|
5726
|
-
/* @__PURE__ */
|
|
5882
|
+
/* @__PURE__ */ jsx7(ChromeMenuDivider, {}),
|
|
5883
|
+
/* @__PURE__ */ jsx7(
|
|
5727
5884
|
ChromeMenuActionItem,
|
|
5728
5885
|
{
|
|
5729
5886
|
appearance,
|
|
5730
5887
|
label: "Settings",
|
|
5731
5888
|
onClick: onOpenSettings,
|
|
5732
|
-
secondary: /* @__PURE__ */
|
|
5889
|
+
secondary: /* @__PURE__ */ jsx7("span", { "aria-hidden": true, children: "\u203A" })
|
|
5733
5890
|
}
|
|
5734
5891
|
)
|
|
5735
5892
|
] }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
5736
|
-
/* @__PURE__ */
|
|
5893
|
+
/* @__PURE__ */ jsx7(
|
|
5737
5894
|
ChromeMenuActionItem,
|
|
5738
5895
|
{
|
|
5739
5896
|
appearance,
|
|
5740
5897
|
label: "Back",
|
|
5741
5898
|
onClick: onShowTracks,
|
|
5742
|
-
secondary: /* @__PURE__ */
|
|
5899
|
+
secondary: /* @__PURE__ */ jsx7("span", { "aria-hidden": true, children: "\u2039" })
|
|
5743
5900
|
}
|
|
5744
5901
|
),
|
|
5745
|
-
/* @__PURE__ */
|
|
5746
|
-
/* @__PURE__ */
|
|
5747
|
-
CAPTION_SIZE_OPTIONS.map((option) => /* @__PURE__ */
|
|
5902
|
+
/* @__PURE__ */ jsx7(ChromeMenuDivider, {}),
|
|
5903
|
+
/* @__PURE__ */ jsx7(ChromeMenuSectionLabel, { children: "Font size" }),
|
|
5904
|
+
CAPTION_SIZE_OPTIONS.map((option) => /* @__PURE__ */ jsx7(
|
|
5748
5905
|
ChromeMenuRadioItem,
|
|
5749
5906
|
{
|
|
5750
5907
|
active: Number(snapshot.captionAppearance.fontSize) === option.value,
|
|
@@ -5756,9 +5913,9 @@ function CaptionsMenu({
|
|
|
5756
5913
|
},
|
|
5757
5914
|
option.id
|
|
5758
5915
|
)),
|
|
5759
|
-
/* @__PURE__ */
|
|
5760
|
-
/* @__PURE__ */
|
|
5761
|
-
CAPTION_BACKGROUND_OPTIONS.map((option) => /* @__PURE__ */
|
|
5916
|
+
/* @__PURE__ */ jsx7(ChromeMenuDivider, {}),
|
|
5917
|
+
/* @__PURE__ */ jsx7(ChromeMenuSectionLabel, { children: "Background" }),
|
|
5918
|
+
CAPTION_BACKGROUND_OPTIONS.map((option) => /* @__PURE__ */ jsx7(
|
|
5762
5919
|
ChromeMenuRadioItem,
|
|
5763
5920
|
{
|
|
5764
5921
|
active: snapshot.captionAppearance.background === option.value,
|
|
@@ -5813,7 +5970,7 @@ function VerticalVolumeSlider({
|
|
|
5813
5970
|
pointerEvents: "auto"
|
|
5814
5971
|
},
|
|
5815
5972
|
children: [
|
|
5816
|
-
/* @__PURE__ */
|
|
5973
|
+
/* @__PURE__ */ jsx7(
|
|
5817
5974
|
"span",
|
|
5818
5975
|
{
|
|
5819
5976
|
"aria-hidden": true,
|
|
@@ -5825,7 +5982,7 @@ function VerticalVolumeSlider({
|
|
|
5825
5982
|
children: percentLabel
|
|
5826
5983
|
}
|
|
5827
5984
|
),
|
|
5828
|
-
/* @__PURE__ */
|
|
5985
|
+
/* @__PURE__ */ jsx7(
|
|
5829
5986
|
"div",
|
|
5830
5987
|
{
|
|
5831
5988
|
style: {
|
|
@@ -5865,7 +6022,7 @@ function VerticalVolumeSlider({
|
|
|
5865
6022
|
},
|
|
5866
6023
|
tabIndex: 0,
|
|
5867
6024
|
children: [
|
|
5868
|
-
/* @__PURE__ */
|
|
6025
|
+
/* @__PURE__ */ jsx7(
|
|
5869
6026
|
"div",
|
|
5870
6027
|
{
|
|
5871
6028
|
style: {
|
|
@@ -5880,7 +6037,7 @@ function VerticalVolumeSlider({
|
|
|
5880
6037
|
}
|
|
5881
6038
|
}
|
|
5882
6039
|
),
|
|
5883
|
-
/* @__PURE__ */
|
|
6040
|
+
/* @__PURE__ */ jsx7(
|
|
5884
6041
|
"div",
|
|
5885
6042
|
{
|
|
5886
6043
|
style: {
|
|
@@ -5939,13 +6096,13 @@ function VolumeControl({
|
|
|
5939
6096
|
};
|
|
5940
6097
|
}, [open, volumeAdjustable]);
|
|
5941
6098
|
if (!volumeAdjustable) {
|
|
5942
|
-
return /* @__PURE__ */
|
|
6099
|
+
return /* @__PURE__ */ jsx7(
|
|
5943
6100
|
ChromeButton,
|
|
5944
6101
|
{
|
|
5945
6102
|
appearance,
|
|
5946
6103
|
label: mutedOrSilent ? "Unmute" : "Mute",
|
|
5947
6104
|
onClick: onToggleMuted,
|
|
5948
|
-
children: mutedOrSilent ? /* @__PURE__ */
|
|
6105
|
+
children: mutedOrSilent ? /* @__PURE__ */ jsx7(Icon, { path: "M3 6.5h2.2L8.5 4v8L5.2 9.5H3zM10.2 6.2l3.2 3.6M13.4 6.2l-3.2 3.6" }) : /* @__PURE__ */ jsx7(Icon, { path: "M3 6.5h2.2L8.5 4v8L5.2 9.5H3zM10.5 5.5a3 3 0 0 1 0 5" })
|
|
5949
6106
|
}
|
|
5950
6107
|
);
|
|
5951
6108
|
}
|
|
@@ -5977,7 +6134,7 @@ function VolumeControl({
|
|
|
5977
6134
|
},
|
|
5978
6135
|
ref: rootRef,
|
|
5979
6136
|
children: [
|
|
5980
|
-
open ? /* @__PURE__ */
|
|
6137
|
+
open ? /* @__PURE__ */ jsx7(
|
|
5981
6138
|
VerticalVolumeSlider,
|
|
5982
6139
|
{
|
|
5983
6140
|
appearance,
|
|
@@ -5985,7 +6142,7 @@ function VolumeControl({
|
|
|
5985
6142
|
volume: displayVolume
|
|
5986
6143
|
}
|
|
5987
6144
|
) : null,
|
|
5988
|
-
/* @__PURE__ */
|
|
6145
|
+
/* @__PURE__ */ jsx7(
|
|
5989
6146
|
ChromeButton,
|
|
5990
6147
|
{
|
|
5991
6148
|
appearance,
|
|
@@ -5996,7 +6153,7 @@ function VolumeControl({
|
|
|
5996
6153
|
}
|
|
5997
6154
|
onToggleMuted();
|
|
5998
6155
|
},
|
|
5999
|
-
children: mutedOrSilent ? /* @__PURE__ */
|
|
6156
|
+
children: mutedOrSilent ? /* @__PURE__ */ jsx7(Icon, { path: "M3 6.5h2.2L8.5 4v8L5.2 9.5H3zM10.2 6.2l3.2 3.6M13.4 6.2l-3.2 3.6" }) : /* @__PURE__ */ jsx7(Icon, { path: "M3 6.5h2.2L8.5 4v8L5.2 9.5H3zM10.5 5.5a3 3 0 0 1 0 5" })
|
|
6000
6157
|
}
|
|
6001
6158
|
)
|
|
6002
6159
|
]
|
|
@@ -6156,7 +6313,7 @@ function PanoVideoControlsHud({
|
|
|
6156
6313
|
let menuNode = null;
|
|
6157
6314
|
switch (menu) {
|
|
6158
6315
|
case "rate":
|
|
6159
|
-
menuNode = /* @__PURE__ */
|
|
6316
|
+
menuNode = /* @__PURE__ */ jsx7(
|
|
6160
6317
|
ChromeMenu,
|
|
6161
6318
|
{
|
|
6162
6319
|
appearance: resolved,
|
|
@@ -6175,7 +6332,7 @@ function PanoVideoControlsHud({
|
|
|
6175
6332
|
);
|
|
6176
6333
|
break;
|
|
6177
6334
|
case "variant":
|
|
6178
|
-
menuNode = /* @__PURE__ */
|
|
6335
|
+
menuNode = /* @__PURE__ */ jsx7(
|
|
6179
6336
|
ChromeMenu,
|
|
6180
6337
|
{
|
|
6181
6338
|
appearance: resolved,
|
|
@@ -6194,7 +6351,7 @@ function PanoVideoControlsHud({
|
|
|
6194
6351
|
);
|
|
6195
6352
|
break;
|
|
6196
6353
|
case "captions":
|
|
6197
|
-
menuNode = /* @__PURE__ */
|
|
6354
|
+
menuNode = /* @__PURE__ */ jsx7(
|
|
6198
6355
|
CaptionsMenu,
|
|
6199
6356
|
{
|
|
6200
6357
|
appearance: resolved,
|
|
@@ -6218,7 +6375,7 @@ function PanoVideoControlsHud({
|
|
|
6218
6375
|
);
|
|
6219
6376
|
break;
|
|
6220
6377
|
case "more":
|
|
6221
|
-
menuNode = /* @__PURE__ */
|
|
6378
|
+
menuNode = /* @__PURE__ */ jsx7(
|
|
6222
6379
|
ChromeMenu,
|
|
6223
6380
|
{
|
|
6224
6381
|
appearance: resolved,
|
|
@@ -6286,7 +6443,7 @@ function PanoVideoControlsHud({
|
|
|
6286
6443
|
};
|
|
6287
6444
|
const rateButton = /* @__PURE__ */ jsxs3("div", { className: "pano-video-menu", "data-pano-video-menu": "rate", children: [
|
|
6288
6445
|
!compact && menu === "rate" ? menuNode : null,
|
|
6289
|
-
/* @__PURE__ */
|
|
6446
|
+
/* @__PURE__ */ jsx7(
|
|
6290
6447
|
ChromeButton,
|
|
6291
6448
|
{
|
|
6292
6449
|
appearance: resolved,
|
|
@@ -6294,13 +6451,13 @@ function PanoVideoControlsHud({
|
|
|
6294
6451
|
onClick: () => {
|
|
6295
6452
|
toggleMenu("rate");
|
|
6296
6453
|
},
|
|
6297
|
-
children: /* @__PURE__ */
|
|
6454
|
+
children: /* @__PURE__ */ jsx7("span", { className: "pano-video-chrome-label", id: `${barId}-rate-btn`, children: snapshot.playbackRate === 1 ? "1x" : `${snapshot.playbackRate}x` })
|
|
6298
6455
|
}
|
|
6299
6456
|
)
|
|
6300
6457
|
] });
|
|
6301
6458
|
const variantButton = canSwitchVariant ? /* @__PURE__ */ jsxs3("div", { className: "pano-video-menu", "data-pano-video-menu": "variant", children: [
|
|
6302
6459
|
!compact && menu === "variant" ? menuNode : null,
|
|
6303
|
-
/* @__PURE__ */
|
|
6460
|
+
/* @__PURE__ */ jsx7(
|
|
6304
6461
|
ChromeButton,
|
|
6305
6462
|
{
|
|
6306
6463
|
appearance: resolved,
|
|
@@ -6308,13 +6465,13 @@ function PanoVideoControlsHud({
|
|
|
6308
6465
|
onClick: () => {
|
|
6309
6466
|
toggleMenu("variant");
|
|
6310
6467
|
},
|
|
6311
|
-
children: /* @__PURE__ */
|
|
6468
|
+
children: /* @__PURE__ */ jsx7("span", { className: "pano-video-chrome-label", id: `${barId}-variant-btn`, children: snapshot.variants.find((variant) => variant.id === snapshot.variantId)?.label ?? "Quality" })
|
|
6312
6469
|
}
|
|
6313
6470
|
)
|
|
6314
6471
|
] }) : null;
|
|
6315
6472
|
const captionsButton = showCaptionsMenu ? /* @__PURE__ */ jsxs3("div", { className: "pano-video-menu", "data-pano-video-menu": "captions", children: [
|
|
6316
6473
|
!compact && menu === "captions" ? menuNode : null,
|
|
6317
|
-
/* @__PURE__ */
|
|
6474
|
+
/* @__PURE__ */ jsx7(
|
|
6318
6475
|
ChromeButton,
|
|
6319
6476
|
{
|
|
6320
6477
|
appearance: resolved,
|
|
@@ -6322,7 +6479,7 @@ function PanoVideoControlsHud({
|
|
|
6322
6479
|
onClick: () => {
|
|
6323
6480
|
toggleMenu("captions");
|
|
6324
6481
|
},
|
|
6325
|
-
children: /* @__PURE__ */
|
|
6482
|
+
children: /* @__PURE__ */ jsx7("span", { id: `${barId}-captions-btn`, children: /* @__PURE__ */ jsx7(Icon, { path: "M2.5 4.5h11v7h-11zM5 7.2h2.4M5 9.2h5.5" }) })
|
|
6326
6483
|
}
|
|
6327
6484
|
)
|
|
6328
6485
|
] }) : null;
|
|
@@ -6333,7 +6490,7 @@ function PanoVideoControlsHud({
|
|
|
6333
6490
|
"data-pano-video-controls": "",
|
|
6334
6491
|
style: barStyle,
|
|
6335
6492
|
children: [
|
|
6336
|
-
/* @__PURE__ */
|
|
6493
|
+
/* @__PURE__ */ jsx7(
|
|
6337
6494
|
ChromeButton,
|
|
6338
6495
|
{
|
|
6339
6496
|
appearance: resolved,
|
|
@@ -6341,11 +6498,11 @@ function PanoVideoControlsHud({
|
|
|
6341
6498
|
onClick: () => {
|
|
6342
6499
|
controller.togglePlay();
|
|
6343
6500
|
},
|
|
6344
|
-
children: snapshot.playing ? /* @__PURE__ */
|
|
6501
|
+
children: snapshot.playing ? /* @__PURE__ */ jsx7(Icon, { path: "M5 3.5h2.2v9H5zM8.8 3.5H11v9H8.8z" }) : /* @__PURE__ */ jsx7(Icon, { path: "M5 3.2v9.6L13 8z" })
|
|
6345
6502
|
}
|
|
6346
6503
|
),
|
|
6347
|
-
hideTime ? null : /* @__PURE__ */
|
|
6348
|
-
/* @__PURE__ */
|
|
6504
|
+
hideTime ? null : /* @__PURE__ */ jsx7("span", { className: "pano-video-time", children: formatMediaTime(snapshot.currentTime) }),
|
|
6505
|
+
/* @__PURE__ */ jsx7(
|
|
6349
6506
|
"input",
|
|
6350
6507
|
{
|
|
6351
6508
|
"aria-label": "Seek",
|
|
@@ -6367,8 +6524,8 @@ function PanoVideoControlsHud({
|
|
|
6367
6524
|
value: duration > 0 ? snapshot.currentTime : 0
|
|
6368
6525
|
}
|
|
6369
6526
|
),
|
|
6370
|
-
hideTime ? null : /* @__PURE__ */
|
|
6371
|
-
/* @__PURE__ */
|
|
6527
|
+
hideTime ? null : /* @__PURE__ */ jsx7("span", { className: "pano-video-time", children: formatMediaTime(duration) }),
|
|
6528
|
+
/* @__PURE__ */ jsx7(
|
|
6372
6529
|
VolumeControl,
|
|
6373
6530
|
{
|
|
6374
6531
|
appearance: resolved,
|
|
@@ -6386,7 +6543,7 @@ function PanoVideoControlsHud({
|
|
|
6386
6543
|
),
|
|
6387
6544
|
compact ? /* @__PURE__ */ jsxs3("div", { className: "pano-video-menu", "data-pano-video-menu": "more", children: [
|
|
6388
6545
|
menu !== null ? menuNode : null,
|
|
6389
|
-
/* @__PURE__ */
|
|
6546
|
+
/* @__PURE__ */ jsx7(
|
|
6390
6547
|
ChromeButton,
|
|
6391
6548
|
{
|
|
6392
6549
|
appearance: resolved,
|
|
@@ -6395,7 +6552,7 @@ function PanoVideoControlsHud({
|
|
|
6395
6552
|
onClick: () => {
|
|
6396
6553
|
toggleMenu("more");
|
|
6397
6554
|
},
|
|
6398
|
-
children: /* @__PURE__ */
|
|
6555
|
+
children: /* @__PURE__ */ jsx7(Icon, { path: "M3 8a1 1 0 1 0 2 0 1 1 0 1 0-2 0M7 8a1 1 0 1 0 2 0 1 1 0 1 0-2 0M11 8a1 1 0 1 0 2 0 1 1 0 1 0-2 0" })
|
|
6399
6556
|
}
|
|
6400
6557
|
)
|
|
6401
6558
|
] }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
@@ -6403,7 +6560,7 @@ function PanoVideoControlsHud({
|
|
|
6403
6560
|
variantButton,
|
|
6404
6561
|
captionsButton
|
|
6405
6562
|
] }),
|
|
6406
|
-
showFullscreen ? /* @__PURE__ */
|
|
6563
|
+
showFullscreen ? /* @__PURE__ */ jsx7(
|
|
6407
6564
|
ChromeButton,
|
|
6408
6565
|
{
|
|
6409
6566
|
appearance: resolved,
|
|
@@ -6411,7 +6568,7 @@ function PanoVideoControlsHud({
|
|
|
6411
6568
|
onClick: () => {
|
|
6412
6569
|
fullscreen?.toggleFullscreen();
|
|
6413
6570
|
},
|
|
6414
|
-
children: fullscreen?.isFullscreen ? /* @__PURE__ */
|
|
6571
|
+
children: fullscreen?.isFullscreen ? /* @__PURE__ */ jsx7(Icon, { path: "M6 3.5H3.5V6M10 3.5h2.5V6M6 12.5H3.5V10M10 12.5h2.5V10" }) : /* @__PURE__ */ jsx7(Icon, { path: "M3.5 6V3.5H6M10 3.5h2.5V6M3.5 10v2.5H6M10 12.5h2.5V10" })
|
|
6415
6572
|
}
|
|
6416
6573
|
) : null
|
|
6417
6574
|
]
|
|
@@ -6428,7 +6585,7 @@ function PanoVideoControls({ appearance }) {
|
|
|
6428
6585
|
}
|
|
6429
6586
|
|
|
6430
6587
|
// src/video/pano-video-chrome-bridge.tsx
|
|
6431
|
-
import { Fragment as Fragment2, jsx as
|
|
6588
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
6432
6589
|
function PanoVideoChromeBridge({
|
|
6433
6590
|
fullscreen,
|
|
6434
6591
|
host,
|
|
@@ -6444,7 +6601,7 @@ function PanoVideoChromeBridge({
|
|
|
6444
6601
|
}
|
|
6445
6602
|
const showDefaultControls = host.controller !== null && host.controls !== false && host.controlClaims === 0;
|
|
6446
6603
|
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
6447
|
-
showDefaultControls ? /* @__PURE__ */
|
|
6604
|
+
showDefaultControls ? /* @__PURE__ */ jsx8(
|
|
6448
6605
|
PanoVideoControlsHud,
|
|
6449
6606
|
{
|
|
6450
6607
|
appearance: typeof host.controls === "object" ? host.controls : void 0,
|
|
@@ -6453,7 +6610,7 @@ function PanoVideoChromeBridge({
|
|
|
6453
6610
|
overlayElement
|
|
6454
6611
|
}
|
|
6455
6612
|
) : null,
|
|
6456
|
-
host.captions !== false && host.controller ? /* @__PURE__ */
|
|
6613
|
+
host.captions !== false && host.controller ? /* @__PURE__ */ jsx8(PanoVideoCaptionsOverlay, { controller: host.controller }) : null
|
|
6457
6614
|
] });
|
|
6458
6615
|
}
|
|
6459
6616
|
|
|
@@ -6461,8 +6618,8 @@ function PanoVideoChromeBridge({
|
|
|
6461
6618
|
import { useSyncExternalStore as useSyncExternalStore5 } from "react";
|
|
6462
6619
|
|
|
6463
6620
|
// src/webvr/host.ts
|
|
6464
|
-
import { createContext as
|
|
6465
|
-
var WebVRRuntimeContext =
|
|
6621
|
+
import { createContext as createContext14 } from "react";
|
|
6622
|
+
var WebVRRuntimeContext = createContext14(null);
|
|
6466
6623
|
function createWebVRHost() {
|
|
6467
6624
|
return {
|
|
6468
6625
|
controller: null,
|
|
@@ -6606,7 +6763,7 @@ function clamp2(value, min, max) {
|
|
|
6606
6763
|
}
|
|
6607
6764
|
|
|
6608
6765
|
// src/webvr/chrome.tsx
|
|
6609
|
-
import { Fragment as Fragment3, jsx as
|
|
6766
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
6610
6767
|
function resolveAppearance(value) {
|
|
6611
6768
|
return {
|
|
6612
6769
|
...DEFAULT_WEBVR_CHROME_APPEARANCE,
|
|
@@ -6618,7 +6775,7 @@ function ChromeButton2({
|
|
|
6618
6775
|
children,
|
|
6619
6776
|
onClick
|
|
6620
6777
|
}) {
|
|
6621
|
-
return /* @__PURE__ */
|
|
6778
|
+
return /* @__PURE__ */ jsx9(
|
|
6622
6779
|
"button",
|
|
6623
6780
|
{
|
|
6624
6781
|
className: "pano-webvr-button",
|
|
@@ -6663,11 +6820,11 @@ function SetupPanel({
|
|
|
6663
6820
|
role: "dialog",
|
|
6664
6821
|
style: panelStyle,
|
|
6665
6822
|
children: [
|
|
6666
|
-
/* @__PURE__ */
|
|
6823
|
+
/* @__PURE__ */ jsx9("h2", { className: "pano-webvr-setup-title", children: appearance.setupTitle ?? "MobileVR Setup" }),
|
|
6667
6824
|
/* @__PURE__ */ jsxs5("label", { className: "pano-webvr-setup-field", children: [
|
|
6668
6825
|
"Screen size (inch)",
|
|
6669
6826
|
/* @__PURE__ */ jsxs5("div", { className: "pano-webvr-setup-row", children: [
|
|
6670
|
-
/* @__PURE__ */
|
|
6827
|
+
/* @__PURE__ */ jsx9(
|
|
6671
6828
|
"button",
|
|
6672
6829
|
{
|
|
6673
6830
|
"aria-label": "Decrease screen size",
|
|
@@ -6679,8 +6836,8 @@ function SetupPanel({
|
|
|
6679
6836
|
children: "\u2039"
|
|
6680
6837
|
}
|
|
6681
6838
|
),
|
|
6682
|
-
/* @__PURE__ */
|
|
6683
|
-
/* @__PURE__ */
|
|
6839
|
+
/* @__PURE__ */ jsx9("strong", { className: "pano-webvr-setup-value", children: settings.screensize === "auto" ? "Auto" : settings.screensize.toFixed(1) }),
|
|
6840
|
+
/* @__PURE__ */ jsx9(
|
|
6684
6841
|
"button",
|
|
6685
6842
|
{
|
|
6686
6843
|
"aria-label": "Increase screen size",
|
|
@@ -6695,9 +6852,9 @@ function SetupPanel({
|
|
|
6695
6852
|
] })
|
|
6696
6853
|
] }),
|
|
6697
6854
|
/* @__PURE__ */ jsxs5("fieldset", { className: "pano-webvr-setup-fieldset", children: [
|
|
6698
|
-
/* @__PURE__ */
|
|
6855
|
+
/* @__PURE__ */ jsx9("legend", { className: "pano-webvr-setup-legend", children: "VR headset preset" }),
|
|
6699
6856
|
/* @__PURE__ */ jsxs5("div", { className: "pano-webvr-setup-row", children: [
|
|
6700
|
-
/* @__PURE__ */
|
|
6857
|
+
/* @__PURE__ */ jsx9(
|
|
6701
6858
|
"button",
|
|
6702
6859
|
{
|
|
6703
6860
|
"aria-label": "Previous headset preset",
|
|
@@ -6707,8 +6864,8 @@ function SetupPanel({
|
|
|
6707
6864
|
children: "\u2039"
|
|
6708
6865
|
}
|
|
6709
6866
|
),
|
|
6710
|
-
/* @__PURE__ */
|
|
6711
|
-
/* @__PURE__ */
|
|
6867
|
+
/* @__PURE__ */ jsx9("strong", { className: "pano-webvr-setup-value-wide", children: WEBVR_PROFILES[settings.profileId].label }),
|
|
6868
|
+
/* @__PURE__ */ jsx9(
|
|
6712
6869
|
"button",
|
|
6713
6870
|
{
|
|
6714
6871
|
"aria-label": "Next headset preset",
|
|
@@ -6720,7 +6877,7 @@ function SetupPanel({
|
|
|
6720
6877
|
)
|
|
6721
6878
|
] })
|
|
6722
6879
|
] }),
|
|
6723
|
-
/* @__PURE__ */
|
|
6880
|
+
/* @__PURE__ */ jsx9(
|
|
6724
6881
|
ChromeButton2,
|
|
6725
6882
|
{
|
|
6726
6883
|
appearance,
|
|
@@ -6744,8 +6901,8 @@ function WebVRChromeBridge({ host }) {
|
|
|
6744
6901
|
}
|
|
6745
6902
|
const appearance = resolveAppearance(chrome);
|
|
6746
6903
|
return /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
6747
|
-
/* @__PURE__ */
|
|
6748
|
-
mode !== "webxr" ? /* @__PURE__ */
|
|
6904
|
+
/* @__PURE__ */ jsx9("div", { className: "pano-webvr-toolbar", children: mode ? /* @__PURE__ */ jsxs5("div", { className: "pano-webvr-toolbar-actions", children: [
|
|
6905
|
+
mode !== "webxr" ? /* @__PURE__ */ jsx9(
|
|
6749
6906
|
ChromeButton2,
|
|
6750
6907
|
{
|
|
6751
6908
|
appearance,
|
|
@@ -6753,7 +6910,7 @@ function WebVRChromeBridge({ host }) {
|
|
|
6753
6910
|
children: "VR Setup"
|
|
6754
6911
|
}
|
|
6755
6912
|
) : null,
|
|
6756
|
-
/* @__PURE__ */
|
|
6913
|
+
/* @__PURE__ */ jsx9(
|
|
6757
6914
|
ChromeButton2,
|
|
6758
6915
|
{
|
|
6759
6916
|
appearance,
|
|
@@ -6761,7 +6918,7 @@ function WebVRChromeBridge({ host }) {
|
|
|
6761
6918
|
children: "Exit VR"
|
|
6762
6919
|
}
|
|
6763
6920
|
)
|
|
6764
|
-
] }) : /* @__PURE__ */
|
|
6921
|
+
] }) : /* @__PURE__ */ jsx9(
|
|
6765
6922
|
ChromeButton2,
|
|
6766
6923
|
{
|
|
6767
6924
|
appearance,
|
|
@@ -6769,7 +6926,7 @@ function WebVRChromeBridge({ host }) {
|
|
|
6769
6926
|
children: available ? "Enter VR" : "VR unavailable"
|
|
6770
6927
|
}
|
|
6771
6928
|
) }),
|
|
6772
|
-
mode === "fake" ? /* @__PURE__ */
|
|
6929
|
+
mode === "fake" ? /* @__PURE__ */ jsx9(
|
|
6773
6930
|
"p",
|
|
6774
6931
|
{
|
|
6775
6932
|
className: "pano-webvr-hint",
|
|
@@ -6777,7 +6934,7 @@ function WebVRChromeBridge({ host }) {
|
|
|
6777
6934
|
children: "Simulated VR Mode \xB7 Click the view to lock the mouse, then move to look around. Use a headset or phone for real VR."
|
|
6778
6935
|
}
|
|
6779
6936
|
) : null,
|
|
6780
|
-
setupOpen ? /* @__PURE__ */
|
|
6937
|
+
setupOpen ? /* @__PURE__ */ jsx9(
|
|
6781
6938
|
SetupPanel,
|
|
6782
6939
|
{
|
|
6783
6940
|
appearance,
|
|
@@ -6819,7 +6976,7 @@ import { useFrame as useFrame5, useThree as useThree8 } from "@react-three/fiber
|
|
|
6819
6976
|
import { useXR as useXR2, XROrigin } from "@react-three/xr";
|
|
6820
6977
|
import { useRef as useRef12 } from "react";
|
|
6821
6978
|
import { Vector3 as Vector34 } from "three";
|
|
6822
|
-
import { jsx as
|
|
6979
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
6823
6980
|
function PanoramaXROrigin() {
|
|
6824
6981
|
const originRef = useRef12(null);
|
|
6825
6982
|
const localHeadPositionRef = useRef12(new Vector34());
|
|
@@ -6835,11 +6992,11 @@ function PanoramaXROrigin() {
|
|
|
6835
6992
|
origin.position.copy(localHeadPositionRef.current).multiplyScalar(-1);
|
|
6836
6993
|
origin.updateMatrixWorld();
|
|
6837
6994
|
}, -100);
|
|
6838
|
-
return /* @__PURE__ */
|
|
6995
|
+
return /* @__PURE__ */ jsx10(XROrigin, { ref: originRef });
|
|
6839
6996
|
}
|
|
6840
6997
|
|
|
6841
6998
|
// src/pano-viewer.tsx
|
|
6842
|
-
import { jsx as
|
|
6999
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
6843
7000
|
var DEFAULT_VIEW = {
|
|
6844
7001
|
yaw: 0,
|
|
6845
7002
|
pitch: 0,
|
|
@@ -6884,7 +7041,7 @@ function PanoCursorTree({
|
|
|
6884
7041
|
if (!cursors) {
|
|
6885
7042
|
return children;
|
|
6886
7043
|
}
|
|
6887
|
-
return /* @__PURE__ */
|
|
7044
|
+
return /* @__PURE__ */ jsx11(PanoCursorController, { cursors, children });
|
|
6888
7045
|
}
|
|
6889
7046
|
function PanoVideoHostReset() {
|
|
6890
7047
|
const host = useContext15(PanoVideoHostContext);
|
|
@@ -6905,9 +7062,9 @@ function DefaultControlChannels({
|
|
|
6905
7062
|
return null;
|
|
6906
7063
|
}
|
|
6907
7064
|
return /* @__PURE__ */ jsxs6(DefaultControlChannelContext.Provider, { value: true, children: [
|
|
6908
|
-
userControlsEnabled && mouseChannel.mount && claims.mouse === 0 ? /* @__PURE__ */
|
|
6909
|
-
userControlsEnabled && touchChannel.mount && claims.touch === 0 ? /* @__PURE__ */
|
|
6910
|
-
userControlsEnabled && keyboardChannel.mount && claims.keyboard === 0 ? /* @__PURE__ */
|
|
7065
|
+
userControlsEnabled && mouseChannel.mount && claims.mouse === 0 ? /* @__PURE__ */ jsx11(MouseControls, { ...mouseChannel.props, fovSpeed }) : null,
|
|
7066
|
+
userControlsEnabled && touchChannel.mount && claims.touch === 0 ? /* @__PURE__ */ jsx11(TouchControls, { ...touchChannel.props }) : null,
|
|
7067
|
+
userControlsEnabled && keyboardChannel.mount && claims.keyboard === 0 ? /* @__PURE__ */ jsx11(
|
|
6911
7068
|
KeyboardControls,
|
|
6912
7069
|
{
|
|
6913
7070
|
...keyboardChannel.props,
|
|
@@ -6939,6 +7096,7 @@ var PanoViewer = forwardRef2(
|
|
|
6939
7096
|
const controlsRef = useRef13(null);
|
|
6940
7097
|
const eventBus = useMemo7(() => createPanoEventBus(), []);
|
|
6941
7098
|
const { controls: hotspotAccessibilityControls, registry } = useHotspotAccessibilityLayer();
|
|
7099
|
+
const hotspotTargetRegistry = useMemo7(() => createHotspotTargetRegistry(), []);
|
|
6942
7100
|
const { api: contextMenuOverlayApi, overlay: contextMenuOverlay } = usePanoContextMenuOverlay();
|
|
6943
7101
|
const { api: chromeOverlayApi, setOverlayNode, overlayElement } = usePanoChromeOverlay();
|
|
6944
7102
|
const videoHost = useMemo7(() => createPanoVideoHost(), []);
|
|
@@ -6999,7 +7157,27 @@ var PanoViewer = forwardRef2(
|
|
|
6999
7157
|
return resume;
|
|
7000
7158
|
}, [mediaActivationControls, mediaActivationOptions]);
|
|
7001
7159
|
const hasMediaActivationIntent = mediaActivationRevision >= 0 && hasPanoMediaActivationIntent(mediaActivationHost);
|
|
7002
|
-
const
|
|
7160
|
+
const shouldActivateMedia = mediaActivationOptions !== null && hasMediaActivationIntent && !mediaActivated;
|
|
7161
|
+
useEffect13(() => {
|
|
7162
|
+
if (!shouldActivateMedia) {
|
|
7163
|
+
return;
|
|
7164
|
+
}
|
|
7165
|
+
if (!needsMediaGesture()) {
|
|
7166
|
+
void activateMedia();
|
|
7167
|
+
return;
|
|
7168
|
+
}
|
|
7169
|
+
const handleGesture = () => {
|
|
7170
|
+
removeListeners();
|
|
7171
|
+
void activateMedia();
|
|
7172
|
+
};
|
|
7173
|
+
const removeListeners = () => {
|
|
7174
|
+
window.removeEventListener("pointerdown", handleGesture, true);
|
|
7175
|
+
window.removeEventListener("keydown", handleGesture, true);
|
|
7176
|
+
};
|
|
7177
|
+
window.addEventListener("pointerdown", handleGesture, { capture: true });
|
|
7178
|
+
window.addEventListener("keydown", handleGesture, { capture: true });
|
|
7179
|
+
return removeListeners;
|
|
7180
|
+
}, [activateMedia, shouldActivateMedia]);
|
|
7003
7181
|
const fallbackViewRef = useRef13(DEFAULT_VIEW);
|
|
7004
7182
|
const normalizedMinFov = Math.max(1, Math.min(minFov, maxFov - 1));
|
|
7005
7183
|
const normalizedMaxFov = Math.min(
|
|
@@ -7174,6 +7352,13 @@ var PanoViewer = forwardRef2(
|
|
|
7174
7352
|
reset: () => {
|
|
7175
7353
|
controlsRef.current?.reset();
|
|
7176
7354
|
},
|
|
7355
|
+
lookTo: (position, options) => controlsRef.current?.lookTo(position, options) ?? Promise.resolve({ status: "cancelled" }),
|
|
7356
|
+
moveTo: (position, options) => controlsRef.current?.moveTo(position, options) ?? Promise.resolve({ status: "cancelled" }),
|
|
7357
|
+
zoomTo: (fov, options) => controlsRef.current?.zoomTo(fov, options) ?? Promise.resolve({ status: "cancelled" }),
|
|
7358
|
+
lookToHotspot: (id, options) => {
|
|
7359
|
+
const position = hotspotTargetRegistry.getPosition(id);
|
|
7360
|
+
return position ? controlsRef.current?.lookTo(position, options) ?? Promise.resolve({ status: "cancelled" }) : Promise.resolve({ status: "not-found" });
|
|
7361
|
+
},
|
|
7177
7362
|
activateMedia,
|
|
7178
7363
|
// -- Fullscreen --
|
|
7179
7364
|
enterFullscreen,
|
|
@@ -7231,6 +7416,7 @@ var PanoViewer = forwardRef2(
|
|
|
7231
7416
|
enterFullscreen,
|
|
7232
7417
|
exitFullscreen,
|
|
7233
7418
|
scenesHost,
|
|
7419
|
+
hotspotTargetRegistry,
|
|
7234
7420
|
toggleFullscreen,
|
|
7235
7421
|
videoHost,
|
|
7236
7422
|
webVRHost
|
|
@@ -7254,7 +7440,7 @@ var PanoViewer = forwardRef2(
|
|
|
7254
7440
|
"aria-label": ariaLabel,
|
|
7255
7441
|
style: rootStyle,
|
|
7256
7442
|
children: [
|
|
7257
|
-
/* @__PURE__ */
|
|
7443
|
+
/* @__PURE__ */ jsx11(
|
|
7258
7444
|
Canvas,
|
|
7259
7445
|
{
|
|
7260
7446
|
"aria-label": `${ariaLabel} canvas`,
|
|
@@ -7276,23 +7462,23 @@ var PanoViewer = forwardRef2(
|
|
|
7276
7462
|
...DEFAULT_CANVAS_STYLE,
|
|
7277
7463
|
touchAction: userControlsEnabled ? "none" : "auto"
|
|
7278
7464
|
},
|
|
7279
|
-
children: /* @__PURE__ */
|
|
7465
|
+
children: /* @__PURE__ */ jsx11(XR, { store: xrStore, children: /* @__PURE__ */ jsxs6(
|
|
7280
7466
|
WebVRRuntimeContext.Provider,
|
|
7281
7467
|
{
|
|
7282
7468
|
value: { host: webVRHost, xrStore, stereoView },
|
|
7283
7469
|
children: [
|
|
7284
|
-
/* @__PURE__ */
|
|
7285
|
-
/* @__PURE__ */
|
|
7470
|
+
/* @__PURE__ */ jsx11(PanoramaXROrigin, {}),
|
|
7471
|
+
/* @__PURE__ */ jsx11(HotspotAccessibilityContext.Provider, { value: registry, children: /* @__PURE__ */ jsx11(HotspotTargetRegistryContext.Provider, { value: hotspotTargetRegistry, children: /* @__PURE__ */ jsx11(PanoEventBusContext.Provider, { value: eventBus, children: /* @__PURE__ */ jsx11(PanoCursorTree, { cursors: resolvedCursors, children: /* @__PURE__ */ jsx11(PanoramaViewContext.Provider, { value: controlsRef, children: /* @__PURE__ */ jsx11(
|
|
7286
7472
|
PanoContextMenuOverlayContext.Provider,
|
|
7287
7473
|
{
|
|
7288
7474
|
value: contextMenuOverlayApi,
|
|
7289
|
-
children: /* @__PURE__ */
|
|
7475
|
+
children: /* @__PURE__ */ jsx11(PanoChromeOverlayContext.Provider, { value: chromeOverlayApi, children: /* @__PURE__ */ jsx11(PanoVideoHostContext.Provider, { value: videoHost, children: /* @__PURE__ */ jsx11(PanoFilterHostContext.Provider, { value: filterHost, children: /* @__PURE__ */ jsx11(
|
|
7290
7476
|
PanoContextMenuActionsContext.Provider,
|
|
7291
7477
|
{
|
|
7292
7478
|
value: contextMenuActions,
|
|
7293
|
-
children: /* @__PURE__ */
|
|
7294
|
-
/* @__PURE__ */
|
|
7295
|
-
/* @__PURE__ */
|
|
7479
|
+
children: /* @__PURE__ */ jsx11(ScenesHostContext.Provider, { value: scenesHost, children: /* @__PURE__ */ jsx11(BackgroundAudioHostContext.Provider, { value: bgmHost, children: /* @__PURE__ */ jsxs6(PanoMediaActivationHostContext.Provider, { value: mediaActivationHost, children: [
|
|
7480
|
+
/* @__PURE__ */ jsx11(PanoVideoHostReset, {}),
|
|
7481
|
+
/* @__PURE__ */ jsx11(
|
|
7296
7482
|
PanoramaViewRuntime,
|
|
7297
7483
|
{
|
|
7298
7484
|
ref: controlsRef,
|
|
@@ -7303,7 +7489,7 @@ var PanoViewer = forwardRef2(
|
|
|
7303
7489
|
options: controlOptions
|
|
7304
7490
|
}
|
|
7305
7491
|
),
|
|
7306
|
-
(onViewChange || onPanoramaClick || onPanoramaDoubleClick || onPanoramaPointerMove) && /* @__PURE__ */
|
|
7492
|
+
(onViewChange || onPanoramaClick || onPanoramaDoubleClick || onPanoramaPointerMove) && /* @__PURE__ */ jsx11(
|
|
7307
7493
|
PanoEvents,
|
|
7308
7494
|
{
|
|
7309
7495
|
onViewChange,
|
|
@@ -7312,18 +7498,18 @@ var PanoViewer = forwardRef2(
|
|
|
7312
7498
|
onPointerMove: onPanoramaPointerMove
|
|
7313
7499
|
}
|
|
7314
7500
|
),
|
|
7315
|
-
/* @__PURE__ */
|
|
7501
|
+
/* @__PURE__ */ jsx11(
|
|
7316
7502
|
AutoRotate,
|
|
7317
7503
|
{
|
|
7318
7504
|
enabled: legacyAutoRotate,
|
|
7319
7505
|
speed: legacyAutoRotateOptions.autoRotateSpeed
|
|
7320
7506
|
}
|
|
7321
7507
|
),
|
|
7322
|
-
/* @__PURE__ */
|
|
7323
|
-
contextMenuChannel.mount ? /* @__PURE__ */
|
|
7508
|
+
/* @__PURE__ */ jsx11(PanoramaEventSurface, {}),
|
|
7509
|
+
contextMenuChannel.mount ? /* @__PURE__ */ jsx11(PanoContextMenu, { ...contextMenuChannel.props }) : null,
|
|
7324
7510
|
/* @__PURE__ */ jsxs6(ControlClaimsContext.Provider, { value: controlClaims, children: [
|
|
7325
7511
|
children,
|
|
7326
|
-
/* @__PURE__ */
|
|
7512
|
+
/* @__PURE__ */ jsx11(
|
|
7327
7513
|
DefaultControlChannels,
|
|
7328
7514
|
{
|
|
7329
7515
|
fovSpeed: controlOptions.fovSpeed,
|
|
@@ -7338,7 +7524,7 @@ var PanoViewer = forwardRef2(
|
|
|
7338
7524
|
}
|
|
7339
7525
|
) }) }) })
|
|
7340
7526
|
}
|
|
7341
|
-
) }) }) }) })
|
|
7527
|
+
) }) }) }) }) })
|
|
7342
7528
|
]
|
|
7343
7529
|
}
|
|
7344
7530
|
) })
|
|
@@ -7351,7 +7537,7 @@ var PanoViewer = forwardRef2(
|
|
|
7351
7537
|
"data-pano-chrome-overlay": "",
|
|
7352
7538
|
ref: setOverlayNode,
|
|
7353
7539
|
children: [
|
|
7354
|
-
/* @__PURE__ */
|
|
7540
|
+
/* @__PURE__ */ jsx11(
|
|
7355
7541
|
PanoVideoChromeBridge,
|
|
7356
7542
|
{
|
|
7357
7543
|
fullscreen: contextMenuActions,
|
|
@@ -7359,21 +7545,12 @@ var PanoViewer = forwardRef2(
|
|
|
7359
7545
|
overlayElement
|
|
7360
7546
|
}
|
|
7361
7547
|
),
|
|
7362
|
-
/* @__PURE__ */
|
|
7548
|
+
/* @__PURE__ */ jsx11(WebVRChromeBridge, { host: webVRHost })
|
|
7363
7549
|
]
|
|
7364
7550
|
}
|
|
7365
7551
|
),
|
|
7366
7552
|
contextMenuOverlay,
|
|
7367
|
-
hotspotAccessibilityControls
|
|
7368
|
-
shouldShowMediaActivation ? /* @__PURE__ */ jsx12(
|
|
7369
|
-
PanoMediaActivationOverlay,
|
|
7370
|
-
{
|
|
7371
|
-
...mediaActivationOptions,
|
|
7372
|
-
onActivate: () => {
|
|
7373
|
-
void activateMedia();
|
|
7374
|
-
}
|
|
7375
|
-
}
|
|
7376
|
-
) : null
|
|
7553
|
+
hotspotAccessibilityControls
|
|
7377
7554
|
]
|
|
7378
7555
|
}
|
|
7379
7556
|
);
|
|
@@ -8303,7 +8480,7 @@ import {
|
|
|
8303
8480
|
Vector2 as Vector22,
|
|
8304
8481
|
Vector3 as Vector37
|
|
8305
8482
|
} from "three";
|
|
8306
|
-
import { jsx as
|
|
8483
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
8307
8484
|
var CENTER_NDC = new Vector22(0, 0);
|
|
8308
8485
|
var HUD_DISTANCE = 2;
|
|
8309
8486
|
var RETICLE_SCALE = 1;
|
|
@@ -8478,8 +8655,8 @@ function WebVRReticle({
|
|
|
8478
8655
|
raycast: noopRaycast,
|
|
8479
8656
|
renderOrder: RETICLE_RENDER_ORDER + 1,
|
|
8480
8657
|
children: [
|
|
8481
|
-
/* @__PURE__ */
|
|
8482
|
-
/* @__PURE__ */
|
|
8658
|
+
/* @__PURE__ */ jsx12("boxGeometry", { args: [CROSSHAIR_LENGTH, CROSSHAIR_THICKNESS, 1e-3] }),
|
|
8659
|
+
/* @__PURE__ */ jsx12(
|
|
8483
8660
|
"meshBasicMaterial",
|
|
8484
8661
|
{
|
|
8485
8662
|
color: "#ffffff",
|
|
@@ -8499,8 +8676,8 @@ function WebVRReticle({
|
|
|
8499
8676
|
raycast: noopRaycast,
|
|
8500
8677
|
renderOrder: RETICLE_RENDER_ORDER + 1,
|
|
8501
8678
|
children: [
|
|
8502
|
-
/* @__PURE__ */
|
|
8503
|
-
/* @__PURE__ */
|
|
8679
|
+
/* @__PURE__ */ jsx12("boxGeometry", { args: [CROSSHAIR_THICKNESS, CROSSHAIR_LENGTH, 1e-3] }),
|
|
8680
|
+
/* @__PURE__ */ jsx12(
|
|
8504
8681
|
"meshBasicMaterial",
|
|
8505
8682
|
{
|
|
8506
8683
|
color: "#ffffff",
|
|
@@ -8522,7 +8699,7 @@ function WebVRReticle({
|
|
|
8522
8699
|
renderOrder: RETICLE_RENDER_ORDER + 2,
|
|
8523
8700
|
visible: false,
|
|
8524
8701
|
children: [
|
|
8525
|
-
/* @__PURE__ */
|
|
8702
|
+
/* @__PURE__ */ jsx12(
|
|
8526
8703
|
"ringGeometry",
|
|
8527
8704
|
{
|
|
8528
8705
|
args: [
|
|
@@ -8535,7 +8712,7 @@ function WebVRReticle({
|
|
|
8535
8712
|
]
|
|
8536
8713
|
}
|
|
8537
8714
|
),
|
|
8538
|
-
/* @__PURE__ */
|
|
8715
|
+
/* @__PURE__ */ jsx12(
|
|
8539
8716
|
"meshBasicMaterial",
|
|
8540
8717
|
{
|
|
8541
8718
|
color: "#ffffff",
|
|
@@ -8987,7 +9164,7 @@ function useWebVRWakeLock(enabled) {
|
|
|
8987
9164
|
}
|
|
8988
9165
|
|
|
8989
9166
|
// src/webvr/webvr.tsx
|
|
8990
|
-
import { Fragment as Fragment4, jsx as
|
|
9167
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
8991
9168
|
function initializeSettings(screensize, profile) {
|
|
8992
9169
|
const stored = loadWebVRSettings();
|
|
8993
9170
|
return {
|
|
@@ -9321,7 +9498,7 @@ var WebVR = forwardRef4(function WebVR2({
|
|
|
9321
9498
|
wakelock && (mode === "mobilevr" || mode === "fake")
|
|
9322
9499
|
);
|
|
9323
9500
|
return /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
9324
|
-
/* @__PURE__ */
|
|
9501
|
+
/* @__PURE__ */ jsx13(
|
|
9325
9502
|
Gyro,
|
|
9326
9503
|
{
|
|
9327
9504
|
ref: gyroRef,
|
|
@@ -9335,7 +9512,7 @@ var WebVR = forwardRef4(function WebVR2({
|
|
|
9335
9512
|
touchMode: "off"
|
|
9336
9513
|
}
|
|
9337
9514
|
),
|
|
9338
|
-
/* @__PURE__ */
|
|
9515
|
+
/* @__PURE__ */ jsx13(
|
|
9339
9516
|
WebVRStereoRenderer,
|
|
9340
9517
|
{
|
|
9341
9518
|
mode,
|
|
@@ -9343,7 +9520,7 @@ var WebVR = forwardRef4(function WebVR2({
|
|
|
9343
9520
|
screensize: settings.screensize
|
|
9344
9521
|
}
|
|
9345
9522
|
),
|
|
9346
|
-
/* @__PURE__ */
|
|
9523
|
+
/* @__PURE__ */ jsx13(
|
|
9347
9524
|
WebVRReticle,
|
|
9348
9525
|
{
|
|
9349
9526
|
dwellMs: cursorDwellMs,
|
|
@@ -9364,6 +9541,10 @@ function createPanoViewerHandle(ref) {
|
|
|
9364
9541
|
reset: () => {
|
|
9365
9542
|
ref.current?.reset();
|
|
9366
9543
|
},
|
|
9544
|
+
lookTo: (position, options) => ref.current?.lookTo(position, options) ?? Promise.resolve({ status: "cancelled" }),
|
|
9545
|
+
moveTo: (position, options) => ref.current?.moveTo(position, options) ?? Promise.resolve({ status: "cancelled" }),
|
|
9546
|
+
zoomTo: (fov, options) => ref.current?.zoomTo(fov, options) ?? Promise.resolve({ status: "cancelled" }),
|
|
9547
|
+
lookToHotspot: (id, options) => ref.current?.lookToHotspot(id, options) ?? Promise.resolve({ status: "not-found" }),
|
|
9367
9548
|
activateMedia: () => ref.current?.activateMedia() ?? Promise.resolve(),
|
|
9368
9549
|
enterFullscreen: () => ref.current?.enterFullscreen() ?? Promise.resolve(),
|
|
9369
9550
|
exitFullscreen: () => ref.current?.exitFullscreen() ?? Promise.resolve(),
|
|
@@ -9623,7 +9804,7 @@ diffuseColor.rgb = mix(diffuseColor.rgb, applyPanoFilter(diffuseColor.rgb), clam
|
|
|
9623
9804
|
}
|
|
9624
9805
|
|
|
9625
9806
|
// src/pano-filter/pano-basic-material.tsx
|
|
9626
|
-
import { jsx as
|
|
9807
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
9627
9808
|
function PanoBasicMaterial({
|
|
9628
9809
|
map,
|
|
9629
9810
|
side,
|
|
@@ -9670,7 +9851,7 @@ function PanoBasicMaterial({
|
|
|
9670
9851
|
intensityUniformRef.current.value = snapshot.intensity;
|
|
9671
9852
|
}
|
|
9672
9853
|
}, [snapshot.intensity]);
|
|
9673
|
-
return /* @__PURE__ */
|
|
9854
|
+
return /* @__PURE__ */ jsx14(
|
|
9674
9855
|
"meshBasicMaterial",
|
|
9675
9856
|
{
|
|
9676
9857
|
ref: materialRef,
|
|
@@ -9686,7 +9867,7 @@ function PanoBasicMaterial({
|
|
|
9686
9867
|
}
|
|
9687
9868
|
|
|
9688
9869
|
// src/sphere.tsx
|
|
9689
|
-
import { jsx as
|
|
9870
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
9690
9871
|
function useEquirectTexture(url, anisotropy, generateMipmaps, onLoad, onError) {
|
|
9691
9872
|
const [texture, setTexture] = useState9(null);
|
|
9692
9873
|
const onLoadRef = useRef22(onLoad);
|
|
@@ -9791,8 +9972,8 @@ function Sphere({
|
|
|
9791
9972
|
rotation: [0, MathUtils5.degToRad(90 + yawOffset), 0],
|
|
9792
9973
|
visible,
|
|
9793
9974
|
children: [
|
|
9794
|
-
/* @__PURE__ */
|
|
9795
|
-
/* @__PURE__ */
|
|
9975
|
+
/* @__PURE__ */ jsx15("sphereGeometry", { args: [DEFAULT_PANORAMA_RADIUS, 128, 64] }),
|
|
9976
|
+
/* @__PURE__ */ jsx15(
|
|
9796
9977
|
PanoBasicMaterial,
|
|
9797
9978
|
{
|
|
9798
9979
|
map: displayTexture,
|
|
@@ -9826,7 +10007,7 @@ import {
|
|
|
9826
10007
|
TextureLoader as TextureLoader2,
|
|
9827
10008
|
VideoTexture
|
|
9828
10009
|
} from "three";
|
|
9829
|
-
import { Fragment as Fragment5, jsx as
|
|
10010
|
+
import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
9830
10011
|
var EMPTY_TRACKS = [];
|
|
9831
10012
|
var EMPTY_RATES = DEFAULT_PANO_VIDEO_PLAYBACK_RATES;
|
|
9832
10013
|
function createEmptySnapshot() {
|
|
@@ -10547,8 +10728,8 @@ function PanoVideo({
|
|
|
10547
10728
|
rotation: [0, MathUtils6.degToRad(90 + yawOffset), 0],
|
|
10548
10729
|
visible,
|
|
10549
10730
|
children: [
|
|
10550
|
-
/* @__PURE__ */
|
|
10551
|
-
/* @__PURE__ */
|
|
10731
|
+
/* @__PURE__ */ jsx16("sphereGeometry", { args: [DEFAULT_PANORAMA_RADIUS, 128, 64] }),
|
|
10732
|
+
/* @__PURE__ */ jsx16(
|
|
10552
10733
|
PanoBasicMaterial,
|
|
10553
10734
|
{
|
|
10554
10735
|
map: activeTexture,
|
|
@@ -10559,7 +10740,7 @@ function PanoVideo({
|
|
|
10559
10740
|
]
|
|
10560
10741
|
}
|
|
10561
10742
|
) : null,
|
|
10562
|
-
captionsEnabled ? /* @__PURE__ */
|
|
10743
|
+
captionsEnabled ? /* @__PURE__ */ jsx16(PanoVideoCaptions, { appearance: typeof captions === "object" ? captions : void 0 }) : null
|
|
10563
10744
|
] });
|
|
10564
10745
|
}
|
|
10565
10746
|
|
|
@@ -10691,7 +10872,7 @@ function overlayProgress(elapsedTime, duration, startTime) {
|
|
|
10691
10872
|
}
|
|
10692
10873
|
|
|
10693
10874
|
// src/scene-transitions/particle-overlay.tsx
|
|
10694
|
-
import { jsx as
|
|
10875
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
10695
10876
|
var PARTICLE_GRID = 48;
|
|
10696
10877
|
var PARTICLE_COUNT = PARTICLE_GRID * PARTICLE_GRID;
|
|
10697
10878
|
var PARTICLE_VERTEX_SHADER = `
|
|
@@ -10813,7 +10994,7 @@ function ParticleOverlay({
|
|
|
10813
10994
|
onFinish();
|
|
10814
10995
|
}
|
|
10815
10996
|
});
|
|
10816
|
-
return /* @__PURE__ */
|
|
10997
|
+
return /* @__PURE__ */ jsx17(
|
|
10817
10998
|
"mesh",
|
|
10818
10999
|
{
|
|
10819
11000
|
ref: meshRef,
|
|
@@ -11107,7 +11288,7 @@ function createSnapshotMaterial(preset, texture) {
|
|
|
11107
11288
|
}
|
|
11108
11289
|
|
|
11109
11290
|
// src/scene-transitions/snapshot-overlay.tsx
|
|
11110
|
-
import { jsx as
|
|
11291
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
11111
11292
|
function SnapshotOverlay({
|
|
11112
11293
|
snapshot,
|
|
11113
11294
|
transition,
|
|
@@ -11157,20 +11338,20 @@ function SnapshotOverlay({
|
|
|
11157
11338
|
return null;
|
|
11158
11339
|
}
|
|
11159
11340
|
return /* @__PURE__ */ jsxs11("mesh", { ref: meshRef, renderOrder: OVERLAY_RENDER_ORDER, frustumCulled: false, children: [
|
|
11160
|
-
/* @__PURE__ */
|
|
11161
|
-
/* @__PURE__ */
|
|
11341
|
+
/* @__PURE__ */ jsx18("primitive", { attach: "geometry", object: FULLSCREEN_PLANE }),
|
|
11342
|
+
/* @__PURE__ */ jsx18("primitive", { attach: "material", object: material })
|
|
11162
11343
|
] });
|
|
11163
11344
|
}
|
|
11164
11345
|
|
|
11165
11346
|
// src/scene-transitions/transition-overlay.tsx
|
|
11166
|
-
import { jsx as
|
|
11347
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
11167
11348
|
function TransitionOverlay(props) {
|
|
11168
11349
|
const { preset } = props.transition;
|
|
11169
11350
|
switch (preset) {
|
|
11170
11351
|
case "none":
|
|
11171
11352
|
return null;
|
|
11172
11353
|
case "particles":
|
|
11173
|
-
return /* @__PURE__ */
|
|
11354
|
+
return /* @__PURE__ */ jsx19(ParticleOverlay, { ...props });
|
|
11174
11355
|
case "crossfade":
|
|
11175
11356
|
case "zoom":
|
|
11176
11357
|
case "blackout":
|
|
@@ -11198,7 +11379,7 @@ function TransitionOverlay(props) {
|
|
|
11198
11379
|
case "zoomBlur":
|
|
11199
11380
|
case "hexDissolve":
|
|
11200
11381
|
case "filmBurn":
|
|
11201
|
-
return /* @__PURE__ */
|
|
11382
|
+
return /* @__PURE__ */ jsx19(SnapshotOverlay, { ...props });
|
|
11202
11383
|
default: {
|
|
11203
11384
|
const exhaustive = preset;
|
|
11204
11385
|
void exhaustive;
|
|
@@ -11210,7 +11391,7 @@ function TransitionOverlay(props) {
|
|
|
11210
11391
|
// src/tile/texture-manager-context.tsx
|
|
11211
11392
|
import { useThree as useThree17 } from "@react-three/fiber";
|
|
11212
11393
|
import {
|
|
11213
|
-
createContext as
|
|
11394
|
+
createContext as createContext15,
|
|
11214
11395
|
useContext as useContext22,
|
|
11215
11396
|
useEffect as useEffect25,
|
|
11216
11397
|
useMemo as useMemo18
|
|
@@ -11443,8 +11624,8 @@ var TileTextureManager = class {
|
|
|
11443
11624
|
};
|
|
11444
11625
|
|
|
11445
11626
|
// src/tile/texture-manager-context.tsx
|
|
11446
|
-
import { jsx as
|
|
11447
|
-
var TileTextureManagerContext =
|
|
11627
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
11628
|
+
var TileTextureManagerContext = createContext15(
|
|
11448
11629
|
null
|
|
11449
11630
|
);
|
|
11450
11631
|
function TileTextureManagerProvider({
|
|
@@ -11467,7 +11648,7 @@ function TileTextureManagerProvider({
|
|
|
11467
11648
|
manager.resume();
|
|
11468
11649
|
return () => manager.dispose();
|
|
11469
11650
|
}, [manager]);
|
|
11470
|
-
return /* @__PURE__ */
|
|
11651
|
+
return /* @__PURE__ */ jsx20(TileTextureManagerContext.Provider, { value: manager, children });
|
|
11471
11652
|
}
|
|
11472
11653
|
function useSharedTileTextureManager() {
|
|
11473
11654
|
return useContext22(TileTextureManagerContext);
|
|
@@ -11676,7 +11857,7 @@ function resolveTemplateUrl(template, address) {
|
|
|
11676
11857
|
}
|
|
11677
11858
|
|
|
11678
11859
|
// src/tile/tile.tsx
|
|
11679
|
-
import { jsx as
|
|
11860
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
11680
11861
|
var MAX_LOD_UPDATE_INTERVAL_MS = 100;
|
|
11681
11862
|
var FAST_ROTATION_THRESHOLD_RADIANS = Math.PI / 180;
|
|
11682
11863
|
var FAST_FOV_THRESHOLD_DEGREES = 0.5;
|
|
@@ -11763,14 +11944,14 @@ function PreviewFace({
|
|
|
11763
11944
|
[geometry]
|
|
11764
11945
|
);
|
|
11765
11946
|
const transform = getFaceTransform(face, PREVIEW_RADIUS);
|
|
11766
|
-
return /* @__PURE__ */
|
|
11947
|
+
return /* @__PURE__ */ jsx21(
|
|
11767
11948
|
"mesh",
|
|
11768
11949
|
{
|
|
11769
11950
|
geometry,
|
|
11770
11951
|
position: transform.position,
|
|
11771
11952
|
renderOrder: -100,
|
|
11772
11953
|
rotation: transform.rotation,
|
|
11773
|
-
children: /* @__PURE__ */
|
|
11954
|
+
children: /* @__PURE__ */ jsx21(
|
|
11774
11955
|
PanoBasicMaterial,
|
|
11775
11956
|
{
|
|
11776
11957
|
depthTest: false,
|
|
@@ -11786,7 +11967,7 @@ function PreviewCube({
|
|
|
11786
11967
|
texture,
|
|
11787
11968
|
faceOrder
|
|
11788
11969
|
}) {
|
|
11789
|
-
return CUBE_FACES.map((face) => /* @__PURE__ */
|
|
11970
|
+
return CUBE_FACES.map((face) => /* @__PURE__ */ jsx21(
|
|
11790
11971
|
PreviewFace,
|
|
11791
11972
|
{
|
|
11792
11973
|
face,
|
|
@@ -11831,14 +12012,14 @@ var TileMesh = memo(function TileMesh2({
|
|
|
11831
12012
|
if (!snapshot.texture) {
|
|
11832
12013
|
return null;
|
|
11833
12014
|
}
|
|
11834
|
-
return /* @__PURE__ */
|
|
12015
|
+
return /* @__PURE__ */ jsx21("group", { position: transform.position, rotation: transform.rotation, children: /* @__PURE__ */ jsx21(
|
|
11835
12016
|
"mesh",
|
|
11836
12017
|
{
|
|
11837
12018
|
geometry: SHARED_TILE_GEOMETRY,
|
|
11838
12019
|
position: [layout.x, layout.y, 0],
|
|
11839
12020
|
renderOrder,
|
|
11840
12021
|
scale: [layout.width, layout.height, 1],
|
|
11841
|
-
children: /* @__PURE__ */
|
|
12022
|
+
children: /* @__PURE__ */ jsx21(
|
|
11842
12023
|
PanoBasicMaterial,
|
|
11843
12024
|
{
|
|
11844
12025
|
depthTest: false,
|
|
@@ -11855,7 +12036,7 @@ var TileLayerMeshes = memo(function TileLayerMeshes2({
|
|
|
11855
12036
|
manager,
|
|
11856
12037
|
resolveUrl
|
|
11857
12038
|
}) {
|
|
11858
|
-
return layer.addresses.map((address) => /* @__PURE__ */
|
|
12039
|
+
return layer.addresses.map((address) => /* @__PURE__ */ jsx21(
|
|
11859
12040
|
TileMesh,
|
|
11860
12041
|
{
|
|
11861
12042
|
address,
|
|
@@ -12193,14 +12374,14 @@ function Tile({
|
|
|
12193
12374
|
commitLayers(nextLayers);
|
|
12194
12375
|
});
|
|
12195
12376
|
return /* @__PURE__ */ jsxs12("group", { visible, children: [
|
|
12196
|
-
previewTexture ? /* @__PURE__ */
|
|
12377
|
+
previewTexture ? /* @__PURE__ */ jsx21(
|
|
12197
12378
|
PreviewCube,
|
|
12198
12379
|
{
|
|
12199
12380
|
texture: previewTexture,
|
|
12200
12381
|
faceOrder: previewFaceOrder
|
|
12201
12382
|
}
|
|
12202
12383
|
) : null,
|
|
12203
|
-
layers.map((layer) => /* @__PURE__ */
|
|
12384
|
+
layers.map((layer) => /* @__PURE__ */ jsx21(
|
|
12204
12385
|
TileLayerMeshes,
|
|
12205
12386
|
{
|
|
12206
12387
|
layer,
|
|
@@ -12213,7 +12394,7 @@ function Tile({
|
|
|
12213
12394
|
}
|
|
12214
12395
|
|
|
12215
12396
|
// src/scenes.tsx
|
|
12216
|
-
import { jsx as
|
|
12397
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
12217
12398
|
function SceneSource({
|
|
12218
12399
|
scene,
|
|
12219
12400
|
visible,
|
|
@@ -12226,7 +12407,7 @@ function SceneSource({
|
|
|
12226
12407
|
}
|
|
12227
12408
|
switch (scene.type) {
|
|
12228
12409
|
case "sphere":
|
|
12229
|
-
return /* @__PURE__ */
|
|
12410
|
+
return /* @__PURE__ */ jsx22(
|
|
12230
12411
|
Sphere,
|
|
12231
12412
|
{
|
|
12232
12413
|
src: scene.src,
|
|
@@ -12239,7 +12420,7 @@ function SceneSource({
|
|
|
12239
12420
|
);
|
|
12240
12421
|
case "tile": {
|
|
12241
12422
|
const { id: _id, type: _type, ...tileProps } = scene;
|
|
12242
|
-
return /* @__PURE__ */
|
|
12423
|
+
return /* @__PURE__ */ jsx22(
|
|
12243
12424
|
Tile,
|
|
12244
12425
|
{
|
|
12245
12426
|
...tileProps,
|
|
@@ -12507,7 +12688,7 @@ function ScenesController({
|
|
|
12507
12688
|
const renderedScene = slots[liveSlot];
|
|
12508
12689
|
const snapshotVisible = snapshot !== null && (phase === "transitioning" || phase === "recapturing" || phase === "preloading");
|
|
12509
12690
|
return /* @__PURE__ */ jsxs13(Fragment6, { children: [
|
|
12510
|
-
/* @__PURE__ */
|
|
12691
|
+
/* @__PURE__ */ jsx22(
|
|
12511
12692
|
SnapshotCapture,
|
|
12512
12693
|
{
|
|
12513
12694
|
requestId: captureRequestId,
|
|
@@ -12519,7 +12700,7 @@ function ScenesController({
|
|
|
12519
12700
|
const source = slots[slot];
|
|
12520
12701
|
const isLive = slot === liveSlot;
|
|
12521
12702
|
const isPending = slot === pendingSlot;
|
|
12522
|
-
return /* @__PURE__ */
|
|
12703
|
+
return /* @__PURE__ */ jsx22(
|
|
12523
12704
|
SceneSource,
|
|
12524
12705
|
{
|
|
12525
12706
|
scene: source,
|
|
@@ -12535,7 +12716,7 @@ function ScenesController({
|
|
|
12535
12716
|
`${slot}:${source?.id ?? "empty"}:${recoveryKey}`
|
|
12536
12717
|
);
|
|
12537
12718
|
}),
|
|
12538
|
-
snapshotVisible ? /* @__PURE__ */
|
|
12719
|
+
snapshotVisible ? /* @__PURE__ */ jsx22(
|
|
12539
12720
|
TransitionOverlay,
|
|
12540
12721
|
{
|
|
12541
12722
|
snapshot,
|
|
@@ -12628,12 +12809,12 @@ function Scenes({
|
|
|
12628
12809
|
}
|
|
12629
12810
|
};
|
|
12630
12811
|
}, [host, requestSceneChange]);
|
|
12631
|
-
return /* @__PURE__ */
|
|
12812
|
+
return /* @__PURE__ */ jsx22(
|
|
12632
12813
|
TileTextureManagerProvider,
|
|
12633
12814
|
{
|
|
12634
12815
|
maxTextureMemoryMb,
|
|
12635
12816
|
maxConcurrentLoads: maxConcurrentTileLoads,
|
|
12636
|
-
children: /* @__PURE__ */
|
|
12817
|
+
children: /* @__PURE__ */ jsx22(
|
|
12637
12818
|
ScenesController,
|
|
12638
12819
|
{
|
|
12639
12820
|
...rest,
|
|
@@ -12686,7 +12867,7 @@ import { useEffect as useEffect28, useMemo as useMemo21, useState as useState13
|
|
|
12686
12867
|
// src/webvr/stereo-html.tsx
|
|
12687
12868
|
import { Html } from "@react-three/drei";
|
|
12688
12869
|
import { useContext as useContext24, useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
12689
|
-
import { Fragment as Fragment7, jsx as
|
|
12870
|
+
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
12690
12871
|
function useFallbackStereoView() {
|
|
12691
12872
|
const runtime = useContext24(WebVRRuntimeContext);
|
|
12692
12873
|
const host = runtime?.host ?? null;
|
|
@@ -12711,10 +12892,10 @@ function stereoCalculatePosition(eye, stereoView) {
|
|
|
12711
12892
|
function PanoHtml({ children, ...htmlProps }) {
|
|
12712
12893
|
const stereoView = useFallbackStereoView();
|
|
12713
12894
|
if (!stereoView) {
|
|
12714
|
-
return /* @__PURE__ */
|
|
12895
|
+
return /* @__PURE__ */ jsx23(Html, { ...htmlProps, children });
|
|
12715
12896
|
}
|
|
12716
12897
|
return /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
12717
|
-
/* @__PURE__ */
|
|
12898
|
+
/* @__PURE__ */ jsx23(
|
|
12718
12899
|
Html,
|
|
12719
12900
|
{
|
|
12720
12901
|
...htmlProps,
|
|
@@ -12722,7 +12903,7 @@ function PanoHtml({ children, ...htmlProps }) {
|
|
|
12722
12903
|
children
|
|
12723
12904
|
}
|
|
12724
12905
|
),
|
|
12725
|
-
/* @__PURE__ */
|
|
12906
|
+
/* @__PURE__ */ jsx23(
|
|
12726
12907
|
Html,
|
|
12727
12908
|
{
|
|
12728
12909
|
...htmlProps,
|
|
@@ -12735,7 +12916,7 @@ function PanoHtml({ children, ...htmlProps }) {
|
|
|
12735
12916
|
}
|
|
12736
12917
|
|
|
12737
12918
|
// src/hotspot/hotspot-tooltip.tsx
|
|
12738
|
-
import { jsx as
|
|
12919
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
12739
12920
|
var DEFAULT_HOTSPOT_TOOLTIP_OFFSET = 12;
|
|
12740
12921
|
var DEFAULT_HOTSPOT_TOOLTIP_APPEARANCE = {
|
|
12741
12922
|
background: "rgba(22, 22, 22, 0.72)",
|
|
@@ -12832,14 +13013,14 @@ function HotspotTooltip({
|
|
|
12832
13013
|
if (!showImage && !content.text) {
|
|
12833
13014
|
return null;
|
|
12834
13015
|
}
|
|
12835
|
-
return /* @__PURE__ */
|
|
13016
|
+
return /* @__PURE__ */ jsx24(PanoHtml, { pointerEvents: "none", style: WRAPPER_STYLE, zIndexRange: [20, 10], children: /* @__PURE__ */ jsxs15(
|
|
12836
13017
|
"div",
|
|
12837
13018
|
{
|
|
12838
13019
|
className: "pano-hotspot-tooltip",
|
|
12839
13020
|
role: "tooltip",
|
|
12840
13021
|
style: bubbleStyle,
|
|
12841
13022
|
children: [
|
|
12842
|
-
showImage ? /* @__PURE__ */
|
|
13023
|
+
showImage ? /* @__PURE__ */ jsx24(
|
|
12843
13024
|
"img",
|
|
12844
13025
|
{
|
|
12845
13026
|
alt: content.imageAlt ?? content.text ?? "",
|
|
@@ -12848,14 +13029,14 @@ function HotspotTooltip({
|
|
|
12848
13029
|
src: content.image
|
|
12849
13030
|
}
|
|
12850
13031
|
) : null,
|
|
12851
|
-
content.text ? /* @__PURE__ */
|
|
13032
|
+
content.text ? /* @__PURE__ */ jsx24("p", { className: "pano-hotspot-tooltip-text", children: content.text }) : null
|
|
12852
13033
|
]
|
|
12853
13034
|
}
|
|
12854
13035
|
) });
|
|
12855
13036
|
}
|
|
12856
13037
|
|
|
12857
13038
|
// src/hotspot/hotspot-anchor.tsx
|
|
12858
|
-
import { jsx as
|
|
13039
|
+
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
12859
13040
|
var DEFAULT_FLOATING_DISTANCE = 10;
|
|
12860
13041
|
var PANORAMA_RADIUS = DEFAULT_PANORAMA_RADIUS;
|
|
12861
13042
|
var PANORAMA_SURFACE_INSET = 4;
|
|
@@ -13193,6 +13374,7 @@ function HotspotAnchor({
|
|
|
13193
13374
|
onDragEnd
|
|
13194
13375
|
}) {
|
|
13195
13376
|
const controlsRef = useContext25(PanoramaViewContext);
|
|
13377
|
+
const hotspotTargetRegistry = useContext25(HotspotTargetRegistryContext);
|
|
13196
13378
|
const eventBus = useContext25(PanoEventBusContext);
|
|
13197
13379
|
const cursorApi = usePanoCursor();
|
|
13198
13380
|
const { camera, size } = useThree20();
|
|
@@ -13208,6 +13390,12 @@ function HotspotAnchor({
|
|
|
13208
13390
|
[tooltip]
|
|
13209
13391
|
);
|
|
13210
13392
|
const normalizedPosition = normalizePanoPosition(position);
|
|
13393
|
+
useEffect29(() => {
|
|
13394
|
+
if (!hotspotTargetRegistry) {
|
|
13395
|
+
return;
|
|
13396
|
+
}
|
|
13397
|
+
return hotspotTargetRegistry.register(id, normalizedPosition);
|
|
13398
|
+
}, [hotspotTargetRegistry, id, normalizedPosition.pitch, normalizedPosition.yaw]);
|
|
13211
13399
|
const rendering = internalOrientation && internalPlacement ? { orientation: internalOrientation, placement: internalPlacement } : HOTSPOT_MODE_RENDERING[mode];
|
|
13212
13400
|
const { orientation: orientation2, placement } = rendering;
|
|
13213
13401
|
const resolvedScale = resolveScale(scale);
|
|
@@ -13495,18 +13683,18 @@ function HotspotAnchor({
|
|
|
13495
13683
|
} : void 0,
|
|
13496
13684
|
onPointerUp: acceptsPointer ? (event) => releasePointer(event, true) : void 0,
|
|
13497
13685
|
children: [
|
|
13498
|
-
focused ? focusContent ?? /* @__PURE__ */
|
|
13686
|
+
focused ? focusContent ?? /* @__PURE__ */ jsx25(
|
|
13499
13687
|
"lineSegments",
|
|
13500
13688
|
{
|
|
13501
13689
|
geometry: focusGeometry,
|
|
13502
13690
|
position: [0, 0, 0.01],
|
|
13503
13691
|
renderOrder: renderOrder + 1,
|
|
13504
13692
|
scale: [1.12, 1.12, 1],
|
|
13505
|
-
children: /* @__PURE__ */
|
|
13693
|
+
children: /* @__PURE__ */ jsx25("lineBasicMaterial", { color: "#f5fbfc", depthTest: false })
|
|
13506
13694
|
}
|
|
13507
13695
|
) : null,
|
|
13508
13696
|
children,
|
|
13509
|
-
tooltipOpen && tooltipContent ? /* @__PURE__ */
|
|
13697
|
+
tooltipOpen && tooltipContent ? /* @__PURE__ */ jsx25("group", { ref: tooltipAnchorRef, children: /* @__PURE__ */ jsx25(
|
|
13510
13698
|
HotspotTooltip,
|
|
13511
13699
|
{
|
|
13512
13700
|
appearance: tooltipAppearance,
|
|
@@ -13527,7 +13715,7 @@ import {
|
|
|
13527
13715
|
MeshBasicMaterial,
|
|
13528
13716
|
Vector2 as Vector26
|
|
13529
13717
|
} from "three";
|
|
13530
|
-
import { jsx as
|
|
13718
|
+
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
13531
13719
|
var HOTSPOT_ALPHA_CUTOFF = 0.05;
|
|
13532
13720
|
var SAMPLE_UV = new Vector26();
|
|
13533
13721
|
var RAYCAST_HITS = [];
|
|
@@ -13630,8 +13818,8 @@ function HotspotPlane({
|
|
|
13630
13818
|
opacity
|
|
13631
13819
|
}) {
|
|
13632
13820
|
return /* @__PURE__ */ jsxs17("mesh", { raycast: hotspotPlaneRaycast, children: [
|
|
13633
|
-
/* @__PURE__ */
|
|
13634
|
-
/* @__PURE__ */
|
|
13821
|
+
/* @__PURE__ */ jsx26("planeGeometry", { args: [1, 1] }),
|
|
13822
|
+
/* @__PURE__ */ jsx26(
|
|
13635
13823
|
"meshBasicMaterial",
|
|
13636
13824
|
{
|
|
13637
13825
|
alphaTest: HOTSPOT_ALPHA_CUTOFF,
|
|
@@ -13647,7 +13835,7 @@ function HotspotPlane({
|
|
|
13647
13835
|
}
|
|
13648
13836
|
|
|
13649
13837
|
// src/hotspot/image-hotspot.tsx
|
|
13650
|
-
import { jsx as
|
|
13838
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
13651
13839
|
function useHotspotImageTexture(src, onLoad, onError) {
|
|
13652
13840
|
const gl = useThree21((state) => state.gl);
|
|
13653
13841
|
const [texture, setTexture] = useState15(null);
|
|
@@ -13711,7 +13899,7 @@ function ImageHotspot({
|
|
|
13711
13899
|
...anchorProps
|
|
13712
13900
|
}) {
|
|
13713
13901
|
const texture = useHotspotImageTexture(src, onLoad, onError);
|
|
13714
|
-
return /* @__PURE__ */
|
|
13902
|
+
return /* @__PURE__ */ jsx27(HotspotAnchor, { ...anchorProps, height, width, children: /* @__PURE__ */ jsx27(HotspotPlane, { map: texture, opacity }) });
|
|
13715
13903
|
}
|
|
13716
13904
|
|
|
13717
13905
|
// src/hotspot/polygon-hotspot.tsx
|
|
@@ -13736,7 +13924,7 @@ import {
|
|
|
13736
13924
|
PerspectiveCamera as PerspectiveCamera6,
|
|
13737
13925
|
Vector3 as Vector314
|
|
13738
13926
|
} from "three";
|
|
13739
|
-
import { jsx as
|
|
13927
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
13740
13928
|
var LINE_WORLD_POSITION = new Vector314();
|
|
13741
13929
|
function applyScreenSpaceDashScale(object, camera, viewportHeight) {
|
|
13742
13930
|
const material = object?.material;
|
|
@@ -13782,7 +13970,7 @@ function HotspotStrokeLine({
|
|
|
13782
13970
|
}
|
|
13783
13971
|
applyScreenSpaceDashScale(lineRef.current, state.camera, state.size.height);
|
|
13784
13972
|
});
|
|
13785
|
-
return /* @__PURE__ */
|
|
13973
|
+
return /* @__PURE__ */ jsx28(
|
|
13786
13974
|
Line,
|
|
13787
13975
|
{
|
|
13788
13976
|
ref: lineRef,
|
|
@@ -13804,7 +13992,7 @@ function HotspotStrokeLine({
|
|
|
13804
13992
|
}
|
|
13805
13993
|
|
|
13806
13994
|
// src/hotspot/polygon-hotspot.tsx
|
|
13807
|
-
import { jsx as
|
|
13995
|
+
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
13808
13996
|
var POLYGON_RADIUS = 990;
|
|
13809
13997
|
var MAX_FILL_SEGMENT_DEGREES = 7;
|
|
13810
13998
|
function cloneVertices(vertices) {
|
|
@@ -14107,7 +14295,7 @@ function PolygonHotspot({
|
|
|
14107
14295
|
draggable,
|
|
14108
14296
|
interactive,
|
|
14109
14297
|
useAngularScale: false,
|
|
14110
|
-
focusContent: /* @__PURE__ */
|
|
14298
|
+
focusContent: /* @__PURE__ */ jsx29(
|
|
14111
14299
|
HotspotStrokeLine,
|
|
14112
14300
|
{
|
|
14113
14301
|
color: "#75cbd3",
|
|
@@ -14129,7 +14317,7 @@ function PolygonHotspot({
|
|
|
14129
14317
|
startVerticesRef.current = null;
|
|
14130
14318
|
},
|
|
14131
14319
|
children: [
|
|
14132
|
-
/* @__PURE__ */
|
|
14320
|
+
/* @__PURE__ */ jsx29("mesh", { geometry: fillGeometry, renderOrder, children: /* @__PURE__ */ jsx29(
|
|
14133
14321
|
"meshBasicMaterial",
|
|
14134
14322
|
{
|
|
14135
14323
|
color: fill,
|
|
@@ -14139,7 +14327,7 @@ function PolygonHotspot({
|
|
|
14139
14327
|
transparent: true
|
|
14140
14328
|
}
|
|
14141
14329
|
) }),
|
|
14142
|
-
/* @__PURE__ */
|
|
14330
|
+
/* @__PURE__ */ jsx29(
|
|
14143
14331
|
HotspotStrokeLine,
|
|
14144
14332
|
{
|
|
14145
14333
|
color: stroke,
|
|
@@ -14164,7 +14352,7 @@ import {
|
|
|
14164
14352
|
Quaternion as Quaternion5,
|
|
14165
14353
|
Vector3 as Vector316
|
|
14166
14354
|
} from "three";
|
|
14167
|
-
import { jsx as
|
|
14355
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
14168
14356
|
var POLYLINE_RADIUS = 990;
|
|
14169
14357
|
var MAX_SEGMENT_DEGREES = 7;
|
|
14170
14358
|
function cloneVertices2(vertices) {
|
|
@@ -14304,7 +14492,7 @@ function PolylineHotspot({
|
|
|
14304
14492
|
startPosition: event.startPosition
|
|
14305
14493
|
});
|
|
14306
14494
|
};
|
|
14307
|
-
return /* @__PURE__ */
|
|
14495
|
+
return /* @__PURE__ */ jsx30(
|
|
14308
14496
|
HotspotAnchor,
|
|
14309
14497
|
{
|
|
14310
14498
|
...anchorProps,
|
|
@@ -14318,7 +14506,7 @@ function PolylineHotspot({
|
|
|
14318
14506
|
renderOrder,
|
|
14319
14507
|
draggable,
|
|
14320
14508
|
useAngularScale: false,
|
|
14321
|
-
focusContent: /* @__PURE__ */
|
|
14509
|
+
focusContent: /* @__PURE__ */ jsx30(
|
|
14322
14510
|
HotspotStrokeLine,
|
|
14323
14511
|
{
|
|
14324
14512
|
color: "#75cbd3",
|
|
@@ -14339,7 +14527,7 @@ function PolylineHotspot({
|
|
|
14339
14527
|
emitVerticesChange(event, onDragEnd);
|
|
14340
14528
|
startVerticesRef.current = null;
|
|
14341
14529
|
},
|
|
14342
|
-
children: /* @__PURE__ */
|
|
14530
|
+
children: /* @__PURE__ */ jsx30(
|
|
14343
14531
|
HotspotStrokeLine,
|
|
14344
14532
|
{
|
|
14345
14533
|
color: stroke,
|
|
@@ -14364,7 +14552,7 @@ import {
|
|
|
14364
14552
|
LinearMipmapLinearFilter as LinearMipmapLinearFilter4,
|
|
14365
14553
|
SRGBColorSpace as SRGBColorSpace6
|
|
14366
14554
|
} from "three";
|
|
14367
|
-
import { jsx as
|
|
14555
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
14368
14556
|
var GRAPHIC_TEXTURE_SIZE = 512;
|
|
14369
14557
|
function resolveStrokeWidth(value) {
|
|
14370
14558
|
return Number.isFinite(value) ? Math.max(value, 0) : 8;
|
|
@@ -14584,15 +14772,15 @@ function CanvasGraphicHotspot({
|
|
|
14584
14772
|
...anchorProps
|
|
14585
14773
|
}) {
|
|
14586
14774
|
const texture = useGraphicTexture(graphic, width, height, onLoad, onError);
|
|
14587
|
-
return /* @__PURE__ */
|
|
14775
|
+
return /* @__PURE__ */ jsx31(HotspotAnchor, { ...anchorProps, height, width, children: /* @__PURE__ */ jsx31(HotspotPlane, { map: texture, opacity }) });
|
|
14588
14776
|
}
|
|
14589
14777
|
function GraphicHotspot(props) {
|
|
14590
14778
|
const { graphic, ...restProps } = props;
|
|
14591
14779
|
if (graphic.kind === "svg") {
|
|
14592
14780
|
const imageProps = restProps;
|
|
14593
|
-
return /* @__PURE__ */
|
|
14781
|
+
return /* @__PURE__ */ jsx31(ImageHotspot, { ...imageProps, src: graphic.src });
|
|
14594
14782
|
}
|
|
14595
|
-
return /* @__PURE__ */
|
|
14783
|
+
return /* @__PURE__ */ jsx31(CanvasGraphicHotspot, { ...restProps, graphic });
|
|
14596
14784
|
}
|
|
14597
14785
|
|
|
14598
14786
|
// src/hotspot/sequence-hotspot.tsx
|
|
@@ -14605,7 +14793,7 @@ import {
|
|
|
14605
14793
|
SRGBColorSpace as SRGBColorSpace7,
|
|
14606
14794
|
TextureLoader as TextureLoader6
|
|
14607
14795
|
} from "three";
|
|
14608
|
-
import { jsx as
|
|
14796
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
14609
14797
|
var DEFAULT_SEQUENCE_FPS = 12;
|
|
14610
14798
|
function resolveFps(value) {
|
|
14611
14799
|
return Number.isFinite(value) && value > 0 ? value : DEFAULT_SEQUENCE_FPS;
|
|
@@ -14781,7 +14969,7 @@ function SequenceHotspot({
|
|
|
14781
14969
|
onFrameChangeRef.current?.({ id, index: nextIndex, src });
|
|
14782
14970
|
}
|
|
14783
14971
|
});
|
|
14784
|
-
return /* @__PURE__ */
|
|
14972
|
+
return /* @__PURE__ */ jsx32(HotspotAnchor, { ...anchorProps, id, height, width, children: /* @__PURE__ */ jsx32(HotspotPlane, { map: texture, opacity }) });
|
|
14785
14973
|
}
|
|
14786
14974
|
|
|
14787
14975
|
// src/hotspot/video-hotspot.tsx
|
|
@@ -14795,7 +14983,7 @@ import {
|
|
|
14795
14983
|
TextureLoader as TextureLoader7,
|
|
14796
14984
|
VideoTexture as VideoTexture2
|
|
14797
14985
|
} from "three";
|
|
14798
|
-
import { jsx as
|
|
14986
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
14799
14987
|
function clampVolume2(volume) {
|
|
14800
14988
|
if (!Number.isFinite(volume)) {
|
|
14801
14989
|
return 1;
|
|
@@ -15020,7 +15208,7 @@ function VideoHotspot({
|
|
|
15020
15208
|
};
|
|
15021
15209
|
}, [playing, resource]);
|
|
15022
15210
|
const activeTexture = resource?.ready ? resource.texture : posterTexture;
|
|
15023
|
-
return /* @__PURE__ */
|
|
15211
|
+
return /* @__PURE__ */ jsx33(HotspotAnchor, { ...anchorProps, id, height, width, children: /* @__PURE__ */ jsx33(HotspotPlane, { map: activeTexture, opacity }) });
|
|
15024
15212
|
}
|
|
15025
15213
|
|
|
15026
15214
|
// src/hotspot/audio-hotspot.tsx
|
|
@@ -15034,7 +15222,7 @@ import {
|
|
|
15034
15222
|
SRGBColorSpace as SRGBColorSpace9,
|
|
15035
15223
|
TextureLoader as TextureLoader8
|
|
15036
15224
|
} from "three";
|
|
15037
|
-
import { jsx as
|
|
15225
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
15038
15226
|
var SPEAKER_TEXTURE_SIZE = 512;
|
|
15039
15227
|
function paintSpeakerBody(context, center) {
|
|
15040
15228
|
context.fillStyle = "#f5fbfc";
|
|
@@ -15319,7 +15507,7 @@ function AudioHotspot({
|
|
|
15319
15507
|
howl.mute(mutedRef.current);
|
|
15320
15508
|
howl.volume(clampAudioVolume(volumeRef.current) * spatial.gain);
|
|
15321
15509
|
});
|
|
15322
|
-
return /* @__PURE__ */
|
|
15510
|
+
return /* @__PURE__ */ jsx34(HotspotAnchor, { ...anchorProps, id, height, width, children: marker ? /* @__PURE__ */ jsx34(HotspotPlane, { map: markerTexture, opacity }) : null });
|
|
15323
15511
|
}
|
|
15324
15512
|
|
|
15325
15513
|
// src/hotspot/text-hotspot.tsx
|
|
@@ -15331,7 +15519,7 @@ import {
|
|
|
15331
15519
|
LinearMipmapLinearFilter as LinearMipmapLinearFilter8,
|
|
15332
15520
|
SRGBColorSpace as SRGBColorSpace10
|
|
15333
15521
|
} from "three";
|
|
15334
|
-
import { jsx as
|
|
15522
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
15335
15523
|
var TEXT_TEXTURE_LONG_SIDE = 1024;
|
|
15336
15524
|
var DEFAULT_FONT_FAMILY = "system-ui, sans-serif";
|
|
15337
15525
|
var DEFAULT_FONT_SIZE = 96;
|
|
@@ -15649,13 +15837,13 @@ function TextHotspot({
|
|
|
15649
15837
|
whiteSpace
|
|
15650
15838
|
};
|
|
15651
15839
|
const texture = useTextTexture(text, width, height, style, onLoad, onError);
|
|
15652
|
-
return /* @__PURE__ */
|
|
15840
|
+
return /* @__PURE__ */ jsx35(HotspotAnchor, { ...anchorProps, height, width, children: /* @__PURE__ */ jsx35(HotspotPlane, { map: texture, opacity }) });
|
|
15653
15841
|
}
|
|
15654
15842
|
|
|
15655
15843
|
// src/hotspot/iframe-hotspot.tsx
|
|
15656
15844
|
import { Html as Html2 } from "@react-three/drei";
|
|
15657
15845
|
import { DoubleSide as DoubleSide6 } from "three";
|
|
15658
|
-
import { jsx as
|
|
15846
|
+
import { jsx as jsx36, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
15659
15847
|
var IFRAME_LONG_SIDE = 800;
|
|
15660
15848
|
var CSS3D_DISTANCE_FACTOR = 400;
|
|
15661
15849
|
var DEFAULT_SANDBOX = "allow-scripts allow-popups allow-forms";
|
|
@@ -15722,8 +15910,8 @@ function IframeHotspot({
|
|
|
15722
15910
|
width,
|
|
15723
15911
|
children: [
|
|
15724
15912
|
/* @__PURE__ */ jsxs19("mesh", { children: [
|
|
15725
|
-
/* @__PURE__ */
|
|
15726
|
-
/* @__PURE__ */
|
|
15913
|
+
/* @__PURE__ */ jsx36("planeGeometry", { args: [1, 1] }),
|
|
15914
|
+
/* @__PURE__ */ jsx36(
|
|
15727
15915
|
"meshBasicMaterial",
|
|
15728
15916
|
{
|
|
15729
15917
|
depthWrite: false,
|
|
@@ -15734,7 +15922,7 @@ function IframeHotspot({
|
|
|
15734
15922
|
}
|
|
15735
15923
|
)
|
|
15736
15924
|
] }),
|
|
15737
|
-
/* @__PURE__ */
|
|
15925
|
+
/* @__PURE__ */ jsx36(
|
|
15738
15926
|
Html2,
|
|
15739
15927
|
{
|
|
15740
15928
|
distanceFactor: CSS3D_DISTANCE_FACTOR,
|
|
@@ -15749,7 +15937,7 @@ function IframeHotspot({
|
|
|
15749
15937
|
},
|
|
15750
15938
|
transform: true,
|
|
15751
15939
|
zIndexRange: [10, 0],
|
|
15752
|
-
children: /* @__PURE__ */
|
|
15940
|
+
children: /* @__PURE__ */ jsx36(
|
|
15753
15941
|
"iframe",
|
|
15754
15942
|
{
|
|
15755
15943
|
allow,
|