@bubo-squared/gyroview 0.6.0 → 0.6.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/CHANGELOG.md +25 -0
- package/dist/index.d.ts +6 -0
- package/dist/packages/player/src/element/ElementLoads.js +4 -7
- package/dist/packages/player/src/element/FullscreenToggle.js +35 -0
- package/dist/packages/player/src/element/GyroViewElement.js +13 -1
- package/dist/packages/player/src/element/styles.js +1 -1
- package/dist/standalone.js +28 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
3
3
|
What changed for a page using the package, newest first. Until 1.0, a minor version may change
|
|
4
4
|
the API.
|
|
5
5
|
|
|
6
|
+
## 0.6.1 (2026-10-05)
|
|
7
|
+
|
|
8
|
+
Fixed:
|
|
9
|
+
|
|
10
|
+
- Where the browser has no fullscreen for the element (iPhone Safari), the pinned player covers
|
|
11
|
+
the whole viewport from inside a modal, a carousel or any container with a transform, a filter
|
|
12
|
+
or containment: it is shown in the top layer, as the browser's own fullscreen is (ADR 0041).
|
|
13
|
+
It filled only that container, and the page showed around it. It also stays above the page's
|
|
14
|
+
own layers, whatever their `z-index`, and keeps none of the page's corners, `translate`,
|
|
15
|
+
`rotate` or `scale` for it.
|
|
16
|
+
|
|
17
|
+
What a page may notice:
|
|
18
|
+
|
|
19
|
+
- While pinned, the element has `popover="manual"` beside `data-fill`; a page never sets the
|
|
20
|
+
attribute itself. A popover or dialog the page opens meanwhile shows above it, as over the
|
|
21
|
+
browser's fullscreen. Where the browser has no popovers of its own (Safari before 17), the
|
|
22
|
+
element is pinned in place as before.
|
|
23
|
+
- While pinned, the element's background, colour, font and overflow are its own: a page's styles
|
|
24
|
+
for every `[popover]`, and the page's own `background`, `color` or `font-family` on
|
|
25
|
+
`gyro-view`, no longer reach it; the `--gyro-view-*` properties still theme it. A page's
|
|
26
|
+
shadow or opacity for every popover would.
|
|
27
|
+
- An element the page removes while pinned leaves the fill, as one in the browser's fullscreen
|
|
28
|
+
does. One it moves within the same task, taken out and put back before a microtask runs, stays
|
|
29
|
+
pinned.
|
|
30
|
+
|
|
6
31
|
## 0.6.0 (2026-10-05)
|
|
7
32
|
|
|
8
33
|
New:
|
package/dist/index.d.ts
CHANGED
|
@@ -1020,6 +1020,12 @@ export declare class GyroViewElement extends TypedEventElement implements LiveSe
|
|
|
1020
1020
|
* Plays local files instead of the `src` attributes, until `src` or `src2` change.
|
|
1021
1021
|
*/
|
|
1022
1022
|
loadFiles(files: FileSource): void;
|
|
1023
|
+
/**
|
|
1024
|
+
* A move within the document disconnects and connects again at once: only an element still out
|
|
1025
|
+
* of it a microtask later was removed. It lets its recording go, and leaves the pinned fill as
|
|
1026
|
+
* the browser's fullscreen element leaves fullscreen.
|
|
1027
|
+
*/
|
|
1028
|
+
private leaveIfRemoved;
|
|
1023
1029
|
/**
|
|
1024
1030
|
* What the controls and the keyboard ask of the element. They live as long as the element:
|
|
1025
1031
|
* their listeners sit on its own shadow tree and host, and on its player.
|
|
@@ -8,8 +8,8 @@ import { elementSourceOf } from "./elementSource.js";
|
|
|
8
8
|
* When `<gyro-view>` loads, and what. Attribute changes are read together a microtask after they
|
|
9
9
|
* arrive, so a `src` set with its `src2` loads once; files handed in replace the attributes until
|
|
10
10
|
* `src` or `src2` change. Only a connected element loads: one out of the document owes its load
|
|
11
|
-
* to the next connection, and lets its recording go
|
|
12
|
-
*
|
|
11
|
+
* to the next connection, and a removed one lets its recording go. A seek asked for while a load
|
|
12
|
+
* waits starts the new recording there.
|
|
13
13
|
*/
|
|
14
14
|
var ElementLoads = class {
|
|
15
15
|
element;
|
|
@@ -36,12 +36,9 @@ var ElementLoads = class {
|
|
|
36
36
|
this.awaited = void 0;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
* of it a microtask later lets its recording go.
|
|
39
|
+
* The element left the document rather than moving within it: its recording goes.
|
|
41
40
|
*/
|
|
42
|
-
|
|
43
|
-
await Promise.resolve();
|
|
44
|
-
if (this.element.isConnected) return;
|
|
41
|
+
removed() {
|
|
45
42
|
this.player.unload();
|
|
46
43
|
this.isOwed = true;
|
|
47
44
|
}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
//#region ../../packages/player/src/element/FullscreenToggle.ts
|
|
2
2
|
var FILL_ATTRIBUTE = "data-fill";
|
|
3
|
+
var POPOVER_ATTRIBUTE = "popover";
|
|
4
|
+
/**
|
|
5
|
+
* No light dismiss and no Escape of the browser's: the element's own keys and button leave.
|
|
6
|
+
*/
|
|
7
|
+
var MANUAL_POPOVER = "manual";
|
|
3
8
|
/**
|
|
4
9
|
* Fills the screen with the element through the Fullscreen API where there is one, and by
|
|
5
10
|
* pinning the element over the page where there is not (iPhone Safari has none for anything
|
|
6
11
|
* but a video). Escape leaves either way.
|
|
12
|
+
*
|
|
13
|
+
* The pinned element is a manual popover, in the top layer the browser's own fullscreen uses:
|
|
14
|
+
* no transform, clip or stacking context of the page holds it there. Pinned in place, a dialog
|
|
15
|
+
* centred by a transform would make its fixed position fill the dialog, not the viewport. A
|
|
16
|
+
* browser without popovers pins it in place all the same.
|
|
7
17
|
*/
|
|
8
18
|
var FullscreenToggle = class {
|
|
9
19
|
element;
|
|
@@ -18,9 +28,17 @@ var FullscreenToggle = class {
|
|
|
18
28
|
}
|
|
19
29
|
async exit() {
|
|
20
30
|
if (this.isNativelyFullscreen()) await document.exitFullscreen();
|
|
31
|
+
this.element.removeAttribute(POPOVER_ATTRIBUTE);
|
|
21
32
|
this.element.removeAttribute(FILL_ATTRIBUTE);
|
|
22
33
|
}
|
|
23
34
|
/**
|
|
35
|
+
* The browser takes a popover out of the top layer when its element leaves the document, so a
|
|
36
|
+
* pinned element the page moves goes back in once it is connected again.
|
|
37
|
+
*/
|
|
38
|
+
connected() {
|
|
39
|
+
if (this.element.hasAttribute(FILL_ATTRIBUTE)) this.raiseToTopLayer();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
24
42
|
* Asked of the element itself: `document.fullscreenElement` names the outermost shadow host
|
|
25
43
|
* instead when the player sits inside another component.
|
|
26
44
|
*/
|
|
@@ -32,8 +50,25 @@ var FullscreenToggle = class {
|
|
|
32
50
|
await this.element.requestFullscreen();
|
|
33
51
|
return;
|
|
34
52
|
} catch {}
|
|
53
|
+
if (!this.element.isConnected) return;
|
|
35
54
|
this.element.setAttribute(FILL_ATTRIBUTE, "");
|
|
55
|
+
this.raiseToTopLayer();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Out of the document there is no top layer to show it in; `connected` raises it on arrival.
|
|
59
|
+
*/
|
|
60
|
+
raiseToTopLayer() {
|
|
61
|
+
if (!hasPopovers() || !this.element.isConnected || this.element.matches(":popover-open")) return;
|
|
62
|
+
this.element.setAttribute(POPOVER_ATTRIBUTE, MANUAL_POPOVER);
|
|
63
|
+
this.element.showPopover();
|
|
36
64
|
}
|
|
37
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* The browser's own popovers, the method and the selector both: Safari has them from 17, and
|
|
68
|
+
* before it does not even parse `:popover-open`, which a polyfill's `showPopover` cannot change.
|
|
69
|
+
*/
|
|
70
|
+
function hasPopovers() {
|
|
71
|
+
return "showPopover" in HTMLElement.prototype && CSS.supports("selector(:popover-open)");
|
|
72
|
+
}
|
|
38
73
|
//#endregion
|
|
39
74
|
export { FullscreenToggle };
|
|
@@ -162,10 +162,11 @@ var GyroViewElement = class extends TypedEventElement {
|
|
|
162
162
|
this.dataset["status"] = this.player.status;
|
|
163
163
|
this.idle.start();
|
|
164
164
|
this.loads.connected();
|
|
165
|
+
this.fullscreen.connected();
|
|
165
166
|
}
|
|
166
167
|
disconnectedCallback() {
|
|
167
168
|
this.idle.stop();
|
|
168
|
-
this.
|
|
169
|
+
this.leaveIfRemoved();
|
|
169
170
|
}
|
|
170
171
|
attributeChangedCallback(name, _previous, value) {
|
|
171
172
|
if (SOURCE_ATTRIBUTES.includes(name)) this.loads.sourceChanged();
|
|
@@ -294,6 +295,17 @@ var GyroViewElement = class extends TypedEventElement {
|
|
|
294
295
|
this.loads.loadFiles(files);
|
|
295
296
|
}
|
|
296
297
|
/**
|
|
298
|
+
* A move within the document disconnects and connects again at once: only an element still out
|
|
299
|
+
* of it a microtask later was removed. It lets its recording go, and leaves the pinned fill as
|
|
300
|
+
* the browser's fullscreen element leaves fullscreen.
|
|
301
|
+
*/
|
|
302
|
+
async leaveIfRemoved() {
|
|
303
|
+
await Promise.resolve();
|
|
304
|
+
if (this.isConnected) return;
|
|
305
|
+
this.loads.removed();
|
|
306
|
+
await this.fullscreen.exit();
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
297
309
|
* What the controls and the keyboard ask of the element. They live as long as the element:
|
|
298
310
|
* their listeners sit on its own shadow tree and host, and on its player.
|
|
299
311
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region ../../packages/player/src/element/styles.css?raw
|
|
2
|
-
var styles_default = ":host {\n --gyro-view-accent: #fff;\n --gyro-view-controls-background: rgb(0 0 0 / 60%);\n --gyro-view-menu-background: rgb(24 24 23 / 92%);\n --gyro-view-text: #fff;\n --gyro-view-font: system-ui, -apple-system, 'Segoe UI', sans-serif;\n --gyro-view-radius: 8px;\n\n display: block;\n position: relative;\n width: 100%;\n aspect-ratio: 16 / 9;\n background: #000;\n color: var(--gyro-view-text);\n font-family: var(--gyro-view-font);\n overflow: hidden;\n user-select: none;\n -webkit-user-select: none;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host(:focus-visible) {\n outline: 2px solid var(--gyro-view-accent);\n outline-offset: 2px;\n}\n\n/*\n * Pinned over the page where the Fullscreen API is refused (iPhone Safari). Like the browser's\n * own fullscreen rules it overrides the size, margins and place the page gave the element, and\n * the insets size it to the visible viewport, where 100vh would reach under Safari's toolbars.\n */\n:host([data-fill]) {\n position: fixed !important;\n inset: 0 !important;\n box-sizing: border-box !important;\n width: auto !important;\n height: auto !important;\n min-width: 0 !important;\n min-height: 0 !important;\n max-width: none !important;\n max-height: none !important;\n margin: 0 !important;\n transform: none !important;\n aspect-ratio: auto !important;\n z-index: 2147483000 !important;\n}\n\n:host(:fullscreen) {\n width: 100%;\n height: 100%;\n aspect-ratio: auto;\n}\n\n/* The size container the controls fit themselves to: the player's size, not the page's. Its\n size never depends on its content, which size containment requires. */\n.stage {\n position: absolute;\n inset: 0;\n container-type: size;\n}\n\ncanvas {\n display: block;\n width: 100%;\n height: 100%;\n touch-action: none;\n}\n\n.poster {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n pointer-events: none;\n}\n\n:host([data-has-frame]) .poster,\n:host(:not([poster])) .poster {\n display: none;\n}\n\n.overlay {\n position: absolute;\n inset: 0;\n display: none;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n gap: 0.5rem;\n padding: 1rem;\n text-align: center;\n background: rgb(0 0 0 / 45%);\n}\n\n:host([data-status='loading']) .overlay.loading,\n:host([data-status='buffering']) .overlay.loading,\n:host([data-status='error']) .overlay.error {\n display: flex;\n}\n\n:host([data-status='buffering']) .overlay.loading {\n background: transparent;\n pointer-events: none;\n}\n\n.spinner {\n width: 2.5rem;\n height: 2.5rem;\n border: 3px solid rgb(255 255 255 / 25%);\n border-top-color: var(--gyro-view-accent);\n border-radius: 50%;\n animation: gyro-view-spin 0.9s linear infinite;\n}\n\n@keyframes gyro-view-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* A viewer who asked for less motion still sees that it loads, three times slower. */\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation-duration: 2.7s;\n }\n}\n\n.error-code {\n font-size: 0.8rem;\n opacity: 0.7;\n}\n";
|
|
2
|
+
var styles_default = ":host {\n --gyro-view-accent: #fff;\n --gyro-view-controls-background: rgb(0 0 0 / 60%);\n --gyro-view-menu-background: rgb(24 24 23 / 92%);\n --gyro-view-text: #fff;\n --gyro-view-font: system-ui, -apple-system, 'Segoe UI', sans-serif;\n --gyro-view-radius: 8px;\n\n display: block;\n position: relative;\n width: 100%;\n aspect-ratio: 16 / 9;\n background: #000;\n color: var(--gyro-view-text);\n font-family: var(--gyro-view-font);\n overflow: hidden;\n user-select: none;\n -webkit-user-select: none;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host(:focus-visible) {\n outline: 2px solid var(--gyro-view-accent);\n outline-offset: 2px;\n}\n\n/*\n * Pinned over the page where the Fullscreen API is refused (iPhone Safari). Like the browser's\n * own fullscreen rules it overrides the size, margins and place the page gave the element, and\n * the insets size it to the visible viewport, where 100vh would reach under Safari's toolbars.\n * It keeps no corners or border of the page's, which would show the page behind it, and zero\n * border and padding override a popover's defaults, which the pinned element is (ADR 0041). A\n * page's styles for every popover would outrank the host's overflow, colours and font, so the\n * fill holds them too. The z-index matters only where the browser has no popovers.\n */\n:host([data-fill]) {\n position: fixed !important;\n inset: 0 !important;\n box-sizing: border-box !important;\n width: auto !important;\n height: auto !important;\n min-width: 0 !important;\n min-height: 0 !important;\n max-width: none !important;\n max-height: none !important;\n margin: 0 !important;\n border: 0 !important;\n border-radius: 0 !important;\n padding: 0 !important;\n transform: none !important;\n translate: none !important;\n rotate: none !important;\n scale: none !important;\n aspect-ratio: auto !important;\n overflow: hidden !important;\n background: #000 !important;\n color: var(--gyro-view-text) !important;\n font-family: var(--gyro-view-font) !important;\n z-index: 2147483000 !important;\n}\n\n:host(:fullscreen) {\n width: 100%;\n height: 100%;\n aspect-ratio: auto;\n}\n\n/* The size container the controls fit themselves to: the player's size, not the page's. Its\n size never depends on its content, which size containment requires. */\n.stage {\n position: absolute;\n inset: 0;\n container-type: size;\n}\n\ncanvas {\n display: block;\n width: 100%;\n height: 100%;\n touch-action: none;\n}\n\n.poster {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n pointer-events: none;\n}\n\n:host([data-has-frame]) .poster,\n:host(:not([poster])) .poster {\n display: none;\n}\n\n.overlay {\n position: absolute;\n inset: 0;\n display: none;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n gap: 0.5rem;\n padding: 1rem;\n text-align: center;\n background: rgb(0 0 0 / 45%);\n}\n\n:host([data-status='loading']) .overlay.loading,\n:host([data-status='buffering']) .overlay.loading,\n:host([data-status='error']) .overlay.error {\n display: flex;\n}\n\n:host([data-status='buffering']) .overlay.loading {\n background: transparent;\n pointer-events: none;\n}\n\n.spinner {\n width: 2.5rem;\n height: 2.5rem;\n border: 3px solid rgb(255 255 255 / 25%);\n border-top-color: var(--gyro-view-accent);\n border-radius: 50%;\n animation: gyro-view-spin 0.9s linear infinite;\n}\n\n@keyframes gyro-view-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* A viewer who asked for less motion still sees that it loads, three times slower. */\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation-duration: 2.7s;\n }\n}\n\n.error-code {\n font-size: 0.8rem;\n opacity: 0.7;\n}\n";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { styles_default as default };
|
package/dist/standalone.js
CHANGED
|
@@ -4639,7 +4639,7 @@ void main() {
|
|
|
4639
4639
|
bool isShown = isInArea(point) && weightSum > 0.0;
|
|
4640
4640
|
outColor = isShown ? vec4(sum / weightSum, 1.0) : vec4(0.0, 0.0, 0.0, 1.0);
|
|
4641
4641
|
}
|
|
4642
|
-
`,rN=[QM,KM],iN=[...rN,XM,ZM];function aN(e){return[YM,...iN,e]}function oN(e){let t=t=>[YM,tN,t,...iN,e,nN];return{rectilinear:t(eN),equirectangular:t(qM),"lens-tiles":[YM,tN,...rN,$M]}}var sN=oN(JM),cN=aN(GM);function lN(e){return[...new Set(e.flat())]}lN([...Object.values(sN),cN]);var uN=64,dN=class{renderer;lensCount;target=new mT(uN,2,{depthBuffer:!1,stencilBuffer:!1});pixels=new Uint8Array(uN*2*4);camera=new mO;scene=new eE;material;geometry=FM();isDisposed=!1;constructor(e,t,n){this.renderer=e,this.lensCount=n,this.material=LM(t,IM(cN)),this.scene.add(new vD(this.geometry,this.material));try{UM(e,this.scene,this.camera)}catch(e){throw this.dispose(),e}}async measure(){try{await this.readSeam()}catch(e){if(this.isDisposed||this.renderer.getContext().isContextLost())return;throw e}return this.isDisposed?void 0:VM(this.pixels,uN,this.lensCount)}dispose(){this.isDisposed||(this.isDisposed=!0,this.target.dispose(),this.material.dispose(),this.geometry.dispose())}draw(){WM(this.renderer,this.target,()=>{this.renderer.render(this.scene,this.camera)})}async readSeam(){this.draw(),await this.renderer.readRenderTargetPixelsAsync(this.target,0,0,uN,2,this.pixels)}};function fN(e,t){return Array.from({length:e},()=>{let e=new DD;return e.flipY=!1,e.colorSpace=``,e.magFilter=iC,pN(e,t),e})}function pN(e,t){e.minFilter=t.minFilter,e.generateMipmaps=t.generateMipmaps,e.anisotropy=t.anisotropy}var mN={programs:sN,defines:pM};function hN(e,t){let n=n=>LM(e,{chunks:t.programs[n],defines:t.defines});return{rectilinear:n(`rectilinear`),equirectangular:n(`equirectangular`),"lens-tiles":n(`lens-tiles`)}}function gN(e,t,n){let r=new mO;for(let i of Object.values(n)){let n=new eE;n.add(new vD(t,i)),UM(e,n,r)}}function _N(e){for(let t of Object.values(e))t.dispose()}var vN={shaders:mN,uniforms:{}},yN=class{parts;canvas;framing=sl;viewMode=Ec;hasFrames=!1;isDisposed=!1;meters=/* @__PURE__ */ new Set;constructor(e,t){this.parts=e,this.canvas=t,this.applyFraming(),t.addEventListener(`webglcontextrestored`,this.onContextRestored)}static create(e,t,n={}){let r={options:n,pictures:vN};return new this(this.openParts(e,t,r),e)}static openParts(e,t,n){bN(t);let r=RM(e,n.options);try{return{...SN(r,t,n.pictures),drawSchedule:n.options.drawSchedule??tM}}catch(e){throw r.dispose(),e}}get lensCount(){return this.parts.lensCount}setFraming(e){this.ensureLive(),this.framing=e,this.applyFraming(),this.redraw()}setViewMode(e){this.ensureLive(),this.viewMode=e,this.applyFraming(),this.redraw()}setQuality(e){this.ensureLive();let t=uM[e];for(let e of this.parts.textures)pN(e,t),this.hasFrames&&(e.needsUpdate=!0);SM(this.parts.uniforms,t),this.redraw()}setLensGains(e){this.ensureLive();for(let[t,n]of e.entries())wM(this.parts.uniforms,t,n);this.redraw()}createSeamMeter(){this.ensureLive();let e=new dN(this.parts.renderer,this.parts.uniforms,this.parts.lensCount);return this.tracked({measure:()=>e.measure(),dispose:()=>{e.dispose()}})}setStabilization(e){this.ensureLive(),CM(this.parts.uniforms,e)}present(e){this.ensureLive();let{frames:t}=e.pair;N(t.length===this.parts.textures.length,`a pair of ${t.length} frames does not fit ${this.parts.textures.length} lens textures`);for(let[e,n]of this.parts.textures.entries()){let r=t[e];r&&n.setFrame(r.handle)}this.parts.matrixCorrections.follow(t.map(e=>e.handle)),this.hasFrames=!0,this.drawNow()}resize(e){this.ensureLive(),this.parts.renderer.setSize(e.width,e.height,!1),this.applyFraming(),this.drawNow()}dispose(){if(!this.isDisposed){this.isDisposed=!0,this.parts.drawSchedule.cancel(),this.canvas.removeEventListener(`webglcontextrestored`,this.onContextRestored);for(let e of this.meters)e.dispose();this.parts.seamProof.dispose();for(let e of this.parts.textures)e.dispose();_N(this.parts.materials),this.parts.pass.geometry.dispose(),this.parts.renderer.dispose()}}get webgl(){return this.parts.renderer}get uniforms(){return this.parts.uniforms}tracked(e){let t={...e,dispose:()=>{this.meters.delete(t),e.dispose()}};return this.meters.add(t),t}redraw(){this.parts.drawSchedule.request(this.draw)}ensureLive(){N(!this.isDisposed,`the renderer has been disposed`)}onContextRestored=()=>{this.redraw()};drawNow(){this.parts.drawSchedule.cancel(),this.draw()}draw=()=>{this.hasFrames&&this.parts.renderer.render(this.parts.scene,this.parts.camera)};applyFraming(){let e={width:this.canvas.width,height:this.canvas.height},t=Il(this.viewMode).picture(this.framing,{viewport:e,lensCount:this.parts.lensCount});this.parts.pass.material=this.parts.materials[t.kind],EM(this.parts.uniforms,t,jc(e))}};function bN(e){if(!(e.lenses.length<=2&&e.frameSlotCount<=2))throw new j(`unsupported-layout`,`the renderer draws at most 2 lenses from 2 frames; the layout has ${e.lenses.length} lenses in ${e.frameSlotCount} frames`)}function xN(e,t){let n=uM[Sc],r=fN(e.frameSlotCount,n),i=mM(e,r);return SM(i,n),{textures:r,uniforms:i,materials:hN({...i,...t.uniforms},t.shaders)}}function SN(e,t,n){let{textures:r,uniforms:i,materials:a}=xN(t,n),o=new vD(FM(),a.rectilinear),s=CN(e,{pass:o,materials:a,textures:r,uniforms:i}),c=new eE;return c.add(o),{renderer:e,scene:c,camera:new mO,pass:o,materials:a,textures:r,uniforms:i,matrixCorrections:new rM(t.lenses,i.uLensMatrixCorrection),lensCount:t.lenses.length,seamProof:s}}function CN(e,t){let{pass:n,materials:r,textures:i,uniforms:a}=t;try{return gN(e,n.geometry,r),new dN(e,a,a.uLensCount.value)}catch(e){_N(r),n.geometry.dispose();for(let e of i)e.dispose();throw e}}var wN={request:e=>requestAnimationFrame(e),cancel:e=>{cancelAnimationFrame(e)}},TN=class{frames;pendingDraw;handle;constructor(e=wN){this.frames=e}request(e){let t=this.pendingDraw!==void 0;this.pendingDraw=e,t||(this.handle=this.frames.request(this.drawPending))}cancel(){this.pendingDraw=void 0,this.handle!==void 0&&(this.frames.cancel(this.handle),this.handle=void 0)}drawPending=()=>{let e=this.pendingDraw;this.pendingDraw=void 0,this.handle=void 0,e?.()}},EN=class{actions=[];isDisposed=!1;add(e){if(this.isDisposed){e();return}this.actions.push(e)}disposeAll(){if(!this.isDisposed){this.isDisposed=!0;for(let e of this.actions.splice(0).toReversed())e()}}toDisposer(){return()=>{this.disposeAll()}}},DN={maxPendingPackets:4,pairTolerance:R(5e-4)},ON=`the recording has no audio track; playback follows a silent clock`,kN=`this browser cannot play the audio track through Media Source Extensions; playback follows a silent clock`,AN=`the audio track could not be prepared for playback; playback follows a silent clock`;async function jN(e){let t=new EN;try{let n=await PN(e);t.add(()=>{n.clock.dispose()}),e.signal.throwIfAborted();let r=MN(e,t),i=zN(e,n.clock,r.gainMatching);return t.add(()=>{i.dispose()}),RN(i,e.opened),{session:i,renderer:r.renderer,...NN(r,i),soundWarnings:n.warnings,dispose:t.toDisposer()}}catch(e){throw t.disposeAll(),e}}function MN(e,t){let n=yN.create(e.host.canvas,IN(e.opened),{drawSchedule:new TN});t.add(()=>{n.dispose()});let{sink:r,stabilizing:i}=LN(n,e.opened),a=new su(r,n);return t.add(()=>{a.dispose()}),{renderer:n,stabilizing:i,gainMatching:a}}function NN(e,t){return{setStabilization:n=>{e.stabilizing?.setStabilizer(tc(n)),t.redraw()},setQuality:t=>{e.renderer.setQuality(t)},setGainMatching:n=>{n?e.gainMatching.enable():e.gainMatching.disable(),t.redraw()}}}async function PN(e){let{soundSegments:t}=e.opened;if(!t)return FN(ON);try{let n=t();return JS.isSupported(n)?(e.signal.throwIfAborted(),{clock:await JS.open(e.host.audio,n),warnings:[]}):FN(kN)}catch(e){return FN(`${AN} (${ie(e)})`)}}function FN(e){return{clock:new hf(()=>pt(performance.now())),warnings:[e]}}function IN(e){return Zl({calibration:e.calibration,layout:e.layout,displayConversions:e.displayConversions})}function LN(e,t){if(!t.motion)return e.setStabilization(Fi.toBody),{sink:e,stabilizing:void 0};let n=new nu({sink:e,motion:t.motion,frameTimes:t.frameTimes});return{sink:n,stabilizing:n}}function RN(e,t){e.events.on(`statechange`,e=>{vf(e)&&t.readAhead()})}function zN(e,t,n){return new Ff({frameSources:e.opened.frameSources,decoderPort:e.decoderPort,clock:t,sink:n,duration:e.opened.duration,buffer:e.opened.buffer,pipeline:DN,queueCapacity:4})}var BN=class{events;play;isLoopingValue=!1;constructor(e,t){this.events=e,this.play=t}get isLooping(){return this.isLoopingValue}setLooping(e){this.isLoopingValue=e}async autoplay(){try{await this.play()}catch(e){this.events.emit(`warning`,M(e,`playback-blocked`)?{code:`autoplay-blocked`,message:`playback waits for a user gesture`}:{code:`playback-failed`,message:`autoplay failed: ${ie(e)}`})}}ended(){this.events.emit(`ended`,void 0),this.isLoopingValue&&this.replay()}async replay(){try{await this.play()}catch(e){this.events.emit(`warning`,{code:`playback-failed`,message:`the loop could not restart playback: ${ie(e)}`})}}};function VN(e,t,n=Sc){let r=yr(t,1,wc(n));return{width:Math.max(1,Math.round(e.width*r)),height:Math.max(1,Math.round(e.height*r))}}function HN(e){let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}var UN=class{canvas;renderer;observer;ratioWatch=new AbortController;quality=Sc;constructor(e,t){this.canvas=e,this.renderer=t,this.observer=new ResizeObserver(()=>{this.fit()}),this.observer.observe(e),this.watchPixelRatio(),this.fit()}setQuality(e){this.quality=e,this.fit()}dispose(){this.observer.disconnect(),this.ratioWatch.abort()}watchPixelRatio(){globalThis.matchMedia(`(resolution: ${globalThis.devicePixelRatio}dppx)`).addEventListener(`change`,()=>{this.fit(),this.watchPixelRatio()},{once:!0,signal:this.ratioWatch.signal})}fit(){let e=VN(HN(this.canvas),globalThis.devicePixelRatio,this.quality);(e.width!==this.canvas.width||e.height!==this.canvas.height)&&this.renderer.resize(e)}},WN=class{tick;scheduler;isActive=!1;handle;constructor(e,t=wN){this.tick=e,this.scheduler=t}start(){this.isActive||(this.isActive=!0,this.schedule())}stop(){this.isActive=!1,this.handle!==void 0&&(this.scheduler.cancel(this.handle),this.handle=void 0)}schedule(){this.handle=this.scheduler.request(()=>{this.handle=void 0,this.tick(),this.isActive&&this.schedule()})}};async function GN(e,t){let{ports:n,signal:r}=t,i=await cf(e,n.decoderPort,XN(t));if(r.throwIfAborted(),!i.canDecode)throw JN(i)}var KN={"no-key-frame":{code:`no-key-frame`,message:`the recording has no key frame to start decoding from`},"key-frame-late":{code:`source-unreadable`,message:`the recording's first frames did not arrive in time`}},qN={code:`codec-unsupported`,message:`this browser cannot decode the recording`};function JN(e){let t=YN(e),{code:n,message:r}=(t===void 0?void 0:KN[t])??qN;return new j(n,`${r}: ${ZN(e)}`)}function YN(e){let t=new Set(e.sources.filter(e=>e.verdict!==`decodes`).map(e=>e.verdict));t.has(`key-frame-late`)&&t.delete(`timed-out`);let[n]=t;return t.size===1?n:void 0}function XN(e){let t=e.ports.probeDeadline();return e.signal.addEventListener(`abort`,()=>{t.resolve()},{once:!0}),t}function ZN(e){return e.sources.filter(e=>e.verdict!==`decodes`).map(e=>`track ${e.track.trackIndex} ${e.verdict}${e.detail?` (${e.detail})`:``}`).join(`; `)}async function QN(e,t){let{ports:n,signal:r}=t,i=e.map(e=>({input:e,opened:n.sources.open(e,r)})),a=await rP(i,n);r.throwIfAborted();let o=[...i,...await tP(i,a,t)],s=await Promise.all(o.map(e=>eP(e,n)));return r.throwIfAborted(),{recording:a,inputs:s}}function $N(e){let t=e.codecs.video.map(({description:e})=>({description:e}));return{name:CS(e.input),videoTracks:t}}async function eP(e,t){let{source:n}=e.opened,{table:r,movieBytes:i}=await Yo(n),a=await t.codecReader.read(i);return{...e,table:r,codecs:a,size:await n.size()}}async function tP(e,t,n){if(e.length!==1||t.info.fileLayout!==`split-files`||!n.findSecondFile)return[];let r=await n.findSecondFile();return n.signal.throwIfAborted(),r===void 0?[]:[{input:r,opened:n.ports.sources.open(r,n.signal)}]}var nP={fileLayout:void 0,trackOrder:void 0};async function rP(e,t){try{return await aP(e.map(({opened:e})=>e.source))}catch(n){let[r]=e;throw e.length===1&&M(n,`invalid-trailer`)&&r&&await iP(r,t),n}}async function iP(e,t){let n;try{n=await eP(e,t)}catch{return}try{os([$N(n)],nP)}catch(e){if(M(e,`missing-second-file`))throw e}}async function aP(e){let[t,n]=e;N(t!==void 0,`a recording needs at least one input`);try{return await $n(t)}catch(e){if(n===void 0||!M(e,`invalid-trailer`))throw e;return $n(n)}}async function oP(e,t){let n=new EN;try{let r=await QN(e,t),i=os(r.inputs.map(e=>$N(e)),r.recording.info),a=lP(r.recording),o=sP(r.inputs,n),s=Xl(i).map(e=>cP(o,e));await GN(s,t);let c=await pa(r.recording,s[0]);return t.signal.throwIfAborted(),uP({read:r,files:o,layout:i,frameSources:s,calibration:a,timing:c},t.ports.audioPackager,n)}catch(e){throw n.disposeAll(),e}}function sP(e,t){return e.map(({opened:n,table:r,codecs:i,size:a})=>{let o=Ld({size:a,duration:r.duration},e.length),s=wd({table:r,stream:n.stream,codecs:i,policy:o});return t.add(()=>{s.dispose()}),s})}function cP(e,t){let n=e[t.inputIndex]?.videoTracks[t.trackIndex];return N(n!==void 0,`the layout points at track ${t.trackIndex} of input ${t.inputIndex}, which does not exist`),n}function lP(e){let{calibration:t,warnings:n}=e.calibration;if(t)return t;throw new j(`no-calibration`,`the recording carries no usable lens calibration, so it cannot be stitched${n.length>0?` (${n.join(`; `)})`:``}`)}function uP(e,t,n){let{read:r,files:i,layout:a,frameSources:o,calibration:s,timing:c}=e,l=R(Math.min(...i.map(e=>e.duration))),u=Ou(o.map(e=>e.description.colour)),[d]=i.flatMap(e=>e.audioTracks);return{recording:r.recording,layout:a,frameSources:o,calibration:s,displayConversions:u.conversions,duration:l,frameTimes:c.frameTimes,motion:c.motion,soundSegments:d&&(()=>t.segmentsOf(d.samples,d.configuration)),metadata:dP(e,l,d!==void 0),warnings:[...c.warnings,...u.warnings],readAhead:()=>{for(let e of i)e.download.startReadingAhead()},buffer:new Rd(i.map(e=>e.download)),dispose:n.toDisposer()}}function dP(e,t,n){let{info:r}=e.read.recording,{motion:i}=e.timing;return{model:r.model,firmware:r.firmware,captureMode:r.captureMode,layout:e.layout.kind,layoutEvidence:e.layout.evidence,tracks:e.frameSources.map(e=>e.description),calibrationVersion:e.calibration.version,frameTimeSource:e.timing.frameTimeSource,hasGyro:i!==void 0,imuFrame:i&&{name:i.imuFrame.name,isVerified:i.imuFrame.isVerified},hasAudio:n,duration:t}}async function fP(e,t,n){let r=pP(e,t,n),i=e.second?[e.main,e.second]:[e.main];try{return await oP(i,r)}catch(t){let{findSecondFile:i}=r;if(!i||!M(t,`missing-second-file`))throw t;let a=await i();if(n.throwIfAborted(),!a)throw t;return oP([e.main,a],r)}}function pP(e,t,n){let{main:r}=e;return e.second===void 0&&SS(r)?{ports:t,signal:n,findSecondFile:$e(()=>mP(r,t))}:{ports:t,signal:n}}async function mP(e,t){let n=await Da(e.url,t.locatorFor(e));return n===void 0?void 0:{...e,url:n}}async function hP(e){let{parts:t,signal:n}=e,r=await fP(e.source,t.ports,n),i=new EN;i.add(()=>{r.dispose()});try{let e=await t.pipelines({opened:r,host:t.host,decoderPort:t.ports.decoderPort,signal:n});i.add(()=>{e.dispose()}),n.throwIfAborted();let a=new UN(t.host.canvas,e.renderer);i.add(()=>{a.dispose()});let o=gP(e,a);return{opened:r,pipeline:o,warnings:_P(r,o),dispose:i.toDisposer()}}catch(e){throw i.disposeAll(),e}}function gP(e,t){return{...e,setQuality:n=>{e.setQuality(n),t.setQuality(n)}}}function _P(e,t){return[...e.warnings.map(e=>({code:`recording-degraded`,message:e})),...t.soundWarnings.map(e=>({code:`no-sound`,message:e}))]}var vP=class{parts;stateValue;request;generation=0;stopHearing;stopFollowingAvailability;wasRefused=!1;constructor(e){this.parts=e,this.stateValue=e.sensor.availability===`available`?`off`:`unavailable`}get state(){return this.stateValue}start(){return this.followAvailability(),this.stateValue===`off`?(this.request??=this.ask(),this.request):Promise.resolve(this.stateValue)}stop(){this.overtakeRequest(),this.stateValue===`on`&&this.change(`off`)}reconsider(){this.reconsiderAvailability(),this.reconsiderHearing()}dispose(){this.overtakeRequest(),this.stopFollowingAvailability?.(),this.stopFollowingAvailability=void 0,this.stopHearing?.(),this.stopHearing=void 0,this.parts.sensor.dispose()}reconsiderAvailability(){let e=this.parts.hasRecording();e&&!this.stopFollowingAvailability?(this.stopFollowingAvailability=this.parts.sensor.onAvailabilityChange(()=>{this.followAvailability()}),this.followAvailability()):!e&&this.stopFollowingAvailability&&(this.stopFollowingAvailability(),this.stopFollowingAvailability=void 0)}reconsiderHearing(){let{sensor:e,view:t,hasRecording:n}=this.parts,r=this.stateValue===`on`&&n()&&t.followsDevice;r&&!this.stopHearing?this.stopHearing=e.listen(e=>{t.followDevice(e)}):!r&&this.stopHearing&&(this.stopHearing(),this.stopHearing=void 0,t.letGo())}followAvailability(){let e=this.parts.sensor.availability===`available`;this.wasRefused||e===(this.stateValue!==`unavailable`)||(this.overtakeRequest(),this.change(e?`off`:`unavailable`))}async ask(){let e=this.generation,t=await this.accessOrGesture();return e===this.generation?(this.request=void 0,this.answer(t),this.stateValue):this.stateValue}async accessOrGesture(){try{return await this.parts.sensor.requestAccess()}catch{return`needs-gesture`}}answer(e){e===`granted`?this.change(`on`):e===`denied`?(this.wasRefused=!0,this.change(`unavailable`),this.warn(`motion-look-refused`,yP)):this.warn(`motion-look-needs-gesture`,bP)}overtakeRequest(){this.generation+=1,this.request=void 0}change(e){this.stateValue=e,this.reconsiderHearing(),this.parts.events.emit(`motionlookchange`,e)}warn(e,t){this.parts.events.emit(`warning`,{code:e,message:t})}},yP="motion look was refused: by the viewer, or by an iframe whose `allow` leaves out accelerometer, gyroscope and magnetometer",bP=`motion look asks for access, which this browser grants only from a user gesture such as a tap`,xP={kind:`idle`};function SP(){return{kind:`loading`,controller:new AbortController,settled:new Wd}}function CP(e){switch(e.kind){case`idle`:return`idle`;case`loading`:return`loading`;case`loaded`:return e.loaded.pipeline.session.state;case`failed`:return`error`}}var wP=class{events;mode=Js;isMatching=!0;qualityValue=Sc;target;constructor(e){this.events=e}get stabilization(){return this.mode}get quality(){return this.qualityValue}attach(e){this.target=e,e?.setStabilization(this.mode),e?.setGainMatching(this.isMatching),e?.setQuality(this.qualityValue)}setStabilization(e){e!==this.mode&&(this.mode=e,this.target?.setStabilization(e),this.events.emit(`stabilizationchange`,e))}setGainMatching(e){this.isMatching=e,this.target?.setGainMatching(e)}setQuality(e){e!==this.qualityValue&&(this.qualityValue=e,this.target?.setQuality(e),this.events.emit(`qualitychange`,e))}},TP=class{audio;events;canSetVolume;constructor(e,t){this.audio=e,this.events=t,this.canSetVolume=DP(e.ownerDocument),e.addEventListener(`volumechange`,this.onVolumeChange)}get volume(){return this.audio.volume}get isMuted(){return this.audio.muted}setVolume(e){this.audio.volume=yr(e,0,1)}setMuted(e){this.audio.muted=e}dispose(){this.audio.removeEventListener(`volumechange`,this.onVolumeChange)}onVolumeChange=()=>{this.events.emit(`volumechange`,{volume:this.volume,isMuted:this.isMuted})}},EP=.5;function DP(e){let t=e.createElement(`audio`);return t.volume=EP,t.volume===EP}function OP(e){return{yaw:e.yaw,pitch:e.pitch,fieldOfView:e.fieldOfView}}function kP(e,t){return e.yaw===t.yaw&&e.pitch===t.pitch&&e.fieldOfView===t.fieldOfView}var AP=2,jP=class{events;measureViewport;framing=sl;mode=Ec;surface;lensCount=AP;previous;constructor(e,t){this.events=e,this.measureViewport=t}get current(){return this.framing.view}get viewMode(){return this.mode}get canPan(){return this.rules().canPan(this.framing)}get followsDevice(){return Rl(this.mode)!==void 0}attach(e){this.surface=e,e&&(this.lensCount=e.lensCount),e?.setViewMode(this.mode),e?.setFraming(this.framing)}set(e){this.frame(this.rules().place(this.framing,e))}setMode(e){e!==this.mode&&(this.mode=e,this.surface?.setViewMode(e),this.events.emit(`viewmodechange`,e))}lookAt(e,t){this.frame(this.rules().place(this.framing,Zc(this.framing.view,e,t)))}followDevice(e){let t=Sl(this.framing.view,this.previous,e);this.previous=t.reading,this.frame({...this.framing,view:t.view})}letGo(){this.previous&&(this.previous=void 0,this.frame({...this.framing,view:Tl(this.framing.view)}))}pan(e){this.frame(this.rules().pan(this.framing,e,this.context()))}turn(e,t){this.frame(this.rules().turn(this.framing,{yaw:e,pitch:t},this.context()))}zoom(e,t=kc){this.frame(this.rules().zoom(this.framing,{steps:e,focus:t},this.context()))}reset(){this.frame(this.rules().reset(this.framing))}frame(e){if(cl(e,this.framing))return;let t=!kP(e.view,this.framing.view);this.framing=e,this.surface?.setFraming(e),t&&this.events.emit(`viewchange`,OP(e.view))}context(){return{viewport:this.measureViewport(),lensCount:this.lensCount}}rules(){return(this.previous===void 0?void 0:Rl(this.mode))??Il(this.mode)}},MP=/* @__PURE__ */ new Set([`ready`,`paused`,`ended`]),NP=/* @__PURE__ */ new Map([[`playing`,`playing`],[`buffering`,`waiting`]]);function PP(e,t){return t===`seeking`?[`seeking`]:e===`seeking`?t===`buffering`?[`seeked`,`waiting`]:[`seeked`]:t===`paused`?e===`ready`?[]:[`pause`]:FP(e,t)}function FP(e,t){let n=NP.get(t);return n===void 0?[]:e===void 0||MP.has(e)?[`play`,n]:[n]}var IP=class{targets;stopListening=[];lastState;detachments=0;constructor(e){this.targets=e}attach(e){this.detach(),this.lastState=e.state;let{events:t}=this.targets;this.stopListening=[e.events.on(`statechange`,t=>{this.onStateChange(t,e)}),e.events.on(`timeupdate`,e=>{t.emit(`timeupdate`,e)}),e.events.on(`present`,e=>{t.emit(`frame`,e)}),e.events.on(`ended`,()=>{this.targets.onEnded()}),e.events.on(`error`,e=>{t.emit(`error`,e)})]}detach(){for(let e of this.stopListening)e();this.stopListening=[],this.lastState=void 0,this.detachments+=1}onStateChange(e,t){let n=this.lastState;this.lastState=e;let r=this.detachments;for(let i of PP(n,e))if(this.emitTransport(i,t),this.detachments!==r)return;this.targets.onState(e)}emitTransport(e,t){let{events:n}=this.targets;e===`seeking`||e===`seeked`?n.emit(e,t.currentTime):n.emit(e,void 0)}},LP=class{parts;events=new bf;outbox=new Pu(this.events);loop;phase=xP;viewing;motion;picture=new wP(this.outbox);pendingStartTime;sound;relay=new IP({events:this.outbox,onState:()=>{this.announceStatus()},onEnded:()=>{this.starts.ended()}});starts=new BN(this.outbox,()=>this.play());isDisposed=!1;lastStatus=`idle`;constructor(e){this.parts=e,this.loop=new WN(this.tick),e.host.audio.addEventListener(`ended`,this.tick),this.sound=new TP(e.host.audio,this.outbox);let{canvas:t}=e.host;this.viewing=new jP(this.outbox,()=>HN(t)),this.motion=new vP({sensor:e.attitude??_p,view:this.viewing,events:this.outbox,hasRecording:()=>this.loaded!==void 0})}get status(){return CP(this.phase)}get metadata(){return this.loaded?.opened.metadata}get currentTime(){return this.loaded?.pipeline.session.currentTime??R(0)}get duration(){return this.loaded?.opened.duration??R(0)}get isPaused(){return!vf(this.loaded?.pipeline.session.state)}get view(){return OP(this.viewing.current)}get viewMode(){return this.viewing.viewMode}get canPan(){return this.viewing.canPan}get motionLook(){return this.motion.state}get stabilization(){return this.picture.stabilization}get quality(){return this.picture.quality}get isLooping(){return this.starts.isLooping}get volume(){return this.sound.volume}get isMuted(){return this.sound.isMuted}get canSetVolume(){return this.sound.canSetVolume}async load(e,t={}){if(this.isDisposed)return;let n=this.outbox.change(()=>{this.unload();let e=SP();return this.phase=e,this.announceStatus(),e});try{await this.complete(n,e,t)}catch(e){if(n.controller.signal.aborted)return;throw this.failWith(e)}finally{n.settled.resolve()}}unload(){this.outbox.change(()=>{this.release(),this.announceStatus()})}async play(){if(await this.loadInProgress(),this.phase.kind===`failed`)throw this.phase.failure;await this.loaded?.pipeline.session.play()}pause(){this.loaded?.pipeline.session.pause()}stop(){this.loaded?.pipeline.session.stop()}seek(e){Jf(e,`time`);let t=this.loaded?.pipeline.session;t&&t.state!==`error`?t.seek(R(e)):this.pendingStartTime=R(e)}async scrub(e){Jf(e,`time`),await this.loaded?.pipeline.session.scrub(R(e))}setView(e){this.viewing.set(Yf(e))}lookAt(e,n){Jf(e,`yaw`),Jf(n,`pitch`),this.viewing.lookAt(t(e),t(n))}pan(e){this.viewing.pan(e)}turn(e,n){Jf(e,`yaw turn`),Jf(n,`pitch turn`),this.viewing.turn(t(e),t(n))}zoom(e,t){Jf(e,`zoom steps`),this.viewing.zoom(e,t)}resetView(){this.viewing.reset()}setViewMode(e){this.viewing.setMode(e),this.motion.reconsider()}startMotionLook(){return this.motion.start()}stopMotionLook(){this.motion.stop()}setStabilization(e){this.picture.setStabilization(e)}setQuality(e){this.picture.setQuality(e)}setLooping(e){this.starts.setLooping(e)}setGainMatching(e){this.picture.setGainMatching(e)}setVolume(e){Jf(e,`volume`),this.sound.setVolume(e)}setMuted(e){this.sound.setMuted(e)}dispose(){this.isDisposed=!0,this.unload(),this.motion.dispose(),this.parts.host.audio.removeEventListener(`ended`,this.tick),this.sound.dispose(),this.events.removeAll()}tick=()=>{this.loaded?.pipeline.session.tick()};async loadInProgress(){this.phase.kind===`loading`&&await this.phase.settled.promise}get loaded(){return this.phase.kind===`loaded`?this.phase.loaded:void 0}async complete(e,t,n){let{signal:r}=e.controller,i=await hP({source:t,parts:this.parts,signal:r});if(r.aborted){i.dispose();return}this.outbox.change(()=>{this.attach(i,e.controller),this.startAtPendingTime(i),n.preload!==!1&&i.pipeline.session.preload()}),n.autoplay&&this.loaded===i&&await this.starts.autoplay()}startAtPendingTime(e){let t=this.pendingStartTime;this.pendingStartTime=void 0,t!==void 0&&e.pipeline.session.seek(t)}attach(e,t){this.phase={kind:`loaded`,loaded:e,controller:t},this.viewing.attach(e.pipeline.renderer),this.motion.reconsider();let{session:n}=e.pipeline;this.picture.attach(e.pipeline),this.relay.attach(n),this.loop.start(),this.announceStatus();for(let t of e.warnings)this.outbox.emit(`warning`,t);this.outbox.emit(`ready`,e.opened.metadata)}release(){let e=this.phase;this.phase=xP,e.kind===`loading`&&e.controller.abort(),this.loop.stop(),this.relay.detach(),this.viewing.attach(void 0),this.motion.reconsider(),this.picture.attach(void 0),e.kind===`loaded`&&(e.loaded.dispose(),e.controller.abort())}failWith(e){let t=ne(e,`invariant-violation`,`the player failed unexpectedly`);return this.outbox.change(()=>{this.release(),this.phase={kind:`failed`,failure:t},this.announceStatus(),this.outbox.emit(`error`,t)}),t}announceStatus(){let{status:e}=this;this.outbox.post(()=>{e!==this.lastStatus&&(this.lastStatus=e,this.events.emit(`statuschange`,e))})}};function RP(e,t){return new LP({host:e,ports:TS(t),pipelines:jN,attitude:new Sp})}function zP(e,t={}){let n=t.signal??new AbortController().signal,{source:r}=ES(t.http??{}).open(BP(e),n);return dr(r)}function BP(e){return typeof e==`string`?{url:e}:{blob:e,name:e instanceof File?e.name:``}}var VP={Src:`src`,Src2:`src2`},HP={CrossOrigin:`crossorigin`},UP={FieldOfView:`fov`,Yaw:`yaw`,Pitch:`pitch`},WP={Autoplay:`autoplay`,Preload:`preload`,GainMatch:`gain-match`,Muted:`muted`,Loop:`loop`,Stabilization:`stabilization`,ViewMode:`view-mode`,Quality:`quality`,Controls:`controls`,Poster:`poster`},GP=[...Object.values(VP),...Object.values(HP),...Object.values(UP),...Object.values(WP)];function KP(e,t){let n=JP(e(HP.CrossOrigin)),r=qP(e(VP.Src),t,n);return r&&{main:r,second:qP(e(VP.Src2),t,n)}}function qP(e,t,n){let r=e?.trim()??``;return r===``?void 0:{url:YP(r,t),...n}}function JP(e){return Wf(iF,e)===`use-credentials`?{credentials:`include`}:{}}function YP(e,t){try{return new URL(e,t).href}catch{return e}}var XP={[UP.FieldOfView]:`fieldOfView`,[UP.Yaw]:`yaw`,[UP.Pitch]:`pitch`};function ZP(e,t,n){let r=XP[t],i=$P(n);return r===void 0||i===void 0?e:{...e,[r]:i}}function QP(e){return e!==null}function $P(e){if(e===null||e.trim()===``)return;let t=Number(e);return Number.isFinite(t)?t:void 0}function eF(e,t,n){return{code:`ignored-attribute`,message:`ignoring ${e}="${t}"; expected one of ${n.join(`, `)}`}}function tF(e,t){return t===null||$P(t)!==void 0?void 0:{code:`ignored-attribute`,message:`ignoring ${e}="${t}"; expected a number of degrees`}}var nF={name:WP.Preload,keywords:[`none`,`auto`],fallback:`auto`},rF={name:WP.GainMatch,keywords:[`on`,`off`],fallback:`on`},iF={name:HP.CrossOrigin,property:`crossOrigin`,keywords:[`anonymous`,`use-credentials`],fallback:`anonymous`};function aF(e){return Wf(nF,e)===`auto`}function oF(e){return Wf(rF,e)===`on`}function sF(e,t,n){return n?cF(n):KP(e,t)}function cF(e){return{main:{blob:e.main,name:e.main.name},second:e.second&&{blob:e.second,name:e.second.name}}}var lF=class{element;player;scheduled;isOwed=!0;awaited;startTime;files;constructor(e,t){this.element=e,this.player=t}connected(){this.isOwed&&this.schedule(),this.awaited?.follow(this.scheduled??Promise.resolve()),this.awaited=void 0}async disconnected(){await Promise.resolve(),!this.element.isConnected&&(this.player.unload(),this.isOwed=!0)}sourceChanged(){this.files=void 0,this.schedule()}requestChanged(){this.files===void 0&&this.schedule()}loadFiles(e){this.files=e,this.schedule()}load(){return this.element.isConnected?this.scheduled??this.reload():this.loadOnConnection()}seek(e){this.scheduled?this.startTime=e:this.player.seek(e)}async settled(){try{await this.scheduled}catch{}}loadOnConnection(){return this.isOwed=!0,this.awaited??=new Wd,this.awaited.promise}schedule(){if(this.isOwed=!this.element.isConnected,this.scheduled||!this.element.isConnected)return;let e=this.loadAfterPendingChanges();this.scheduled=e,e.catch(uF)}async loadAfterPendingChanges(){await Promise.resolve(),this.scheduled=void 0,this.element.isConnected&&await this.reload()}reload(){this.isOwed=!1;let e=e=>this.element.getAttribute(e),t=sF(e,document.baseURI,this.files);delete this.element.dataset.hasFrame;let n=this.startTime;if(this.startTime=void 0,!t)return this.player.unload(),Promise.resolve();let r=this.player.load(t,{autoplay:this.element.autoplay,preload:aF(e(WP.Preload))});return n!==void 0&&this.player.seek(n),r}};function uF(){}var dF=`data-fill`,fF=class{element;constructor(e){this.element=e}get isActive(){return this.isNativelyFullscreen()||this.element.hasAttribute(dF)}async toggle(){await(this.isActive?this.exit():this.enter())}async exit(){this.isNativelyFullscreen()&&await document.exitFullscreen(),this.element.removeAttribute(dF)}isNativelyFullscreen(){return this.element.matches(`:fullscreen`)}async enter(){if(document.fullscreenEnabled)try{await this.element.requestFullscreen();return}catch{}this.element.setAttribute(dF,``)}},pF=`data-idle`,mF=2500,hF=[`pointermove`,`pointerdown`,`keydown`,`focusin`],gF={capture:!0},_F=class{element;shouldHide;timer;wasIdleAtPress=!1;constructor(e,t){this.element=e,this.shouldHide=t}get wasIdleAtLastPress(){return this.wasIdleAtPress}start(){this.element.addEventListener(`pointerdown`,this.onPress,gF);for(let e of hF)this.element.addEventListener(e,this.onActivity,gF);this.onActivity()}stop(){for(let e of hF)this.element.removeEventListener(e,this.onActivity,gF);this.element.removeEventListener(`pointerdown`,this.onPress,gF),this.clearTimer(),this.element.removeAttribute(pF)}refresh(){this.shouldHide()||this.element.removeAttribute(pF),this.restart()}onPress=()=>{this.wasIdleAtPress=this.element.hasAttribute(pF)};onActivity=()=>{this.element.removeAttribute(pF),this.restart()};restart(){this.clearTimer(),this.timer=setTimeout(()=>{this.shouldHide()&&this.element.setAttribute(pF,``)},mF)}clearTimer(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}};function vF(e,t,n){return({player:r,warn:i},a)=>{let o=If(a,t);o?n(r,o):a!==null&&i(eF(e,a,t))}}var yF={[WP.Stabilization]:vF(WP.Stabilization,qs,(e,t)=>{e.setStabilization(t)}),[WP.ViewMode]:vF(WP.ViewMode,Tc,(e,t)=>{e.setViewMode(t)}),[WP.Quality]:vF(WP.Quality,xc,(e,t)=>{e.setQuality(t)}),[WP.Muted]:({player:e},t)=>{e.setMuted(QP(t))},[WP.Loop]:({player:e},t)=>{e.setLooping(QP(t))},[WP.Poster]:({posterImage:e},t)=>{e.src=t??``},[WP.GainMatch]:({player:e},t)=>{e.setGainMatching(oF(t))}};function bF(e){return Object.hasOwn(yF,e)}function xF(e,t,n){bF(t)&&yF[t](e,n)}function SF(e,t){e.hasAttribute(`tabindex`)||(e.tabIndex=0),e.hasAttribute(`role`)||e.setAttribute(`role`,`region`),e.hasAttribute(`aria-label`)||e.hasAttribute(`aria-labelledby`)||e.setAttribute(`aria-label`,t)}function CF(e,t,n){e.getAttribute(`aria-label`)===t&&e.setAttribute(`aria-label`,n)}function wF(e,t){let n=/* @__PURE__ */ new Map;for(let r of t)Object.hasOwn(e,r)&&(n.set(r,Reflect.get(e,r)),Reflect.deleteProperty(e,r));return n}function TF(e,t,n){let r=[...t];t.clear();for(let[t,i]of r)try{Reflect.set(e,t,i)}catch(e){n({code:`refused-property`,message:`${t} set before the element was defined was refused: ${ie(e)}`})}}var EF=Nu({stabilization:!0,viewMode:!0,quality:!0,fov:!0,yaw:!0,pitch:!0,muted:!0,loop:!0,volume:!0});function DF(e,t){let n={stabilization:{get:()=>t.stabilization,set:NF(e=>{t.setStabilization(AF(e))})},viewMode:{get:()=>t.viewMode,set:NF(e=>{t.setViewMode(jF(e))})},quality:{get:()=>t.quality,set:NF(e=>{t.setQuality(MF(e))})},...OF(t),...kF(t)};for(let[t,r]of Object.entries(n))Object.defineProperty(e,t,{configurable:!0,enumerable:!0,...r})}function OF(e){let t=(t,n)=>({get:()=>e.view[t],set:NF(r=>{e.setView({...e.view,[t]:FF(r,n)})})});return{fov:t(`fieldOfView`,`fov`),yaw:t(`yaw`,`yaw`),pitch:t(`pitch`,`pitch`)}}function kF(e){return{muted:{get:()=>e.isMuted,set:t=>{e.setMuted(!!t)}},loop:{get:()=>e.isLooping,set:t=>{e.setLooping(!!t)}},volume:{get:()=>e.volume,set:NF(t=>{e.setVolume(IF(t,`volume`))})}}}function AF(e){return PF(e,Lf,`stabilization`)}function jF(e){return PF(e,Rf,`viewMode`)}function MF(e){return PF(e,zf,`quality`)}function NF(e){return t=>{t!=null&&t!==``&&e(t)}}function PF(e,t,n){let r=typeof e==`string`?t(e):void 0;if(r===void 0)throw new j(`invalid-argument`,`${n} cannot be ${String(e)}`);return r}function FF(e,n){return t(IF(e,n))}function IF(e,t){return Jf(e,t),e}var LF=`/*
|
|
4642
|
+
`,rN=[QM,KM],iN=[...rN,XM,ZM];function aN(e){return[YM,...iN,e]}function oN(e){let t=t=>[YM,tN,t,...iN,e,nN];return{rectilinear:t(eN),equirectangular:t(qM),"lens-tiles":[YM,tN,...rN,$M]}}var sN=oN(JM),cN=aN(GM);function lN(e){return[...new Set(e.flat())]}lN([...Object.values(sN),cN]);var uN=64,dN=class{renderer;lensCount;target=new mT(uN,2,{depthBuffer:!1,stencilBuffer:!1});pixels=new Uint8Array(uN*2*4);camera=new mO;scene=new eE;material;geometry=FM();isDisposed=!1;constructor(e,t,n){this.renderer=e,this.lensCount=n,this.material=LM(t,IM(cN)),this.scene.add(new vD(this.geometry,this.material));try{UM(e,this.scene,this.camera)}catch(e){throw this.dispose(),e}}async measure(){try{await this.readSeam()}catch(e){if(this.isDisposed||this.renderer.getContext().isContextLost())return;throw e}return this.isDisposed?void 0:VM(this.pixels,uN,this.lensCount)}dispose(){this.isDisposed||(this.isDisposed=!0,this.target.dispose(),this.material.dispose(),this.geometry.dispose())}draw(){WM(this.renderer,this.target,()=>{this.renderer.render(this.scene,this.camera)})}async readSeam(){this.draw(),await this.renderer.readRenderTargetPixelsAsync(this.target,0,0,uN,2,this.pixels)}};function fN(e,t){return Array.from({length:e},()=>{let e=new DD;return e.flipY=!1,e.colorSpace=``,e.magFilter=iC,pN(e,t),e})}function pN(e,t){e.minFilter=t.minFilter,e.generateMipmaps=t.generateMipmaps,e.anisotropy=t.anisotropy}var mN={programs:sN,defines:pM};function hN(e,t){let n=n=>LM(e,{chunks:t.programs[n],defines:t.defines});return{rectilinear:n(`rectilinear`),equirectangular:n(`equirectangular`),"lens-tiles":n(`lens-tiles`)}}function gN(e,t,n){let r=new mO;for(let i of Object.values(n)){let n=new eE;n.add(new vD(t,i)),UM(e,n,r)}}function _N(e){for(let t of Object.values(e))t.dispose()}var vN={shaders:mN,uniforms:{}},yN=class{parts;canvas;framing=sl;viewMode=Ec;hasFrames=!1;isDisposed=!1;meters=/* @__PURE__ */ new Set;constructor(e,t){this.parts=e,this.canvas=t,this.applyFraming(),t.addEventListener(`webglcontextrestored`,this.onContextRestored)}static create(e,t,n={}){let r={options:n,pictures:vN};return new this(this.openParts(e,t,r),e)}static openParts(e,t,n){bN(t);let r=RM(e,n.options);try{return{...SN(r,t,n.pictures),drawSchedule:n.options.drawSchedule??tM}}catch(e){throw r.dispose(),e}}get lensCount(){return this.parts.lensCount}setFraming(e){this.ensureLive(),this.framing=e,this.applyFraming(),this.redraw()}setViewMode(e){this.ensureLive(),this.viewMode=e,this.applyFraming(),this.redraw()}setQuality(e){this.ensureLive();let t=uM[e];for(let e of this.parts.textures)pN(e,t),this.hasFrames&&(e.needsUpdate=!0);SM(this.parts.uniforms,t),this.redraw()}setLensGains(e){this.ensureLive();for(let[t,n]of e.entries())wM(this.parts.uniforms,t,n);this.redraw()}createSeamMeter(){this.ensureLive();let e=new dN(this.parts.renderer,this.parts.uniforms,this.parts.lensCount);return this.tracked({measure:()=>e.measure(),dispose:()=>{e.dispose()}})}setStabilization(e){this.ensureLive(),CM(this.parts.uniforms,e)}present(e){this.ensureLive();let{frames:t}=e.pair;N(t.length===this.parts.textures.length,`a pair of ${t.length} frames does not fit ${this.parts.textures.length} lens textures`);for(let[e,n]of this.parts.textures.entries()){let r=t[e];r&&n.setFrame(r.handle)}this.parts.matrixCorrections.follow(t.map(e=>e.handle)),this.hasFrames=!0,this.drawNow()}resize(e){this.ensureLive(),this.parts.renderer.setSize(e.width,e.height,!1),this.applyFraming(),this.drawNow()}dispose(){if(!this.isDisposed){this.isDisposed=!0,this.parts.drawSchedule.cancel(),this.canvas.removeEventListener(`webglcontextrestored`,this.onContextRestored);for(let e of this.meters)e.dispose();this.parts.seamProof.dispose();for(let e of this.parts.textures)e.dispose();_N(this.parts.materials),this.parts.pass.geometry.dispose(),this.parts.renderer.dispose()}}get webgl(){return this.parts.renderer}get uniforms(){return this.parts.uniforms}tracked(e){let t={...e,dispose:()=>{this.meters.delete(t),e.dispose()}};return this.meters.add(t),t}redraw(){this.parts.drawSchedule.request(this.draw)}ensureLive(){N(!this.isDisposed,`the renderer has been disposed`)}onContextRestored=()=>{this.redraw()};drawNow(){this.parts.drawSchedule.cancel(),this.draw()}draw=()=>{this.hasFrames&&this.parts.renderer.render(this.parts.scene,this.parts.camera)};applyFraming(){let e={width:this.canvas.width,height:this.canvas.height},t=Il(this.viewMode).picture(this.framing,{viewport:e,lensCount:this.parts.lensCount});this.parts.pass.material=this.parts.materials[t.kind],EM(this.parts.uniforms,t,jc(e))}};function bN(e){if(!(e.lenses.length<=2&&e.frameSlotCount<=2))throw new j(`unsupported-layout`,`the renderer draws at most 2 lenses from 2 frames; the layout has ${e.lenses.length} lenses in ${e.frameSlotCount} frames`)}function xN(e,t){let n=uM[Sc],r=fN(e.frameSlotCount,n),i=mM(e,r);return SM(i,n),{textures:r,uniforms:i,materials:hN({...i,...t.uniforms},t.shaders)}}function SN(e,t,n){let{textures:r,uniforms:i,materials:a}=xN(t,n),o=new vD(FM(),a.rectilinear),s=CN(e,{pass:o,materials:a,textures:r,uniforms:i}),c=new eE;return c.add(o),{renderer:e,scene:c,camera:new mO,pass:o,materials:a,textures:r,uniforms:i,matrixCorrections:new rM(t.lenses,i.uLensMatrixCorrection),lensCount:t.lenses.length,seamProof:s}}function CN(e,t){let{pass:n,materials:r,textures:i,uniforms:a}=t;try{return gN(e,n.geometry,r),new dN(e,a,a.uLensCount.value)}catch(e){_N(r),n.geometry.dispose();for(let e of i)e.dispose();throw e}}var wN={request:e=>requestAnimationFrame(e),cancel:e=>{cancelAnimationFrame(e)}},TN=class{frames;pendingDraw;handle;constructor(e=wN){this.frames=e}request(e){let t=this.pendingDraw!==void 0;this.pendingDraw=e,t||(this.handle=this.frames.request(this.drawPending))}cancel(){this.pendingDraw=void 0,this.handle!==void 0&&(this.frames.cancel(this.handle),this.handle=void 0)}drawPending=()=>{let e=this.pendingDraw;this.pendingDraw=void 0,this.handle=void 0,e?.()}},EN=class{actions=[];isDisposed=!1;add(e){if(this.isDisposed){e();return}this.actions.push(e)}disposeAll(){if(!this.isDisposed){this.isDisposed=!0;for(let e of this.actions.splice(0).toReversed())e()}}toDisposer(){return()=>{this.disposeAll()}}},DN={maxPendingPackets:4,pairTolerance:R(5e-4)},ON=`the recording has no audio track; playback follows a silent clock`,kN=`this browser cannot play the audio track through Media Source Extensions; playback follows a silent clock`,AN=`the audio track could not be prepared for playback; playback follows a silent clock`;async function jN(e){let t=new EN;try{let n=await PN(e);t.add(()=>{n.clock.dispose()}),e.signal.throwIfAborted();let r=MN(e,t),i=zN(e,n.clock,r.gainMatching);return t.add(()=>{i.dispose()}),RN(i,e.opened),{session:i,renderer:r.renderer,...NN(r,i),soundWarnings:n.warnings,dispose:t.toDisposer()}}catch(e){throw t.disposeAll(),e}}function MN(e,t){let n=yN.create(e.host.canvas,IN(e.opened),{drawSchedule:new TN});t.add(()=>{n.dispose()});let{sink:r,stabilizing:i}=LN(n,e.opened),a=new su(r,n);return t.add(()=>{a.dispose()}),{renderer:n,stabilizing:i,gainMatching:a}}function NN(e,t){return{setStabilization:n=>{e.stabilizing?.setStabilizer(tc(n)),t.redraw()},setQuality:t=>{e.renderer.setQuality(t)},setGainMatching:n=>{n?e.gainMatching.enable():e.gainMatching.disable(),t.redraw()}}}async function PN(e){let{soundSegments:t}=e.opened;if(!t)return FN(ON);try{let n=t();return JS.isSupported(n)?(e.signal.throwIfAborted(),{clock:await JS.open(e.host.audio,n),warnings:[]}):FN(kN)}catch(e){return FN(`${AN} (${ie(e)})`)}}function FN(e){return{clock:new hf(()=>pt(performance.now())),warnings:[e]}}function IN(e){return Zl({calibration:e.calibration,layout:e.layout,displayConversions:e.displayConversions})}function LN(e,t){if(!t.motion)return e.setStabilization(Fi.toBody),{sink:e,stabilizing:void 0};let n=new nu({sink:e,motion:t.motion,frameTimes:t.frameTimes});return{sink:n,stabilizing:n}}function RN(e,t){e.events.on(`statechange`,e=>{vf(e)&&t.readAhead()})}function zN(e,t,n){return new Ff({frameSources:e.opened.frameSources,decoderPort:e.decoderPort,clock:t,sink:n,duration:e.opened.duration,buffer:e.opened.buffer,pipeline:DN,queueCapacity:4})}var BN=class{events;play;isLoopingValue=!1;constructor(e,t){this.events=e,this.play=t}get isLooping(){return this.isLoopingValue}setLooping(e){this.isLoopingValue=e}async autoplay(){try{await this.play()}catch(e){this.events.emit(`warning`,M(e,`playback-blocked`)?{code:`autoplay-blocked`,message:`playback waits for a user gesture`}:{code:`playback-failed`,message:`autoplay failed: ${ie(e)}`})}}ended(){this.events.emit(`ended`,void 0),this.isLoopingValue&&this.replay()}async replay(){try{await this.play()}catch(e){this.events.emit(`warning`,{code:`playback-failed`,message:`the loop could not restart playback: ${ie(e)}`})}}};function VN(e,t,n=Sc){let r=yr(t,1,wc(n));return{width:Math.max(1,Math.round(e.width*r)),height:Math.max(1,Math.round(e.height*r))}}function HN(e){let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}var UN=class{canvas;renderer;observer;ratioWatch=new AbortController;quality=Sc;constructor(e,t){this.canvas=e,this.renderer=t,this.observer=new ResizeObserver(()=>{this.fit()}),this.observer.observe(e),this.watchPixelRatio(),this.fit()}setQuality(e){this.quality=e,this.fit()}dispose(){this.observer.disconnect(),this.ratioWatch.abort()}watchPixelRatio(){globalThis.matchMedia(`(resolution: ${globalThis.devicePixelRatio}dppx)`).addEventListener(`change`,()=>{this.fit(),this.watchPixelRatio()},{once:!0,signal:this.ratioWatch.signal})}fit(){let e=VN(HN(this.canvas),globalThis.devicePixelRatio,this.quality);(e.width!==this.canvas.width||e.height!==this.canvas.height)&&this.renderer.resize(e)}},WN=class{tick;scheduler;isActive=!1;handle;constructor(e,t=wN){this.tick=e,this.scheduler=t}start(){this.isActive||(this.isActive=!0,this.schedule())}stop(){this.isActive=!1,this.handle!==void 0&&(this.scheduler.cancel(this.handle),this.handle=void 0)}schedule(){this.handle=this.scheduler.request(()=>{this.handle=void 0,this.tick(),this.isActive&&this.schedule()})}};async function GN(e,t){let{ports:n,signal:r}=t,i=await cf(e,n.decoderPort,XN(t));if(r.throwIfAborted(),!i.canDecode)throw JN(i)}var KN={"no-key-frame":{code:`no-key-frame`,message:`the recording has no key frame to start decoding from`},"key-frame-late":{code:`source-unreadable`,message:`the recording's first frames did not arrive in time`}},qN={code:`codec-unsupported`,message:`this browser cannot decode the recording`};function JN(e){let t=YN(e),{code:n,message:r}=(t===void 0?void 0:KN[t])??qN;return new j(n,`${r}: ${ZN(e)}`)}function YN(e){let t=new Set(e.sources.filter(e=>e.verdict!==`decodes`).map(e=>e.verdict));t.has(`key-frame-late`)&&t.delete(`timed-out`);let[n]=t;return t.size===1?n:void 0}function XN(e){let t=e.ports.probeDeadline();return e.signal.addEventListener(`abort`,()=>{t.resolve()},{once:!0}),t}function ZN(e){return e.sources.filter(e=>e.verdict!==`decodes`).map(e=>`track ${e.track.trackIndex} ${e.verdict}${e.detail?` (${e.detail})`:``}`).join(`; `)}async function QN(e,t){let{ports:n,signal:r}=t,i=e.map(e=>({input:e,opened:n.sources.open(e,r)})),a=await rP(i,n);r.throwIfAborted();let o=[...i,...await tP(i,a,t)],s=await Promise.all(o.map(e=>eP(e,n)));return r.throwIfAborted(),{recording:a,inputs:s}}function $N(e){let t=e.codecs.video.map(({description:e})=>({description:e}));return{name:CS(e.input),videoTracks:t}}async function eP(e,t){let{source:n}=e.opened,{table:r,movieBytes:i}=await Yo(n),a=await t.codecReader.read(i);return{...e,table:r,codecs:a,size:await n.size()}}async function tP(e,t,n){if(e.length!==1||t.info.fileLayout!==`split-files`||!n.findSecondFile)return[];let r=await n.findSecondFile();return n.signal.throwIfAborted(),r===void 0?[]:[{input:r,opened:n.ports.sources.open(r,n.signal)}]}var nP={fileLayout:void 0,trackOrder:void 0};async function rP(e,t){try{return await aP(e.map(({opened:e})=>e.source))}catch(n){let[r]=e;throw e.length===1&&M(n,`invalid-trailer`)&&r&&await iP(r,t),n}}async function iP(e,t){let n;try{n=await eP(e,t)}catch{return}try{os([$N(n)],nP)}catch(e){if(M(e,`missing-second-file`))throw e}}async function aP(e){let[t,n]=e;N(t!==void 0,`a recording needs at least one input`);try{return await $n(t)}catch(e){if(n===void 0||!M(e,`invalid-trailer`))throw e;return $n(n)}}async function oP(e,t){let n=new EN;try{let r=await QN(e,t),i=os(r.inputs.map(e=>$N(e)),r.recording.info),a=lP(r.recording),o=sP(r.inputs,n),s=Xl(i).map(e=>cP(o,e));await GN(s,t);let c=await pa(r.recording,s[0]);return t.signal.throwIfAborted(),uP({read:r,files:o,layout:i,frameSources:s,calibration:a,timing:c},t.ports.audioPackager,n)}catch(e){throw n.disposeAll(),e}}function sP(e,t){return e.map(({opened:n,table:r,codecs:i,size:a})=>{let o=Ld({size:a,duration:r.duration},e.length),s=wd({table:r,stream:n.stream,codecs:i,policy:o});return t.add(()=>{s.dispose()}),s})}function cP(e,t){let n=e[t.inputIndex]?.videoTracks[t.trackIndex];return N(n!==void 0,`the layout points at track ${t.trackIndex} of input ${t.inputIndex}, which does not exist`),n}function lP(e){let{calibration:t,warnings:n}=e.calibration;if(t)return t;throw new j(`no-calibration`,`the recording carries no usable lens calibration, so it cannot be stitched${n.length>0?` (${n.join(`; `)})`:``}`)}function uP(e,t,n){let{read:r,files:i,layout:a,frameSources:o,calibration:s,timing:c}=e,l=R(Math.min(...i.map(e=>e.duration))),u=Ou(o.map(e=>e.description.colour)),[d]=i.flatMap(e=>e.audioTracks);return{recording:r.recording,layout:a,frameSources:o,calibration:s,displayConversions:u.conversions,duration:l,frameTimes:c.frameTimes,motion:c.motion,soundSegments:d&&(()=>t.segmentsOf(d.samples,d.configuration)),metadata:dP(e,l,d!==void 0),warnings:[...c.warnings,...u.warnings],readAhead:()=>{for(let e of i)e.download.startReadingAhead()},buffer:new Rd(i.map(e=>e.download)),dispose:n.toDisposer()}}function dP(e,t,n){let{info:r}=e.read.recording,{motion:i}=e.timing;return{model:r.model,firmware:r.firmware,captureMode:r.captureMode,layout:e.layout.kind,layoutEvidence:e.layout.evidence,tracks:e.frameSources.map(e=>e.description),calibrationVersion:e.calibration.version,frameTimeSource:e.timing.frameTimeSource,hasGyro:i!==void 0,imuFrame:i&&{name:i.imuFrame.name,isVerified:i.imuFrame.isVerified},hasAudio:n,duration:t}}async function fP(e,t,n){let r=pP(e,t,n),i=e.second?[e.main,e.second]:[e.main];try{return await oP(i,r)}catch(t){let{findSecondFile:i}=r;if(!i||!M(t,`missing-second-file`))throw t;let a=await i();if(n.throwIfAborted(),!a)throw t;return oP([e.main,a],r)}}function pP(e,t,n){let{main:r}=e;return e.second===void 0&&SS(r)?{ports:t,signal:n,findSecondFile:$e(()=>mP(r,t))}:{ports:t,signal:n}}async function mP(e,t){let n=await Da(e.url,t.locatorFor(e));return n===void 0?void 0:{...e,url:n}}async function hP(e){let{parts:t,signal:n}=e,r=await fP(e.source,t.ports,n),i=new EN;i.add(()=>{r.dispose()});try{let e=await t.pipelines({opened:r,host:t.host,decoderPort:t.ports.decoderPort,signal:n});i.add(()=>{e.dispose()}),n.throwIfAborted();let a=new UN(t.host.canvas,e.renderer);i.add(()=>{a.dispose()});let o=gP(e,a);return{opened:r,pipeline:o,warnings:_P(r,o),dispose:i.toDisposer()}}catch(e){throw i.disposeAll(),e}}function gP(e,t){return{...e,setQuality:n=>{e.setQuality(n),t.setQuality(n)}}}function _P(e,t){return[...e.warnings.map(e=>({code:`recording-degraded`,message:e})),...t.soundWarnings.map(e=>({code:`no-sound`,message:e}))]}var vP=class{parts;stateValue;request;generation=0;stopHearing;stopFollowingAvailability;wasRefused=!1;constructor(e){this.parts=e,this.stateValue=e.sensor.availability===`available`?`off`:`unavailable`}get state(){return this.stateValue}start(){return this.followAvailability(),this.stateValue===`off`?(this.request??=this.ask(),this.request):Promise.resolve(this.stateValue)}stop(){this.overtakeRequest(),this.stateValue===`on`&&this.change(`off`)}reconsider(){this.reconsiderAvailability(),this.reconsiderHearing()}dispose(){this.overtakeRequest(),this.stopFollowingAvailability?.(),this.stopFollowingAvailability=void 0,this.stopHearing?.(),this.stopHearing=void 0,this.parts.sensor.dispose()}reconsiderAvailability(){let e=this.parts.hasRecording();e&&!this.stopFollowingAvailability?(this.stopFollowingAvailability=this.parts.sensor.onAvailabilityChange(()=>{this.followAvailability()}),this.followAvailability()):!e&&this.stopFollowingAvailability&&(this.stopFollowingAvailability(),this.stopFollowingAvailability=void 0)}reconsiderHearing(){let{sensor:e,view:t,hasRecording:n}=this.parts,r=this.stateValue===`on`&&n()&&t.followsDevice;r&&!this.stopHearing?this.stopHearing=e.listen(e=>{t.followDevice(e)}):!r&&this.stopHearing&&(this.stopHearing(),this.stopHearing=void 0,t.letGo())}followAvailability(){let e=this.parts.sensor.availability===`available`;this.wasRefused||e===(this.stateValue!==`unavailable`)||(this.overtakeRequest(),this.change(e?`off`:`unavailable`))}async ask(){let e=this.generation,t=await this.accessOrGesture();return e===this.generation?(this.request=void 0,this.answer(t),this.stateValue):this.stateValue}async accessOrGesture(){try{return await this.parts.sensor.requestAccess()}catch{return`needs-gesture`}}answer(e){e===`granted`?this.change(`on`):e===`denied`?(this.wasRefused=!0,this.change(`unavailable`),this.warn(`motion-look-refused`,yP)):this.warn(`motion-look-needs-gesture`,bP)}overtakeRequest(){this.generation+=1,this.request=void 0}change(e){this.stateValue=e,this.reconsiderHearing(),this.parts.events.emit(`motionlookchange`,e)}warn(e,t){this.parts.events.emit(`warning`,{code:e,message:t})}},yP="motion look was refused: by the viewer, or by an iframe whose `allow` leaves out accelerometer, gyroscope and magnetometer",bP=`motion look asks for access, which this browser grants only from a user gesture such as a tap`,xP={kind:`idle`};function SP(){return{kind:`loading`,controller:new AbortController,settled:new Wd}}function CP(e){switch(e.kind){case`idle`:return`idle`;case`loading`:return`loading`;case`loaded`:return e.loaded.pipeline.session.state;case`failed`:return`error`}}var wP=class{events;mode=Js;isMatching=!0;qualityValue=Sc;target;constructor(e){this.events=e}get stabilization(){return this.mode}get quality(){return this.qualityValue}attach(e){this.target=e,e?.setStabilization(this.mode),e?.setGainMatching(this.isMatching),e?.setQuality(this.qualityValue)}setStabilization(e){e!==this.mode&&(this.mode=e,this.target?.setStabilization(e),this.events.emit(`stabilizationchange`,e))}setGainMatching(e){this.isMatching=e,this.target?.setGainMatching(e)}setQuality(e){e!==this.qualityValue&&(this.qualityValue=e,this.target?.setQuality(e),this.events.emit(`qualitychange`,e))}},TP=class{audio;events;canSetVolume;constructor(e,t){this.audio=e,this.events=t,this.canSetVolume=DP(e.ownerDocument),e.addEventListener(`volumechange`,this.onVolumeChange)}get volume(){return this.audio.volume}get isMuted(){return this.audio.muted}setVolume(e){this.audio.volume=yr(e,0,1)}setMuted(e){this.audio.muted=e}dispose(){this.audio.removeEventListener(`volumechange`,this.onVolumeChange)}onVolumeChange=()=>{this.events.emit(`volumechange`,{volume:this.volume,isMuted:this.isMuted})}},EP=.5;function DP(e){let t=e.createElement(`audio`);return t.volume=EP,t.volume===EP}function OP(e){return{yaw:e.yaw,pitch:e.pitch,fieldOfView:e.fieldOfView}}function kP(e,t){return e.yaw===t.yaw&&e.pitch===t.pitch&&e.fieldOfView===t.fieldOfView}var AP=2,jP=class{events;measureViewport;framing=sl;mode=Ec;surface;lensCount=AP;previous;constructor(e,t){this.events=e,this.measureViewport=t}get current(){return this.framing.view}get viewMode(){return this.mode}get canPan(){return this.rules().canPan(this.framing)}get followsDevice(){return Rl(this.mode)!==void 0}attach(e){this.surface=e,e&&(this.lensCount=e.lensCount),e?.setViewMode(this.mode),e?.setFraming(this.framing)}set(e){this.frame(this.rules().place(this.framing,e))}setMode(e){e!==this.mode&&(this.mode=e,this.surface?.setViewMode(e),this.events.emit(`viewmodechange`,e))}lookAt(e,t){this.frame(this.rules().place(this.framing,Zc(this.framing.view,e,t)))}followDevice(e){let t=Sl(this.framing.view,this.previous,e);this.previous=t.reading,this.frame({...this.framing,view:t.view})}letGo(){this.previous&&(this.previous=void 0,this.frame({...this.framing,view:Tl(this.framing.view)}))}pan(e){this.frame(this.rules().pan(this.framing,e,this.context()))}turn(e,t){this.frame(this.rules().turn(this.framing,{yaw:e,pitch:t},this.context()))}zoom(e,t=kc){this.frame(this.rules().zoom(this.framing,{steps:e,focus:t},this.context()))}reset(){this.frame(this.rules().reset(this.framing))}frame(e){if(cl(e,this.framing))return;let t=!kP(e.view,this.framing.view);this.framing=e,this.surface?.setFraming(e),t&&this.events.emit(`viewchange`,OP(e.view))}context(){return{viewport:this.measureViewport(),lensCount:this.lensCount}}rules(){return(this.previous===void 0?void 0:Rl(this.mode))??Il(this.mode)}},MP=/* @__PURE__ */ new Set([`ready`,`paused`,`ended`]),NP=/* @__PURE__ */ new Map([[`playing`,`playing`],[`buffering`,`waiting`]]);function PP(e,t){return t===`seeking`?[`seeking`]:e===`seeking`?t===`buffering`?[`seeked`,`waiting`]:[`seeked`]:t===`paused`?e===`ready`?[]:[`pause`]:FP(e,t)}function FP(e,t){let n=NP.get(t);return n===void 0?[]:e===void 0||MP.has(e)?[`play`,n]:[n]}var IP=class{targets;stopListening=[];lastState;detachments=0;constructor(e){this.targets=e}attach(e){this.detach(),this.lastState=e.state;let{events:t}=this.targets;this.stopListening=[e.events.on(`statechange`,t=>{this.onStateChange(t,e)}),e.events.on(`timeupdate`,e=>{t.emit(`timeupdate`,e)}),e.events.on(`present`,e=>{t.emit(`frame`,e)}),e.events.on(`ended`,()=>{this.targets.onEnded()}),e.events.on(`error`,e=>{t.emit(`error`,e)})]}detach(){for(let e of this.stopListening)e();this.stopListening=[],this.lastState=void 0,this.detachments+=1}onStateChange(e,t){let n=this.lastState;this.lastState=e;let r=this.detachments;for(let i of PP(n,e))if(this.emitTransport(i,t),this.detachments!==r)return;this.targets.onState(e)}emitTransport(e,t){let{events:n}=this.targets;e===`seeking`||e===`seeked`?n.emit(e,t.currentTime):n.emit(e,void 0)}},LP=class{parts;events=new bf;outbox=new Pu(this.events);loop;phase=xP;viewing;motion;picture=new wP(this.outbox);pendingStartTime;sound;relay=new IP({events:this.outbox,onState:()=>{this.announceStatus()},onEnded:()=>{this.starts.ended()}});starts=new BN(this.outbox,()=>this.play());isDisposed=!1;lastStatus=`idle`;constructor(e){this.parts=e,this.loop=new WN(this.tick),e.host.audio.addEventListener(`ended`,this.tick),this.sound=new TP(e.host.audio,this.outbox);let{canvas:t}=e.host;this.viewing=new jP(this.outbox,()=>HN(t)),this.motion=new vP({sensor:e.attitude??_p,view:this.viewing,events:this.outbox,hasRecording:()=>this.loaded!==void 0})}get status(){return CP(this.phase)}get metadata(){return this.loaded?.opened.metadata}get currentTime(){return this.loaded?.pipeline.session.currentTime??R(0)}get duration(){return this.loaded?.opened.duration??R(0)}get isPaused(){return!vf(this.loaded?.pipeline.session.state)}get view(){return OP(this.viewing.current)}get viewMode(){return this.viewing.viewMode}get canPan(){return this.viewing.canPan}get motionLook(){return this.motion.state}get stabilization(){return this.picture.stabilization}get quality(){return this.picture.quality}get isLooping(){return this.starts.isLooping}get volume(){return this.sound.volume}get isMuted(){return this.sound.isMuted}get canSetVolume(){return this.sound.canSetVolume}async load(e,t={}){if(this.isDisposed)return;let n=this.outbox.change(()=>{this.unload();let e=SP();return this.phase=e,this.announceStatus(),e});try{await this.complete(n,e,t)}catch(e){if(n.controller.signal.aborted)return;throw this.failWith(e)}finally{n.settled.resolve()}}unload(){this.outbox.change(()=>{this.release(),this.announceStatus()})}async play(){if(await this.loadInProgress(),this.phase.kind===`failed`)throw this.phase.failure;await this.loaded?.pipeline.session.play()}pause(){this.loaded?.pipeline.session.pause()}stop(){this.loaded?.pipeline.session.stop()}seek(e){Jf(e,`time`);let t=this.loaded?.pipeline.session;t&&t.state!==`error`?t.seek(R(e)):this.pendingStartTime=R(e)}async scrub(e){Jf(e,`time`),await this.loaded?.pipeline.session.scrub(R(e))}setView(e){this.viewing.set(Yf(e))}lookAt(e,n){Jf(e,`yaw`),Jf(n,`pitch`),this.viewing.lookAt(t(e),t(n))}pan(e){this.viewing.pan(e)}turn(e,n){Jf(e,`yaw turn`),Jf(n,`pitch turn`),this.viewing.turn(t(e),t(n))}zoom(e,t){Jf(e,`zoom steps`),this.viewing.zoom(e,t)}resetView(){this.viewing.reset()}setViewMode(e){this.viewing.setMode(e),this.motion.reconsider()}startMotionLook(){return this.motion.start()}stopMotionLook(){this.motion.stop()}setStabilization(e){this.picture.setStabilization(e)}setQuality(e){this.picture.setQuality(e)}setLooping(e){this.starts.setLooping(e)}setGainMatching(e){this.picture.setGainMatching(e)}setVolume(e){Jf(e,`volume`),this.sound.setVolume(e)}setMuted(e){this.sound.setMuted(e)}dispose(){this.isDisposed=!0,this.unload(),this.motion.dispose(),this.parts.host.audio.removeEventListener(`ended`,this.tick),this.sound.dispose(),this.events.removeAll()}tick=()=>{this.loaded?.pipeline.session.tick()};async loadInProgress(){this.phase.kind===`loading`&&await this.phase.settled.promise}get loaded(){return this.phase.kind===`loaded`?this.phase.loaded:void 0}async complete(e,t,n){let{signal:r}=e.controller,i=await hP({source:t,parts:this.parts,signal:r});if(r.aborted){i.dispose();return}this.outbox.change(()=>{this.attach(i,e.controller),this.startAtPendingTime(i),n.preload!==!1&&i.pipeline.session.preload()}),n.autoplay&&this.loaded===i&&await this.starts.autoplay()}startAtPendingTime(e){let t=this.pendingStartTime;this.pendingStartTime=void 0,t!==void 0&&e.pipeline.session.seek(t)}attach(e,t){this.phase={kind:`loaded`,loaded:e,controller:t},this.viewing.attach(e.pipeline.renderer),this.motion.reconsider();let{session:n}=e.pipeline;this.picture.attach(e.pipeline),this.relay.attach(n),this.loop.start(),this.announceStatus();for(let t of e.warnings)this.outbox.emit(`warning`,t);this.outbox.emit(`ready`,e.opened.metadata)}release(){let e=this.phase;this.phase=xP,e.kind===`loading`&&e.controller.abort(),this.loop.stop(),this.relay.detach(),this.viewing.attach(void 0),this.motion.reconsider(),this.picture.attach(void 0),e.kind===`loaded`&&(e.loaded.dispose(),e.controller.abort())}failWith(e){let t=ne(e,`invariant-violation`,`the player failed unexpectedly`);return this.outbox.change(()=>{this.release(),this.phase={kind:`failed`,failure:t},this.announceStatus(),this.outbox.emit(`error`,t)}),t}announceStatus(){let{status:e}=this;this.outbox.post(()=>{e!==this.lastStatus&&(this.lastStatus=e,this.events.emit(`statuschange`,e))})}};function RP(e,t){return new LP({host:e,ports:TS(t),pipelines:jN,attitude:new Sp})}function zP(e,t={}){let n=t.signal??new AbortController().signal,{source:r}=ES(t.http??{}).open(BP(e),n);return dr(r)}function BP(e){return typeof e==`string`?{url:e}:{blob:e,name:e instanceof File?e.name:``}}var VP={Src:`src`,Src2:`src2`},HP={CrossOrigin:`crossorigin`},UP={FieldOfView:`fov`,Yaw:`yaw`,Pitch:`pitch`},WP={Autoplay:`autoplay`,Preload:`preload`,GainMatch:`gain-match`,Muted:`muted`,Loop:`loop`,Stabilization:`stabilization`,ViewMode:`view-mode`,Quality:`quality`,Controls:`controls`,Poster:`poster`},GP=[...Object.values(VP),...Object.values(HP),...Object.values(UP),...Object.values(WP)];function KP(e,t){let n=JP(e(HP.CrossOrigin)),r=qP(e(VP.Src),t,n);return r&&{main:r,second:qP(e(VP.Src2),t,n)}}function qP(e,t,n){let r=e?.trim()??``;return r===``?void 0:{url:YP(r,t),...n}}function JP(e){return Wf(iF,e)===`use-credentials`?{credentials:`include`}:{}}function YP(e,t){try{return new URL(e,t).href}catch{return e}}var XP={[UP.FieldOfView]:`fieldOfView`,[UP.Yaw]:`yaw`,[UP.Pitch]:`pitch`};function ZP(e,t,n){let r=XP[t],i=$P(n);return r===void 0||i===void 0?e:{...e,[r]:i}}function QP(e){return e!==null}function $P(e){if(e===null||e.trim()===``)return;let t=Number(e);return Number.isFinite(t)?t:void 0}function eF(e,t,n){return{code:`ignored-attribute`,message:`ignoring ${e}="${t}"; expected one of ${n.join(`, `)}`}}function tF(e,t){return t===null||$P(t)!==void 0?void 0:{code:`ignored-attribute`,message:`ignoring ${e}="${t}"; expected a number of degrees`}}var nF={name:WP.Preload,keywords:[`none`,`auto`],fallback:`auto`},rF={name:WP.GainMatch,keywords:[`on`,`off`],fallback:`on`},iF={name:HP.CrossOrigin,property:`crossOrigin`,keywords:[`anonymous`,`use-credentials`],fallback:`anonymous`};function aF(e){return Wf(nF,e)===`auto`}function oF(e){return Wf(rF,e)===`on`}function sF(e,t,n){return n?cF(n):KP(e,t)}function cF(e){return{main:{blob:e.main,name:e.main.name},second:e.second&&{blob:e.second,name:e.second.name}}}var lF=class{element;player;scheduled;isOwed=!0;awaited;startTime;files;constructor(e,t){this.element=e,this.player=t}connected(){this.isOwed&&this.schedule(),this.awaited?.follow(this.scheduled??Promise.resolve()),this.awaited=void 0}removed(){this.player.unload(),this.isOwed=!0}sourceChanged(){this.files=void 0,this.schedule()}requestChanged(){this.files===void 0&&this.schedule()}loadFiles(e){this.files=e,this.schedule()}load(){return this.element.isConnected?this.scheduled??this.reload():this.loadOnConnection()}seek(e){this.scheduled?this.startTime=e:this.player.seek(e)}async settled(){try{await this.scheduled}catch{}}loadOnConnection(){return this.isOwed=!0,this.awaited??=new Wd,this.awaited.promise}schedule(){if(this.isOwed=!this.element.isConnected,this.scheduled||!this.element.isConnected)return;let e=this.loadAfterPendingChanges();this.scheduled=e,e.catch(uF)}async loadAfterPendingChanges(){await Promise.resolve(),this.scheduled=void 0,this.element.isConnected&&await this.reload()}reload(){this.isOwed=!1;let e=e=>this.element.getAttribute(e),t=sF(e,document.baseURI,this.files);delete this.element.dataset.hasFrame;let n=this.startTime;if(this.startTime=void 0,!t)return this.player.unload(),Promise.resolve();let r=this.player.load(t,{autoplay:this.element.autoplay,preload:aF(e(WP.Preload))});return n!==void 0&&this.player.seek(n),r}};function uF(){}var dF=`data-fill`,fF=`popover`,pF=`manual`,mF=class{element;constructor(e){this.element=e}get isActive(){return this.isNativelyFullscreen()||this.element.hasAttribute(dF)}async toggle(){await(this.isActive?this.exit():this.enter())}async exit(){this.isNativelyFullscreen()&&await document.exitFullscreen(),this.element.removeAttribute(fF),this.element.removeAttribute(dF)}connected(){this.element.hasAttribute(dF)&&this.raiseToTopLayer()}isNativelyFullscreen(){return this.element.matches(`:fullscreen`)}async enter(){if(document.fullscreenEnabled)try{await this.element.requestFullscreen();return}catch{}this.element.isConnected&&(this.element.setAttribute(dF,``),this.raiseToTopLayer())}raiseToTopLayer(){hF()&&this.element.isConnected&&!this.element.matches(`:popover-open`)&&(this.element.setAttribute(fF,pF),this.element.showPopover())}};function hF(){return`showPopover`in HTMLElement.prototype&&CSS.supports(`selector(:popover-open)`)}var gF=`data-idle`,_F=2500,vF=[`pointermove`,`pointerdown`,`keydown`,`focusin`],yF={capture:!0},bF=class{element;shouldHide;timer;wasIdleAtPress=!1;constructor(e,t){this.element=e,this.shouldHide=t}get wasIdleAtLastPress(){return this.wasIdleAtPress}start(){this.element.addEventListener(`pointerdown`,this.onPress,yF);for(let e of vF)this.element.addEventListener(e,this.onActivity,yF);this.onActivity()}stop(){for(let e of vF)this.element.removeEventListener(e,this.onActivity,yF);this.element.removeEventListener(`pointerdown`,this.onPress,yF),this.clearTimer(),this.element.removeAttribute(gF)}refresh(){this.shouldHide()||this.element.removeAttribute(gF),this.restart()}onPress=()=>{this.wasIdleAtPress=this.element.hasAttribute(gF)};onActivity=()=>{this.element.removeAttribute(gF),this.restart()};restart(){this.clearTimer(),this.timer=setTimeout(()=>{this.shouldHide()&&this.element.setAttribute(gF,``)},_F)}clearTimer(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}};function xF(e,t,n){return({player:r,warn:i},a)=>{let o=If(a,t);o?n(r,o):a!==null&&i(eF(e,a,t))}}var SF={[WP.Stabilization]:xF(WP.Stabilization,qs,(e,t)=>{e.setStabilization(t)}),[WP.ViewMode]:xF(WP.ViewMode,Tc,(e,t)=>{e.setViewMode(t)}),[WP.Quality]:xF(WP.Quality,xc,(e,t)=>{e.setQuality(t)}),[WP.Muted]:({player:e},t)=>{e.setMuted(QP(t))},[WP.Loop]:({player:e},t)=>{e.setLooping(QP(t))},[WP.Poster]:({posterImage:e},t)=>{e.src=t??``},[WP.GainMatch]:({player:e},t)=>{e.setGainMatching(oF(t))}};function CF(e){return Object.hasOwn(SF,e)}function wF(e,t,n){CF(t)&&SF[t](e,n)}function TF(e,t){e.hasAttribute(`tabindex`)||(e.tabIndex=0),e.hasAttribute(`role`)||e.setAttribute(`role`,`region`),e.hasAttribute(`aria-label`)||e.hasAttribute(`aria-labelledby`)||e.setAttribute(`aria-label`,t)}function EF(e,t,n){e.getAttribute(`aria-label`)===t&&e.setAttribute(`aria-label`,n)}function DF(e,t){let n=/* @__PURE__ */ new Map;for(let r of t)Object.hasOwn(e,r)&&(n.set(r,Reflect.get(e,r)),Reflect.deleteProperty(e,r));return n}function OF(e,t,n){let r=[...t];t.clear();for(let[t,i]of r)try{Reflect.set(e,t,i)}catch(e){n({code:`refused-property`,message:`${t} set before the element was defined was refused: ${ie(e)}`})}}var kF=Nu({stabilization:!0,viewMode:!0,quality:!0,fov:!0,yaw:!0,pitch:!0,muted:!0,loop:!0,volume:!0});function AF(e,t){let n={stabilization:{get:()=>t.stabilization,set:IF(e=>{t.setStabilization(NF(e))})},viewMode:{get:()=>t.viewMode,set:IF(e=>{t.setViewMode(PF(e))})},quality:{get:()=>t.quality,set:IF(e=>{t.setQuality(FF(e))})},...jF(t),...MF(t)};for(let[t,r]of Object.entries(n))Object.defineProperty(e,t,{configurable:!0,enumerable:!0,...r})}function jF(e){let t=(t,n)=>({get:()=>e.view[t],set:IF(r=>{e.setView({...e.view,[t]:RF(r,n)})})});return{fov:t(`fieldOfView`,`fov`),yaw:t(`yaw`,`yaw`),pitch:t(`pitch`,`pitch`)}}function MF(e){return{muted:{get:()=>e.isMuted,set:t=>{e.setMuted(!!t)}},loop:{get:()=>e.isLooping,set:t=>{e.setLooping(!!t)}},volume:{get:()=>e.volume,set:IF(t=>{e.setVolume(zF(t,`volume`))})}}}function NF(e){return LF(e,Lf,`stabilization`)}function PF(e){return LF(e,Rf,`viewMode`)}function FF(e){return LF(e,zf,`quality`)}function IF(e){return t=>{t!=null&&t!==``&&e(t)}}function LF(e,t,n){let r=typeof e==`string`?t(e):void 0;if(r===void 0)throw new j(`invalid-argument`,`${n} cannot be ${String(e)}`);return r}function RF(e,n){return t(zF(e,n))}function zF(e,t){return Jf(e,t),e}var BF=`/*
|
|
4643
4643
|
* The controls' own styles: the big play button, the bar, its buttons, sliders and menus, and the
|
|
4644
4644
|
* grab hand over the picture. The host's custom properties (\`--gyro-view-*\`) theme them. Secondary
|
|
4645
4645
|
* words, fills and tracks are the text colour at lower strengths, so a page that changes the text
|
|
@@ -5165,17 +5165,17 @@ canvas[data-draggable]:active {
|
|
|
5165
5165
|
transition: none;
|
|
5166
5166
|
}
|
|
5167
5167
|
}
|
|
5168
|
-
`,
|
|
5168
|
+
`,VF=`gyroview`;function HF(e){let t=document.createElement(`template`);return t.innerHTML=UF()?.createHTML(e)??e,t.content}var UF=$e(()=>{let e=globalThis.trustedTypes;try{return e?.createPolicy(VF,{createHTML:e=>e})}catch{return}});function WF(e){return`<svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${e}</svg>`}function GF(e){return WF(`<g transform="scale(1.2)" stroke-width="1.5">${e}</g>`)}var KF=`<path d="M4 9.5v5h3.5L12 19V5L7.5 9.5z"/>`,qF={play:WF(`<path d="M8 5v14l11-7z" fill="currentColor"/>`),pause:WF(`<rect x="6" y="5" width="4" height="14" rx="1" fill="currentColor" stroke="none"/><rect x="14" y="5" width="4" height="14" rx="1" fill="currentColor" stroke="none"/>`),sound:WF(`${KF}<path d="M15.5 9a4 4 0 0 1 0 6"/><path d="M18.5 6a8 8 0 0 1 0 12"/>`),muted:WF(`${KF}<path d="M16 9.5l5 5M21 9.5l-5 5"/>`),resetView:WF(`<path d="M4.5 12a7.5 7.5 0 1 0 2.2-5.3"/><path d="M4.5 4.5v4h4"/>`),motionLook:WF(`<rect x="8.5" y="4.5" width="7" height="15" rx="1.5"/><path d="M11 16.5h2"/><path d="M5 8.5a7 7 0 0 0 0 7"/><path d="M19 8.5a7 7 0 0 1 0 7"/>`),fullscreen:WF(`<path d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5"/>`),close:WF(`<path d="M6 6l12 12M18 6L6 18"/>`)},JF={off:GF(`<path d="M2 11l2.5-3 3 4.5 3-6 3 5 2-2.5L18 11"/>`),lock:GF(`<rect x="4.5" y="9" width="11" height="8" rx="1.5"/><path d="M7 9V6.5a3 3 0 016 0V9"/>`),horizon:GF(`<circle cx="10" cy="10" r="7"/><path d="M3 10h14M8 13h4"/>`),follow:GF(`<path d="M3 15c3.5 0 4-9 8.5-9 2 0 3 1 4.5 1"/><path d="M14 4.5L16.5 7 14 9.5"/>`)},YF={"raw-lenses":GF(`<circle cx="6" cy="10" r="4.25"/><circle cx="14" cy="10" r="4.25"/>`),equirectangular:GF(`<rect x="2" y="5" width="16" height="10" rx="1.5"/><path d="M2 10h16M7.5 5c-1.2 3.3-1.2 6.7 0 10M12.5 5c1.2 3.3 1.2 6.7 0 10"/>`),normal:GF(`<path d="M10 16L3.2 7.2a10 10 0 0113.6 0z"/>`)},XF=/* @__PURE__ */ new Map;function ZF(e){let t=XF.get(e);return t||(t=HF(qF[e]),XF.set(e,t)),t.cloneNode(!0)}var QF={names:`stabilizationModes`,descriptions:`stabilizationModeDescriptions`},$F={names:`viewModes`,descriptions:`viewModeDescriptions`},eI=new Set([QF,$F].flatMap(e=>[e.names,e.descriptions])),tI=`The video could not be loaded.`,nI=`This browser cannot play this video.`,rI=`This file cannot be played.`,iI=`The video could not be played.`,aI={labels:{player:`360° video player`,loading:`Loading`,play:`Play`,pause:`Pause`,seek:`Seek`,position:`{time} of {duration}`,mute:`Mute`,volume:`Volume`,resetView:`Reset view`,motionLook:`Look by moving the device`,stabilization:`Stabilization`,viewMode:`View`,fullscreen:`Fullscreen`,close:`Close`},stabilizationModes:{off:`Off`,lock:`Lock`,horizon:`Horizon`,follow:`Follow`},stabilizationModeDescriptions:{off:`Footage as the camera moved`,lock:`Orientation fixed to the world`,horizon:`Level horizon, follows heading`,follow:`Follows turns, smooths out shake`},viewModes:{"raw-lenses":`Raw lenses`,equirectangular:`Equirectangular`,normal:`Normal`},viewModeDescriptions:{"raw-lenses":`Both fisheye images as recorded`,equirectangular:`The full 360° frame, unwrapped`,normal:`Standard view, drag to look around`},errors:{"binary-out-of-bounds":rI,"binary-unsafe-integer":rI,"codec-unsupported":nI,cors:tI,decode:iI,"embed-destroyed":iI,"index-out-of-range":iI,"invalid-argument":iI,"invalid-byte-range":tI,"invalid-calibration":rI,"invalid-protobuf":rI,"invalid-trailer":rI,"invariant-violation":iI,"missing-second-file":`Part of this recording is missing.`,"no-calibration":rI,"no-info-record":rI,"no-key-frame":rI,"playback-blocked":iI,"range-unsupported":tI,"render-unavailable":nI,"source-changed":`The video was replaced while it played.`,"source-truncated":tI,"source-unreadable":tI,"unsupported-calibration":rI,"unsupported-container":rI,"unsupported-gyro-record":rI,"unsupported-info-format":rI,"unsupported-layout":rI,"webcodecs-unavailable":nI}};function oI(e){let t=uI(e)?e:{};return{labels:lI(aI.labels,t.labels),stabilizationModes:lI(aI.stabilizationModes,t.stabilizationModes),stabilizationModeDescriptions:lI(aI.stabilizationModeDescriptions,t.stabilizationModeDescriptions),viewModes:lI(aI.viewModes,t.viewModes),viewModeDescriptions:lI(aI.viewModeDescriptions,t.viewModeDescriptions),errors:lI(aI.errors,t.errors)}}function sI(e){return e!==null&&Object.hasOwn(aI.labels,e)}function cI(e){return e!==null&&eI.has(e)}function lI(e,t){if(!uI(t))return e;let n=Object.entries(e).map(([e,n])=>{let r=t[e];return[e,typeof r==`string`?r:n]});return Object.fromEntries(n)}function uI(e){return typeof e==`object`&&!!e}var dI={Stabilization:`stabilization`,ViewMode:`view-mode`};function fI(e){return{button:`${e}-button`,popup:`${e}-menu`}}function pI(e){return e.choices.map(t=>{let n=`${e.name}-${t}`;return`<button type="button" role="menuitemradio" aria-checked="false" tabindex="-1" data-choice="${t}" aria-labelledby="${n}-name" aria-describedby="${n}-description"><span class="choice-icon">${e.icons[t]??``}</span><span class="choice-name" id="${n}-name" data-choice-text="${e.words.names}"></span><span class="choice-description" id="${n}-description" data-choice-text="${e.words.descriptions}"></span></button>`}).join(``)}function mI(e){let t=fI(e.name),[n,r]=[`${e.name}-label`,`${e.name}-value`];return`<div class="choice">
|
|
5169
5169
|
<button class="icon-button setting ${t.button}" type="button" aria-haspopup="menu" aria-expanded="false" aria-labelledby="${n} ${r}"><span class="setting-icon"></span><span hidden><span id="${n}" data-text="${e.title}"></span> <span id="${r}" data-choice-text="${e.words.names}"></span></span></button>
|
|
5170
5170
|
<div class="popup ${t.popup}" hidden>
|
|
5171
5171
|
<div class="popup-header">
|
|
5172
5172
|
<p class="popup-title" aria-hidden="true" data-text="${e.title}"></p>
|
|
5173
|
-
<button class="icon-button popup-close" type="button" data-label="close">${
|
|
5173
|
+
<button class="icon-button popup-close" type="button" data-label="close">${qF.close}</button>
|
|
5174
5174
|
</div>
|
|
5175
|
-
<div role="menu" data-label="${e.title}">${
|
|
5175
|
+
<div role="menu" data-label="${e.title}">${pI(e)}</div>
|
|
5176
5176
|
</div>
|
|
5177
|
-
</div>`}function
|
|
5178
|
-
<button class="big-play" part="big-play" type="button">${
|
|
5177
|
+
</div>`}function hI(){return mI({name:dI.Stabilization,title:`stabilization`,choices:qs,icons:JF,words:QF})+mI({name:dI.ViewMode,title:`viewMode`,choices:Tc,icons:YF,words:$F})}var gI=BF;function _I(){return`
|
|
5178
|
+
<button class="big-play" part="big-play" type="button">${qF.play}</button>
|
|
5179
5179
|
<div class="controls" part="controls">
|
|
5180
5180
|
<input class="seek" type="range" min="0" max="0" step="0.01" value="0" data-label="seek" />
|
|
5181
5181
|
<div class="row">
|
|
@@ -5184,12 +5184,12 @@ canvas[data-draggable]:active {
|
|
|
5184
5184
|
<input class="volume" type="range" min="0" max="1" step="0.01" value="1" data-label="volume" />
|
|
5185
5185
|
<span class="time"><span class="elapsed">0:00</span> <span class="total">/ 0:00</span></span>
|
|
5186
5186
|
<span class="spacer"></span>
|
|
5187
|
-
${
|
|
5188
|
-
<button class="icon-button motion-look" type="button" aria-pressed="false" data-label="motionLook" hidden>${
|
|
5189
|
-
<button class="icon-button reset-view" type="button" data-label="resetView">${
|
|
5190
|
-
<button class="icon-button fullscreen" type="button" data-label="fullscreen">${
|
|
5187
|
+
${hI()}
|
|
5188
|
+
<button class="icon-button motion-look" type="button" aria-pressed="false" data-label="motionLook" hidden>${qF.motionLook}</button>
|
|
5189
|
+
<button class="icon-button reset-view" type="button" data-label="resetView">${qF.resetView}</button>
|
|
5190
|
+
<button class="icon-button fullscreen" type="button" data-label="fullscreen">${qF.fullscreen}</button>
|
|
5191
5191
|
</div>
|
|
5192
|
-
</div>`}function
|
|
5192
|
+
</div>`}function vI(e,t,n){let r=e.querySelector(t);return N(r instanceof n,`the element template lacks ${t}`),r}function yI(e,t){let n=fI(t);return{button:vI(e,`.${n.button}`,HTMLButtonElement),icon:vI(e,`.${n.button} .setting-icon`,HTMLElement),popup:vI(e,`.${n.popup}`,HTMLElement),close:vI(e,`.${n.popup} .popup-close`,HTMLButtonElement)}}function bI(e){return{seek:vI(e,`.seek`,HTMLInputElement),play:vI(e,`.play`,HTMLButtonElement),bigPlay:vI(e,`.big-play`,HTMLButtonElement),elapsed:vI(e,`.time .elapsed`,HTMLElement),total:vI(e,`.time .total`,HTMLElement),mute:vI(e,`.mute`,HTMLButtonElement),volume:vI(e,`.volume`,HTMLInputElement),resetView:vI(e,`.reset-view`,HTMLButtonElement),motionLook:vI(e,`.motion-look`,HTMLButtonElement),stabilization:yI(e,dI.Stabilization),viewMode:yI(e,dI.ViewMode),fullscreen:vI(e,`.fullscreen`,HTMLButtonElement)}}var xI=Nu({statuschange:!0,ready:!0,play:!0,playing:!0,waiting:!0,pause:!0,ended:!0,timeupdate:!0,seeking:!0,seeked:!0,frame:!0,viewchange:!0,viewmodechange:!0,motionlookchange:!0,stabilizationchange:!0,qualitychange:!0,volumechange:!0,warning:!0,error:!0});function SI(e,t){let{element:n,shadow:r,idle:i,wording:a}=t,o=vI(r,`.error-message`,HTMLElement),s=vI(r,`.error-code`,HTMLElement);e.events.on(`statuschange`,e=>{n.dataset.status=e,i.refresh()}),e.events.on(`frame`,()=>{n.dataset.hasFrame=``}),e.events.on(`error`,e=>{a.showError(o,e.code),s.textContent=e.code});for(let t of xI)e.events.on(t,e=>{n.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0}))})}var CI=`:host {
|
|
5193
5193
|
--gyro-view-accent: #fff;
|
|
5194
5194
|
--gyro-view-controls-background: rgb(0 0 0 / 60%);
|
|
5195
5195
|
--gyro-view-menu-background: rgb(24 24 23 / 92%);
|
|
@@ -5222,6 +5222,10 @@ canvas[data-draggable]:active {
|
|
|
5222
5222
|
* Pinned over the page where the Fullscreen API is refused (iPhone Safari). Like the browser's
|
|
5223
5223
|
* own fullscreen rules it overrides the size, margins and place the page gave the element, and
|
|
5224
5224
|
* the insets size it to the visible viewport, where 100vh would reach under Safari's toolbars.
|
|
5225
|
+
* It keeps no corners or border of the page's, which would show the page behind it, and zero
|
|
5226
|
+
* border and padding override a popover's defaults, which the pinned element is (ADR 0041). A
|
|
5227
|
+
* page's styles for every popover would outrank the host's overflow, colours and font, so the
|
|
5228
|
+
* fill holds them too. The z-index matters only where the browser has no popovers.
|
|
5225
5229
|
*/
|
|
5226
5230
|
:host([data-fill]) {
|
|
5227
5231
|
position: fixed !important;
|
|
@@ -5234,8 +5238,18 @@ canvas[data-draggable]:active {
|
|
|
5234
5238
|
max-width: none !important;
|
|
5235
5239
|
max-height: none !important;
|
|
5236
5240
|
margin: 0 !important;
|
|
5241
|
+
border: 0 !important;
|
|
5242
|
+
border-radius: 0 !important;
|
|
5243
|
+
padding: 0 !important;
|
|
5237
5244
|
transform: none !important;
|
|
5245
|
+
translate: none !important;
|
|
5246
|
+
rotate: none !important;
|
|
5247
|
+
scale: none !important;
|
|
5238
5248
|
aspect-ratio: auto !important;
|
|
5249
|
+
overflow: hidden !important;
|
|
5250
|
+
background: #000 !important;
|
|
5251
|
+
color: var(--gyro-view-text) !important;
|
|
5252
|
+
font-family: var(--gyro-view-font) !important;
|
|
5239
5253
|
z-index: 2147483000 !important;
|
|
5240
5254
|
}
|
|
5241
5255
|
|
|
@@ -5324,7 +5338,7 @@ canvas {
|
|
|
5324
5338
|
font-size: 0.8rem;
|
|
5325
5339
|
opacity: 0.7;
|
|
5326
5340
|
}
|
|
5327
|
-
`;function
|
|
5341
|
+
`;function wI(){return`
|
|
5328
5342
|
<div class="stage" part="stage">
|
|
5329
5343
|
<canvas part="canvas"></canvas>
|
|
5330
5344
|
<img class="poster" part="poster" alt="" />
|
|
@@ -5336,6 +5350,6 @@ canvas {
|
|
|
5336
5350
|
<p class="error-message" part="error-message"></p>
|
|
5337
5351
|
<p class="error-code" part="error-code"></p>
|
|
5338
5352
|
</div>
|
|
5339
|
-
${
|
|
5353
|
+
${_I()}
|
|
5340
5354
|
</div>
|
|
5341
|
-
`}var SI=$e(()=>zF(xI())),CI=$e(()=>[bI,pI].map(e=>TI(e)));function wI(e){e.adoptedStyleSheets=CI(),e.append(SI().cloneNode(!0))}function TI(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var EI=typeof HTMLElement==`function`?HTMLElement:Object,DI=class extends EI{addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}},OI=class{parts;player;constructor(e,t){this.parts=e,this.player=t,e.motionLook.addEventListener(`click`,()=>{t.motionLook===`on`?t.stopMotionLook():t.startMotionLook()}),t.events.on(`motionlookchange`,()=>{this.reflect()}),t.events.on(`viewmodechange`,()=>{this.reflect()}),this.reflect()}reflect(){let{motionLook:e,viewMode:t}=this.player,n=this.parts.motionLook;n.hidden=e===`unavailable`||Rl(t)===void 0,n.setAttribute(`aria-pressed`,String(e===`on`))}},kI=/* @__PURE__ */ new Map([[`ArrowDown`,(e,t)=>(e+1)%t],[`ArrowUp`,(e,t)=>(e-1+t)%t],[`Home`,()=>0],[`End`,(e,t)=>t-1]]),AI={capture:!0},jI=class{parts;host;items;constructor(e,t,n){this.parts=t,this.host=n,this.items=[...t.popup.querySelectorAll(`:scope [role="menuitemradio"]`)];for(let e of this.items)e.addEventListener(`click`,()=>{this.closeToButton();let{choice:t}=e.dataset;t!==void 0&&n.choose(t)});t.close.addEventListener(`click`,()=>{this.closeToButton()}),this.bindButton(),this.bindDismissal(e),this.bindKeys(e)}get isOpen(){return!this.parts.popup.hidden}markChosen(e){for(let t of this.items)t.setAttribute(`aria-checked`,String(t.dataset.choice===e));let t=this.items.find(t=>t.dataset.choice===e)?.querySelector(`:scope .choice-icon > svg`);this.parts.icon.replaceChildren(...t?[t.cloneNode(!0)]:[]),this.parts.button.dataset.choice=e,this.host.wording.write(this.parts.button)}setAvailable(e){this.parts.button.hidden=!e,e||this.setOpen(!1)}bindButton(){this.parts.button.addEventListener(`click`,()=>{this.setOpen(!this.isOpen),this.isOpen&&this.focusItem(this.items.findIndex(e=>MI(e)))})}bindDismissal(e){let{button:t,popup:n}=this.parts;e.addEventListener(`pointerdown`,e=>{this.isOpen&&(e.composedPath().some(e=>e===n||e===t)||(this.setOpen(!1),e.stopPropagation()))},AI),e.addEventListener(`focusout`,e=>{let r=e instanceof FocusEvent?e.relatedTarget:null;r!==t&&r instanceof Node&&!n.contains(r)&&this.setOpen(!1)})}bindKeys(e){e.addEventListener(`keydown`,e=>{this.isOpen&&e instanceof KeyboardEvent&&this.onKey(e)})}onKey(e){let t=e.composedPath();if(e.key===`Escape`){this.closeToButton(),e.stopPropagation();return}t.includes(this.parts.popup)&&(e.stopPropagation(),e.key===`Tab`?this.setOpen(!1):this.moveFocus(e,t))}moveFocus(e,t){let n=kI.get(e.key);if(!n)return;e.preventDefault();let r=this.items.findIndex(e=>t.includes(e));this.focusItem(n(r,this.items.length))}focusItem(e){(this.items[e]??this.items[0])?.focus()}closeToButton(){this.setOpen(!1),this.parts.button.focus()}setOpen(e){this.parts.popup.hidden=!e,this.parts.button.setAttribute(`aria-expanded`,String(e))}};function MI(e){return e.getAttribute(`aria-checked`)===`true`}var NI=class{viewMode;stabilization;player;constructor(e,t,n){let{player:r,wording:i}=n;this.player=r,this.viewMode=new jI(e,t.viewMode,{wording:i,choose:e=>{let t=Rf(e);t&&r.setViewMode(t)}}),this.stabilization=new jI(e,t.stabilization,{wording:i,choose:e=>{let t=Lf(e);t&&r.setStabilization(t)}}),this.followPlayer()}followPlayer(){let{player:e}=this;e.events.on(`viewmodechange`,e=>{this.viewMode.markChosen(e),this.offerStabilization()}),e.events.on(`stabilizationchange`,e=>{this.stabilization.markChosen(e)}),e.events.on(`statuschange`,()=>{this.offerStabilization()}),this.viewMode.markChosen(e.viewMode),this.stabilization.markChosen(e.stabilization),this.offerStabilization()}offerStabilization(){let e=this.player.metadata?.hasGyro===!0,t=Il(this.player.viewMode).isStabilized;this.stabilization.setAvailable(e&&t)}},PI=60,FI=60;function II(e){let t=Number.isFinite(e)?Math.max(0,Math.floor(e)):0,n=t%PI,r=Math.floor(t/PI)%FI,i=Math.floor(t/3600);return i>0?`${i}:${LI(r)}:${LI(n)}`:`${r}:${LI(n)}`}function LI(e){return String(e).padStart(2,`0`)}function RI(e){let t=Number(e.min),n=Number(e.max)-t,r=n>0?(Number(e.value)-t)/n:0;e.style.setProperty(`--fill`,String(yr(r,0,1)))}var zI=/* @__PURE__ */ new Map([[`ArrowLeft`,-1],[`ArrowDown`,-1],[`ArrowRight`,1],[`ArrowUp`,1]]),BI=[`pointerup`,`pointercancel`,`change`],VI=class{parts;host;isScrubbing=!1;scrubTarget;scrubbing;constructor(e,t){this.parts=e,this.host=t,this.bindInput();let{events:n}=this.host.player;n.on(`statuschange`,()=>{this.showRecording()}),n.on(`timeupdate`,e=>{this.follow(e)}),this.showRecording()}bindInput(){let{seek:e}=this.parts;e.addEventListener(`input`,()=>{this.isScrubbing=!0;let t=Number(e.value);this.showTime(t),this.scrubTo(t)});for(let t of BI)e.addEventListener(t,()=>{this.endScrub()});e.addEventListener(`keydown`,e=>{let t=zI.get(e.key);if(t===void 0)return;e.preventDefault();let{player:n}=this.host;n.seek(n.currentTime+t*5)})}showRecording(){let{duration:e,currentTime:t}=this.host.player;this.parts.seek.max=String(e),this.follow(t)}follow(e){this.isScrubbing||(this.parts.seek.value=String(e),this.showTime(e))}scrubTo(e){this.scrubTarget=e,this.scrubbing??=this.drainScrubs()}async drainScrubs(){try{for(;this.scrubTarget!==void 0;){let e=this.scrubTarget;this.scrubTarget=void 0,await this.host.player.scrub(e)}}catch(e){this.host.warn({code:`playback-failed`,message:`the seek bar could not show that moment: ${ie(e)}`})}finally{this.scrubbing=void 0}}endScrub(){this.isScrubbing&&(this.isScrubbing=!1,this.scrubTarget=void 0,this.host.player.seek(Number(this.parts.seek.value)))}showTime(e){let[t,n]=[II(e),II(this.host.player.duration)];this.parts.elapsed.textContent=t,this.parts.total.textContent=`/ ${n}`;let{position:r}=this.host.wording.current.labels,i=r.replaceAll(`{time}`,()=>t).replaceAll(`{duration}`,()=>n);this.parts.seek.setAttribute(`aria-valuetext`,i),RI(this.parts.seek)}},HI=100,UI=class{parts;player;constructor(e,t){this.parts=e,this.player=t,e.volume.hidden=!t.canSetVolume,e.mute.addEventListener(`click`,()=>{t.setMuted(!t.isMuted)}),e.volume.addEventListener(`input`,()=>{t.setVolume(Number(e.volume.value)),t.isMuted&&t.setMuted(!1)}),t.events.on(`volumechange`,()=>{this.reflect()}),this.reflect()}reflect(){let{isMuted:e,volume:t}=this.player,n=e?0:t;this.parts.mute.replaceChildren(JF(e?`muted`:`sound`)),this.parts.mute.setAttribute(`aria-pressed`,String(e)),this.parts.volume.value=String(n),this.parts.volume.setAttribute(`aria-valuetext`,`${Math.round(n*HI)}%`),RI(this.parts.volume)}},WI=class{parts;host;constructor(e,t){this.parts=e,this.host=t;let{player:n}=t;for(let n of[e.play,e.bigPlay])n.addEventListener(`click`,()=>{t.togglePlay()});n.events.on(`statuschange`,()=>{this.reflect(n.isPaused)}),this.reflect(n.isPaused)}reflect(e){for(let t of[this.parts.play,this.parts.bigPlay])this.host.wording.label(t,e?`play`:`pause`);this.parts.play.replaceChildren(JF(e?`play`:`pause`))}};function GI(e,t){e.resetView.addEventListener(`click`,()=>{t.player.resetView()}),e.fullscreen.addEventListener(`click`,()=>{t.toggleFullscreen()})}function KI(e,t){let n=_I(e);new WI(n,t),GI(n,t),new VI(n,t),new UI(n,t.player),new NI(e,n,{player:t.player,wording:t.wording}),new OI(n,t.player)}var qI=`data-label`,JI=`data-text`,YI=`data-choice-text`,XI=`data-error`,ZI={label:`[data-label]`,text:`[data-text]`,choiceText:`[data-choice-text]`,choice:`[data-choice]`,error:`[data-error]`},QI=class{words=nI;get current(){return this.words}replace(e){this.words=rI(e)}label(e,t){e.setAttribute(qI,t),e.setAttribute(`aria-label`,this.words.labels[t])}showError(e,t){e.setAttribute(XI,t),e.textContent=this.words.errors[t]}write(e){for(let t of e.querySelectorAll(ZI.label))this.writeLabel(t);for(let t of e.querySelectorAll(ZI.text))this.writeText(t);for(let t of e.querySelectorAll(ZI.choiceText))this.writeChoiceText(t);for(let t of e.querySelectorAll(ZI.error))this.writeError(t)}writeLabel(e){let t=e.getAttribute(qI);iI(t)&&e.setAttribute(`aria-label`,this.words.labels[t])}writeText(e){let t=e.getAttribute(JI);iI(t)&&(e.textContent=this.words.labels[t])}writeChoiceText(e){let t=e.getAttribute(YI),n=e.closest(ZI.choice)?.dataset.choice;n!==void 0&&aI(t)&&(e.textContent=this.words[t][n]??``)}writeError(e){let t=e.getAttribute(XI);te(t)&&(e.textContent=this.words.errors[t])}},$I=[...Object.values(VP),WP.Poster],eL=[nF,rF],tL=[iF],nL=[WP.Autoplay,WP.Controls],rL=Object.values(VP),iL=Object.values(HP),aL=[...[...$I,...eL.map(({name:e})=>e),...nL].map(e=>qf(e)),...tL.map(({property:e})=>e),...EF,`currentTime`,`messages`],oL=Object.values(UP),sL=class extends DI{static observedAttributes=GP;earlyProperties;player;loads;wording=new QI;fullscreen=new fF(this);idle;posterImage;constructor(){super(),this.earlyProperties=wF(this,aL),Bf(this,$I),Hf(this,eL),Uf(this,tL),Vf(this,nL);let e=this.attachShadow({mode:`open`});wI(e),this.wording.write(e);let t=hI(e,`canvas`,HTMLCanvasElement),n=hI(e,`audio`,HTMLAudioElement);this.posterImage=hI(e,`.poster`,HTMLImageElement),this.player=RP({canvas:t,audio:n}),this.loads=new lF(this,this.player),DF(this,this.player);let r=this.controlsHost();KI(e,r),new dp(t,this.player,this.onPictureTap),rp(this,r),this.idle=new _F(this,()=>this.player.status===`playing`);let{idle:i,wording:a}=this;yI(this.player,{element:this,shadow:e,idle:i,wording:a})}get status(){return this.player.status}get metadata(){return this.player.metadata}get currentTime(){return this.player.currentTime}set currentTime(e){this.seek(e)}get duration(){return this.player.duration}get paused(){return this.player.isPaused}get view(){return this.player.view}get motionLook(){return this.player.motionLook}get messages(){return this.wording.current}set messages(e){let t=this.wording.current.labels.player;this.wording.replace(e),this.shadowRoot&&this.wording.write(this.shadowRoot),CF(this,t,this.wording.current.labels.player)}connectedCallback(){SF(this,this.wording.current.labels.player),TF(this,this.earlyProperties,this.warn),this.dataset.status=this.player.status,this.idle.start(),this.loads.connected()}disconnectedCallback(){this.idle.stop(),this.loads.disconnected()}attributeChangedCallback(e,t,n){if(rL.includes(e))this.loads.sourceChanged();else if(iL.includes(e))this.loads.requestChanged();else if(oL.includes(e)){this.player.setView(ZP(this.player.view,e,n));let t=tF(e,n);t!==void 0&&this.warn(t)}else xF({player:this.player,posterImage:this.posterImage,warn:this.warn},e,n)}async play(){await this.loads.settled(),await this.player.play()}pause(){this.player.pause()}stop(){this.player.stop()}seek(e){Jf(e,`time`),this.loads.seek(e)}scrub(e){return this.player.scrub(e)}lookAt(e,t){this.player.lookAt(e,t)}resetView(){this.player.resetView()}zoom(e,t){this.player.zoom(e,t)}startMotionLook(){return this.player.startMotionLook()}stopMotionLook(){this.player.stopMotionLook()}setStabilization(e){this.player.setStabilization(AF(e))}setViewMode(e){this.player.setViewMode(jF(e))}setQuality(e){this.player.setQuality(MF(e))}toggleFullscreen(){return this.fullscreen.toggle()}load(){return this.loads.load()}loadFiles(e){this.loads.loadFiles(e)}controlsHost(){return{player:this.player,wording:this.wording,togglePlay:this.togglePlayback,toggleFullscreen:()=>{this.toggleFullscreen()},warn:this.warn,isFullscreen:()=>this.fullscreen.isActive,exitFullscreen:()=>{this.fullscreen.exit()}}}onPictureTap=e=>{let t=this.controls&&this.idle.wasIdleAtLastPress;e!==`mouse`&&t||this.togglePlayback()};togglePlayback=()=>{hp(this.player)};warn=e=>{this.dispatchEvent(new CustomEvent(`warning`,{detail:e,composed:!0}))}},cL=`gyro-view`;function lL(){if(typeof customElements>`u`)return;let e=customElements.get(cL);e===void 0?customElements.define(cL,sL):e!==sL&&uL()}var uL=$e(()=>{console.warn(`<${cL}> was defined by another copy of gyroview; that copy's element is used`)});lL();export{A as GYRO_VIEW_ERROR_CATEGORIES,k as GYRO_VIEW_ERROR_CODES,cL as GYRO_VIEW_TAG,sL as GyroViewElement,j as GyroViewError,xc as PICTURE_QUALITIES,LP as Player,qs as STABILIZATION_MODES,Tc as VIEW_MODES,mp as attachKeyboard,pp as attachViewGestures,RP as createBrowserPlayer,lL as defineGyroView,M as hasErrorCode,zP as inspectRecording,te as isGyroViewErrorCode};
|
|
5355
|
+
`}var TI=$e(()=>HF(wI())),EI=$e(()=>[CI,gI].map(e=>OI(e)));function DI(e){e.adoptedStyleSheets=EI(),e.append(TI().cloneNode(!0))}function OI(e){let t=new CSSStyleSheet;return t.replaceSync(e),t}var kI=typeof HTMLElement==`function`?HTMLElement:Object,AI=class extends kI{addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}},jI=class{parts;player;constructor(e,t){this.parts=e,this.player=t,e.motionLook.addEventListener(`click`,()=>{t.motionLook===`on`?t.stopMotionLook():t.startMotionLook()}),t.events.on(`motionlookchange`,()=>{this.reflect()}),t.events.on(`viewmodechange`,()=>{this.reflect()}),this.reflect()}reflect(){let{motionLook:e,viewMode:t}=this.player,n=this.parts.motionLook;n.hidden=e===`unavailable`||Rl(t)===void 0,n.setAttribute(`aria-pressed`,String(e===`on`))}},MI=/* @__PURE__ */ new Map([[`ArrowDown`,(e,t)=>(e+1)%t],[`ArrowUp`,(e,t)=>(e-1+t)%t],[`Home`,()=>0],[`End`,(e,t)=>t-1]]),NI={capture:!0},PI=class{parts;host;items;constructor(e,t,n){this.parts=t,this.host=n,this.items=[...t.popup.querySelectorAll(`:scope [role="menuitemradio"]`)];for(let e of this.items)e.addEventListener(`click`,()=>{this.closeToButton();let{choice:t}=e.dataset;t!==void 0&&n.choose(t)});t.close.addEventListener(`click`,()=>{this.closeToButton()}),this.bindButton(),this.bindDismissal(e),this.bindKeys(e)}get isOpen(){return!this.parts.popup.hidden}markChosen(e){for(let t of this.items)t.setAttribute(`aria-checked`,String(t.dataset.choice===e));let t=this.items.find(t=>t.dataset.choice===e)?.querySelector(`:scope .choice-icon > svg`);this.parts.icon.replaceChildren(...t?[t.cloneNode(!0)]:[]),this.parts.button.dataset.choice=e,this.host.wording.write(this.parts.button)}setAvailable(e){this.parts.button.hidden=!e,e||this.setOpen(!1)}bindButton(){this.parts.button.addEventListener(`click`,()=>{this.setOpen(!this.isOpen),this.isOpen&&this.focusItem(this.items.findIndex(e=>FI(e)))})}bindDismissal(e){let{button:t,popup:n}=this.parts;e.addEventListener(`pointerdown`,e=>{this.isOpen&&(e.composedPath().some(e=>e===n||e===t)||(this.setOpen(!1),e.stopPropagation()))},NI),e.addEventListener(`focusout`,e=>{let r=e instanceof FocusEvent?e.relatedTarget:null;r!==t&&r instanceof Node&&!n.contains(r)&&this.setOpen(!1)})}bindKeys(e){e.addEventListener(`keydown`,e=>{this.isOpen&&e instanceof KeyboardEvent&&this.onKey(e)})}onKey(e){let t=e.composedPath();if(e.key===`Escape`){this.closeToButton(),e.stopPropagation();return}t.includes(this.parts.popup)&&(e.stopPropagation(),e.key===`Tab`?this.setOpen(!1):this.moveFocus(e,t))}moveFocus(e,t){let n=MI.get(e.key);if(!n)return;e.preventDefault();let r=this.items.findIndex(e=>t.includes(e));this.focusItem(n(r,this.items.length))}focusItem(e){(this.items[e]??this.items[0])?.focus()}closeToButton(){this.setOpen(!1),this.parts.button.focus()}setOpen(e){this.parts.popup.hidden=!e,this.parts.button.setAttribute(`aria-expanded`,String(e))}};function FI(e){return e.getAttribute(`aria-checked`)===`true`}var II=class{viewMode;stabilization;player;constructor(e,t,n){let{player:r,wording:i}=n;this.player=r,this.viewMode=new PI(e,t.viewMode,{wording:i,choose:e=>{let t=Rf(e);t&&r.setViewMode(t)}}),this.stabilization=new PI(e,t.stabilization,{wording:i,choose:e=>{let t=Lf(e);t&&r.setStabilization(t)}}),this.followPlayer()}followPlayer(){let{player:e}=this;e.events.on(`viewmodechange`,e=>{this.viewMode.markChosen(e),this.offerStabilization()}),e.events.on(`stabilizationchange`,e=>{this.stabilization.markChosen(e)}),e.events.on(`statuschange`,()=>{this.offerStabilization()}),this.viewMode.markChosen(e.viewMode),this.stabilization.markChosen(e.stabilization),this.offerStabilization()}offerStabilization(){let e=this.player.metadata?.hasGyro===!0,t=Il(this.player.viewMode).isStabilized;this.stabilization.setAvailable(e&&t)}},LI=60,RI=60;function zI(e){let t=Number.isFinite(e)?Math.max(0,Math.floor(e)):0,n=t%LI,r=Math.floor(t/LI)%RI,i=Math.floor(t/3600);return i>0?`${i}:${BI(r)}:${BI(n)}`:`${r}:${BI(n)}`}function BI(e){return String(e).padStart(2,`0`)}function VI(e){let t=Number(e.min),n=Number(e.max)-t,r=n>0?(Number(e.value)-t)/n:0;e.style.setProperty(`--fill`,String(yr(r,0,1)))}var HI=/* @__PURE__ */ new Map([[`ArrowLeft`,-1],[`ArrowDown`,-1],[`ArrowRight`,1],[`ArrowUp`,1]]),UI=[`pointerup`,`pointercancel`,`change`],WI=class{parts;host;isScrubbing=!1;scrubTarget;scrubbing;constructor(e,t){this.parts=e,this.host=t,this.bindInput();let{events:n}=this.host.player;n.on(`statuschange`,()=>{this.showRecording()}),n.on(`timeupdate`,e=>{this.follow(e)}),this.showRecording()}bindInput(){let{seek:e}=this.parts;e.addEventListener(`input`,()=>{this.isScrubbing=!0;let t=Number(e.value);this.showTime(t),this.scrubTo(t)});for(let t of UI)e.addEventListener(t,()=>{this.endScrub()});e.addEventListener(`keydown`,e=>{let t=HI.get(e.key);if(t===void 0)return;e.preventDefault();let{player:n}=this.host;n.seek(n.currentTime+t*5)})}showRecording(){let{duration:e,currentTime:t}=this.host.player;this.parts.seek.max=String(e),this.follow(t)}follow(e){this.isScrubbing||(this.parts.seek.value=String(e),this.showTime(e))}scrubTo(e){this.scrubTarget=e,this.scrubbing??=this.drainScrubs()}async drainScrubs(){try{for(;this.scrubTarget!==void 0;){let e=this.scrubTarget;this.scrubTarget=void 0,await this.host.player.scrub(e)}}catch(e){this.host.warn({code:`playback-failed`,message:`the seek bar could not show that moment: ${ie(e)}`})}finally{this.scrubbing=void 0}}endScrub(){this.isScrubbing&&(this.isScrubbing=!1,this.scrubTarget=void 0,this.host.player.seek(Number(this.parts.seek.value)))}showTime(e){let[t,n]=[zI(e),zI(this.host.player.duration)];this.parts.elapsed.textContent=t,this.parts.total.textContent=`/ ${n}`;let{position:r}=this.host.wording.current.labels,i=r.replaceAll(`{time}`,()=>t).replaceAll(`{duration}`,()=>n);this.parts.seek.setAttribute(`aria-valuetext`,i),VI(this.parts.seek)}},GI=100,KI=class{parts;player;constructor(e,t){this.parts=e,this.player=t,e.volume.hidden=!t.canSetVolume,e.mute.addEventListener(`click`,()=>{t.setMuted(!t.isMuted)}),e.volume.addEventListener(`input`,()=>{t.setVolume(Number(e.volume.value)),t.isMuted&&t.setMuted(!1)}),t.events.on(`volumechange`,()=>{this.reflect()}),this.reflect()}reflect(){let{isMuted:e,volume:t}=this.player,n=e?0:t;this.parts.mute.replaceChildren(ZF(e?`muted`:`sound`)),this.parts.mute.setAttribute(`aria-pressed`,String(e)),this.parts.volume.value=String(n),this.parts.volume.setAttribute(`aria-valuetext`,`${Math.round(n*GI)}%`),VI(this.parts.volume)}},qI=class{parts;host;constructor(e,t){this.parts=e,this.host=t;let{player:n}=t;for(let n of[e.play,e.bigPlay])n.addEventListener(`click`,()=>{t.togglePlay()});n.events.on(`statuschange`,()=>{this.reflect(n.isPaused)}),this.reflect(n.isPaused)}reflect(e){for(let t of[this.parts.play,this.parts.bigPlay])this.host.wording.label(t,e?`play`:`pause`);this.parts.play.replaceChildren(ZF(e?`play`:`pause`))}};function JI(e,t){e.resetView.addEventListener(`click`,()=>{t.player.resetView()}),e.fullscreen.addEventListener(`click`,()=>{t.toggleFullscreen()})}function YI(e,t){let n=bI(e);new qI(n,t),JI(n,t),new WI(n,t),new KI(n,t.player),new II(e,n,{player:t.player,wording:t.wording}),new jI(n,t.player)}var XI=`data-label`,ZI=`data-text`,QI=`data-choice-text`,$I=`data-error`,eL={label:`[data-label]`,text:`[data-text]`,choiceText:`[data-choice-text]`,choice:`[data-choice]`,error:`[data-error]`},tL=class{words=aI;get current(){return this.words}replace(e){this.words=oI(e)}label(e,t){e.setAttribute(XI,t),e.setAttribute(`aria-label`,this.words.labels[t])}showError(e,t){e.setAttribute($I,t),e.textContent=this.words.errors[t]}write(e){for(let t of e.querySelectorAll(eL.label))this.writeLabel(t);for(let t of e.querySelectorAll(eL.text))this.writeText(t);for(let t of e.querySelectorAll(eL.choiceText))this.writeChoiceText(t);for(let t of e.querySelectorAll(eL.error))this.writeError(t)}writeLabel(e){let t=e.getAttribute(XI);sI(t)&&e.setAttribute(`aria-label`,this.words.labels[t])}writeText(e){let t=e.getAttribute(ZI);sI(t)&&(e.textContent=this.words.labels[t])}writeChoiceText(e){let t=e.getAttribute(QI),n=e.closest(eL.choice)?.dataset.choice;n!==void 0&&cI(t)&&(e.textContent=this.words[t][n]??``)}writeError(e){let t=e.getAttribute($I);te(t)&&(e.textContent=this.words.errors[t])}},nL=[...Object.values(VP),WP.Poster],rL=[nF,rF],iL=[iF],aL=[WP.Autoplay,WP.Controls],oL=Object.values(VP),sL=Object.values(HP),cL=[...[...nL,...rL.map(({name:e})=>e),...aL].map(e=>qf(e)),...iL.map(({property:e})=>e),...kF,`currentTime`,`messages`],lL=Object.values(UP),uL=class extends AI{static observedAttributes=GP;earlyProperties;player;loads;wording=new tL;fullscreen=new mF(this);idle;posterImage;constructor(){super(),this.earlyProperties=DF(this,cL),Bf(this,nL),Hf(this,rL),Uf(this,iL),Vf(this,aL);let e=this.attachShadow({mode:`open`});DI(e),this.wording.write(e);let t=vI(e,`canvas`,HTMLCanvasElement),n=vI(e,`audio`,HTMLAudioElement);this.posterImage=vI(e,`.poster`,HTMLImageElement),this.player=RP({canvas:t,audio:n}),this.loads=new lF(this,this.player),AF(this,this.player);let r=this.controlsHost();YI(e,r),new dp(t,this.player,this.onPictureTap),rp(this,r),this.idle=new bF(this,()=>this.player.status===`playing`);let{idle:i,wording:a}=this;SI(this.player,{element:this,shadow:e,idle:i,wording:a})}get status(){return this.player.status}get metadata(){return this.player.metadata}get currentTime(){return this.player.currentTime}set currentTime(e){this.seek(e)}get duration(){return this.player.duration}get paused(){return this.player.isPaused}get view(){return this.player.view}get motionLook(){return this.player.motionLook}get messages(){return this.wording.current}set messages(e){let t=this.wording.current.labels.player;this.wording.replace(e),this.shadowRoot&&this.wording.write(this.shadowRoot),EF(this,t,this.wording.current.labels.player)}connectedCallback(){TF(this,this.wording.current.labels.player),OF(this,this.earlyProperties,this.warn),this.dataset.status=this.player.status,this.idle.start(),this.loads.connected(),this.fullscreen.connected()}disconnectedCallback(){this.idle.stop(),this.leaveIfRemoved()}attributeChangedCallback(e,t,n){if(oL.includes(e))this.loads.sourceChanged();else if(sL.includes(e))this.loads.requestChanged();else if(lL.includes(e)){this.player.setView(ZP(this.player.view,e,n));let t=tF(e,n);t!==void 0&&this.warn(t)}else wF({player:this.player,posterImage:this.posterImage,warn:this.warn},e,n)}async play(){await this.loads.settled(),await this.player.play()}pause(){this.player.pause()}stop(){this.player.stop()}seek(e){Jf(e,`time`),this.loads.seek(e)}scrub(e){return this.player.scrub(e)}lookAt(e,t){this.player.lookAt(e,t)}resetView(){this.player.resetView()}zoom(e,t){this.player.zoom(e,t)}startMotionLook(){return this.player.startMotionLook()}stopMotionLook(){this.player.stopMotionLook()}setStabilization(e){this.player.setStabilization(NF(e))}setViewMode(e){this.player.setViewMode(PF(e))}setQuality(e){this.player.setQuality(FF(e))}toggleFullscreen(){return this.fullscreen.toggle()}load(){return this.loads.load()}loadFiles(e){this.loads.loadFiles(e)}async leaveIfRemoved(){await Promise.resolve(),!this.isConnected&&(this.loads.removed(),await this.fullscreen.exit())}controlsHost(){return{player:this.player,wording:this.wording,togglePlay:this.togglePlayback,toggleFullscreen:()=>{this.toggleFullscreen()},warn:this.warn,isFullscreen:()=>this.fullscreen.isActive,exitFullscreen:()=>{this.fullscreen.exit()}}}onPictureTap=e=>{let t=this.controls&&this.idle.wasIdleAtLastPress;e!==`mouse`&&t||this.togglePlayback()};togglePlayback=()=>{hp(this.player)};warn=e=>{this.dispatchEvent(new CustomEvent(`warning`,{detail:e,composed:!0}))}},dL=`gyro-view`;function fL(){if(typeof customElements>`u`)return;let e=customElements.get(dL);e===void 0?customElements.define(dL,uL):e!==uL&&pL()}var pL=$e(()=>{console.warn(`<${dL}> was defined by another copy of gyroview; that copy's element is used`)});fL();export{A as GYRO_VIEW_ERROR_CATEGORIES,k as GYRO_VIEW_ERROR_CODES,dL as GYRO_VIEW_TAG,uL as GyroViewElement,j as GyroViewError,xc as PICTURE_QUALITIES,LP as Player,qs as STABILIZATION_MODES,Tc as VIEW_MODES,mp as attachKeyboard,pp as attachViewGestures,RP as createBrowserPlayer,fL as defineGyroView,M as hasErrorCode,zP as inspectRecording,te as isGyroViewErrorCode};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bubo-squared/gyroview",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Play raw Insta360 .insv recordings (X3, X4, X5, X6) in the browser: a <gyro-view> web component that stitches and gyro-stabilizes the camera's dual-fisheye video on the GPU.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"insta360",
|