From 4a51dc165c9c0d8f7865c698b2e0c5d69114fa59 Mon Sep 17 00:00:00 2001
From: Vincent Marchetti
Date: Tue, 7 May 2024 13:31:32 -0400
Subject: [PATCH 01/16] Added a uni test for the case of a lookAt property of a
camera whose value is PointSelector
---
test/index.js | 3 +-
.../positioned_camera_lookat_point.js | 95 +++++++++++++++++++
2 files changed, 97 insertions(+), 1 deletion(-)
create mode 100644 test/tests_3d/2_cameras/positioned_camera_lookat_point.js
diff --git a/test/index.js b/test/index.js
index f7db22f0..d8571996 100644
--- a/test/index.js
+++ b/test/index.js
@@ -142,7 +142,8 @@ function run_iiif3d_tests(){
describe("2_cameras" , function(){
- importTest('position_camera_lookat_anno', './tests_3d/2_cameras/positioned_camera_lookat_anno.js');
+ importTest('position_camera_lookat_anno', './tests_3d/2_cameras/positioned_camera_lookat_anno.js');
+ importTest('position_camera_lookat_point', './tests_3d/2_cameras/positioned_camera_lookat_point.js');
});
}
diff --git a/test/tests_3d/2_cameras/positioned_camera_lookat_point.js b/test/tests_3d/2_cameras/positioned_camera_lookat_point.js
new file mode 100644
index 00000000..95bf5a96
--- /dev/null
+++ b/test/tests_3d/2_cameras/positioned_camera_lookat_point.js
@@ -0,0 +1,95 @@
+var expect = require('chai').expect;
+var should = require('chai').should();
+var manifesto = require('../../../dist-commonjs/');
+
+var threejs_math = require('threejs-math');
+
+let manifest, annotations, scene;
+
+let manifest_url = {
+ local: "",
+ remote : "https://raw.githubusercontent.com/IIIF/3d/main/manifests/2_cameras/positioned_camera_lookat_point.json"
+ }.remote;
+
+describe('positioned_camera_lookat_point', function() {
+
+ it('loads successfully', function(done) {
+ manifesto.loadManifest(manifest_url).then(function(data) {
+ manifest = manifesto.parseManifest(data);
+ done();
+ });
+ });
+
+ it('has a sequence', function() {
+ sequence = manifest.getSequenceByIndex(0);
+ expect(sequence).to.exist;
+ });
+
+
+ it('has a scene with two annotation', function(){
+ sequence = manifest.getSequenceByIndex(0);
+ expect(sequence).to.exist;
+ scene = sequence.getScenes()[0];
+ expect(scene).to.exist;
+ expect(scene.isScene()).to.be.ok;
+ annotations = scene.getContent();
+ expect(annotations.length).to.equal(2);
+
+
+ });
+
+ it('has 1th annotation a Camera', function(){
+ var camera_anno = annotations[1];
+ let body = camera_anno.getBody()[0];
+ let camera = (body.isSpecifResource)?body.getTarget():
+ (body.isAnnotationBody)?body:
+ null;
+
+ expect(camera.isCamera).to.equal(true);
+ expect(camera.isPerspectiveCamera).to.equal(true);
+ expect(camera.isModel).to.equal(false,"checking isModel=false");
+ expect(camera.FieldOfView).to.equal(45.0);
+
+ let lookedAt = camera.LookAt;
+ expect( lookedAt , "find the lookAt annotation.id?").to.exist;
+
+ let lookedAtAnnotation = scene.getAnnotationById( lookedAt.id );
+ expect( lookedAtAnnotation, "find the lookAt annotation in scene?").to.exist;
+
+ /*
+ let lookedAtLocation = lookedAtAnnotation.LookAtLocation;
+ expect( lookedAtLocation ).to.exist;
+
+ let testLocation = [lookedAtLocation.x,lookedAtLocation.y,lookedAtLocation.z];
+ expect(testLocation).to.deep.equal( [0.0,0.0,0.0]);
+
+
+ let lookedFromLocation = camera_anno.LookAtLocation ;
+ let direction = lookedAtLocation.clone().sub( lookedFromLocation );
+ let exact_unit_direction = direction.clone().divideScalar( direction.length() );
+
+ expect( [direction.x, direction.y,direction.z]).to.deep.equal([0.0,-3.0,10.0]);
+
+ let euler = manifesto.cameraRelativeRotation( direction );
+
+ // next want to evaluate the result:
+ // 1. create a quaternion representation from the euler
+ // 2. show that athis rotation does 3 things to the unit vectors
+ // attached to the camera
+ // 2.1 the camera z axis transforms to be parallel to exact_unit_direction
+ // 2.2 the rotated camera x axis is perpendicular to global z axis
+ // 2.3 rotated camera y axis z component is positive
+ let quat = new threejs_math.Quaternion().setFromEuler( euler );
+
+ let camera_direction = new threejs_math.Vector3( 0.0, 0.0, -1.0 ).applyQuaternion( quat );
+ let direction_error = camera_direction.clone().sub(exact_unit_direction).length();
+ expect( direction_error ).to.be.below( 1.0e-8 );
+
+ let camera_x_axis = new threejs_math.Vector3( 1.0, 0.0, 0.0 ).applyQuaternion( quat );
+ expect( Math.abs( camera_x_axis.z )).to.be.below(1.0e-8);
+
+ let camera_y_axis = new threejs_math.Vector3( 0.0, 1.0, 0.0 ).applyQuaternion( quat );
+ expect( camera_y_axis.z ).to.be.above(0.0);
+ */
+ });
+});
From e2626ae75cacf11c14b8aaf658287a6d4badef97 Mon Sep 17 00:00:00 2001
From: Vincent Marchetti
Date: Tue, 7 May 2024 14:25:17 -0400
Subject: [PATCH 02/16] Implemented allowing the value of lookAt to be a
PointSelector
---
src/Camera.ts | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/Camera.ts b/src/Camera.ts
index 4c962d15..6e5ea886 100644
--- a/src/Camera.ts
+++ b/src/Camera.ts
@@ -1,7 +1,8 @@
import {
IManifestoOptions,
Utils,
- AnnotationBody } from "./internal";
+ AnnotationBody,
+ PointSelector } from "./internal";
export class Camera extends AnnotationBody {
constructor(jsonld?: any, options?: IManifestoOptions) {
@@ -37,7 +38,15 @@ export class Camera extends AnnotationBody {
get FieldOfView(): number | undefined { return this.getFieldOfView();}
getLookAt() : object | null {
- return this.getPropertyAsObject("lookAt" )
+ let rawObj = this.getPropertyAsObject("lookAt" )
+ let rawType = (rawObj["type"] || rawObj["@type"])
+ if (rawType == "Annotation"){
+ return rawObj;
+ }
+ if (rawType == "PointSelector"){
+ return new PointSelector(rawObj);
+ }
+ throw new Error('unidentified value of lookAt ${rawType}');
}
get LookAt() : object | null {return this.getLookAt();}
From 4b0b5eb74eb1becfb963d8adbdd83cdd68bd0735 Mon Sep 17 00:00:00 2001
From: Vincent Marchetti
Date: Tue, 7 May 2024 14:26:50 -0400
Subject: [PATCH 03/16] Corrected an error the testing of the opertion of the
rotation returned from manifesto
---
test/tests_3d/2_cameras/positioned_camera_lookat_anno.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/tests_3d/2_cameras/positioned_camera_lookat_anno.js b/test/tests_3d/2_cameras/positioned_camera_lookat_anno.js
index 98fa81f6..c8b392e6 100644
--- a/test/tests_3d/2_cameras/positioned_camera_lookat_anno.js
+++ b/test/tests_3d/2_cameras/positioned_camera_lookat_anno.js
@@ -86,7 +86,7 @@ describe('positioned_camera_lookat_anno', function() {
expect( direction_error ).to.be.below( 1.0e-8 );
let camera_x_axis = new threejs_math.Vector3( 1.0, 0.0, 0.0 ).applyQuaternion( quat );
- expect( Math.abs( camera_x_axis.z )).to.be.below(1.0e-8);
+ expect( Math.abs( camera_x_axis.y )).to.be.below(1.0e-8);
let camera_y_axis = new threejs_math.Vector3( 0.0, 1.0, 0.0 ).applyQuaternion( quat );
expect( camera_y_axis.z ).to.be.above(0.0);
From 62dec8c1efeaa82843dc4884d599cc82940be251 Mon Sep 17 00:00:00 2001
From: Vincent Marchetti
Date: Tue, 7 May 2024 14:27:40 -0400
Subject: [PATCH 04/16] Implemented testing of a camera whose lookAt is a point
selector
---
.../positioned_camera_lookat_point.js | 38 ++++++++++++-------
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/test/tests_3d/2_cameras/positioned_camera_lookat_point.js b/test/tests_3d/2_cameras/positioned_camera_lookat_point.js
index 95bf5a96..604b33dd 100644
--- a/test/tests_3d/2_cameras/positioned_camera_lookat_point.js
+++ b/test/tests_3d/2_cameras/positioned_camera_lookat_point.js
@@ -53,23 +53,26 @@ describe('positioned_camera_lookat_point', function() {
let lookedAt = camera.LookAt;
expect( lookedAt , "find the lookAt annotation.id?").to.exist;
- let lookedAtAnnotation = scene.getAnnotationById( lookedAt.id );
- expect( lookedAtAnnotation, "find the lookAt annotation in scene?").to.exist;
-
- /*
- let lookedAtLocation = lookedAtAnnotation.LookAtLocation;
+ let lookedAtLocation = null;
+ if ( lookedAt.isPointSelector ){
+ lookedAtLocation = lookedAt.getLocation();
+ }
+ else{
+ let lookedAtAnnotation = scene.getAnnotationById( lookedAt.id );
+ expect( lookedAtAnnotation, "find the lookAt annotation in scene?").to.exist;
+ lookedAtLocation = lookedAtAnnotation.LookAtLocation;
+ }
expect( lookedAtLocation ).to.exist;
- let testLocation = [lookedAtLocation.x,lookedAtLocation.y,lookedAtLocation.z];
- expect(testLocation).to.deep.equal( [0.0,0.0,0.0]);
-
-
let lookedFromLocation = camera_anno.LookAtLocation ;
let direction = lookedAtLocation.clone().sub( lookedFromLocation );
let exact_unit_direction = direction.clone().divideScalar( direction.length() );
- expect( [direction.x, direction.y,direction.z]).to.deep.equal([0.0,-3.0,10.0]);
+ expect( [direction.x, direction.y,direction.z]).to.deep.equal([2.0,-2.0,10.0]);
+
+ let exact_coords = [exact_unit_direction.x, exact_unit_direction.y,exact_unit_direction.z].join(", ");
+ //console.log(`exact direction ( ${exact_coords} )`)
let euler = manifesto.cameraRelativeRotation( direction );
// next want to evaluate the result:
@@ -82,14 +85,21 @@ describe('positioned_camera_lookat_point', function() {
let quat = new threejs_math.Quaternion().setFromEuler( euler );
let camera_direction = new threejs_math.Vector3( 0.0, 0.0, -1.0 ).applyQuaternion( quat );
- let direction_error = camera_direction.clone().sub(exact_unit_direction).length();
- expect( direction_error ).to.be.below( 1.0e-8 );
+
+ let camera_direction_coords = [camera_direction.x, camera_direction.y, camera_direction.z ];
+ //console.log(`camera direction ( ${camera_direction_coords} )`)
+
+ let direction_error = camera_direction.clone().sub(exact_unit_direction);
+ let direction_error_coords = [ direction_error.x, direction_error.y, direction_error.z ];
+ //console.log(`direction error ( ${direction_error_coords} )`)
+
+ expect( direction_error.length() ).to.be.below( 1.0e-8 );
let camera_x_axis = new threejs_math.Vector3( 1.0, 0.0, 0.0 ).applyQuaternion( quat );
- expect( Math.abs( camera_x_axis.z )).to.be.below(1.0e-8);
+ expect( Math.abs( camera_x_axis.y )).to.be.below(1.0e-8);
let camera_y_axis = new threejs_math.Vector3( 0.0, 1.0, 0.0 ).applyQuaternion( quat );
expect( camera_y_axis.z ).to.be.above(0.0);
- */
+
});
});
From ba41cba555b04d0bd54cebade4b3c4f7963bc7f6 Mon Sep 17 00:00:00 2001
From: Vincent Marchetti
Date: Tue, 7 May 2024 15:34:21 -0400
Subject: [PATCH 05/16] Added documentation on the getLookAt function
---
src/Camera.ts | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/Camera.ts b/src/Camera.ts
index 6e5ea886..6b4e901d 100644
--- a/src/Camera.ts
+++ b/src/Camera.ts
@@ -37,7 +37,11 @@ export class Camera extends AnnotationBody {
**/
get FieldOfView(): number | undefined { return this.getFieldOfView();}
- getLookAt() : object | null {
+ /**
+ * @return : if not null, is either a PointSelector, or an object
+ * with an id matching the id of an Annotation instance.
+ **/
+ getLookAt() : object | PointSelector | null {
let rawObj = this.getPropertyAsObject("lookAt" )
let rawType = (rawObj["type"] || rawObj["@type"])
if (rawType == "Annotation"){
From 43a953639ebfe3259ba28efdbf77afc35634633d Mon Sep 17 00:00:00 2001
From: Vincent Marchetti
Date: Tue, 7 May 2024 15:36:27 -0400
Subject: [PATCH 06/16] rebuilt modules and documentation
---
dist-commonjs/Annotation.d.ts | 2 +-
dist-commonjs/Camera.d.ts | 8 ++++++--
dist-commonjs/Camera.js | 14 +++++++++++++-
dist-commonjs/Camera.js.map | 2 +-
dist-esmodule/Camera.d.ts | 8 ++++++--
dist-esmodule/Camera.js | 16 ++++++++++++++--
dist-esmodule/Camera.js.map | 2 +-
dist-umd/manifesto.js | 2 +-
dist-var/manifesto.js | 2 +-
docs/classes/Annotation.html | 16 ++++++++--------
docs/classes/AnnotationBody.html | 6 +++---
docs/classes/AnnotationBodyParser.html | 4 ++--
docs/classes/AnnotationList.html | 6 +++---
docs/classes/AnnotationPage.html | 6 +++---
docs/classes/Camera.html | 12 +++++++-----
docs/classes/Canvas.html | 10 +++++-----
docs/classes/Collection.html | 10 +++++-----
docs/classes/Color.html | 16 ++++++++--------
docs/classes/Deserialiser.html | 4 ++--
docs/classes/Duration.html | 4 ++--
docs/classes/IIIFResource.html | 6 +++---
docs/classes/JSONLDResource.html | 6 +++---
docs/classes/LabelValuePair.html | 4 ++--
docs/classes/LanguageMap.html | 6 +++---
docs/classes/Light.html | 8 ++++----
docs/classes/LocalizedValue.html | 10 +++++-----
docs/classes/Manifest.html | 12 ++++++------
docs/classes/ManifestResource.html | 6 +++---
docs/classes/PointSelector.html | 6 +++---
docs/classes/PropertyValue.html | 16 ++++++++--------
docs/classes/Range.html | 6 +++---
docs/classes/Rendering.html | 6 +++---
docs/classes/Resource.html | 6 +++---
docs/classes/RotateTransform.html | 6 +++---
docs/classes/ScaleTransform.html | 6 +++---
docs/classes/Scene.html | 6 +++---
docs/classes/Sequence.html | 8 ++++----
docs/classes/Service.html | 6 +++---
docs/classes/Size.html | 4 ++--
docs/classes/SpecificResource.html | 6 +++---
docs/classes/Thumb.html | 4 ++--
docs/classes/Thumbnail.html | 6 +++---
docs/classes/Transform.html | 6 +++---
docs/classes/TransformParser.html | 4 ++--
docs/classes/TranslateTransform.html | 6 +++---
docs/classes/TreeNode.html | 4 ++--
docs/classes/Utils.html | 6 +++---
docs/enums/ManifestType.html | 4 ++--
docs/enums/StatusCode.html | 4 ++--
docs/enums/TreeNodeType.html | 4 ++--
docs/functions/cameraRelativeRotation.html | 2 +-
docs/functions/lightRelativeRotation.html | 2 +-
docs/functions/loadManifest.html | 2 +-
docs/functions/parseManifest.html | 2 +-
docs/interfaces/IAccessToken.html | 4 ++--
docs/interfaces/IExternalImageResourceData.html | 4 ++--
docs/interfaces/IExternalResource.html | 4 ++--
docs/interfaces/IExternalResourceData.html | 4 ++--
docs/interfaces/IExternalResourceOptions.html | 4 ++--
docs/interfaces/IManifestoOptions.html | 4 ++--
types/index.d.ts | 6 +++++-
61 files changed, 207 insertions(+), 169 deletions(-)
diff --git a/dist-commonjs/Annotation.d.ts b/dist-commonjs/Annotation.d.ts
index 6afc5e98..4fdaf072 100644
--- a/dist-commonjs/Annotation.d.ts
+++ b/dist-commonjs/Annotation.d.ts
@@ -10,7 +10,7 @@ export declare class Annotation extends ManifestResource {
@see{ https://iiif.io/api/cookbook/recipe/0033-choice/ }
**/
getBody(): (AnnotationBody | SpecificResource)[];
- get Body(): (SpecificResource | AnnotationBody)[];
+ get Body(): (AnnotationBody | SpecificResource)[];
/**
auxiliary function to getBody; intended to hande an object that has an element items
which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/
diff --git a/dist-commonjs/Camera.d.ts b/dist-commonjs/Camera.d.ts
index 00b6a4ac..0486fc31 100644
--- a/dist-commonjs/Camera.d.ts
+++ b/dist-commonjs/Camera.d.ts
@@ -1,4 +1,4 @@
-import { IManifestoOptions, AnnotationBody } from "./internal";
+import { IManifestoOptions, AnnotationBody, PointSelector } from "./internal";
export declare class Camera extends AnnotationBody {
constructor(jsonld?: any, options?: IManifestoOptions);
get isPerspectiveCamera(): boolean;
@@ -12,6 +12,10 @@ export declare class Camera extends AnnotationBody {
Angular unit is degrees
**/
get FieldOfView(): number | undefined;
- getLookAt(): object | null;
+ /**
+ * @return : if not null, is either a PointSelector, or an object
+ * with an id matching the id of an Annotation instance.
+ **/
+ getLookAt(): object | PointSelector | null;
get LookAt(): object | null;
}
diff --git a/dist-commonjs/Camera.js b/dist-commonjs/Camera.js
index ecf7f86d..03bb4d06 100644
--- a/dist-commonjs/Camera.js
+++ b/dist-commonjs/Camera.js
@@ -57,8 +57,20 @@ var Camera = /** @class */ (function (_super) {
enumerable: false,
configurable: true
});
+ /**
+ * @return : if not null, is either a PointSelector, or an object
+ * with an id matching the id of an Annotation instance.
+ **/
Camera.prototype.getLookAt = function () {
- return this.getPropertyAsObject("lookAt");
+ var rawObj = this.getPropertyAsObject("lookAt");
+ var rawType = (rawObj["type"] || rawObj["@type"]);
+ if (rawType == "Annotation") {
+ return rawObj;
+ }
+ if (rawType == "PointSelector") {
+ return new internal_1.PointSelector(rawObj);
+ }
+ throw new Error('unidentified value of lookAt ${rawType}');
};
Object.defineProperty(Camera.prototype, "LookAt", {
get: function () { return this.getLookAt(); },
diff --git a/dist-commonjs/Camera.js.map b/dist-commonjs/Camera.js.map
index 40919dbc..314f6745 100644
--- a/dist-commonjs/Camera.js.map
+++ b/dist-commonjs/Camera.js.map
@@ -1 +1 @@
-{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../src/Camera.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAGuC;AAEvC;IAA4B,0BAAc;IACxC,gBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QACvB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,QAAQ,GAAI,IAAI,CAAC;;IACxB,CAAC;IAID,sBAAI,uCAAmB;aAAvB;YACE,OAAO,CAAC,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC;QACjF,CAAC;;;OAAA;IAED;;;OAGG;IACH,+BAAc,GAAd;QAEE,IAAI,IAAI,CAAC,mBAAmB,EAAC,CAAC;YAC1B,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAC5C,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;;gBACnB,OAAO,IAAI,CAAC;QACrB,CAAC;;YACI,OAAO,SAAS,CAAC;IACxB,CAAC;IAKD,sBAAI,+BAAW;QAJf;;;WAGG;aACH,cAAwC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAEtE,0BAAS,GAAT;QACE,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;IAC5C,CAAC;IACD,sBAAI,0BAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAGzD,aAAC;AAAD,CAAC,AAvCD,CAA4B,yBAAc,GAuCzC;AAvCY,wBAAM;AAuClB,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../src/Camera.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAIsC;AAEtC;IAA4B,0BAAc;IACxC,gBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QACvB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,QAAQ,GAAI,IAAI,CAAC;;IACxB,CAAC;IAID,sBAAI,uCAAmB;aAAvB;YACE,OAAO,CAAC,gBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC;QACjF,CAAC;;;OAAA;IAED;;;OAGG;IACH,+BAAc,GAAd;QAEE,IAAI,IAAI,CAAC,mBAAmB,EAAC,CAAC;YAC1B,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAC5C,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;;gBACnB,OAAO,IAAI,CAAC;QACrB,CAAC;;YACI,OAAO,SAAS,CAAC;IACxB,CAAC;IAKD,sBAAI,+BAAW;QAJf;;;WAGG;aACH,cAAwC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAEtE;;;OAGG;IACH,0BAAS,GAAT;QACE,IAAI,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;QAChD,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,OAAO,IAAI,YAAY,EAAC,CAAC;YACzB,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,IAAI,OAAO,IAAI,eAAe,EAAC,CAAC;YAC5B,OAAO,IAAI,wBAAa,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IACD,sBAAI,0BAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAGzD,aAAC;AAAD,CAAC,AAnDD,CAA4B,yBAAc,GAmDzC;AAnDY,wBAAM;AAmDlB,CAAC"}
\ No newline at end of file
diff --git a/dist-esmodule/Camera.d.ts b/dist-esmodule/Camera.d.ts
index 00b6a4ac..0486fc31 100644
--- a/dist-esmodule/Camera.d.ts
+++ b/dist-esmodule/Camera.d.ts
@@ -1,4 +1,4 @@
-import { IManifestoOptions, AnnotationBody } from "./internal";
+import { IManifestoOptions, AnnotationBody, PointSelector } from "./internal";
export declare class Camera extends AnnotationBody {
constructor(jsonld?: any, options?: IManifestoOptions);
get isPerspectiveCamera(): boolean;
@@ -12,6 +12,10 @@ export declare class Camera extends AnnotationBody {
Angular unit is degrees
**/
get FieldOfView(): number | undefined;
- getLookAt(): object | null;
+ /**
+ * @return : if not null, is either a PointSelector, or an object
+ * with an id matching the id of an Annotation instance.
+ **/
+ getLookAt(): object | PointSelector | null;
get LookAt(): object | null;
}
diff --git a/dist-esmodule/Camera.js b/dist-esmodule/Camera.js
index bad17d8e..4e3bf4f3 100644
--- a/dist-esmodule/Camera.js
+++ b/dist-esmodule/Camera.js
@@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
-import { Utils, AnnotationBody } from "./internal";
+import { Utils, AnnotationBody, PointSelector } from "./internal";
var Camera = /** @class */ (function (_super) {
__extends(Camera, _super);
function Camera(jsonld, options) {
@@ -54,8 +54,20 @@ var Camera = /** @class */ (function (_super) {
enumerable: false,
configurable: true
});
+ /**
+ * @return : if not null, is either a PointSelector, or an object
+ * with an id matching the id of an Annotation instance.
+ **/
Camera.prototype.getLookAt = function () {
- return this.getPropertyAsObject("lookAt");
+ var rawObj = this.getPropertyAsObject("lookAt");
+ var rawType = (rawObj["type"] || rawObj["@type"]);
+ if (rawType == "Annotation") {
+ return rawObj;
+ }
+ if (rawType == "PointSelector") {
+ return new PointSelector(rawObj);
+ }
+ throw new Error('unidentified value of lookAt ${rawType}');
};
Object.defineProperty(Camera.prototype, "LookAt", {
get: function () { return this.getLookAt(); },
diff --git a/dist-esmodule/Camera.js.map b/dist-esmodule/Camera.js.map
index 66d96001..7e0255af 100644
--- a/dist-esmodule/Camera.js.map
+++ b/dist-esmodule/Camera.js.map
@@ -1 +1 @@
-{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../src/Camera.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEH,KAAK,EACL,cAAc,EAAE,MAAM,YAAY,CAAC;AAEvC;IAA4B,0BAAc;IACxC,gBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QACvB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,QAAQ,GAAI,IAAI,CAAC;;IACxB,CAAC;IAID,sBAAI,uCAAmB;aAAvB;YACE,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC;QACjF,CAAC;;;OAAA;IAED;;;OAGG;IACH,+BAAc,GAAd;QAEE,IAAI,IAAI,CAAC,mBAAmB,EAAC,CAAC;YAC1B,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAC5C,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;;gBACnB,OAAO,IAAI,CAAC;QACrB,CAAC;;YACI,OAAO,SAAS,CAAC;IACxB,CAAC;IAKD,sBAAI,+BAAW;QAJf;;;WAGG;aACH,cAAwC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAEtE,0BAAS,GAAT;QACE,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;IAC5C,CAAC;IACD,sBAAI,0BAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAGzD,aAAC;AAAD,CAAC,AAvCD,CAA4B,cAAc,GAuCzC;;AAAA,CAAC"}
\ No newline at end of file
+{"version":3,"file":"Camera.js","sourceRoot":"","sources":["../src/Camera.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAEH,KAAK,EACL,cAAc,EACd,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtC;IAA4B,0BAAc;IACxC,gBAAY,MAAY,EAAE,OAA2B;QACnD,YAAA,MAAK,YAAC,MAAM,EAAE,OAAO,CAAC,SAAC;QACvB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,OAAO,GAAI,KAAK,CAAC;QACtB,KAAI,CAAC,QAAQ,GAAI,IAAI,CAAC;;IACxB,CAAC;IAID,sBAAI,uCAAmB;aAAvB;YACE,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,mBAAmB,CAAC,CAAC;QACjF,CAAC;;;OAAA;IAED;;;OAGG;IACH,+BAAc,GAAd;QAEE,IAAI,IAAI,CAAC,mBAAmB,EAAC,CAAC;YAC1B,IAAI,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAC5C,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;;gBACnB,OAAO,IAAI,CAAC;QACrB,CAAC;;YACI,OAAO,SAAS,CAAC;IACxB,CAAC;IAKD,sBAAI,+BAAW;QAJf;;;WAGG;aACH,cAAwC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAEtE;;;OAGG;IACH,0BAAS,GAAT;QACE,IAAI,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAE,CAAA;QAChD,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,OAAO,IAAI,YAAY,EAAC,CAAC;YACzB,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,IAAI,OAAO,IAAI,eAAe,EAAC,CAAC;YAC5B,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IACD,sBAAI,0BAAM;aAAV,cAA8B,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA,CAAC;;;OAAA;IAGzD,aAAC;AAAD,CAAC,AAnDD,CAA4B,cAAc,GAmDzC;;AAAA,CAAC"}
\ No newline at end of file
diff --git a/dist-umd/manifesto.js b/dist-umd/manifesto.js
index 428d6283..0c03709e 100644
--- a/dist-umd/manifesto.js
+++ b/dist-umd/manifesto.js
@@ -1,2 +1,2 @@
/*! For license information please see manifesto.js.LICENSE.txt */
-!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("node-fetch")):"function"==typeof define&&define.amd?define("manifesto",["node-fetch"],n):"object"==typeof exports?exports.manifesto=n(require("node-fetch")):t.manifesto=n(t["node-fetch"])}("undefined"!=typeof self?self:this,(__WEBPACK_EXTERNAL_MODULE_node_fetch__=>(()=>{var __webpack_modules__={"./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\r\nObject.defineProperty(exports, "__esModule", ({ value: true }));\r\nexports.CONTINUE = 100;\r\nexports.SWITCHING_PROTOCOLS = 101;\r\nexports.PROCESSING = 102;\r\nexports.OK = 200;\r\nexports.CREATED = 201;\r\nexports.ACCEPTED = 202;\r\nexports.NON_AUTHORITATIVE_INFORMATION = 203;\r\nexports.NO_CONTENT = 204;\r\nexports.RESET_CONTENT = 205;\r\nexports.PARTIAL_CONTENT = 206;\r\nexports.MULTI_STATUS = 207;\r\nexports.MULTIPLE_CHOICES = 300;\r\nexports.MOVED_PERMANENTLY = 301;\r\nexports.MOVED_TEMPORARILY = 302;\r\nexports.SEE_OTHER = 303;\r\nexports.NOT_MODIFIED = 304;\r\nexports.USE_PROXY = 305;\r\nexports.TEMPORARY_REDIRECT = 307;\r\nexports.BAD_REQUEST = 400;\r\nexports.UNAUTHORIZED = 401;\r\nexports.PAYMENT_REQUIRED = 402;\r\nexports.FORBIDDEN = 403;\r\nexports.NOT_FOUND = 404;\r\nexports.METHOD_NOT_ALLOWED = 405;\r\nexports.NOT_ACCEPTABLE = 406;\r\nexports.PROXY_AUTHENTICATION_REQUIRED = 407;\r\nexports.REQUEST_TIME_OUT = 408;\r\nexports.CONFLICT = 409;\r\nexports.GONE = 410;\r\nexports.LENGTH_REQUIRED = 411;\r\nexports.PRECONDITION_FAILED = 412;\r\nexports.REQUEST_ENTITY_TOO_LARGE = 413;\r\nexports.REQUEST_URI_TOO_LARGE = 414;\r\nexports.UNSUPPORTED_MEDIA_TYPE = 415;\r\nexports.REQUESTED_RANGE_NOT_SATISFIABLE = 416;\r\nexports.EXPECTATION_FAILED = 417;\r\nexports.IM_A_TEAPOT = 418;\r\nexports.UNPROCESSABLE_ENTITY = 422;\r\nexports.LOCKED = 423;\r\nexports.FAILED_DEPENDENCY = 424;\r\nexports.UNORDERED_COLLECTION = 425;\r\nexports.UPGRADE_REQUIRED = 426;\r\nexports.PRECONDITION_REQUIRED = 428;\r\nexports.TOO_MANY_REQUESTS = 429;\r\nexports.REQUEST_HEADER_FIELDS_TOO_LARGE = 431;\r\nexports.INTERNAL_SERVER_ERROR = 500;\r\nexports.NOT_IMPLEMENTED = 501;\r\nexports.BAD_GATEWAY = 502;\r\nexports.SERVICE_UNAVAILABLE = 503;\r\nexports.GATEWAY_TIME_OUT = 504;\r\nexports.HTTP_VERSION_NOT_SUPPORTED = 505;\r\nexports.VARIANT_ALSO_NEGOTIATES = 506;\r\nexports.INSUFFICIENT_STORAGE = 507;\r\nexports.BANDWIDTH_LIMIT_EXCEEDED = 509;\r\nexports.NOT_EXTENDED = 510;\r\nexports.NETWORK_AUTHENTICATION_REQUIRED = 511;\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js?')},"./node_modules/@iiif/vocabulary/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar AnnotationMotivation;\n(function (AnnotationMotivation) {\n AnnotationMotivation["BOOKMARKING"] = "oa:bookmarking";\n AnnotationMotivation["CLASSIFYING"] = "oa:classifying";\n AnnotationMotivation["COMMENTING"] = "oa:commenting";\n AnnotationMotivation["DESCRIBING"] = "oa:describing";\n AnnotationMotivation["EDITING"] = "oa:editing";\n AnnotationMotivation["HIGHLIGHTING"] = "oa:highlighting";\n AnnotationMotivation["IDENTIFYING"] = "oa:identifying";\n AnnotationMotivation["LINKING"] = "oa:linking";\n AnnotationMotivation["MODERATING"] = "oa:moderating";\n AnnotationMotivation["PAINTING"] = "sc:painting";\n AnnotationMotivation["QUESTIONING"] = "oa:questioning";\n AnnotationMotivation["REPLYING"] = "oa:replying";\n AnnotationMotivation["TAGGING"] = "oa:tagging";\n AnnotationMotivation["TRANSCRIBING"] = "oad:transcribing";\n})(AnnotationMotivation = exports.AnnotationMotivation || (exports.AnnotationMotivation = {}));\nvar Behavior;\n(function (Behavior) {\n Behavior["AUTO_ADVANCE"] = "auto-advance";\n Behavior["CONTINUOUS"] = "continuous";\n Behavior["FACING_PAGES"] = "facing-pages";\n Behavior["HIDDEN"] = "hidden";\n Behavior["INDIVIDUALS"] = "individuals";\n Behavior["MULTI_PART"] = "multi-part";\n Behavior["NO_NAV"] = "no-nav";\n Behavior["NON_PAGED"] = "non-paged";\n Behavior["PAGED"] = "paged";\n Behavior["REPEAT"] = "repeat";\n Behavior["SEQUENCE"] = "sequence";\n Behavior["THUMBNAIL_NAV"] = "thumbnail-nav";\n Behavior["TOGETHER"] = "together";\n Behavior["UNORDERED"] = "unordered";\n})(Behavior = exports.Behavior || (exports.Behavior = {}));\nvar ExternalResourceType;\n(function (ExternalResourceType) {\n ExternalResourceType["CANVAS"] = "canvas";\n ExternalResourceType["CHOICE"] = "choice";\n ExternalResourceType["OA_CHOICE"] = "oa:choice";\n ExternalResourceType["CONTENT_AS_TEXT"] = "contentastext";\n ExternalResourceType["DATASET"] = "dataset";\n ExternalResourceType["DOCUMENT"] = "document";\n ExternalResourceType["IMAGE"] = "image";\n ExternalResourceType["MODEL"] = "model";\n ExternalResourceType["MOVING_IMAGE"] = "movingimage";\n ExternalResourceType["PDF"] = "pdf";\n ExternalResourceType["PHYSICAL_OBJECT"] = "physicalobject";\n ExternalResourceType["SOUND"] = "sound";\n ExternalResourceType["TEXT"] = "text";\n ExternalResourceType["TEXTUALBODY"] = "textualbody";\n ExternalResourceType["VIDEO"] = "video";\n})(ExternalResourceType = exports.ExternalResourceType || (exports.ExternalResourceType = {}));\nvar IIIFResourceType;\n(function (IIIFResourceType) {\n IIIFResourceType["ANNOTATION"] = "annotation";\n IIIFResourceType["CANVAS"] = "canvas";\n IIIFResourceType["COLLECTION"] = "collection";\n IIIFResourceType["MANIFEST"] = "manifest";\n IIIFResourceType["RANGE"] = "range";\n IIIFResourceType["SEQUENCE"] = "sequence";\n})(IIIFResourceType = exports.IIIFResourceType || (exports.IIIFResourceType = {}));\nvar MediaType;\n(function (MediaType) {\n MediaType["AUDIO_MP4"] = "audio/mp4";\n MediaType["CORTO"] = "application/corto";\n MediaType["DICOM"] = "application/dicom";\n MediaType["DRACO"] = "application/draco";\n MediaType["EPUB"] = "application/epub+zip";\n MediaType["GIRDER"] = "image/vnd.kitware.girder";\n MediaType["GLB"] = "model/gltf-binary";\n MediaType["GLTF"] = "model/gltf+json";\n MediaType["IIIF_PRESENTATION_2"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/2/context.json\\"";\n MediaType["IIIF_PRESENTATION_3"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/3/context.json\\"";\n MediaType["JPG"] = "image/jpeg";\n MediaType["M3U8"] = "application/vnd.apple.mpegurl";\n MediaType["MP3"] = "audio/mp3";\n MediaType["MPEG_DASH"] = "application/dash+xml";\n MediaType["OBJ"] = "text/plain";\n MediaType["OPF"] = "application/oebps-package+xml";\n MediaType["PDF"] = "application/pdf";\n MediaType["PLY"] = "application/ply";\n MediaType["THREEJS"] = "application/vnd.threejs+json";\n MediaType["USDZ"] = "model/vnd.usd+zip";\n MediaType["VIDEO_MP4"] = "video/mp4";\n MediaType["WAV"] = "audio/wav";\n MediaType["WEBM"] = "video/webm";\n})(MediaType = exports.MediaType || (exports.MediaType = {}));\nvar RenderingFormat;\n(function (RenderingFormat) {\n RenderingFormat["DOC"] = "application/msword";\n RenderingFormat["DOCX"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";\n RenderingFormat["PDF"] = "application/pdf";\n})(RenderingFormat = exports.RenderingFormat || (exports.RenderingFormat = {}));\nvar ServiceProfile;\n(function (ServiceProfile) {\n // image api\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level0";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level1";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level2";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level0";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level1";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level2";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2";\n ServiceProfile["IMAGE_1_LEVEL_0"] = "http://iiif.io/api/image/1/level0.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/1/profiles/level0.json";\n ServiceProfile["IMAGE_1_LEVEL_1"] = "http://iiif.io/api/image/1/level1.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/1/profiles/level1.json";\n ServiceProfile["IMAGE_1_LEVEL_2"] = "http://iiif.io/api/image/1/level2.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/1/profiles/level2.json";\n ServiceProfile["IMAGE_2_LEVEL_0"] = "http://iiif.io/api/image/2/level0.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/2/profiles/level0.json";\n ServiceProfile["IMAGE_2_LEVEL_1"] = "http://iiif.io/api/image/2/level1.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/2/profiles/level1.json";\n ServiceProfile["IMAGE_2_LEVEL_2"] = "http://iiif.io/api/image/2/level2.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/2/profiles/level2.json";\n // auth api\n ServiceProfile["AUTH_0_CLICK_THROUGH"] = "http://iiif.io/api/auth/0/login/clickthrough";\n ServiceProfile["AUTH_0_LOGIN"] = "http://iiif.io/api/auth/0/login";\n ServiceProfile["AUTH_0_LOGOUT"] = "http://iiif.io/api/auth/0/logout";\n ServiceProfile["AUTH_0_RESTRICTED"] = "http://iiif.io/api/auth/0/login/restricted";\n ServiceProfile["AUTH_0_TOKEN"] = "http://iiif.io/api/auth/0/token";\n ServiceProfile["AUTH_1_CLICK_THROUGH"] = "http://iiif.io/api/auth/1/clickthrough";\n ServiceProfile["AUTH_1_EXTERNAL"] = "http://iiif.io/api/auth/1/external";\n ServiceProfile["AUTH_1_KIOSK"] = "http://iiif.io/api/auth/1/kiosk";\n ServiceProfile["AUTH_1_LOGIN"] = "http://iiif.io/api/auth/1/login";\n ServiceProfile["AUTH_1_LOGOUT"] = "http://iiif.io/api/auth/1/logout";\n ServiceProfile["AUTH_1_PROBE"] = "http://iiif.io/api/auth/1/probe";\n ServiceProfile["AUTH_1_TOKEN"] = "http://iiif.io/api/auth/1/token";\n // search api\n ServiceProfile["SEARCH_0"] = "http://iiif.io/api/search/0/search";\n ServiceProfile["SEARCH_0_AUTO_COMPLETE"] = "http://iiif.io/api/search/0/autocomplete";\n ServiceProfile["SEARCH_1"] = "http://iiif.io/api/search/1/search";\n ServiceProfile["SEARCH_1_AUTO_COMPLETE"] = "http://iiif.io/api/search/1/autocomplete";\n // extensions\n ServiceProfile["TRACKING_EXTENSIONS"] = "http://universalviewer.io/tracking-extensions-profile";\n ServiceProfile["UI_EXTENSIONS"] = "http://universalviewer.io/ui-extensions-profile";\n ServiceProfile["PRINT_EXTENSIONS"] = "http://universalviewer.io/print-extensions-profile";\n ServiceProfile["SHARE_EXTENSIONS"] = "http://universalviewer.io/share-extensions-profile";\n ServiceProfile["DOWNLOAD_EXTENSIONS"] = "http://universalviewer.io/download-extensions-profile";\n // other\n ServiceProfile["OTHER_MANIFESTATIONS"] = "http://iiif.io/api/otherManifestations.json";\n ServiceProfile["IXIF"] = "http://wellcomelibrary.org/ld/ixif/0/alpha.json";\n})(ServiceProfile = exports.ServiceProfile || (exports.ServiceProfile = {}));\nvar ServiceType;\n(function (ServiceType) {\n ServiceType["IMAGE_SERVICE_2"] = "ImageService2";\n ServiceType["IMAGE_SERVICE_3"] = "ImageService3";\n})(ServiceType = exports.ServiceType || (exports.ServiceType = {}));\nvar ViewingDirection;\n(function (ViewingDirection) {\n ViewingDirection["BOTTOM_TO_TOP"] = "bottom-to-top";\n ViewingDirection["LEFT_TO_RIGHT"] = "left-to-right";\n ViewingDirection["RIGHT_TO_LEFT"] = "right-to-left";\n ViewingDirection["TOP_TO_BOTTOM"] = "top-to-bottom";\n})(ViewingDirection = exports.ViewingDirection || (exports.ViewingDirection = {}));\nvar ViewingHint;\n(function (ViewingHint) {\n ViewingHint["CONTINUOUS"] = "continuous";\n ViewingHint["INDIVIDUALS"] = "individuals";\n ViewingHint["NON_PAGED"] = "non-paged";\n ViewingHint["PAGED"] = "paged";\n ViewingHint["TOP"] = "top";\n})(ViewingHint = exports.ViewingHint || (exports.ViewingHint = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@iiif/vocabulary/dist-commonjs/index.js?')},"./node_modules/color-name/index.js":module=>{"use strict";eval('\r\n\r\nmodule.exports = {\r\n\t"aliceblue": [240, 248, 255],\r\n\t"antiquewhite": [250, 235, 215],\r\n\t"aqua": [0, 255, 255],\r\n\t"aquamarine": [127, 255, 212],\r\n\t"azure": [240, 255, 255],\r\n\t"beige": [245, 245, 220],\r\n\t"bisque": [255, 228, 196],\r\n\t"black": [0, 0, 0],\r\n\t"blanchedalmond": [255, 235, 205],\r\n\t"blue": [0, 0, 255],\r\n\t"blueviolet": [138, 43, 226],\r\n\t"brown": [165, 42, 42],\r\n\t"burlywood": [222, 184, 135],\r\n\t"cadetblue": [95, 158, 160],\r\n\t"chartreuse": [127, 255, 0],\r\n\t"chocolate": [210, 105, 30],\r\n\t"coral": [255, 127, 80],\r\n\t"cornflowerblue": [100, 149, 237],\r\n\t"cornsilk": [255, 248, 220],\r\n\t"crimson": [220, 20, 60],\r\n\t"cyan": [0, 255, 255],\r\n\t"darkblue": [0, 0, 139],\r\n\t"darkcyan": [0, 139, 139],\r\n\t"darkgoldenrod": [184, 134, 11],\r\n\t"darkgray": [169, 169, 169],\r\n\t"darkgreen": [0, 100, 0],\r\n\t"darkgrey": [169, 169, 169],\r\n\t"darkkhaki": [189, 183, 107],\r\n\t"darkmagenta": [139, 0, 139],\r\n\t"darkolivegreen": [85, 107, 47],\r\n\t"darkorange": [255, 140, 0],\r\n\t"darkorchid": [153, 50, 204],\r\n\t"darkred": [139, 0, 0],\r\n\t"darksalmon": [233, 150, 122],\r\n\t"darkseagreen": [143, 188, 143],\r\n\t"darkslateblue": [72, 61, 139],\r\n\t"darkslategray": [47, 79, 79],\r\n\t"darkslategrey": [47, 79, 79],\r\n\t"darkturquoise": [0, 206, 209],\r\n\t"darkviolet": [148, 0, 211],\r\n\t"deeppink": [255, 20, 147],\r\n\t"deepskyblue": [0, 191, 255],\r\n\t"dimgray": [105, 105, 105],\r\n\t"dimgrey": [105, 105, 105],\r\n\t"dodgerblue": [30, 144, 255],\r\n\t"firebrick": [178, 34, 34],\r\n\t"floralwhite": [255, 250, 240],\r\n\t"forestgreen": [34, 139, 34],\r\n\t"fuchsia": [255, 0, 255],\r\n\t"gainsboro": [220, 220, 220],\r\n\t"ghostwhite": [248, 248, 255],\r\n\t"gold": [255, 215, 0],\r\n\t"goldenrod": [218, 165, 32],\r\n\t"gray": [128, 128, 128],\r\n\t"green": [0, 128, 0],\r\n\t"greenyellow": [173, 255, 47],\r\n\t"grey": [128, 128, 128],\r\n\t"honeydew": [240, 255, 240],\r\n\t"hotpink": [255, 105, 180],\r\n\t"indianred": [205, 92, 92],\r\n\t"indigo": [75, 0, 130],\r\n\t"ivory": [255, 255, 240],\r\n\t"khaki": [240, 230, 140],\r\n\t"lavender": [230, 230, 250],\r\n\t"lavenderblush": [255, 240, 245],\r\n\t"lawngreen": [124, 252, 0],\r\n\t"lemonchiffon": [255, 250, 205],\r\n\t"lightblue": [173, 216, 230],\r\n\t"lightcoral": [240, 128, 128],\r\n\t"lightcyan": [224, 255, 255],\r\n\t"lightgoldenrodyellow": [250, 250, 210],\r\n\t"lightgray": [211, 211, 211],\r\n\t"lightgreen": [144, 238, 144],\r\n\t"lightgrey": [211, 211, 211],\r\n\t"lightpink": [255, 182, 193],\r\n\t"lightsalmon": [255, 160, 122],\r\n\t"lightseagreen": [32, 178, 170],\r\n\t"lightskyblue": [135, 206, 250],\r\n\t"lightslategray": [119, 136, 153],\r\n\t"lightslategrey": [119, 136, 153],\r\n\t"lightsteelblue": [176, 196, 222],\r\n\t"lightyellow": [255, 255, 224],\r\n\t"lime": [0, 255, 0],\r\n\t"limegreen": [50, 205, 50],\r\n\t"linen": [250, 240, 230],\r\n\t"magenta": [255, 0, 255],\r\n\t"maroon": [128, 0, 0],\r\n\t"mediumaquamarine": [102, 205, 170],\r\n\t"mediumblue": [0, 0, 205],\r\n\t"mediumorchid": [186, 85, 211],\r\n\t"mediumpurple": [147, 112, 219],\r\n\t"mediumseagreen": [60, 179, 113],\r\n\t"mediumslateblue": [123, 104, 238],\r\n\t"mediumspringgreen": [0, 250, 154],\r\n\t"mediumturquoise": [72, 209, 204],\r\n\t"mediumvioletred": [199, 21, 133],\r\n\t"midnightblue": [25, 25, 112],\r\n\t"mintcream": [245, 255, 250],\r\n\t"mistyrose": [255, 228, 225],\r\n\t"moccasin": [255, 228, 181],\r\n\t"navajowhite": [255, 222, 173],\r\n\t"navy": [0, 0, 128],\r\n\t"oldlace": [253, 245, 230],\r\n\t"olive": [128, 128, 0],\r\n\t"olivedrab": [107, 142, 35],\r\n\t"orange": [255, 165, 0],\r\n\t"orangered": [255, 69, 0],\r\n\t"orchid": [218, 112, 214],\r\n\t"palegoldenrod": [238, 232, 170],\r\n\t"palegreen": [152, 251, 152],\r\n\t"paleturquoise": [175, 238, 238],\r\n\t"palevioletred": [219, 112, 147],\r\n\t"papayawhip": [255, 239, 213],\r\n\t"peachpuff": [255, 218, 185],\r\n\t"peru": [205, 133, 63],\r\n\t"pink": [255, 192, 203],\r\n\t"plum": [221, 160, 221],\r\n\t"powderblue": [176, 224, 230],\r\n\t"purple": [128, 0, 128],\r\n\t"rebeccapurple": [102, 51, 153],\r\n\t"red": [255, 0, 0],\r\n\t"rosybrown": [188, 143, 143],\r\n\t"royalblue": [65, 105, 225],\r\n\t"saddlebrown": [139, 69, 19],\r\n\t"salmon": [250, 128, 114],\r\n\t"sandybrown": [244, 164, 96],\r\n\t"seagreen": [46, 139, 87],\r\n\t"seashell": [255, 245, 238],\r\n\t"sienna": [160, 82, 45],\r\n\t"silver": [192, 192, 192],\r\n\t"skyblue": [135, 206, 235],\r\n\t"slateblue": [106, 90, 205],\r\n\t"slategray": [112, 128, 144],\r\n\t"slategrey": [112, 128, 144],\r\n\t"snow": [255, 250, 250],\r\n\t"springgreen": [0, 255, 127],\r\n\t"steelblue": [70, 130, 180],\r\n\t"tan": [210, 180, 140],\r\n\t"teal": [0, 128, 128],\r\n\t"thistle": [216, 191, 216],\r\n\t"tomato": [255, 99, 71],\r\n\t"turquoise": [64, 224, 208],\r\n\t"violet": [238, 130, 238],\r\n\t"wheat": [245, 222, 179],\r\n\t"white": [255, 255, 255],\r\n\t"whitesmoke": [245, 245, 245],\r\n\t"yellow": [255, 255, 0],\r\n\t"yellowgreen": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-name/index.js?')},"./node_modules/color-string/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\nvar swizzle = __webpack_require__(/*! simple-swizzle */ \"./node_modules/simple-swizzle/index.js\");\nvar hasOwnProperty = Object.hasOwnProperty;\n\nvar reverseNames = Object.create(null);\n\n// create a list of reverse color names\nfor (var name in colorNames) {\n\tif (hasOwnProperty.call(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nvar cs = module.exports = {\n\tto: {},\n\tget: {}\n};\n\ncs.get = function (string) {\n\tvar prefix = string.substring(0, 3).toLowerCase();\n\tvar val;\n\tvar model;\n\tswitch (prefix) {\n\t\tcase 'hsl':\n\t\t\tval = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\tcase 'hwb':\n\t\t\tval = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tval = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t}\n\n\tif (!val) {\n\t\treturn null;\n\t}\n\n\treturn {model: model, value: val};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar abbr = /^#([a-f0-9]{3,4})$/i;\n\tvar hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;\n\tvar rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar keyword = /^(\\w+)$/;\n\n\tvar rgb = [0, 0, 0, 1];\n\tvar match;\n\tvar i;\n\tvar hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tvar i2 = i * 2;\n\t\t\trgb[i] = parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i + 1], 0);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!hasOwnProperty.call(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hsl = /^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hsl);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar s = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar l = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hwb = /^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hwb);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar w = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar b = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function () {\n\tvar rgba = swizzle(arguments);\n\n\tvar r = Math.round(rgba[0] / 255 * 100);\n\tvar g = Math.round(rgba[1] / 255 * 100);\n\tvar b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function () {\n\tvar hsla = swizzle(arguments);\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function () {\n\tvar hwba = swizzle(arguments);\n\n\tvar a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// helpers\nfunction clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n\tvar str = Math.round(num).toString(16).toUpperCase();\n\treturn (str.length < 2) ? '0' + str : str;\n}\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-string/index.js?")},"./node_modules/is-arrayish/index.js":module=>{eval("module.exports = function isArrayish(obj) {\n\tif (!obj || typeof obj === 'string') {\n\t\treturn false;\n\t}\n\n\treturn obj instanceof Array || Array.isArray(obj) ||\n\t\t(obj.length >= 0 && (obj.splice instanceof Function ||\n\t\t\t(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/is-arrayish/index.js?")},"./node_modules/isomorphic-unfetch/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('function r(m) {\n\treturn (m && m.default) || m;\n}\nmodule.exports = __webpack_require__.g.fetch =\n\t__webpack_require__.g.fetch ||\n\t(typeof process == "undefined"\n\t\t? r(__webpack_require__(/*! unfetch */ "./node_modules/unfetch/dist/unfetch.module.js"))\n\t\t: function (url, opts) {\n\t\t\t\tif (typeof url === "string" || url instanceof URL) {\n\t\t\t\t\turl = String(url).replace(/^\\/\\//g, "https://");\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! node-fetch */ "node-fetch", 23)).then((m) => r(m)(url, opts));\n\t\t });\n\n\n//# sourceURL=webpack://manifesto/./node_modules/isomorphic-unfetch/index.js?')},"./node_modules/lodash/_Symbol.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_Symbol.js?')},"./node_modules/lodash/_arrayPush.js":module=>{eval("/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_arrayPush.js?")},"./node_modules/lodash/_baseFlatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"),\n isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js");\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseFlatten.js?')},"./node_modules/lodash/_baseGetTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),\n objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");\n\n/** `Object#toString` result references. */\nvar nullTag = \'[object Null]\',\n undefinedTag = \'[object Undefined]\';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseGetTag.js?')},"./node_modules/lodash/_baseIsArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");\n\n/** `Object#toString` result references. */\nvar argsTag = \'[object Arguments]\';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseIsArguments.js?')},"./node_modules/lodash/_freeGlobal.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\nmodule.exports = freeGlobal;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_freeGlobal.js?")},"./node_modules/lodash/_getRawTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_getRawTag.js?')},"./node_modules/lodash/_isFlattenable.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"),\n isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js");\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_isFlattenable.js?')},"./node_modules/lodash/_objectToString.js":module=>{eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_objectToString.js?")},"./node_modules/lodash/_root.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_root.js?")},"./node_modules/lodash/flatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flatten.js?')},"./node_modules/lodash/flattenDeep.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flattenDeep.js?')},"./node_modules/lodash/isArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ \"./node_modules/lodash/_baseIsArguments.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArguments.js?")},"./node_modules/lodash/isArray.js":module=>{eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArray.js?")},"./node_modules/lodash/isObjectLike.js":module=>{eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isObjectLike.js?")},"./node_modules/simple-swizzle/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar isArrayish = __webpack_require__(/*! is-arrayish */ "./node_modules/is-arrayish/index.js");\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\nvar swizzle = module.exports = function swizzle(args) {\n\tvar results = [];\n\n\tfor (var i = 0, len = args.length; i < len; i++) {\n\t\tvar arg = args[i];\n\n\t\tif (isArrayish(arg)) {\n\t\t\t// http://jsperf.com/javascript-array-concat-vs-push/98\n\t\t\tresults = concat.call(results, slice.call(arg));\n\t\t} else {\n\t\t\tresults.push(arg);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nswizzle.wrap = function (fn) {\n\treturn function () {\n\t\treturn fn(swizzle(arguments));\n\t};\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/simple-swizzle/index.js?')},"./src/Annotation.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Annotation = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar Annotation = /** @class */ (function (_super) {\n __extends(Annotation, _super);\n function Annotation(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n /**\n In spite of its name, this method returns an array of objects, each of which\n represents a potential body annotations\n \n @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ }\n **/\n Annotation.prototype.getBody = function () {\n var bodies = [];\n var body = this.getProperty("body");\n // the following is intended to handle the following cases for\n /// the raw json of the body property of __jsonld\n // -- body is an array, each element of which is parsed\n // == body is an object with property items, each item is parsed\n // -- body is parsed\n if (body) {\n for (var _i = 0, _a = [].concat(body); _i < _a.length; _i++) {\n var bd = _a[_i];\n var items = bd.items;\n if (items)\n bodies = bodies.concat(this.parseBodiesFromItemsList(items));\n else\n bodies.push(this.parseSingletonBody(bd));\n }\n }\n return bodies;\n };\n Object.defineProperty(Annotation.prototype, "Body", {\n get: function () { return this.getBody(); },\n enumerable: false,\n configurable: true\n });\n /**\n auxiliary function to getBody; intended to hande an object that has an element items\n which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/\n seems to be the use case for this\n **/\n Annotation.prototype.parseBodiesFromItemsList = function (rawbodies) {\n var retVal = [];\n for (var _i = 0, _a = [].concat(rawbodies); _i < _a.length; _i++) {\n var bd = _a[_i];\n retVal.push(this.parseSingletonBody(bd));\n }\n return retVal;\n };\n /**\n auxiliary function to parseBodiesFromItemsList and getBody, this is the last\n step on recursively going through collections of bodies.\n **/\n Annotation.prototype.parseSingletonBody = function (rawbody) {\n if (rawbody.type === "SpecificResource") {\n return new internal_1.SpecificResource(rawbody, this.options);\n }\n else {\n return internal_1.AnnotationBodyParser.BuildFromJson(rawbody, this.options);\n }\n };\n /**\n Developer Note: 8 April 2024\n getBody3D function was developed in the early stages of the 3D API Feb-March 2024\n as alternative to the existing Annotation getBody function, but the signature for\n getBody3D was chosen to be a single object instance, not an array.\n \n At this stage, the merging of the 2D API anf the draft 3D API has been completed, so\n 3D applications can use the getBody() function to retrieve the body of an Annotation intended\n to target a scene. For compatibily the return value of the function is still an\n array.\n \n 3D clients using getBody are responsible for choosing the appropriate instance from the\n returned array. In most cases this will be the sole 0th element.\n **/\n Annotation.prototype.getBody3D = function () {\n console.warn("Annotation.getBody3D is deprecated: replace with getBody3D() with getBody()[0]");\n return this.getBody()[0];\n };\n Annotation.prototype.getMotivation = function () {\n var motivation = this.getProperty("motivation");\n if (motivation) {\n //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation);\n return motivation;\n }\n return null;\n };\n // open annotation\n Annotation.prototype.getOn = function () {\n return this.getProperty("on");\n };\n Annotation.prototype.getTarget = function () {\n var rawTarget = this.getPropertyAsObject("target");\n if (rawTarget.isIRI)\n return rawTarget;\n if (rawTarget.type && rawTarget.type == "SpecificResource") {\n return new internal_1.SpecificResource(rawTarget, this.options);\n }\n else {\n throw new Error("unknown target specified");\n }\n };\n Object.defineProperty(Annotation.prototype, "Target", {\n get: function () { return this.getTarget(); },\n enumerable: false,\n configurable: true\n });\n Annotation.prototype.getResource = function () {\n return new internal_1.Resource(this.getProperty("resource"), this.options);\n };\n Object.defineProperty(Annotation.prototype, "LookAtLocation", {\n /**\n * A 3D point coordinate object for the location of an Annotation\n * to satisfy the requirements of the lookAt property of camera and\n * spotlight resources, according to the draft v4 API as of April 1 2024\n *\n * Is the position of the point for a target which is a SpecificResource with\n * a PointSelector\n * Otherwise, for example when the annotation target is an entire Scene, the\n * location for lookAt is the origin (0,0,0)\n **/\n get: function () {\n var _a;\n var target = this.getTarget();\n if (target.isSpecificResource && ((_a = target.getSelector()) === null || _a === void 0 ? void 0 : _a.isPointSelector))\n return target.getSelector().getLocation();\n else\n return new threejs_math_1.Vector3(0.0, 0.0, 0.0);\n },\n enumerable: false,\n configurable: true\n });\n return Annotation;\n}(internal_1.ManifestResource));\nexports.Annotation = Annotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Annotation.ts?')},"./src/AnnotationBody.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBody = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\nWith the 3D extensions to the IIIF Presentation API the name of this\nclass is misleading, but for now is being retained for the sake backward\ncompatibility with earlier manifesto code and tests.\n\nThe 3D extensions allow that the body property of an annotation can be\na light, camera, or model, or a SpecificResource object wrapping a light, camera,\nor model.\n**/\nvar AnnotationBody = /** @class */ (function (_super) {\n __extends(AnnotationBody, _super);\n function AnnotationBody(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = true;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = false;\n // following class members were added to support 3D and mixed 2D/3D content\n // these boolean switches will be appropriately set when the manifest json is parsed\n _this.isModel = true;\n _this.isLight = false;\n _this.isCamera = false;\n return _this;\n }\n // Format, Type, Width, and Height are the body properties supported\n // in the code that supports Presentation 3\n AnnotationBody.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return internal_1.Utils.getMediaType(format);\n }\n return null;\n };\n AnnotationBody.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return (internal_1.Utils.normaliseType(this.getProperty("type")));\n }\n return null;\n };\n AnnotationBody.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n AnnotationBody.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n return AnnotationBody;\n}(internal_1.ManifestResource));\nexports.AnnotationBody = AnnotationBody;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBody.ts?')},"./src/AnnotationBodyParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBodyParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LightTypes = ["AmbientLight", "DirectionalLight"];\nvar CameraTypes = ["PerspectiveCamera", "OrthographicCamera"];\nvar DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"];\nvar AnnotationBodyParser = /** @class */ (function () {\n function AnnotationBodyParser() {\n }\n AnnotationBodyParser.BuildFromJson = function (jsonld, options) {\n if (DisplayedTypes.includes(jsonld.type))\n return new internal_1.AnnotationBody(jsonld, options);\n else if (LightTypes.includes(jsonld.type))\n return new internal_1.Light(jsonld, options);\n else if (CameraTypes.includes(jsonld.type))\n return new internal_1.Camera(jsonld, options);\n else\n throw new Error("unimplemented type for AnnotationBody: " + jsonld.type);\n };\n return AnnotationBodyParser;\n}());\nexports.AnnotationBodyParser = AnnotationBodyParser;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBodyParser.ts?')},"./src/AnnotationList.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationList = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationList = /** @class */ (function (_super) {\n __extends(AnnotationList, _super);\n function AnnotationList(label, jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.label = label;\n _this.options = options;\n return _this;\n }\n AnnotationList.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n AnnotationList.prototype.getLabel = function () {\n return this.label;\n };\n AnnotationList.prototype.getResources = function () {\n var _this = this;\n var resources = this.getProperty("resources");\n return resources.map(function (resource) { return new internal_1.Annotation(resource, _this.options); });\n };\n AnnotationList.prototype.load = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.isLoaded) {\n resolve(_this);\n }\n else {\n var id = _this.__jsonld.id;\n if (!id) {\n id = _this.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id)\n .then(function (data) {\n _this.__jsonld = data;\n _this.context = _this.getProperty("context");\n _this.id = _this.getProperty("id");\n _this.isLoaded = true;\n resolve(_this);\n })\n .catch(reject);\n }\n });\n };\n return AnnotationList;\n}(internal_1.JSONLDResource));\nexports.AnnotationList = AnnotationList;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationList.ts?')},"./src/AnnotationPage.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationPage = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationPage = /** @class */ (function (_super) {\n __extends(AnnotationPage, _super);\n function AnnotationPage(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n AnnotationPage.prototype.getItems = function () {\n return this.getProperty("items");\n };\n return AnnotationPage;\n}(internal_1.ManifestResource));\nexports.AnnotationPage = AnnotationPage;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationPage.ts?')},"./src/Camera.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Camera = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Camera = /** @class */ (function (_super) {\n __extends(Camera, _super);\n function Camera(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isModel = false;\n _this.isLight = false;\n _this.isCamera = true;\n return _this;\n }\n Object.defineProperty(Camera.prototype, "isPerspectiveCamera", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "perspectivecamera");\n },\n enumerable: false,\n configurable: true\n });\n /**\n @returns full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n Camera.prototype.getFieldOfView = function () {\n if (this.isPerspectiveCamera) {\n var value = this.getProperty("fieldOfView");\n if (value)\n return value;\n else\n return 45.0;\n }\n else\n return undefined;\n };\n Object.defineProperty(Camera.prototype, "FieldOfView", {\n /**\n Full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n get: function () { return this.getFieldOfView(); },\n enumerable: false,\n configurable: true\n });\n Camera.prototype.getLookAt = function () {\n return this.getPropertyAsObject("lookAt");\n };\n Object.defineProperty(Camera.prototype, "LookAt", {\n get: function () { return this.getLookAt(); },\n enumerable: false,\n configurable: true\n });\n return Camera;\n}(internal_1.AnnotationBody));\nexports.Camera = Camera;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/Camera.ts?')},"./src/Canvas.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Canvas = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n// @ts-ignore\nvar flatten_1 = __importDefault(__webpack_require__(/*! lodash/flatten */ "./node_modules/lodash/flatten.js"));\n// @ts-ignore\nvar flattenDeep_1 = __importDefault(__webpack_require__(/*! lodash/flattenDeep */ "./node_modules/lodash/flattenDeep.js"));\nvar Canvas = /** @class */ (function (_super) {\n __extends(Canvas, _super);\n function Canvas(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // http://iiif.io/api/image/2.1/#canonical-uri-syntax\n Canvas.prototype.getCanonicalImageUri = function (w) {\n var id = null;\n var region = "full";\n var rotation = 0;\n var quality = "default";\n var width = w;\n var size;\n // if an info.json has been loaded\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data["@id"]) {\n id = this.externalResource.data["@id"];\n if (!width) {\n width = this.externalResource.data.width;\n }\n if (this.externalResource.data["@context"]) {\n if (this.externalResource.data["@context"].indexOf("/1.0/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1.1/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1/context.json") > -1) {\n quality = "native";\n }\n }\n }\n else {\n // info.json hasn\'t been loaded yet\n var images = void 0;\n // presentation 2.0\n images = this.getImages();\n if (images && images.length) {\n var firstImage = images[0];\n var resource = firstImage.getResource();\n var services = resource.getServices();\n if (!width) {\n width = resource.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return (internal_1.Utils.isImageProfile(service.getProfile()) ||\n internal_1.Utils.isImageServiceType(service.getIIIFResourceType()));\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === resource.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return resource.id;\n }\n }\n // presentation 3.0\n images = this.getContent();\n if (images && images.length) {\n var firstImage = images[0];\n // Developer note: Since Canvas in Presentation 3 doesn\'t use\n // SpecificResource resources in the body, force a cast\n var body = firstImage.getBody();\n var anno = body[0];\n var services = anno.getServices();\n if (!width) {\n width = anno.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return internal_1.Utils.isImageServiceType(service.getIIIFResourceType());\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === anno.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return anno.id;\n }\n }\n // todo: should this be moved to getThumbUri?\n if (!id) {\n var thumbnail = this.getProperty("thumbnail");\n if (thumbnail) {\n if (typeof thumbnail === "string") {\n return thumbnail;\n }\n else {\n if (thumbnail["@id"]) {\n return thumbnail["@id"];\n }\n else if (thumbnail.length) {\n return thumbnail[0].id;\n }\n }\n }\n }\n }\n size = width + ",";\n // trim off trailing \'/\'\n if (id && id.endsWith("/")) {\n id = id.substr(0, id.length - 1);\n }\n var uri = [id, region, size, rotation, quality + ".jpg"].join("/");\n return uri;\n };\n Canvas.prototype.getMaxDimensions = function () {\n var maxDimensions = null;\n var profile;\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data.profile) {\n profile = this.externalResource.data.profile;\n if (Array.isArray(profile)) {\n profile = profile.filter(function (p) { return p["maxWidth" || 0]; })[0];\n if (profile) {\n maxDimensions = new internal_1.Size(profile.maxWidth, profile.maxHeight ? profile.maxHeight : profile.maxWidth);\n }\n }\n }\n return maxDimensions;\n };\n // Presentation API 3.0\n Canvas.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n return content;\n };\n Canvas.prototype.getDuration = function () {\n return this.getProperty("duration");\n };\n // presentation 2.0\n Canvas.prototype.getImages = function () {\n var images = [];\n if (!this.__jsonld.images)\n return images;\n for (var i = 0; i < this.__jsonld.images.length; i++) {\n var a = this.__jsonld.images[i];\n var annotation = new internal_1.Annotation(a, this.options);\n images.push(annotation);\n }\n return images;\n };\n Canvas.prototype.getIndex = function () {\n return this.getProperty("index");\n };\n Canvas.prototype.getOtherContent = function () {\n var _this = this;\n var otherContent = Array.isArray(this.getProperty("otherContent"))\n ? this.getProperty("otherContent")\n : [this.getProperty("otherContent")];\n var canonicalComparison = function (typeA, typeB) {\n if (typeof typeA !== "string" || typeof typeB !== "string") {\n return false;\n }\n return typeA.toLowerCase() === typeA.toLowerCase();\n };\n var otherPromises = otherContent\n .filter(function (otherContent) {\n return otherContent &&\n canonicalComparison(otherContent["@type"], "sc:AnnotationList");\n })\n .map(function (annotationList, i) {\n return new internal_1.AnnotationList(annotationList["label"] || "Annotation list ".concat(i), annotationList, _this.options);\n })\n .map(function (annotationList) { return annotationList.load(); });\n return Promise.all(otherPromises);\n };\n // Prefer thumbnail service to image service if supplied and if\n // the thumbnail service can provide a satisfactory size +/- x pixels.\n // this is used to get thumb URIs *before* the info.json has been requested\n // and populate thumbnails in a viewer.\n // the publisher may also provide pre-computed fixed-size thumbs for better performance.\n //getThumbUri(width: number): string {\n //\n // var uri;\n // var images: IAnnotation[] = this.getImages();\n //\n // if (images && images.length) {\n // var firstImage = images[0];\n // var resource: IResource = firstImage.getResource();\n // var services: IService[] = resource.getServices();\n //\n // for (let i = 0; i < services.length; i++) {\n // var service: IService = services[i];\n // var id = service.id;\n //\n // if (!_endsWith(id, \'/\')) {\n // id += \'/\';\n // }\n //\n // uri = id + \'full/\' + width + \',/0/\' + Utils.getImageQuality(service.getProfile()) + \'.jpg\';\n // }\n // }\n //\n // return uri;\n //}\n //getType(): CanvasType {\n // return new CanvasType(this.getProperty(\'@type\').toLowerCase());\n //}\n Canvas.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Canvas.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Canvas.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Canvas.prototype, "imageResources", {\n get: function () {\n var _this = this;\n var resources = (0, flattenDeep_1.default)([\n this.getImages().map(function (i) { return i.getResource(); }),\n this.getContent().map(function (i) { return i.getBody(); })\n ]);\n return (0, flatten_1.default)(resources.map(function (resource) {\n switch (resource.getProperty("type").toLowerCase()) {\n case dist_commonjs_1.ExternalResourceType.CHOICE:\n case dist_commonjs_1.ExternalResourceType.OA_CHOICE:\n return new Canvas({\n images: (0, flatten_1.default)([\n resource.getProperty("default"),\n resource.getProperty("item")\n ]).map(function (r) { return ({ resource: r }); })\n }, _this.options)\n .getImages()\n .map(function (i) { return i.getResource(); });\n default:\n return resource;\n }\n }));\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "resourceAnnotations", {\n get: function () {\n return (0, flattenDeep_1.default)([this.getImages(), this.getContent()]);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns a given resource Annotation, based on a contained resource or body\n * id\n */\n Canvas.prototype.resourceAnnotation = function (id) {\n return this.resourceAnnotations.find(function (anno) {\n return anno.getResource().id === id ||\n (0, flatten_1.default)(new Array(anno.getBody())).some(function (body) { return body.id === id; });\n });\n };\n /**\n * Returns the fragment placement values if a resourceAnnotation is placed on\n * a canvas somewhere besides the full extent\n */\n Canvas.prototype.onFragment = function (id) {\n var resourceAnnotation = this.resourceAnnotation(id);\n if (!resourceAnnotation)\n return undefined;\n // IIIF v2\n var on = resourceAnnotation.getProperty("on");\n // IIIF v3\n var target = resourceAnnotation.getProperty("target");\n if (!on || !target) {\n return undefined;\n }\n var fragmentMatch = (on || target).match(/xywh=(.*)$/);\n if (!fragmentMatch)\n return undefined;\n return fragmentMatch[1].split(",").map(function (str) { return parseInt(str, 10); });\n };\n Object.defineProperty(Canvas.prototype, "iiifImageResources", {\n get: function () {\n return this.imageResources.filter(function (r) { return r && r.getServices()[0] && r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "imageServiceIds", {\n get: function () {\n return this.iiifImageResources.map(function (r) { return r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "aspectRatio", {\n get: function () {\n return this.getWidth() / this.getHeight();\n },\n enumerable: false,\n configurable: true\n });\n return Canvas;\n}(internal_1.Resource));\nexports.Canvas = Canvas;\n\n\n//# sourceURL=webpack://manifesto/./src/Canvas.ts?')},"./src/Collection.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Collection = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Collection = /** @class */ (function (_super) {\n __extends(Collection, _super);\n function Collection(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._collections = null;\n _this._manifests = null;\n jsonld.__collection = _this;\n return _this;\n }\n Collection.prototype.getCollections = function () {\n if (this._collections) {\n return this._collections;\n }\n return (this._collections = (this.items.filter(function (m) { return m.isCollection(); })));\n };\n Collection.prototype.getManifests = function () {\n if (this._manifests) {\n return this._manifests;\n }\n return (this._manifests = (this.items.filter(function (m) { return m.isManifest(); })));\n };\n Collection.prototype.getCollectionByIndex = function (collectionIndex) {\n var collections = this.getCollections();\n var collection;\n for (var i = 0; i < collections.length; i++) {\n var c = collections[i];\n if (c.index === collectionIndex) {\n collection = c;\n }\n }\n if (collection) {\n collection.options.index = collectionIndex;\n // id for collection MUST be dereferenceable\n return collection.load();\n }\n else {\n throw new Error("Collection index not found");\n }\n };\n Collection.prototype.getManifestByIndex = function (manifestIndex) {\n var manifests = this.getManifests();\n var manifest;\n for (var i = 0; i < manifests.length; i++) {\n var m = manifests[i];\n if (m.index === manifestIndex) {\n manifest = m;\n }\n }\n if (manifest) {\n manifest.options.index = manifestIndex;\n return manifest.load();\n }\n else {\n throw new Error("Manifest index not found");\n }\n };\n Collection.prototype.getTotalCollections = function () {\n return this.getCollections().length;\n };\n Collection.prototype.getTotalManifests = function () {\n return this.getManifests().length;\n };\n Collection.prototype.getTotalItems = function () {\n return this.items.length;\n };\n Collection.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n return dist_commonjs_1.ViewingDirection.LEFT_TO_RIGHT;\n };\n /**\n * Note: this only will return the first behavior as per the manifesto convention\n * IIIF v3 supports multiple behaviors\n */\n Collection.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Collection.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n /**\n * Get a tree of sub collections and manifests, using each child manifest\'s first \'top\' range.\n */\n Collection.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n //console.log("get default tree for ", this.id);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n this._parseManifests(this);\n this._parseCollections(this);\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Collection.prototype._parseManifests = function (parentCollection) {\n if (parentCollection.getManifests() &&\n parentCollection.getManifests().length) {\n for (var i = 0; i < parentCollection.getManifests().length; i++) {\n var manifest = parentCollection.getManifests()[i];\n var tree = manifest.getDefaultTree();\n tree.label =\n manifest.parentLabel ||\n manifest.getLabel().getValue(this.options.locale) ||\n "manifest " + (i + 1);\n tree.navDate = manifest.getNavDate();\n tree.data.id = manifest.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n Collection.prototype._parseCollections = function (parentCollection) {\n //console.log("parse collections for ", parentCollection.id);\n if (parentCollection.getCollections() &&\n parentCollection.getCollections().length) {\n for (var i = 0; i < parentCollection.getCollections().length; i++) {\n var collection = parentCollection.getCollections()[i];\n var tree = collection.getDefaultTree();\n tree.label =\n collection.parentLabel ||\n collection.getLabel().getValue(this.options.locale) ||\n "collection " + (i + 1);\n tree.navDate = collection.getNavDate();\n tree.data.id = collection.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n return Collection;\n}(internal_1.IIIFResource));\nexports.Collection = Collection;\n\n\n//# sourceURL=webpack://manifesto/./src/Collection.ts?')},"./src/Color.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n//import { colorString } from "color-string"\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Color = void 0;\nvar colorString = __webpack_require__(/*! color-string */ "./node_modules/color-string/index.js");\n/**\n * class structure with red, green, blue values in 0-255 range\n * Uses the {@link https://www.npmjs.com/package.color-string | color-string }\n * library for conversion from and to string representations of color.\n**/\nvar Color = /** @class */ (function () {\n /**\n * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red\n **/\n function Color(rgbValue) {\n this.value = rgbValue;\n }\n /**\n * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red\n * @returns Color instance.\n **/\n Color.fromCSS = function (cssTerm) {\n var rv = colorString.get(cssTerm);\n if (rv.model !== \'rgb\')\n throw new Error("unsupported color string: " + cssTerm);\n return new Color([rv.value[0], rv.value[1], rv.value[2]]);\n };\n Object.defineProperty(Color.prototype, "red", {\n /**\n * @return 0 to 255 value of red color component\n **/\n get: function () { return this.value[0]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "green", {\n /**\n * @return 0 to 255 value of green color component\n **/\n get: function () { return this.value[1]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "blue", {\n /**\n * @return 0 to 255 value of blue color component\n **/\n get: function () { return this.value[2]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "CSS", {\n /**\n * @returns hex string (as for CSS ) representation of r,g,b components\n **/\n get: function () { return colorString.to.hex(this.value); },\n enumerable: false,\n configurable: true\n });\n return Color;\n}());\nexports.Color = Color;\n\n\n//# sourceURL=webpack://manifesto/./src/Color.ts?')},"./src/Duration.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Duration = void 0;\nvar Duration = /** @class */ (function () {\n function Duration(start, end) {\n this.start = start;\n this.end = end;\n }\n Duration.prototype.getLength = function () {\n return this.end - this.start;\n };\n return Duration;\n}());\nexports.Duration = Duration;\n\n\n//# sourceURL=webpack://manifesto/./src/Duration.ts?')},"./src/Geometry3d.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.lightRelativeRotation = exports.cameraRelativeRotation = void 0;\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\n// https://ros2jsguy.github.io/threejs-math/index.html\n/**\n* performs the calculation required for the lookAt\n* property of a camera resource. Determines the\n* required angles of two rotations, the first about\n* the x axis and the second about the y axis, which will\n* rotate the default camera direction (0,0,-1) into the\n* direction of the input arguments\n*\n* Result of calculation is returned as a instance of EulerAngle from the\n* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The\n* three-js library uses body-fixed axes to represent EulerAngles, which reverse\n* the ordering of the "relative rotation" algorithm described in the\n* draft 3d api.\n\n* @param direction A vector interpreted as a direction. Client code\n* responsible for not passing a 0-length vector, else a\n\n*\n* @returns threejs-math.EulerAngle instance\n**/\nfunction cameraRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n // projDirection is the direction projected onto the xz plane\n var projDirection = direction.clone().setComponent(1, 0.0);\n var projLength = projDirection.length();\n // handle the edge case, desired viewing direction is either straight up\n // or straight down\n if (projLength == 0.0) {\n if (direction.y > 0.0) {\n // looking straight up fro below\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(+90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n else {\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(-90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n }\n var yAngleRad = Math.atan2(-projDirection.x, -projDirection.z);\n var xAngleRad = Math.atan2(direction.y, projLength);\n return new threejs_math_1.Euler(xAngleRad, yAngleRad, 0.0, "YXZ");\n}\nexports.cameraRelativeRotation = cameraRelativeRotation;\n;\nfunction lightRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n var unit_direction = direction.clone().divideScalar(direction.length());\n // negative y axis is initial direction of DirectionalLight, SpotLight\n // in draft 3D API\n var ny_axis = new threejs_math_1.Vector3(0.0, -1.0, 0.0);\n var quat = new threejs_math_1.Quaternion().setFromUnitVectors(ny_axis, unit_direction);\n var tmp = new threejs_math_1.Euler().setFromQuaternion(quat, "ZXY");\n // standard be setting the final intrinsic Y rotation, which is\n // along desired direction, to 0\n return new threejs_math_1.Euler(tmp.x, 0.0, tmp.z, "ZXY");\n}\nexports.lightRelativeRotation = lightRelativeRotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Geometry3d.ts?')},"./src/IAccessToken.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IAccessToken.ts?')},"./src/IExternalImageResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalImageResourceData.ts?')},"./src/IExternalResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResource.ts?')},"./src/IExternalResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceData.ts?')},"./src/IExternalResourceOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceOptions.ts?')},"./src/IIIFResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.IIIFResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar IIIFResource = /** @class */ (function (_super) {\n __extends(IIIFResource, _super);\n function IIIFResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = -1;\n _this.isLoaded = false;\n var defaultOptions = {\n defaultLabel: "-",\n locale: "en-GB",\n resource: _this,\n pessimisticAccessControl: false\n };\n _this.options = Object.assign(defaultOptions, options);\n return _this;\n }\n /**\n * @deprecated\n */\n IIIFResource.prototype.getAttribution = function () {\n //console.warn(\'getAttribution will be deprecated, use getRequiredStatement instead.\');\n var attribution = this.getProperty("attribution");\n if (attribution) {\n return internal_1.PropertyValue.parse(attribution, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getDescription = function () {\n var description = this.getProperty("description");\n if (description) {\n return internal_1.PropertyValue.parse(description, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getHomepage = function () {\n var homepage = this.getProperty("homepage");\n if (!homepage)\n return null;\n if (typeof homepage == "string")\n return homepage;\n if (Array.isArray(homepage) && homepage.length) {\n homepage = homepage[0];\n }\n return homepage["@id"] || homepage.id;\n };\n IIIFResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n IIIFResource.prototype.getLogo = function () {\n var logo = this.getProperty("logo");\n // Presentation 3.\n // The logo is exclusive to the "provider" property, which is of type "Agent".\n // In order to fulfil `manifest.getLogo()` we should check\n // When P3 is fully supported, the following should work.\n // return this.getProvider()?.getLogo();\n if (!logo) {\n var provider = this.getProperty("provider");\n if (!provider) {\n return null;\n }\n logo = provider.logo;\n }\n if (!logo)\n return null;\n if (typeof logo === "string")\n return logo;\n if (Array.isArray(logo) && logo.length) {\n logo = logo[0];\n }\n return logo["@id"] || logo.id;\n };\n IIIFResource.prototype.getLicense = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("license"), this.options.locale);\n };\n IIIFResource.prototype.getNavDate = function () {\n return new Date(this.getProperty("navDate"));\n };\n IIIFResource.prototype.getRelated = function () {\n return this.getProperty("related");\n };\n IIIFResource.prototype.getSeeAlso = function () {\n return this.getProperty("seeAlso");\n };\n IIIFResource.prototype.getTrackingLabel = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.TRACKING_EXTENSIONS));\n if (service) {\n return service.getProperty("trackingLabel");\n }\n return "";\n };\n IIIFResource.prototype.getDefaultTree = function () {\n this.defaultTree = new internal_1.TreeNode("root");\n this.defaultTree.data = this;\n return this.defaultTree;\n };\n IIIFResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n else {\n // fall back to attribution (if it exists)\n var attribution = this.getAttribution();\n if (attribution) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.value = attribution;\n }\n }\n return requiredStatement;\n };\n IIIFResource.prototype.isCollection = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.isManifest = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.load = function () {\n var that = this;\n return new Promise(function (resolve) {\n if (that.isLoaded) {\n resolve(that);\n }\n else {\n var options_1 = that.options;\n options_1.navDate = that.getNavDate();\n var id = that.__jsonld.id;\n if (!id) {\n id = that.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id).then(function (data) {\n that.parentLabel = that.getLabel().getValue(options_1.locale);\n var parsed = internal_1.Deserialiser.parse(data, options_1);\n that = Object.assign(that, parsed);\n //that.parentCollection = options.resource.parentCollection;\n that.index = options_1.index;\n resolve(that);\n });\n }\n });\n };\n return IIIFResource;\n}(internal_1.ManifestResource));\nexports.IIIFResource = IIIFResource;\n\n\n//# sourceURL=webpack://manifesto/./src/IIIFResource.ts?')},"./src/IManifestoOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IManifestoOptions.ts?')},"./src/JSONLDResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.JSONLDResource = void 0;\nvar JSONLDResource = /** @class */ (function () {\n function JSONLDResource(jsonld) {\n this.__jsonld = jsonld;\n this.context = this.getProperty("context");\n this.id = this.getProperty("id");\n }\n JSONLDResource.prototype.getProperty = function (name) {\n var prop = null;\n if (this.__jsonld) {\n prop = this.__jsonld[name];\n if (!prop) {\n // property may have a prepended \'@\'\n prop = this.__jsonld["@" + name];\n }\n }\n return prop;\n };\n /**\n A function that wraps the getProperty function, which client\n code can use if it is needed to identify when the json value of\n a property is an IRI -- Internationalized Resource Identifier\n \n If the value of the json value is a bare string, then it will be\n wrapped in a json object with the string in the property \'id\',\n additionally that property will have a property \'isIRI\' which will\n be true for the literal string case, otherwise false meaning the\n returned getProperty should be parsed as before.\n \n **/\n JSONLDResource.prototype.getPropertyAsObject = function (name) {\n var prop = this.getProperty(name);\n if (prop === null)\n return prop;\n else if (typeof (prop) === \'string\')\n return { "id": prop,\n "isIRI": true\n };\n else if (prop === Object(prop))\n return prop;\n else {\n throw new Error("cannot resolve prop as object: " + prop);\n }\n };\n return JSONLDResource;\n}());\nexports.JSONLDResource = JSONLDResource;\n\n\n//# sourceURL=webpack://manifesto/./src/JSONLDResource.ts?')},"./src/LabelValuePair.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LabelValuePair = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LabelValuePair = /** @class */ (function () {\n function LabelValuePair(defaultLocale) {\n this.defaultLocale = defaultLocale;\n }\n LabelValuePair.prototype.parse = function (resource) {\n this.resource = resource;\n this.label = internal_1.PropertyValue.parse(this.resource.label, this.defaultLocale);\n this.value = internal_1.PropertyValue.parse(this.resource.value, this.defaultLocale);\n };\n // shortcuts to get/set values based on user or default locale\n LabelValuePair.prototype.getLabel = function (locale) {\n if (this.label === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.label.getValue(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setLabel = function (value) {\n if (this.label === null) {\n this.label = new internal_1.PropertyValue([]);\n }\n this.label.setValue(value, this.defaultLocale);\n };\n LabelValuePair.prototype.getValue = function (locale, joinWith) {\n if (joinWith === void 0) { joinWith = " "; }\n if (this.value === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValue(locale || this.defaultLocale, joinWith);\n };\n LabelValuePair.prototype.getValues = function (locale) {\n if (this.value === null) {\n return [];\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValues(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setValue = function (value) {\n if (this.value === null) {\n this.value = new internal_1.PropertyValue([]);\n }\n this.value.setValue(value, this.defaultLocale);\n };\n return LabelValuePair;\n}());\nexports.LabelValuePair = LabelValuePair;\n\n\n//# sourceURL=webpack://manifesto/./src/LabelValuePair.ts?')},"./src/Language.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/Language.ts?')},"./src/LanguageMap.ts":function(__unused_webpack_module,exports){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LanguageMap = void 0;\n/** @deprecated Use PropertyValue instead */\nvar LanguageMap = /** @class */ (function (_super) {\n __extends(LanguageMap, _super);\n function LanguageMap() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /** @deprecated Use the `PropertyValue#getValue` instance method instead */\n LanguageMap.getValue = function (languageCollection, locale) {\n return languageCollection.getValue(locale, " ");\n };\n /** @deprecated Use the `PropertyValue#getValues` instance method instead */\n LanguageMap.getValues = function (languageCollection, locale) {\n return languageCollection.getValues(locale);\n };\n return LanguageMap;\n}(Array));\nexports.LanguageMap = LanguageMap;\n\n\n//# sourceURL=webpack://manifesto/./src/LanguageMap.ts?')},"./src/Light.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Light = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Light = /** @class */ (function (_super) {\n __extends(Light, _super);\n function Light(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isLight = true;\n _this.isModel = false;\n return _this;\n }\n Object.defineProperty(Light.prototype, "isAmbientLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "ambientlight");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Light.prototype, "isDirectionalLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "directionallight");\n },\n enumerable: false,\n configurable: true\n });\n Light.prototype.getColor = function () {\n var hexColor = this.getProperty("color");\n if (hexColor)\n return internal_1.Color.fromCSS(hexColor);\n else\n return new internal_1.Color([255, 255, 255]); // white light\n };\n /**\n * The implementation of the intensity is based on\n * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md }\n * and the example 3D manifests\n * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights }\n * on 24 Mar 2024. The intensity property in the manifest is an object\n * with declared type \'Value\', a numeric property named \'value\' and a\n * property named unit . This implementation will only work with a unit == \'relative\'\n * and it will be assumed that a relative unit value of 1.0 corresponds to the\n * brightest light source a rendering engine supports.\n *\n * This code will implement a default intensity of 1.0\n **/\n Light.prototype.getIntensity = function () {\n var intObject = this.getProperty("intensity");\n if (intObject) {\n try {\n if (!(intObject.type === "Value" && intObject.unit === "relative"))\n throw new Error();\n return intObject.value;\n }\n catch (err) {\n throw new Error("unable to interpret raw intensity object " + JSON.stringify(intObject));\n }\n }\n else\n return 1.0;\n };\n return Light;\n}(internal_1.AnnotationBody));\nexports.Light = Light;\n\n\n//# sourceURL=webpack://manifesto/./src/Light.ts?')},"./src/Manifest.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Manifest = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n* @remarks Scenes are conveniently retrieved from a Manifest by iterating through\n* Sequence in the Manifest, inner loop the Scenes in each sequence\n* @see {@link Sequence }\n*\n* @example\n* var manifest: Manifest;\n* function doSomethingWithScene(scene:Scene)...\n* ...\n* foreach(var seq:Sequence of manifest.getSequences()\n* foreach(var scene : Scene of seq.getScenes()\n* doSomethingWithScene(scene);\n**/\nvar Manifest = /** @class */ (function (_super) {\n __extends(Manifest, _super);\n function Manifest(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = 0;\n _this._allRanges = null;\n _this.items = [];\n _this._topRanges = [];\n if (_this.__jsonld.structures && _this.__jsonld.structures.length) {\n var topRanges = _this._getTopRanges();\n for (var i = 0; i < topRanges.length; i++) {\n var range = topRanges[i];\n _this._parseRanges(range, String(i));\n }\n }\n // initialization the cached _annotationIdMap to null\n // it will be populated if and only if client calls make a request\n // to the getter annotationIdMap\n _this._annotationIdMap = null;\n return _this;\n }\n /** @deprecated Use getAccompanyingCanvas instead */\n Manifest.prototype.getPosterCanvas = function () {\n var posterCanvas = this.getProperty("posterCanvas");\n if (posterCanvas) {\n posterCanvas = new internal_1.Canvas(posterCanvas, this.options);\n }\n return posterCanvas;\n };\n Manifest.prototype.getAccompanyingCanvas = function () {\n var accompanyingCanvas = this.getProperty("accompanyingCanvas");\n if (accompanyingCanvas) {\n accompanyingCanvas = new internal_1.Canvas(accompanyingCanvas, this.options);\n }\n return accompanyingCanvas;\n };\n Manifest.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Manifest.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n if (!this.isLoaded) {\n return this.defaultTree;\n }\n var topRanges = this.getTopRanges();\n // if there are any ranges in the manifest, default to the first \'top\' range or generated placeholder\n if (topRanges.length) {\n topRanges[0].getTree(this.defaultTree);\n }\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Manifest.prototype._getTopRanges = function () {\n var topRanges = [];\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var json = this.__jsonld.structures[i];\n if (json.viewingHint === dist_commonjs_1.ViewingHint.TOP) {\n topRanges.push(json);\n }\n }\n // if no viewingHint="top" range was found, create a default one\n if (!topRanges.length) {\n var range = {};\n range.ranges = this.__jsonld.structures;\n topRanges.push(range);\n }\n }\n return topRanges;\n };\n Manifest.prototype.getTopRanges = function () {\n return this._topRanges;\n };\n Manifest.prototype._getRangeById = function (id) {\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var r = this.__jsonld.structures[i];\n if (r["@id"] === id || r.id === id) {\n return r;\n }\n }\n }\n return null;\n };\n //private _parseRangeCanvas(json: any, range: Range): void {\n // todo: currently this isn\'t needed\n //var canvas: IJSONLDResource = new JSONLDResource(json);\n //range.items.push(canvas);\n //}\n Manifest.prototype._parseRanges = function (r, path, parentRange) {\n var range;\n var id = null;\n if (typeof r === "string") {\n id = r;\n r = this._getRangeById(id);\n }\n if (!r) {\n console.warn("Range:", id, "does not exist");\n return;\n }\n range = new internal_1.Range(r, this.options);\n range.parentRange = parentRange;\n range.path = path;\n if (!parentRange) {\n this._topRanges.push(range);\n }\n else {\n parentRange.items.push(range);\n }\n var items = r.items || r.members;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n // todo: use an ItemType constant?\n if ((item["@type"] && item["@type"].toLowerCase() === "sc:range") ||\n (item["type"] && item["type"].toLowerCase() === "range")) {\n this._parseRanges(item, path + "/" + i, range);\n }\n else if ((item["@type"] && item["@type"].toLowerCase() === "sc:canvas") ||\n (item["type"] && item["type"].toLowerCase() === "canvas")) {\n // store the ids on the __jsonld object to be used by Range.getCanvasIds()\n if (!range.canvases) {\n range.canvases = [];\n }\n var id_1 = item.id || item["@id"];\n range.canvases.push(id_1);\n }\n }\n }\n else if (r.ranges) {\n for (var i = 0; i < r.ranges.length; i++) {\n this._parseRanges(r.ranges[i], path + "/" + i, range);\n }\n }\n };\n Manifest.prototype.getAllRanges = function () {\n if (this._allRanges != null)\n return this._allRanges;\n this._allRanges = [];\n var topRanges = this.getTopRanges();\n var _loop_1 = function (i) {\n var topRange = topRanges[i];\n if (topRange.id) {\n this_1._allRanges.push(topRange); // it might be a placeholder root range\n }\n var reducer = function (acc, next) {\n acc.add(next);\n var nextRanges = next.getRanges();\n if (nextRanges.length) {\n return nextRanges.reduce(reducer, acc);\n }\n return acc;\n };\n var subRanges = Array.from(topRange.getRanges().reduce(reducer, new Set()));\n this_1._allRanges = this_1._allRanges.concat(subRanges);\n };\n var this_1 = this;\n for (var i = 0; i < topRanges.length; i++) {\n _loop_1(i);\n }\n return this._allRanges;\n };\n Manifest.prototype.getRangeById = function (id) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.id === id) {\n return range;\n }\n }\n return null;\n };\n Manifest.prototype.getRangeByPath = function (path) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.path === path) {\n return range;\n }\n }\n return null;\n };\n /**\n * @returns Array of Sequence instances\n **/\n Manifest.prototype.getSequences = function () {\n if (this.items.length) {\n return this.items;\n }\n // IxIF mediaSequences overrode sequences, so need to be checked first.\n // deprecate this when presentation 3 ships\n var items = this.__jsonld.mediaSequences || this.__jsonld.sequences;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var s = items[i];\n var sequence = new internal_1.Sequence(s, this.options);\n this.items.push(sequence);\n }\n }\n else if (this.__jsonld.items) {\n var sequence = new internal_1.Sequence(this.__jsonld.items, this.options);\n this.items.push(sequence);\n }\n return this.items;\n };\n Manifest.prototype.getSequenceByIndex = function (sequenceIndex) {\n return this.getSequences()[sequenceIndex];\n };\n Manifest.prototype.getTotalSequences = function () {\n return this.getSequences().length;\n };\n Manifest.prototype.getManifestType = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.UI_EXTENSIONS));\n if (service) {\n return service.getProperty("manifestType");\n }\n return internal_1.ManifestType.EMPTY;\n };\n Manifest.prototype.isMultiSequence = function () {\n return this.getTotalSequences() > 1;\n };\n Manifest.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n var behavior = this.getBehavior();\n if (behavior) {\n return behavior === dist_commonjs_1.Behavior.PAGED;\n }\n return false;\n };\n Manifest.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Manifest.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Manifest.prototype, "annotationIdMap", {\n /**\n * Developer Note: The concept of the "id map" appear in the\n * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map\n * This functionality may be available as well in the \'nodeMap\' code of the\n * digitalbazaar/jsonld library\n *\n * this very simplified version just returns a mao of id -> Annotation nodes\n * in manifest\n *\n * THe annotationIdMap is a Javascript object whose property names are\n * IRI (id values) and property values are instances of the Annotation class\n **/\n get: function () {\n if (this._annotationIdMap == null) {\n this._annotationIdMap = {};\n for (var _i = 0, _a = this.getSequences(); _i < _a.length; _i++) {\n var seq = _a[_i];\n for (var _b = 0, _c = seq.getScenes(); _b < _c.length; _b++) {\n var scene = _c[_b];\n for (var _d = 0, _e = scene.getContent(); _d < _e.length; _d++) {\n var anno = _e[_d];\n this._annotationIdMap[anno.id] = anno;\n }\n }\n }\n }\n return this._annotationIdMap;\n },\n enumerable: false,\n configurable: true\n });\n return Manifest;\n}(internal_1.IIIFResource));\nexports.Manifest = Manifest;\n\n\n//# sourceURL=webpack://manifesto/./src/Manifest.ts?')},"./src/ManifestResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar ManifestResource = /** @class */ (function (_super) {\n __extends(ManifestResource, _super);\n function ManifestResource(jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.options = options;\n return _this;\n }\n ManifestResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n ManifestResource.prototype.getLabel = function () {\n var label = this.getProperty("label");\n if (label) {\n return internal_1.PropertyValue.parse(label, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n ManifestResource.prototype.getDefaultLabel = function () {\n return this.getLabel().getValue(this.options.locale);\n };\n ManifestResource.prototype.getMetadata = function () {\n var _metadata = this.getProperty("metadata");\n var metadata = [];\n if (!_metadata)\n return metadata;\n for (var i = 0; i < _metadata.length; i++) {\n var item = _metadata[i];\n var metadataItem = new internal_1.LabelValuePair(this.options.locale);\n metadataItem.parse(item);\n metadata.push(metadataItem);\n }\n return metadata;\n };\n ManifestResource.prototype.getRendering = function (format) {\n var renderings = this.getRenderings();\n for (var i = 0; i < renderings.length; i++) {\n var rendering = renderings[i];\n if (rendering.getFormat() === format) {\n return rendering;\n }\n }\n return null;\n };\n ManifestResource.prototype.getRenderings = function () {\n var rendering;\n // if passing a manifesto-parsed object, use the __jsonld.rendering property,\n // otherwise look for a rendering property\n if (this.__jsonld) {\n rendering = this.__jsonld.rendering;\n }\n else {\n rendering = this.rendering;\n }\n var renderings = [];\n if (!rendering)\n return renderings;\n // coerce to array\n if (!Array.isArray(rendering)) {\n rendering = [rendering];\n }\n for (var i = 0; i < rendering.length; i++) {\n var r = rendering[i];\n renderings.push(new internal_1.Rendering(r, this.options));\n }\n return renderings;\n };\n ManifestResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n return requiredStatement;\n };\n ManifestResource.prototype.getService = function (profile) {\n return internal_1.Utils.getService(this, profile);\n };\n ManifestResource.prototype.getServices = function () {\n return internal_1.Utils.getServices(this);\n };\n ManifestResource.prototype.getThumbnail = function () {\n var thumbnail = this.getProperty("thumbnail");\n if (Array.isArray(thumbnail)) {\n thumbnail = thumbnail[0];\n }\n if (thumbnail) {\n return new internal_1.Thumbnail(thumbnail, this.options);\n }\n return null;\n };\n ManifestResource.prototype.isAnnotation = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.ANNOTATION;\n };\n ManifestResource.prototype.isCanvas = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.CANVAS;\n };\n ManifestResource.prototype.isCollection = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION;\n };\n ManifestResource.prototype.isManifest = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST;\n };\n ManifestResource.prototype.isRange = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.RANGE;\n };\n // this different implementation is necessary until such time as the \n // SCENE is added to the @iiif/vocabulary package.\n ManifestResource.prototype.isScene = function () {\n return this.getIIIFResourceType() === internal_1.Utils.normaliseType(\'Scene\');\n };\n ManifestResource.prototype.isSequence = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.SEQUENCE;\n };\n return ManifestResource;\n}(internal_1.JSONLDResource));\nexports.ManifestResource = ManifestResource;\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestResource.ts?')},"./src/ManifestType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestType = void 0;\nvar ManifestType;\n(function (ManifestType) {\n ManifestType["EMPTY"] = "";\n ManifestType["MANUSCRIPT"] = "manuscript";\n ManifestType["MONOGRAPH"] = "monograph";\n})(ManifestType || (exports.ManifestType = ManifestType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestType.ts?')},"./src/PointSelector.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PointSelector = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar PointSelector = /** @class */ (function (_super) {\n __extends(PointSelector, _super);\n function PointSelector(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isPointSelector = true;\n return _this;\n }\n PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\n };\n return PointSelector;\n}(internal_1.JSONLDResource));\nexports.PointSelector = PointSelector;\n\n\n//# sourceURL=webpack://manifesto/./src/PointSelector.ts?')},"./src/PropertyValue.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PropertyValue = exports.LocalizedValue = void 0;\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/** Utility class to hold one or more values with their associated (optional) locale */\nvar LocalizedValue = /** @class */ (function () {\n function LocalizedValue(value, locale, defaultLocale) {\n if (defaultLocale === void 0) { defaultLocale = "none"; }\n if (Array.isArray(value) && value.length === 1) {\n this._value = value[0];\n }\n else {\n this._value = value;\n }\n if (locale === "none" || locale === "@none") {\n locale = undefined;\n }\n this._locale = locale;\n this._defaultLocale = defaultLocale;\n }\n /** Parse a localized value from a IIIF v2 property value\n *\n * @param {string | string[] | object | object[]} rawVal value from IIIF resource\n * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value\n */\n LocalizedValue.parseV2Value = function (rawVal, defaultLocale) {\n if (typeof rawVal === "string") {\n return new LocalizedValue(rawVal, undefined, defaultLocale);\n }\n else if (rawVal["@value"]) {\n return new LocalizedValue(rawVal["@value"], rawVal["@language"], defaultLocale);\n }\n return null;\n };\n Object.defineProperty(LocalizedValue.prototype, "value", {\n /*** @deprecated Use PropertyValue#getValue instead */\n get: function () {\n if (Array.isArray(this._value)) {\n return this._value.join(" ");\n }\n return this._value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizedValue.prototype, "locale", {\n /*** @deprecated Don\'t use, only used for backwards compatibility reasons */\n get: function () {\n if (this._locale === undefined) {\n return this._defaultLocale;\n }\n return this._locale;\n },\n enumerable: false,\n configurable: true\n });\n LocalizedValue.prototype.addValue = function (value) {\n if (!Array.isArray(this._value)) {\n this._value = [this._value];\n }\n if (Array.isArray(value)) {\n this._value = this._value.concat(value);\n }\n else {\n this._value.push(value);\n }\n };\n return LocalizedValue;\n}());\nexports.LocalizedValue = LocalizedValue;\n/***\n * Holds a collection of values and their (optional) languages and allows\n * language-based value retrieval as per the algorithm described in\n * https://iiif.io/api/presentation/2.1/#language-of-property-values\n */\nvar PropertyValue = /** @class */ (function (_super) {\n __extends(PropertyValue, _super);\n function PropertyValue(values, defaultLocale) {\n if (values === void 0) { values = []; }\n var _this = _super.apply(this, values) || this;\n // Needed for ES5 compatibility, see https://stackoverflow.com/a/40967939\n _this.__proto__ = PropertyValue.prototype;\n _this._defaultLocale = defaultLocale;\n return _this;\n }\n PropertyValue.parse = function (rawVal, defaultLocale) {\n if (!rawVal) {\n return new PropertyValue([], defaultLocale);\n }\n if (Array.isArray(rawVal)) {\n // Collection of IIIF v2 property values\n var parsed = rawVal\n .map(function (v) { return LocalizedValue.parseV2Value(v, defaultLocale); })\n .filter(function (v) { return v !== null; });\n var byLocale = parsed.reduce(function (acc, lv) {\n var loc = lv._locale;\n if (!loc) {\n // Cannot use undefined as an object key\n loc = "none";\n }\n if (acc[loc]) {\n acc[loc].addValue(lv._value);\n }\n else {\n acc[loc] = lv;\n }\n return acc;\n }, {});\n return new PropertyValue(Object.values(byLocale), defaultLocale);\n }\n else if (typeof rawVal === "string") {\n return new PropertyValue([new LocalizedValue(rawVal, undefined, defaultLocale)], defaultLocale);\n }\n else if (rawVal["@language"]) {\n // Single IIIF v2 property value\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else if (rawVal["@value"]) {\n // Single IIIF v2 property value without language\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else {\n // IIIF v3 property value\n return new PropertyValue(Object.keys(rawVal).map(function (locale) {\n var val = rawVal[locale];\n if (!Array.isArray(val)) {\n throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");\n }\n return new LocalizedValue(val, locale, defaultLocale);\n }), defaultLocale);\n }\n };\n /*** Try to find the available locale that best fit\'s the user\'s preferences. */\n PropertyValue.prototype.getSuitableLocale = function (locales) {\n // If any of the values have a language associated with them, the client\n // must display all of the values associated with the language that best\n // matches the language preference.\n if (locales.length == 0 && this._defaultLocale)\n locales.push(this._defaultLocale);\n // create an array of the language codes for all different LocalizedValue instances in this PropertyValue\n var allLocales = new Array();\n for (var _i = 0, _a = this; _i < _a.length; _i++) {\n var lv = _a[_i];\n if (lv._locale != undefined)\n allLocales.push(lv._locale);\n }\n var _loop_1 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return l === userLocale; });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // First, look for a precise match\n for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) {\n var userLocale = locales_1[_b];\n var state_1 = _loop_1(userLocale);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n var _loop_2 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return Utils_1.Utils.getInexactLocale(l) === Utils_1.Utils.getInexactLocale(userLocale); });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // Look for an inexact match\n for (var _c = 0, locales_2 = locales; _c < locales_2.length; _c++) {\n var userLocale = locales_2[_c];\n var state_2 = _loop_2(userLocale);\n if (typeof state_2 === "object")\n return state_2.value;\n }\n return undefined;\n };\n /**\n * Set the value(s) for a given locale.\n *\n * If there\'s an existing locale that matches the given locale, it will be updated.\n *\n * @param locale Locale to set the value for\n * @param value value to set\n */\n PropertyValue.prototype.setValue = function (value, locale) {\n var existing = undefined;\n if (!locale) {\n existing = this.find(function (lv) { return lv._locale === undefined; });\n }\n else {\n var bestLocale_1 = this.getSuitableLocale([locale]);\n if (bestLocale_1) {\n existing = this.find(function (lv) { return lv._locale === bestLocale_1; });\n }\n }\n if (existing) {\n // Mutate existing localized value\n existing._value = value;\n }\n else {\n // Create a new localized value\n this.push(new LocalizedValue(value, locale, this._defaultLocale));\n }\n };\n /**\n * Get a value in the most suitable locale.\n *\n * @param {string | string[] | undefined} locales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @param {string | undefined} joinWith String to join multiple available values by,\n * if undefined only the first available value will be returned\n * @returns the first value in the most suitable locale or null if none could be found\n */\n PropertyValue.prototype.getValue = function (locales, joinWith) {\n var vals = this.getValues(locales);\n if (vals.length === 0) {\n return null;\n }\n if (joinWith) {\n return vals.join(joinWith);\n }\n return vals[0];\n };\n /**\n * Get all values available in the most suitable locale.\n *\n * @param {string | string[]} userLocales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @returns the values for the most suitable locale, empty if none could be found\n */\n PropertyValue.prototype.getValues = function (userLocales) {\n if (!this.length) {\n return [];\n }\n var locales;\n if (!userLocales) {\n locales = [];\n }\n else if (!Array.isArray(userLocales)) {\n locales = [userLocales];\n }\n else {\n locales = userLocales;\n }\n // If none of the values have a language associated with them, the client\n // must display all of the values.\n if (this.length === 1 && this[0]._locale === undefined) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // Try to determine the available locale that best fits the user\'s preferences\n var matchingLocale = this.getSuitableLocale(locales);\n if (matchingLocale) {\n var val = this.find(function (lv) { return lv._locale === matchingLocale; })._value;\n return Array.isArray(val) ? val : [val];\n }\n // If all of the values have a language associated with them, and none match\n // the language preference, the client must select a language and display\n // all of the values associated with that language.\n var allHaveLang = !this.find(function (lv) { return lv._locale === undefined; });\n if (allHaveLang) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // If some of the values have a language associated with them, but none\n // match the language preference, the client must display all of the values\n // that do not have a language associated with them.\n var lv = this.find(function (lv) { return lv._locale === undefined; });\n if (lv) {\n return Array.isArray(lv._value) ? lv._value : [lv._value];\n }\n return [];\n };\n return PropertyValue;\n}(Array));\nexports.PropertyValue = PropertyValue;\n\n\n//# sourceURL=webpack://manifesto/./src/PropertyValue.ts?')},"./src/Range.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Range = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar Range = /** @class */ (function (_super) {\n __extends(Range, _super);\n function Range(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this._ranges = null;\n _this.canvases = null;\n _this.items = [];\n return _this;\n }\n Range.prototype.getCanvasIds = function () {\n if (this.__jsonld.canvases) {\n return this.__jsonld.canvases;\n }\n else if (this.canvases) {\n return this.canvases;\n }\n return [];\n };\n Range.prototype.getDuration = function () {\n // For this implementation, we want to catch SOME of the temporal cases - i.e. when there is a t=1,100\n if (this.canvases && this.canvases.length) {\n var startTimes = [];\n var endTimes = [];\n // When we loop through all of the canvases we store the recorded start and end times.\n // Then we choose the maximum and minimum values from this. This will give us a more accurate duration for the\n // Chosen range. However this is still not perfect and does not cover more complex ranges. These cases are out of\n // scope for this change.\n for (var _i = 0, _a = this.canvases; _i < _a.length; _i++) {\n var canvas = _a[_i];\n if (!canvas)\n continue;\n var _b = (canvas.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [undefined, canvas]), canvasId = _b[1], start_1 = _b[2], end_1 = _b[3];\n if (canvasId) {\n startTimes.push(parseFloat(start_1));\n endTimes.push(parseFloat(end_1));\n }\n }\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n else {\n // get child ranges and calculate the start and end based on them\n var childRanges = this.getRanges();\n var startTimes = [];\n var endTimes = [];\n // Once again, we use a max/min to get the ranges.\n for (var _c = 0, childRanges_1 = childRanges; _c < childRanges_1.length; _c++) {\n var childRange = childRanges_1[_c];\n var duration = childRange.getDuration();\n if (duration) {\n startTimes.push(duration.start);\n endTimes.push(duration.end);\n }\n }\n // And return the minimum as the start, and the maximum as the end.\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n var start;\n var end;\n // There are 2 paths for this implementation. Either we have a list of canvases, or a list of ranges\n // which may have a list of ranges.\n // This is one of the limitations of this implementation.\n if (this.canvases && this.canvases.length) {\n // When we loop through each of the canvases we are expecting to see a fragment or a link to the whole canvas.\n // For example - if we have http://example.org/canvas#t=1,100 it will extract 1 and 100 as the start and end.\n for (var i = 0; i < this.canvases.length; i++) {\n var canvas = this.canvases[i];\n var temporal = internal_1.Utils.getTemporalComponent(canvas);\n if (temporal && temporal.length > 1) {\n if (i === 0) {\n // Note: Cannot guarantee ranges are sequential (fixed above)\n start = Number(temporal[0]);\n }\n if (i === this.canvases.length - 1) {\n end = Number(temporal[1]); // Note: The end of this duration may be targeting a different canvas.\n }\n }\n }\n }\n else {\n // In this second case, where there are nested ranges, we recursively get the duration\n // from each of the child ranges (a start and end) and then choose the first and last for the bounds of this range.\n var childRanges = this.getRanges();\n for (var i = 0; i < childRanges.length; i++) {\n var childRange = childRanges[i];\n var duration = childRange.getDuration();\n if (duration) {\n if (i === 0) {\n start = duration.start;\n }\n if (i === childRanges.length - 1) {\n end = duration.end;\n }\n }\n }\n }\n if (start !== undefined && end !== undefined) {\n return new internal_1.Duration(start, end);\n }\n return undefined;\n };\n // getCanvases(): ICanvas[] {\n // if (this._canvases) {\n // return this._canvases;\n // }\n // return this._canvases = this.items.en().where(m => m.isCanvas()).toArray();\n // }\n Range.prototype.getRanges = function () {\n if (this._ranges) {\n return this._ranges;\n }\n return (this._ranges = this.items.filter(function (m) { return m.isRange(); }));\n };\n Range.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Range.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Range.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Range.prototype.getTree = function (treeRoot) {\n treeRoot.data = this;\n this.treeNode = treeRoot;\n var ranges = this.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var node = new internal_1.TreeNode();\n treeRoot.addNode(node);\n this._parseTreeNode(node, range);\n }\n }\n internal_1.Utils.generateTreeNodeIds(treeRoot);\n return treeRoot;\n };\n Range.prototype.spansTime = function (time) {\n var duration = this.getDuration();\n if (duration) {\n if (time >= duration.start && time <= duration.end) {\n return true;\n }\n }\n return false;\n };\n Range.prototype._parseTreeNode = function (node, range) {\n node.label = range.getLabel().getValue(this.options.locale);\n node.data = range;\n node.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n range.treeNode = node;\n var ranges = range.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var childRange = ranges[i];\n var behavior = childRange.getBehavior();\n if (behavior === dist_commonjs_1.Behavior.NO_NAV) {\n continue;\n }\n else {\n var childNode = new internal_1.TreeNode();\n node.addNode(childNode);\n this._parseTreeNode(childNode, childRange);\n }\n }\n }\n };\n return Range;\n}(internal_1.ManifestResource));\nexports.Range = Range;\n\n\n//# sourceURL=webpack://manifesto/./src/Range.ts?')},"./src/Rendering.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Rendering = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Rendering = /** @class */ (function (_super) {\n __extends(Rendering, _super);\n function Rendering(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Rendering.prototype.getFormat = function () {\n return this.getProperty("format");\n };\n return Rendering;\n}(internal_1.ManifestResource));\nexports.Rendering = Rendering;\n\n\n//# sourceURL=webpack://manifesto/./src/Rendering.ts?')},"./src/Resource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Resource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Resource = /** @class */ (function (_super) {\n __extends(Resource, _super);\n function Resource(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Resource.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return format.toLowerCase();\n }\n return null;\n };\n Resource.prototype.getResources = function () {\n var resources = [];\n if (!this.__jsonld.resources)\n return resources;\n for (var i = 0; i < this.__jsonld.resources.length; i++) {\n var a = this.__jsonld.resources[i];\n var annotation = new internal_1.Annotation(a, this.options);\n resources.push(annotation);\n }\n return resources;\n };\n Resource.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return internal_1.Utils.normaliseType(type);\n }\n return null;\n };\n Resource.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Resource.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Resource.prototype.getMaxWidth = function () {\n return this.getProperty("maxWidth");\n };\n Resource.prototype.getMaxHeight = function () {\n var maxHeight = this.getProperty("maxHeight");\n // if a maxHeight hasn\'t been specified, default to maxWidth.\n // maxWidth in essence becomes maxEdge\n if (!maxHeight) {\n return this.getMaxWidth();\n }\n return null;\n };\n return Resource;\n}(internal_1.ManifestResource));\nexports.Resource = Resource;\n\n\n//# sourceURL=webpack://manifesto/./src/Resource.ts?')},"./src/RotateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.RotateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar RotateTransform = /** @class */ (function (_super) {\n __extends(RotateTransform, _super);\n function RotateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isRotateTransform = true;\n return _this;\n }\n RotateTransform.prototype.getRotation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return RotateTransform;\n}(internal_1.Transform));\nexports.RotateTransform = RotateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/RotateTransform.ts?')},"./src/ScaleTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ScaleTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar ScaleTransform = /** @class */ (function (_super) {\n __extends(ScaleTransform, _super);\n function ScaleTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isScaleTransform = true;\n return _this;\n }\n ScaleTransform.prototype.getScale = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n // note that default scaling is 1.0\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 1.0;\n }\n return retVal;\n };\n return ScaleTransform;\n}(internal_1.Transform));\nexports.ScaleTransform = ScaleTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/ScaleTransform.ts?')},"./src/Scene.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Scene = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Scene = /** @class */ (function (_super) {\n __extends(Scene, _super);\n function Scene(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // Presentation API 3.0\n Scene.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n ;\n return content;\n };\n ;\n Object.defineProperty(Scene.prototype, "Content", {\n // 3D extension\n get: function () { return this.getContent(); },\n enumerable: false,\n configurable: true\n });\n Scene.prototype.getAnnotationById = function (searchId) {\n for (var _i = 0, _a = this.Content; _i < _a.length; _i++) {\n var anno = _a[_i];\n if (anno.id === searchId)\n return anno;\n }\n return null;\n };\n Scene.prototype.getBackgroundColor = function () {\n // regular expression intended to match strings like\n // "#FF00FF" -- interpreted as three hexadecimal values\n // in range 0-255 . Not that the \\w escape matches digits,\n // upper and lower case latin characters, and underscore\n // currently only supports the form for CSS\n // https://www.w3.org/wiki/CSS/Properties/color/RGB\n // with 6 hexadecimal digits\n var bgc = this.getProperty("backgroundColor");\n if (bgc)\n return internal_1.Color.fromCSS(bgc);\n else\n return null;\n };\n ;\n return Scene;\n}(internal_1.ManifestResource));\nexports.Scene = Scene;\n\n\n//# sourceURL=webpack://manifesto/./src/Scene.ts?')},"./src/Sequence.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Sequence = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Sequence = /** @class */ (function (_super) {\n __extends(Sequence, _super);\n function Sequence(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._thumbnails = null;\n return _this;\n }\n Sequence.prototype.getCanvases = function () {\n if (this.items.length) {\n return this.items;\n }\n var items = this.__jsonld.canvases || this.__jsonld.elements;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var c = items[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n else if (this.__jsonld) {\n for (var i = 0; i < this.__jsonld.length; i++) {\n var c = this.__jsonld[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n return this.items;\n };\n Sequence.prototype.getCanvasById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // normalise canvas id\n var canvasId = internal_1.Utils.normaliseUrl(canvas.id);\n if (internal_1.Utils.normaliseUrl(id) === canvasId) {\n return canvas;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasByIndex = function (canvasIndex) {\n return this.getCanvases()[canvasIndex];\n };\n Sequence.prototype.getCanvasIndexById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === id) {\n return i;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasIndexByLabel = function (label, foliated) {\n label = label.trim();\n if (!isNaN(label)) {\n // if the label is numeric\n label = parseInt(label, 10).toString(); // trim any preceding zeros.\n if (foliated)\n label += "r"; // default to recto\n }\n var doublePageRegExp = /(\\d*)\\D+(\\d*)/;\n var match, regExp, regStr, labelPart1, labelPart2;\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // check if there\'s a literal match\n if (canvas.getLabel().getValue(this.options.locale) === label) {\n return i;\n }\n // check if there\'s a match for double-page spreads e.g. 100-101, 100_101, 100 101\n match = doublePageRegExp.exec(label);\n if (!match)\n continue;\n labelPart1 = match[1];\n labelPart2 = match[2];\n if (!labelPart2)\n continue;\n regStr = "^" + labelPart1 + "\\\\D+" + labelPart2 + "$";\n regExp = new RegExp(regStr);\n if (regExp.test(canvas.getLabel().toString())) {\n return i;\n }\n }\n return -1;\n };\n Sequence.prototype.getLastCanvasLabel = function (alphanumeric) {\n for (var i = this.getTotalCanvases() - 1; i >= 0; i--) {\n var canvas = this.getCanvasByIndex(i);\n var label = (canvas.getLabel().getValue(this.options.locale));\n if (alphanumeric) {\n var regExp = /^[a-zA-Z0-9]*$/;\n if (regExp.test(label)) {\n return label;\n }\n }\n else if (label) {\n return label;\n }\n }\n return this.options.defaultLabel;\n };\n Sequence.prototype.getLastPageIndex = function () {\n return this.getTotalCanvases() - 1;\n };\n Sequence.prototype.getNextPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[0] + 1;\n }\n else {\n index = indices[indices.length - 1] + 1;\n }\n }\n else {\n index = canvasIndex + 1;\n }\n if (index > this.getLastPageIndex()) {\n return -1;\n }\n return index;\n };\n Sequence.prototype.getPagedIndices = function (canvasIndex, pagingEnabled) {\n var indices = [];\n if (!pagingEnabled) {\n indices.push(canvasIndex);\n }\n else {\n if (this.isFirstCanvas(canvasIndex) || this.isLastCanvas(canvasIndex)) {\n indices = [canvasIndex];\n }\n else if (canvasIndex % 2) {\n indices = [canvasIndex, canvasIndex + 1];\n }\n else {\n indices = [canvasIndex - 1, canvasIndex];\n }\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n indices = indices.reverse();\n }\n }\n return indices;\n };\n Sequence.prototype.getPrevPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[indices.length - 1] - 1;\n }\n else {\n index = indices[0] - 1;\n }\n }\n else {\n index = canvasIndex - 1;\n }\n return index;\n };\n /**\n * @returns Array of Scene instances in the Sequence\n **/\n Sequence.prototype.getScenes = function () {\n var returnVal = [];\n var low_items = this.__jsonld.elements || this.__jsonld;\n if (low_items) {\n for (var i = 0; i < low_items.length; ++i) {\n var c = low_items[i];\n if (c.type === \'Scene\') {\n var scene = new internal_1.Scene(c, this.options);\n //scene.index = i;\n returnVal.push(scene);\n }\n }\n }\n return returnVal;\n };\n Sequence.prototype.getStartCanvasIndex = function () {\n var startCanvas = this.getStartCanvas();\n if (startCanvas) {\n // if there\'s a startCanvas attribute, loop through the canvases and return the matching index.\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === startCanvas)\n return i;\n }\n }\n // default to first canvas.\n return 0;\n };\n // todo: deprecate\n Sequence.prototype.getThumbs = function (width, height) {\n //console.warn(\'getThumbs will be deprecated, use getThumbnails instead\');\n var thumbs = [];\n var totalCanvases = this.getTotalCanvases();\n for (var i = 0; i < totalCanvases; i++) {\n var canvas = this.getCanvasByIndex(i);\n var thumb = new internal_1.Thumb(width, canvas);\n thumbs.push(thumb);\n }\n return thumbs;\n };\n Sequence.prototype.getThumbnails = function () {\n if (this._thumbnails != null)\n return this._thumbnails;\n this._thumbnails = [];\n var canvases = this.getCanvases();\n for (var i = 0; i < canvases.length; i++) {\n var thumbnail = canvases[i].getThumbnail();\n if (thumbnail) {\n this._thumbnails.push(thumbnail);\n }\n }\n return this._thumbnails;\n };\n Sequence.prototype.getStartCanvas = function () {\n return this.getProperty("startCanvas");\n };\n Sequence.prototype.getTotalCanvases = function () {\n return this.getCanvases().length;\n };\n Sequence.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n else if (this.options.resource.getViewingDirection) {\n return this.options.resource.getViewingDirection();\n }\n return null;\n };\n Sequence.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Sequence.prototype.isCanvasIndexOutOfRange = function (canvasIndex) {\n return canvasIndex > this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isFirstCanvas = function (canvasIndex) {\n return canvasIndex === 0;\n };\n Sequence.prototype.isLastCanvas = function (canvasIndex) {\n return canvasIndex === this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isMultiCanvas = function () {\n return this.getTotalCanvases() > 1;\n };\n Sequence.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n return false;\n };\n // checks if the number of canvases is even - therefore has a front and back cover\n Sequence.prototype.isTotalCanvasesEven = function () {\n return this.getTotalCanvases() % 2 === 0;\n };\n return Sequence;\n}(internal_1.ManifestResource));\nexports.Sequence = Sequence;\n\n\n//# sourceURL=webpack://manifesto/./src/Sequence.ts?')},"./src/Serialisation.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Deserialiser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Deserialiser = /** @class */ (function () {\n function Deserialiser() {\n }\n Deserialiser.parse = function (manifest, options) {\n if (typeof manifest === "string") {\n manifest = JSON.parse(manifest);\n }\n return this.parseJson(manifest, options);\n };\n Deserialiser.parseJson = function (json, options) {\n var resource;\n // have options been passed for the manifest to inherit?\n if (options) {\n if (options.navDate && !isNaN(options.navDate.getTime())) {\n json.navDate = options.navDate.toString();\n }\n }\n if (json["@type"]) {\n switch (json["@type"]) {\n case "sc:Collection":\n resource = this.parseCollection(json, options);\n break;\n case "sc:Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n else {\n // presentation 3\n switch (json["type"]) {\n case "Collection":\n resource = this.parseCollection(json, options);\n break;\n case "Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n // Top-level resource was loaded from a URI, so flag it to prevent\n // unnecessary reload:\n resource.isLoaded = true;\n return resource;\n };\n Deserialiser.parseCollection = function (json, options) {\n var collection = new internal_1.Collection(json, options);\n if (options) {\n collection.index = options.index || 0;\n if (options.resource) {\n collection.parentCollection = options.resource.parentCollection;\n }\n }\n else {\n collection.index = 0;\n }\n this.parseCollections(collection, options);\n this.parseManifests(collection, options);\n this.parseItems(collection, options);\n return collection;\n };\n Deserialiser.parseCollections = function (collection, options) {\n var items;\n if (collection.__jsonld.collections) {\n items = collection.__jsonld.collections;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "collection"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (options) {\n options.index = i;\n }\n var item = this.parseCollection(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseManifest = function (json, options) {\n var manifest = new internal_1.Manifest(json, options);\n return manifest;\n };\n Deserialiser.parseManifests = function (collection, options) {\n var items;\n if (collection.__jsonld.manifests) {\n items = collection.__jsonld.manifests;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "manifest"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = this.parseManifest(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseItem = function (json, options) {\n if (json["@type"]) {\n if (json["@type"].toLowerCase() === "sc:manifest") {\n return this.parseManifest(json, options);\n }\n else if (json["@type"].toLowerCase() === "sc:collection") {\n return this.parseCollection(json, options);\n }\n }\n else if (json.type) {\n if (json.type.toLowerCase() === "manifest") {\n return this.parseManifest(json, options);\n }\n else if (json.type.toLowerCase() === "collection") {\n return this.parseCollection(json, options);\n }\n }\n return null;\n };\n Deserialiser.parseItems = function (collection, options) {\n var items = collection.__jsonld.members || collection.__jsonld.items;\n if (items) {\n var _loop_1 = function (i) {\n if (options) {\n options.index = i;\n }\n var item = this_1.parseItem(items[i], options);\n if (!item)\n return { value: void 0 };\n // only add to items if not already parsed from backwards-compatible collections/manifests arrays\n if (collection.items.filter(function (m) { return m.id === item.id; })[0]) {\n return "continue";\n }\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n };\n var this_1 = this;\n for (var i = 0; i < items.length; i++) {\n var state_1 = _loop_1(i);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n }\n };\n return Deserialiser;\n}());\nexports.Deserialiser = Deserialiser;\n\n\n//# sourceURL=webpack://manifesto/./src/Serialisation.ts?')},"./src/Service.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Service = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Service = /** @class */ (function (_super) {\n __extends(Service, _super);\n function Service(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Service.prototype.getProfile = function () {\n var profile = this.getProperty("profile");\n if (!profile) {\n profile = this.getProperty("dcterms:conformsTo");\n }\n if (Array.isArray(profile)) {\n return profile[0];\n }\n return profile;\n };\n Service.prototype.getConfirmLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale);\n };\n Service.prototype.getDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("description"), this.options.locale);\n };\n Service.prototype.getFailureDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale);\n };\n Service.prototype.getFailureHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale);\n };\n Service.prototype.getHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("header"), this.options.locale);\n };\n Service.prototype.getServiceLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("label"), this.options.locale);\n };\n Service.prototype.getInfoUri = function () {\n var infoUri = this.id;\n if (!infoUri.endsWith("/")) {\n infoUri += "/";\n }\n infoUri += "info.json";\n return infoUri;\n };\n return Service;\n}(internal_1.ManifestResource));\nexports.Service = Service;\n\n\n//# sourceURL=webpack://manifesto/./src/Service.ts?')},"./src/Size.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Size = void 0;\nvar Size = /** @class */ (function () {\n function Size(width, height) {\n this.width = width;\n this.height = height;\n }\n return Size;\n}());\nexports.Size = Size;\n\n\n//# sourceURL=webpack://manifesto/./src/Size.ts?')},"./src/SpecificResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.SpecificResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n Developer note: This implementation does not strictly adhere\n to the description of SpecificResource in the Web Annotation Model\n document https://www.w3.org/TR/annotation-model/\n section 4 : https://www.w3.org/TR/annotation-model/#specific-resources\n \n The getTransform() method returning an Array of 3D Transfom resources, is\n an extension of SpecificResource beyond the web annotation model.\n*/\nvar SpecificResource = /** @class */ (function (_super) {\n __extends(SpecificResource, _super);\n function SpecificResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = false;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = true;\n _this.isSpecificResource = true;\n return _this;\n }\n ;\n SpecificResource.prototype.getSource = function () {\n var raw = this.getPropertyAsObject("source");\n if (raw.isIRI)\n return raw;\n /*\n this logic gets a little convoluted, because we have to preserve\n the cases where the raw json is an array for the sources of a\n SpecificResource applied to an annotation body, while for a target\n of an Annotation we just want a single object\n */\n // case of a source of a SpecificResource which is an Annotation target\n if (raw) {\n var containerTypes = ["Scene", "Canvas"];\n var singleItem = ([].concat(raw))[0];\n if (containerTypes.includes(singleItem["type"]))\n return singleItem;\n }\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n return internal_1.AnnotationBodyParser.BuildFromJson(item, this.options);\n }\n }\n throw new Error("cannot resolve Source " + JSON.stringify(raw));\n };\n SpecificResource.prototype.getSelector = function () {\n var raw = this.getProperty("selector");\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n if (item["type"] === "PointSelector")\n return new internal_1.PointSelector(item);\n }\n throw new Error("unable to resolve SpecificResource selector " + JSON.stringify(this.__jsonld));\n }\n return null;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Selector", {\n get: function () { return this.getSelector(); },\n enumerable: false,\n configurable: true\n });\n SpecificResource.prototype.getTransform = function () {\n var retVal = [];\n var transformItems = this.getProperty("transform");\n for (var i = 0; i < transformItems.length; ++i) {\n var transformItem = transformItems[i];\n retVal.push(internal_1.TransformParser.BuildFromJson(transformItem));\n }\n return retVal;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Transform", {\n get: function () { return this.getTransform(); },\n enumerable: false,\n configurable: true\n });\n return SpecificResource;\n}(internal_1.ManifestResource));\nexports.SpecificResource = SpecificResource;\n\n\n//# sourceURL=webpack://manifesto/./src/SpecificResource.ts?')},"./src/StatusCode.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.StatusCode = void 0;\nvar StatusCode;\n(function (StatusCode) {\n StatusCode[StatusCode["AUTHORIZATION_FAILED"] = 1] = "AUTHORIZATION_FAILED";\n StatusCode[StatusCode["FORBIDDEN"] = 2] = "FORBIDDEN";\n StatusCode[StatusCode["INTERNAL_SERVER_ERROR"] = 3] = "INTERNAL_SERVER_ERROR";\n StatusCode[StatusCode["RESTRICTED"] = 4] = "RESTRICTED";\n})(StatusCode || (exports.StatusCode = StatusCode = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/StatusCode.ts?')},"./src/Thumb.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumb = void 0;\n// todo: deprecate\n// this is used by Sequence.getThumbs\nvar Thumb = /** @class */ (function () {\n function Thumb(width, canvas) {\n this.data = canvas;\n this.index = canvas.index;\n this.width = width;\n var heightRatio = canvas.getHeight() / canvas.getWidth();\n if (heightRatio) {\n this.height = Math.floor(this.width * heightRatio);\n }\n else {\n this.height = width;\n }\n this.uri = canvas.getCanonicalImageUri(width);\n this.label = canvas.getLabel().getValue(); // todo: pass locale?\n this.viewingHint = canvas.getViewingHint();\n }\n return Thumb;\n}());\nexports.Thumb = Thumb;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumb.ts?')},"./src/Thumbnail.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumbnail = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Thumbnail = /** @class */ (function (_super) {\n __extends(Thumbnail, _super);\n function Thumbnail(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n return Thumbnail;\n}(internal_1.Resource));\nexports.Thumbnail = Thumbnail;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumbnail.ts?')},"./src/Transform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Transform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Transform = /** @class */ (function (_super) {\n __extends(Transform, _super);\n function Transform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTransform = true;\n _this.isTransform = true;\n return _this;\n }\n return Transform;\n}(internal_1.JSONLDResource));\nexports.Transform = Transform;\n\n\n//# sourceURL=webpack://manifesto/./src/Transform.ts?')},"./src/TransformParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TransformParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TransformParser = /** @class */ (function () {\n function TransformParser() {\n }\n TransformParser.BuildFromJson = function (jsonld) {\n if (jsonld.type === "TranslateTransform")\n return new internal_1.TranslateTransform(jsonld);\n else if (jsonld.type === "RotateTransform")\n return new internal_1.RotateTransform(jsonld);\n else if (jsonld.type === "ScaleTransform")\n return new internal_1.ScaleTransform(jsonld);\n else\n throw new Error("Unknown transform type " + jsonld.type);\n };\n return TransformParser;\n}());\nexports.TransformParser = TransformParser;\n\n\n//# sourceURL=webpack://manifesto/./src/TransformParser.ts?')},"./src/TranslateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TranslateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TranslateTransform = /** @class */ (function (_super) {\n __extends(TranslateTransform, _super);\n function TranslateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTranslateTransform = true;\n return _this;\n }\n TranslateTransform.prototype.getTranslation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return TranslateTransform;\n}(internal_1.Transform));\nexports.TranslateTransform = TranslateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/TranslateTransform.ts?')},"./src/TreeNode.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNode = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TreeNode = /** @class */ (function () {\n function TreeNode(label, data) {\n this.label = label;\n this.data = data || {};\n this.nodes = [];\n }\n TreeNode.prototype.addNode = function (node) {\n this.nodes.push(node);\n node.parentNode = this;\n };\n TreeNode.prototype.isCollection = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n };\n TreeNode.prototype.isManifest = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n };\n TreeNode.prototype.isRange = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n };\n return TreeNode;\n}());\nexports.TreeNode = TreeNode;\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNode.ts?')},"./src/TreeNodeType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNodeType = void 0;\nvar TreeNodeType;\n(function (TreeNodeType) {\n TreeNodeType["COLLECTION"] = "collection";\n TreeNodeType["MANIFEST"] = "manifest";\n TreeNodeType["RANGE"] = "range";\n})(TreeNodeType || (exports.TreeNodeType = TreeNodeType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNodeType.ts?')},"./src/Utils.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Utils = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar dist_commonjs_2 = __webpack_require__(/*! @edsilv/http-status-codes/dist-commonjs */ "./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js");\n__webpack_require__(/*! isomorphic-unfetch */ "./node_modules/isomorphic-unfetch/index.js");\nvar Utils = /** @class */ (function () {\n function Utils() {\n }\n Utils.getMediaType = function (type) {\n type = type.toLowerCase();\n type = type.split(";")[0];\n return type.trim();\n };\n Utils.getImageQuality = function (profile) {\n if (profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) {\n return "native";\n }\n return "default";\n };\n Utils.getInexactLocale = function (locale) {\n if (locale.indexOf("-") !== -1) {\n return locale.substr(0, locale.indexOf("-"));\n }\n return locale;\n };\n Utils.getLocalisedValue = function (resource, locale) {\n // if the resource is not an array of translations, return the string.\n if (!Array.isArray(resource)) {\n return resource;\n }\n // test for exact match\n for (var i = 0; i < resource.length; i++) {\n var value_1 = resource[i];\n var language_1 = value_1["@language"];\n if (locale === language_1) {\n return value_1["@value"];\n }\n }\n // test for inexact match\n var match = locale.substr(0, locale.indexOf("-"));\n for (var i = 0; i < resource.length; i++) {\n var value = resource[i];\n var language = value["@language"];\n if (language === match) {\n return value["@value"];\n }\n }\n return null;\n };\n Utils.generateTreeNodeIds = function (treeNode, index) {\n if (index === void 0) { index = 0; }\n var id;\n if (!treeNode.parentNode) {\n id = "0";\n }\n else {\n id = treeNode.parentNode.id + "-" + index;\n }\n treeNode.id = id;\n for (var i = 0; i < treeNode.nodes.length; i++) {\n var n = treeNode.nodes[i];\n Utils.generateTreeNodeIds(n, i);\n }\n };\n Utils.normaliseType = function (type) {\n type = (type || "").toLowerCase();\n if (type.indexOf(":") !== -1) {\n var split = type.split(":");\n return split[1];\n }\n return type;\n };\n Utils.normaliseUrl = function (url) {\n url = url.substr(url.indexOf("://"));\n if (url.indexOf("#") !== -1) {\n url = url.split("#")[0];\n }\n return url;\n };\n Utils.normalisedUrlsMatch = function (url1, url2) {\n return Utils.normaliseUrl(url1) === Utils.normaliseUrl(url2);\n };\n Utils.isImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.isImageServiceType = function (type) {\n return ((type !== null &&\n type.toLowerCase() === dist_commonjs_1.ServiceType.IMAGE_SERVICE_2.toLowerCase()) ||\n type === dist_commonjs_1.ServiceType.IMAGE_SERVICE_3.toLowerCase());\n };\n Utils.isLevel0ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) {\n return true;\n }\n return false;\n };\n Utils.isLevel1ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) {\n return true;\n }\n return false;\n };\n Utils.isLevel2ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.parseManifest = function (manifest, options) {\n return internal_1.Deserialiser.parse(manifest, options);\n };\n Utils.checkStatus = function (response) {\n if (response.ok) {\n return response;\n }\n else {\n var error = new Error(response.statusText);\n error.response = response;\n return Promise.reject(error);\n }\n };\n Utils.loadManifest = function (url) {\n return new Promise(function (resolve, reject) {\n fetch(url)\n .then(Utils.checkStatus)\n .then(function (r) { return r.json(); })\n .then(function (data) {\n resolve(data);\n })\n .catch(function (err) {\n reject();\n });\n });\n };\n Utils.loadExternalResourcesAuth1 = function (resources, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth1(resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n Utils.loadExternalResourceAuth1 = function (resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var storedAccessToken;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, getStoredAccessToken(resource)];\n case 1:\n storedAccessToken = _a.sent();\n if (!storedAccessToken) return [3 /*break*/, 6];\n return [4 /*yield*/, resource.getData(storedAccessToken)];\n case 2:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.OK)) return [3 /*break*/, 3];\n return [2 /*return*/, resource];\n case 3: \n // the stored token is no good for this resource\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 4:\n // the stored token is no good for this resource\n _a.sent();\n _a.label = 5;\n case 5:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n case 6: return [4 /*yield*/, resource.getData()];\n case 7:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.MOVED_TEMPORARILY ||\n resource.status === dist_commonjs_2.UNAUTHORIZED)) return [3 /*break*/, 9];\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 8:\n _a.sent();\n _a.label = 9;\n case 9:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n }\n });\n });\n };\n Utils.doAuthChain = function (resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var externalService, kioskService, clickThroughService, loginService, serviceToTry, lastAttempted, kioskInteraction, contentProviderInteraction, contentProviderInteraction;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // This function enters the flowchart at the < External? > junction\n // http://iiif.io/api/auth/1.0/#workflow-from-the-browser-client-perspective\n if (!resource.isAccessControlled()) {\n return [2 /*return*/, resource]; // no services found\n }\n externalService = resource.externalService;\n if (externalService) {\n externalService.options = resource.options;\n }\n kioskService = resource.kioskService;\n if (kioskService) {\n kioskService.options = resource.options;\n }\n clickThroughService = resource.clickThroughService;\n if (clickThroughService) {\n clickThroughService.options = resource.options;\n }\n loginService = resource.loginService;\n if (loginService) {\n loginService.options = resource.options;\n }\n if (!(!resource.isResponseHandled && resource.status === dist_commonjs_2.MOVED_TEMPORARILY)) return [3 /*break*/, 2];\n return [4 /*yield*/, handleMovedTemporarily(resource)];\n case 1:\n _a.sent();\n return [2 /*return*/, resource];\n case 2:\n serviceToTry = null;\n lastAttempted = null;\n // repetition of logic is left in these steps for clarity:\n // Looking for external pattern\n serviceToTry = externalService;\n if (!serviceToTry) return [3 /*break*/, 4];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 3:\n _a.sent();\n return [2 /*return*/, resource];\n case 4:\n // Looking for kiosk pattern\n serviceToTry = kioskService;\n if (!serviceToTry) return [3 /*break*/, 7];\n lastAttempted = serviceToTry;\n kioskInteraction = openContentProviderInteraction(serviceToTry);\n if (!kioskInteraction) return [3 /*break*/, 7];\n return [4 /*yield*/, userInteractedWithContentProvider(kioskInteraction)];\n case 5:\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 6:\n _a.sent();\n return [2 /*return*/, resource];\n case 7:\n // The code for the next two patterns is identical (other than the profile name).\n // The difference is in the expected behaviour of\n //\n // await userInteractedWithContentProvider(contentProviderInteraction);\n //\n // For clickthrough the opened window should close immediately having established\n // a session, whereas for login the user might spend some time entering credentials etc.\n // Looking for clickthrough pattern\n serviceToTry = clickThroughService;\n if (!serviceToTry) return [3 /*break*/, 11];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 8:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 11];\n // should close immediately\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 9:\n // should close immediately\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 10:\n _a.sent();\n return [2 /*return*/, resource];\n case 11:\n // Looking for login pattern\n serviceToTry = loginService;\n if (!serviceToTry) return [3 /*break*/, 15];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 12:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 15];\n // we expect the user to spend some time interacting\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 13:\n // we expect the user to spend some time interacting\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 14:\n _a.sent();\n return [2 /*return*/, resource];\n case 15:\n // nothing worked! Use the most recently tried service as the source of\n // messages to show to the user.\n if (lastAttempted) {\n showOutOfOptionsMessages(resource, lastAttempted);\n }\n return [2 /*return*/];\n }\n });\n });\n };\n Utils.attemptResourceWithToken = function (resource, openTokenService, authService) {\n return __awaiter(this, void 0, void 0, function () {\n var tokenService, tokenMessage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n tokenService = authService.getService(dist_commonjs_1.ServiceProfile.AUTH_1_TOKEN);\n if (!tokenService) return [3 /*break*/, 3];\n return [4 /*yield*/, openTokenService(resource, tokenService)];\n case 1:\n tokenMessage = _a.sent();\n if (!(tokenMessage && tokenMessage.accessToken)) return [3 /*break*/, 3];\n return [4 /*yield*/, resource.getData(tokenMessage)];\n case 2:\n _a.sent();\n return [2 /*return*/, resource];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n Utils.loadExternalResourcesAuth09 = function (resources, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth09(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n // IIIF auth api pre v1.0\n // Keeping this around for now until the auth 1.0 implementation is stable\n Utils.loadExternalResourceAuth09 = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n if (options && options.pessimisticAccessControl) {\n // pessimistic: access control cookies may have been deleted.\n // always request the access token for every access controlled info.json request\n // returned access tokens are not stored, therefore the login window flashes for every request.\n resource\n .getData()\n .then(function () {\n if (resource.isAccessControlled()) {\n // if the resource has a click through service, use that.\n if (resource.clickThroughService) {\n resolve(clickThrough(resource));\n //} else if(resource.restrictedService) {\n resolve(restricted(resource));\n }\n else {\n login(resource)\n .then(function () {\n getAccessToken(resource, true)\n .then(function (token) {\n resource\n .getData(token)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n }\n else {\n // this info.json isn\'t access controlled, therefore no need to request an access token.\n resolve(resource);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // optimistic: access control cookies may not have been deleted.\n // store access tokens to avoid login window flashes.\n // if cookies are deleted a page refresh is required.\n // try loading the resource using an access token that matches the info.json domain.\n // if an access token is found, request the resource using it regardless of whether it is access controlled.\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n // if the info.json loaded using the stored access token\n if (resource.status === dist_commonjs_2.OK) {\n resolve(handleResourceResponse(resource));\n }\n else {\n // otherwise, load the resource data to determine the correct access control services.\n // if access controlled, do login.\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n // if (resource.restrictedService){\n // reject(Utils.createRestrictedError());\n // } else {\n reject(Utils.createAuthorizationFailedError());\n //}\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n else {\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n });\n };\n Utils.createError = function (name, message) {\n var error = new Error();\n error.message = message;\n error.name = String(name);\n return error;\n };\n Utils.createAuthorizationFailedError = function () {\n return Utils.createError(internal_1.StatusCode.AUTHORIZATION_FAILED, "Authorization failed");\n };\n Utils.createRestrictedError = function () {\n return Utils.createError(internal_1.StatusCode.RESTRICTED, "Restricted");\n };\n Utils.createInternalServerError = function (message) {\n return Utils.createError(internal_1.StatusCode.INTERNAL_SERVER_ERROR, message);\n };\n Utils.authorize = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) {\n return new Promise(function (resolve, reject) {\n resource.getData().then(function () {\n if (resource.isAccessControlled()) {\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource); // happy path ended\n }\n else {\n // the stored token is no good for this resource\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // There was no stored token, but the user might have a cookie that will grant a token\n getAccessToken(resource, false).then(function (accessToken) {\n if (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n // try using the fresh access token\n resource\n .getData(accessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource);\n }\n else {\n // User has a token, but it\'s not good enough\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n // not able to store access token\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // The user did not have a cookie that granted a token\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n });\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // this info.json isn\'t access controlled, therefore there\'s no need to request an access token\n resolve(resource);\n }\n });\n });\n };\n Utils.showAuthInteraction = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject) {\n if (resource.status === dist_commonjs_2.MOVED_TEMPORARILY && !resource.isResponseHandled) {\n // if the resource was redirected to a degraded version\n // and the response hasn\'t been handled yet.\n // if the client wishes to trigger a login, set resource.isResponseHandled to true\n // and call loadExternalResources() again passing the resource.\n resolve(resource);\n // } else if (resource.restrictedService) {\n // resolve(restricted(resource));\n // // TODO: move to next etc\n }\n else if (resource.clickThroughService && !resource.isResponseHandled) {\n // if the resource has a click through service, use that.\n clickThrough(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n else {\n // get an access token\n login(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n };\n Utils.getService = function (resource, profile) {\n var services = this.getServices(resource);\n for (var i = 0; i < services.length; i++) {\n var service = services[i];\n if (service.getProfile() === profile) {\n return service;\n }\n }\n return null;\n };\n Utils.getResourceById = function (parentResource, id) {\n return (Utils.traverseAndFind(parentResource.__jsonld, "@id", id));\n };\n /**\n * Does a depth first traversal of an Object, returning an Object that\n * matches provided k and v arguments\n * @example Utils.traverseAndFind({foo: \'bar\'}, \'foo\', \'bar\')\n */\n Utils.traverseAndFind = function (object, k, v) {\n if (object.hasOwnProperty(k) && object[k] === v) {\n return object;\n }\n for (var i = 0; i < Object.keys(object).length; i++) {\n if (typeof object[Object.keys(object)[i]] === "object") {\n var o = Utils.traverseAndFind(object[Object.keys(object)[i]], k, v);\n if (o != null) {\n return o;\n }\n }\n }\n return undefined;\n };\n Utils.getServices = function (resource, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.onlyService, onlyService = _c === void 0 ? false : _c, _d = _b.onlyServices, onlyServices = _d === void 0 ? false : _d, _e = _b.skipParentResources, skipParentResources = _e === void 0 ? false : _e;\n var services = [];\n // Resources can reference "services" on the manifest. This is a bit of a hack to just get the services from the manifest\n // too. What would be better is if this was used as a "Map" of full services.\n // So when you come across { id: \'...\' } without any data, you can "lookup" services from the manifest.\n // I would have implemented this if I was confident that it was reliable. Instead, I opted for the safest option that\n // should not break any existing services.\n if (!skipParentResources &&\n resource &&\n resource.options &&\n resource.options.resource &&\n resource.options.resource !== resource) {\n services.push.apply(services, Utils.getServices(resource.options.resource, { onlyServices: true }));\n }\n var service = !onlyServices\n ? (resource.__jsonld || resource).service || []\n : [];\n // coerce to array\n if (!Array.isArray(service)) {\n service = [service];\n }\n if (!onlyService) {\n // Some resources also have a `.services` property.\n // https://iiif.io/api/presentation/3.0/#services\n service.push.apply(service, ((resource.__jsonld || resource).services || []));\n }\n if (service.length === 0) {\n return services;\n }\n for (var i = 0; i < service.length; i++) {\n var s = service[i];\n if (typeof s === "string") {\n var r = this.getResourceById(resource.options.resource, s);\n if (r) {\n services.push(new internal_1.Service(r.__jsonld || r, resource.options));\n }\n }\n else {\n services.push(new internal_1.Service(s, resource.options));\n }\n }\n return services;\n };\n Utils.getTemporalComponent = function (target) {\n var temporal = /t=([^&]+)/g.exec(target);\n var t = null;\n if (temporal && temporal[1]) {\n t = temporal[1].split(",");\n }\n return t;\n };\n return Utils;\n}());\nexports.Utils = Utils;\n\n\n//# sourceURL=webpack://manifesto/./src/Utils.ts?')},"./src/index.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.parseManifest = exports.loadManifest = void 0;\n__exportStar(__webpack_require__(/*! ./internal */ "./src/internal.ts"), exports);\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/**\nInitiates downloading an IIIF manifest json file from URL. Returns a Promise\nto allow subsequent processing on a successful fetch.\n\n@param url string containing the URL to Fetch\n@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text.\n**/\nvar loadManifest = function (url) {\n return Utils_1.Utils.loadManifest(url);\n};\nexports.loadManifest = loadManifest;\n/**\nParses IIIF manifest file to return a manifesto Manifest instance\n\n@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file.\n@param options? TODO Not yet documented\n@returns instance of Manifest class.\n**/\nvar parseManifest = function (manifest, options) {\n return Utils_1.Utils.parseManifest(manifest, options);\n};\nexports.parseManifest = parseManifest;\n\n\n//# sourceURL=webpack://manifesto/./src/index.ts?')},"./src/internal.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./JSONLDResource */ "./src/JSONLDResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestResource */ "./src/ManifestResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Resource */ "./src/Resource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IIIFResource */ "./src/IIIFResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./SpecificResource */ "./src/SpecificResource.ts"), exports);\n//export * from "./SpecificResourceForTarget";\n//export * from "./SpecificResourceForBody";\n__exportStar(__webpack_require__(/*! ./AnnotationBody */ "./src/AnnotationBody.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Light */ "./src/Light.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Camera */ "./src/Camera.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationBodyParser */ "./src/AnnotationBodyParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Annotation */ "./src/Annotation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationList */ "./src/AnnotationList.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationPage */ "./src/AnnotationPage.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Canvas */ "./src/Canvas.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Collection */ "./src/Collection.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Duration */ "./src/Duration.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IAccessToken */ "./src/IAccessToken.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalImageResourceData */ "./src/IExternalImageResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResource */ "./src/IExternalResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceData */ "./src/IExternalResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceOptions */ "./src/IExternalResourceOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IManifestoOptions */ "./src/IManifestoOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LabelValuePair */ "./src/LabelValuePair.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Language */ "./src/Language.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LanguageMap */ "./src/LanguageMap.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PropertyValue */ "./src/PropertyValue.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Manifest */ "./src/Manifest.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestType */ "./src/ManifestType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PointSelector */ "./src/PointSelector.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Range */ "./src/Range.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Rendering */ "./src/Rendering.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Scene */ "./src/Scene.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Sequence */ "./src/Sequence.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Serialisation */ "./src/Serialisation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Service */ "./src/Service.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Size */ "./src/Size.ts"), exports);\n__exportStar(__webpack_require__(/*! ./StatusCode */ "./src/StatusCode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumb */ "./src/Thumb.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumbnail */ "./src/Thumbnail.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TransformParser */ "./src/TransformParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNode */ "./src/TreeNode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNodeType */ "./src/TreeNodeType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Utils */ "./src/Utils.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./RotateTransform */ "./src/RotateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ScaleTransform */ "./src/ScaleTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Color */ "./src/Color.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Geometry3d */ "./src/Geometry3d.ts"), exports);\n\n\n//# sourceURL=webpack://manifesto/./src/internal.ts?')},"./node_modules/unfetch/dist/unfetch.module.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},s.onerror=r,s.withCredentials="include"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})}\n//# sourceMappingURL=unfetch.module.js.map\n\n\n//# sourceURL=webpack://manifesto/./node_modules/unfetch/dist/unfetch.module.js?')},"node-fetch":t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE_node_fetch__},"./node_modules/threejs-math/build/threejs-math.cjs":(__unused_webpack_module,exports)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nconst REVISION = '144dev';\nconst MOUSE = {\n\tLEFT: 0,\n\tMIDDLE: 1,\n\tRIGHT: 2,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2\n};\nconst TOUCH = {\n\tROTATE: 0,\n\tPAN: 1,\n\tDOLLY_PAN: 2,\n\tDOLLY_ROTATE: 3\n};\nconst CullFaceNone = 0;\nconst CullFaceBack = 1;\nconst CullFaceFront = 2;\nconst CullFaceFrontBack = 3;\nconst BasicShadowMap = 0;\nconst PCFShadowMap = 1;\nconst PCFSoftShadowMap = 2;\nconst VSMShadowMap = 3;\nconst FrontSide = 0;\nconst BackSide = 1;\nconst DoubleSide = 2;\nconst NoBlending = 0;\nconst NormalBlending = 1;\nconst AdditiveBlending = 2;\nconst SubtractiveBlending = 3;\nconst MultiplyBlending = 4;\nconst CustomBlending = 5;\nconst AddEquation = 100;\nconst SubtractEquation = 101;\nconst ReverseSubtractEquation = 102;\nconst MinEquation = 103;\nconst MaxEquation = 104;\nconst ZeroFactor = 200;\nconst OneFactor = 201;\nconst SrcColorFactor = 202;\nconst OneMinusSrcColorFactor = 203;\nconst SrcAlphaFactor = 204;\nconst OneMinusSrcAlphaFactor = 205;\nconst DstAlphaFactor = 206;\nconst OneMinusDstAlphaFactor = 207;\nconst DstColorFactor = 208;\nconst OneMinusDstColorFactor = 209;\nconst SrcAlphaSaturateFactor = 210;\nconst NeverDepth = 0;\nconst AlwaysDepth = 1;\nconst LessDepth = 2;\nconst LessEqualDepth = 3;\nconst EqualDepth = 4;\nconst GreaterEqualDepth = 5;\nconst GreaterDepth = 6;\nconst NotEqualDepth = 7;\nconst MultiplyOperation = 0;\nconst MixOperation = 1;\nconst AddOperation = 2;\nconst NoToneMapping = 0;\nconst LinearToneMapping = 1;\nconst ReinhardToneMapping = 2;\nconst CineonToneMapping = 3;\nconst ACESFilmicToneMapping = 4;\nconst CustomToneMapping = 5;\nconst UVMapping = 300;\nconst CubeReflectionMapping = 301;\nconst CubeRefractionMapping = 302;\nconst EquirectangularReflectionMapping = 303;\nconst EquirectangularRefractionMapping = 304;\nconst CubeUVReflectionMapping = 306;\nconst RepeatWrapping = 1000;\nconst ClampToEdgeWrapping = 1001;\nconst MirroredRepeatWrapping = 1002;\nconst NearestFilter = 1003;\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004;\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005;\nconst LinearFilter = 1006;\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007;\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008;\nconst UnsignedByteType = 1009;\nconst ByteType = 1010;\nconst ShortType = 1011;\nconst UnsignedShortType = 1012;\nconst IntType = 1013;\nconst UnsignedIntType = 1014;\nconst FloatType = 1015;\nconst HalfFloatType = 1016;\nconst UnsignedShort4444Type = 1017;\nconst UnsignedShort5551Type = 1018;\nconst UnsignedInt248Type = 1020;\nconst AlphaFormat = 1021;\nconst RGBFormat = 1022; // @deprecated since r137\n\nconst RGBAFormat = 1023;\nconst LuminanceFormat = 1024;\nconst LuminanceAlphaFormat = 1025;\nconst DepthFormat = 1026;\nconst DepthStencilFormat = 1027;\nconst RedFormat = 1028;\nconst RedIntegerFormat = 1029;\nconst RGFormat = 1030;\nconst RGIntegerFormat = 1031;\nconst RGBAIntegerFormat = 1033;\nconst RGB_S3TC_DXT1_Format = 33776;\nconst RGBA_S3TC_DXT1_Format = 33777;\nconst RGBA_S3TC_DXT3_Format = 33778;\nconst RGBA_S3TC_DXT5_Format = 33779;\nconst RGB_PVRTC_4BPPV1_Format = 35840;\nconst RGB_PVRTC_2BPPV1_Format = 35841;\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\nconst RGB_ETC1_Format = 36196;\nconst RGB_ETC2_Format = 37492;\nconst RGBA_ETC2_EAC_Format = 37496;\nconst RGBA_ASTC_4x4_Format = 37808;\nconst RGBA_ASTC_5x4_Format = 37809;\nconst RGBA_ASTC_5x5_Format = 37810;\nconst RGBA_ASTC_6x5_Format = 37811;\nconst RGBA_ASTC_6x6_Format = 37812;\nconst RGBA_ASTC_8x5_Format = 37813;\nconst RGBA_ASTC_8x6_Format = 37814;\nconst RGBA_ASTC_8x8_Format = 37815;\nconst RGBA_ASTC_10x5_Format = 37816;\nconst RGBA_ASTC_10x6_Format = 37817;\nconst RGBA_ASTC_10x8_Format = 37818;\nconst RGBA_ASTC_10x10_Format = 37819;\nconst RGBA_ASTC_12x10_Format = 37820;\nconst RGBA_ASTC_12x12_Format = 37821;\nconst RGBA_BPTC_Format = 36492;\nconst LoopOnce = 2200;\nconst LoopRepeat = 2201;\nconst LoopPingPong = 2202;\nconst InterpolateDiscrete = 2300;\nconst InterpolateLinear = 2301;\nconst InterpolateSmooth = 2302;\nconst ZeroCurvatureEnding = 2400;\nconst ZeroSlopeEnding = 2401;\nconst WrapAroundEnding = 2402;\nconst NormalAnimationBlendMode = 2500;\nconst AdditiveAnimationBlendMode = 2501;\nconst TrianglesDrawMode = 0;\nconst TriangleStripDrawMode = 1;\nconst TriangleFanDrawMode = 2;\nconst LinearEncoding = 3000;\nconst sRGBEncoding = 3001;\nconst BasicDepthPacking = 3200;\nconst RGBADepthPacking = 3201;\nconst TangentSpaceNormalMap = 0;\nconst ObjectSpaceNormalMap = 1; // Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\n\nconst NoColorSpace = '';\nconst SRGBColorSpace = 'srgb';\nconst LinearSRGBColorSpace = 'srgb-linear';\nconst ZeroStencilOp = 0;\nconst KeepStencilOp = 7680;\nconst ReplaceStencilOp = 7681;\nconst IncrementStencilOp = 7682;\nconst DecrementStencilOp = 7683;\nconst IncrementWrapStencilOp = 34055;\nconst DecrementWrapStencilOp = 34056;\nconst InvertStencilOp = 5386;\nconst NeverStencilFunc = 512;\nconst LessStencilFunc = 513;\nconst EqualStencilFunc = 514;\nconst LessEqualStencilFunc = 515;\nconst GreaterStencilFunc = 516;\nconst NotEqualStencilFunc = 517;\nconst GreaterEqualStencilFunc = 518;\nconst AlwaysStencilFunc = 519;\nconst StaticDrawUsage = 35044;\nconst DynamicDrawUsage = 35048;\nconst StreamDrawUsage = 35040;\nconst StaticReadUsage = 35045;\nconst DynamicReadUsage = 35049;\nconst StreamReadUsage = 35041;\nconst StaticCopyUsage = 35046;\nconst DynamicCopyUsage = 35050;\nconst StreamCopyUsage = 35042;\nconst GLSL1 = '100';\nconst GLSL3 = '300 es';\nconst _SRGBAFormat = 1035; // fallback for WebGL 1\n\nclass Vector2 {\n\tconstructor(x = 0, y = 0) {\n\t\tVector2.prototype.isVector2 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tget width() {\n\t\treturn this.x;\n\t}\n\n\tset width(value) {\n\t\tthis.x = value;\n\t}\n\n\tget height() {\n\t\treturn this.y;\n\t}\n\n\tset height(value) {\n\t\tthis.y = value;\n\t}\n\n\tset(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\treturn this;\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6];\n\t\tthis.y = e[1] * x + e[4] * y + e[7];\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y;\n\t}\n\n\tcross(v) {\n\t\treturn this.x * v.y - this.y * v.x;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tangle() {\n\t\t// computes the angle in radians with respect to the positive x-axis\n\t\tconst angle = Math.atan2(-this.y, -this.x) + Math.PI;\n\t\treturn angle;\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \treturn this;\n\t// }\n\n\n\trotateAround(center, angle) {\n\t\tconst c = Math.cos(angle),\n\t\t\t\t\ts = Math.sin(angle);\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\t\treturn this;\n\t}\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t}\n\n}\n\nconst _lut = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff'];\nlet _seed = 1234567;\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI; // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\nfunction generateUUID() {\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[d0 & 0xff] + _lut[d0 >> 8 & 0xff] + _lut[d0 >> 16 & 0xff] + _lut[d0 >> 24 & 0xff] + '-' + _lut[d1 & 0xff] + _lut[d1 >> 8 & 0xff] + '-' + _lut[d1 >> 16 & 0x0f | 0x40] + _lut[d1 >> 24 & 0xff] + '-' + _lut[d2 & 0x3f | 0x80] + _lut[d2 >> 8 & 0xff] + '-' + _lut[d2 >> 16 & 0xff] + _lut[d2 >> 24 & 0xff] + _lut[d3 & 0xff] + _lut[d3 >> 8 & 0xff] + _lut[d3 >> 16 & 0xff] + _lut[d3 >> 24 & 0xff]; // .toLowerCase() here flattens concatenated strings to save heap memory space.\n\n\treturn uuid.toLowerCase();\n}\n\nfunction clamp(value, min, max) {\n\treturn Math.max(min, Math.min(max, value));\n} // compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\n\n\nfunction euclideanModulo(n, m) {\n\treturn (n % m + m) % m;\n} // Linear mapping from range to range \n\n\nfunction mapLinear(x, a1, a2, b1, b2) {\n\treturn b1 + (x - a1) * (b2 - b1) / (a2 - a1);\n} // https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\nfunction inverseLerp(x, y, value) {\n\tif (x !== y) {\n\t\treturn (value - x) / (y - x);\n\t} else {\n\t\treturn 0;\n\t}\n} // https://en.wikipedia.org/wiki/Linear_interpolation\n\n\nfunction lerp(x, y, t) {\n\treturn (1 - t) * x + t * y;\n} // http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\n\n\nfunction damp(x, y, lambda, dt) {\n\treturn lerp(x, y, 1 - Math.exp(-lambda * dt));\n} // https://www.desmos.com/calculator/vcsjnyz7x4\n\n\nfunction pingpong(x, length = 1) {\n\treturn length - Math.abs(euclideanModulo(x, length * 2) - length);\n} // http://en.wikipedia.org/wiki/Smoothstep\n\n\nfunction smoothstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * (3 - 2 * x);\n}\n\nfunction smootherstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * x * (x * (x * 6 - 15) + 10);\n} // Random integer from interval\n\n\nfunction randInt(low, high) {\n\treturn low + Math.floor(Math.random() * (high - low + 1));\n} // Random float from interval\n\n\nfunction randFloat(low, high) {\n\treturn low + Math.random() * (high - low);\n} // Random float from <-range/2, range/2> interval\n\n\nfunction randFloatSpread(range) {\n\treturn range * (0.5 - Math.random());\n} // Deterministic pseudo-random float in the interval [ 0, 1 ]\n\n\nfunction seededRandom(s) {\n\tif (s !== undefined) _seed = s; // Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\tt = Math.imul(t ^ t >>> 15, t | 1);\n\tt ^= t + Math.imul(t ^ t >>> 7, t | 61);\n\treturn ((t ^ t >>> 14) >>> 0) / 4294967296;\n}\n\nfunction degToRad(degrees) {\n\treturn degrees * DEG2RAD;\n}\n\nfunction radToDeg(radians) {\n\treturn radians * RAD2DEG;\n}\n\nfunction isPowerOfTwo(value) {\n\treturn (value & value - 1) === 0 && value !== 0;\n}\n\nfunction ceilPowerOfTwo(value) {\n\treturn Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n}\n\nfunction floorPowerOfTwo(value) {\n\treturn Math.pow(2, Math.floor(Math.log(value) / Math.LN2));\n}\n\nfunction setQuaternionFromProperEuler(q, a, b, c, order) {\n\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\t// rotations are applied to the axes in the order specified by 'order'\n\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t// angles are in radians\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\tconst c2 = cos(b / 2);\n\tconst s2 = sin(b / 2);\n\tconst c13 = cos((a + c) / 2);\n\tconst s13 = sin((a + c) / 2);\n\tconst c1_3 = cos((a - c) / 2);\n\tconst s1_3 = sin((a - c) / 2);\n\tconst c3_1 = cos((c - a) / 2);\n\tconst s3_1 = sin((c - a) / 2);\n\n\tswitch (order) {\n\t\tcase 'XYX':\n\t\t\tq.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order);\n\t}\n}\n\nfunction denormalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\t\t\treturn value / 255.0;\n\n\t\tcase Int16Array:\n\t\t\treturn Math.max(value / 32767.0, -1.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.max(value / 127.0, -1.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nfunction normalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn Math.round(value * 65535.0);\n\n\t\tcase Uint8Array:\n\t\t\treturn Math.round(value * 255.0);\n\n\t\tcase Int16Array:\n\t\t\treturn Math.round(value * 32767.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.round(value * 127.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nvar MathUtils = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\tgenerateUUID: generateUUID,\n\tclamp: clamp,\n\teuclideanModulo: euclideanModulo,\n\tmapLinear: mapLinear,\n\tinverseLerp: inverseLerp,\n\tlerp: lerp,\n\tdamp: damp,\n\tpingpong: pingpong,\n\tsmoothstep: smoothstep,\n\tsmootherstep: smootherstep,\n\trandInt: randInt,\n\trandFloat: randFloat,\n\trandFloatSpread: randFloatSpread,\n\tseededRandom: seededRandom,\n\tdegToRad: degToRad,\n\tradToDeg: radToDeg,\n\tisPowerOfTwo: isPowerOfTwo,\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\tnormalize: normalize,\n\tdenormalize: denormalize\n});\n\nclass Quaternion {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tthis.isQuaternion = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\t}\n\n\tstatic slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) {\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\t\tlet x0 = src0[srcOffset0 + 0],\n\t\t\t\ty0 = src0[srcOffset0 + 1],\n\t\t\t\tz0 = src0[srcOffset0 + 2],\n\t\t\t\tw0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1 + 0],\n\t\t\t\t\ty1 = src1[srcOffset1 + 1],\n\t\t\t\t\tz1 = src1[srcOffset1 + 2],\n\t\t\t\t\tw1 = src1[srcOffset1 + 3];\n\n\t\tif (t === 0) {\n\t\t\tdst[dstOffset + 0] = x0;\n\t\t\tdst[dstOffset + 1] = y0;\n\t\t\tdst[dstOffset + 2] = z0;\n\t\t\tdst[dstOffset + 3] = w0;\n\t\t\treturn;\n\t\t}\n\n\t\tif (t === 1) {\n\t\t\tdst[dstOffset + 0] = x1;\n\t\t\tdst[dstOffset + 1] = y1;\n\t\t\tdst[dstOffset + 2] = z1;\n\t\t\tdst[dstOffset + 3] = w1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\t\t\tdir = cos >= 0 ? 1 : -1,\n\t\t\t\t\t\tsqrSin = 1 - cos * cos; // Skip the Slerp for tiny steps to avoid numeric problems:\n\n\t\t\tif (sqrSin > Number.EPSILON) {\n\t\t\t\tconst sin = Math.sqrt(sqrSin),\n\t\t\t\t\t\t\tlen = Math.atan2(sin, cos * dir);\n\t\t\t\ts = Math.sin(s * len) / sin;\n\t\t\t\tt = Math.sin(t * len) / sin;\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir; // Normalize in case we just did a lerp:\n\n\t\t\tif (s === 1 - t) {\n\t\t\t\tconst f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\t\t\t}\n\t\t}\n\n\t\tdst[dstOffset] = x0;\n\t\tdst[dstOffset + 1] = y0;\n\t\tdst[dstOffset + 2] = z0;\n\t\tdst[dstOffset + 3] = w0;\n\t}\n\n\tstatic multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {\n\t\tconst x0 = src0[srcOffset0];\n\t\tconst y0 = src0[srcOffset0 + 1];\n\t\tconst z0 = src0[srcOffset0 + 2];\n\t\tconst w0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1];\n\t\tconst y1 = src1[srcOffset1 + 1];\n\t\tconst z1 = src1[srcOffset1 + 2];\n\t\tconst w1 = src1[srcOffset1 + 3];\n\t\tdst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\t\treturn dst;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget w() {\n\t\treturn this._w;\n\t}\n\n\tset w(value) {\n\t\tthis._w = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._w);\n\t}\n\n\tcopy(quaternion) {\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromEuler(euler, update) {\n\t\tconst x = euler._x,\n\t\t\t\t\ty = euler._y,\n\t\t\t\t\tz = euler._z,\n\t\t\t\t\torder = euler._order; // http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\t\tconst c1 = cos(x / 2);\n\t\tconst c2 = cos(y / 2);\n\t\tconst c3 = cos(z / 2);\n\t\tconst s1 = sin(x / 2);\n\t\tconst s2 = sin(y / 2);\n\t\tconst s3 = sin(z / 2);\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tif (update !== false) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromAxisAngle(axis, angle) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\t\t// assumes axis is normalized\n\t\tconst halfAngle = angle / 2,\n\t\t\t\t\ts = Math.sin(halfAngle);\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos(halfAngle);\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10],\n\t\t\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif (trace > 0) {\n\t\t\tconst s = 0.5 / Math.sqrt(trace + 1.0);\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = (m32 - m23) * s;\n\t\t\tthis._y = (m13 - m31) * s;\n\t\t\tthis._z = (m21 - m12) * s;\n\t\t} else if (m11 > m22 && m11 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\t\t\tthis._w = (m32 - m23) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = (m12 + m21) / s;\n\t\t\tthis._z = (m13 + m31) / s;\n\t\t} else if (m22 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\t\t\tthis._w = (m13 - m31) / s;\n\t\t\tthis._x = (m12 + m21) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = (m23 + m32) / s;\n\t\t} else {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\t\t\tthis._w = (m21 - m12) / s;\n\t\t\tthis._x = (m13 + m31) / s;\n\t\t\tthis._y = (m23 + m32) / s;\n\t\t\tthis._z = 0.25 * s;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromUnitVectors(vFrom, vTo) {\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\t\tlet r = vFrom.dot(vTo) + 1;\n\n\t\tif (r < Number.EPSILON) {\n\t\t\t// vFrom and vTo point in opposite directions\n\t\t\tr = 0;\n\n\t\t\tif (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n\t\t\t\tthis._x = -vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\t\t\t} else {\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = -vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\t\t\t}\n\t\t} else {\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\t\t}\n\n\t\treturn this.normalize();\n\t}\n\n\tangleTo(q) {\n\t\treturn 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));\n\t}\n\n\trotateTowards(q, step) {\n\t\tconst angle = this.angleTo(q);\n\t\tif (angle === 0) return this;\n\t\tconst t = Math.min(1, step / angle);\n\t\tthis.slerp(q, t);\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\treturn this.set(0, 0, 0, 1);\n\t}\n\n\tinvert() {\n\t\t// quaternion is assumed to have unit length\n\t\treturn this.conjugate();\n\t}\n\n\tconjugate() {\n\t\tthis._x *= -1;\n\t\tthis._y *= -1;\n\t\tthis._z *= -1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\t}\n\n\tlengthSq() {\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n\t}\n\n\tnormalize() {\n\t\tlet l = this.length();\n\n\t\tif (l === 0) {\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\t\t} else {\n\t\t\tl = 1 / l;\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tmultiply(q) {\n\t\treturn this.multiplyQuaternions(this, q);\n\t}\n\n\tpremultiply(q) {\n\t\treturn this.multiplyQuaternions(q, this);\n\t}\n\n\tmultiplyQuaternions(a, b) {\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\t\tconst qax = a._x,\n\t\t\t\t\tqay = a._y,\n\t\t\t\t\tqaz = a._z,\n\t\t\t\t\tqaw = a._w;\n\t\tconst qbx = b._x,\n\t\t\t\t\tqby = b._y,\n\t\t\t\t\tqbz = b._z,\n\t\t\t\t\tqbw = b._w;\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerp(qb, t) {\n\t\tif (t === 0) return this;\n\t\tif (t === 1) return this.copy(qb);\n\t\tconst x = this._x,\n\t\t\t\t\ty = this._y,\n\t\t\t\t\tz = this._z,\n\t\t\t\t\tw = this._w; // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif (cosHalfTheta < 0) {\n\t\t\tthis._w = -qb._w;\n\t\t\tthis._x = -qb._x;\n\t\t\tthis._y = -qb._y;\n\t\t\tthis._z = -qb._z;\n\t\t\tcosHalfTheta = -cosHalfTheta;\n\t\t} else {\n\t\t\tthis.copy(qb);\n\t\t}\n\n\t\tif (cosHalfTheta >= 1.0) {\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif (sqrSinHalfTheta <= Number.EPSILON) {\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\t\t\tthis.normalize();\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt(sqrSinHalfTheta);\n\t\tconst halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);\n\t\tconst ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n\t\t\t\t\tratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n\t\tthis._w = w * ratioA + this._w * ratioB;\n\t\tthis._x = x * ratioA + this._x * ratioB;\n\t\tthis._y = y * ratioA + this._y * ratioB;\n\t\tthis._z = z * ratioA + this._z * ratioB;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerpQuaternions(qa, qb, t) {\n\t\treturn this.copy(qa).slerp(qb, t);\n\t}\n\n\trandom() {\n\t\t// Derived from http://planning.cs.uiuc.edu/node198.html\n\t\t// Note, this source uses w, x, y, z ordering,\n\t\t// so we swap the order below.\n\t\tconst u1 = Math.random();\n\t\tconst sqrt1u1 = Math.sqrt(1 - u1);\n\t\tconst sqrtu1 = Math.sqrt(u1);\n\t\tconst u2 = 2 * Math.PI * Math.random();\n\t\tconst u3 = 2 * Math.PI * Math.random();\n\t\treturn this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2));\n\t}\n\n\tequals(quaternion) {\n\t\treturn quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis._x = array[offset];\n\t\tthis._y = array[offset + 1];\n\t\tthis._z = array[offset + 2];\n\t\tthis._w = array[offset + 3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis._x = attribute.getX( index );\n\t// \tthis._y = attribute.getY( index );\n\t// \tthis._z = attribute.getZ( index );\n\t// \tthis._w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\t}\n\n}\n\nclass Vector3 {\n\tconstructor(x = 0, y = 0, z = 0) {\n\t\tVector3.prototype.isVector3 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}\n\n\tset(x, y, z) {\n\t\tif (z === undefined) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\treturn this;\n\t}\n\n\tmultiplyVectors(a, b) {\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\t\treturn this;\n\t}\n\n\tapplyEuler(euler) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromEuler(euler));\n\t}\n\n\tapplyAxisAngle(axis, angle) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromAxisAngle(axis, angle));\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6] * z;\n\t\tthis.y = e[1] * x + e[4] * y + e[7] * z;\n\t\tthis.z = e[2] * x + e[5] * y + e[8] * z;\n\t\treturn this;\n\t}\n\n\tapplyNormalMatrix(m) {\n\t\treturn this.applyMatrix3(m).normalize();\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\tthis.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w;\n\t\tthis.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w;\n\t\tthis.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w;\n\t\treturn this;\n\t}\n\n\tapplyQuaternion(q) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst qx = q.x,\n\t\t\t\t\tqy = q.y,\n\t\t\t\t\tqz = q.z,\n\t\t\t\t\tqw = q.w; // calculate quat * vector\n\n\t\tconst ix = qw * x + qy * z - qz * y;\n\t\tconst iy = qw * y + qz * x - qx * z;\n\t\tconst iz = qw * z + qx * y - qy * x;\n\t\tconst iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n\t\tthis.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t\tthis.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t\tthis.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t\treturn this;\n\t} // project( camera ) {\n\t// \treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\t// }\n\t// unproject( camera ) {\n\t// \treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\t// }\n\n\n\ttransformDirection(m) {\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z;\n\t\treturn this.normalize();\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t} // TODO lengthSquared?\n\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\treturn this;\n\t}\n\n\tcross(v) {\n\t\treturn this.crossVectors(this, v);\n\t}\n\n\tcrossVectors(a, b) {\n\t\tconst ax = a.x,\n\t\t\t\t\tay = a.y,\n\t\t\t\t\taz = a.z;\n\t\tconst bx = b.x,\n\t\t\t\t\tby = b.y,\n\t\t\t\t\tbz = b.z;\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\t\treturn this;\n\t}\n\n\tprojectOnVector(v) {\n\t\tconst denominator = v.lengthSq();\n\t\tif (denominator === 0) return this.set(0, 0, 0);\n\t\tconst scalar = v.dot(this) / denominator;\n\t\treturn this.copy(v).multiplyScalar(scalar);\n\t}\n\n\tprojectOnPlane(planeNormal) {\n\t\t_vector$3.copy(this).projectOnVector(planeNormal);\n\n\t\treturn this.sub(_vector$3);\n\t}\n\n\treflect(normal) {\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\t\treturn this.sub(_vector$3.copy(normal).multiplyScalar(2 * this.dot(normal)));\n\t}\n\n\tangleTo(v) {\n\t\tconst denominator = Math.sqrt(this.lengthSq() * v.lengthSq());\n\t\tif (denominator === 0) return Math.PI / 2;\n\t\tconst theta = this.dot(v) / denominator; // clamp, to handle numerical problems\n\n\t\treturn Math.acos(clamp(theta, -1, 1));\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y,\n\t\t\t\t\tdz = this.z - v.z;\n\t\treturn dx * dx + dy * dy + dz * dz;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);\n\t}\n\n\tsetFromSpherical(s) {\n\t\treturn this.setFromSphericalCoords(s.radius, s.phi, s.theta);\n\t}\n\n\tsetFromSphericalCoords(radius, phi, theta) {\n\t\tconst sinPhiRadius = Math.sin(phi) * radius;\n\t\tthis.x = sinPhiRadius * Math.sin(theta);\n\t\tthis.y = Math.cos(phi) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromCylindrical(c) {\n\t\treturn this.setFromCylindricalCoords(c.radius, c.theta, c.y);\n\t}\n\n\tsetFromCylindricalCoords(radius, theta, y) {\n\t\tthis.x = radius * Math.sin(theta);\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromMatrixPosition(m) {\n\t\tconst e = m.elements;\n\t\tthis.x = e[12];\n\t\tthis.y = e[13];\n\t\tthis.z = e[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrixScale(m) {\n\t\tconst sx = this.setFromMatrixColumn(m, 0).length();\n\t\tconst sy = this.setFromMatrixColumn(m, 1).length();\n\t\tconst sz = this.setFromMatrixColumn(m, 2).length();\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\t\treturn this;\n\t}\n\n\tsetFromMatrixColumn(m, index) {\n\t\treturn this.fromArray(m.elements, index * 4);\n\t}\n\n\tsetFromMatrix3Column(m, index) {\n\t\treturn this.fromArray(m.elements, index * 3);\n\t}\n\n\tsetFromEuler(e) {\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\treturn this;\n\t}\n\n\trandomDirection() {\n\t\t// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\n\t\tconst u = (Math.random() - 0.5) * 2;\n\t\tconst t = Math.random() * Math.PI * 2;\n\t\tconst f = Math.sqrt(1 - u ** 2);\n\t\tthis.x = f * Math.cos(t);\n\t\tthis.y = f * Math.sin(t);\n\t\tthis.z = u;\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/new Vector3();\n\nconst _quaternion$1 = /*@__PURE__*/new Quaternion();\n\nconst _vector$2 = /*@__PURE__*/new Vector2();\n\nclass Box2 {\n\tconstructor(min = new Vector2(+Infinity, +Infinity), max = new Vector2(-Infinity, -Infinity)) {\n\t\tthis.isBox2 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$2.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = +Infinity;\n\t\tthis.max.x = this.max.y = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y;\n\t}\n\n\tgetCenter(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 4 splitting planes to rule out intersections\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$2.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max);\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nclass Box3 {\n\tconstructor(min = new Vector3(+Infinity, +Infinity, +Infinity), max = new Vector3(-Infinity, -Infinity, -Infinity)) {\n\t\tthis.isBox3 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromArray(array) {\n\t\tlet minX = +Infinity;\n\t\tlet minY = +Infinity;\n\t\tlet minZ = +Infinity;\n\t\tlet maxX = -Infinity;\n\t\tlet maxY = -Infinity;\n\t\tlet maxZ = -Infinity;\n\n\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\tconst x = array[i];\n\t\t\tconst y = array[i + 1];\n\t\t\tconst z = array[i + 2];\n\t\t\tif (x < minX) minX = x;\n\t\t\tif (y < minY) minY = y;\n\t\t\tif (z < minZ) minZ = z;\n\t\t\tif (x > maxX) maxX = x;\n\t\t\tif (y > maxY) maxY = y;\n\t\t\tif (z > maxZ) maxZ = z;\n\t\t}\n\n\t\tthis.min.set(minX, minY, minZ);\n\t\tthis.max.set(maxX, maxY, maxZ);\n\t\treturn this;\n\t} // setFromBufferAttribute( attribute ) {\n\t// \tlet minX = + Infinity;\n\t// \tlet minY = + Infinity;\n\t// \tlet minZ = + Infinity;\n\t// \tlet maxX = - Infinity;\n\t// \tlet maxY = - Infinity;\n\t// \tlet maxZ = - Infinity;\n\t// \tfor ( let i = 0, l = attribute.count; i < l; i ++ ) {\n\t// \t\tconst x = attribute.getX( i );\n\t// \t\tconst y = attribute.getY( i );\n\t// \t\tconst z = attribute.getZ( i );\n\t// \t\tif ( x < minX ) minX = x;\n\t// \t\tif ( y < minY ) minY = y;\n\t// \t\tif ( z < minZ ) minZ = z;\n\t// \t\tif ( x > maxX ) maxX = x;\n\t// \t\tif ( y > maxY ) maxY = y;\n\t// \t\tif ( z > maxZ ) maxZ = z;\n\t// \t}\n\t// \tthis.min.set( minX, minY, minZ );\n\t// \tthis.max.set( maxX, maxY, maxZ );\n\t// \treturn this;\n\t// }\n\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$1.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tsetFromObject(object, precise = false) {\n\t\tthis.makeEmpty();\n\t\treturn this.expandByObject(object, precise);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = this.min.z = +Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n\t}\n\n\tgetCenter(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t} // expandByObject( object, precise = false ) {\n\t// \t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t// \t// accounting for both the object's, and children's, world transforms\n\t// \tobject.updateWorldMatrix( false, false );\n\t// \tconst geometry = object.geometry;\n\t// \tif ( geometry !== undefined ) {\n\t// \t\tif ( precise && geometry.attributes != undefined && geometry.attributes.position !== undefined ) {\n\t// \t\t\tconst position = geometry.attributes.position;\n\t// \t\t\tfor ( let i = 0, l = position.count; i < l; i ++ ) {\n\t// \t\t\t\t_vector.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );\n\t// \t\t\t\tthis.expandByPoint( _vector );\n\t// \t\t\t}\n\t// \t\t} else {\n\t// \t\t\tif ( geometry.boundingBox === null ) {\n\t// \t\t\t\tgeometry.computeBoundingBox();\n\t// \t\t\t}\n\t// \t\t\t_box.copy( geometry.boundingBox );\n\t// \t\t\t_box.applyMatrix4( object.matrixWorld );\n\t// \t\t\tthis.union( _box );\n\t// \t\t}\n\t// \t}\n\t// \tconst children = object.children;\n\t// \tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\t// \t\tthis.expandByObject( children[ i ], precise );\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint(sphere.center, _vector$1); // If that point is inside the sphere, the AABB and sphere intersect.\n\n\t\treturn _vector$1.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\t\tlet min, max;\n\n\t\tif (plane.normal.x > 0) {\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\t\t} else {\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\t\t}\n\n\t\tif (plane.normal.y > 0) {\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\t\t} else {\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\t\t}\n\n\t\tif (plane.normal.z > 0) {\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\t\t} else {\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\t\t}\n\n\t\treturn min <= -plane.constant && max >= -plane.constant;\n\t}\n\n\tintersectsTriangle(triangle) {\n\t\tif (this.isEmpty()) {\n\t\t\treturn false;\n\t\t} // compute box center and extents\n\n\n\t\tthis.getCenter(_center);\n\n\t\t_extents.subVectors(this.max, _center); // translate triangle to aabb origin\n\n\n\t\t_v0$1.subVectors(triangle.a, _center);\n\n\t\t_v1$3.subVectors(triangle.b, _center);\n\n\t\t_v2$1.subVectors(triangle.c, _center); // compute edge vectors for triangle\n\n\n\t\t_f0.subVectors(_v1$3, _v0$1);\n\n\t\t_f1.subVectors(_v2$1, _v1$3);\n\n\t\t_f2.subVectors(_v0$1, _v2$1); // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\n\n\t\tlet axes = [0, -_f0.z, _f0.y, 0, -_f1.z, _f1.y, 0, -_f2.z, _f2.y, _f0.z, 0, -_f0.x, _f1.z, 0, -_f1.x, _f2.z, 0, -_f2.x, -_f0.y, _f0.x, 0, -_f1.y, _f1.x, 0, -_f2.y, _f2.x, 0];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // test 3 face normals from the aabb\n\n\n\t\taxes = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\n\n\t\t_triangleNormal.crossVectors(_f0, _f1);\n\n\t\taxes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];\n\t\treturn satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents);\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$1.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tgetBoundingSphere(target) {\n\t\tthis.getCenter(target.center);\n\t\ttarget.radius = this.getSize(_vector$1).length() * 0.5;\n\t\treturn target;\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max); // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\n\t\tif (this.isEmpty()) this.makeEmpty();\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\t// transform of empty box is an empty box.\n\t\tif (this.isEmpty()) return this; // NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\n\t\t_points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); // 000\n\n\n\t\t_points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); // 001\n\n\n\t\t_points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); // 010\n\n\n\t\t_points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); // 011\n\n\n\t\t_points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); // 100\n\n\n\t\t_points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); // 101\n\n\n\t\t_points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); // 110\n\n\n\t\t_points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); // 111\n\n\n\t\tthis.setFromPoints(_points);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nconst _points = [/*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3()];\n\nconst _vector$1 = /*@__PURE__*/new Vector3();\n\nconst _box$1 = /*@__PURE__*/new Box3(); // triangle centered vertices\n\n\nconst _v0$1 = /*@__PURE__*/new Vector3();\n\nconst _v1$3 = /*@__PURE__*/new Vector3();\n\nconst _v2$1 = /*@__PURE__*/new Vector3(); // triangle edge vectors\n\n\nconst _f0 = /*@__PURE__*/new Vector3();\n\nconst _f1 = /*@__PURE__*/new Vector3();\n\nconst _f2 = /*@__PURE__*/new Vector3();\n\nconst _center = /*@__PURE__*/new Vector3();\n\nconst _extents = /*@__PURE__*/new Vector3();\n\nconst _triangleNormal = /*@__PURE__*/new Vector3();\n\nconst _testAxis = /*@__PURE__*/new Vector3();\n\nfunction satForAxes(axes, v0, v1, v2, extents) {\n\tfor (let i = 0, j = axes.length - 3; i <= j; i += 3) {\n\t\t_testAxis.fromArray(axes, i); // project the aabb onto the separating axis\n\n\n\t\tconst r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); // project all 3 vertices of the triangle onto the separating axis\n\n\t\tconst p0 = v0.dot(_testAxis);\n\t\tconst p1 = v1.dot(_testAxis);\n\t\tconst p2 = v2.dot(_testAxis); // actual test, basically see if either of the most extreme of the triangle points intersects r\n\n\t\tif (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) {\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nfunction SRGBToLinear(c) {\n\treturn c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);\n}\nfunction LinearToSRGB(c) {\n\treturn c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;\n} // JavaScript RGB-to-RGB transforms, defined as\n// FN[InputColorSpace][OutputColorSpace] callback functions.\n\nconst FN = {\n\t[SRGBColorSpace]: {\n\t\t[LinearSRGBColorSpace]: SRGBToLinear\n\t},\n\t[LinearSRGBColorSpace]: {\n\t\t[SRGBColorSpace]: LinearToSRGB\n\t}\n};\nconst ColorManagement = {\n\tlegacyMode: true,\n\n\tget workingColorSpace() {\n\t\treturn LinearSRGBColorSpace;\n\t},\n\n\tset workingColorSpace(colorSpace) {\n\t\tconsole.warn('THREE.ColorManagement: .workingColorSpace is readonly.');\n\t},\n\n\tconvert: function (color, sourceColorSpace, targetColorSpace) {\n\t\tif (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {\n\t\t\treturn color;\n\t\t}\n\n\t\tif (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== undefined) {\n\t\t\tconst fn = FN[sourceColorSpace][targetColorSpace];\n\t\t\tcolor.r = fn(color.r);\n\t\t\tcolor.g = fn(color.g);\n\t\t\tcolor.b = fn(color.b);\n\t\t\treturn color;\n\t\t}\n\n\t\tthrow new Error('Unsupported color space conversion.');\n\t},\n\tfromWorkingColorSpace: function (color, targetColorSpace) {\n\t\treturn this.convert(color, this.workingColorSpace, targetColorSpace);\n\t},\n\ttoWorkingColorSpace: function (color, sourceColorSpace) {\n\t\treturn this.convert(color, sourceColorSpace, this.workingColorSpace);\n\t}\n};\n\nconst _colorKeywords = {\n\t'aliceblue': 0xF0F8FF,\n\t'antiquewhite': 0xFAEBD7,\n\t'aqua': 0x00FFFF,\n\t'aquamarine': 0x7FFFD4,\n\t'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC,\n\t'bisque': 0xFFE4C4,\n\t'black': 0x000000,\n\t'blanchedalmond': 0xFFEBCD,\n\t'blue': 0x0000FF,\n\t'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A,\n\t'burlywood': 0xDEB887,\n\t'cadetblue': 0x5F9EA0,\n\t'chartreuse': 0x7FFF00,\n\t'chocolate': 0xD2691E,\n\t'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED,\n\t'cornsilk': 0xFFF8DC,\n\t'crimson': 0xDC143C,\n\t'cyan': 0x00FFFF,\n\t'darkblue': 0x00008B,\n\t'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B,\n\t'darkgray': 0xA9A9A9,\n\t'darkgreen': 0x006400,\n\t'darkgrey': 0xA9A9A9,\n\t'darkkhaki': 0xBDB76B,\n\t'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F,\n\t'darkorange': 0xFF8C00,\n\t'darkorchid': 0x9932CC,\n\t'darkred': 0x8B0000,\n\t'darksalmon': 0xE9967A,\n\t'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B,\n\t'darkslategray': 0x2F4F4F,\n\t'darkslategrey': 0x2F4F4F,\n\t'darkturquoise': 0x00CED1,\n\t'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493,\n\t'deepskyblue': 0x00BFFF,\n\t'dimgray': 0x696969,\n\t'dimgrey': 0x696969,\n\t'dodgerblue': 0x1E90FF,\n\t'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0,\n\t'forestgreen': 0x228B22,\n\t'fuchsia': 0xFF00FF,\n\t'gainsboro': 0xDCDCDC,\n\t'ghostwhite': 0xF8F8FF,\n\t'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520,\n\t'gray': 0x808080,\n\t'green': 0x008000,\n\t'greenyellow': 0xADFF2F,\n\t'grey': 0x808080,\n\t'honeydew': 0xF0FFF0,\n\t'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C,\n\t'indigo': 0x4B0082,\n\t'ivory': 0xFFFFF0,\n\t'khaki': 0xF0E68C,\n\t'lavender': 0xE6E6FA,\n\t'lavenderblush': 0xFFF0F5,\n\t'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD,\n\t'lightblue': 0xADD8E6,\n\t'lightcoral': 0xF08080,\n\t'lightcyan': 0xE0FFFF,\n\t'lightgoldenrodyellow': 0xFAFAD2,\n\t'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90,\n\t'lightgrey': 0xD3D3D3,\n\t'lightpink': 0xFFB6C1,\n\t'lightsalmon': 0xFFA07A,\n\t'lightseagreen': 0x20B2AA,\n\t'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899,\n\t'lightslategrey': 0x778899,\n\t'lightsteelblue': 0xB0C4DE,\n\t'lightyellow': 0xFFFFE0,\n\t'lime': 0x00FF00,\n\t'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6,\n\t'magenta': 0xFF00FF,\n\t'maroon': 0x800000,\n\t'mediumaquamarine': 0x66CDAA,\n\t'mediumblue': 0x0000CD,\n\t'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB,\n\t'mediumseagreen': 0x3CB371,\n\t'mediumslateblue': 0x7B68EE,\n\t'mediumspringgreen': 0x00FA9A,\n\t'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585,\n\t'midnightblue': 0x191970,\n\t'mintcream': 0xF5FFFA,\n\t'mistyrose': 0xFFE4E1,\n\t'moccasin': 0xFFE4B5,\n\t'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080,\n\t'oldlace': 0xFDF5E6,\n\t'olive': 0x808000,\n\t'olivedrab': 0x6B8E23,\n\t'orange': 0xFFA500,\n\t'orangered': 0xFF4500,\n\t'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA,\n\t'palegreen': 0x98FB98,\n\t'paleturquoise': 0xAFEEEE,\n\t'palevioletred': 0xDB7093,\n\t'papayawhip': 0xFFEFD5,\n\t'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F,\n\t'pink': 0xFFC0CB,\n\t'plum': 0xDDA0DD,\n\t'powderblue': 0xB0E0E6,\n\t'purple': 0x800080,\n\t'rebeccapurple': 0x663399,\n\t'red': 0xFF0000,\n\t'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1,\n\t'saddlebrown': 0x8B4513,\n\t'salmon': 0xFA8072,\n\t'sandybrown': 0xF4A460,\n\t'seagreen': 0x2E8B57,\n\t'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D,\n\t'silver': 0xC0C0C0,\n\t'skyblue': 0x87CEEB,\n\t'slateblue': 0x6A5ACD,\n\t'slategray': 0x708090,\n\t'slategrey': 0x708090,\n\t'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F,\n\t'steelblue': 0x4682B4,\n\t'tan': 0xD2B48C,\n\t'teal': 0x008080,\n\t'thistle': 0xD8BFD8,\n\t'tomato': 0xFF6347,\n\t'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE,\n\t'wheat': 0xF5DEB3,\n\t'white': 0xFFFFFF,\n\t'whitesmoke': 0xF5F5F5,\n\t'yellow': 0xFFFF00,\n\t'yellowgreen': 0x9ACD32\n};\nconst _rgb = {\n\tr: 0,\n\tg: 0,\n\tb: 0\n};\nconst _hslA = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\nconst _hslB = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\n\nfunction hue2rgb(p, q, t) {\n\tif (t < 0) t += 1;\n\tif (t > 1) t -= 1;\n\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\tif (t < 1 / 2) return q;\n\tif (t < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t);\n\treturn p;\n}\n\nfunction toComponents(source, target) {\n\ttarget.r = source.r;\n\ttarget.g = source.g;\n\ttarget.b = source.b;\n\treturn target;\n}\n\nclass Color {\n\tconstructor(r, g, b) {\n\t\tthis.isColor = true;\n\t\tthis.r = 1;\n\t\tthis.g = 1;\n\t\tthis.b = 1;\n\n\t\tif (g === undefined && b === undefined) {\n\t\t\t// r is THREE.Color, hex or string\n\t\t\treturn this.set(r);\n\t\t}\n\n\t\treturn this.setRGB(r, g, b);\n\t}\n\n\tset(value) {\n\t\tif (value && value.isColor) {\n\t\t\tthis.copy(value);\n\t\t} else if (typeof value === 'number') {\n\t\t\tthis.setHex(value);\n\t\t} else if (typeof value === 'string') {\n\t\t\tthis.setStyle(value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\t\treturn this;\n\t}\n\n\tsetHex(hex, colorSpace = SRGBColorSpace) {\n\t\thex = Math.floor(hex);\n\t\tthis.r = (hex >> 16 & 255) / 255;\n\t\tthis.g = (hex >> 8 & 255) / 255;\n\t\tthis.b = (hex & 255) / 255;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetRGB(r, g, b, colorSpace = ColorManagement.workingColorSpace) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetHSL(h, s, l, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo(h, 1);\n\t\ts = clamp(s, 0, 1);\n\t\tl = clamp(l, 0, 1);\n\n\t\tif (s === 0) {\n\t\t\tthis.r = this.g = this.b = l;\n\t\t} else {\n\t\t\tconst p = l <= 0.5 ? l * (1 + s) : l + s - l * s;\n\t\t\tconst q = 2 * l - p;\n\t\t\tthis.r = hue2rgb(q, p, h + 1 / 3);\n\t\t\tthis.g = hue2rgb(q, p, h);\n\t\t\tthis.b = hue2rgb(q, p, h - 1 / 3);\n\t\t}\n\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetStyle(style, colorSpace = SRGBColorSpace) {\n\t\tfunction handleAlpha(string) {\n\t\t\tif (string === undefined) return;\n\n\t\t\tif (parseFloat(string) < 1) {\n\t\t\t\tconsole.warn('THREE.Color: Alpha component of ' + style + ' will be ignored.');\n\t\t\t}\n\t\t}\n\n\t\tlet m;\n\n\t\tif (m = /^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(style)) {\n\t\t\t// rgb / hsl\n\t\t\tlet color;\n\t\t\tconst name = m[1];\n\t\t\tconst components = m[2];\n\n\t\t\tswitch (name) {\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\tthis.r = Math.min(255, parseInt(color[1], 10)) / 255;\n\t\t\t\t\t\tthis.g = Math.min(255, parseInt(color[2], 10)) / 255;\n\t\t\t\t\t\tthis.b = Math.min(255, parseInt(color[3], 10)) / 255;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\tthis.r = Math.min(100, parseInt(color[1], 10)) / 100;\n\t\t\t\t\t\tthis.g = Math.min(100, parseInt(color[2], 10)) / 100;\n\t\t\t\t\t\tthis.b = Math.min(100, parseInt(color[3], 10)) / 100;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\t\t\t\t\tif (color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\tconst h = parseFloat(color[1]) / 360;\n\t\t\t\t\t\tconst s = parseFloat(color[2]) / 100;\n\t\t\t\t\t\tconst l = parseFloat(color[3]) / 100;\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this.setHSL(h, s, l, colorSpace);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (m = /^\\#([A-Fa-f\\d]+)$/.exec(style)) {\n\t\t\t// hex color\n\t\t\tconst hex = m[1];\n\t\t\tconst size = hex.length;\n\n\t\t\tif (size === 3) {\n\t\t\t\t// #ff0\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t} else if (size === 6) {\n\t\t\t\t// #ff0000\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tif (style && style.length > 0) {\n\t\t\treturn this.setColorName(style, colorSpace);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetColorName(style, colorSpace = SRGBColorSpace) {\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[style.toLowerCase()];\n\n\t\tif (hex !== undefined) {\n\t\t\t// red\n\t\t\tthis.setHex(hex, colorSpace);\n\t\t} else {\n\t\t\t// unknown color\n\t\t\tconsole.warn('THREE.Color: Unknown color ' + style);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.r, this.g, this.b);\n\t}\n\n\tcopy(color) {\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\t\treturn this;\n\t}\n\n\tcopySRGBToLinear(color) {\n\t\tthis.r = SRGBToLinear(color.r);\n\t\tthis.g = SRGBToLinear(color.g);\n\t\tthis.b = SRGBToLinear(color.b);\n\t\treturn this;\n\t}\n\n\tcopyLinearToSRGB(color) {\n\t\tthis.r = LinearToSRGB(color.r);\n\t\tthis.g = LinearToSRGB(color.g);\n\t\tthis.b = LinearToSRGB(color.b);\n\t\treturn this;\n\t}\n\n\tconvertSRGBToLinear() {\n\t\tthis.copySRGBToLinear(this);\n\t\treturn this;\n\t}\n\n\tconvertLinearToSRGB() {\n\t\tthis.copyLinearToSRGB(this);\n\t\treturn this;\n\t}\n\n\tgetHex(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\treturn clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0;\n\t}\n\n\tgetHexString(colorSpace = SRGBColorSpace) {\n\t\treturn ('000000' + this.getHex(colorSpace).toString(16)).slice(-6);\n\t}\n\n\tgetHSL(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\tconst r = _rgb.r,\n\t\t\t\t\tg = _rgb.g,\n\t\t\t\t\tb = _rgb.b;\n\t\tconst max = Math.max(r, g, b);\n\t\tconst min = Math.min(r, g, b);\n\t\tlet hue, saturation;\n\t\tconst lightness = (min + max) / 2.0;\n\n\t\tif (min === max) {\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\t\t} else {\n\t\t\tconst delta = max - min;\n\t\t\tsaturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\n\n\t\t\tswitch (max) {\n\t\t\t\tcase r:\n\t\t\t\t\thue = (g - b) / delta + (g < b ? 6 : 0);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase g:\n\t\t\t\t\thue = (b - r) / delta + 2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase b:\n\t\t\t\t\thue = (r - g) / delta + 4;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\thue /= 6;\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\t\treturn target;\n\t}\n\n\tgetRGB(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\ttarget.r = _rgb.r;\n\t\ttarget.g = _rgb.g;\n\t\ttarget.b = _rgb.b;\n\t\treturn target;\n\t}\n\n\tgetStyle(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\n\t\tif (colorSpace !== SRGBColorSpace) {\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;\n\t\t}\n\n\t\treturn `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`;\n\t}\n\n\toffsetHSL(h, s, l) {\n\t\tthis.getHSL(_hslA);\n\t\t_hslA.h += h;\n\t\t_hslA.s += s;\n\t\t_hslA.l += l;\n\t\tthis.setHSL(_hslA.h, _hslA.s, _hslA.l);\n\t\treturn this;\n\t}\n\n\tadd(color) {\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\t\treturn this;\n\t}\n\n\taddColors(color1, color2) {\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\t\treturn this;\n\t}\n\n\tsub(color) {\n\t\tthis.r = Math.max(0, this.r - color.r);\n\t\tthis.g = Math.max(0, this.g - color.g);\n\t\tthis.b = Math.max(0, this.b - color.b);\n\t\treturn this;\n\t}\n\n\tmultiply(color) {\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\t\treturn this;\n\t}\n\n\tlerp(color, alpha) {\n\t\tthis.r += (color.r - this.r) * alpha;\n\t\tthis.g += (color.g - this.g) * alpha;\n\t\tthis.b += (color.b - this.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpColors(color1, color2, alpha) {\n\t\tthis.r = color1.r + (color2.r - color1.r) * alpha;\n\t\tthis.g = color1.g + (color2.g - color1.g) * alpha;\n\t\tthis.b = color1.b + (color2.b - color1.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpHSL(color, alpha) {\n\t\tthis.getHSL(_hslA);\n\t\tcolor.getHSL(_hslB);\n\t\tconst h = lerp(_hslA.h, _hslB.h, alpha);\n\t\tconst s = lerp(_hslA.s, _hslB.s, alpha);\n\t\tconst l = lerp(_hslA.l, _hslB.l, alpha);\n\t\tthis.setHSL(h, s, l);\n\t\treturn this;\n\t}\n\n\tequals(c) {\n\t\treturn c.r === this.r && c.g === this.g && c.b === this.b;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.r = array[offset];\n\t\tthis.g = array[offset + 1];\n\t\tthis.b = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.r;\n\t\tarray[offset + 1] = this.g;\n\t\tarray[offset + 2] = this.b;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.r = attribute.getX( index );\n\t// \tthis.g = attribute.getY( index );\n\t// \tthis.b = attribute.getZ( index );\n\t// \tif ( attribute.normalized === true ) {\n\t// \t\t// assuming Uint8Array\n\t// \t\tthis.r /= 255;\n\t// \t\tthis.g /= 255;\n\t// \t\tthis.b /= 255;\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\ttoJSON() {\n\t\treturn this.getHex();\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\t}\n\n}\n\nColor.NAMES = _colorKeywords;\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\r\n */\nclass Cylindrical {\n\tconstructor(radius = 1, theta = 0, y = 0) {\n\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\n\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\n\t\tthis.y = y; // height above the x-z plane\n\n\t\treturn this;\n\t}\n\n\tset(radius, theta, y) {\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + z * z);\n\t\tthis.theta = Math.atan2(x, z);\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix4 {\n\tconstructor() {\n\t\tMatrix4.prototype.isMatrix4 = true;\n\t\tthis.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[4] = n12;\n\t\tte[8] = n13;\n\t\tte[12] = n14;\n\t\tte[1] = n21;\n\t\tte[5] = n22;\n\t\tte[9] = n23;\n\t\tte[13] = n24;\n\t\tte[2] = n31;\n\t\tte[6] = n32;\n\t\tte[10] = n33;\n\t\tte[14] = n34;\n\t\tte[3] = n41;\n\t\tte[7] = n42;\n\t\tte[11] = n43;\n\t\tte[15] = n44;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Matrix4().fromArray(this.elements);\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\tte[9] = me[9];\n\t\tte[10] = me[10];\n\t\tte[11] = me[11];\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\tte[15] = me[15];\n\t\treturn this;\n\t}\n\n\tcopyPosition(m) {\n\t\tconst te = this.elements,\n\t\t\t\t\tme = m.elements;\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrix3(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[3], me[6], 0, me[1], me[4], me[7], 0, me[2], me[5], me[8], 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrixColumn(this, 0);\n\t\tyAxis.setFromMatrixColumn(this, 1);\n\t\tzAxis.setFromMatrixColumn(this, 2);\n\t\treturn this;\n\t}\n\n\tmakeBasis(xAxis, yAxis, zAxis) {\n\t\tthis.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractRotation(m) {\n\t\t// this method does not support reflection matrices\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$2.setFromMatrixColumn(m, 0).length();\n\n\t\tconst scaleY = 1 / _v1$2.setFromMatrixColumn(m, 1).length();\n\n\t\tconst scaleZ = 1 / _v1$2.setFromMatrixColumn(m, 2).length();\n\n\t\tte[0] = me[0] * scaleX;\n\t\tte[1] = me[1] * scaleX;\n\t\tte[2] = me[2] * scaleX;\n\t\tte[3] = 0;\n\t\tte[4] = me[4] * scaleY;\n\t\tte[5] = me[5] * scaleY;\n\t\tte[6] = me[6] * scaleY;\n\t\tte[7] = 0;\n\t\tte[8] = me[8] * scaleZ;\n\t\tte[9] = me[9] * scaleZ;\n\t\tte[10] = me[10] * scaleZ;\n\t\tte[11] = 0;\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromEuler(euler) {\n\t\tconst te = this.elements;\n\t\tconst x = euler.x,\n\t\t\t\t\ty = euler.y,\n\t\t\t\t\tz = euler.z;\n\t\tconst a = Math.cos(x),\n\t\t\t\t\tb = Math.sin(x);\n\t\tconst c = Math.cos(y),\n\t\t\t\t\td = Math.sin(y);\n\t\tconst e = Math.cos(z),\n\t\t\t\t\tf = Math.sin(z);\n\n\t\tif (euler.order === 'XYZ') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -c * f;\n\t\t\tte[8] = d;\n\t\t\tte[1] = af + be * d;\n\t\t\tte[5] = ae - bf * d;\n\t\t\tte[9] = -b * c;\n\t\t\tte[2] = bf - ae * d;\n\t\t\tte[6] = be + af * d;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YXZ') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce + df * b;\n\t\t\tte[4] = de * b - cf;\n\t\t\tte[8] = a * d;\n\t\t\tte[1] = a * f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b;\n\t\t\tte[2] = cf * b - de;\n\t\t\tte[6] = df + ce * b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZXY') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce - df * b;\n\t\t\tte[4] = -a * f;\n\t\t\tte[8] = de + cf * b;\n\t\t\tte[1] = cf + de * b;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = df - ce * b;\n\t\t\tte[2] = -a * d;\n\t\t\tte[6] = b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZYX') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = be * d - af;\n\t\t\tte[8] = ae * d + bf;\n\t\t\tte[1] = c * f;\n\t\t\tte[5] = bf * d + ae;\n\t\t\tte[9] = af * d - be;\n\t\t\tte[2] = -d;\n\t\t\tte[6] = b * c;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YZX') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = bd - ac * f;\n\t\t\tte[8] = bc * f + ad;\n\t\t\tte[1] = f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b * e;\n\t\t\tte[2] = -d * e;\n\t\t\tte[6] = ad * f + bc;\n\t\t\tte[10] = ac - bd * f;\n\t\t} else if (euler.order === 'XZY') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -f;\n\t\t\tte[8] = d * e;\n\t\t\tte[1] = ac * f + bd;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = ad * f - bc;\n\t\t\tte[2] = bc * f - ad;\n\t\t\tte[6] = b * e;\n\t\t\tte[10] = bd * f + ac;\n\t\t} // bottom row\n\n\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0; // last column\n\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromQuaternion(q) {\n\t\treturn this.compose(_zero, q, _one);\n\t}\n\n\tlookAt(eye, target, up) {\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors(eye, target);\n\n\t\tif (_z.lengthSq() === 0) {\n\t\t\t// eye and target are in the same position\n\t\t\t_z.z = 1;\n\t\t}\n\n\t\t_z.normalize();\n\n\t\t_x.crossVectors(up, _z);\n\n\t\tif (_x.lengthSq() === 0) {\n\t\t\t// up and z are parallel\n\t\t\tif (Math.abs(up.z) === 1) {\n\t\t\t\t_z.x += 0.0001;\n\t\t\t} else {\n\t\t\t\t_z.z += 0.0001;\n\t\t\t}\n\n\t\t\t_z.normalize();\n\n\t\t\t_x.crossVectors(up, _z);\n\t\t}\n\n\t\t_x.normalize();\n\n\t\t_y.crossVectors(_z, _x);\n\n\t\tte[0] = _x.x;\n\t\tte[4] = _y.x;\n\t\tte[8] = _z.x;\n\t\tte[1] = _x.y;\n\t\tte[5] = _y.y;\n\t\tte[9] = _z.y;\n\t\tte[2] = _x.z;\n\t\tte[6] = _y.z;\n\t\tte[10] = _z.z;\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[4],\n\t\t\t\t\ta13 = ae[8],\n\t\t\t\t\ta14 = ae[12];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[5],\n\t\t\t\t\ta23 = ae[9],\n\t\t\t\t\ta24 = ae[13];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[6],\n\t\t\t\t\ta33 = ae[10],\n\t\t\t\t\ta34 = ae[14];\n\t\tconst a41 = ae[3],\n\t\t\t\t\ta42 = ae[7],\n\t\t\t\t\ta43 = ae[11],\n\t\t\t\t\ta44 = ae[15];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[4],\n\t\t\t\t\tb13 = be[8],\n\t\t\t\t\tb14 = be[12];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[5],\n\t\t\t\t\tb23 = be[9],\n\t\t\t\t\tb24 = be[13];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[6],\n\t\t\t\t\tb33 = be[10],\n\t\t\t\t\tb34 = be[14];\n\t\tconst b41 = be[3],\n\t\t\t\t\tb42 = be[7],\n\t\t\t\t\tb43 = be[11],\n\t\t\t\t\tb44 = be[15];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\t\tte[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[4] *= s;\n\t\tte[8] *= s;\n\t\tte[12] *= s;\n\t\tte[1] *= s;\n\t\tte[5] *= s;\n\t\tte[9] *= s;\n\t\tte[13] *= s;\n\t\tte[2] *= s;\n\t\tte[6] *= s;\n\t\tte[10] *= s;\n\t\tte[14] *= s;\n\t\tte[3] *= s;\n\t\tte[7] *= s;\n\t\tte[11] *= s;\n\t\tte[15] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst n11 = te[0],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn14 = te[12];\n\t\tconst n21 = te[1],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn24 = te[13];\n\t\tconst n31 = te[2],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn34 = te[14];\n\t\tconst n41 = te[3],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn44 = te[15]; //TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);\n\t}\n\n\ttranspose() {\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\t\ttmp = te[1];\n\t\tte[1] = te[4];\n\t\tte[4] = tmp;\n\t\ttmp = te[2];\n\t\tte[2] = te[8];\n\t\tte[8] = tmp;\n\t\ttmp = te[6];\n\t\tte[6] = te[9];\n\t\tte[9] = tmp;\n\t\ttmp = te[3];\n\t\tte[3] = te[12];\n\t\tte[12] = tmp;\n\t\ttmp = te[7];\n\t\tte[7] = te[13];\n\t\tte[13] = tmp;\n\t\ttmp = te[11];\n\t\tte[11] = te[14];\n\t\tte[14] = tmp;\n\t\treturn this;\n\t}\n\n\tsetPosition(x, y, z) {\n\t\tconst te = this.elements;\n\n\t\tif (x.isVector3) {\n\t\t\tte[12] = x.x;\n\t\t\tte[13] = x.y;\n\t\t\tte[14] = x.z;\n\t\t} else {\n\t\t\tte[12] = x;\n\t\t\tte[13] = y;\n\t\t\tte[14] = z;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tinvert() {\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn41 = te[3],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn14 = te[12],\n\t\t\t\t\tn24 = te[13],\n\t\t\t\t\tn34 = te[14],\n\t\t\t\t\tn44 = te[15],\n\t\t\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;\n\t\tte[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;\n\t\tte[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;\n\t\tte[4] = t12 * detInv;\n\t\tte[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;\n\t\tte[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;\n\t\tte[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;\n\t\tte[8] = t13 * detInv;\n\t\tte[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;\n\t\tte[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;\n\t\tte[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;\n\t\tte[12] = t14 * detInv;\n\t\tte[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;\n\t\tte[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;\n\t\tte[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;\n\t\treturn this;\n\t}\n\n\tscale(v) {\n\t\tconst te = this.elements;\n\t\tconst x = v.x,\n\t\t\t\t\ty = v.y,\n\t\t\t\t\tz = v.z;\n\t\tte[0] *= x;\n\t\tte[4] *= y;\n\t\tte[8] *= z;\n\t\tte[1] *= x;\n\t\tte[5] *= y;\n\t\tte[9] *= z;\n\t\tte[2] *= x;\n\t\tte[6] *= y;\n\t\tte[10] *= z;\n\t\tte[3] *= x;\n\t\tte[7] *= y;\n\t\tte[11] *= z;\n\t\treturn this;\n\t}\n\n\tgetMaxScaleOnAxis() {\n\t\tconst te = this.elements;\n\t\tconst scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];\n\t\tconst scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];\n\t\tconst scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];\n\t\treturn Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));\n\t}\n\n\tmakeTranslation(x, y, z) {\n\t\tthis.set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationX(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationY(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationZ(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationAxis(axis, angle) {\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\t\tconst c = Math.cos(angle);\n\t\tconst s = Math.sin(angle);\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x,\n\t\t\t\t\ty = axis.y,\n\t\t\t\t\tz = axis.z;\n\t\tconst tx = t * x,\n\t\t\t\t\tty = t * y;\n\t\tthis.set(tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y, z) {\n\t\tthis.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeShear(xy, xz, yx, yz, zx, zy) {\n\t\tthis.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\t\tconst x = quaternion._x,\n\t\t\t\t\ty = quaternion._y,\n\t\t\t\t\tz = quaternion._z,\n\t\t\t\t\tw = quaternion._w;\n\t\tconst x2 = x + x,\n\t\t\t\t\ty2 = y + y,\n\t\t\t\t\tz2 = z + z;\n\t\tconst xx = x * x2,\n\t\t\t\t\txy = x * y2,\n\t\t\t\t\txz = x * z2;\n\t\tconst yy = y * y2,\n\t\t\t\t\tyz = y * z2,\n\t\t\t\t\tzz = z * z2;\n\t\tconst wx = w * x2,\n\t\t\t\t\twy = w * y2,\n\t\t\t\t\twz = w * z2;\n\t\tconst sx = scale.x,\n\t\t\t\t\tsy = scale.y,\n\t\t\t\t\tsz = scale.z;\n\t\tte[0] = (1 - (yy + zz)) * sx;\n\t\tte[1] = (xy + wz) * sx;\n\t\tte[2] = (xz - wy) * sx;\n\t\tte[3] = 0;\n\t\tte[4] = (xy - wz) * sy;\n\t\tte[5] = (1 - (xx + zz)) * sy;\n\t\tte[6] = (yz + wx) * sy;\n\t\tte[7] = 0;\n\t\tte[8] = (xz + wy) * sz;\n\t\tte[9] = (yz - wx) * sz;\n\t\tte[10] = (1 - (xx + yy)) * sz;\n\t\tte[11] = 0;\n\t\tte[12] = position.x;\n\t\tte[13] = position.y;\n\t\tte[14] = position.z;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tdecompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$2.set(te[0], te[1], te[2]).length();\n\n\t\tconst sy = _v1$2.set(te[4], te[5], te[6]).length();\n\n\t\tconst sz = _v1$2.set(te[8], te[9], te[10]).length(); // if determine is negative, we need to invert one scale\n\n\n\t\tconst det = this.determinant();\n\t\tif (det < 0) sx = -sx;\n\t\tposition.x = te[12];\n\t\tposition.y = te[13];\n\t\tposition.z = te[14]; // scale the rotation part\n\n\t\t_m1.copy(this);\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\t\t_m1.elements[0] *= invSX;\n\t\t_m1.elements[1] *= invSX;\n\t\t_m1.elements[2] *= invSX;\n\t\t_m1.elements[4] *= invSY;\n\t\t_m1.elements[5] *= invSY;\n\t\t_m1.elements[6] *= invSY;\n\t\t_m1.elements[8] *= invSZ;\n\t\t_m1.elements[9] *= invSZ;\n\t\t_m1.elements[10] *= invSZ;\n\t\tquaternion.setFromRotationMatrix(_m1);\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\t\treturn this;\n\t}\n\n\tmakePerspective(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst x = 2 * near / (right - left);\n\t\tconst y = 2 * near / (top - bottom);\n\t\tconst a = (right + left) / (right - left);\n\t\tconst b = (top + bottom) / (top - bottom);\n\t\tconst c = -(far + near) / (far - near);\n\t\tconst d = -2 * far * near / (far - near);\n\t\tte[0] = x;\n\t\tte[4] = 0;\n\t\tte[8] = a;\n\t\tte[12] = 0;\n\t\tte[1] = 0;\n\t\tte[5] = y;\n\t\tte[9] = b;\n\t\tte[13] = 0;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = c;\n\t\tte[14] = d;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = -1;\n\t\tte[15] = 0;\n\t\treturn this;\n\t}\n\n\tmakeOrthographic(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst w = 1.0 / (right - left);\n\t\tconst h = 1.0 / (top - bottom);\n\t\tconst p = 1.0 / (far - near);\n\t\tconst x = (right + left) * w;\n\t\tconst y = (top + bottom) * h;\n\t\tconst z = (far + near) * p;\n\t\tte[0] = 2 * w;\n\t\tte[4] = 0;\n\t\tte[8] = 0;\n\t\tte[12] = -x;\n\t\tte[1] = 0;\n\t\tte[5] = 2 * h;\n\t\tte[9] = 0;\n\t\tte[13] = -y;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = -2 * p;\n\t\tte[14] = -z;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\tarray[offset + 9] = te[9];\n\t\tarray[offset + 10] = te[10];\n\t\tarray[offset + 11] = te[11];\n\t\tarray[offset + 12] = te[12];\n\t\tarray[offset + 13] = te[13];\n\t\tarray[offset + 14] = te[14];\n\t\tarray[offset + 15] = te[15];\n\t\treturn array;\n\t}\n\n}\n\nconst _v1$2 = /*@__PURE__*/new Vector3();\n\nconst _m1 = /*@__PURE__*/new Matrix4();\n\nconst _zero = /*@__PURE__*/new Vector3(0, 0, 0);\n\nconst _one = /*@__PURE__*/new Vector3(1, 1, 1);\n\nconst _x = /*@__PURE__*/new Vector3();\n\nconst _y = /*@__PURE__*/new Vector3();\n\nconst _z = /*@__PURE__*/new Vector3();\n\nconst _matrix = /*@__PURE__*/new Matrix4();\n\nconst _quaternion = /*@__PURE__*/new Quaternion();\n\nclass Euler {\n\tconstructor(x = 0, y = 0, z = 0, order = Euler.DefaultOrder) {\n\t\tthis.isEuler = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget order() {\n\t\treturn this._order;\n\t}\n\n\tset order(value) {\n\t\tthis._order = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, order = this._order) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._order);\n\t}\n\n\tcopy(euler) {\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m, order = this._order, update = true) {\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements;\n\t\tconst m11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8];\n\t\tconst m21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9];\n\t\tconst m31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._y = Math.asin(clamp(m13, -1, 1));\n\n\t\t\t\tif (Math.abs(m13) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = Math.asin(-clamp(m23, -1, 1));\n\n\t\t\t\tif (Math.abs(m23) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = Math.asin(clamp(m32, -1, 1));\n\n\t\t\t\tif (Math.abs(m32) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._y = Math.asin(-clamp(m31, -1, 1));\n\n\t\t\t\tif (Math.abs(m31) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._z = Math.asin(clamp(m21, -1, 1));\n\n\t\t\t\tif (Math.abs(m21) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m22);\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._z = Math.asin(-clamp(m12, -1, 1));\n\n\t\t\t\tif (Math.abs(m12) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._y = Math.atan2(m13, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tthis._order = order;\n\t\tif (update === true) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromQuaternion(q, order, update) {\n\t\t_matrix.makeRotationFromQuaternion(q);\n\n\t\treturn this.setFromRotationMatrix(_matrix, order, update);\n\t}\n\n\tsetFromVector3(v, order = this._order) {\n\t\treturn this.set(v.x, v.y, v.z, order);\n\t}\n\n\treorder(newOrder) {\n\t\t// WARNING: this discards revolution information -bhouston\n\t\t_quaternion.setFromEuler(this);\n\n\t\treturn this.setFromQuaternion(_quaternion, newOrder);\n\t}\n\n\tequals(euler) {\n\t\treturn euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;\n\t}\n\n\tfromArray(array) {\n\t\tthis._x = array[0];\n\t\tthis._y = array[1];\n\t\tthis._z = array[2];\n\t\tif (array[3] !== undefined) this._order = array[3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._order;\n\t\treturn array;\n\t}\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\t} // @deprecated since r138, 02cf0df1cb4575d5842fef9c85bb5a89fe020d53\n\n\n\ttoVector3() {\n\t\tconsole.error('THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead');\n\t}\n\n}\n\nEuler.DefaultOrder = 'XYZ';\nEuler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX'];\n\n/**\r\n * Abstract base class of interpolants over parametric samples.\r\n *\r\n * The parameter domain is one dimensional, typically the time or a path\r\n * along a curve defined by the data.\r\n *\r\n * The sample values can have any dimensionality and derived classes may\r\n * apply special interpretations to the data.\r\n *\r\n * This class provides the interval seek in a Template Method, deferring\r\n * the actual interpolation to derived classes.\r\n *\r\n * Time complexity is O(1) for linear access crossing at most two points\r\n * and O(log N) for random access, where N is the number of positions.\r\n *\r\n * References:\r\n *\r\n * \t\thttp://www.oodesign.com/template-method-pattern.html\r\n *\r\n */\nclass Interpolant {\n\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor(sampleSize);\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\t\tthis.settings = null;\n\t\tthis.DefaultSettings_ = {};\n\t}\n\n\tevaluate(t) {\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\t\tt1 = pp[i1],\n\t\t\t\tt0 = pp[i1 - 1];\n\n\t\tvalidate_interval: {\n\t\t\tseek: {\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if (!(t < t1)) {\n\t\t\t\t\t\tfor (let giveUpAt = i1 + 2;;) {\n\t\t\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\t\t\tif (t < t0) break forward_scan; // after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[++i1];\n\n\t\t\t\t\t\t\tif (t < t1) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the right side of the index\n\n\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} //- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\n\n\t\t\t\t\tif (!(t >= t0)) {\n\t\t\t\t\t\t// looping?\n\t\t\t\t\t\tconst t1global = pp[1];\n\n\t\t\t\t\t\tif (t < t1global) {\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\n\t\t\t\t\t\t\tt0 = t1global;\n\t\t\t\t\t\t} // linear reverse scan\n\n\n\t\t\t\t\t\tfor (let giveUpAt = i1 - 2;;) {\n\t\t\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\t\t\t// before start\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[--i1 - 1];\n\n\t\t\t\t\t\t\tif (t >= t0) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the left side of the index\n\n\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} // the interval is valid\n\n\n\t\t\t\t\tbreak validate_interval;\n\t\t\t\t} // linear scan\n\t\t\t\t// binary search\n\n\n\t\t\t\twhile (i1 < right) {\n\t\t\t\t\tconst mid = i1 + right >>> 1;\n\n\t\t\t\t\tif (t < pp[mid]) {\n\t\t\t\t\t\tright = mid;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti1 = mid + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[i1];\n\t\t\t\tt0 = pp[i1 - 1]; // check boundary cases, again\n\n\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t}\n\n\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t}\n\t\t\t} // seek\n\n\n\t\t\tthis._cachedIndex = i1;\n\t\t\tthis.intervalChanged_(i1, t0, t1);\n\t\t} // validate_interval\n\n\n\t\treturn this.interpolate_(i1, t0, t, t1);\n\t}\n\n\tgetSettings_() {\n\t\treturn this.settings || this.DefaultSettings_;\n\t}\n\n\tcopySampleValue_(index) {\n\t\t// copies a sample value to the result buffer\n\t\tconst result = this.resultBuffer,\n\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\toffset = index * stride;\n\n\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\tresult[i] = values[offset + i];\n\t\t}\n\n\t\treturn result;\n\t} // Template methods for derived classes:\n\n\n\tinterpolate_() {\n\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t}\n\n\tintervalChanged_() {// empty\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/new Vector3();\n\nconst _startEnd = /*@__PURE__*/new Vector3();\n\nclass Line3 {\n\tconstructor(start = new Vector3(), end = new Vector3()) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t}\n\n\tset(start, end) {\n\t\tthis.start.copy(start);\n\t\tthis.end.copy(end);\n\t\treturn this;\n\t}\n\n\tcopy(line) {\n\t\tthis.start.copy(line.start);\n\t\tthis.end.copy(line.end);\n\t\treturn this;\n\t}\n\n\tgetCenter(target) {\n\t\treturn target.addVectors(this.start, this.end).multiplyScalar(0.5);\n\t}\n\n\tdelta(target) {\n\t\treturn target.subVectors(this.end, this.start);\n\t}\n\n\tdistanceSq() {\n\t\treturn this.start.distanceToSquared(this.end);\n\t}\n\n\tdistance() {\n\t\treturn this.start.distanceTo(this.end);\n\t}\n\n\tat(t, target) {\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tclosestPointToPointParameter(point, clampToLine) {\n\t\t_startP.subVectors(point, this.start);\n\n\t\t_startEnd.subVectors(this.end, this.start);\n\n\t\tconst startEnd2 = _startEnd.dot(_startEnd);\n\n\t\tconst startEnd_startP = _startEnd.dot(_startP);\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif (clampToLine) {\n\t\t\tt = clamp(t, 0, 1);\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tclosestPointToPoint(point, clampToLine, target) {\n\t\tconst t = this.closestPointToPointParameter(point, clampToLine);\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.start.applyMatrix4(matrix);\n\t\tthis.end.applyMatrix4(matrix);\n\t\treturn this;\n\t}\n\n\tequals(line) {\n\t\treturn line.start.equals(this.start) && line.end.equals(this.end);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix3 {\n\tconstructor() {\n\t\tMatrix3.prototype.isMatrix3 = true;\n\t\tthis.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n21, n22, n23, n31, n32, n33) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[1] = n21;\n\t\tte[2] = n31;\n\t\tte[3] = n12;\n\t\tte[4] = n22;\n\t\tte[5] = n32;\n\t\tte[6] = n13;\n\t\tte[7] = n23;\n\t\tte[8] = n33;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 1, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrix3Column(this, 0);\n\t\tyAxis.setFromMatrix3Column(this, 1);\n\t\tzAxis.setFromMatrix3Column(this, 2);\n\t\treturn this;\n\t}\n\n\tsetFromMatrix4(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10]);\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[3],\n\t\t\t\t\ta13 = ae[6];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[4],\n\t\t\t\t\ta23 = ae[7];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[5],\n\t\t\t\t\ta33 = ae[8];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[3],\n\t\t\t\t\tb13 = be[6];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[4],\n\t\t\t\t\tb23 = be[7];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[5],\n\t\t\t\t\tb33 = be[8];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[3] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[4] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[5] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[3] *= s;\n\t\tte[6] *= s;\n\t\tte[1] *= s;\n\t\tte[4] *= s;\n\t\tte[7] *= s;\n\t\tte[2] *= s;\n\t\tte[5] *= s;\n\t\tte[8] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst a = te[0],\n\t\t\t\t\tb = te[1],\n\t\t\t\t\tc = te[2],\n\t\t\t\t\td = te[3],\n\t\t\t\t\te = te[4],\n\t\t\t\t\tf = te[5],\n\t\t\t\t\tg = te[6],\n\t\t\t\t\th = te[7],\n\t\t\t\t\ti = te[8];\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\t}\n\n\tinvert() {\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn12 = te[3],\n\t\t\t\t\tn22 = te[4],\n\t\t\t\t\tn32 = te[5],\n\t\t\t\t\tn13 = te[6],\n\t\t\t\t\tn23 = te[7],\n\t\t\t\t\tn33 = te[8],\n\t\t\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\t\t\tt13 = n23 * n12 - n22 * n13,\n\t\t\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n31 * n23 - n33 * n21) * detInv;\n\t\tte[2] = (n32 * n21 - n31 * n22) * detInv;\n\t\tte[3] = t12 * detInv;\n\t\tte[4] = (n33 * n11 - n31 * n13) * detInv;\n\t\tte[5] = (n31 * n12 - n32 * n11) * detInv;\n\t\tte[6] = t13 * detInv;\n\t\tte[7] = (n21 * n13 - n23 * n11) * detInv;\n\t\tte[8] = (n22 * n11 - n21 * n12) * detInv;\n\t\treturn this;\n\t}\n\n\ttranspose() {\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\t\ttmp = m[1];\n\t\tm[1] = m[3];\n\t\tm[3] = tmp;\n\t\ttmp = m[2];\n\t\tm[2] = m[6];\n\t\tm[6] = tmp;\n\t\ttmp = m[5];\n\t\tm[5] = m[7];\n\t\tm[7] = tmp;\n\t\treturn this;\n\t}\n\n\tgetNormalMatrix(matrix4) {\n\t\treturn this.setFromMatrix4(matrix4).invert().transpose();\n\t}\n\n\ttransposeIntoArray(r) {\n\t\tconst m = this.elements;\n\t\tr[0] = m[0];\n\t\tr[1] = m[3];\n\t\tr[2] = m[6];\n\t\tr[3] = m[1];\n\t\tr[4] = m[4];\n\t\tr[5] = m[7];\n\t\tr[6] = m[2];\n\t\tr[7] = m[5];\n\t\tr[8] = m[8];\n\t\treturn this;\n\t}\n\n\tsetUvTransform(tx, ty, sx, sy, rotation, cx, cy) {\n\t\tconst c = Math.cos(rotation);\n\t\tconst s = Math.sin(rotation);\n\t\tthis.set(sx * c, sx * s, -sx * (c * cx + s * cy) + cx + tx, -sy * s, sy * c, -sy * (-s * cx + c * cy) + cy + ty, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tscale(sx, sy) {\n\t\tthis.premultiply(_m3.makeScale(sx, sy));\n\t\treturn this;\n\t}\n\n\trotate(theta) {\n\t\tthis.premultiply(_m3.makeRotation(-theta));\n\t\treturn this;\n\t}\n\n\ttranslate(tx, ty) {\n\t\tthis.premultiply(_m3.makeTranslation(tx, ty));\n\t\treturn this;\n\t} // for 2D Transforms\n\n\n\tmakeTranslation(x, y) {\n\t\tthis.set(1, 0, x, 0, 1, y, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotation(theta) {\n\t\t// counterclockwise\n\t\tconst c = Math.cos(theta);\n\t\tconst s = Math.sin(theta);\n\t\tthis.set(c, -s, 0, s, c, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y) {\n\t\tthis.set(x, 0, 0, 0, y, 0, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\treturn array;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().fromArray(this.elements);\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/new Matrix3();\n\nconst _vector1 = /*@__PURE__*/new Vector3();\n\nconst _vector2 = /*@__PURE__*/new Vector3();\n\nconst _normalMatrix = /*@__PURE__*/new Matrix3();\n\nclass Plane {\n\tconstructor(normal = new Vector3(1, 0, 0), constant = 0) {\n\t\tthis.isPlane = true; // normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\t}\n\n\tset(normal, constant) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = constant;\n\t\treturn this;\n\t}\n\n\tsetComponents(x, y, z, w) {\n\t\tthis.normal.set(x, y, z);\n\t\tthis.constant = w;\n\t\treturn this;\n\t}\n\n\tsetFromNormalAndCoplanarPoint(normal, point) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = -point.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tsetFromCoplanarPoints(a, b, c) {\n\t\tconst normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize(); // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\n\t\tthis.setFromNormalAndCoplanarPoint(normal, a);\n\t\treturn this;\n\t}\n\n\tcopy(plane) {\n\t\tthis.normal.copy(plane.normal);\n\t\tthis.constant = plane.constant;\n\t\treturn this;\n\t}\n\n\tnormalize() {\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar(inverseNormalLength);\n\t\tthis.constant *= inverseNormalLength;\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.constant *= -1;\n\t\tthis.normal.negate();\n\t\treturn this;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn this.normal.dot(point) + this.constant;\n\t}\n\n\tdistanceToSphere(sphere) {\n\t\treturn this.distanceToPoint(sphere.center) - sphere.radius;\n\t}\n\n\tprojectPoint(point, target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);\n\t}\n\n\tintersectLine(line, target) {\n\t\tconst direction = line.delta(_vector1);\n\t\tconst denominator = this.normal.dot(direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (this.distanceToPoint(line.start) === 0) {\n\t\t\t\treturn target.copy(line.start);\n\t\t\t} // Unsure if this is the correct method to handle this case.\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(line.start.dot(this.normal) + this.constant) / denominator;\n\n\t\tif (t < 0 || t > 1) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn target.copy(direction).multiplyScalar(t).add(line.start);\n\t}\n\n\tintersectsLine(line) {\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\t\tconst startSign = this.distanceToPoint(line.start);\n\t\tconst endSign = this.distanceToPoint(line.end);\n\t\treturn startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsPlane(this);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn sphere.intersectsPlane(this);\n\t}\n\n\tcoplanarPoint(target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.constant);\n\t}\n\n\tapplyMatrix4(matrix, optionalNormalMatrix) {\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);\n\n\t\tconst referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);\n\t\tconst normal = this.normal.applyMatrix3(normalMatrix).normalize();\n\t\tthis.constant = -referencePoint.dot(normal);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.constant -= offset.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tequals(plane) {\n\t\treturn plane.normal.equals(this.normal) && plane.constant === this.constant;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/new Vector3();\n\nconst _segCenter = /*@__PURE__*/new Vector3();\n\nconst _segDir = /*@__PURE__*/new Vector3();\n\nconst _diff = /*@__PURE__*/new Vector3();\n\nconst _edge1 = /*@__PURE__*/new Vector3();\n\nconst _edge2 = /*@__PURE__*/new Vector3();\n\nconst _normal = /*@__PURE__*/new Vector3();\n\nclass Ray {\n\tconstructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\t}\n\n\tset(origin, direction) {\n\t\tthis.origin.copy(origin);\n\t\tthis.direction.copy(direction);\n\t\treturn this;\n\t}\n\n\tcopy(ray) {\n\t\tthis.origin.copy(ray.origin);\n\t\tthis.direction.copy(ray.direction);\n\t\treturn this;\n\t}\n\n\tat(t, target = new Vector3()) {\n\t\treturn target.copy(this.direction).multiplyScalar(t).add(this.origin);\n\t}\n\n\tlookAt(v) {\n\t\tthis.direction.copy(v).sub(this.origin).normalize();\n\t\treturn this;\n\t}\n\n\trecast(t) {\n\t\tthis.origin.copy(this.at(t, _vector));\n\t\treturn this;\n\t}\n\n\tclosestPointToPoint(point, target = new Vector3()) {\n\t\ttarget.subVectors(point, this.origin);\n\t\tconst directionDistance = target.dot(this.direction);\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn target.copy(this.origin);\n\t\t}\n\n\t\treturn target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn Math.sqrt(this.distanceSqToPoint(point));\n\t}\n\n\tdistanceSqToPoint(point) {\n\t\tconst directionDistance = _vector.subVectors(point, this.origin).dot(this.direction); // point behind the ray\n\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn this.origin.distanceToSquared(point);\n\t\t}\n\n\t\t_vector.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\n\t\treturn _vector.distanceToSquared(point);\n\t}\n\n\tdistanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\t\t_segCenter.copy(v0).add(v1).multiplyScalar(0.5);\n\n\t\t_segDir.copy(v1).sub(v0).normalize();\n\n\t\t_diff.copy(this.origin).sub(_segCenter);\n\n\t\tconst segExtent = v0.distanceTo(v1) * 0.5;\n\t\tconst a01 = -this.direction.dot(_segDir);\n\n\t\tconst b0 = _diff.dot(this.direction);\n\n\t\tconst b1 = -_diff.dot(_segDir);\n\n\t\tconst c = _diff.lengthSq();\n\n\t\tconst det = Math.abs(1 - a01 * a01);\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif (det > 0) {\n\t\t\t// The ray and segment are not parallel.\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif (s0 >= 0) {\n\t\t\t\tif (s1 >= -extDet) {\n\t\t\t\t\tif (s1 <= extDet) {\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 1\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// region 5\n\t\t\t\t\ts1 = -segExtent;\n\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s1 <= -extDet) {\n\t\t\t\t\t// region 4\n\t\t\t\t\ts0 = Math.max(0, -(-a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else if (s1 <= extDet) {\n\t\t\t\t\t// region 3\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else {\n\t\t\t\t\t// region 2\n\t\t\t\t\ts0 = Math.max(0, -(a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Ray and segment are parallel.\n\t\t\ts1 = a01 > 0 ? -segExtent : segExtent;\n\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t}\n\n\t\tif (optionalPointOnRay) {\n\t\t\toptionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);\n\t\t}\n\n\t\tif (optionalPointOnSegment) {\n\t\t\toptionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);\n\t\t}\n\n\t\treturn sqrDist;\n\t}\n\n\tintersectSphere(sphere, target = new Vector3()) {\n\t\t_vector.subVectors(sphere.center, this.origin);\n\n\t\tconst tca = _vector.dot(this.direction);\n\n\t\tconst d2 = _vector.dot(_vector) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\t\tif (d2 > radius2) return null;\n\t\tconst thc = Math.sqrt(radius2 - d2); // t0 = first intersect point - entrance on front of sphere\n\n\t\tconst t0 = tca - thc; // t1 = second intersect point - exit point on back of sphere\n\n\t\tconst t1 = tca + thc; // test to see if both t0 and t1 are behind the ray - if so, return null\n\n\t\tif (t0 < 0 && t1 < 0) return null; // test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\n\t\tif (t0 < 0) return this.at(t1, target); // else t0 is in front of the ray, so return the first collision point scaled by t0\n\n\t\treturn this.at(t0, target);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tdistanceToPlane(plane) {\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (plane.distanceToPoint(this.origin) === 0) {\n\t\t\t\treturn 0;\n\t\t\t} // Null is preferable to undefined since undefined means.... it is undefined\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(this.origin.dot(plane.normal) + plane.constant) / denominator; // Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\t}\n\n\tintersectPlane(plane, target) {\n\t\tconst t = this.distanceToPlane(plane);\n\n\t\tif (t === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.at(t, target);\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// check if the ray lies on the plane first\n\t\tconst distToPoint = plane.distanceToPoint(this.origin);\n\n\t\tif (distToPoint === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator * distToPoint < 0) {\n\t\t\treturn true;\n\t\t} // ray origin is behind the plane (and is pointing behind it)\n\n\n\t\treturn false;\n\t}\n\n\tintersectBox(box, target) {\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\t\t\tinvdirz = 1 / this.direction.z;\n\t\tconst origin = this.origin;\n\n\t\tif (invdirx >= 0) {\n\t\t\ttmin = (box.min.x - origin.x) * invdirx;\n\t\t\ttmax = (box.max.x - origin.x) * invdirx;\n\t\t} else {\n\t\t\ttmin = (box.max.x - origin.x) * invdirx;\n\t\t\ttmax = (box.min.x - origin.x) * invdirx;\n\t\t}\n\n\t\tif (invdiry >= 0) {\n\t\t\ttymin = (box.min.y - origin.y) * invdiry;\n\t\t\ttymax = (box.max.y - origin.y) * invdiry;\n\t\t} else {\n\t\t\ttymin = (box.max.y - origin.y) * invdiry;\n\t\t\ttymax = (box.min.y - origin.y) * invdiry;\n\t\t}\n\n\t\tif (tmin > tymax || tymin > tmax) return null; // These lines also handle the case where tmin or tmax is NaN\n\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\tif (tymin > tmin || tmin !== tmin) tmin = tymin;\n\t\tif (tymax < tmax || tmax !== tmax) tmax = tymax;\n\n\t\tif (invdirz >= 0) {\n\t\t\ttzmin = (box.min.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.max.z - origin.z) * invdirz;\n\t\t} else {\n\t\t\ttzmin = (box.max.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.min.z - origin.z) * invdirz;\n\t\t}\n\n\t\tif (tmin > tzmax || tzmin > tmax) return null;\n\t\tif (tzmin > tmin || tmin !== tmin) tmin = tzmin;\n\t\tif (tzmax < tmax || tmax !== tmax) tmax = tzmax; //return point closest to the ray (positive side)\n\n\t\tif (tmax < 0) return null;\n\t\treturn this.at(tmin >= 0 ? tmin : tmax, target);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn this.intersectBox(box, _vector) !== null;\n\t}\n\n\tintersectTriangle(a, b, c, backfaceCulling, target) {\n\t\t// Compute the offset origin, edges, and normal.\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\t\t_edge1.subVectors(b, a);\n\n\t\t_edge2.subVectors(c, a);\n\n\t\t_normal.crossVectors(_edge1, _edge2); // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t//\t |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t//\t |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t//\t |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\n\n\t\tlet DdN = this.direction.dot(_normal);\n\t\tlet sign;\n\n\t\tif (DdN > 0) {\n\t\t\tif (backfaceCulling) return null;\n\t\t\tsign = 1;\n\t\t} else if (DdN < 0) {\n\t\t\tsign = -1;\n\t\t\tDdN = -DdN;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\n\t\t_diff.subVectors(this.origin, a);\n\n\t\tconst DdQxE2 = sign * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); // b1 < 0, no intersection\n\n\t\tif (DdQxE2 < 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot(_edge1.cross(_diff)); // b2 < 0, no intersection\n\n\t\tif (DdE1xQ < 0) {\n\t\t\treturn null;\n\t\t} // b1+b2 > 1, no intersection\n\n\n\t\tif (DdQxE2 + DdE1xQ > DdN) {\n\t\t\treturn null;\n\t\t} // Line intersects triangle, check if ray does.\n\n\n\t\tconst QdN = -sign * _diff.dot(_normal); // t < 0, no intersection\n\n\n\t\tif (QdN < 0) {\n\t\t\treturn null;\n\t\t} // Ray intersects triangle.\n\n\n\t\treturn this.at(QdN / DdN, target);\n\t}\n\n\tapplyMatrix4(matrix4) {\n\t\tthis.origin.applyMatrix4(matrix4);\n\t\tthis.direction.transformDirection(matrix4);\n\t\treturn this;\n\t}\n\n\tequals(ray) {\n\t\treturn ray.origin.equals(this.origin) && ray.direction.equals(this.direction);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _box = /*@__PURE__*/new Box3();\n\nconst _v1$1 = /*@__PURE__*/new Vector3();\n\nconst _toFarthestPoint = /*@__PURE__*/new Vector3();\n\nconst _toPoint = /*@__PURE__*/new Vector3();\n\nclass Sphere {\n\tconstructor(center = new Vector3(), radius = -1) {\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\t}\n\n\tset(center, radius) {\n\t\tthis.center.copy(center);\n\t\tthis.radius = radius;\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points, optionalCenter) {\n\t\tconst center = this.center;\n\n\t\tif (optionalCenter !== undefined) {\n\t\t\tcenter.copy(optionalCenter);\n\t\t} else {\n\t\t\t_box.setFromPoints(points).getCenter(center);\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));\n\t\t}\n\n\t\tthis.radius = Math.sqrt(maxRadiusSq);\n\t\treturn this;\n\t}\n\n\tcopy(sphere) {\n\t\tthis.center.copy(sphere.center);\n\t\tthis.radius = sphere.radius;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\treturn this.radius < 0;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.center.set(0, 0, 0);\n\t\tthis.radius = -1;\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.distanceToSquared(this.center) <= this.radius * this.radius;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn point.distanceTo(this.center) - this.radius;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\tconst radiusSum = this.radius + sphere.radius;\n\t\treturn sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsSphere(this);\n\t}\n\n\tintersectsPlane(plane) {\n\t\treturn Math.abs(plane.distanceToPoint(this.center)) <= this.radius;\n\t}\n\n\tclampPoint(point, target) {\n\t\tconst deltaLengthSq = this.center.distanceToSquared(point);\n\t\ttarget.copy(point);\n\n\t\tif (deltaLengthSq > this.radius * this.radius) {\n\t\t\ttarget.sub(this.center).normalize();\n\t\t\ttarget.multiplyScalar(this.radius).add(this.center);\n\t\t}\n\n\t\treturn target;\n\t}\n\n\tgetBoundingBox(target) {\n\t\tif (this.isEmpty()) {\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\t\t}\n\n\t\ttarget.set(this.center, this.center);\n\t\ttarget.expandByScalar(this.radius);\n\t\treturn target;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.center.applyMatrix4(matrix);\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.center.add(offset);\n\t\treturn this;\n\t}\n\n\texpandByPoint(point) {\n\t\tif (this.isEmpty()) {\n\t\t\tthis.center.copy(point);\n\t\t\tthis.radius = 0;\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671\n\n\n\t\t_toPoint.subVectors(point, this.center);\n\n\t\tconst lengthSq = _toPoint.lengthSq();\n\n\t\tif (lengthSq > this.radius * this.radius) {\n\t\t\tconst length = Math.sqrt(lengthSq);\n\t\t\tconst missingRadiusHalf = (length - this.radius) * 0.5; // Nudge this sphere towards the target point. Add half the missing distance to radius,\n\t\t\t// and the other half to position. This gives a tighter enclosure, instead of if\n\t\t\t// the whole missing distance were just added to radius.\n\n\t\t\tthis.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length));\n\t\t\tthis.radius += missingRadiusHalf;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tunion(sphere) {\n\t\t// handle empty sphere cases\n\t\tif (sphere.isEmpty()) {\n\t\t\treturn;\n\t\t} else if (this.isEmpty()) {\n\t\t\tthis.copy(sphere);\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769\n\t\t// To enclose another sphere into this sphere, we only need to enclose two points:\n\t\t// 1) Enclose the farthest point on the other sphere into this sphere.\n\t\t// 2) Enclose the opposite point of the farthest point into this sphere.\n\n\n\t\tif (this.center.equals(sphere.center) === true) {\n\t\t\t_toFarthestPoint.set(0, 0, 1).multiplyScalar(sphere.radius);\n\t\t} else {\n\t\t\t_toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);\n\t\t}\n\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).add(_toFarthestPoint));\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).sub(_toFarthestPoint));\n\t\treturn this;\n\t}\n\n\tequals(sphere) {\n\t\treturn sphere.center.equals(this.center) && sphere.radius === this.radius;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\r\n *\r\n * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\r\n * The azimuthal angle (theta) is measured from the positive z-axis.\r\n */\n\nclass Spherical {\n\tconstructor(radius = 1, phi = 0, theta = 0) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi; // polar angle\n\n\t\tthis.theta = theta; // azimuthal angle\n\n\t\treturn this;\n\t}\n\n\tset(radius, phi, theta) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\t\treturn this;\n\t} // restrict phi to be between EPS and PI-EPS\n\n\n\tmakeSafe() {\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi));\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + y * y + z * z);\n\n\t\tif (this.radius === 0) {\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\t\t} else {\n\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\tthis.phi = Math.acos(clamp(y / this.radius, -1, 1));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/new Vector3();\n\nconst _v1 = /*@__PURE__*/new Vector3();\n\nconst _v2 = /*@__PURE__*/new Vector3();\n\nconst _v3 = /*@__PURE__*/new Vector3();\n\nconst _vab = /*@__PURE__*/new Vector3();\n\nconst _vac = /*@__PURE__*/new Vector3();\n\nconst _vbc = /*@__PURE__*/new Vector3();\n\nconst _vap = /*@__PURE__*/new Vector3();\n\nconst _vbp = /*@__PURE__*/new Vector3();\n\nconst _vcp = /*@__PURE__*/new Vector3();\n\nclass Triangle {\n\tconstructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\t}\n\n\tstatic getNormal(a, b, c, target) {\n\t\ttarget.subVectors(c, b);\n\n\t\t_v0.subVectors(a, b);\n\n\t\ttarget.cross(_v0);\n\t\tconst targetLengthSq = target.lengthSq();\n\n\t\tif (targetLengthSq > 0) {\n\t\t\treturn target.multiplyScalar(1 / Math.sqrt(targetLengthSq));\n\t\t}\n\n\t\treturn target.set(0, 0, 0);\n\t} // static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\n\tstatic getBarycoord(point, a, b, c, target) {\n\t\t_v0.subVectors(c, a);\n\n\t\t_v1.subVectors(b, a);\n\n\t\t_v2.subVectors(point, a);\n\n\t\tconst dot00 = _v0.dot(_v0);\n\n\t\tconst dot01 = _v0.dot(_v1);\n\n\t\tconst dot02 = _v0.dot(_v2);\n\n\t\tconst dot11 = _v1.dot(_v1);\n\n\t\tconst dot12 = _v1.dot(_v2);\n\n\t\tconst denom = dot00 * dot11 - dot01 * dot01; // collinear or singular triangle\n\n\t\tif (denom === 0) {\n\t\t\t// arbitrary location outside of triangle?\n\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\treturn target.set(-2, -1, -1);\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n\t\tconst v = (dot00 * dot12 - dot01 * dot02) * invDenom; // barycentric coordinates must always sum to 1\n\n\t\treturn target.set(1 - u - v, v, u);\n\t}\n\n\tstatic containsPoint(point, a, b, c) {\n\t\tthis.getBarycoord(point, a, b, c, _v3);\n\t\treturn _v3.x >= 0 && _v3.y >= 0 && _v3.x + _v3.y <= 1;\n\t}\n\n\tstatic getUV(point, p1, p2, p3, uv1, uv2, uv3, target) {\n\t\tthis.getBarycoord(point, p1, p2, p3, _v3);\n\t\ttarget.set(0, 0);\n\t\ttarget.addScaledVector(uv1, _v3.x);\n\t\ttarget.addScaledVector(uv2, _v3.y);\n\t\ttarget.addScaledVector(uv3, _v3.z);\n\t\treturn target;\n\t}\n\n\tstatic isFrontFacing(a, b, c, direction) {\n\t\t_v0.subVectors(c, b);\n\n\t\t_v1.subVectors(a, b); // strictly front facing\n\n\n\t\treturn _v0.cross(_v1).dot(direction) < 0 ? true : false;\n\t}\n\n\tset(a, b, c) {\n\t\tthis.a.copy(a);\n\t\tthis.b.copy(b);\n\t\tthis.c.copy(c);\n\t\treturn this;\n\t}\n\n\tsetFromPointsAndIndices(points, i0, i1, i2) {\n\t\tthis.a.copy(points[i0]);\n\t\tthis.b.copy(points[i1]);\n\t\tthis.c.copy(points[i2]);\n\t\treturn this;\n\t} // setFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\t// \tthis.a.fromBufferAttribute( attribute, i0 );\n\t// \tthis.b.fromBufferAttribute( attribute, i1 );\n\t// \tthis.c.fromBufferAttribute( attribute, i2 );\n\t// \treturn this;\n\t// }\n\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(triangle) {\n\t\tthis.a.copy(triangle.a);\n\t\tthis.b.copy(triangle.b);\n\t\tthis.c.copy(triangle.c);\n\t\treturn this;\n\t}\n\n\tgetArea() {\n\t\t_v0.subVectors(this.c, this.b);\n\n\t\t_v1.subVectors(this.a, this.b);\n\n\t\treturn _v0.cross(_v1).length() * 0.5;\n\t}\n\n\tgetMidpoint(target) {\n\t\treturn target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n\t}\n\n\tgetNormal(target) {\n\t\treturn Triangle.getNormal(this.a, this.b, this.c, target);\n\t}\n\n\tgetPlane(target) {\n\t\treturn target.setFromCoplanarPoints(this.a, this.b, this.c);\n\t}\n\n\tgetBarycoord(point, target) {\n\t\treturn Triangle.getBarycoord(point, this.a, this.b, this.c, target);\n\t}\n\n\tgetUV(point, uv1, uv2, uv3, target) {\n\t\treturn Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target);\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn Triangle.containsPoint(point, this.a, this.b, this.c);\n\t}\n\n\tisFrontFacing(direction) {\n\t\treturn Triangle.isFrontFacing(this.a, this.b, this.c, direction);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsTriangle(this);\n\t}\n\n\tclosestPointToPoint(p, target) {\n\t\tconst a = this.a,\n\t\t\t\t\tb = this.b,\n\t\t\t\t\tc = this.c;\n\t\tlet v, w; // algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors(b, a);\n\n\t\t_vac.subVectors(c, a);\n\n\t\t_vap.subVectors(p, a);\n\n\t\tconst d1 = _vab.dot(_vap);\n\n\t\tconst d2 = _vac.dot(_vap);\n\n\t\tif (d1 <= 0 && d2 <= 0) {\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy(a);\n\t\t}\n\n\t\t_vbp.subVectors(p, b);\n\n\t\tconst d3 = _vab.dot(_vbp);\n\n\t\tconst d4 = _vac.dot(_vbp);\n\n\t\tif (d3 >= 0 && d4 <= d3) {\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy(b);\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\n\t\tif (vc <= 0 && d1 >= 0 && d3 <= 0) {\n\t\t\tv = d1 / (d1 - d3); // edge region of AB; barycentric coords (1-v, v, 0)\n\n\t\t\treturn target.copy(a).addScaledVector(_vab, v);\n\t\t}\n\n\t\t_vcp.subVectors(p, c);\n\n\t\tconst d5 = _vab.dot(_vcp);\n\n\t\tconst d6 = _vac.dot(_vcp);\n\n\t\tif (d6 >= 0 && d5 <= d6) {\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy(c);\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\n\t\tif (vb <= 0 && d2 >= 0 && d6 <= 0) {\n\t\t\tw = d2 / (d2 - d6); // edge region of AC; barycentric coords (1-w, 0, w)\n\n\t\t\treturn target.copy(a).addScaledVector(_vac, w);\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\n\t\tif (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {\n\t\t\t_vbc.subVectors(c, b);\n\n\t\t\tw = (d4 - d3) / (d4 - d3 + (d5 - d6)); // edge region of BC; barycentric coords (0, 1-w, w)\n\n\t\t\treturn target.copy(b).addScaledVector(_vbc, w); // edge region of BC\n\t\t} // face region\n\n\n\t\tconst denom = 1 / (va + vb + vc); // u = va * denom\n\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\t\treturn target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w);\n\t}\n\n\tequals(triangle) {\n\t\treturn triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);\n\t}\n\n}\n\nclass Vector4 {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tVector4.prototype.isVector4 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t}\n\n\tget width() {\n\t\treturn this.z;\n\t}\n\n\tset width(value) {\n\t\tthis.z = value;\n\t}\n\n\tget height() {\n\t\treturn this.w;\n\t}\n\n\tset height(value) {\n\t\tthis.w = value;\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetW(w) {\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tthis.w = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tcase 3:\n\t\t\t\treturn this.w;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z, this.w);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = v.w !== undefined ? v.w : 1;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z,\n\t\t\t\t\tw = this.w;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w;\n\t\tthis.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tsetAxisAngleFromQuaternion(q) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\t\t// q is assumed to be normalized\n\t\tthis.w = 2 * Math.acos(q.w);\n\t\tconst s = Math.sqrt(1 - q.w * q.w);\n\n\t\tif (s < 0.0001) {\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\t\t} else {\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetAxisAngleFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tlet angle, x, y, z; // variables for result\n\n\t\tconst epsilon = 0.01,\n\t\t\t\t\t// margin to allow for rounding errors\n\t\tepsilon2 = 0.1,\n\t\t\t\t\t// margin to distinguish between 0 and 180 degrees\n\t\tte = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tif (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\t\t\tif (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\t\t\t\tthis.set(1, 0, 0, 0);\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\t\t\t} // otherwise this singularity is angle = 180\n\n\n\t\t\tangle = Math.PI;\n\t\t\tconst xx = (m11 + 1) / 2;\n\t\t\tconst yy = (m22 + 1) / 2;\n\t\t\tconst zz = (m33 + 1) / 2;\n\t\t\tconst xy = (m12 + m21) / 4;\n\t\t\tconst xz = (m13 + m31) / 4;\n\t\t\tconst yz = (m23 + m32) / 4;\n\n\t\t\tif (xx > yy && xx > zz) {\n\t\t\t\t// m11 is the largest diagonal term\n\t\t\t\tif (xx < epsilon) {\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\tx = Math.sqrt(xx);\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\t\t\t\t}\n\t\t\t} else if (yy > zz) {\n\t\t\t\t// m22 is the largest diagonal term\n\t\t\t\tif (yy < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\ty = Math.sqrt(yy);\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\t\t\t\tif (zz < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\t\t\t\t} else {\n\t\t\t\t\tz = Math.sqrt(zz);\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.set(x, y, z, angle);\n\t\t\treturn this; // return 180 deg rotation\n\t\t} // as we have reached here there are no singularities so we can handle normally\n\n\n\t\tlet s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); // used to normalize\n\n\t\tif (Math.abs(s) < 0.001) s = 1; // prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = (m32 - m23) / s;\n\t\tthis.y = (m13 - m31) / s;\n\t\tthis.z = (m21 - m12) / s;\n\t\tthis.w = Math.acos((m11 + m22 + m33 - 1) / 2);\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\tthis.w = Math.min(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\tthis.w = Math.max(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\tthis.w = Math.max(min.w, Math.min(max.w, this.w));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\tthis.w = Math.max(minVal, Math.min(maxVal, this.w));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\tthis.w = Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\tthis.w = Math.ceil(this.w);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\tthis.w = Math.round(this.w);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\tthis.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\tthis.w = -this.w;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\tthis.w += (v.w - this.w) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\tthis.w = v1.w + (v2.w - v1.w) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\tthis.w = array[offset + 3];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\tarray[offset + 3] = this.w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \tthis.w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\t}\n\n}\n\nexports.ACESFilmicToneMapping = ACESFilmicToneMapping;\nexports.AddEquation = AddEquation;\nexports.AddOperation = AddOperation;\nexports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;\nexports.AdditiveBlending = AdditiveBlending;\nexports.AlphaFormat = AlphaFormat;\nexports.AlwaysDepth = AlwaysDepth;\nexports.AlwaysStencilFunc = AlwaysStencilFunc;\nexports.BackSide = BackSide;\nexports.BasicDepthPacking = BasicDepthPacking;\nexports.BasicShadowMap = BasicShadowMap;\nexports.Box2 = Box2;\nexports.Box3 = Box3;\nexports.ByteType = ByteType;\nexports.CineonToneMapping = CineonToneMapping;\nexports.ClampToEdgeWrapping = ClampToEdgeWrapping;\nexports.Color = Color;\nexports.ColorManagement = ColorManagement;\nexports.CubeReflectionMapping = CubeReflectionMapping;\nexports.CubeRefractionMapping = CubeRefractionMapping;\nexports.CubeUVReflectionMapping = CubeUVReflectionMapping;\nexports.CullFaceBack = CullFaceBack;\nexports.CullFaceFront = CullFaceFront;\nexports.CullFaceFrontBack = CullFaceFrontBack;\nexports.CullFaceNone = CullFaceNone;\nexports.CustomBlending = CustomBlending;\nexports.CustomToneMapping = CustomToneMapping;\nexports.Cylindrical = Cylindrical;\nexports.DecrementStencilOp = DecrementStencilOp;\nexports.DecrementWrapStencilOp = DecrementWrapStencilOp;\nexports.DepthFormat = DepthFormat;\nexports.DepthStencilFormat = DepthStencilFormat;\nexports.DoubleSide = DoubleSide;\nexports.DstAlphaFactor = DstAlphaFactor;\nexports.DstColorFactor = DstColorFactor;\nexports.DynamicCopyUsage = DynamicCopyUsage;\nexports.DynamicDrawUsage = DynamicDrawUsage;\nexports.DynamicReadUsage = DynamicReadUsage;\nexports.EqualDepth = EqualDepth;\nexports.EqualStencilFunc = EqualStencilFunc;\nexports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;\nexports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;\nexports.Euler = Euler;\nexports.FloatType = FloatType;\nexports.FrontSide = FrontSide;\nexports.GLSL1 = GLSL1;\nexports.GLSL3 = GLSL3;\nexports.GreaterDepth = GreaterDepth;\nexports.GreaterEqualDepth = GreaterEqualDepth;\nexports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;\nexports.GreaterStencilFunc = GreaterStencilFunc;\nexports.HalfFloatType = HalfFloatType;\nexports.IncrementStencilOp = IncrementStencilOp;\nexports.IncrementWrapStencilOp = IncrementWrapStencilOp;\nexports.IntType = IntType;\nexports.Interpolant = Interpolant;\nexports.InterpolateDiscrete = InterpolateDiscrete;\nexports.InterpolateLinear = InterpolateLinear;\nexports.InterpolateSmooth = InterpolateSmooth;\nexports.InvertStencilOp = InvertStencilOp;\nexports.KeepStencilOp = KeepStencilOp;\nexports.LessDepth = LessDepth;\nexports.LessEqualDepth = LessEqualDepth;\nexports.LessEqualStencilFunc = LessEqualStencilFunc;\nexports.LessStencilFunc = LessStencilFunc;\nexports.Line3 = Line3;\nexports.LinearEncoding = LinearEncoding;\nexports.LinearFilter = LinearFilter;\nexports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;\nexports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;\nexports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;\nexports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;\nexports.LinearSRGBColorSpace = LinearSRGBColorSpace;\nexports.LinearToSRGB = LinearToSRGB;\nexports.LinearToneMapping = LinearToneMapping;\nexports.LoopOnce = LoopOnce;\nexports.LoopPingPong = LoopPingPong;\nexports.LoopRepeat = LoopRepeat;\nexports.LuminanceAlphaFormat = LuminanceAlphaFormat;\nexports.LuminanceFormat = LuminanceFormat;\nexports.MOUSE = MOUSE;\nexports.MathUtils = MathUtils;\nexports.Matrix3 = Matrix3;\nexports.Matrix4 = Matrix4;\nexports.MaxEquation = MaxEquation;\nexports.MinEquation = MinEquation;\nexports.MirroredRepeatWrapping = MirroredRepeatWrapping;\nexports.MixOperation = MixOperation;\nexports.MultiplyBlending = MultiplyBlending;\nexports.MultiplyOperation = MultiplyOperation;\nexports.NearestFilter = NearestFilter;\nexports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;\nexports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;\nexports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;\nexports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;\nexports.NeverDepth = NeverDepth;\nexports.NeverStencilFunc = NeverStencilFunc;\nexports.NoBlending = NoBlending;\nexports.NoColorSpace = NoColorSpace;\nexports.NoToneMapping = NoToneMapping;\nexports.NormalAnimationBlendMode = NormalAnimationBlendMode;\nexports.NormalBlending = NormalBlending;\nexports.NotEqualDepth = NotEqualDepth;\nexports.NotEqualStencilFunc = NotEqualStencilFunc;\nexports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;\nexports.OneFactor = OneFactor;\nexports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;\nexports.OneMinusDstColorFactor = OneMinusDstColorFactor;\nexports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;\nexports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;\nexports.PCFShadowMap = PCFShadowMap;\nexports.PCFSoftShadowMap = PCFSoftShadowMap;\nexports.Plane = Plane;\nexports.Quaternion = Quaternion;\nexports.REVISION = REVISION;\nexports.RGBADepthPacking = RGBADepthPacking;\nexports.RGBAFormat = RGBAFormat;\nexports.RGBAIntegerFormat = RGBAIntegerFormat;\nexports.RGBA_ASTC_10x10_Format = RGBA_ASTC_10x10_Format;\nexports.RGBA_ASTC_10x5_Format = RGBA_ASTC_10x5_Format;\nexports.RGBA_ASTC_10x6_Format = RGBA_ASTC_10x6_Format;\nexports.RGBA_ASTC_10x8_Format = RGBA_ASTC_10x8_Format;\nexports.RGBA_ASTC_12x10_Format = RGBA_ASTC_12x10_Format;\nexports.RGBA_ASTC_12x12_Format = RGBA_ASTC_12x12_Format;\nexports.RGBA_ASTC_4x4_Format = RGBA_ASTC_4x4_Format;\nexports.RGBA_ASTC_5x4_Format = RGBA_ASTC_5x4_Format;\nexports.RGBA_ASTC_5x5_Format = RGBA_ASTC_5x5_Format;\nexports.RGBA_ASTC_6x5_Format = RGBA_ASTC_6x5_Format;\nexports.RGBA_ASTC_6x6_Format = RGBA_ASTC_6x6_Format;\nexports.RGBA_ASTC_8x5_Format = RGBA_ASTC_8x5_Format;\nexports.RGBA_ASTC_8x6_Format = RGBA_ASTC_8x6_Format;\nexports.RGBA_ASTC_8x8_Format = RGBA_ASTC_8x8_Format;\nexports.RGBA_BPTC_Format = RGBA_BPTC_Format;\nexports.RGBA_ETC2_EAC_Format = RGBA_ETC2_EAC_Format;\nexports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format;\nexports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format;\nexports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;\nexports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;\nexports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;\nexports.RGBFormat = RGBFormat;\nexports.RGB_ETC1_Format = RGB_ETC1_Format;\nexports.RGB_ETC2_Format = RGB_ETC2_Format;\nexports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;\nexports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format;\nexports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format;\nexports.RGFormat = RGFormat;\nexports.RGIntegerFormat = RGIntegerFormat;\nexports.Ray = Ray;\nexports.RedFormat = RedFormat;\nexports.RedIntegerFormat = RedIntegerFormat;\nexports.ReinhardToneMapping = ReinhardToneMapping;\nexports.RepeatWrapping = RepeatWrapping;\nexports.ReplaceStencilOp = ReplaceStencilOp;\nexports.ReverseSubtractEquation = ReverseSubtractEquation;\nexports.SRGBColorSpace = SRGBColorSpace;\nexports.SRGBToLinear = SRGBToLinear;\nexports.ShortType = ShortType;\nexports.Sphere = Sphere;\nexports.Spherical = Spherical;\nexports.SrcAlphaFactor = SrcAlphaFactor;\nexports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;\nexports.SrcColorFactor = SrcColorFactor;\nexports.StaticCopyUsage = StaticCopyUsage;\nexports.StaticDrawUsage = StaticDrawUsage;\nexports.StaticReadUsage = StaticReadUsage;\nexports.StreamCopyUsage = StreamCopyUsage;\nexports.StreamDrawUsage = StreamDrawUsage;\nexports.StreamReadUsage = StreamReadUsage;\nexports.SubtractEquation = SubtractEquation;\nexports.SubtractiveBlending = SubtractiveBlending;\nexports.TOUCH = TOUCH;\nexports.TangentSpaceNormalMap = TangentSpaceNormalMap;\nexports.Triangle = Triangle;\nexports.TriangleFanDrawMode = TriangleFanDrawMode;\nexports.TriangleStripDrawMode = TriangleStripDrawMode;\nexports.TrianglesDrawMode = TrianglesDrawMode;\nexports.UVMapping = UVMapping;\nexports.UnsignedByteType = UnsignedByteType;\nexports.UnsignedInt248Type = UnsignedInt248Type;\nexports.UnsignedIntType = UnsignedIntType;\nexports.UnsignedShort4444Type = UnsignedShort4444Type;\nexports.UnsignedShort5551Type = UnsignedShort5551Type;\nexports.UnsignedShortType = UnsignedShortType;\nexports.VSMShadowMap = VSMShadowMap;\nexports.Vector2 = Vector2;\nexports.Vector3 = Vector3;\nexports.Vector4 = Vector4;\nexports.WrapAroundEnding = WrapAroundEnding;\nexports.ZeroCurvatureEnding = ZeroCurvatureEnding;\nexports.ZeroFactor = ZeroFactor;\nexports.ZeroSlopeEnding = ZeroSlopeEnding;\nexports.ZeroStencilOp = ZeroStencilOp;\nexports._SRGBAFormat = _SRGBAFormat;\nexports.sRGBEncoding = sRGBEncoding;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/threejs-math/build/threejs-math.cjs?")}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(t){var n=__webpack_module_cache__[t];if(void 0!==n)return n.exports;var e=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(e.exports,e,e.exports,__webpack_require__),e.exports}getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var e=Object.create(null);__webpack_require__.r(e);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&n&&t;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((n=>r[n]=()=>t[n]));return r.default=()=>t,__webpack_require__.d(e,r),e},__webpack_require__.d=(t,n)=>{for(var e in n)__webpack_require__.o(n,e)&&!__webpack_require__.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/index.ts");return __webpack_exports__})()));
\ No newline at end of file
+!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("node-fetch")):"function"==typeof define&&define.amd?define("manifesto",["node-fetch"],n):"object"==typeof exports?exports.manifesto=n(require("node-fetch")):t.manifesto=n(t["node-fetch"])}("undefined"!=typeof self?self:this,(__WEBPACK_EXTERNAL_MODULE_node_fetch__=>(()=>{var __webpack_modules__={"./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\r\nObject.defineProperty(exports, "__esModule", ({ value: true }));\r\nexports.CONTINUE = 100;\r\nexports.SWITCHING_PROTOCOLS = 101;\r\nexports.PROCESSING = 102;\r\nexports.OK = 200;\r\nexports.CREATED = 201;\r\nexports.ACCEPTED = 202;\r\nexports.NON_AUTHORITATIVE_INFORMATION = 203;\r\nexports.NO_CONTENT = 204;\r\nexports.RESET_CONTENT = 205;\r\nexports.PARTIAL_CONTENT = 206;\r\nexports.MULTI_STATUS = 207;\r\nexports.MULTIPLE_CHOICES = 300;\r\nexports.MOVED_PERMANENTLY = 301;\r\nexports.MOVED_TEMPORARILY = 302;\r\nexports.SEE_OTHER = 303;\r\nexports.NOT_MODIFIED = 304;\r\nexports.USE_PROXY = 305;\r\nexports.TEMPORARY_REDIRECT = 307;\r\nexports.BAD_REQUEST = 400;\r\nexports.UNAUTHORIZED = 401;\r\nexports.PAYMENT_REQUIRED = 402;\r\nexports.FORBIDDEN = 403;\r\nexports.NOT_FOUND = 404;\r\nexports.METHOD_NOT_ALLOWED = 405;\r\nexports.NOT_ACCEPTABLE = 406;\r\nexports.PROXY_AUTHENTICATION_REQUIRED = 407;\r\nexports.REQUEST_TIME_OUT = 408;\r\nexports.CONFLICT = 409;\r\nexports.GONE = 410;\r\nexports.LENGTH_REQUIRED = 411;\r\nexports.PRECONDITION_FAILED = 412;\r\nexports.REQUEST_ENTITY_TOO_LARGE = 413;\r\nexports.REQUEST_URI_TOO_LARGE = 414;\r\nexports.UNSUPPORTED_MEDIA_TYPE = 415;\r\nexports.REQUESTED_RANGE_NOT_SATISFIABLE = 416;\r\nexports.EXPECTATION_FAILED = 417;\r\nexports.IM_A_TEAPOT = 418;\r\nexports.UNPROCESSABLE_ENTITY = 422;\r\nexports.LOCKED = 423;\r\nexports.FAILED_DEPENDENCY = 424;\r\nexports.UNORDERED_COLLECTION = 425;\r\nexports.UPGRADE_REQUIRED = 426;\r\nexports.PRECONDITION_REQUIRED = 428;\r\nexports.TOO_MANY_REQUESTS = 429;\r\nexports.REQUEST_HEADER_FIELDS_TOO_LARGE = 431;\r\nexports.INTERNAL_SERVER_ERROR = 500;\r\nexports.NOT_IMPLEMENTED = 501;\r\nexports.BAD_GATEWAY = 502;\r\nexports.SERVICE_UNAVAILABLE = 503;\r\nexports.GATEWAY_TIME_OUT = 504;\r\nexports.HTTP_VERSION_NOT_SUPPORTED = 505;\r\nexports.VARIANT_ALSO_NEGOTIATES = 506;\r\nexports.INSUFFICIENT_STORAGE = 507;\r\nexports.BANDWIDTH_LIMIT_EXCEEDED = 509;\r\nexports.NOT_EXTENDED = 510;\r\nexports.NETWORK_AUTHENTICATION_REQUIRED = 511;\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js?')},"./node_modules/@iiif/vocabulary/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar AnnotationMotivation;\n(function (AnnotationMotivation) {\n AnnotationMotivation["BOOKMARKING"] = "oa:bookmarking";\n AnnotationMotivation["CLASSIFYING"] = "oa:classifying";\n AnnotationMotivation["COMMENTING"] = "oa:commenting";\n AnnotationMotivation["DESCRIBING"] = "oa:describing";\n AnnotationMotivation["EDITING"] = "oa:editing";\n AnnotationMotivation["HIGHLIGHTING"] = "oa:highlighting";\n AnnotationMotivation["IDENTIFYING"] = "oa:identifying";\n AnnotationMotivation["LINKING"] = "oa:linking";\n AnnotationMotivation["MODERATING"] = "oa:moderating";\n AnnotationMotivation["PAINTING"] = "sc:painting";\n AnnotationMotivation["QUESTIONING"] = "oa:questioning";\n AnnotationMotivation["REPLYING"] = "oa:replying";\n AnnotationMotivation["TAGGING"] = "oa:tagging";\n AnnotationMotivation["TRANSCRIBING"] = "oad:transcribing";\n})(AnnotationMotivation = exports.AnnotationMotivation || (exports.AnnotationMotivation = {}));\nvar Behavior;\n(function (Behavior) {\n Behavior["AUTO_ADVANCE"] = "auto-advance";\n Behavior["CONTINUOUS"] = "continuous";\n Behavior["FACING_PAGES"] = "facing-pages";\n Behavior["HIDDEN"] = "hidden";\n Behavior["INDIVIDUALS"] = "individuals";\n Behavior["MULTI_PART"] = "multi-part";\n Behavior["NO_NAV"] = "no-nav";\n Behavior["NON_PAGED"] = "non-paged";\n Behavior["PAGED"] = "paged";\n Behavior["REPEAT"] = "repeat";\n Behavior["SEQUENCE"] = "sequence";\n Behavior["THUMBNAIL_NAV"] = "thumbnail-nav";\n Behavior["TOGETHER"] = "together";\n Behavior["UNORDERED"] = "unordered";\n})(Behavior = exports.Behavior || (exports.Behavior = {}));\nvar ExternalResourceType;\n(function (ExternalResourceType) {\n ExternalResourceType["CANVAS"] = "canvas";\n ExternalResourceType["CHOICE"] = "choice";\n ExternalResourceType["OA_CHOICE"] = "oa:choice";\n ExternalResourceType["CONTENT_AS_TEXT"] = "contentastext";\n ExternalResourceType["DATASET"] = "dataset";\n ExternalResourceType["DOCUMENT"] = "document";\n ExternalResourceType["IMAGE"] = "image";\n ExternalResourceType["MODEL"] = "model";\n ExternalResourceType["MOVING_IMAGE"] = "movingimage";\n ExternalResourceType["PDF"] = "pdf";\n ExternalResourceType["PHYSICAL_OBJECT"] = "physicalobject";\n ExternalResourceType["SOUND"] = "sound";\n ExternalResourceType["TEXT"] = "text";\n ExternalResourceType["TEXTUALBODY"] = "textualbody";\n ExternalResourceType["VIDEO"] = "video";\n})(ExternalResourceType = exports.ExternalResourceType || (exports.ExternalResourceType = {}));\nvar IIIFResourceType;\n(function (IIIFResourceType) {\n IIIFResourceType["ANNOTATION"] = "annotation";\n IIIFResourceType["CANVAS"] = "canvas";\n IIIFResourceType["COLLECTION"] = "collection";\n IIIFResourceType["MANIFEST"] = "manifest";\n IIIFResourceType["RANGE"] = "range";\n IIIFResourceType["SEQUENCE"] = "sequence";\n})(IIIFResourceType = exports.IIIFResourceType || (exports.IIIFResourceType = {}));\nvar MediaType;\n(function (MediaType) {\n MediaType["AUDIO_MP4"] = "audio/mp4";\n MediaType["CORTO"] = "application/corto";\n MediaType["DICOM"] = "application/dicom";\n MediaType["DRACO"] = "application/draco";\n MediaType["EPUB"] = "application/epub+zip";\n MediaType["GIRDER"] = "image/vnd.kitware.girder";\n MediaType["GLB"] = "model/gltf-binary";\n MediaType["GLTF"] = "model/gltf+json";\n MediaType["IIIF_PRESENTATION_2"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/2/context.json\\"";\n MediaType["IIIF_PRESENTATION_3"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/3/context.json\\"";\n MediaType["JPG"] = "image/jpeg";\n MediaType["M3U8"] = "application/vnd.apple.mpegurl";\n MediaType["MP3"] = "audio/mp3";\n MediaType["MPEG_DASH"] = "application/dash+xml";\n MediaType["OBJ"] = "text/plain";\n MediaType["OPF"] = "application/oebps-package+xml";\n MediaType["PDF"] = "application/pdf";\n MediaType["PLY"] = "application/ply";\n MediaType["THREEJS"] = "application/vnd.threejs+json";\n MediaType["USDZ"] = "model/vnd.usd+zip";\n MediaType["VIDEO_MP4"] = "video/mp4";\n MediaType["WAV"] = "audio/wav";\n MediaType["WEBM"] = "video/webm";\n})(MediaType = exports.MediaType || (exports.MediaType = {}));\nvar RenderingFormat;\n(function (RenderingFormat) {\n RenderingFormat["DOC"] = "application/msword";\n RenderingFormat["DOCX"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";\n RenderingFormat["PDF"] = "application/pdf";\n})(RenderingFormat = exports.RenderingFormat || (exports.RenderingFormat = {}));\nvar ServiceProfile;\n(function (ServiceProfile) {\n // image api\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level0";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level1";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level2";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level0";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level1";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level2";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2";\n ServiceProfile["IMAGE_1_LEVEL_0"] = "http://iiif.io/api/image/1/level0.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/1/profiles/level0.json";\n ServiceProfile["IMAGE_1_LEVEL_1"] = "http://iiif.io/api/image/1/level1.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/1/profiles/level1.json";\n ServiceProfile["IMAGE_1_LEVEL_2"] = "http://iiif.io/api/image/1/level2.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/1/profiles/level2.json";\n ServiceProfile["IMAGE_2_LEVEL_0"] = "http://iiif.io/api/image/2/level0.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/2/profiles/level0.json";\n ServiceProfile["IMAGE_2_LEVEL_1"] = "http://iiif.io/api/image/2/level1.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/2/profiles/level1.json";\n ServiceProfile["IMAGE_2_LEVEL_2"] = "http://iiif.io/api/image/2/level2.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/2/profiles/level2.json";\n // auth api\n ServiceProfile["AUTH_0_CLICK_THROUGH"] = "http://iiif.io/api/auth/0/login/clickthrough";\n ServiceProfile["AUTH_0_LOGIN"] = "http://iiif.io/api/auth/0/login";\n ServiceProfile["AUTH_0_LOGOUT"] = "http://iiif.io/api/auth/0/logout";\n ServiceProfile["AUTH_0_RESTRICTED"] = "http://iiif.io/api/auth/0/login/restricted";\n ServiceProfile["AUTH_0_TOKEN"] = "http://iiif.io/api/auth/0/token";\n ServiceProfile["AUTH_1_CLICK_THROUGH"] = "http://iiif.io/api/auth/1/clickthrough";\n ServiceProfile["AUTH_1_EXTERNAL"] = "http://iiif.io/api/auth/1/external";\n ServiceProfile["AUTH_1_KIOSK"] = "http://iiif.io/api/auth/1/kiosk";\n ServiceProfile["AUTH_1_LOGIN"] = "http://iiif.io/api/auth/1/login";\n ServiceProfile["AUTH_1_LOGOUT"] = "http://iiif.io/api/auth/1/logout";\n ServiceProfile["AUTH_1_PROBE"] = "http://iiif.io/api/auth/1/probe";\n ServiceProfile["AUTH_1_TOKEN"] = "http://iiif.io/api/auth/1/token";\n // search api\n ServiceProfile["SEARCH_0"] = "http://iiif.io/api/search/0/search";\n ServiceProfile["SEARCH_0_AUTO_COMPLETE"] = "http://iiif.io/api/search/0/autocomplete";\n ServiceProfile["SEARCH_1"] = "http://iiif.io/api/search/1/search";\n ServiceProfile["SEARCH_1_AUTO_COMPLETE"] = "http://iiif.io/api/search/1/autocomplete";\n // extensions\n ServiceProfile["TRACKING_EXTENSIONS"] = "http://universalviewer.io/tracking-extensions-profile";\n ServiceProfile["UI_EXTENSIONS"] = "http://universalviewer.io/ui-extensions-profile";\n ServiceProfile["PRINT_EXTENSIONS"] = "http://universalviewer.io/print-extensions-profile";\n ServiceProfile["SHARE_EXTENSIONS"] = "http://universalviewer.io/share-extensions-profile";\n ServiceProfile["DOWNLOAD_EXTENSIONS"] = "http://universalviewer.io/download-extensions-profile";\n // other\n ServiceProfile["OTHER_MANIFESTATIONS"] = "http://iiif.io/api/otherManifestations.json";\n ServiceProfile["IXIF"] = "http://wellcomelibrary.org/ld/ixif/0/alpha.json";\n})(ServiceProfile = exports.ServiceProfile || (exports.ServiceProfile = {}));\nvar ServiceType;\n(function (ServiceType) {\n ServiceType["IMAGE_SERVICE_2"] = "ImageService2";\n ServiceType["IMAGE_SERVICE_3"] = "ImageService3";\n})(ServiceType = exports.ServiceType || (exports.ServiceType = {}));\nvar ViewingDirection;\n(function (ViewingDirection) {\n ViewingDirection["BOTTOM_TO_TOP"] = "bottom-to-top";\n ViewingDirection["LEFT_TO_RIGHT"] = "left-to-right";\n ViewingDirection["RIGHT_TO_LEFT"] = "right-to-left";\n ViewingDirection["TOP_TO_BOTTOM"] = "top-to-bottom";\n})(ViewingDirection = exports.ViewingDirection || (exports.ViewingDirection = {}));\nvar ViewingHint;\n(function (ViewingHint) {\n ViewingHint["CONTINUOUS"] = "continuous";\n ViewingHint["INDIVIDUALS"] = "individuals";\n ViewingHint["NON_PAGED"] = "non-paged";\n ViewingHint["PAGED"] = "paged";\n ViewingHint["TOP"] = "top";\n})(ViewingHint = exports.ViewingHint || (exports.ViewingHint = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@iiif/vocabulary/dist-commonjs/index.js?')},"./node_modules/color-name/index.js":module=>{"use strict";eval('\r\n\r\nmodule.exports = {\r\n\t"aliceblue": [240, 248, 255],\r\n\t"antiquewhite": [250, 235, 215],\r\n\t"aqua": [0, 255, 255],\r\n\t"aquamarine": [127, 255, 212],\r\n\t"azure": [240, 255, 255],\r\n\t"beige": [245, 245, 220],\r\n\t"bisque": [255, 228, 196],\r\n\t"black": [0, 0, 0],\r\n\t"blanchedalmond": [255, 235, 205],\r\n\t"blue": [0, 0, 255],\r\n\t"blueviolet": [138, 43, 226],\r\n\t"brown": [165, 42, 42],\r\n\t"burlywood": [222, 184, 135],\r\n\t"cadetblue": [95, 158, 160],\r\n\t"chartreuse": [127, 255, 0],\r\n\t"chocolate": [210, 105, 30],\r\n\t"coral": [255, 127, 80],\r\n\t"cornflowerblue": [100, 149, 237],\r\n\t"cornsilk": [255, 248, 220],\r\n\t"crimson": [220, 20, 60],\r\n\t"cyan": [0, 255, 255],\r\n\t"darkblue": [0, 0, 139],\r\n\t"darkcyan": [0, 139, 139],\r\n\t"darkgoldenrod": [184, 134, 11],\r\n\t"darkgray": [169, 169, 169],\r\n\t"darkgreen": [0, 100, 0],\r\n\t"darkgrey": [169, 169, 169],\r\n\t"darkkhaki": [189, 183, 107],\r\n\t"darkmagenta": [139, 0, 139],\r\n\t"darkolivegreen": [85, 107, 47],\r\n\t"darkorange": [255, 140, 0],\r\n\t"darkorchid": [153, 50, 204],\r\n\t"darkred": [139, 0, 0],\r\n\t"darksalmon": [233, 150, 122],\r\n\t"darkseagreen": [143, 188, 143],\r\n\t"darkslateblue": [72, 61, 139],\r\n\t"darkslategray": [47, 79, 79],\r\n\t"darkslategrey": [47, 79, 79],\r\n\t"darkturquoise": [0, 206, 209],\r\n\t"darkviolet": [148, 0, 211],\r\n\t"deeppink": [255, 20, 147],\r\n\t"deepskyblue": [0, 191, 255],\r\n\t"dimgray": [105, 105, 105],\r\n\t"dimgrey": [105, 105, 105],\r\n\t"dodgerblue": [30, 144, 255],\r\n\t"firebrick": [178, 34, 34],\r\n\t"floralwhite": [255, 250, 240],\r\n\t"forestgreen": [34, 139, 34],\r\n\t"fuchsia": [255, 0, 255],\r\n\t"gainsboro": [220, 220, 220],\r\n\t"ghostwhite": [248, 248, 255],\r\n\t"gold": [255, 215, 0],\r\n\t"goldenrod": [218, 165, 32],\r\n\t"gray": [128, 128, 128],\r\n\t"green": [0, 128, 0],\r\n\t"greenyellow": [173, 255, 47],\r\n\t"grey": [128, 128, 128],\r\n\t"honeydew": [240, 255, 240],\r\n\t"hotpink": [255, 105, 180],\r\n\t"indianred": [205, 92, 92],\r\n\t"indigo": [75, 0, 130],\r\n\t"ivory": [255, 255, 240],\r\n\t"khaki": [240, 230, 140],\r\n\t"lavender": [230, 230, 250],\r\n\t"lavenderblush": [255, 240, 245],\r\n\t"lawngreen": [124, 252, 0],\r\n\t"lemonchiffon": [255, 250, 205],\r\n\t"lightblue": [173, 216, 230],\r\n\t"lightcoral": [240, 128, 128],\r\n\t"lightcyan": [224, 255, 255],\r\n\t"lightgoldenrodyellow": [250, 250, 210],\r\n\t"lightgray": [211, 211, 211],\r\n\t"lightgreen": [144, 238, 144],\r\n\t"lightgrey": [211, 211, 211],\r\n\t"lightpink": [255, 182, 193],\r\n\t"lightsalmon": [255, 160, 122],\r\n\t"lightseagreen": [32, 178, 170],\r\n\t"lightskyblue": [135, 206, 250],\r\n\t"lightslategray": [119, 136, 153],\r\n\t"lightslategrey": [119, 136, 153],\r\n\t"lightsteelblue": [176, 196, 222],\r\n\t"lightyellow": [255, 255, 224],\r\n\t"lime": [0, 255, 0],\r\n\t"limegreen": [50, 205, 50],\r\n\t"linen": [250, 240, 230],\r\n\t"magenta": [255, 0, 255],\r\n\t"maroon": [128, 0, 0],\r\n\t"mediumaquamarine": [102, 205, 170],\r\n\t"mediumblue": [0, 0, 205],\r\n\t"mediumorchid": [186, 85, 211],\r\n\t"mediumpurple": [147, 112, 219],\r\n\t"mediumseagreen": [60, 179, 113],\r\n\t"mediumslateblue": [123, 104, 238],\r\n\t"mediumspringgreen": [0, 250, 154],\r\n\t"mediumturquoise": [72, 209, 204],\r\n\t"mediumvioletred": [199, 21, 133],\r\n\t"midnightblue": [25, 25, 112],\r\n\t"mintcream": [245, 255, 250],\r\n\t"mistyrose": [255, 228, 225],\r\n\t"moccasin": [255, 228, 181],\r\n\t"navajowhite": [255, 222, 173],\r\n\t"navy": [0, 0, 128],\r\n\t"oldlace": [253, 245, 230],\r\n\t"olive": [128, 128, 0],\r\n\t"olivedrab": [107, 142, 35],\r\n\t"orange": [255, 165, 0],\r\n\t"orangered": [255, 69, 0],\r\n\t"orchid": [218, 112, 214],\r\n\t"palegoldenrod": [238, 232, 170],\r\n\t"palegreen": [152, 251, 152],\r\n\t"paleturquoise": [175, 238, 238],\r\n\t"palevioletred": [219, 112, 147],\r\n\t"papayawhip": [255, 239, 213],\r\n\t"peachpuff": [255, 218, 185],\r\n\t"peru": [205, 133, 63],\r\n\t"pink": [255, 192, 203],\r\n\t"plum": [221, 160, 221],\r\n\t"powderblue": [176, 224, 230],\r\n\t"purple": [128, 0, 128],\r\n\t"rebeccapurple": [102, 51, 153],\r\n\t"red": [255, 0, 0],\r\n\t"rosybrown": [188, 143, 143],\r\n\t"royalblue": [65, 105, 225],\r\n\t"saddlebrown": [139, 69, 19],\r\n\t"salmon": [250, 128, 114],\r\n\t"sandybrown": [244, 164, 96],\r\n\t"seagreen": [46, 139, 87],\r\n\t"seashell": [255, 245, 238],\r\n\t"sienna": [160, 82, 45],\r\n\t"silver": [192, 192, 192],\r\n\t"skyblue": [135, 206, 235],\r\n\t"slateblue": [106, 90, 205],\r\n\t"slategray": [112, 128, 144],\r\n\t"slategrey": [112, 128, 144],\r\n\t"snow": [255, 250, 250],\r\n\t"springgreen": [0, 255, 127],\r\n\t"steelblue": [70, 130, 180],\r\n\t"tan": [210, 180, 140],\r\n\t"teal": [0, 128, 128],\r\n\t"thistle": [216, 191, 216],\r\n\t"tomato": [255, 99, 71],\r\n\t"turquoise": [64, 224, 208],\r\n\t"violet": [238, 130, 238],\r\n\t"wheat": [245, 222, 179],\r\n\t"white": [255, 255, 255],\r\n\t"whitesmoke": [245, 245, 245],\r\n\t"yellow": [255, 255, 0],\r\n\t"yellowgreen": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-name/index.js?')},"./node_modules/color-string/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\nvar swizzle = __webpack_require__(/*! simple-swizzle */ \"./node_modules/simple-swizzle/index.js\");\nvar hasOwnProperty = Object.hasOwnProperty;\n\nvar reverseNames = Object.create(null);\n\n// create a list of reverse color names\nfor (var name in colorNames) {\n\tif (hasOwnProperty.call(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nvar cs = module.exports = {\n\tto: {},\n\tget: {}\n};\n\ncs.get = function (string) {\n\tvar prefix = string.substring(0, 3).toLowerCase();\n\tvar val;\n\tvar model;\n\tswitch (prefix) {\n\t\tcase 'hsl':\n\t\t\tval = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\tcase 'hwb':\n\t\t\tval = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tval = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t}\n\n\tif (!val) {\n\t\treturn null;\n\t}\n\n\treturn {model: model, value: val};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar abbr = /^#([a-f0-9]{3,4})$/i;\n\tvar hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;\n\tvar rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar keyword = /^(\\w+)$/;\n\n\tvar rgb = [0, 0, 0, 1];\n\tvar match;\n\tvar i;\n\tvar hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tvar i2 = i * 2;\n\t\t\trgb[i] = parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i + 1], 0);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!hasOwnProperty.call(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hsl = /^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hsl);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar s = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar l = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hwb = /^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hwb);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar w = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar b = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function () {\n\tvar rgba = swizzle(arguments);\n\n\tvar r = Math.round(rgba[0] / 255 * 100);\n\tvar g = Math.round(rgba[1] / 255 * 100);\n\tvar b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function () {\n\tvar hsla = swizzle(arguments);\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function () {\n\tvar hwba = swizzle(arguments);\n\n\tvar a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// helpers\nfunction clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n\tvar str = Math.round(num).toString(16).toUpperCase();\n\treturn (str.length < 2) ? '0' + str : str;\n}\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-string/index.js?")},"./node_modules/is-arrayish/index.js":module=>{eval("module.exports = function isArrayish(obj) {\n\tif (!obj || typeof obj === 'string') {\n\t\treturn false;\n\t}\n\n\treturn obj instanceof Array || Array.isArray(obj) ||\n\t\t(obj.length >= 0 && (obj.splice instanceof Function ||\n\t\t\t(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/is-arrayish/index.js?")},"./node_modules/isomorphic-unfetch/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('function r(m) {\n\treturn (m && m.default) || m;\n}\nmodule.exports = __webpack_require__.g.fetch =\n\t__webpack_require__.g.fetch ||\n\t(typeof process == "undefined"\n\t\t? r(__webpack_require__(/*! unfetch */ "./node_modules/unfetch/dist/unfetch.module.js"))\n\t\t: function (url, opts) {\n\t\t\t\tif (typeof url === "string" || url instanceof URL) {\n\t\t\t\t\turl = String(url).replace(/^\\/\\//g, "https://");\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! node-fetch */ "node-fetch", 23)).then((m) => r(m)(url, opts));\n\t\t });\n\n\n//# sourceURL=webpack://manifesto/./node_modules/isomorphic-unfetch/index.js?')},"./node_modules/lodash/_Symbol.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_Symbol.js?')},"./node_modules/lodash/_arrayPush.js":module=>{eval("/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_arrayPush.js?")},"./node_modules/lodash/_baseFlatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"),\n isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js");\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseFlatten.js?')},"./node_modules/lodash/_baseGetTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),\n objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");\n\n/** `Object#toString` result references. */\nvar nullTag = \'[object Null]\',\n undefinedTag = \'[object Undefined]\';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseGetTag.js?')},"./node_modules/lodash/_baseIsArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");\n\n/** `Object#toString` result references. */\nvar argsTag = \'[object Arguments]\';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseIsArguments.js?')},"./node_modules/lodash/_freeGlobal.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\nmodule.exports = freeGlobal;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_freeGlobal.js?")},"./node_modules/lodash/_getRawTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_getRawTag.js?')},"./node_modules/lodash/_isFlattenable.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"),\n isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js");\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_isFlattenable.js?')},"./node_modules/lodash/_objectToString.js":module=>{eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_objectToString.js?")},"./node_modules/lodash/_root.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_root.js?")},"./node_modules/lodash/flatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flatten.js?')},"./node_modules/lodash/flattenDeep.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flattenDeep.js?')},"./node_modules/lodash/isArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ \"./node_modules/lodash/_baseIsArguments.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArguments.js?")},"./node_modules/lodash/isArray.js":module=>{eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArray.js?")},"./node_modules/lodash/isObjectLike.js":module=>{eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isObjectLike.js?")},"./node_modules/simple-swizzle/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar isArrayish = __webpack_require__(/*! is-arrayish */ "./node_modules/is-arrayish/index.js");\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\nvar swizzle = module.exports = function swizzle(args) {\n\tvar results = [];\n\n\tfor (var i = 0, len = args.length; i < len; i++) {\n\t\tvar arg = args[i];\n\n\t\tif (isArrayish(arg)) {\n\t\t\t// http://jsperf.com/javascript-array-concat-vs-push/98\n\t\t\tresults = concat.call(results, slice.call(arg));\n\t\t} else {\n\t\t\tresults.push(arg);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nswizzle.wrap = function (fn) {\n\treturn function () {\n\t\treturn fn(swizzle(arguments));\n\t};\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/simple-swizzle/index.js?')},"./src/Annotation.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Annotation = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar Annotation = /** @class */ (function (_super) {\n __extends(Annotation, _super);\n function Annotation(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n /**\n In spite of its name, this method returns an array of objects, each of which\n represents a potential body annotations\n \n @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ }\n **/\n Annotation.prototype.getBody = function () {\n var bodies = [];\n var body = this.getProperty("body");\n // the following is intended to handle the following cases for\n /// the raw json of the body property of __jsonld\n // -- body is an array, each element of which is parsed\n // == body is an object with property items, each item is parsed\n // -- body is parsed\n if (body) {\n for (var _i = 0, _a = [].concat(body); _i < _a.length; _i++) {\n var bd = _a[_i];\n var items = bd.items;\n if (items)\n bodies = bodies.concat(this.parseBodiesFromItemsList(items));\n else\n bodies.push(this.parseSingletonBody(bd));\n }\n }\n return bodies;\n };\n Object.defineProperty(Annotation.prototype, "Body", {\n get: function () { return this.getBody(); },\n enumerable: false,\n configurable: true\n });\n /**\n auxiliary function to getBody; intended to hande an object that has an element items\n which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/\n seems to be the use case for this\n **/\n Annotation.prototype.parseBodiesFromItemsList = function (rawbodies) {\n var retVal = [];\n for (var _i = 0, _a = [].concat(rawbodies); _i < _a.length; _i++) {\n var bd = _a[_i];\n retVal.push(this.parseSingletonBody(bd));\n }\n return retVal;\n };\n /**\n auxiliary function to parseBodiesFromItemsList and getBody, this is the last\n step on recursively going through collections of bodies.\n **/\n Annotation.prototype.parseSingletonBody = function (rawbody) {\n if (rawbody.type === "SpecificResource") {\n return new internal_1.SpecificResource(rawbody, this.options);\n }\n else {\n return internal_1.AnnotationBodyParser.BuildFromJson(rawbody, this.options);\n }\n };\n /**\n Developer Note: 8 April 2024\n getBody3D function was developed in the early stages of the 3D API Feb-March 2024\n as alternative to the existing Annotation getBody function, but the signature for\n getBody3D was chosen to be a single object instance, not an array.\n \n At this stage, the merging of the 2D API anf the draft 3D API has been completed, so\n 3D applications can use the getBody() function to retrieve the body of an Annotation intended\n to target a scene. For compatibily the return value of the function is still an\n array.\n \n 3D clients using getBody are responsible for choosing the appropriate instance from the\n returned array. In most cases this will be the sole 0th element.\n **/\n Annotation.prototype.getBody3D = function () {\n console.warn("Annotation.getBody3D is deprecated: replace with getBody3D() with getBody()[0]");\n return this.getBody()[0];\n };\n Annotation.prototype.getMotivation = function () {\n var motivation = this.getProperty("motivation");\n if (motivation) {\n //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation);\n return motivation;\n }\n return null;\n };\n // open annotation\n Annotation.prototype.getOn = function () {\n return this.getProperty("on");\n };\n Annotation.prototype.getTarget = function () {\n var rawTarget = this.getPropertyAsObject("target");\n if (rawTarget.isIRI)\n return rawTarget;\n if (rawTarget.type && rawTarget.type == "SpecificResource") {\n return new internal_1.SpecificResource(rawTarget, this.options);\n }\n else {\n throw new Error("unknown target specified");\n }\n };\n Object.defineProperty(Annotation.prototype, "Target", {\n get: function () { return this.getTarget(); },\n enumerable: false,\n configurable: true\n });\n Annotation.prototype.getResource = function () {\n return new internal_1.Resource(this.getProperty("resource"), this.options);\n };\n Object.defineProperty(Annotation.prototype, "LookAtLocation", {\n /**\n * A 3D point coordinate object for the location of an Annotation\n * to satisfy the requirements of the lookAt property of camera and\n * spotlight resources, according to the draft v4 API as of April 1 2024\n *\n * Is the position of the point for a target which is a SpecificResource with\n * a PointSelector\n * Otherwise, for example when the annotation target is an entire Scene, the\n * location for lookAt is the origin (0,0,0)\n **/\n get: function () {\n var _a;\n var target = this.getTarget();\n if (target.isSpecificResource && ((_a = target.getSelector()) === null || _a === void 0 ? void 0 : _a.isPointSelector))\n return target.getSelector().getLocation();\n else\n return new threejs_math_1.Vector3(0.0, 0.0, 0.0);\n },\n enumerable: false,\n configurable: true\n });\n return Annotation;\n}(internal_1.ManifestResource));\nexports.Annotation = Annotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Annotation.ts?')},"./src/AnnotationBody.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBody = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\nWith the 3D extensions to the IIIF Presentation API the name of this\nclass is misleading, but for now is being retained for the sake backward\ncompatibility with earlier manifesto code and tests.\n\nThe 3D extensions allow that the body property of an annotation can be\na light, camera, or model, or a SpecificResource object wrapping a light, camera,\nor model.\n**/\nvar AnnotationBody = /** @class */ (function (_super) {\n __extends(AnnotationBody, _super);\n function AnnotationBody(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = true;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = false;\n // following class members were added to support 3D and mixed 2D/3D content\n // these boolean switches will be appropriately set when the manifest json is parsed\n _this.isModel = true;\n _this.isLight = false;\n _this.isCamera = false;\n return _this;\n }\n // Format, Type, Width, and Height are the body properties supported\n // in the code that supports Presentation 3\n AnnotationBody.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return internal_1.Utils.getMediaType(format);\n }\n return null;\n };\n AnnotationBody.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return (internal_1.Utils.normaliseType(this.getProperty("type")));\n }\n return null;\n };\n AnnotationBody.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n AnnotationBody.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n return AnnotationBody;\n}(internal_1.ManifestResource));\nexports.AnnotationBody = AnnotationBody;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBody.ts?')},"./src/AnnotationBodyParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBodyParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LightTypes = ["AmbientLight", "DirectionalLight"];\nvar CameraTypes = ["PerspectiveCamera", "OrthographicCamera"];\nvar DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"];\nvar AnnotationBodyParser = /** @class */ (function () {\n function AnnotationBodyParser() {\n }\n AnnotationBodyParser.BuildFromJson = function (jsonld, options) {\n if (DisplayedTypes.includes(jsonld.type))\n return new internal_1.AnnotationBody(jsonld, options);\n else if (LightTypes.includes(jsonld.type))\n return new internal_1.Light(jsonld, options);\n else if (CameraTypes.includes(jsonld.type))\n return new internal_1.Camera(jsonld, options);\n else\n throw new Error("unimplemented type for AnnotationBody: " + jsonld.type);\n };\n return AnnotationBodyParser;\n}());\nexports.AnnotationBodyParser = AnnotationBodyParser;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBodyParser.ts?')},"./src/AnnotationList.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationList = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationList = /** @class */ (function (_super) {\n __extends(AnnotationList, _super);\n function AnnotationList(label, jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.label = label;\n _this.options = options;\n return _this;\n }\n AnnotationList.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n AnnotationList.prototype.getLabel = function () {\n return this.label;\n };\n AnnotationList.prototype.getResources = function () {\n var _this = this;\n var resources = this.getProperty("resources");\n return resources.map(function (resource) { return new internal_1.Annotation(resource, _this.options); });\n };\n AnnotationList.prototype.load = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.isLoaded) {\n resolve(_this);\n }\n else {\n var id = _this.__jsonld.id;\n if (!id) {\n id = _this.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id)\n .then(function (data) {\n _this.__jsonld = data;\n _this.context = _this.getProperty("context");\n _this.id = _this.getProperty("id");\n _this.isLoaded = true;\n resolve(_this);\n })\n .catch(reject);\n }\n });\n };\n return AnnotationList;\n}(internal_1.JSONLDResource));\nexports.AnnotationList = AnnotationList;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationList.ts?')},"./src/AnnotationPage.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationPage = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationPage = /** @class */ (function (_super) {\n __extends(AnnotationPage, _super);\n function AnnotationPage(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n AnnotationPage.prototype.getItems = function () {\n return this.getProperty("items");\n };\n return AnnotationPage;\n}(internal_1.ManifestResource));\nexports.AnnotationPage = AnnotationPage;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationPage.ts?')},"./src/Camera.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Camera = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Camera = /** @class */ (function (_super) {\n __extends(Camera, _super);\n function Camera(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isModel = false;\n _this.isLight = false;\n _this.isCamera = true;\n return _this;\n }\n Object.defineProperty(Camera.prototype, "isPerspectiveCamera", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "perspectivecamera");\n },\n enumerable: false,\n configurable: true\n });\n /**\n @returns full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n Camera.prototype.getFieldOfView = function () {\n if (this.isPerspectiveCamera) {\n var value = this.getProperty("fieldOfView");\n if (value)\n return value;\n else\n return 45.0;\n }\n else\n return undefined;\n };\n Object.defineProperty(Camera.prototype, "FieldOfView", {\n /**\n Full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n get: function () { return this.getFieldOfView(); },\n enumerable: false,\n configurable: true\n });\n /**\n * @return : if not null, is either a PointSelector, or an object\n * with an id matching the id of an Annotation instance.\n **/\n Camera.prototype.getLookAt = function () {\n var rawObj = this.getPropertyAsObject("lookAt");\n var rawType = (rawObj["type"] || rawObj["@type"]);\n if (rawType == "Annotation") {\n return rawObj;\n }\n if (rawType == "PointSelector") {\n return new internal_1.PointSelector(rawObj);\n }\n throw new Error(\'unidentified value of lookAt ${rawType}\');\n };\n Object.defineProperty(Camera.prototype, "LookAt", {\n get: function () { return this.getLookAt(); },\n enumerable: false,\n configurable: true\n });\n return Camera;\n}(internal_1.AnnotationBody));\nexports.Camera = Camera;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/Camera.ts?')},"./src/Canvas.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Canvas = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n// @ts-ignore\nvar flatten_1 = __importDefault(__webpack_require__(/*! lodash/flatten */ "./node_modules/lodash/flatten.js"));\n// @ts-ignore\nvar flattenDeep_1 = __importDefault(__webpack_require__(/*! lodash/flattenDeep */ "./node_modules/lodash/flattenDeep.js"));\nvar Canvas = /** @class */ (function (_super) {\n __extends(Canvas, _super);\n function Canvas(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // http://iiif.io/api/image/2.1/#canonical-uri-syntax\n Canvas.prototype.getCanonicalImageUri = function (w) {\n var id = null;\n var region = "full";\n var rotation = 0;\n var quality = "default";\n var width = w;\n var size;\n // if an info.json has been loaded\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data["@id"]) {\n id = this.externalResource.data["@id"];\n if (!width) {\n width = this.externalResource.data.width;\n }\n if (this.externalResource.data["@context"]) {\n if (this.externalResource.data["@context"].indexOf("/1.0/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1.1/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1/context.json") > -1) {\n quality = "native";\n }\n }\n }\n else {\n // info.json hasn\'t been loaded yet\n var images = void 0;\n // presentation 2.0\n images = this.getImages();\n if (images && images.length) {\n var firstImage = images[0];\n var resource = firstImage.getResource();\n var services = resource.getServices();\n if (!width) {\n width = resource.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return (internal_1.Utils.isImageProfile(service.getProfile()) ||\n internal_1.Utils.isImageServiceType(service.getIIIFResourceType()));\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === resource.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return resource.id;\n }\n }\n // presentation 3.0\n images = this.getContent();\n if (images && images.length) {\n var firstImage = images[0];\n // Developer note: Since Canvas in Presentation 3 doesn\'t use\n // SpecificResource resources in the body, force a cast\n var body = firstImage.getBody();\n var anno = body[0];\n var services = anno.getServices();\n if (!width) {\n width = anno.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return internal_1.Utils.isImageServiceType(service.getIIIFResourceType());\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === anno.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return anno.id;\n }\n }\n // todo: should this be moved to getThumbUri?\n if (!id) {\n var thumbnail = this.getProperty("thumbnail");\n if (thumbnail) {\n if (typeof thumbnail === "string") {\n return thumbnail;\n }\n else {\n if (thumbnail["@id"]) {\n return thumbnail["@id"];\n }\n else if (thumbnail.length) {\n return thumbnail[0].id;\n }\n }\n }\n }\n }\n size = width + ",";\n // trim off trailing \'/\'\n if (id && id.endsWith("/")) {\n id = id.substr(0, id.length - 1);\n }\n var uri = [id, region, size, rotation, quality + ".jpg"].join("/");\n return uri;\n };\n Canvas.prototype.getMaxDimensions = function () {\n var maxDimensions = null;\n var profile;\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data.profile) {\n profile = this.externalResource.data.profile;\n if (Array.isArray(profile)) {\n profile = profile.filter(function (p) { return p["maxWidth" || 0]; })[0];\n if (profile) {\n maxDimensions = new internal_1.Size(profile.maxWidth, profile.maxHeight ? profile.maxHeight : profile.maxWidth);\n }\n }\n }\n return maxDimensions;\n };\n // Presentation API 3.0\n Canvas.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n return content;\n };\n Canvas.prototype.getDuration = function () {\n return this.getProperty("duration");\n };\n // presentation 2.0\n Canvas.prototype.getImages = function () {\n var images = [];\n if (!this.__jsonld.images)\n return images;\n for (var i = 0; i < this.__jsonld.images.length; i++) {\n var a = this.__jsonld.images[i];\n var annotation = new internal_1.Annotation(a, this.options);\n images.push(annotation);\n }\n return images;\n };\n Canvas.prototype.getIndex = function () {\n return this.getProperty("index");\n };\n Canvas.prototype.getOtherContent = function () {\n var _this = this;\n var otherContent = Array.isArray(this.getProperty("otherContent"))\n ? this.getProperty("otherContent")\n : [this.getProperty("otherContent")];\n var canonicalComparison = function (typeA, typeB) {\n if (typeof typeA !== "string" || typeof typeB !== "string") {\n return false;\n }\n return typeA.toLowerCase() === typeA.toLowerCase();\n };\n var otherPromises = otherContent\n .filter(function (otherContent) {\n return otherContent &&\n canonicalComparison(otherContent["@type"], "sc:AnnotationList");\n })\n .map(function (annotationList, i) {\n return new internal_1.AnnotationList(annotationList["label"] || "Annotation list ".concat(i), annotationList, _this.options);\n })\n .map(function (annotationList) { return annotationList.load(); });\n return Promise.all(otherPromises);\n };\n // Prefer thumbnail service to image service if supplied and if\n // the thumbnail service can provide a satisfactory size +/- x pixels.\n // this is used to get thumb URIs *before* the info.json has been requested\n // and populate thumbnails in a viewer.\n // the publisher may also provide pre-computed fixed-size thumbs for better performance.\n //getThumbUri(width: number): string {\n //\n // var uri;\n // var images: IAnnotation[] = this.getImages();\n //\n // if (images && images.length) {\n // var firstImage = images[0];\n // var resource: IResource = firstImage.getResource();\n // var services: IService[] = resource.getServices();\n //\n // for (let i = 0; i < services.length; i++) {\n // var service: IService = services[i];\n // var id = service.id;\n //\n // if (!_endsWith(id, \'/\')) {\n // id += \'/\';\n // }\n //\n // uri = id + \'full/\' + width + \',/0/\' + Utils.getImageQuality(service.getProfile()) + \'.jpg\';\n // }\n // }\n //\n // return uri;\n //}\n //getType(): CanvasType {\n // return new CanvasType(this.getProperty(\'@type\').toLowerCase());\n //}\n Canvas.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Canvas.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Canvas.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Canvas.prototype, "imageResources", {\n get: function () {\n var _this = this;\n var resources = (0, flattenDeep_1.default)([\n this.getImages().map(function (i) { return i.getResource(); }),\n this.getContent().map(function (i) { return i.getBody(); })\n ]);\n return (0, flatten_1.default)(resources.map(function (resource) {\n switch (resource.getProperty("type").toLowerCase()) {\n case dist_commonjs_1.ExternalResourceType.CHOICE:\n case dist_commonjs_1.ExternalResourceType.OA_CHOICE:\n return new Canvas({\n images: (0, flatten_1.default)([\n resource.getProperty("default"),\n resource.getProperty("item")\n ]).map(function (r) { return ({ resource: r }); })\n }, _this.options)\n .getImages()\n .map(function (i) { return i.getResource(); });\n default:\n return resource;\n }\n }));\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "resourceAnnotations", {\n get: function () {\n return (0, flattenDeep_1.default)([this.getImages(), this.getContent()]);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns a given resource Annotation, based on a contained resource or body\n * id\n */\n Canvas.prototype.resourceAnnotation = function (id) {\n return this.resourceAnnotations.find(function (anno) {\n return anno.getResource().id === id ||\n (0, flatten_1.default)(new Array(anno.getBody())).some(function (body) { return body.id === id; });\n });\n };\n /**\n * Returns the fragment placement values if a resourceAnnotation is placed on\n * a canvas somewhere besides the full extent\n */\n Canvas.prototype.onFragment = function (id) {\n var resourceAnnotation = this.resourceAnnotation(id);\n if (!resourceAnnotation)\n return undefined;\n // IIIF v2\n var on = resourceAnnotation.getProperty("on");\n // IIIF v3\n var target = resourceAnnotation.getProperty("target");\n if (!on || !target) {\n return undefined;\n }\n var fragmentMatch = (on || target).match(/xywh=(.*)$/);\n if (!fragmentMatch)\n return undefined;\n return fragmentMatch[1].split(",").map(function (str) { return parseInt(str, 10); });\n };\n Object.defineProperty(Canvas.prototype, "iiifImageResources", {\n get: function () {\n return this.imageResources.filter(function (r) { return r && r.getServices()[0] && r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "imageServiceIds", {\n get: function () {\n return this.iiifImageResources.map(function (r) { return r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "aspectRatio", {\n get: function () {\n return this.getWidth() / this.getHeight();\n },\n enumerable: false,\n configurable: true\n });\n return Canvas;\n}(internal_1.Resource));\nexports.Canvas = Canvas;\n\n\n//# sourceURL=webpack://manifesto/./src/Canvas.ts?')},"./src/Collection.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Collection = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Collection = /** @class */ (function (_super) {\n __extends(Collection, _super);\n function Collection(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._collections = null;\n _this._manifests = null;\n jsonld.__collection = _this;\n return _this;\n }\n Collection.prototype.getCollections = function () {\n if (this._collections) {\n return this._collections;\n }\n return (this._collections = (this.items.filter(function (m) { return m.isCollection(); })));\n };\n Collection.prototype.getManifests = function () {\n if (this._manifests) {\n return this._manifests;\n }\n return (this._manifests = (this.items.filter(function (m) { return m.isManifest(); })));\n };\n Collection.prototype.getCollectionByIndex = function (collectionIndex) {\n var collections = this.getCollections();\n var collection;\n for (var i = 0; i < collections.length; i++) {\n var c = collections[i];\n if (c.index === collectionIndex) {\n collection = c;\n }\n }\n if (collection) {\n collection.options.index = collectionIndex;\n // id for collection MUST be dereferenceable\n return collection.load();\n }\n else {\n throw new Error("Collection index not found");\n }\n };\n Collection.prototype.getManifestByIndex = function (manifestIndex) {\n var manifests = this.getManifests();\n var manifest;\n for (var i = 0; i < manifests.length; i++) {\n var m = manifests[i];\n if (m.index === manifestIndex) {\n manifest = m;\n }\n }\n if (manifest) {\n manifest.options.index = manifestIndex;\n return manifest.load();\n }\n else {\n throw new Error("Manifest index not found");\n }\n };\n Collection.prototype.getTotalCollections = function () {\n return this.getCollections().length;\n };\n Collection.prototype.getTotalManifests = function () {\n return this.getManifests().length;\n };\n Collection.prototype.getTotalItems = function () {\n return this.items.length;\n };\n Collection.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n return dist_commonjs_1.ViewingDirection.LEFT_TO_RIGHT;\n };\n /**\n * Note: this only will return the first behavior as per the manifesto convention\n * IIIF v3 supports multiple behaviors\n */\n Collection.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Collection.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n /**\n * Get a tree of sub collections and manifests, using each child manifest\'s first \'top\' range.\n */\n Collection.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n //console.log("get default tree for ", this.id);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n this._parseManifests(this);\n this._parseCollections(this);\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Collection.prototype._parseManifests = function (parentCollection) {\n if (parentCollection.getManifests() &&\n parentCollection.getManifests().length) {\n for (var i = 0; i < parentCollection.getManifests().length; i++) {\n var manifest = parentCollection.getManifests()[i];\n var tree = manifest.getDefaultTree();\n tree.label =\n manifest.parentLabel ||\n manifest.getLabel().getValue(this.options.locale) ||\n "manifest " + (i + 1);\n tree.navDate = manifest.getNavDate();\n tree.data.id = manifest.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n Collection.prototype._parseCollections = function (parentCollection) {\n //console.log("parse collections for ", parentCollection.id);\n if (parentCollection.getCollections() &&\n parentCollection.getCollections().length) {\n for (var i = 0; i < parentCollection.getCollections().length; i++) {\n var collection = parentCollection.getCollections()[i];\n var tree = collection.getDefaultTree();\n tree.label =\n collection.parentLabel ||\n collection.getLabel().getValue(this.options.locale) ||\n "collection " + (i + 1);\n tree.navDate = collection.getNavDate();\n tree.data.id = collection.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n return Collection;\n}(internal_1.IIIFResource));\nexports.Collection = Collection;\n\n\n//# sourceURL=webpack://manifesto/./src/Collection.ts?')},"./src/Color.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n//import { colorString } from "color-string"\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Color = void 0;\nvar colorString = __webpack_require__(/*! color-string */ "./node_modules/color-string/index.js");\n/**\n * class structure with red, green, blue values in 0-255 range\n * Uses the {@link https://www.npmjs.com/package.color-string | color-string }\n * library for conversion from and to string representations of color.\n**/\nvar Color = /** @class */ (function () {\n /**\n * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red\n **/\n function Color(rgbValue) {\n this.value = rgbValue;\n }\n /**\n * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red\n * @returns Color instance.\n **/\n Color.fromCSS = function (cssTerm) {\n var rv = colorString.get(cssTerm);\n if (rv.model !== \'rgb\')\n throw new Error("unsupported color string: " + cssTerm);\n return new Color([rv.value[0], rv.value[1], rv.value[2]]);\n };\n Object.defineProperty(Color.prototype, "red", {\n /**\n * @return 0 to 255 value of red color component\n **/\n get: function () { return this.value[0]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "green", {\n /**\n * @return 0 to 255 value of green color component\n **/\n get: function () { return this.value[1]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "blue", {\n /**\n * @return 0 to 255 value of blue color component\n **/\n get: function () { return this.value[2]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "CSS", {\n /**\n * @returns hex string (as for CSS ) representation of r,g,b components\n **/\n get: function () { return colorString.to.hex(this.value); },\n enumerable: false,\n configurable: true\n });\n return Color;\n}());\nexports.Color = Color;\n\n\n//# sourceURL=webpack://manifesto/./src/Color.ts?')},"./src/Duration.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Duration = void 0;\nvar Duration = /** @class */ (function () {\n function Duration(start, end) {\n this.start = start;\n this.end = end;\n }\n Duration.prototype.getLength = function () {\n return this.end - this.start;\n };\n return Duration;\n}());\nexports.Duration = Duration;\n\n\n//# sourceURL=webpack://manifesto/./src/Duration.ts?')},"./src/Geometry3d.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.lightRelativeRotation = exports.cameraRelativeRotation = void 0;\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\n// https://ros2jsguy.github.io/threejs-math/index.html\n/**\n* performs the calculation required for the lookAt\n* property of a camera resource. Determines the\n* required angles of two rotations, the first about\n* the x axis and the second about the y axis, which will\n* rotate the default camera direction (0,0,-1) into the\n* direction of the input arguments\n*\n* Result of calculation is returned as a instance of EulerAngle from the\n* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The\n* three-js library uses body-fixed axes to represent EulerAngles, which reverse\n* the ordering of the "relative rotation" algorithm described in the\n* draft 3d api.\n\n* @param direction A vector interpreted as a direction. Client code\n* responsible for not passing a 0-length vector, else a\n\n*\n* @returns threejs-math.EulerAngle instance\n**/\nfunction cameraRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n // projDirection is the direction projected onto the xz plane\n var projDirection = direction.clone().setComponent(1, 0.0);\n var projLength = projDirection.length();\n // handle the edge case, desired viewing direction is either straight up\n // or straight down\n if (projLength == 0.0) {\n if (direction.y > 0.0) {\n // looking straight up fro below\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(+90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n else {\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(-90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n }\n var yAngleRad = Math.atan2(-projDirection.x, -projDirection.z);\n var xAngleRad = Math.atan2(direction.y, projLength);\n return new threejs_math_1.Euler(xAngleRad, yAngleRad, 0.0, "YXZ");\n}\nexports.cameraRelativeRotation = cameraRelativeRotation;\n;\nfunction lightRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n var unit_direction = direction.clone().divideScalar(direction.length());\n // negative y axis is initial direction of DirectionalLight, SpotLight\n // in draft 3D API\n var ny_axis = new threejs_math_1.Vector3(0.0, -1.0, 0.0);\n var quat = new threejs_math_1.Quaternion().setFromUnitVectors(ny_axis, unit_direction);\n var tmp = new threejs_math_1.Euler().setFromQuaternion(quat, "ZXY");\n // standard be setting the final intrinsic Y rotation, which is\n // along desired direction, to 0\n return new threejs_math_1.Euler(tmp.x, 0.0, tmp.z, "ZXY");\n}\nexports.lightRelativeRotation = lightRelativeRotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Geometry3d.ts?')},"./src/IAccessToken.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IAccessToken.ts?')},"./src/IExternalImageResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalImageResourceData.ts?')},"./src/IExternalResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResource.ts?')},"./src/IExternalResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceData.ts?')},"./src/IExternalResourceOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceOptions.ts?')},"./src/IIIFResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.IIIFResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar IIIFResource = /** @class */ (function (_super) {\n __extends(IIIFResource, _super);\n function IIIFResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = -1;\n _this.isLoaded = false;\n var defaultOptions = {\n defaultLabel: "-",\n locale: "en-GB",\n resource: _this,\n pessimisticAccessControl: false\n };\n _this.options = Object.assign(defaultOptions, options);\n return _this;\n }\n /**\n * @deprecated\n */\n IIIFResource.prototype.getAttribution = function () {\n //console.warn(\'getAttribution will be deprecated, use getRequiredStatement instead.\');\n var attribution = this.getProperty("attribution");\n if (attribution) {\n return internal_1.PropertyValue.parse(attribution, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getDescription = function () {\n var description = this.getProperty("description");\n if (description) {\n return internal_1.PropertyValue.parse(description, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getHomepage = function () {\n var homepage = this.getProperty("homepage");\n if (!homepage)\n return null;\n if (typeof homepage == "string")\n return homepage;\n if (Array.isArray(homepage) && homepage.length) {\n homepage = homepage[0];\n }\n return homepage["@id"] || homepage.id;\n };\n IIIFResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n IIIFResource.prototype.getLogo = function () {\n var logo = this.getProperty("logo");\n // Presentation 3.\n // The logo is exclusive to the "provider" property, which is of type "Agent".\n // In order to fulfil `manifest.getLogo()` we should check\n // When P3 is fully supported, the following should work.\n // return this.getProvider()?.getLogo();\n if (!logo) {\n var provider = this.getProperty("provider");\n if (!provider) {\n return null;\n }\n logo = provider.logo;\n }\n if (!logo)\n return null;\n if (typeof logo === "string")\n return logo;\n if (Array.isArray(logo) && logo.length) {\n logo = logo[0];\n }\n return logo["@id"] || logo.id;\n };\n IIIFResource.prototype.getLicense = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("license"), this.options.locale);\n };\n IIIFResource.prototype.getNavDate = function () {\n return new Date(this.getProperty("navDate"));\n };\n IIIFResource.prototype.getRelated = function () {\n return this.getProperty("related");\n };\n IIIFResource.prototype.getSeeAlso = function () {\n return this.getProperty("seeAlso");\n };\n IIIFResource.prototype.getTrackingLabel = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.TRACKING_EXTENSIONS));\n if (service) {\n return service.getProperty("trackingLabel");\n }\n return "";\n };\n IIIFResource.prototype.getDefaultTree = function () {\n this.defaultTree = new internal_1.TreeNode("root");\n this.defaultTree.data = this;\n return this.defaultTree;\n };\n IIIFResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n else {\n // fall back to attribution (if it exists)\n var attribution = this.getAttribution();\n if (attribution) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.value = attribution;\n }\n }\n return requiredStatement;\n };\n IIIFResource.prototype.isCollection = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.isManifest = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.load = function () {\n var that = this;\n return new Promise(function (resolve) {\n if (that.isLoaded) {\n resolve(that);\n }\n else {\n var options_1 = that.options;\n options_1.navDate = that.getNavDate();\n var id = that.__jsonld.id;\n if (!id) {\n id = that.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id).then(function (data) {\n that.parentLabel = that.getLabel().getValue(options_1.locale);\n var parsed = internal_1.Deserialiser.parse(data, options_1);\n that = Object.assign(that, parsed);\n //that.parentCollection = options.resource.parentCollection;\n that.index = options_1.index;\n resolve(that);\n });\n }\n });\n };\n return IIIFResource;\n}(internal_1.ManifestResource));\nexports.IIIFResource = IIIFResource;\n\n\n//# sourceURL=webpack://manifesto/./src/IIIFResource.ts?')},"./src/IManifestoOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IManifestoOptions.ts?')},"./src/JSONLDResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.JSONLDResource = void 0;\nvar JSONLDResource = /** @class */ (function () {\n function JSONLDResource(jsonld) {\n this.__jsonld = jsonld;\n this.context = this.getProperty("context");\n this.id = this.getProperty("id");\n }\n JSONLDResource.prototype.getProperty = function (name) {\n var prop = null;\n if (this.__jsonld) {\n prop = this.__jsonld[name];\n if (!prop) {\n // property may have a prepended \'@\'\n prop = this.__jsonld["@" + name];\n }\n }\n return prop;\n };\n /**\n A function that wraps the getProperty function, which client\n code can use if it is needed to identify when the json value of\n a property is an IRI -- Internationalized Resource Identifier\n \n If the value of the json value is a bare string, then it will be\n wrapped in a json object with the string in the property \'id\',\n additionally that property will have a property \'isIRI\' which will\n be true for the literal string case, otherwise false meaning the\n returned getProperty should be parsed as before.\n \n **/\n JSONLDResource.prototype.getPropertyAsObject = function (name) {\n var prop = this.getProperty(name);\n if (prop === null)\n return prop;\n else if (typeof (prop) === \'string\')\n return { "id": prop,\n "isIRI": true\n };\n else if (prop === Object(prop))\n return prop;\n else {\n throw new Error("cannot resolve prop as object: " + prop);\n }\n };\n return JSONLDResource;\n}());\nexports.JSONLDResource = JSONLDResource;\n\n\n//# sourceURL=webpack://manifesto/./src/JSONLDResource.ts?')},"./src/LabelValuePair.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LabelValuePair = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LabelValuePair = /** @class */ (function () {\n function LabelValuePair(defaultLocale) {\n this.defaultLocale = defaultLocale;\n }\n LabelValuePair.prototype.parse = function (resource) {\n this.resource = resource;\n this.label = internal_1.PropertyValue.parse(this.resource.label, this.defaultLocale);\n this.value = internal_1.PropertyValue.parse(this.resource.value, this.defaultLocale);\n };\n // shortcuts to get/set values based on user or default locale\n LabelValuePair.prototype.getLabel = function (locale) {\n if (this.label === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.label.getValue(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setLabel = function (value) {\n if (this.label === null) {\n this.label = new internal_1.PropertyValue([]);\n }\n this.label.setValue(value, this.defaultLocale);\n };\n LabelValuePair.prototype.getValue = function (locale, joinWith) {\n if (joinWith === void 0) { joinWith = " "; }\n if (this.value === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValue(locale || this.defaultLocale, joinWith);\n };\n LabelValuePair.prototype.getValues = function (locale) {\n if (this.value === null) {\n return [];\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValues(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setValue = function (value) {\n if (this.value === null) {\n this.value = new internal_1.PropertyValue([]);\n }\n this.value.setValue(value, this.defaultLocale);\n };\n return LabelValuePair;\n}());\nexports.LabelValuePair = LabelValuePair;\n\n\n//# sourceURL=webpack://manifesto/./src/LabelValuePair.ts?')},"./src/Language.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/Language.ts?')},"./src/LanguageMap.ts":function(__unused_webpack_module,exports){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LanguageMap = void 0;\n/** @deprecated Use PropertyValue instead */\nvar LanguageMap = /** @class */ (function (_super) {\n __extends(LanguageMap, _super);\n function LanguageMap() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /** @deprecated Use the `PropertyValue#getValue` instance method instead */\n LanguageMap.getValue = function (languageCollection, locale) {\n return languageCollection.getValue(locale, " ");\n };\n /** @deprecated Use the `PropertyValue#getValues` instance method instead */\n LanguageMap.getValues = function (languageCollection, locale) {\n return languageCollection.getValues(locale);\n };\n return LanguageMap;\n}(Array));\nexports.LanguageMap = LanguageMap;\n\n\n//# sourceURL=webpack://manifesto/./src/LanguageMap.ts?')},"./src/Light.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Light = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Light = /** @class */ (function (_super) {\n __extends(Light, _super);\n function Light(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isLight = true;\n _this.isModel = false;\n return _this;\n }\n Object.defineProperty(Light.prototype, "isAmbientLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "ambientlight");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Light.prototype, "isDirectionalLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "directionallight");\n },\n enumerable: false,\n configurable: true\n });\n Light.prototype.getColor = function () {\n var hexColor = this.getProperty("color");\n if (hexColor)\n return internal_1.Color.fromCSS(hexColor);\n else\n return new internal_1.Color([255, 255, 255]); // white light\n };\n /**\n * The implementation of the intensity is based on\n * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md }\n * and the example 3D manifests\n * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights }\n * on 24 Mar 2024. The intensity property in the manifest is an object\n * with declared type \'Value\', a numeric property named \'value\' and a\n * property named unit . This implementation will only work with a unit == \'relative\'\n * and it will be assumed that a relative unit value of 1.0 corresponds to the\n * brightest light source a rendering engine supports.\n *\n * This code will implement a default intensity of 1.0\n **/\n Light.prototype.getIntensity = function () {\n var intObject = this.getProperty("intensity");\n if (intObject) {\n try {\n if (!(intObject.type === "Value" && intObject.unit === "relative"))\n throw new Error();\n return intObject.value;\n }\n catch (err) {\n throw new Error("unable to interpret raw intensity object " + JSON.stringify(intObject));\n }\n }\n else\n return 1.0;\n };\n return Light;\n}(internal_1.AnnotationBody));\nexports.Light = Light;\n\n\n//# sourceURL=webpack://manifesto/./src/Light.ts?')},"./src/Manifest.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Manifest = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n* @remarks Scenes are conveniently retrieved from a Manifest by iterating through\n* Sequence in the Manifest, inner loop the Scenes in each sequence\n* @see {@link Sequence }\n*\n* @example\n* var manifest: Manifest;\n* function doSomethingWithScene(scene:Scene)...\n* ...\n* foreach(var seq:Sequence of manifest.getSequences()\n* foreach(var scene : Scene of seq.getScenes()\n* doSomethingWithScene(scene);\n**/\nvar Manifest = /** @class */ (function (_super) {\n __extends(Manifest, _super);\n function Manifest(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = 0;\n _this._allRanges = null;\n _this.items = [];\n _this._topRanges = [];\n if (_this.__jsonld.structures && _this.__jsonld.structures.length) {\n var topRanges = _this._getTopRanges();\n for (var i = 0; i < topRanges.length; i++) {\n var range = topRanges[i];\n _this._parseRanges(range, String(i));\n }\n }\n // initialization the cached _annotationIdMap to null\n // it will be populated if and only if client calls make a request\n // to the getter annotationIdMap\n _this._annotationIdMap = null;\n return _this;\n }\n /** @deprecated Use getAccompanyingCanvas instead */\n Manifest.prototype.getPosterCanvas = function () {\n var posterCanvas = this.getProperty("posterCanvas");\n if (posterCanvas) {\n posterCanvas = new internal_1.Canvas(posterCanvas, this.options);\n }\n return posterCanvas;\n };\n Manifest.prototype.getAccompanyingCanvas = function () {\n var accompanyingCanvas = this.getProperty("accompanyingCanvas");\n if (accompanyingCanvas) {\n accompanyingCanvas = new internal_1.Canvas(accompanyingCanvas, this.options);\n }\n return accompanyingCanvas;\n };\n Manifest.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Manifest.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n if (!this.isLoaded) {\n return this.defaultTree;\n }\n var topRanges = this.getTopRanges();\n // if there are any ranges in the manifest, default to the first \'top\' range or generated placeholder\n if (topRanges.length) {\n topRanges[0].getTree(this.defaultTree);\n }\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Manifest.prototype._getTopRanges = function () {\n var topRanges = [];\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var json = this.__jsonld.structures[i];\n if (json.viewingHint === dist_commonjs_1.ViewingHint.TOP) {\n topRanges.push(json);\n }\n }\n // if no viewingHint="top" range was found, create a default one\n if (!topRanges.length) {\n var range = {};\n range.ranges = this.__jsonld.structures;\n topRanges.push(range);\n }\n }\n return topRanges;\n };\n Manifest.prototype.getTopRanges = function () {\n return this._topRanges;\n };\n Manifest.prototype._getRangeById = function (id) {\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var r = this.__jsonld.structures[i];\n if (r["@id"] === id || r.id === id) {\n return r;\n }\n }\n }\n return null;\n };\n //private _parseRangeCanvas(json: any, range: Range): void {\n // todo: currently this isn\'t needed\n //var canvas: IJSONLDResource = new JSONLDResource(json);\n //range.items.push(canvas);\n //}\n Manifest.prototype._parseRanges = function (r, path, parentRange) {\n var range;\n var id = null;\n if (typeof r === "string") {\n id = r;\n r = this._getRangeById(id);\n }\n if (!r) {\n console.warn("Range:", id, "does not exist");\n return;\n }\n range = new internal_1.Range(r, this.options);\n range.parentRange = parentRange;\n range.path = path;\n if (!parentRange) {\n this._topRanges.push(range);\n }\n else {\n parentRange.items.push(range);\n }\n var items = r.items || r.members;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n // todo: use an ItemType constant?\n if ((item["@type"] && item["@type"].toLowerCase() === "sc:range") ||\n (item["type"] && item["type"].toLowerCase() === "range")) {\n this._parseRanges(item, path + "/" + i, range);\n }\n else if ((item["@type"] && item["@type"].toLowerCase() === "sc:canvas") ||\n (item["type"] && item["type"].toLowerCase() === "canvas")) {\n // store the ids on the __jsonld object to be used by Range.getCanvasIds()\n if (!range.canvases) {\n range.canvases = [];\n }\n var id_1 = item.id || item["@id"];\n range.canvases.push(id_1);\n }\n }\n }\n else if (r.ranges) {\n for (var i = 0; i < r.ranges.length; i++) {\n this._parseRanges(r.ranges[i], path + "/" + i, range);\n }\n }\n };\n Manifest.prototype.getAllRanges = function () {\n if (this._allRanges != null)\n return this._allRanges;\n this._allRanges = [];\n var topRanges = this.getTopRanges();\n var _loop_1 = function (i) {\n var topRange = topRanges[i];\n if (topRange.id) {\n this_1._allRanges.push(topRange); // it might be a placeholder root range\n }\n var reducer = function (acc, next) {\n acc.add(next);\n var nextRanges = next.getRanges();\n if (nextRanges.length) {\n return nextRanges.reduce(reducer, acc);\n }\n return acc;\n };\n var subRanges = Array.from(topRange.getRanges().reduce(reducer, new Set()));\n this_1._allRanges = this_1._allRanges.concat(subRanges);\n };\n var this_1 = this;\n for (var i = 0; i < topRanges.length; i++) {\n _loop_1(i);\n }\n return this._allRanges;\n };\n Manifest.prototype.getRangeById = function (id) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.id === id) {\n return range;\n }\n }\n return null;\n };\n Manifest.prototype.getRangeByPath = function (path) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.path === path) {\n return range;\n }\n }\n return null;\n };\n /**\n * @returns Array of Sequence instances\n **/\n Manifest.prototype.getSequences = function () {\n if (this.items.length) {\n return this.items;\n }\n // IxIF mediaSequences overrode sequences, so need to be checked first.\n // deprecate this when presentation 3 ships\n var items = this.__jsonld.mediaSequences || this.__jsonld.sequences;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var s = items[i];\n var sequence = new internal_1.Sequence(s, this.options);\n this.items.push(sequence);\n }\n }\n else if (this.__jsonld.items) {\n var sequence = new internal_1.Sequence(this.__jsonld.items, this.options);\n this.items.push(sequence);\n }\n return this.items;\n };\n Manifest.prototype.getSequenceByIndex = function (sequenceIndex) {\n return this.getSequences()[sequenceIndex];\n };\n Manifest.prototype.getTotalSequences = function () {\n return this.getSequences().length;\n };\n Manifest.prototype.getManifestType = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.UI_EXTENSIONS));\n if (service) {\n return service.getProperty("manifestType");\n }\n return internal_1.ManifestType.EMPTY;\n };\n Manifest.prototype.isMultiSequence = function () {\n return this.getTotalSequences() > 1;\n };\n Manifest.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n var behavior = this.getBehavior();\n if (behavior) {\n return behavior === dist_commonjs_1.Behavior.PAGED;\n }\n return false;\n };\n Manifest.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Manifest.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Manifest.prototype, "annotationIdMap", {\n /**\n * Developer Note: The concept of the "id map" appear in the\n * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map\n * This functionality may be available as well in the \'nodeMap\' code of the\n * digitalbazaar/jsonld library\n *\n * this very simplified version just returns a mao of id -> Annotation nodes\n * in manifest\n *\n * THe annotationIdMap is a Javascript object whose property names are\n * IRI (id values) and property values are instances of the Annotation class\n **/\n get: function () {\n if (this._annotationIdMap == null) {\n this._annotationIdMap = {};\n for (var _i = 0, _a = this.getSequences(); _i < _a.length; _i++) {\n var seq = _a[_i];\n for (var _b = 0, _c = seq.getScenes(); _b < _c.length; _b++) {\n var scene = _c[_b];\n for (var _d = 0, _e = scene.getContent(); _d < _e.length; _d++) {\n var anno = _e[_d];\n this._annotationIdMap[anno.id] = anno;\n }\n }\n }\n }\n return this._annotationIdMap;\n },\n enumerable: false,\n configurable: true\n });\n return Manifest;\n}(internal_1.IIIFResource));\nexports.Manifest = Manifest;\n\n\n//# sourceURL=webpack://manifesto/./src/Manifest.ts?')},"./src/ManifestResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar ManifestResource = /** @class */ (function (_super) {\n __extends(ManifestResource, _super);\n function ManifestResource(jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.options = options;\n return _this;\n }\n ManifestResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n ManifestResource.prototype.getLabel = function () {\n var label = this.getProperty("label");\n if (label) {\n return internal_1.PropertyValue.parse(label, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n ManifestResource.prototype.getDefaultLabel = function () {\n return this.getLabel().getValue(this.options.locale);\n };\n ManifestResource.prototype.getMetadata = function () {\n var _metadata = this.getProperty("metadata");\n var metadata = [];\n if (!_metadata)\n return metadata;\n for (var i = 0; i < _metadata.length; i++) {\n var item = _metadata[i];\n var metadataItem = new internal_1.LabelValuePair(this.options.locale);\n metadataItem.parse(item);\n metadata.push(metadataItem);\n }\n return metadata;\n };\n ManifestResource.prototype.getRendering = function (format) {\n var renderings = this.getRenderings();\n for (var i = 0; i < renderings.length; i++) {\n var rendering = renderings[i];\n if (rendering.getFormat() === format) {\n return rendering;\n }\n }\n return null;\n };\n ManifestResource.prototype.getRenderings = function () {\n var rendering;\n // if passing a manifesto-parsed object, use the __jsonld.rendering property,\n // otherwise look for a rendering property\n if (this.__jsonld) {\n rendering = this.__jsonld.rendering;\n }\n else {\n rendering = this.rendering;\n }\n var renderings = [];\n if (!rendering)\n return renderings;\n // coerce to array\n if (!Array.isArray(rendering)) {\n rendering = [rendering];\n }\n for (var i = 0; i < rendering.length; i++) {\n var r = rendering[i];\n renderings.push(new internal_1.Rendering(r, this.options));\n }\n return renderings;\n };\n ManifestResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n return requiredStatement;\n };\n ManifestResource.prototype.getService = function (profile) {\n return internal_1.Utils.getService(this, profile);\n };\n ManifestResource.prototype.getServices = function () {\n return internal_1.Utils.getServices(this);\n };\n ManifestResource.prototype.getThumbnail = function () {\n var thumbnail = this.getProperty("thumbnail");\n if (Array.isArray(thumbnail)) {\n thumbnail = thumbnail[0];\n }\n if (thumbnail) {\n return new internal_1.Thumbnail(thumbnail, this.options);\n }\n return null;\n };\n ManifestResource.prototype.isAnnotation = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.ANNOTATION;\n };\n ManifestResource.prototype.isCanvas = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.CANVAS;\n };\n ManifestResource.prototype.isCollection = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION;\n };\n ManifestResource.prototype.isManifest = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST;\n };\n ManifestResource.prototype.isRange = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.RANGE;\n };\n // this different implementation is necessary until such time as the \n // SCENE is added to the @iiif/vocabulary package.\n ManifestResource.prototype.isScene = function () {\n return this.getIIIFResourceType() === internal_1.Utils.normaliseType(\'Scene\');\n };\n ManifestResource.prototype.isSequence = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.SEQUENCE;\n };\n return ManifestResource;\n}(internal_1.JSONLDResource));\nexports.ManifestResource = ManifestResource;\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestResource.ts?')},"./src/ManifestType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestType = void 0;\nvar ManifestType;\n(function (ManifestType) {\n ManifestType["EMPTY"] = "";\n ManifestType["MANUSCRIPT"] = "manuscript";\n ManifestType["MONOGRAPH"] = "monograph";\n})(ManifestType || (exports.ManifestType = ManifestType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestType.ts?')},"./src/PointSelector.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PointSelector = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar PointSelector = /** @class */ (function (_super) {\n __extends(PointSelector, _super);\n function PointSelector(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isPointSelector = true;\n return _this;\n }\n PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\n };\n return PointSelector;\n}(internal_1.JSONLDResource));\nexports.PointSelector = PointSelector;\n\n\n//# sourceURL=webpack://manifesto/./src/PointSelector.ts?')},"./src/PropertyValue.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PropertyValue = exports.LocalizedValue = void 0;\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/** Utility class to hold one or more values with their associated (optional) locale */\nvar LocalizedValue = /** @class */ (function () {\n function LocalizedValue(value, locale, defaultLocale) {\n if (defaultLocale === void 0) { defaultLocale = "none"; }\n if (Array.isArray(value) && value.length === 1) {\n this._value = value[0];\n }\n else {\n this._value = value;\n }\n if (locale === "none" || locale === "@none") {\n locale = undefined;\n }\n this._locale = locale;\n this._defaultLocale = defaultLocale;\n }\n /** Parse a localized value from a IIIF v2 property value\n *\n * @param {string | string[] | object | object[]} rawVal value from IIIF resource\n * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value\n */\n LocalizedValue.parseV2Value = function (rawVal, defaultLocale) {\n if (typeof rawVal === "string") {\n return new LocalizedValue(rawVal, undefined, defaultLocale);\n }\n else if (rawVal["@value"]) {\n return new LocalizedValue(rawVal["@value"], rawVal["@language"], defaultLocale);\n }\n return null;\n };\n Object.defineProperty(LocalizedValue.prototype, "value", {\n /*** @deprecated Use PropertyValue#getValue instead */\n get: function () {\n if (Array.isArray(this._value)) {\n return this._value.join(" ");\n }\n return this._value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizedValue.prototype, "locale", {\n /*** @deprecated Don\'t use, only used for backwards compatibility reasons */\n get: function () {\n if (this._locale === undefined) {\n return this._defaultLocale;\n }\n return this._locale;\n },\n enumerable: false,\n configurable: true\n });\n LocalizedValue.prototype.addValue = function (value) {\n if (!Array.isArray(this._value)) {\n this._value = [this._value];\n }\n if (Array.isArray(value)) {\n this._value = this._value.concat(value);\n }\n else {\n this._value.push(value);\n }\n };\n return LocalizedValue;\n}());\nexports.LocalizedValue = LocalizedValue;\n/***\n * Holds a collection of values and their (optional) languages and allows\n * language-based value retrieval as per the algorithm described in\n * https://iiif.io/api/presentation/2.1/#language-of-property-values\n */\nvar PropertyValue = /** @class */ (function (_super) {\n __extends(PropertyValue, _super);\n function PropertyValue(values, defaultLocale) {\n if (values === void 0) { values = []; }\n var _this = _super.apply(this, values) || this;\n // Needed for ES5 compatibility, see https://stackoverflow.com/a/40967939\n _this.__proto__ = PropertyValue.prototype;\n _this._defaultLocale = defaultLocale;\n return _this;\n }\n PropertyValue.parse = function (rawVal, defaultLocale) {\n if (!rawVal) {\n return new PropertyValue([], defaultLocale);\n }\n if (Array.isArray(rawVal)) {\n // Collection of IIIF v2 property values\n var parsed = rawVal\n .map(function (v) { return LocalizedValue.parseV2Value(v, defaultLocale); })\n .filter(function (v) { return v !== null; });\n var byLocale = parsed.reduce(function (acc, lv) {\n var loc = lv._locale;\n if (!loc) {\n // Cannot use undefined as an object key\n loc = "none";\n }\n if (acc[loc]) {\n acc[loc].addValue(lv._value);\n }\n else {\n acc[loc] = lv;\n }\n return acc;\n }, {});\n return new PropertyValue(Object.values(byLocale), defaultLocale);\n }\n else if (typeof rawVal === "string") {\n return new PropertyValue([new LocalizedValue(rawVal, undefined, defaultLocale)], defaultLocale);\n }\n else if (rawVal["@language"]) {\n // Single IIIF v2 property value\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else if (rawVal["@value"]) {\n // Single IIIF v2 property value without language\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else {\n // IIIF v3 property value\n return new PropertyValue(Object.keys(rawVal).map(function (locale) {\n var val = rawVal[locale];\n if (!Array.isArray(val)) {\n throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");\n }\n return new LocalizedValue(val, locale, defaultLocale);\n }), defaultLocale);\n }\n };\n /*** Try to find the available locale that best fit\'s the user\'s preferences. */\n PropertyValue.prototype.getSuitableLocale = function (locales) {\n // If any of the values have a language associated with them, the client\n // must display all of the values associated with the language that best\n // matches the language preference.\n if (locales.length == 0 && this._defaultLocale)\n locales.push(this._defaultLocale);\n // create an array of the language codes for all different LocalizedValue instances in this PropertyValue\n var allLocales = new Array();\n for (var _i = 0, _a = this; _i < _a.length; _i++) {\n var lv = _a[_i];\n if (lv._locale != undefined)\n allLocales.push(lv._locale);\n }\n var _loop_1 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return l === userLocale; });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // First, look for a precise match\n for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) {\n var userLocale = locales_1[_b];\n var state_1 = _loop_1(userLocale);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n var _loop_2 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return Utils_1.Utils.getInexactLocale(l) === Utils_1.Utils.getInexactLocale(userLocale); });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // Look for an inexact match\n for (var _c = 0, locales_2 = locales; _c < locales_2.length; _c++) {\n var userLocale = locales_2[_c];\n var state_2 = _loop_2(userLocale);\n if (typeof state_2 === "object")\n return state_2.value;\n }\n return undefined;\n };\n /**\n * Set the value(s) for a given locale.\n *\n * If there\'s an existing locale that matches the given locale, it will be updated.\n *\n * @param locale Locale to set the value for\n * @param value value to set\n */\n PropertyValue.prototype.setValue = function (value, locale) {\n var existing = undefined;\n if (!locale) {\n existing = this.find(function (lv) { return lv._locale === undefined; });\n }\n else {\n var bestLocale_1 = this.getSuitableLocale([locale]);\n if (bestLocale_1) {\n existing = this.find(function (lv) { return lv._locale === bestLocale_1; });\n }\n }\n if (existing) {\n // Mutate existing localized value\n existing._value = value;\n }\n else {\n // Create a new localized value\n this.push(new LocalizedValue(value, locale, this._defaultLocale));\n }\n };\n /**\n * Get a value in the most suitable locale.\n *\n * @param {string | string[] | undefined} locales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @param {string | undefined} joinWith String to join multiple available values by,\n * if undefined only the first available value will be returned\n * @returns the first value in the most suitable locale or null if none could be found\n */\n PropertyValue.prototype.getValue = function (locales, joinWith) {\n var vals = this.getValues(locales);\n if (vals.length === 0) {\n return null;\n }\n if (joinWith) {\n return vals.join(joinWith);\n }\n return vals[0];\n };\n /**\n * Get all values available in the most suitable locale.\n *\n * @param {string | string[]} userLocales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @returns the values for the most suitable locale, empty if none could be found\n */\n PropertyValue.prototype.getValues = function (userLocales) {\n if (!this.length) {\n return [];\n }\n var locales;\n if (!userLocales) {\n locales = [];\n }\n else if (!Array.isArray(userLocales)) {\n locales = [userLocales];\n }\n else {\n locales = userLocales;\n }\n // If none of the values have a language associated with them, the client\n // must display all of the values.\n if (this.length === 1 && this[0]._locale === undefined) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // Try to determine the available locale that best fits the user\'s preferences\n var matchingLocale = this.getSuitableLocale(locales);\n if (matchingLocale) {\n var val = this.find(function (lv) { return lv._locale === matchingLocale; })._value;\n return Array.isArray(val) ? val : [val];\n }\n // If all of the values have a language associated with them, and none match\n // the language preference, the client must select a language and display\n // all of the values associated with that language.\n var allHaveLang = !this.find(function (lv) { return lv._locale === undefined; });\n if (allHaveLang) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // If some of the values have a language associated with them, but none\n // match the language preference, the client must display all of the values\n // that do not have a language associated with them.\n var lv = this.find(function (lv) { return lv._locale === undefined; });\n if (lv) {\n return Array.isArray(lv._value) ? lv._value : [lv._value];\n }\n return [];\n };\n return PropertyValue;\n}(Array));\nexports.PropertyValue = PropertyValue;\n\n\n//# sourceURL=webpack://manifesto/./src/PropertyValue.ts?')},"./src/Range.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Range = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar Range = /** @class */ (function (_super) {\n __extends(Range, _super);\n function Range(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this._ranges = null;\n _this.canvases = null;\n _this.items = [];\n return _this;\n }\n Range.prototype.getCanvasIds = function () {\n if (this.__jsonld.canvases) {\n return this.__jsonld.canvases;\n }\n else if (this.canvases) {\n return this.canvases;\n }\n return [];\n };\n Range.prototype.getDuration = function () {\n // For this implementation, we want to catch SOME of the temporal cases - i.e. when there is a t=1,100\n if (this.canvases && this.canvases.length) {\n var startTimes = [];\n var endTimes = [];\n // When we loop through all of the canvases we store the recorded start and end times.\n // Then we choose the maximum and minimum values from this. This will give us a more accurate duration for the\n // Chosen range. However this is still not perfect and does not cover more complex ranges. These cases are out of\n // scope for this change.\n for (var _i = 0, _a = this.canvases; _i < _a.length; _i++) {\n var canvas = _a[_i];\n if (!canvas)\n continue;\n var _b = (canvas.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [undefined, canvas]), canvasId = _b[1], start_1 = _b[2], end_1 = _b[3];\n if (canvasId) {\n startTimes.push(parseFloat(start_1));\n endTimes.push(parseFloat(end_1));\n }\n }\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n else {\n // get child ranges and calculate the start and end based on them\n var childRanges = this.getRanges();\n var startTimes = [];\n var endTimes = [];\n // Once again, we use a max/min to get the ranges.\n for (var _c = 0, childRanges_1 = childRanges; _c < childRanges_1.length; _c++) {\n var childRange = childRanges_1[_c];\n var duration = childRange.getDuration();\n if (duration) {\n startTimes.push(duration.start);\n endTimes.push(duration.end);\n }\n }\n // And return the minimum as the start, and the maximum as the end.\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n var start;\n var end;\n // There are 2 paths for this implementation. Either we have a list of canvases, or a list of ranges\n // which may have a list of ranges.\n // This is one of the limitations of this implementation.\n if (this.canvases && this.canvases.length) {\n // When we loop through each of the canvases we are expecting to see a fragment or a link to the whole canvas.\n // For example - if we have http://example.org/canvas#t=1,100 it will extract 1 and 100 as the start and end.\n for (var i = 0; i < this.canvases.length; i++) {\n var canvas = this.canvases[i];\n var temporal = internal_1.Utils.getTemporalComponent(canvas);\n if (temporal && temporal.length > 1) {\n if (i === 0) {\n // Note: Cannot guarantee ranges are sequential (fixed above)\n start = Number(temporal[0]);\n }\n if (i === this.canvases.length - 1) {\n end = Number(temporal[1]); // Note: The end of this duration may be targeting a different canvas.\n }\n }\n }\n }\n else {\n // In this second case, where there are nested ranges, we recursively get the duration\n // from each of the child ranges (a start and end) and then choose the first and last for the bounds of this range.\n var childRanges = this.getRanges();\n for (var i = 0; i < childRanges.length; i++) {\n var childRange = childRanges[i];\n var duration = childRange.getDuration();\n if (duration) {\n if (i === 0) {\n start = duration.start;\n }\n if (i === childRanges.length - 1) {\n end = duration.end;\n }\n }\n }\n }\n if (start !== undefined && end !== undefined) {\n return new internal_1.Duration(start, end);\n }\n return undefined;\n };\n // getCanvases(): ICanvas[] {\n // if (this._canvases) {\n // return this._canvases;\n // }\n // return this._canvases = this.items.en().where(m => m.isCanvas()).toArray();\n // }\n Range.prototype.getRanges = function () {\n if (this._ranges) {\n return this._ranges;\n }\n return (this._ranges = this.items.filter(function (m) { return m.isRange(); }));\n };\n Range.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Range.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Range.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Range.prototype.getTree = function (treeRoot) {\n treeRoot.data = this;\n this.treeNode = treeRoot;\n var ranges = this.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var node = new internal_1.TreeNode();\n treeRoot.addNode(node);\n this._parseTreeNode(node, range);\n }\n }\n internal_1.Utils.generateTreeNodeIds(treeRoot);\n return treeRoot;\n };\n Range.prototype.spansTime = function (time) {\n var duration = this.getDuration();\n if (duration) {\n if (time >= duration.start && time <= duration.end) {\n return true;\n }\n }\n return false;\n };\n Range.prototype._parseTreeNode = function (node, range) {\n node.label = range.getLabel().getValue(this.options.locale);\n node.data = range;\n node.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n range.treeNode = node;\n var ranges = range.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var childRange = ranges[i];\n var behavior = childRange.getBehavior();\n if (behavior === dist_commonjs_1.Behavior.NO_NAV) {\n continue;\n }\n else {\n var childNode = new internal_1.TreeNode();\n node.addNode(childNode);\n this._parseTreeNode(childNode, childRange);\n }\n }\n }\n };\n return Range;\n}(internal_1.ManifestResource));\nexports.Range = Range;\n\n\n//# sourceURL=webpack://manifesto/./src/Range.ts?')},"./src/Rendering.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Rendering = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Rendering = /** @class */ (function (_super) {\n __extends(Rendering, _super);\n function Rendering(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Rendering.prototype.getFormat = function () {\n return this.getProperty("format");\n };\n return Rendering;\n}(internal_1.ManifestResource));\nexports.Rendering = Rendering;\n\n\n//# sourceURL=webpack://manifesto/./src/Rendering.ts?')},"./src/Resource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Resource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Resource = /** @class */ (function (_super) {\n __extends(Resource, _super);\n function Resource(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Resource.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return format.toLowerCase();\n }\n return null;\n };\n Resource.prototype.getResources = function () {\n var resources = [];\n if (!this.__jsonld.resources)\n return resources;\n for (var i = 0; i < this.__jsonld.resources.length; i++) {\n var a = this.__jsonld.resources[i];\n var annotation = new internal_1.Annotation(a, this.options);\n resources.push(annotation);\n }\n return resources;\n };\n Resource.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return internal_1.Utils.normaliseType(type);\n }\n return null;\n };\n Resource.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Resource.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Resource.prototype.getMaxWidth = function () {\n return this.getProperty("maxWidth");\n };\n Resource.prototype.getMaxHeight = function () {\n var maxHeight = this.getProperty("maxHeight");\n // if a maxHeight hasn\'t been specified, default to maxWidth.\n // maxWidth in essence becomes maxEdge\n if (!maxHeight) {\n return this.getMaxWidth();\n }\n return null;\n };\n return Resource;\n}(internal_1.ManifestResource));\nexports.Resource = Resource;\n\n\n//# sourceURL=webpack://manifesto/./src/Resource.ts?')},"./src/RotateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.RotateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar RotateTransform = /** @class */ (function (_super) {\n __extends(RotateTransform, _super);\n function RotateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isRotateTransform = true;\n return _this;\n }\n RotateTransform.prototype.getRotation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return RotateTransform;\n}(internal_1.Transform));\nexports.RotateTransform = RotateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/RotateTransform.ts?')},"./src/ScaleTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ScaleTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar ScaleTransform = /** @class */ (function (_super) {\n __extends(ScaleTransform, _super);\n function ScaleTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isScaleTransform = true;\n return _this;\n }\n ScaleTransform.prototype.getScale = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n // note that default scaling is 1.0\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 1.0;\n }\n return retVal;\n };\n return ScaleTransform;\n}(internal_1.Transform));\nexports.ScaleTransform = ScaleTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/ScaleTransform.ts?')},"./src/Scene.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Scene = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Scene = /** @class */ (function (_super) {\n __extends(Scene, _super);\n function Scene(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // Presentation API 3.0\n Scene.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n ;\n return content;\n };\n ;\n Object.defineProperty(Scene.prototype, "Content", {\n // 3D extension\n get: function () { return this.getContent(); },\n enumerable: false,\n configurable: true\n });\n Scene.prototype.getAnnotationById = function (searchId) {\n for (var _i = 0, _a = this.Content; _i < _a.length; _i++) {\n var anno = _a[_i];\n if (anno.id === searchId)\n return anno;\n }\n return null;\n };\n Scene.prototype.getBackgroundColor = function () {\n // regular expression intended to match strings like\n // "#FF00FF" -- interpreted as three hexadecimal values\n // in range 0-255 . Not that the \\w escape matches digits,\n // upper and lower case latin characters, and underscore\n // currently only supports the form for CSS\n // https://www.w3.org/wiki/CSS/Properties/color/RGB\n // with 6 hexadecimal digits\n var bgc = this.getProperty("backgroundColor");\n if (bgc)\n return internal_1.Color.fromCSS(bgc);\n else\n return null;\n };\n ;\n return Scene;\n}(internal_1.ManifestResource));\nexports.Scene = Scene;\n\n\n//# sourceURL=webpack://manifesto/./src/Scene.ts?')},"./src/Sequence.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Sequence = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Sequence = /** @class */ (function (_super) {\n __extends(Sequence, _super);\n function Sequence(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._thumbnails = null;\n return _this;\n }\n Sequence.prototype.getCanvases = function () {\n if (this.items.length) {\n return this.items;\n }\n var items = this.__jsonld.canvases || this.__jsonld.elements;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var c = items[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n else if (this.__jsonld) {\n for (var i = 0; i < this.__jsonld.length; i++) {\n var c = this.__jsonld[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n return this.items;\n };\n Sequence.prototype.getCanvasById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // normalise canvas id\n var canvasId = internal_1.Utils.normaliseUrl(canvas.id);\n if (internal_1.Utils.normaliseUrl(id) === canvasId) {\n return canvas;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasByIndex = function (canvasIndex) {\n return this.getCanvases()[canvasIndex];\n };\n Sequence.prototype.getCanvasIndexById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === id) {\n return i;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasIndexByLabel = function (label, foliated) {\n label = label.trim();\n if (!isNaN(label)) {\n // if the label is numeric\n label = parseInt(label, 10).toString(); // trim any preceding zeros.\n if (foliated)\n label += "r"; // default to recto\n }\n var doublePageRegExp = /(\\d*)\\D+(\\d*)/;\n var match, regExp, regStr, labelPart1, labelPart2;\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // check if there\'s a literal match\n if (canvas.getLabel().getValue(this.options.locale) === label) {\n return i;\n }\n // check if there\'s a match for double-page spreads e.g. 100-101, 100_101, 100 101\n match = doublePageRegExp.exec(label);\n if (!match)\n continue;\n labelPart1 = match[1];\n labelPart2 = match[2];\n if (!labelPart2)\n continue;\n regStr = "^" + labelPart1 + "\\\\D+" + labelPart2 + "$";\n regExp = new RegExp(regStr);\n if (regExp.test(canvas.getLabel().toString())) {\n return i;\n }\n }\n return -1;\n };\n Sequence.prototype.getLastCanvasLabel = function (alphanumeric) {\n for (var i = this.getTotalCanvases() - 1; i >= 0; i--) {\n var canvas = this.getCanvasByIndex(i);\n var label = (canvas.getLabel().getValue(this.options.locale));\n if (alphanumeric) {\n var regExp = /^[a-zA-Z0-9]*$/;\n if (regExp.test(label)) {\n return label;\n }\n }\n else if (label) {\n return label;\n }\n }\n return this.options.defaultLabel;\n };\n Sequence.prototype.getLastPageIndex = function () {\n return this.getTotalCanvases() - 1;\n };\n Sequence.prototype.getNextPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[0] + 1;\n }\n else {\n index = indices[indices.length - 1] + 1;\n }\n }\n else {\n index = canvasIndex + 1;\n }\n if (index > this.getLastPageIndex()) {\n return -1;\n }\n return index;\n };\n Sequence.prototype.getPagedIndices = function (canvasIndex, pagingEnabled) {\n var indices = [];\n if (!pagingEnabled) {\n indices.push(canvasIndex);\n }\n else {\n if (this.isFirstCanvas(canvasIndex) || this.isLastCanvas(canvasIndex)) {\n indices = [canvasIndex];\n }\n else if (canvasIndex % 2) {\n indices = [canvasIndex, canvasIndex + 1];\n }\n else {\n indices = [canvasIndex - 1, canvasIndex];\n }\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n indices = indices.reverse();\n }\n }\n return indices;\n };\n Sequence.prototype.getPrevPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[indices.length - 1] - 1;\n }\n else {\n index = indices[0] - 1;\n }\n }\n else {\n index = canvasIndex - 1;\n }\n return index;\n };\n /**\n * @returns Array of Scene instances in the Sequence\n **/\n Sequence.prototype.getScenes = function () {\n var returnVal = [];\n var low_items = this.__jsonld.elements || this.__jsonld;\n if (low_items) {\n for (var i = 0; i < low_items.length; ++i) {\n var c = low_items[i];\n if (c.type === \'Scene\') {\n var scene = new internal_1.Scene(c, this.options);\n //scene.index = i;\n returnVal.push(scene);\n }\n }\n }\n return returnVal;\n };\n Sequence.prototype.getStartCanvasIndex = function () {\n var startCanvas = this.getStartCanvas();\n if (startCanvas) {\n // if there\'s a startCanvas attribute, loop through the canvases and return the matching index.\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === startCanvas)\n return i;\n }\n }\n // default to first canvas.\n return 0;\n };\n // todo: deprecate\n Sequence.prototype.getThumbs = function (width, height) {\n //console.warn(\'getThumbs will be deprecated, use getThumbnails instead\');\n var thumbs = [];\n var totalCanvases = this.getTotalCanvases();\n for (var i = 0; i < totalCanvases; i++) {\n var canvas = this.getCanvasByIndex(i);\n var thumb = new internal_1.Thumb(width, canvas);\n thumbs.push(thumb);\n }\n return thumbs;\n };\n Sequence.prototype.getThumbnails = function () {\n if (this._thumbnails != null)\n return this._thumbnails;\n this._thumbnails = [];\n var canvases = this.getCanvases();\n for (var i = 0; i < canvases.length; i++) {\n var thumbnail = canvases[i].getThumbnail();\n if (thumbnail) {\n this._thumbnails.push(thumbnail);\n }\n }\n return this._thumbnails;\n };\n Sequence.prototype.getStartCanvas = function () {\n return this.getProperty("startCanvas");\n };\n Sequence.prototype.getTotalCanvases = function () {\n return this.getCanvases().length;\n };\n Sequence.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n else if (this.options.resource.getViewingDirection) {\n return this.options.resource.getViewingDirection();\n }\n return null;\n };\n Sequence.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Sequence.prototype.isCanvasIndexOutOfRange = function (canvasIndex) {\n return canvasIndex > this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isFirstCanvas = function (canvasIndex) {\n return canvasIndex === 0;\n };\n Sequence.prototype.isLastCanvas = function (canvasIndex) {\n return canvasIndex === this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isMultiCanvas = function () {\n return this.getTotalCanvases() > 1;\n };\n Sequence.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n return false;\n };\n // checks if the number of canvases is even - therefore has a front and back cover\n Sequence.prototype.isTotalCanvasesEven = function () {\n return this.getTotalCanvases() % 2 === 0;\n };\n return Sequence;\n}(internal_1.ManifestResource));\nexports.Sequence = Sequence;\n\n\n//# sourceURL=webpack://manifesto/./src/Sequence.ts?')},"./src/Serialisation.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Deserialiser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Deserialiser = /** @class */ (function () {\n function Deserialiser() {\n }\n Deserialiser.parse = function (manifest, options) {\n if (typeof manifest === "string") {\n manifest = JSON.parse(manifest);\n }\n return this.parseJson(manifest, options);\n };\n Deserialiser.parseJson = function (json, options) {\n var resource;\n // have options been passed for the manifest to inherit?\n if (options) {\n if (options.navDate && !isNaN(options.navDate.getTime())) {\n json.navDate = options.navDate.toString();\n }\n }\n if (json["@type"]) {\n switch (json["@type"]) {\n case "sc:Collection":\n resource = this.parseCollection(json, options);\n break;\n case "sc:Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n else {\n // presentation 3\n switch (json["type"]) {\n case "Collection":\n resource = this.parseCollection(json, options);\n break;\n case "Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n // Top-level resource was loaded from a URI, so flag it to prevent\n // unnecessary reload:\n resource.isLoaded = true;\n return resource;\n };\n Deserialiser.parseCollection = function (json, options) {\n var collection = new internal_1.Collection(json, options);\n if (options) {\n collection.index = options.index || 0;\n if (options.resource) {\n collection.parentCollection = options.resource.parentCollection;\n }\n }\n else {\n collection.index = 0;\n }\n this.parseCollections(collection, options);\n this.parseManifests(collection, options);\n this.parseItems(collection, options);\n return collection;\n };\n Deserialiser.parseCollections = function (collection, options) {\n var items;\n if (collection.__jsonld.collections) {\n items = collection.__jsonld.collections;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "collection"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (options) {\n options.index = i;\n }\n var item = this.parseCollection(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseManifest = function (json, options) {\n var manifest = new internal_1.Manifest(json, options);\n return manifest;\n };\n Deserialiser.parseManifests = function (collection, options) {\n var items;\n if (collection.__jsonld.manifests) {\n items = collection.__jsonld.manifests;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "manifest"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = this.parseManifest(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseItem = function (json, options) {\n if (json["@type"]) {\n if (json["@type"].toLowerCase() === "sc:manifest") {\n return this.parseManifest(json, options);\n }\n else if (json["@type"].toLowerCase() === "sc:collection") {\n return this.parseCollection(json, options);\n }\n }\n else if (json.type) {\n if (json.type.toLowerCase() === "manifest") {\n return this.parseManifest(json, options);\n }\n else if (json.type.toLowerCase() === "collection") {\n return this.parseCollection(json, options);\n }\n }\n return null;\n };\n Deserialiser.parseItems = function (collection, options) {\n var items = collection.__jsonld.members || collection.__jsonld.items;\n if (items) {\n var _loop_1 = function (i) {\n if (options) {\n options.index = i;\n }\n var item = this_1.parseItem(items[i], options);\n if (!item)\n return { value: void 0 };\n // only add to items if not already parsed from backwards-compatible collections/manifests arrays\n if (collection.items.filter(function (m) { return m.id === item.id; })[0]) {\n return "continue";\n }\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n };\n var this_1 = this;\n for (var i = 0; i < items.length; i++) {\n var state_1 = _loop_1(i);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n }\n };\n return Deserialiser;\n}());\nexports.Deserialiser = Deserialiser;\n\n\n//# sourceURL=webpack://manifesto/./src/Serialisation.ts?')},"./src/Service.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Service = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Service = /** @class */ (function (_super) {\n __extends(Service, _super);\n function Service(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Service.prototype.getProfile = function () {\n var profile = this.getProperty("profile");\n if (!profile) {\n profile = this.getProperty("dcterms:conformsTo");\n }\n if (Array.isArray(profile)) {\n return profile[0];\n }\n return profile;\n };\n Service.prototype.getConfirmLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale);\n };\n Service.prototype.getDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("description"), this.options.locale);\n };\n Service.prototype.getFailureDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale);\n };\n Service.prototype.getFailureHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale);\n };\n Service.prototype.getHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("header"), this.options.locale);\n };\n Service.prototype.getServiceLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("label"), this.options.locale);\n };\n Service.prototype.getInfoUri = function () {\n var infoUri = this.id;\n if (!infoUri.endsWith("/")) {\n infoUri += "/";\n }\n infoUri += "info.json";\n return infoUri;\n };\n return Service;\n}(internal_1.ManifestResource));\nexports.Service = Service;\n\n\n//# sourceURL=webpack://manifesto/./src/Service.ts?')},"./src/Size.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Size = void 0;\nvar Size = /** @class */ (function () {\n function Size(width, height) {\n this.width = width;\n this.height = height;\n }\n return Size;\n}());\nexports.Size = Size;\n\n\n//# sourceURL=webpack://manifesto/./src/Size.ts?')},"./src/SpecificResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.SpecificResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n Developer note: This implementation does not strictly adhere\n to the description of SpecificResource in the Web Annotation Model\n document https://www.w3.org/TR/annotation-model/\n section 4 : https://www.w3.org/TR/annotation-model/#specific-resources\n \n The getTransform() method returning an Array of 3D Transfom resources, is\n an extension of SpecificResource beyond the web annotation model.\n*/\nvar SpecificResource = /** @class */ (function (_super) {\n __extends(SpecificResource, _super);\n function SpecificResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = false;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = true;\n _this.isSpecificResource = true;\n return _this;\n }\n ;\n SpecificResource.prototype.getSource = function () {\n var raw = this.getPropertyAsObject("source");\n if (raw.isIRI)\n return raw;\n /*\n this logic gets a little convoluted, because we have to preserve\n the cases where the raw json is an array for the sources of a\n SpecificResource applied to an annotation body, while for a target\n of an Annotation we just want a single object\n */\n // case of a source of a SpecificResource which is an Annotation target\n if (raw) {\n var containerTypes = ["Scene", "Canvas"];\n var singleItem = ([].concat(raw))[0];\n if (containerTypes.includes(singleItem["type"]))\n return singleItem;\n }\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n return internal_1.AnnotationBodyParser.BuildFromJson(item, this.options);\n }\n }\n throw new Error("cannot resolve Source " + JSON.stringify(raw));\n };\n SpecificResource.prototype.getSelector = function () {\n var raw = this.getProperty("selector");\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n if (item["type"] === "PointSelector")\n return new internal_1.PointSelector(item);\n }\n throw new Error("unable to resolve SpecificResource selector " + JSON.stringify(this.__jsonld));\n }\n return null;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Selector", {\n get: function () { return this.getSelector(); },\n enumerable: false,\n configurable: true\n });\n SpecificResource.prototype.getTransform = function () {\n var retVal = [];\n var transformItems = this.getProperty("transform");\n for (var i = 0; i < transformItems.length; ++i) {\n var transformItem = transformItems[i];\n retVal.push(internal_1.TransformParser.BuildFromJson(transformItem));\n }\n return retVal;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Transform", {\n get: function () { return this.getTransform(); },\n enumerable: false,\n configurable: true\n });\n return SpecificResource;\n}(internal_1.ManifestResource));\nexports.SpecificResource = SpecificResource;\n\n\n//# sourceURL=webpack://manifesto/./src/SpecificResource.ts?')},"./src/StatusCode.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.StatusCode = void 0;\nvar StatusCode;\n(function (StatusCode) {\n StatusCode[StatusCode["AUTHORIZATION_FAILED"] = 1] = "AUTHORIZATION_FAILED";\n StatusCode[StatusCode["FORBIDDEN"] = 2] = "FORBIDDEN";\n StatusCode[StatusCode["INTERNAL_SERVER_ERROR"] = 3] = "INTERNAL_SERVER_ERROR";\n StatusCode[StatusCode["RESTRICTED"] = 4] = "RESTRICTED";\n})(StatusCode || (exports.StatusCode = StatusCode = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/StatusCode.ts?')},"./src/Thumb.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumb = void 0;\n// todo: deprecate\n// this is used by Sequence.getThumbs\nvar Thumb = /** @class */ (function () {\n function Thumb(width, canvas) {\n this.data = canvas;\n this.index = canvas.index;\n this.width = width;\n var heightRatio = canvas.getHeight() / canvas.getWidth();\n if (heightRatio) {\n this.height = Math.floor(this.width * heightRatio);\n }\n else {\n this.height = width;\n }\n this.uri = canvas.getCanonicalImageUri(width);\n this.label = canvas.getLabel().getValue(); // todo: pass locale?\n this.viewingHint = canvas.getViewingHint();\n }\n return Thumb;\n}());\nexports.Thumb = Thumb;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumb.ts?')},"./src/Thumbnail.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumbnail = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Thumbnail = /** @class */ (function (_super) {\n __extends(Thumbnail, _super);\n function Thumbnail(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n return Thumbnail;\n}(internal_1.Resource));\nexports.Thumbnail = Thumbnail;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumbnail.ts?')},"./src/Transform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Transform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Transform = /** @class */ (function (_super) {\n __extends(Transform, _super);\n function Transform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTransform = true;\n _this.isTransform = true;\n return _this;\n }\n return Transform;\n}(internal_1.JSONLDResource));\nexports.Transform = Transform;\n\n\n//# sourceURL=webpack://manifesto/./src/Transform.ts?')},"./src/TransformParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TransformParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TransformParser = /** @class */ (function () {\n function TransformParser() {\n }\n TransformParser.BuildFromJson = function (jsonld) {\n if (jsonld.type === "TranslateTransform")\n return new internal_1.TranslateTransform(jsonld);\n else if (jsonld.type === "RotateTransform")\n return new internal_1.RotateTransform(jsonld);\n else if (jsonld.type === "ScaleTransform")\n return new internal_1.ScaleTransform(jsonld);\n else\n throw new Error("Unknown transform type " + jsonld.type);\n };\n return TransformParser;\n}());\nexports.TransformParser = TransformParser;\n\n\n//# sourceURL=webpack://manifesto/./src/TransformParser.ts?')},"./src/TranslateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TranslateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TranslateTransform = /** @class */ (function (_super) {\n __extends(TranslateTransform, _super);\n function TranslateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTranslateTransform = true;\n return _this;\n }\n TranslateTransform.prototype.getTranslation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return TranslateTransform;\n}(internal_1.Transform));\nexports.TranslateTransform = TranslateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/TranslateTransform.ts?')},"./src/TreeNode.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNode = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TreeNode = /** @class */ (function () {\n function TreeNode(label, data) {\n this.label = label;\n this.data = data || {};\n this.nodes = [];\n }\n TreeNode.prototype.addNode = function (node) {\n this.nodes.push(node);\n node.parentNode = this;\n };\n TreeNode.prototype.isCollection = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n };\n TreeNode.prototype.isManifest = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n };\n TreeNode.prototype.isRange = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n };\n return TreeNode;\n}());\nexports.TreeNode = TreeNode;\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNode.ts?')},"./src/TreeNodeType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNodeType = void 0;\nvar TreeNodeType;\n(function (TreeNodeType) {\n TreeNodeType["COLLECTION"] = "collection";\n TreeNodeType["MANIFEST"] = "manifest";\n TreeNodeType["RANGE"] = "range";\n})(TreeNodeType || (exports.TreeNodeType = TreeNodeType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNodeType.ts?')},"./src/Utils.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Utils = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar dist_commonjs_2 = __webpack_require__(/*! @edsilv/http-status-codes/dist-commonjs */ "./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js");\n__webpack_require__(/*! isomorphic-unfetch */ "./node_modules/isomorphic-unfetch/index.js");\nvar Utils = /** @class */ (function () {\n function Utils() {\n }\n Utils.getMediaType = function (type) {\n type = type.toLowerCase();\n type = type.split(";")[0];\n return type.trim();\n };\n Utils.getImageQuality = function (profile) {\n if (profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) {\n return "native";\n }\n return "default";\n };\n Utils.getInexactLocale = function (locale) {\n if (locale.indexOf("-") !== -1) {\n return locale.substr(0, locale.indexOf("-"));\n }\n return locale;\n };\n Utils.getLocalisedValue = function (resource, locale) {\n // if the resource is not an array of translations, return the string.\n if (!Array.isArray(resource)) {\n return resource;\n }\n // test for exact match\n for (var i = 0; i < resource.length; i++) {\n var value_1 = resource[i];\n var language_1 = value_1["@language"];\n if (locale === language_1) {\n return value_1["@value"];\n }\n }\n // test for inexact match\n var match = locale.substr(0, locale.indexOf("-"));\n for (var i = 0; i < resource.length; i++) {\n var value = resource[i];\n var language = value["@language"];\n if (language === match) {\n return value["@value"];\n }\n }\n return null;\n };\n Utils.generateTreeNodeIds = function (treeNode, index) {\n if (index === void 0) { index = 0; }\n var id;\n if (!treeNode.parentNode) {\n id = "0";\n }\n else {\n id = treeNode.parentNode.id + "-" + index;\n }\n treeNode.id = id;\n for (var i = 0; i < treeNode.nodes.length; i++) {\n var n = treeNode.nodes[i];\n Utils.generateTreeNodeIds(n, i);\n }\n };\n Utils.normaliseType = function (type) {\n type = (type || "").toLowerCase();\n if (type.indexOf(":") !== -1) {\n var split = type.split(":");\n return split[1];\n }\n return type;\n };\n Utils.normaliseUrl = function (url) {\n url = url.substr(url.indexOf("://"));\n if (url.indexOf("#") !== -1) {\n url = url.split("#")[0];\n }\n return url;\n };\n Utils.normalisedUrlsMatch = function (url1, url2) {\n return Utils.normaliseUrl(url1) === Utils.normaliseUrl(url2);\n };\n Utils.isImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.isImageServiceType = function (type) {\n return ((type !== null &&\n type.toLowerCase() === dist_commonjs_1.ServiceType.IMAGE_SERVICE_2.toLowerCase()) ||\n type === dist_commonjs_1.ServiceType.IMAGE_SERVICE_3.toLowerCase());\n };\n Utils.isLevel0ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) {\n return true;\n }\n return false;\n };\n Utils.isLevel1ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) {\n return true;\n }\n return false;\n };\n Utils.isLevel2ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.parseManifest = function (manifest, options) {\n return internal_1.Deserialiser.parse(manifest, options);\n };\n Utils.checkStatus = function (response) {\n if (response.ok) {\n return response;\n }\n else {\n var error = new Error(response.statusText);\n error.response = response;\n return Promise.reject(error);\n }\n };\n Utils.loadManifest = function (url) {\n return new Promise(function (resolve, reject) {\n fetch(url)\n .then(Utils.checkStatus)\n .then(function (r) { return r.json(); })\n .then(function (data) {\n resolve(data);\n })\n .catch(function (err) {\n reject();\n });\n });\n };\n Utils.loadExternalResourcesAuth1 = function (resources, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth1(resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n Utils.loadExternalResourceAuth1 = function (resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var storedAccessToken;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, getStoredAccessToken(resource)];\n case 1:\n storedAccessToken = _a.sent();\n if (!storedAccessToken) return [3 /*break*/, 6];\n return [4 /*yield*/, resource.getData(storedAccessToken)];\n case 2:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.OK)) return [3 /*break*/, 3];\n return [2 /*return*/, resource];\n case 3: \n // the stored token is no good for this resource\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 4:\n // the stored token is no good for this resource\n _a.sent();\n _a.label = 5;\n case 5:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n case 6: return [4 /*yield*/, resource.getData()];\n case 7:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.MOVED_TEMPORARILY ||\n resource.status === dist_commonjs_2.UNAUTHORIZED)) return [3 /*break*/, 9];\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 8:\n _a.sent();\n _a.label = 9;\n case 9:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n }\n });\n });\n };\n Utils.doAuthChain = function (resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var externalService, kioskService, clickThroughService, loginService, serviceToTry, lastAttempted, kioskInteraction, contentProviderInteraction, contentProviderInteraction;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // This function enters the flowchart at the < External? > junction\n // http://iiif.io/api/auth/1.0/#workflow-from-the-browser-client-perspective\n if (!resource.isAccessControlled()) {\n return [2 /*return*/, resource]; // no services found\n }\n externalService = resource.externalService;\n if (externalService) {\n externalService.options = resource.options;\n }\n kioskService = resource.kioskService;\n if (kioskService) {\n kioskService.options = resource.options;\n }\n clickThroughService = resource.clickThroughService;\n if (clickThroughService) {\n clickThroughService.options = resource.options;\n }\n loginService = resource.loginService;\n if (loginService) {\n loginService.options = resource.options;\n }\n if (!(!resource.isResponseHandled && resource.status === dist_commonjs_2.MOVED_TEMPORARILY)) return [3 /*break*/, 2];\n return [4 /*yield*/, handleMovedTemporarily(resource)];\n case 1:\n _a.sent();\n return [2 /*return*/, resource];\n case 2:\n serviceToTry = null;\n lastAttempted = null;\n // repetition of logic is left in these steps for clarity:\n // Looking for external pattern\n serviceToTry = externalService;\n if (!serviceToTry) return [3 /*break*/, 4];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 3:\n _a.sent();\n return [2 /*return*/, resource];\n case 4:\n // Looking for kiosk pattern\n serviceToTry = kioskService;\n if (!serviceToTry) return [3 /*break*/, 7];\n lastAttempted = serviceToTry;\n kioskInteraction = openContentProviderInteraction(serviceToTry);\n if (!kioskInteraction) return [3 /*break*/, 7];\n return [4 /*yield*/, userInteractedWithContentProvider(kioskInteraction)];\n case 5:\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 6:\n _a.sent();\n return [2 /*return*/, resource];\n case 7:\n // The code for the next two patterns is identical (other than the profile name).\n // The difference is in the expected behaviour of\n //\n // await userInteractedWithContentProvider(contentProviderInteraction);\n //\n // For clickthrough the opened window should close immediately having established\n // a session, whereas for login the user might spend some time entering credentials etc.\n // Looking for clickthrough pattern\n serviceToTry = clickThroughService;\n if (!serviceToTry) return [3 /*break*/, 11];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 8:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 11];\n // should close immediately\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 9:\n // should close immediately\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 10:\n _a.sent();\n return [2 /*return*/, resource];\n case 11:\n // Looking for login pattern\n serviceToTry = loginService;\n if (!serviceToTry) return [3 /*break*/, 15];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 12:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 15];\n // we expect the user to spend some time interacting\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 13:\n // we expect the user to spend some time interacting\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 14:\n _a.sent();\n return [2 /*return*/, resource];\n case 15:\n // nothing worked! Use the most recently tried service as the source of\n // messages to show to the user.\n if (lastAttempted) {\n showOutOfOptionsMessages(resource, lastAttempted);\n }\n return [2 /*return*/];\n }\n });\n });\n };\n Utils.attemptResourceWithToken = function (resource, openTokenService, authService) {\n return __awaiter(this, void 0, void 0, function () {\n var tokenService, tokenMessage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n tokenService = authService.getService(dist_commonjs_1.ServiceProfile.AUTH_1_TOKEN);\n if (!tokenService) return [3 /*break*/, 3];\n return [4 /*yield*/, openTokenService(resource, tokenService)];\n case 1:\n tokenMessage = _a.sent();\n if (!(tokenMessage && tokenMessage.accessToken)) return [3 /*break*/, 3];\n return [4 /*yield*/, resource.getData(tokenMessage)];\n case 2:\n _a.sent();\n return [2 /*return*/, resource];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n Utils.loadExternalResourcesAuth09 = function (resources, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth09(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n // IIIF auth api pre v1.0\n // Keeping this around for now until the auth 1.0 implementation is stable\n Utils.loadExternalResourceAuth09 = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n if (options && options.pessimisticAccessControl) {\n // pessimistic: access control cookies may have been deleted.\n // always request the access token for every access controlled info.json request\n // returned access tokens are not stored, therefore the login window flashes for every request.\n resource\n .getData()\n .then(function () {\n if (resource.isAccessControlled()) {\n // if the resource has a click through service, use that.\n if (resource.clickThroughService) {\n resolve(clickThrough(resource));\n //} else if(resource.restrictedService) {\n resolve(restricted(resource));\n }\n else {\n login(resource)\n .then(function () {\n getAccessToken(resource, true)\n .then(function (token) {\n resource\n .getData(token)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n }\n else {\n // this info.json isn\'t access controlled, therefore no need to request an access token.\n resolve(resource);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // optimistic: access control cookies may not have been deleted.\n // store access tokens to avoid login window flashes.\n // if cookies are deleted a page refresh is required.\n // try loading the resource using an access token that matches the info.json domain.\n // if an access token is found, request the resource using it regardless of whether it is access controlled.\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n // if the info.json loaded using the stored access token\n if (resource.status === dist_commonjs_2.OK) {\n resolve(handleResourceResponse(resource));\n }\n else {\n // otherwise, load the resource data to determine the correct access control services.\n // if access controlled, do login.\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n // if (resource.restrictedService){\n // reject(Utils.createRestrictedError());\n // } else {\n reject(Utils.createAuthorizationFailedError());\n //}\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n else {\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n });\n };\n Utils.createError = function (name, message) {\n var error = new Error();\n error.message = message;\n error.name = String(name);\n return error;\n };\n Utils.createAuthorizationFailedError = function () {\n return Utils.createError(internal_1.StatusCode.AUTHORIZATION_FAILED, "Authorization failed");\n };\n Utils.createRestrictedError = function () {\n return Utils.createError(internal_1.StatusCode.RESTRICTED, "Restricted");\n };\n Utils.createInternalServerError = function (message) {\n return Utils.createError(internal_1.StatusCode.INTERNAL_SERVER_ERROR, message);\n };\n Utils.authorize = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) {\n return new Promise(function (resolve, reject) {\n resource.getData().then(function () {\n if (resource.isAccessControlled()) {\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource); // happy path ended\n }\n else {\n // the stored token is no good for this resource\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // There was no stored token, but the user might have a cookie that will grant a token\n getAccessToken(resource, false).then(function (accessToken) {\n if (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n // try using the fresh access token\n resource\n .getData(accessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource);\n }\n else {\n // User has a token, but it\'s not good enough\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n // not able to store access token\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // The user did not have a cookie that granted a token\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n });\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // this info.json isn\'t access controlled, therefore there\'s no need to request an access token\n resolve(resource);\n }\n });\n });\n };\n Utils.showAuthInteraction = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject) {\n if (resource.status === dist_commonjs_2.MOVED_TEMPORARILY && !resource.isResponseHandled) {\n // if the resource was redirected to a degraded version\n // and the response hasn\'t been handled yet.\n // if the client wishes to trigger a login, set resource.isResponseHandled to true\n // and call loadExternalResources() again passing the resource.\n resolve(resource);\n // } else if (resource.restrictedService) {\n // resolve(restricted(resource));\n // // TODO: move to next etc\n }\n else if (resource.clickThroughService && !resource.isResponseHandled) {\n // if the resource has a click through service, use that.\n clickThrough(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n else {\n // get an access token\n login(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n };\n Utils.getService = function (resource, profile) {\n var services = this.getServices(resource);\n for (var i = 0; i < services.length; i++) {\n var service = services[i];\n if (service.getProfile() === profile) {\n return service;\n }\n }\n return null;\n };\n Utils.getResourceById = function (parentResource, id) {\n return (Utils.traverseAndFind(parentResource.__jsonld, "@id", id));\n };\n /**\n * Does a depth first traversal of an Object, returning an Object that\n * matches provided k and v arguments\n * @example Utils.traverseAndFind({foo: \'bar\'}, \'foo\', \'bar\')\n */\n Utils.traverseAndFind = function (object, k, v) {\n if (object.hasOwnProperty(k) && object[k] === v) {\n return object;\n }\n for (var i = 0; i < Object.keys(object).length; i++) {\n if (typeof object[Object.keys(object)[i]] === "object") {\n var o = Utils.traverseAndFind(object[Object.keys(object)[i]], k, v);\n if (o != null) {\n return o;\n }\n }\n }\n return undefined;\n };\n Utils.getServices = function (resource, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.onlyService, onlyService = _c === void 0 ? false : _c, _d = _b.onlyServices, onlyServices = _d === void 0 ? false : _d, _e = _b.skipParentResources, skipParentResources = _e === void 0 ? false : _e;\n var services = [];\n // Resources can reference "services" on the manifest. This is a bit of a hack to just get the services from the manifest\n // too. What would be better is if this was used as a "Map" of full services.\n // So when you come across { id: \'...\' } without any data, you can "lookup" services from the manifest.\n // I would have implemented this if I was confident that it was reliable. Instead, I opted for the safest option that\n // should not break any existing services.\n if (!skipParentResources &&\n resource &&\n resource.options &&\n resource.options.resource &&\n resource.options.resource !== resource) {\n services.push.apply(services, Utils.getServices(resource.options.resource, { onlyServices: true }));\n }\n var service = !onlyServices\n ? (resource.__jsonld || resource).service || []\n : [];\n // coerce to array\n if (!Array.isArray(service)) {\n service = [service];\n }\n if (!onlyService) {\n // Some resources also have a `.services` property.\n // https://iiif.io/api/presentation/3.0/#services\n service.push.apply(service, ((resource.__jsonld || resource).services || []));\n }\n if (service.length === 0) {\n return services;\n }\n for (var i = 0; i < service.length; i++) {\n var s = service[i];\n if (typeof s === "string") {\n var r = this.getResourceById(resource.options.resource, s);\n if (r) {\n services.push(new internal_1.Service(r.__jsonld || r, resource.options));\n }\n }\n else {\n services.push(new internal_1.Service(s, resource.options));\n }\n }\n return services;\n };\n Utils.getTemporalComponent = function (target) {\n var temporal = /t=([^&]+)/g.exec(target);\n var t = null;\n if (temporal && temporal[1]) {\n t = temporal[1].split(",");\n }\n return t;\n };\n return Utils;\n}());\nexports.Utils = Utils;\n\n\n//# sourceURL=webpack://manifesto/./src/Utils.ts?')},"./src/index.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.parseManifest = exports.loadManifest = void 0;\n__exportStar(__webpack_require__(/*! ./internal */ "./src/internal.ts"), exports);\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/**\nInitiates downloading an IIIF manifest json file from URL. Returns a Promise\nto allow subsequent processing on a successful fetch.\n\n@param url string containing the URL to Fetch\n@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text.\n**/\nvar loadManifest = function (url) {\n return Utils_1.Utils.loadManifest(url);\n};\nexports.loadManifest = loadManifest;\n/**\nParses IIIF manifest file to return a manifesto Manifest instance\n\n@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file.\n@param options? TODO Not yet documented\n@returns instance of Manifest class.\n**/\nvar parseManifest = function (manifest, options) {\n return Utils_1.Utils.parseManifest(manifest, options);\n};\nexports.parseManifest = parseManifest;\n\n\n//# sourceURL=webpack://manifesto/./src/index.ts?')},"./src/internal.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./JSONLDResource */ "./src/JSONLDResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestResource */ "./src/ManifestResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Resource */ "./src/Resource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IIIFResource */ "./src/IIIFResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./SpecificResource */ "./src/SpecificResource.ts"), exports);\n//export * from "./SpecificResourceForTarget";\n//export * from "./SpecificResourceForBody";\n__exportStar(__webpack_require__(/*! ./AnnotationBody */ "./src/AnnotationBody.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Light */ "./src/Light.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Camera */ "./src/Camera.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationBodyParser */ "./src/AnnotationBodyParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Annotation */ "./src/Annotation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationList */ "./src/AnnotationList.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationPage */ "./src/AnnotationPage.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Canvas */ "./src/Canvas.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Collection */ "./src/Collection.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Duration */ "./src/Duration.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IAccessToken */ "./src/IAccessToken.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalImageResourceData */ "./src/IExternalImageResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResource */ "./src/IExternalResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceData */ "./src/IExternalResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceOptions */ "./src/IExternalResourceOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IManifestoOptions */ "./src/IManifestoOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LabelValuePair */ "./src/LabelValuePair.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Language */ "./src/Language.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LanguageMap */ "./src/LanguageMap.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PropertyValue */ "./src/PropertyValue.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Manifest */ "./src/Manifest.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestType */ "./src/ManifestType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PointSelector */ "./src/PointSelector.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Range */ "./src/Range.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Rendering */ "./src/Rendering.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Scene */ "./src/Scene.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Sequence */ "./src/Sequence.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Serialisation */ "./src/Serialisation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Service */ "./src/Service.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Size */ "./src/Size.ts"), exports);\n__exportStar(__webpack_require__(/*! ./StatusCode */ "./src/StatusCode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumb */ "./src/Thumb.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumbnail */ "./src/Thumbnail.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TransformParser */ "./src/TransformParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNode */ "./src/TreeNode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNodeType */ "./src/TreeNodeType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Utils */ "./src/Utils.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./RotateTransform */ "./src/RotateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ScaleTransform */ "./src/ScaleTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Color */ "./src/Color.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Geometry3d */ "./src/Geometry3d.ts"), exports);\n\n\n//# sourceURL=webpack://manifesto/./src/internal.ts?')},"./node_modules/unfetch/dist/unfetch.module.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},s.onerror=r,s.withCredentials="include"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})}\n//# sourceMappingURL=unfetch.module.js.map\n\n\n//# sourceURL=webpack://manifesto/./node_modules/unfetch/dist/unfetch.module.js?')},"node-fetch":t=>{"use strict";t.exports=__WEBPACK_EXTERNAL_MODULE_node_fetch__},"./node_modules/threejs-math/build/threejs-math.cjs":(__unused_webpack_module,exports)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nconst REVISION = '144dev';\nconst MOUSE = {\n\tLEFT: 0,\n\tMIDDLE: 1,\n\tRIGHT: 2,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2\n};\nconst TOUCH = {\n\tROTATE: 0,\n\tPAN: 1,\n\tDOLLY_PAN: 2,\n\tDOLLY_ROTATE: 3\n};\nconst CullFaceNone = 0;\nconst CullFaceBack = 1;\nconst CullFaceFront = 2;\nconst CullFaceFrontBack = 3;\nconst BasicShadowMap = 0;\nconst PCFShadowMap = 1;\nconst PCFSoftShadowMap = 2;\nconst VSMShadowMap = 3;\nconst FrontSide = 0;\nconst BackSide = 1;\nconst DoubleSide = 2;\nconst NoBlending = 0;\nconst NormalBlending = 1;\nconst AdditiveBlending = 2;\nconst SubtractiveBlending = 3;\nconst MultiplyBlending = 4;\nconst CustomBlending = 5;\nconst AddEquation = 100;\nconst SubtractEquation = 101;\nconst ReverseSubtractEquation = 102;\nconst MinEquation = 103;\nconst MaxEquation = 104;\nconst ZeroFactor = 200;\nconst OneFactor = 201;\nconst SrcColorFactor = 202;\nconst OneMinusSrcColorFactor = 203;\nconst SrcAlphaFactor = 204;\nconst OneMinusSrcAlphaFactor = 205;\nconst DstAlphaFactor = 206;\nconst OneMinusDstAlphaFactor = 207;\nconst DstColorFactor = 208;\nconst OneMinusDstColorFactor = 209;\nconst SrcAlphaSaturateFactor = 210;\nconst NeverDepth = 0;\nconst AlwaysDepth = 1;\nconst LessDepth = 2;\nconst LessEqualDepth = 3;\nconst EqualDepth = 4;\nconst GreaterEqualDepth = 5;\nconst GreaterDepth = 6;\nconst NotEqualDepth = 7;\nconst MultiplyOperation = 0;\nconst MixOperation = 1;\nconst AddOperation = 2;\nconst NoToneMapping = 0;\nconst LinearToneMapping = 1;\nconst ReinhardToneMapping = 2;\nconst CineonToneMapping = 3;\nconst ACESFilmicToneMapping = 4;\nconst CustomToneMapping = 5;\nconst UVMapping = 300;\nconst CubeReflectionMapping = 301;\nconst CubeRefractionMapping = 302;\nconst EquirectangularReflectionMapping = 303;\nconst EquirectangularRefractionMapping = 304;\nconst CubeUVReflectionMapping = 306;\nconst RepeatWrapping = 1000;\nconst ClampToEdgeWrapping = 1001;\nconst MirroredRepeatWrapping = 1002;\nconst NearestFilter = 1003;\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004;\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005;\nconst LinearFilter = 1006;\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007;\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008;\nconst UnsignedByteType = 1009;\nconst ByteType = 1010;\nconst ShortType = 1011;\nconst UnsignedShortType = 1012;\nconst IntType = 1013;\nconst UnsignedIntType = 1014;\nconst FloatType = 1015;\nconst HalfFloatType = 1016;\nconst UnsignedShort4444Type = 1017;\nconst UnsignedShort5551Type = 1018;\nconst UnsignedInt248Type = 1020;\nconst AlphaFormat = 1021;\nconst RGBFormat = 1022; // @deprecated since r137\n\nconst RGBAFormat = 1023;\nconst LuminanceFormat = 1024;\nconst LuminanceAlphaFormat = 1025;\nconst DepthFormat = 1026;\nconst DepthStencilFormat = 1027;\nconst RedFormat = 1028;\nconst RedIntegerFormat = 1029;\nconst RGFormat = 1030;\nconst RGIntegerFormat = 1031;\nconst RGBAIntegerFormat = 1033;\nconst RGB_S3TC_DXT1_Format = 33776;\nconst RGBA_S3TC_DXT1_Format = 33777;\nconst RGBA_S3TC_DXT3_Format = 33778;\nconst RGBA_S3TC_DXT5_Format = 33779;\nconst RGB_PVRTC_4BPPV1_Format = 35840;\nconst RGB_PVRTC_2BPPV1_Format = 35841;\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\nconst RGB_ETC1_Format = 36196;\nconst RGB_ETC2_Format = 37492;\nconst RGBA_ETC2_EAC_Format = 37496;\nconst RGBA_ASTC_4x4_Format = 37808;\nconst RGBA_ASTC_5x4_Format = 37809;\nconst RGBA_ASTC_5x5_Format = 37810;\nconst RGBA_ASTC_6x5_Format = 37811;\nconst RGBA_ASTC_6x6_Format = 37812;\nconst RGBA_ASTC_8x5_Format = 37813;\nconst RGBA_ASTC_8x6_Format = 37814;\nconst RGBA_ASTC_8x8_Format = 37815;\nconst RGBA_ASTC_10x5_Format = 37816;\nconst RGBA_ASTC_10x6_Format = 37817;\nconst RGBA_ASTC_10x8_Format = 37818;\nconst RGBA_ASTC_10x10_Format = 37819;\nconst RGBA_ASTC_12x10_Format = 37820;\nconst RGBA_ASTC_12x12_Format = 37821;\nconst RGBA_BPTC_Format = 36492;\nconst LoopOnce = 2200;\nconst LoopRepeat = 2201;\nconst LoopPingPong = 2202;\nconst InterpolateDiscrete = 2300;\nconst InterpolateLinear = 2301;\nconst InterpolateSmooth = 2302;\nconst ZeroCurvatureEnding = 2400;\nconst ZeroSlopeEnding = 2401;\nconst WrapAroundEnding = 2402;\nconst NormalAnimationBlendMode = 2500;\nconst AdditiveAnimationBlendMode = 2501;\nconst TrianglesDrawMode = 0;\nconst TriangleStripDrawMode = 1;\nconst TriangleFanDrawMode = 2;\nconst LinearEncoding = 3000;\nconst sRGBEncoding = 3001;\nconst BasicDepthPacking = 3200;\nconst RGBADepthPacking = 3201;\nconst TangentSpaceNormalMap = 0;\nconst ObjectSpaceNormalMap = 1; // Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\n\nconst NoColorSpace = '';\nconst SRGBColorSpace = 'srgb';\nconst LinearSRGBColorSpace = 'srgb-linear';\nconst ZeroStencilOp = 0;\nconst KeepStencilOp = 7680;\nconst ReplaceStencilOp = 7681;\nconst IncrementStencilOp = 7682;\nconst DecrementStencilOp = 7683;\nconst IncrementWrapStencilOp = 34055;\nconst DecrementWrapStencilOp = 34056;\nconst InvertStencilOp = 5386;\nconst NeverStencilFunc = 512;\nconst LessStencilFunc = 513;\nconst EqualStencilFunc = 514;\nconst LessEqualStencilFunc = 515;\nconst GreaterStencilFunc = 516;\nconst NotEqualStencilFunc = 517;\nconst GreaterEqualStencilFunc = 518;\nconst AlwaysStencilFunc = 519;\nconst StaticDrawUsage = 35044;\nconst DynamicDrawUsage = 35048;\nconst StreamDrawUsage = 35040;\nconst StaticReadUsage = 35045;\nconst DynamicReadUsage = 35049;\nconst StreamReadUsage = 35041;\nconst StaticCopyUsage = 35046;\nconst DynamicCopyUsage = 35050;\nconst StreamCopyUsage = 35042;\nconst GLSL1 = '100';\nconst GLSL3 = '300 es';\nconst _SRGBAFormat = 1035; // fallback for WebGL 1\n\nclass Vector2 {\n\tconstructor(x = 0, y = 0) {\n\t\tVector2.prototype.isVector2 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tget width() {\n\t\treturn this.x;\n\t}\n\n\tset width(value) {\n\t\tthis.x = value;\n\t}\n\n\tget height() {\n\t\treturn this.y;\n\t}\n\n\tset height(value) {\n\t\tthis.y = value;\n\t}\n\n\tset(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\treturn this;\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6];\n\t\tthis.y = e[1] * x + e[4] * y + e[7];\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y;\n\t}\n\n\tcross(v) {\n\t\treturn this.x * v.y - this.y * v.x;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tangle() {\n\t\t// computes the angle in radians with respect to the positive x-axis\n\t\tconst angle = Math.atan2(-this.y, -this.x) + Math.PI;\n\t\treturn angle;\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \treturn this;\n\t// }\n\n\n\trotateAround(center, angle) {\n\t\tconst c = Math.cos(angle),\n\t\t\t\t\ts = Math.sin(angle);\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\t\treturn this;\n\t}\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t}\n\n}\n\nconst _lut = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff'];\nlet _seed = 1234567;\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI; // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\nfunction generateUUID() {\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[d0 & 0xff] + _lut[d0 >> 8 & 0xff] + _lut[d0 >> 16 & 0xff] + _lut[d0 >> 24 & 0xff] + '-' + _lut[d1 & 0xff] + _lut[d1 >> 8 & 0xff] + '-' + _lut[d1 >> 16 & 0x0f | 0x40] + _lut[d1 >> 24 & 0xff] + '-' + _lut[d2 & 0x3f | 0x80] + _lut[d2 >> 8 & 0xff] + '-' + _lut[d2 >> 16 & 0xff] + _lut[d2 >> 24 & 0xff] + _lut[d3 & 0xff] + _lut[d3 >> 8 & 0xff] + _lut[d3 >> 16 & 0xff] + _lut[d3 >> 24 & 0xff]; // .toLowerCase() here flattens concatenated strings to save heap memory space.\n\n\treturn uuid.toLowerCase();\n}\n\nfunction clamp(value, min, max) {\n\treturn Math.max(min, Math.min(max, value));\n} // compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\n\n\nfunction euclideanModulo(n, m) {\n\treturn (n % m + m) % m;\n} // Linear mapping from range to range \n\n\nfunction mapLinear(x, a1, a2, b1, b2) {\n\treturn b1 + (x - a1) * (b2 - b1) / (a2 - a1);\n} // https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\nfunction inverseLerp(x, y, value) {\n\tif (x !== y) {\n\t\treturn (value - x) / (y - x);\n\t} else {\n\t\treturn 0;\n\t}\n} // https://en.wikipedia.org/wiki/Linear_interpolation\n\n\nfunction lerp(x, y, t) {\n\treturn (1 - t) * x + t * y;\n} // http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\n\n\nfunction damp(x, y, lambda, dt) {\n\treturn lerp(x, y, 1 - Math.exp(-lambda * dt));\n} // https://www.desmos.com/calculator/vcsjnyz7x4\n\n\nfunction pingpong(x, length = 1) {\n\treturn length - Math.abs(euclideanModulo(x, length * 2) - length);\n} // http://en.wikipedia.org/wiki/Smoothstep\n\n\nfunction smoothstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * (3 - 2 * x);\n}\n\nfunction smootherstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * x * (x * (x * 6 - 15) + 10);\n} // Random integer from interval\n\n\nfunction randInt(low, high) {\n\treturn low + Math.floor(Math.random() * (high - low + 1));\n} // Random float from interval\n\n\nfunction randFloat(low, high) {\n\treturn low + Math.random() * (high - low);\n} // Random float from <-range/2, range/2> interval\n\n\nfunction randFloatSpread(range) {\n\treturn range * (0.5 - Math.random());\n} // Deterministic pseudo-random float in the interval [ 0, 1 ]\n\n\nfunction seededRandom(s) {\n\tif (s !== undefined) _seed = s; // Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\tt = Math.imul(t ^ t >>> 15, t | 1);\n\tt ^= t + Math.imul(t ^ t >>> 7, t | 61);\n\treturn ((t ^ t >>> 14) >>> 0) / 4294967296;\n}\n\nfunction degToRad(degrees) {\n\treturn degrees * DEG2RAD;\n}\n\nfunction radToDeg(radians) {\n\treturn radians * RAD2DEG;\n}\n\nfunction isPowerOfTwo(value) {\n\treturn (value & value - 1) === 0 && value !== 0;\n}\n\nfunction ceilPowerOfTwo(value) {\n\treturn Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n}\n\nfunction floorPowerOfTwo(value) {\n\treturn Math.pow(2, Math.floor(Math.log(value) / Math.LN2));\n}\n\nfunction setQuaternionFromProperEuler(q, a, b, c, order) {\n\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\t// rotations are applied to the axes in the order specified by 'order'\n\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t// angles are in radians\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\tconst c2 = cos(b / 2);\n\tconst s2 = sin(b / 2);\n\tconst c13 = cos((a + c) / 2);\n\tconst s13 = sin((a + c) / 2);\n\tconst c1_3 = cos((a - c) / 2);\n\tconst s1_3 = sin((a - c) / 2);\n\tconst c3_1 = cos((c - a) / 2);\n\tconst s3_1 = sin((c - a) / 2);\n\n\tswitch (order) {\n\t\tcase 'XYX':\n\t\t\tq.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order);\n\t}\n}\n\nfunction denormalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\t\t\treturn value / 255.0;\n\n\t\tcase Int16Array:\n\t\t\treturn Math.max(value / 32767.0, -1.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.max(value / 127.0, -1.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nfunction normalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn Math.round(value * 65535.0);\n\n\t\tcase Uint8Array:\n\t\t\treturn Math.round(value * 255.0);\n\n\t\tcase Int16Array:\n\t\t\treturn Math.round(value * 32767.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.round(value * 127.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nvar MathUtils = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\tgenerateUUID: generateUUID,\n\tclamp: clamp,\n\teuclideanModulo: euclideanModulo,\n\tmapLinear: mapLinear,\n\tinverseLerp: inverseLerp,\n\tlerp: lerp,\n\tdamp: damp,\n\tpingpong: pingpong,\n\tsmoothstep: smoothstep,\n\tsmootherstep: smootherstep,\n\trandInt: randInt,\n\trandFloat: randFloat,\n\trandFloatSpread: randFloatSpread,\n\tseededRandom: seededRandom,\n\tdegToRad: degToRad,\n\tradToDeg: radToDeg,\n\tisPowerOfTwo: isPowerOfTwo,\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\tnormalize: normalize,\n\tdenormalize: denormalize\n});\n\nclass Quaternion {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tthis.isQuaternion = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\t}\n\n\tstatic slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) {\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\t\tlet x0 = src0[srcOffset0 + 0],\n\t\t\t\ty0 = src0[srcOffset0 + 1],\n\t\t\t\tz0 = src0[srcOffset0 + 2],\n\t\t\t\tw0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1 + 0],\n\t\t\t\t\ty1 = src1[srcOffset1 + 1],\n\t\t\t\t\tz1 = src1[srcOffset1 + 2],\n\t\t\t\t\tw1 = src1[srcOffset1 + 3];\n\n\t\tif (t === 0) {\n\t\t\tdst[dstOffset + 0] = x0;\n\t\t\tdst[dstOffset + 1] = y0;\n\t\t\tdst[dstOffset + 2] = z0;\n\t\t\tdst[dstOffset + 3] = w0;\n\t\t\treturn;\n\t\t}\n\n\t\tif (t === 1) {\n\t\t\tdst[dstOffset + 0] = x1;\n\t\t\tdst[dstOffset + 1] = y1;\n\t\t\tdst[dstOffset + 2] = z1;\n\t\t\tdst[dstOffset + 3] = w1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\t\t\tdir = cos >= 0 ? 1 : -1,\n\t\t\t\t\t\tsqrSin = 1 - cos * cos; // Skip the Slerp for tiny steps to avoid numeric problems:\n\n\t\t\tif (sqrSin > Number.EPSILON) {\n\t\t\t\tconst sin = Math.sqrt(sqrSin),\n\t\t\t\t\t\t\tlen = Math.atan2(sin, cos * dir);\n\t\t\t\ts = Math.sin(s * len) / sin;\n\t\t\t\tt = Math.sin(t * len) / sin;\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir; // Normalize in case we just did a lerp:\n\n\t\t\tif (s === 1 - t) {\n\t\t\t\tconst f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\t\t\t}\n\t\t}\n\n\t\tdst[dstOffset] = x0;\n\t\tdst[dstOffset + 1] = y0;\n\t\tdst[dstOffset + 2] = z0;\n\t\tdst[dstOffset + 3] = w0;\n\t}\n\n\tstatic multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {\n\t\tconst x0 = src0[srcOffset0];\n\t\tconst y0 = src0[srcOffset0 + 1];\n\t\tconst z0 = src0[srcOffset0 + 2];\n\t\tconst w0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1];\n\t\tconst y1 = src1[srcOffset1 + 1];\n\t\tconst z1 = src1[srcOffset1 + 2];\n\t\tconst w1 = src1[srcOffset1 + 3];\n\t\tdst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\t\treturn dst;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget w() {\n\t\treturn this._w;\n\t}\n\n\tset w(value) {\n\t\tthis._w = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._w);\n\t}\n\n\tcopy(quaternion) {\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromEuler(euler, update) {\n\t\tconst x = euler._x,\n\t\t\t\t\ty = euler._y,\n\t\t\t\t\tz = euler._z,\n\t\t\t\t\torder = euler._order; // http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\t\tconst c1 = cos(x / 2);\n\t\tconst c2 = cos(y / 2);\n\t\tconst c3 = cos(z / 2);\n\t\tconst s1 = sin(x / 2);\n\t\tconst s2 = sin(y / 2);\n\t\tconst s3 = sin(z / 2);\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tif (update !== false) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromAxisAngle(axis, angle) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\t\t// assumes axis is normalized\n\t\tconst halfAngle = angle / 2,\n\t\t\t\t\ts = Math.sin(halfAngle);\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos(halfAngle);\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10],\n\t\t\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif (trace > 0) {\n\t\t\tconst s = 0.5 / Math.sqrt(trace + 1.0);\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = (m32 - m23) * s;\n\t\t\tthis._y = (m13 - m31) * s;\n\t\t\tthis._z = (m21 - m12) * s;\n\t\t} else if (m11 > m22 && m11 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\t\t\tthis._w = (m32 - m23) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = (m12 + m21) / s;\n\t\t\tthis._z = (m13 + m31) / s;\n\t\t} else if (m22 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\t\t\tthis._w = (m13 - m31) / s;\n\t\t\tthis._x = (m12 + m21) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = (m23 + m32) / s;\n\t\t} else {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\t\t\tthis._w = (m21 - m12) / s;\n\t\t\tthis._x = (m13 + m31) / s;\n\t\t\tthis._y = (m23 + m32) / s;\n\t\t\tthis._z = 0.25 * s;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromUnitVectors(vFrom, vTo) {\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\t\tlet r = vFrom.dot(vTo) + 1;\n\n\t\tif (r < Number.EPSILON) {\n\t\t\t// vFrom and vTo point in opposite directions\n\t\t\tr = 0;\n\n\t\t\tif (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n\t\t\t\tthis._x = -vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\t\t\t} else {\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = -vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\t\t\t}\n\t\t} else {\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\t\t}\n\n\t\treturn this.normalize();\n\t}\n\n\tangleTo(q) {\n\t\treturn 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));\n\t}\n\n\trotateTowards(q, step) {\n\t\tconst angle = this.angleTo(q);\n\t\tif (angle === 0) return this;\n\t\tconst t = Math.min(1, step / angle);\n\t\tthis.slerp(q, t);\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\treturn this.set(0, 0, 0, 1);\n\t}\n\n\tinvert() {\n\t\t// quaternion is assumed to have unit length\n\t\treturn this.conjugate();\n\t}\n\n\tconjugate() {\n\t\tthis._x *= -1;\n\t\tthis._y *= -1;\n\t\tthis._z *= -1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\t}\n\n\tlengthSq() {\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n\t}\n\n\tnormalize() {\n\t\tlet l = this.length();\n\n\t\tif (l === 0) {\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\t\t} else {\n\t\t\tl = 1 / l;\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tmultiply(q) {\n\t\treturn this.multiplyQuaternions(this, q);\n\t}\n\n\tpremultiply(q) {\n\t\treturn this.multiplyQuaternions(q, this);\n\t}\n\n\tmultiplyQuaternions(a, b) {\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\t\tconst qax = a._x,\n\t\t\t\t\tqay = a._y,\n\t\t\t\t\tqaz = a._z,\n\t\t\t\t\tqaw = a._w;\n\t\tconst qbx = b._x,\n\t\t\t\t\tqby = b._y,\n\t\t\t\t\tqbz = b._z,\n\t\t\t\t\tqbw = b._w;\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerp(qb, t) {\n\t\tif (t === 0) return this;\n\t\tif (t === 1) return this.copy(qb);\n\t\tconst x = this._x,\n\t\t\t\t\ty = this._y,\n\t\t\t\t\tz = this._z,\n\t\t\t\t\tw = this._w; // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif (cosHalfTheta < 0) {\n\t\t\tthis._w = -qb._w;\n\t\t\tthis._x = -qb._x;\n\t\t\tthis._y = -qb._y;\n\t\t\tthis._z = -qb._z;\n\t\t\tcosHalfTheta = -cosHalfTheta;\n\t\t} else {\n\t\t\tthis.copy(qb);\n\t\t}\n\n\t\tif (cosHalfTheta >= 1.0) {\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif (sqrSinHalfTheta <= Number.EPSILON) {\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\t\t\tthis.normalize();\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt(sqrSinHalfTheta);\n\t\tconst halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);\n\t\tconst ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n\t\t\t\t\tratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n\t\tthis._w = w * ratioA + this._w * ratioB;\n\t\tthis._x = x * ratioA + this._x * ratioB;\n\t\tthis._y = y * ratioA + this._y * ratioB;\n\t\tthis._z = z * ratioA + this._z * ratioB;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerpQuaternions(qa, qb, t) {\n\t\treturn this.copy(qa).slerp(qb, t);\n\t}\n\n\trandom() {\n\t\t// Derived from http://planning.cs.uiuc.edu/node198.html\n\t\t// Note, this source uses w, x, y, z ordering,\n\t\t// so we swap the order below.\n\t\tconst u1 = Math.random();\n\t\tconst sqrt1u1 = Math.sqrt(1 - u1);\n\t\tconst sqrtu1 = Math.sqrt(u1);\n\t\tconst u2 = 2 * Math.PI * Math.random();\n\t\tconst u3 = 2 * Math.PI * Math.random();\n\t\treturn this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2));\n\t}\n\n\tequals(quaternion) {\n\t\treturn quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis._x = array[offset];\n\t\tthis._y = array[offset + 1];\n\t\tthis._z = array[offset + 2];\n\t\tthis._w = array[offset + 3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis._x = attribute.getX( index );\n\t// \tthis._y = attribute.getY( index );\n\t// \tthis._z = attribute.getZ( index );\n\t// \tthis._w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\t}\n\n}\n\nclass Vector3 {\n\tconstructor(x = 0, y = 0, z = 0) {\n\t\tVector3.prototype.isVector3 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}\n\n\tset(x, y, z) {\n\t\tif (z === undefined) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\treturn this;\n\t}\n\n\tmultiplyVectors(a, b) {\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\t\treturn this;\n\t}\n\n\tapplyEuler(euler) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromEuler(euler));\n\t}\n\n\tapplyAxisAngle(axis, angle) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromAxisAngle(axis, angle));\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6] * z;\n\t\tthis.y = e[1] * x + e[4] * y + e[7] * z;\n\t\tthis.z = e[2] * x + e[5] * y + e[8] * z;\n\t\treturn this;\n\t}\n\n\tapplyNormalMatrix(m) {\n\t\treturn this.applyMatrix3(m).normalize();\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\tthis.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w;\n\t\tthis.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w;\n\t\tthis.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w;\n\t\treturn this;\n\t}\n\n\tapplyQuaternion(q) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst qx = q.x,\n\t\t\t\t\tqy = q.y,\n\t\t\t\t\tqz = q.z,\n\t\t\t\t\tqw = q.w; // calculate quat * vector\n\n\t\tconst ix = qw * x + qy * z - qz * y;\n\t\tconst iy = qw * y + qz * x - qx * z;\n\t\tconst iz = qw * z + qx * y - qy * x;\n\t\tconst iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n\t\tthis.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t\tthis.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t\tthis.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t\treturn this;\n\t} // project( camera ) {\n\t// \treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\t// }\n\t// unproject( camera ) {\n\t// \treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\t// }\n\n\n\ttransformDirection(m) {\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z;\n\t\treturn this.normalize();\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t} // TODO lengthSquared?\n\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\treturn this;\n\t}\n\n\tcross(v) {\n\t\treturn this.crossVectors(this, v);\n\t}\n\n\tcrossVectors(a, b) {\n\t\tconst ax = a.x,\n\t\t\t\t\tay = a.y,\n\t\t\t\t\taz = a.z;\n\t\tconst bx = b.x,\n\t\t\t\t\tby = b.y,\n\t\t\t\t\tbz = b.z;\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\t\treturn this;\n\t}\n\n\tprojectOnVector(v) {\n\t\tconst denominator = v.lengthSq();\n\t\tif (denominator === 0) return this.set(0, 0, 0);\n\t\tconst scalar = v.dot(this) / denominator;\n\t\treturn this.copy(v).multiplyScalar(scalar);\n\t}\n\n\tprojectOnPlane(planeNormal) {\n\t\t_vector$3.copy(this).projectOnVector(planeNormal);\n\n\t\treturn this.sub(_vector$3);\n\t}\n\n\treflect(normal) {\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\t\treturn this.sub(_vector$3.copy(normal).multiplyScalar(2 * this.dot(normal)));\n\t}\n\n\tangleTo(v) {\n\t\tconst denominator = Math.sqrt(this.lengthSq() * v.lengthSq());\n\t\tif (denominator === 0) return Math.PI / 2;\n\t\tconst theta = this.dot(v) / denominator; // clamp, to handle numerical problems\n\n\t\treturn Math.acos(clamp(theta, -1, 1));\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y,\n\t\t\t\t\tdz = this.z - v.z;\n\t\treturn dx * dx + dy * dy + dz * dz;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);\n\t}\n\n\tsetFromSpherical(s) {\n\t\treturn this.setFromSphericalCoords(s.radius, s.phi, s.theta);\n\t}\n\n\tsetFromSphericalCoords(radius, phi, theta) {\n\t\tconst sinPhiRadius = Math.sin(phi) * radius;\n\t\tthis.x = sinPhiRadius * Math.sin(theta);\n\t\tthis.y = Math.cos(phi) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromCylindrical(c) {\n\t\treturn this.setFromCylindricalCoords(c.radius, c.theta, c.y);\n\t}\n\n\tsetFromCylindricalCoords(radius, theta, y) {\n\t\tthis.x = radius * Math.sin(theta);\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromMatrixPosition(m) {\n\t\tconst e = m.elements;\n\t\tthis.x = e[12];\n\t\tthis.y = e[13];\n\t\tthis.z = e[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrixScale(m) {\n\t\tconst sx = this.setFromMatrixColumn(m, 0).length();\n\t\tconst sy = this.setFromMatrixColumn(m, 1).length();\n\t\tconst sz = this.setFromMatrixColumn(m, 2).length();\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\t\treturn this;\n\t}\n\n\tsetFromMatrixColumn(m, index) {\n\t\treturn this.fromArray(m.elements, index * 4);\n\t}\n\n\tsetFromMatrix3Column(m, index) {\n\t\treturn this.fromArray(m.elements, index * 3);\n\t}\n\n\tsetFromEuler(e) {\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\treturn this;\n\t}\n\n\trandomDirection() {\n\t\t// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\n\t\tconst u = (Math.random() - 0.5) * 2;\n\t\tconst t = Math.random() * Math.PI * 2;\n\t\tconst f = Math.sqrt(1 - u ** 2);\n\t\tthis.x = f * Math.cos(t);\n\t\tthis.y = f * Math.sin(t);\n\t\tthis.z = u;\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/new Vector3();\n\nconst _quaternion$1 = /*@__PURE__*/new Quaternion();\n\nconst _vector$2 = /*@__PURE__*/new Vector2();\n\nclass Box2 {\n\tconstructor(min = new Vector2(+Infinity, +Infinity), max = new Vector2(-Infinity, -Infinity)) {\n\t\tthis.isBox2 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$2.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = +Infinity;\n\t\tthis.max.x = this.max.y = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y;\n\t}\n\n\tgetCenter(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 4 splitting planes to rule out intersections\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$2.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max);\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nclass Box3 {\n\tconstructor(min = new Vector3(+Infinity, +Infinity, +Infinity), max = new Vector3(-Infinity, -Infinity, -Infinity)) {\n\t\tthis.isBox3 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromArray(array) {\n\t\tlet minX = +Infinity;\n\t\tlet minY = +Infinity;\n\t\tlet minZ = +Infinity;\n\t\tlet maxX = -Infinity;\n\t\tlet maxY = -Infinity;\n\t\tlet maxZ = -Infinity;\n\n\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\tconst x = array[i];\n\t\t\tconst y = array[i + 1];\n\t\t\tconst z = array[i + 2];\n\t\t\tif (x < minX) minX = x;\n\t\t\tif (y < minY) minY = y;\n\t\t\tif (z < minZ) minZ = z;\n\t\t\tif (x > maxX) maxX = x;\n\t\t\tif (y > maxY) maxY = y;\n\t\t\tif (z > maxZ) maxZ = z;\n\t\t}\n\n\t\tthis.min.set(minX, minY, minZ);\n\t\tthis.max.set(maxX, maxY, maxZ);\n\t\treturn this;\n\t} // setFromBufferAttribute( attribute ) {\n\t// \tlet minX = + Infinity;\n\t// \tlet minY = + Infinity;\n\t// \tlet minZ = + Infinity;\n\t// \tlet maxX = - Infinity;\n\t// \tlet maxY = - Infinity;\n\t// \tlet maxZ = - Infinity;\n\t// \tfor ( let i = 0, l = attribute.count; i < l; i ++ ) {\n\t// \t\tconst x = attribute.getX( i );\n\t// \t\tconst y = attribute.getY( i );\n\t// \t\tconst z = attribute.getZ( i );\n\t// \t\tif ( x < minX ) minX = x;\n\t// \t\tif ( y < minY ) minY = y;\n\t// \t\tif ( z < minZ ) minZ = z;\n\t// \t\tif ( x > maxX ) maxX = x;\n\t// \t\tif ( y > maxY ) maxY = y;\n\t// \t\tif ( z > maxZ ) maxZ = z;\n\t// \t}\n\t// \tthis.min.set( minX, minY, minZ );\n\t// \tthis.max.set( maxX, maxY, maxZ );\n\t// \treturn this;\n\t// }\n\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$1.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tsetFromObject(object, precise = false) {\n\t\tthis.makeEmpty();\n\t\treturn this.expandByObject(object, precise);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = this.min.z = +Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n\t}\n\n\tgetCenter(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t} // expandByObject( object, precise = false ) {\n\t// \t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t// \t// accounting for both the object's, and children's, world transforms\n\t// \tobject.updateWorldMatrix( false, false );\n\t// \tconst geometry = object.geometry;\n\t// \tif ( geometry !== undefined ) {\n\t// \t\tif ( precise && geometry.attributes != undefined && geometry.attributes.position !== undefined ) {\n\t// \t\t\tconst position = geometry.attributes.position;\n\t// \t\t\tfor ( let i = 0, l = position.count; i < l; i ++ ) {\n\t// \t\t\t\t_vector.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );\n\t// \t\t\t\tthis.expandByPoint( _vector );\n\t// \t\t\t}\n\t// \t\t} else {\n\t// \t\t\tif ( geometry.boundingBox === null ) {\n\t// \t\t\t\tgeometry.computeBoundingBox();\n\t// \t\t\t}\n\t// \t\t\t_box.copy( geometry.boundingBox );\n\t// \t\t\t_box.applyMatrix4( object.matrixWorld );\n\t// \t\t\tthis.union( _box );\n\t// \t\t}\n\t// \t}\n\t// \tconst children = object.children;\n\t// \tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\t// \t\tthis.expandByObject( children[ i ], precise );\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint(sphere.center, _vector$1); // If that point is inside the sphere, the AABB and sphere intersect.\n\n\t\treturn _vector$1.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\t\tlet min, max;\n\n\t\tif (plane.normal.x > 0) {\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\t\t} else {\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\t\t}\n\n\t\tif (plane.normal.y > 0) {\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\t\t} else {\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\t\t}\n\n\t\tif (plane.normal.z > 0) {\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\t\t} else {\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\t\t}\n\n\t\treturn min <= -plane.constant && max >= -plane.constant;\n\t}\n\n\tintersectsTriangle(triangle) {\n\t\tif (this.isEmpty()) {\n\t\t\treturn false;\n\t\t} // compute box center and extents\n\n\n\t\tthis.getCenter(_center);\n\n\t\t_extents.subVectors(this.max, _center); // translate triangle to aabb origin\n\n\n\t\t_v0$1.subVectors(triangle.a, _center);\n\n\t\t_v1$3.subVectors(triangle.b, _center);\n\n\t\t_v2$1.subVectors(triangle.c, _center); // compute edge vectors for triangle\n\n\n\t\t_f0.subVectors(_v1$3, _v0$1);\n\n\t\t_f1.subVectors(_v2$1, _v1$3);\n\n\t\t_f2.subVectors(_v0$1, _v2$1); // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\n\n\t\tlet axes = [0, -_f0.z, _f0.y, 0, -_f1.z, _f1.y, 0, -_f2.z, _f2.y, _f0.z, 0, -_f0.x, _f1.z, 0, -_f1.x, _f2.z, 0, -_f2.x, -_f0.y, _f0.x, 0, -_f1.y, _f1.x, 0, -_f2.y, _f2.x, 0];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // test 3 face normals from the aabb\n\n\n\t\taxes = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\n\n\t\t_triangleNormal.crossVectors(_f0, _f1);\n\n\t\taxes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];\n\t\treturn satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents);\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$1.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tgetBoundingSphere(target) {\n\t\tthis.getCenter(target.center);\n\t\ttarget.radius = this.getSize(_vector$1).length() * 0.5;\n\t\treturn target;\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max); // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\n\t\tif (this.isEmpty()) this.makeEmpty();\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\t// transform of empty box is an empty box.\n\t\tif (this.isEmpty()) return this; // NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\n\t\t_points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); // 000\n\n\n\t\t_points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); // 001\n\n\n\t\t_points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); // 010\n\n\n\t\t_points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); // 011\n\n\n\t\t_points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); // 100\n\n\n\t\t_points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); // 101\n\n\n\t\t_points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); // 110\n\n\n\t\t_points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); // 111\n\n\n\t\tthis.setFromPoints(_points);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nconst _points = [/*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3()];\n\nconst _vector$1 = /*@__PURE__*/new Vector3();\n\nconst _box$1 = /*@__PURE__*/new Box3(); // triangle centered vertices\n\n\nconst _v0$1 = /*@__PURE__*/new Vector3();\n\nconst _v1$3 = /*@__PURE__*/new Vector3();\n\nconst _v2$1 = /*@__PURE__*/new Vector3(); // triangle edge vectors\n\n\nconst _f0 = /*@__PURE__*/new Vector3();\n\nconst _f1 = /*@__PURE__*/new Vector3();\n\nconst _f2 = /*@__PURE__*/new Vector3();\n\nconst _center = /*@__PURE__*/new Vector3();\n\nconst _extents = /*@__PURE__*/new Vector3();\n\nconst _triangleNormal = /*@__PURE__*/new Vector3();\n\nconst _testAxis = /*@__PURE__*/new Vector3();\n\nfunction satForAxes(axes, v0, v1, v2, extents) {\n\tfor (let i = 0, j = axes.length - 3; i <= j; i += 3) {\n\t\t_testAxis.fromArray(axes, i); // project the aabb onto the separating axis\n\n\n\t\tconst r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); // project all 3 vertices of the triangle onto the separating axis\n\n\t\tconst p0 = v0.dot(_testAxis);\n\t\tconst p1 = v1.dot(_testAxis);\n\t\tconst p2 = v2.dot(_testAxis); // actual test, basically see if either of the most extreme of the triangle points intersects r\n\n\t\tif (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) {\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nfunction SRGBToLinear(c) {\n\treturn c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);\n}\nfunction LinearToSRGB(c) {\n\treturn c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;\n} // JavaScript RGB-to-RGB transforms, defined as\n// FN[InputColorSpace][OutputColorSpace] callback functions.\n\nconst FN = {\n\t[SRGBColorSpace]: {\n\t\t[LinearSRGBColorSpace]: SRGBToLinear\n\t},\n\t[LinearSRGBColorSpace]: {\n\t\t[SRGBColorSpace]: LinearToSRGB\n\t}\n};\nconst ColorManagement = {\n\tlegacyMode: true,\n\n\tget workingColorSpace() {\n\t\treturn LinearSRGBColorSpace;\n\t},\n\n\tset workingColorSpace(colorSpace) {\n\t\tconsole.warn('THREE.ColorManagement: .workingColorSpace is readonly.');\n\t},\n\n\tconvert: function (color, sourceColorSpace, targetColorSpace) {\n\t\tif (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {\n\t\t\treturn color;\n\t\t}\n\n\t\tif (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== undefined) {\n\t\t\tconst fn = FN[sourceColorSpace][targetColorSpace];\n\t\t\tcolor.r = fn(color.r);\n\t\t\tcolor.g = fn(color.g);\n\t\t\tcolor.b = fn(color.b);\n\t\t\treturn color;\n\t\t}\n\n\t\tthrow new Error('Unsupported color space conversion.');\n\t},\n\tfromWorkingColorSpace: function (color, targetColorSpace) {\n\t\treturn this.convert(color, this.workingColorSpace, targetColorSpace);\n\t},\n\ttoWorkingColorSpace: function (color, sourceColorSpace) {\n\t\treturn this.convert(color, sourceColorSpace, this.workingColorSpace);\n\t}\n};\n\nconst _colorKeywords = {\n\t'aliceblue': 0xF0F8FF,\n\t'antiquewhite': 0xFAEBD7,\n\t'aqua': 0x00FFFF,\n\t'aquamarine': 0x7FFFD4,\n\t'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC,\n\t'bisque': 0xFFE4C4,\n\t'black': 0x000000,\n\t'blanchedalmond': 0xFFEBCD,\n\t'blue': 0x0000FF,\n\t'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A,\n\t'burlywood': 0xDEB887,\n\t'cadetblue': 0x5F9EA0,\n\t'chartreuse': 0x7FFF00,\n\t'chocolate': 0xD2691E,\n\t'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED,\n\t'cornsilk': 0xFFF8DC,\n\t'crimson': 0xDC143C,\n\t'cyan': 0x00FFFF,\n\t'darkblue': 0x00008B,\n\t'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B,\n\t'darkgray': 0xA9A9A9,\n\t'darkgreen': 0x006400,\n\t'darkgrey': 0xA9A9A9,\n\t'darkkhaki': 0xBDB76B,\n\t'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F,\n\t'darkorange': 0xFF8C00,\n\t'darkorchid': 0x9932CC,\n\t'darkred': 0x8B0000,\n\t'darksalmon': 0xE9967A,\n\t'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B,\n\t'darkslategray': 0x2F4F4F,\n\t'darkslategrey': 0x2F4F4F,\n\t'darkturquoise': 0x00CED1,\n\t'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493,\n\t'deepskyblue': 0x00BFFF,\n\t'dimgray': 0x696969,\n\t'dimgrey': 0x696969,\n\t'dodgerblue': 0x1E90FF,\n\t'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0,\n\t'forestgreen': 0x228B22,\n\t'fuchsia': 0xFF00FF,\n\t'gainsboro': 0xDCDCDC,\n\t'ghostwhite': 0xF8F8FF,\n\t'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520,\n\t'gray': 0x808080,\n\t'green': 0x008000,\n\t'greenyellow': 0xADFF2F,\n\t'grey': 0x808080,\n\t'honeydew': 0xF0FFF0,\n\t'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C,\n\t'indigo': 0x4B0082,\n\t'ivory': 0xFFFFF0,\n\t'khaki': 0xF0E68C,\n\t'lavender': 0xE6E6FA,\n\t'lavenderblush': 0xFFF0F5,\n\t'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD,\n\t'lightblue': 0xADD8E6,\n\t'lightcoral': 0xF08080,\n\t'lightcyan': 0xE0FFFF,\n\t'lightgoldenrodyellow': 0xFAFAD2,\n\t'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90,\n\t'lightgrey': 0xD3D3D3,\n\t'lightpink': 0xFFB6C1,\n\t'lightsalmon': 0xFFA07A,\n\t'lightseagreen': 0x20B2AA,\n\t'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899,\n\t'lightslategrey': 0x778899,\n\t'lightsteelblue': 0xB0C4DE,\n\t'lightyellow': 0xFFFFE0,\n\t'lime': 0x00FF00,\n\t'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6,\n\t'magenta': 0xFF00FF,\n\t'maroon': 0x800000,\n\t'mediumaquamarine': 0x66CDAA,\n\t'mediumblue': 0x0000CD,\n\t'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB,\n\t'mediumseagreen': 0x3CB371,\n\t'mediumslateblue': 0x7B68EE,\n\t'mediumspringgreen': 0x00FA9A,\n\t'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585,\n\t'midnightblue': 0x191970,\n\t'mintcream': 0xF5FFFA,\n\t'mistyrose': 0xFFE4E1,\n\t'moccasin': 0xFFE4B5,\n\t'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080,\n\t'oldlace': 0xFDF5E6,\n\t'olive': 0x808000,\n\t'olivedrab': 0x6B8E23,\n\t'orange': 0xFFA500,\n\t'orangered': 0xFF4500,\n\t'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA,\n\t'palegreen': 0x98FB98,\n\t'paleturquoise': 0xAFEEEE,\n\t'palevioletred': 0xDB7093,\n\t'papayawhip': 0xFFEFD5,\n\t'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F,\n\t'pink': 0xFFC0CB,\n\t'plum': 0xDDA0DD,\n\t'powderblue': 0xB0E0E6,\n\t'purple': 0x800080,\n\t'rebeccapurple': 0x663399,\n\t'red': 0xFF0000,\n\t'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1,\n\t'saddlebrown': 0x8B4513,\n\t'salmon': 0xFA8072,\n\t'sandybrown': 0xF4A460,\n\t'seagreen': 0x2E8B57,\n\t'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D,\n\t'silver': 0xC0C0C0,\n\t'skyblue': 0x87CEEB,\n\t'slateblue': 0x6A5ACD,\n\t'slategray': 0x708090,\n\t'slategrey': 0x708090,\n\t'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F,\n\t'steelblue': 0x4682B4,\n\t'tan': 0xD2B48C,\n\t'teal': 0x008080,\n\t'thistle': 0xD8BFD8,\n\t'tomato': 0xFF6347,\n\t'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE,\n\t'wheat': 0xF5DEB3,\n\t'white': 0xFFFFFF,\n\t'whitesmoke': 0xF5F5F5,\n\t'yellow': 0xFFFF00,\n\t'yellowgreen': 0x9ACD32\n};\nconst _rgb = {\n\tr: 0,\n\tg: 0,\n\tb: 0\n};\nconst _hslA = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\nconst _hslB = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\n\nfunction hue2rgb(p, q, t) {\n\tif (t < 0) t += 1;\n\tif (t > 1) t -= 1;\n\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\tif (t < 1 / 2) return q;\n\tif (t < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t);\n\treturn p;\n}\n\nfunction toComponents(source, target) {\n\ttarget.r = source.r;\n\ttarget.g = source.g;\n\ttarget.b = source.b;\n\treturn target;\n}\n\nclass Color {\n\tconstructor(r, g, b) {\n\t\tthis.isColor = true;\n\t\tthis.r = 1;\n\t\tthis.g = 1;\n\t\tthis.b = 1;\n\n\t\tif (g === undefined && b === undefined) {\n\t\t\t// r is THREE.Color, hex or string\n\t\t\treturn this.set(r);\n\t\t}\n\n\t\treturn this.setRGB(r, g, b);\n\t}\n\n\tset(value) {\n\t\tif (value && value.isColor) {\n\t\t\tthis.copy(value);\n\t\t} else if (typeof value === 'number') {\n\t\t\tthis.setHex(value);\n\t\t} else if (typeof value === 'string') {\n\t\t\tthis.setStyle(value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\t\treturn this;\n\t}\n\n\tsetHex(hex, colorSpace = SRGBColorSpace) {\n\t\thex = Math.floor(hex);\n\t\tthis.r = (hex >> 16 & 255) / 255;\n\t\tthis.g = (hex >> 8 & 255) / 255;\n\t\tthis.b = (hex & 255) / 255;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetRGB(r, g, b, colorSpace = ColorManagement.workingColorSpace) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetHSL(h, s, l, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo(h, 1);\n\t\ts = clamp(s, 0, 1);\n\t\tl = clamp(l, 0, 1);\n\n\t\tif (s === 0) {\n\t\t\tthis.r = this.g = this.b = l;\n\t\t} else {\n\t\t\tconst p = l <= 0.5 ? l * (1 + s) : l + s - l * s;\n\t\t\tconst q = 2 * l - p;\n\t\t\tthis.r = hue2rgb(q, p, h + 1 / 3);\n\t\t\tthis.g = hue2rgb(q, p, h);\n\t\t\tthis.b = hue2rgb(q, p, h - 1 / 3);\n\t\t}\n\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetStyle(style, colorSpace = SRGBColorSpace) {\n\t\tfunction handleAlpha(string) {\n\t\t\tif (string === undefined) return;\n\n\t\t\tif (parseFloat(string) < 1) {\n\t\t\t\tconsole.warn('THREE.Color: Alpha component of ' + style + ' will be ignored.');\n\t\t\t}\n\t\t}\n\n\t\tlet m;\n\n\t\tif (m = /^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(style)) {\n\t\t\t// rgb / hsl\n\t\t\tlet color;\n\t\t\tconst name = m[1];\n\t\t\tconst components = m[2];\n\n\t\t\tswitch (name) {\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\tthis.r = Math.min(255, parseInt(color[1], 10)) / 255;\n\t\t\t\t\t\tthis.g = Math.min(255, parseInt(color[2], 10)) / 255;\n\t\t\t\t\t\tthis.b = Math.min(255, parseInt(color[3], 10)) / 255;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\tthis.r = Math.min(100, parseInt(color[1], 10)) / 100;\n\t\t\t\t\t\tthis.g = Math.min(100, parseInt(color[2], 10)) / 100;\n\t\t\t\t\t\tthis.b = Math.min(100, parseInt(color[3], 10)) / 100;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\t\t\t\t\tif (color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\tconst h = parseFloat(color[1]) / 360;\n\t\t\t\t\t\tconst s = parseFloat(color[2]) / 100;\n\t\t\t\t\t\tconst l = parseFloat(color[3]) / 100;\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this.setHSL(h, s, l, colorSpace);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (m = /^\\#([A-Fa-f\\d]+)$/.exec(style)) {\n\t\t\t// hex color\n\t\t\tconst hex = m[1];\n\t\t\tconst size = hex.length;\n\n\t\t\tif (size === 3) {\n\t\t\t\t// #ff0\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t} else if (size === 6) {\n\t\t\t\t// #ff0000\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tif (style && style.length > 0) {\n\t\t\treturn this.setColorName(style, colorSpace);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetColorName(style, colorSpace = SRGBColorSpace) {\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[style.toLowerCase()];\n\n\t\tif (hex !== undefined) {\n\t\t\t// red\n\t\t\tthis.setHex(hex, colorSpace);\n\t\t} else {\n\t\t\t// unknown color\n\t\t\tconsole.warn('THREE.Color: Unknown color ' + style);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.r, this.g, this.b);\n\t}\n\n\tcopy(color) {\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\t\treturn this;\n\t}\n\n\tcopySRGBToLinear(color) {\n\t\tthis.r = SRGBToLinear(color.r);\n\t\tthis.g = SRGBToLinear(color.g);\n\t\tthis.b = SRGBToLinear(color.b);\n\t\treturn this;\n\t}\n\n\tcopyLinearToSRGB(color) {\n\t\tthis.r = LinearToSRGB(color.r);\n\t\tthis.g = LinearToSRGB(color.g);\n\t\tthis.b = LinearToSRGB(color.b);\n\t\treturn this;\n\t}\n\n\tconvertSRGBToLinear() {\n\t\tthis.copySRGBToLinear(this);\n\t\treturn this;\n\t}\n\n\tconvertLinearToSRGB() {\n\t\tthis.copyLinearToSRGB(this);\n\t\treturn this;\n\t}\n\n\tgetHex(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\treturn clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0;\n\t}\n\n\tgetHexString(colorSpace = SRGBColorSpace) {\n\t\treturn ('000000' + this.getHex(colorSpace).toString(16)).slice(-6);\n\t}\n\n\tgetHSL(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\tconst r = _rgb.r,\n\t\t\t\t\tg = _rgb.g,\n\t\t\t\t\tb = _rgb.b;\n\t\tconst max = Math.max(r, g, b);\n\t\tconst min = Math.min(r, g, b);\n\t\tlet hue, saturation;\n\t\tconst lightness = (min + max) / 2.0;\n\n\t\tif (min === max) {\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\t\t} else {\n\t\t\tconst delta = max - min;\n\t\t\tsaturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\n\n\t\t\tswitch (max) {\n\t\t\t\tcase r:\n\t\t\t\t\thue = (g - b) / delta + (g < b ? 6 : 0);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase g:\n\t\t\t\t\thue = (b - r) / delta + 2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase b:\n\t\t\t\t\thue = (r - g) / delta + 4;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\thue /= 6;\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\t\treturn target;\n\t}\n\n\tgetRGB(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\ttarget.r = _rgb.r;\n\t\ttarget.g = _rgb.g;\n\t\ttarget.b = _rgb.b;\n\t\treturn target;\n\t}\n\n\tgetStyle(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\n\t\tif (colorSpace !== SRGBColorSpace) {\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;\n\t\t}\n\n\t\treturn `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`;\n\t}\n\n\toffsetHSL(h, s, l) {\n\t\tthis.getHSL(_hslA);\n\t\t_hslA.h += h;\n\t\t_hslA.s += s;\n\t\t_hslA.l += l;\n\t\tthis.setHSL(_hslA.h, _hslA.s, _hslA.l);\n\t\treturn this;\n\t}\n\n\tadd(color) {\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\t\treturn this;\n\t}\n\n\taddColors(color1, color2) {\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\t\treturn this;\n\t}\n\n\tsub(color) {\n\t\tthis.r = Math.max(0, this.r - color.r);\n\t\tthis.g = Math.max(0, this.g - color.g);\n\t\tthis.b = Math.max(0, this.b - color.b);\n\t\treturn this;\n\t}\n\n\tmultiply(color) {\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\t\treturn this;\n\t}\n\n\tlerp(color, alpha) {\n\t\tthis.r += (color.r - this.r) * alpha;\n\t\tthis.g += (color.g - this.g) * alpha;\n\t\tthis.b += (color.b - this.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpColors(color1, color2, alpha) {\n\t\tthis.r = color1.r + (color2.r - color1.r) * alpha;\n\t\tthis.g = color1.g + (color2.g - color1.g) * alpha;\n\t\tthis.b = color1.b + (color2.b - color1.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpHSL(color, alpha) {\n\t\tthis.getHSL(_hslA);\n\t\tcolor.getHSL(_hslB);\n\t\tconst h = lerp(_hslA.h, _hslB.h, alpha);\n\t\tconst s = lerp(_hslA.s, _hslB.s, alpha);\n\t\tconst l = lerp(_hslA.l, _hslB.l, alpha);\n\t\tthis.setHSL(h, s, l);\n\t\treturn this;\n\t}\n\n\tequals(c) {\n\t\treturn c.r === this.r && c.g === this.g && c.b === this.b;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.r = array[offset];\n\t\tthis.g = array[offset + 1];\n\t\tthis.b = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.r;\n\t\tarray[offset + 1] = this.g;\n\t\tarray[offset + 2] = this.b;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.r = attribute.getX( index );\n\t// \tthis.g = attribute.getY( index );\n\t// \tthis.b = attribute.getZ( index );\n\t// \tif ( attribute.normalized === true ) {\n\t// \t\t// assuming Uint8Array\n\t// \t\tthis.r /= 255;\n\t// \t\tthis.g /= 255;\n\t// \t\tthis.b /= 255;\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\ttoJSON() {\n\t\treturn this.getHex();\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\t}\n\n}\n\nColor.NAMES = _colorKeywords;\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\r\n */\nclass Cylindrical {\n\tconstructor(radius = 1, theta = 0, y = 0) {\n\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\n\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\n\t\tthis.y = y; // height above the x-z plane\n\n\t\treturn this;\n\t}\n\n\tset(radius, theta, y) {\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + z * z);\n\t\tthis.theta = Math.atan2(x, z);\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix4 {\n\tconstructor() {\n\t\tMatrix4.prototype.isMatrix4 = true;\n\t\tthis.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[4] = n12;\n\t\tte[8] = n13;\n\t\tte[12] = n14;\n\t\tte[1] = n21;\n\t\tte[5] = n22;\n\t\tte[9] = n23;\n\t\tte[13] = n24;\n\t\tte[2] = n31;\n\t\tte[6] = n32;\n\t\tte[10] = n33;\n\t\tte[14] = n34;\n\t\tte[3] = n41;\n\t\tte[7] = n42;\n\t\tte[11] = n43;\n\t\tte[15] = n44;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Matrix4().fromArray(this.elements);\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\tte[9] = me[9];\n\t\tte[10] = me[10];\n\t\tte[11] = me[11];\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\tte[15] = me[15];\n\t\treturn this;\n\t}\n\n\tcopyPosition(m) {\n\t\tconst te = this.elements,\n\t\t\t\t\tme = m.elements;\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrix3(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[3], me[6], 0, me[1], me[4], me[7], 0, me[2], me[5], me[8], 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrixColumn(this, 0);\n\t\tyAxis.setFromMatrixColumn(this, 1);\n\t\tzAxis.setFromMatrixColumn(this, 2);\n\t\treturn this;\n\t}\n\n\tmakeBasis(xAxis, yAxis, zAxis) {\n\t\tthis.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractRotation(m) {\n\t\t// this method does not support reflection matrices\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$2.setFromMatrixColumn(m, 0).length();\n\n\t\tconst scaleY = 1 / _v1$2.setFromMatrixColumn(m, 1).length();\n\n\t\tconst scaleZ = 1 / _v1$2.setFromMatrixColumn(m, 2).length();\n\n\t\tte[0] = me[0] * scaleX;\n\t\tte[1] = me[1] * scaleX;\n\t\tte[2] = me[2] * scaleX;\n\t\tte[3] = 0;\n\t\tte[4] = me[4] * scaleY;\n\t\tte[5] = me[5] * scaleY;\n\t\tte[6] = me[6] * scaleY;\n\t\tte[7] = 0;\n\t\tte[8] = me[8] * scaleZ;\n\t\tte[9] = me[9] * scaleZ;\n\t\tte[10] = me[10] * scaleZ;\n\t\tte[11] = 0;\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromEuler(euler) {\n\t\tconst te = this.elements;\n\t\tconst x = euler.x,\n\t\t\t\t\ty = euler.y,\n\t\t\t\t\tz = euler.z;\n\t\tconst a = Math.cos(x),\n\t\t\t\t\tb = Math.sin(x);\n\t\tconst c = Math.cos(y),\n\t\t\t\t\td = Math.sin(y);\n\t\tconst e = Math.cos(z),\n\t\t\t\t\tf = Math.sin(z);\n\n\t\tif (euler.order === 'XYZ') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -c * f;\n\t\t\tte[8] = d;\n\t\t\tte[1] = af + be * d;\n\t\t\tte[5] = ae - bf * d;\n\t\t\tte[9] = -b * c;\n\t\t\tte[2] = bf - ae * d;\n\t\t\tte[6] = be + af * d;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YXZ') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce + df * b;\n\t\t\tte[4] = de * b - cf;\n\t\t\tte[8] = a * d;\n\t\t\tte[1] = a * f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b;\n\t\t\tte[2] = cf * b - de;\n\t\t\tte[6] = df + ce * b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZXY') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce - df * b;\n\t\t\tte[4] = -a * f;\n\t\t\tte[8] = de + cf * b;\n\t\t\tte[1] = cf + de * b;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = df - ce * b;\n\t\t\tte[2] = -a * d;\n\t\t\tte[6] = b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZYX') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = be * d - af;\n\t\t\tte[8] = ae * d + bf;\n\t\t\tte[1] = c * f;\n\t\t\tte[5] = bf * d + ae;\n\t\t\tte[9] = af * d - be;\n\t\t\tte[2] = -d;\n\t\t\tte[6] = b * c;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YZX') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = bd - ac * f;\n\t\t\tte[8] = bc * f + ad;\n\t\t\tte[1] = f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b * e;\n\t\t\tte[2] = -d * e;\n\t\t\tte[6] = ad * f + bc;\n\t\t\tte[10] = ac - bd * f;\n\t\t} else if (euler.order === 'XZY') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -f;\n\t\t\tte[8] = d * e;\n\t\t\tte[1] = ac * f + bd;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = ad * f - bc;\n\t\t\tte[2] = bc * f - ad;\n\t\t\tte[6] = b * e;\n\t\t\tte[10] = bd * f + ac;\n\t\t} // bottom row\n\n\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0; // last column\n\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromQuaternion(q) {\n\t\treturn this.compose(_zero, q, _one);\n\t}\n\n\tlookAt(eye, target, up) {\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors(eye, target);\n\n\t\tif (_z.lengthSq() === 0) {\n\t\t\t// eye and target are in the same position\n\t\t\t_z.z = 1;\n\t\t}\n\n\t\t_z.normalize();\n\n\t\t_x.crossVectors(up, _z);\n\n\t\tif (_x.lengthSq() === 0) {\n\t\t\t// up and z are parallel\n\t\t\tif (Math.abs(up.z) === 1) {\n\t\t\t\t_z.x += 0.0001;\n\t\t\t} else {\n\t\t\t\t_z.z += 0.0001;\n\t\t\t}\n\n\t\t\t_z.normalize();\n\n\t\t\t_x.crossVectors(up, _z);\n\t\t}\n\n\t\t_x.normalize();\n\n\t\t_y.crossVectors(_z, _x);\n\n\t\tte[0] = _x.x;\n\t\tte[4] = _y.x;\n\t\tte[8] = _z.x;\n\t\tte[1] = _x.y;\n\t\tte[5] = _y.y;\n\t\tte[9] = _z.y;\n\t\tte[2] = _x.z;\n\t\tte[6] = _y.z;\n\t\tte[10] = _z.z;\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[4],\n\t\t\t\t\ta13 = ae[8],\n\t\t\t\t\ta14 = ae[12];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[5],\n\t\t\t\t\ta23 = ae[9],\n\t\t\t\t\ta24 = ae[13];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[6],\n\t\t\t\t\ta33 = ae[10],\n\t\t\t\t\ta34 = ae[14];\n\t\tconst a41 = ae[3],\n\t\t\t\t\ta42 = ae[7],\n\t\t\t\t\ta43 = ae[11],\n\t\t\t\t\ta44 = ae[15];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[4],\n\t\t\t\t\tb13 = be[8],\n\t\t\t\t\tb14 = be[12];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[5],\n\t\t\t\t\tb23 = be[9],\n\t\t\t\t\tb24 = be[13];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[6],\n\t\t\t\t\tb33 = be[10],\n\t\t\t\t\tb34 = be[14];\n\t\tconst b41 = be[3],\n\t\t\t\t\tb42 = be[7],\n\t\t\t\t\tb43 = be[11],\n\t\t\t\t\tb44 = be[15];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\t\tte[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[4] *= s;\n\t\tte[8] *= s;\n\t\tte[12] *= s;\n\t\tte[1] *= s;\n\t\tte[5] *= s;\n\t\tte[9] *= s;\n\t\tte[13] *= s;\n\t\tte[2] *= s;\n\t\tte[6] *= s;\n\t\tte[10] *= s;\n\t\tte[14] *= s;\n\t\tte[3] *= s;\n\t\tte[7] *= s;\n\t\tte[11] *= s;\n\t\tte[15] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst n11 = te[0],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn14 = te[12];\n\t\tconst n21 = te[1],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn24 = te[13];\n\t\tconst n31 = te[2],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn34 = te[14];\n\t\tconst n41 = te[3],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn44 = te[15]; //TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);\n\t}\n\n\ttranspose() {\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\t\ttmp = te[1];\n\t\tte[1] = te[4];\n\t\tte[4] = tmp;\n\t\ttmp = te[2];\n\t\tte[2] = te[8];\n\t\tte[8] = tmp;\n\t\ttmp = te[6];\n\t\tte[6] = te[9];\n\t\tte[9] = tmp;\n\t\ttmp = te[3];\n\t\tte[3] = te[12];\n\t\tte[12] = tmp;\n\t\ttmp = te[7];\n\t\tte[7] = te[13];\n\t\tte[13] = tmp;\n\t\ttmp = te[11];\n\t\tte[11] = te[14];\n\t\tte[14] = tmp;\n\t\treturn this;\n\t}\n\n\tsetPosition(x, y, z) {\n\t\tconst te = this.elements;\n\n\t\tif (x.isVector3) {\n\t\t\tte[12] = x.x;\n\t\t\tte[13] = x.y;\n\t\t\tte[14] = x.z;\n\t\t} else {\n\t\t\tte[12] = x;\n\t\t\tte[13] = y;\n\t\t\tte[14] = z;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tinvert() {\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn41 = te[3],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn14 = te[12],\n\t\t\t\t\tn24 = te[13],\n\t\t\t\t\tn34 = te[14],\n\t\t\t\t\tn44 = te[15],\n\t\t\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;\n\t\tte[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;\n\t\tte[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;\n\t\tte[4] = t12 * detInv;\n\t\tte[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;\n\t\tte[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;\n\t\tte[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;\n\t\tte[8] = t13 * detInv;\n\t\tte[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;\n\t\tte[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;\n\t\tte[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;\n\t\tte[12] = t14 * detInv;\n\t\tte[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;\n\t\tte[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;\n\t\tte[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;\n\t\treturn this;\n\t}\n\n\tscale(v) {\n\t\tconst te = this.elements;\n\t\tconst x = v.x,\n\t\t\t\t\ty = v.y,\n\t\t\t\t\tz = v.z;\n\t\tte[0] *= x;\n\t\tte[4] *= y;\n\t\tte[8] *= z;\n\t\tte[1] *= x;\n\t\tte[5] *= y;\n\t\tte[9] *= z;\n\t\tte[2] *= x;\n\t\tte[6] *= y;\n\t\tte[10] *= z;\n\t\tte[3] *= x;\n\t\tte[7] *= y;\n\t\tte[11] *= z;\n\t\treturn this;\n\t}\n\n\tgetMaxScaleOnAxis() {\n\t\tconst te = this.elements;\n\t\tconst scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];\n\t\tconst scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];\n\t\tconst scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];\n\t\treturn Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));\n\t}\n\n\tmakeTranslation(x, y, z) {\n\t\tthis.set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationX(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationY(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationZ(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationAxis(axis, angle) {\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\t\tconst c = Math.cos(angle);\n\t\tconst s = Math.sin(angle);\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x,\n\t\t\t\t\ty = axis.y,\n\t\t\t\t\tz = axis.z;\n\t\tconst tx = t * x,\n\t\t\t\t\tty = t * y;\n\t\tthis.set(tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y, z) {\n\t\tthis.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeShear(xy, xz, yx, yz, zx, zy) {\n\t\tthis.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\t\tconst x = quaternion._x,\n\t\t\t\t\ty = quaternion._y,\n\t\t\t\t\tz = quaternion._z,\n\t\t\t\t\tw = quaternion._w;\n\t\tconst x2 = x + x,\n\t\t\t\t\ty2 = y + y,\n\t\t\t\t\tz2 = z + z;\n\t\tconst xx = x * x2,\n\t\t\t\t\txy = x * y2,\n\t\t\t\t\txz = x * z2;\n\t\tconst yy = y * y2,\n\t\t\t\t\tyz = y * z2,\n\t\t\t\t\tzz = z * z2;\n\t\tconst wx = w * x2,\n\t\t\t\t\twy = w * y2,\n\t\t\t\t\twz = w * z2;\n\t\tconst sx = scale.x,\n\t\t\t\t\tsy = scale.y,\n\t\t\t\t\tsz = scale.z;\n\t\tte[0] = (1 - (yy + zz)) * sx;\n\t\tte[1] = (xy + wz) * sx;\n\t\tte[2] = (xz - wy) * sx;\n\t\tte[3] = 0;\n\t\tte[4] = (xy - wz) * sy;\n\t\tte[5] = (1 - (xx + zz)) * sy;\n\t\tte[6] = (yz + wx) * sy;\n\t\tte[7] = 0;\n\t\tte[8] = (xz + wy) * sz;\n\t\tte[9] = (yz - wx) * sz;\n\t\tte[10] = (1 - (xx + yy)) * sz;\n\t\tte[11] = 0;\n\t\tte[12] = position.x;\n\t\tte[13] = position.y;\n\t\tte[14] = position.z;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tdecompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$2.set(te[0], te[1], te[2]).length();\n\n\t\tconst sy = _v1$2.set(te[4], te[5], te[6]).length();\n\n\t\tconst sz = _v1$2.set(te[8], te[9], te[10]).length(); // if determine is negative, we need to invert one scale\n\n\n\t\tconst det = this.determinant();\n\t\tif (det < 0) sx = -sx;\n\t\tposition.x = te[12];\n\t\tposition.y = te[13];\n\t\tposition.z = te[14]; // scale the rotation part\n\n\t\t_m1.copy(this);\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\t\t_m1.elements[0] *= invSX;\n\t\t_m1.elements[1] *= invSX;\n\t\t_m1.elements[2] *= invSX;\n\t\t_m1.elements[4] *= invSY;\n\t\t_m1.elements[5] *= invSY;\n\t\t_m1.elements[6] *= invSY;\n\t\t_m1.elements[8] *= invSZ;\n\t\t_m1.elements[9] *= invSZ;\n\t\t_m1.elements[10] *= invSZ;\n\t\tquaternion.setFromRotationMatrix(_m1);\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\t\treturn this;\n\t}\n\n\tmakePerspective(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst x = 2 * near / (right - left);\n\t\tconst y = 2 * near / (top - bottom);\n\t\tconst a = (right + left) / (right - left);\n\t\tconst b = (top + bottom) / (top - bottom);\n\t\tconst c = -(far + near) / (far - near);\n\t\tconst d = -2 * far * near / (far - near);\n\t\tte[0] = x;\n\t\tte[4] = 0;\n\t\tte[8] = a;\n\t\tte[12] = 0;\n\t\tte[1] = 0;\n\t\tte[5] = y;\n\t\tte[9] = b;\n\t\tte[13] = 0;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = c;\n\t\tte[14] = d;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = -1;\n\t\tte[15] = 0;\n\t\treturn this;\n\t}\n\n\tmakeOrthographic(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst w = 1.0 / (right - left);\n\t\tconst h = 1.0 / (top - bottom);\n\t\tconst p = 1.0 / (far - near);\n\t\tconst x = (right + left) * w;\n\t\tconst y = (top + bottom) * h;\n\t\tconst z = (far + near) * p;\n\t\tte[0] = 2 * w;\n\t\tte[4] = 0;\n\t\tte[8] = 0;\n\t\tte[12] = -x;\n\t\tte[1] = 0;\n\t\tte[5] = 2 * h;\n\t\tte[9] = 0;\n\t\tte[13] = -y;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = -2 * p;\n\t\tte[14] = -z;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\tarray[offset + 9] = te[9];\n\t\tarray[offset + 10] = te[10];\n\t\tarray[offset + 11] = te[11];\n\t\tarray[offset + 12] = te[12];\n\t\tarray[offset + 13] = te[13];\n\t\tarray[offset + 14] = te[14];\n\t\tarray[offset + 15] = te[15];\n\t\treturn array;\n\t}\n\n}\n\nconst _v1$2 = /*@__PURE__*/new Vector3();\n\nconst _m1 = /*@__PURE__*/new Matrix4();\n\nconst _zero = /*@__PURE__*/new Vector3(0, 0, 0);\n\nconst _one = /*@__PURE__*/new Vector3(1, 1, 1);\n\nconst _x = /*@__PURE__*/new Vector3();\n\nconst _y = /*@__PURE__*/new Vector3();\n\nconst _z = /*@__PURE__*/new Vector3();\n\nconst _matrix = /*@__PURE__*/new Matrix4();\n\nconst _quaternion = /*@__PURE__*/new Quaternion();\n\nclass Euler {\n\tconstructor(x = 0, y = 0, z = 0, order = Euler.DefaultOrder) {\n\t\tthis.isEuler = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget order() {\n\t\treturn this._order;\n\t}\n\n\tset order(value) {\n\t\tthis._order = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, order = this._order) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._order);\n\t}\n\n\tcopy(euler) {\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m, order = this._order, update = true) {\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements;\n\t\tconst m11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8];\n\t\tconst m21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9];\n\t\tconst m31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._y = Math.asin(clamp(m13, -1, 1));\n\n\t\t\t\tif (Math.abs(m13) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = Math.asin(-clamp(m23, -1, 1));\n\n\t\t\t\tif (Math.abs(m23) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = Math.asin(clamp(m32, -1, 1));\n\n\t\t\t\tif (Math.abs(m32) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._y = Math.asin(-clamp(m31, -1, 1));\n\n\t\t\t\tif (Math.abs(m31) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._z = Math.asin(clamp(m21, -1, 1));\n\n\t\t\t\tif (Math.abs(m21) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m22);\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._z = Math.asin(-clamp(m12, -1, 1));\n\n\t\t\t\tif (Math.abs(m12) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._y = Math.atan2(m13, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tthis._order = order;\n\t\tif (update === true) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromQuaternion(q, order, update) {\n\t\t_matrix.makeRotationFromQuaternion(q);\n\n\t\treturn this.setFromRotationMatrix(_matrix, order, update);\n\t}\n\n\tsetFromVector3(v, order = this._order) {\n\t\treturn this.set(v.x, v.y, v.z, order);\n\t}\n\n\treorder(newOrder) {\n\t\t// WARNING: this discards revolution information -bhouston\n\t\t_quaternion.setFromEuler(this);\n\n\t\treturn this.setFromQuaternion(_quaternion, newOrder);\n\t}\n\n\tequals(euler) {\n\t\treturn euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;\n\t}\n\n\tfromArray(array) {\n\t\tthis._x = array[0];\n\t\tthis._y = array[1];\n\t\tthis._z = array[2];\n\t\tif (array[3] !== undefined) this._order = array[3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._order;\n\t\treturn array;\n\t}\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\t} // @deprecated since r138, 02cf0df1cb4575d5842fef9c85bb5a89fe020d53\n\n\n\ttoVector3() {\n\t\tconsole.error('THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead');\n\t}\n\n}\n\nEuler.DefaultOrder = 'XYZ';\nEuler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX'];\n\n/**\r\n * Abstract base class of interpolants over parametric samples.\r\n *\r\n * The parameter domain is one dimensional, typically the time or a path\r\n * along a curve defined by the data.\r\n *\r\n * The sample values can have any dimensionality and derived classes may\r\n * apply special interpretations to the data.\r\n *\r\n * This class provides the interval seek in a Template Method, deferring\r\n * the actual interpolation to derived classes.\r\n *\r\n * Time complexity is O(1) for linear access crossing at most two points\r\n * and O(log N) for random access, where N is the number of positions.\r\n *\r\n * References:\r\n *\r\n * \t\thttp://www.oodesign.com/template-method-pattern.html\r\n *\r\n */\nclass Interpolant {\n\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor(sampleSize);\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\t\tthis.settings = null;\n\t\tthis.DefaultSettings_ = {};\n\t}\n\n\tevaluate(t) {\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\t\tt1 = pp[i1],\n\t\t\t\tt0 = pp[i1 - 1];\n\n\t\tvalidate_interval: {\n\t\t\tseek: {\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if (!(t < t1)) {\n\t\t\t\t\t\tfor (let giveUpAt = i1 + 2;;) {\n\t\t\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\t\t\tif (t < t0) break forward_scan; // after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[++i1];\n\n\t\t\t\t\t\t\tif (t < t1) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the right side of the index\n\n\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} //- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\n\n\t\t\t\t\tif (!(t >= t0)) {\n\t\t\t\t\t\t// looping?\n\t\t\t\t\t\tconst t1global = pp[1];\n\n\t\t\t\t\t\tif (t < t1global) {\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\n\t\t\t\t\t\t\tt0 = t1global;\n\t\t\t\t\t\t} // linear reverse scan\n\n\n\t\t\t\t\t\tfor (let giveUpAt = i1 - 2;;) {\n\t\t\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\t\t\t// before start\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[--i1 - 1];\n\n\t\t\t\t\t\t\tif (t >= t0) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the left side of the index\n\n\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} // the interval is valid\n\n\n\t\t\t\t\tbreak validate_interval;\n\t\t\t\t} // linear scan\n\t\t\t\t// binary search\n\n\n\t\t\t\twhile (i1 < right) {\n\t\t\t\t\tconst mid = i1 + right >>> 1;\n\n\t\t\t\t\tif (t < pp[mid]) {\n\t\t\t\t\t\tright = mid;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti1 = mid + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[i1];\n\t\t\t\tt0 = pp[i1 - 1]; // check boundary cases, again\n\n\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t}\n\n\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t}\n\t\t\t} // seek\n\n\n\t\t\tthis._cachedIndex = i1;\n\t\t\tthis.intervalChanged_(i1, t0, t1);\n\t\t} // validate_interval\n\n\n\t\treturn this.interpolate_(i1, t0, t, t1);\n\t}\n\n\tgetSettings_() {\n\t\treturn this.settings || this.DefaultSettings_;\n\t}\n\n\tcopySampleValue_(index) {\n\t\t// copies a sample value to the result buffer\n\t\tconst result = this.resultBuffer,\n\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\toffset = index * stride;\n\n\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\tresult[i] = values[offset + i];\n\t\t}\n\n\t\treturn result;\n\t} // Template methods for derived classes:\n\n\n\tinterpolate_() {\n\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t}\n\n\tintervalChanged_() {// empty\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/new Vector3();\n\nconst _startEnd = /*@__PURE__*/new Vector3();\n\nclass Line3 {\n\tconstructor(start = new Vector3(), end = new Vector3()) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t}\n\n\tset(start, end) {\n\t\tthis.start.copy(start);\n\t\tthis.end.copy(end);\n\t\treturn this;\n\t}\n\n\tcopy(line) {\n\t\tthis.start.copy(line.start);\n\t\tthis.end.copy(line.end);\n\t\treturn this;\n\t}\n\n\tgetCenter(target) {\n\t\treturn target.addVectors(this.start, this.end).multiplyScalar(0.5);\n\t}\n\n\tdelta(target) {\n\t\treturn target.subVectors(this.end, this.start);\n\t}\n\n\tdistanceSq() {\n\t\treturn this.start.distanceToSquared(this.end);\n\t}\n\n\tdistance() {\n\t\treturn this.start.distanceTo(this.end);\n\t}\n\n\tat(t, target) {\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tclosestPointToPointParameter(point, clampToLine) {\n\t\t_startP.subVectors(point, this.start);\n\n\t\t_startEnd.subVectors(this.end, this.start);\n\n\t\tconst startEnd2 = _startEnd.dot(_startEnd);\n\n\t\tconst startEnd_startP = _startEnd.dot(_startP);\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif (clampToLine) {\n\t\t\tt = clamp(t, 0, 1);\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tclosestPointToPoint(point, clampToLine, target) {\n\t\tconst t = this.closestPointToPointParameter(point, clampToLine);\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.start.applyMatrix4(matrix);\n\t\tthis.end.applyMatrix4(matrix);\n\t\treturn this;\n\t}\n\n\tequals(line) {\n\t\treturn line.start.equals(this.start) && line.end.equals(this.end);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix3 {\n\tconstructor() {\n\t\tMatrix3.prototype.isMatrix3 = true;\n\t\tthis.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n21, n22, n23, n31, n32, n33) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[1] = n21;\n\t\tte[2] = n31;\n\t\tte[3] = n12;\n\t\tte[4] = n22;\n\t\tte[5] = n32;\n\t\tte[6] = n13;\n\t\tte[7] = n23;\n\t\tte[8] = n33;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 1, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrix3Column(this, 0);\n\t\tyAxis.setFromMatrix3Column(this, 1);\n\t\tzAxis.setFromMatrix3Column(this, 2);\n\t\treturn this;\n\t}\n\n\tsetFromMatrix4(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10]);\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[3],\n\t\t\t\t\ta13 = ae[6];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[4],\n\t\t\t\t\ta23 = ae[7];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[5],\n\t\t\t\t\ta33 = ae[8];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[3],\n\t\t\t\t\tb13 = be[6];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[4],\n\t\t\t\t\tb23 = be[7];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[5],\n\t\t\t\t\tb33 = be[8];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[3] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[4] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[5] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[3] *= s;\n\t\tte[6] *= s;\n\t\tte[1] *= s;\n\t\tte[4] *= s;\n\t\tte[7] *= s;\n\t\tte[2] *= s;\n\t\tte[5] *= s;\n\t\tte[8] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst a = te[0],\n\t\t\t\t\tb = te[1],\n\t\t\t\t\tc = te[2],\n\t\t\t\t\td = te[3],\n\t\t\t\t\te = te[4],\n\t\t\t\t\tf = te[5],\n\t\t\t\t\tg = te[6],\n\t\t\t\t\th = te[7],\n\t\t\t\t\ti = te[8];\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\t}\n\n\tinvert() {\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn12 = te[3],\n\t\t\t\t\tn22 = te[4],\n\t\t\t\t\tn32 = te[5],\n\t\t\t\t\tn13 = te[6],\n\t\t\t\t\tn23 = te[7],\n\t\t\t\t\tn33 = te[8],\n\t\t\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\t\t\tt13 = n23 * n12 - n22 * n13,\n\t\t\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n31 * n23 - n33 * n21) * detInv;\n\t\tte[2] = (n32 * n21 - n31 * n22) * detInv;\n\t\tte[3] = t12 * detInv;\n\t\tte[4] = (n33 * n11 - n31 * n13) * detInv;\n\t\tte[5] = (n31 * n12 - n32 * n11) * detInv;\n\t\tte[6] = t13 * detInv;\n\t\tte[7] = (n21 * n13 - n23 * n11) * detInv;\n\t\tte[8] = (n22 * n11 - n21 * n12) * detInv;\n\t\treturn this;\n\t}\n\n\ttranspose() {\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\t\ttmp = m[1];\n\t\tm[1] = m[3];\n\t\tm[3] = tmp;\n\t\ttmp = m[2];\n\t\tm[2] = m[6];\n\t\tm[6] = tmp;\n\t\ttmp = m[5];\n\t\tm[5] = m[7];\n\t\tm[7] = tmp;\n\t\treturn this;\n\t}\n\n\tgetNormalMatrix(matrix4) {\n\t\treturn this.setFromMatrix4(matrix4).invert().transpose();\n\t}\n\n\ttransposeIntoArray(r) {\n\t\tconst m = this.elements;\n\t\tr[0] = m[0];\n\t\tr[1] = m[3];\n\t\tr[2] = m[6];\n\t\tr[3] = m[1];\n\t\tr[4] = m[4];\n\t\tr[5] = m[7];\n\t\tr[6] = m[2];\n\t\tr[7] = m[5];\n\t\tr[8] = m[8];\n\t\treturn this;\n\t}\n\n\tsetUvTransform(tx, ty, sx, sy, rotation, cx, cy) {\n\t\tconst c = Math.cos(rotation);\n\t\tconst s = Math.sin(rotation);\n\t\tthis.set(sx * c, sx * s, -sx * (c * cx + s * cy) + cx + tx, -sy * s, sy * c, -sy * (-s * cx + c * cy) + cy + ty, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tscale(sx, sy) {\n\t\tthis.premultiply(_m3.makeScale(sx, sy));\n\t\treturn this;\n\t}\n\n\trotate(theta) {\n\t\tthis.premultiply(_m3.makeRotation(-theta));\n\t\treturn this;\n\t}\n\n\ttranslate(tx, ty) {\n\t\tthis.premultiply(_m3.makeTranslation(tx, ty));\n\t\treturn this;\n\t} // for 2D Transforms\n\n\n\tmakeTranslation(x, y) {\n\t\tthis.set(1, 0, x, 0, 1, y, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotation(theta) {\n\t\t// counterclockwise\n\t\tconst c = Math.cos(theta);\n\t\tconst s = Math.sin(theta);\n\t\tthis.set(c, -s, 0, s, c, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y) {\n\t\tthis.set(x, 0, 0, 0, y, 0, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\treturn array;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().fromArray(this.elements);\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/new Matrix3();\n\nconst _vector1 = /*@__PURE__*/new Vector3();\n\nconst _vector2 = /*@__PURE__*/new Vector3();\n\nconst _normalMatrix = /*@__PURE__*/new Matrix3();\n\nclass Plane {\n\tconstructor(normal = new Vector3(1, 0, 0), constant = 0) {\n\t\tthis.isPlane = true; // normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\t}\n\n\tset(normal, constant) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = constant;\n\t\treturn this;\n\t}\n\n\tsetComponents(x, y, z, w) {\n\t\tthis.normal.set(x, y, z);\n\t\tthis.constant = w;\n\t\treturn this;\n\t}\n\n\tsetFromNormalAndCoplanarPoint(normal, point) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = -point.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tsetFromCoplanarPoints(a, b, c) {\n\t\tconst normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize(); // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\n\t\tthis.setFromNormalAndCoplanarPoint(normal, a);\n\t\treturn this;\n\t}\n\n\tcopy(plane) {\n\t\tthis.normal.copy(plane.normal);\n\t\tthis.constant = plane.constant;\n\t\treturn this;\n\t}\n\n\tnormalize() {\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar(inverseNormalLength);\n\t\tthis.constant *= inverseNormalLength;\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.constant *= -1;\n\t\tthis.normal.negate();\n\t\treturn this;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn this.normal.dot(point) + this.constant;\n\t}\n\n\tdistanceToSphere(sphere) {\n\t\treturn this.distanceToPoint(sphere.center) - sphere.radius;\n\t}\n\n\tprojectPoint(point, target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);\n\t}\n\n\tintersectLine(line, target) {\n\t\tconst direction = line.delta(_vector1);\n\t\tconst denominator = this.normal.dot(direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (this.distanceToPoint(line.start) === 0) {\n\t\t\t\treturn target.copy(line.start);\n\t\t\t} // Unsure if this is the correct method to handle this case.\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(line.start.dot(this.normal) + this.constant) / denominator;\n\n\t\tif (t < 0 || t > 1) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn target.copy(direction).multiplyScalar(t).add(line.start);\n\t}\n\n\tintersectsLine(line) {\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\t\tconst startSign = this.distanceToPoint(line.start);\n\t\tconst endSign = this.distanceToPoint(line.end);\n\t\treturn startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsPlane(this);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn sphere.intersectsPlane(this);\n\t}\n\n\tcoplanarPoint(target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.constant);\n\t}\n\n\tapplyMatrix4(matrix, optionalNormalMatrix) {\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);\n\n\t\tconst referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);\n\t\tconst normal = this.normal.applyMatrix3(normalMatrix).normalize();\n\t\tthis.constant = -referencePoint.dot(normal);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.constant -= offset.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tequals(plane) {\n\t\treturn plane.normal.equals(this.normal) && plane.constant === this.constant;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/new Vector3();\n\nconst _segCenter = /*@__PURE__*/new Vector3();\n\nconst _segDir = /*@__PURE__*/new Vector3();\n\nconst _diff = /*@__PURE__*/new Vector3();\n\nconst _edge1 = /*@__PURE__*/new Vector3();\n\nconst _edge2 = /*@__PURE__*/new Vector3();\n\nconst _normal = /*@__PURE__*/new Vector3();\n\nclass Ray {\n\tconstructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\t}\n\n\tset(origin, direction) {\n\t\tthis.origin.copy(origin);\n\t\tthis.direction.copy(direction);\n\t\treturn this;\n\t}\n\n\tcopy(ray) {\n\t\tthis.origin.copy(ray.origin);\n\t\tthis.direction.copy(ray.direction);\n\t\treturn this;\n\t}\n\n\tat(t, target = new Vector3()) {\n\t\treturn target.copy(this.direction).multiplyScalar(t).add(this.origin);\n\t}\n\n\tlookAt(v) {\n\t\tthis.direction.copy(v).sub(this.origin).normalize();\n\t\treturn this;\n\t}\n\n\trecast(t) {\n\t\tthis.origin.copy(this.at(t, _vector));\n\t\treturn this;\n\t}\n\n\tclosestPointToPoint(point, target = new Vector3()) {\n\t\ttarget.subVectors(point, this.origin);\n\t\tconst directionDistance = target.dot(this.direction);\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn target.copy(this.origin);\n\t\t}\n\n\t\treturn target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn Math.sqrt(this.distanceSqToPoint(point));\n\t}\n\n\tdistanceSqToPoint(point) {\n\t\tconst directionDistance = _vector.subVectors(point, this.origin).dot(this.direction); // point behind the ray\n\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn this.origin.distanceToSquared(point);\n\t\t}\n\n\t\t_vector.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\n\t\treturn _vector.distanceToSquared(point);\n\t}\n\n\tdistanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\t\t_segCenter.copy(v0).add(v1).multiplyScalar(0.5);\n\n\t\t_segDir.copy(v1).sub(v0).normalize();\n\n\t\t_diff.copy(this.origin).sub(_segCenter);\n\n\t\tconst segExtent = v0.distanceTo(v1) * 0.5;\n\t\tconst a01 = -this.direction.dot(_segDir);\n\n\t\tconst b0 = _diff.dot(this.direction);\n\n\t\tconst b1 = -_diff.dot(_segDir);\n\n\t\tconst c = _diff.lengthSq();\n\n\t\tconst det = Math.abs(1 - a01 * a01);\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif (det > 0) {\n\t\t\t// The ray and segment are not parallel.\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif (s0 >= 0) {\n\t\t\t\tif (s1 >= -extDet) {\n\t\t\t\t\tif (s1 <= extDet) {\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 1\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// region 5\n\t\t\t\t\ts1 = -segExtent;\n\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s1 <= -extDet) {\n\t\t\t\t\t// region 4\n\t\t\t\t\ts0 = Math.max(0, -(-a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else if (s1 <= extDet) {\n\t\t\t\t\t// region 3\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else {\n\t\t\t\t\t// region 2\n\t\t\t\t\ts0 = Math.max(0, -(a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Ray and segment are parallel.\n\t\t\ts1 = a01 > 0 ? -segExtent : segExtent;\n\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t}\n\n\t\tif (optionalPointOnRay) {\n\t\t\toptionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);\n\t\t}\n\n\t\tif (optionalPointOnSegment) {\n\t\t\toptionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);\n\t\t}\n\n\t\treturn sqrDist;\n\t}\n\n\tintersectSphere(sphere, target = new Vector3()) {\n\t\t_vector.subVectors(sphere.center, this.origin);\n\n\t\tconst tca = _vector.dot(this.direction);\n\n\t\tconst d2 = _vector.dot(_vector) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\t\tif (d2 > radius2) return null;\n\t\tconst thc = Math.sqrt(radius2 - d2); // t0 = first intersect point - entrance on front of sphere\n\n\t\tconst t0 = tca - thc; // t1 = second intersect point - exit point on back of sphere\n\n\t\tconst t1 = tca + thc; // test to see if both t0 and t1 are behind the ray - if so, return null\n\n\t\tif (t0 < 0 && t1 < 0) return null; // test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\n\t\tif (t0 < 0) return this.at(t1, target); // else t0 is in front of the ray, so return the first collision point scaled by t0\n\n\t\treturn this.at(t0, target);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tdistanceToPlane(plane) {\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (plane.distanceToPoint(this.origin) === 0) {\n\t\t\t\treturn 0;\n\t\t\t} // Null is preferable to undefined since undefined means.... it is undefined\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(this.origin.dot(plane.normal) + plane.constant) / denominator; // Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\t}\n\n\tintersectPlane(plane, target) {\n\t\tconst t = this.distanceToPlane(plane);\n\n\t\tif (t === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.at(t, target);\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// check if the ray lies on the plane first\n\t\tconst distToPoint = plane.distanceToPoint(this.origin);\n\n\t\tif (distToPoint === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator * distToPoint < 0) {\n\t\t\treturn true;\n\t\t} // ray origin is behind the plane (and is pointing behind it)\n\n\n\t\treturn false;\n\t}\n\n\tintersectBox(box, target) {\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\t\t\tinvdirz = 1 / this.direction.z;\n\t\tconst origin = this.origin;\n\n\t\tif (invdirx >= 0) {\n\t\t\ttmin = (box.min.x - origin.x) * invdirx;\n\t\t\ttmax = (box.max.x - origin.x) * invdirx;\n\t\t} else {\n\t\t\ttmin = (box.max.x - origin.x) * invdirx;\n\t\t\ttmax = (box.min.x - origin.x) * invdirx;\n\t\t}\n\n\t\tif (invdiry >= 0) {\n\t\t\ttymin = (box.min.y - origin.y) * invdiry;\n\t\t\ttymax = (box.max.y - origin.y) * invdiry;\n\t\t} else {\n\t\t\ttymin = (box.max.y - origin.y) * invdiry;\n\t\t\ttymax = (box.min.y - origin.y) * invdiry;\n\t\t}\n\n\t\tif (tmin > tymax || tymin > tmax) return null; // These lines also handle the case where tmin or tmax is NaN\n\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\tif (tymin > tmin || tmin !== tmin) tmin = tymin;\n\t\tif (tymax < tmax || tmax !== tmax) tmax = tymax;\n\n\t\tif (invdirz >= 0) {\n\t\t\ttzmin = (box.min.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.max.z - origin.z) * invdirz;\n\t\t} else {\n\t\t\ttzmin = (box.max.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.min.z - origin.z) * invdirz;\n\t\t}\n\n\t\tif (tmin > tzmax || tzmin > tmax) return null;\n\t\tif (tzmin > tmin || tmin !== tmin) tmin = tzmin;\n\t\tif (tzmax < tmax || tmax !== tmax) tmax = tzmax; //return point closest to the ray (positive side)\n\n\t\tif (tmax < 0) return null;\n\t\treturn this.at(tmin >= 0 ? tmin : tmax, target);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn this.intersectBox(box, _vector) !== null;\n\t}\n\n\tintersectTriangle(a, b, c, backfaceCulling, target) {\n\t\t// Compute the offset origin, edges, and normal.\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\t\t_edge1.subVectors(b, a);\n\n\t\t_edge2.subVectors(c, a);\n\n\t\t_normal.crossVectors(_edge1, _edge2); // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t//\t |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t//\t |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t//\t |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\n\n\t\tlet DdN = this.direction.dot(_normal);\n\t\tlet sign;\n\n\t\tif (DdN > 0) {\n\t\t\tif (backfaceCulling) return null;\n\t\t\tsign = 1;\n\t\t} else if (DdN < 0) {\n\t\t\tsign = -1;\n\t\t\tDdN = -DdN;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\n\t\t_diff.subVectors(this.origin, a);\n\n\t\tconst DdQxE2 = sign * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); // b1 < 0, no intersection\n\n\t\tif (DdQxE2 < 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot(_edge1.cross(_diff)); // b2 < 0, no intersection\n\n\t\tif (DdE1xQ < 0) {\n\t\t\treturn null;\n\t\t} // b1+b2 > 1, no intersection\n\n\n\t\tif (DdQxE2 + DdE1xQ > DdN) {\n\t\t\treturn null;\n\t\t} // Line intersects triangle, check if ray does.\n\n\n\t\tconst QdN = -sign * _diff.dot(_normal); // t < 0, no intersection\n\n\n\t\tif (QdN < 0) {\n\t\t\treturn null;\n\t\t} // Ray intersects triangle.\n\n\n\t\treturn this.at(QdN / DdN, target);\n\t}\n\n\tapplyMatrix4(matrix4) {\n\t\tthis.origin.applyMatrix4(matrix4);\n\t\tthis.direction.transformDirection(matrix4);\n\t\treturn this;\n\t}\n\n\tequals(ray) {\n\t\treturn ray.origin.equals(this.origin) && ray.direction.equals(this.direction);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _box = /*@__PURE__*/new Box3();\n\nconst _v1$1 = /*@__PURE__*/new Vector3();\n\nconst _toFarthestPoint = /*@__PURE__*/new Vector3();\n\nconst _toPoint = /*@__PURE__*/new Vector3();\n\nclass Sphere {\n\tconstructor(center = new Vector3(), radius = -1) {\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\t}\n\n\tset(center, radius) {\n\t\tthis.center.copy(center);\n\t\tthis.radius = radius;\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points, optionalCenter) {\n\t\tconst center = this.center;\n\n\t\tif (optionalCenter !== undefined) {\n\t\t\tcenter.copy(optionalCenter);\n\t\t} else {\n\t\t\t_box.setFromPoints(points).getCenter(center);\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));\n\t\t}\n\n\t\tthis.radius = Math.sqrt(maxRadiusSq);\n\t\treturn this;\n\t}\n\n\tcopy(sphere) {\n\t\tthis.center.copy(sphere.center);\n\t\tthis.radius = sphere.radius;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\treturn this.radius < 0;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.center.set(0, 0, 0);\n\t\tthis.radius = -1;\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.distanceToSquared(this.center) <= this.radius * this.radius;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn point.distanceTo(this.center) - this.radius;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\tconst radiusSum = this.radius + sphere.radius;\n\t\treturn sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsSphere(this);\n\t}\n\n\tintersectsPlane(plane) {\n\t\treturn Math.abs(plane.distanceToPoint(this.center)) <= this.radius;\n\t}\n\n\tclampPoint(point, target) {\n\t\tconst deltaLengthSq = this.center.distanceToSquared(point);\n\t\ttarget.copy(point);\n\n\t\tif (deltaLengthSq > this.radius * this.radius) {\n\t\t\ttarget.sub(this.center).normalize();\n\t\t\ttarget.multiplyScalar(this.radius).add(this.center);\n\t\t}\n\n\t\treturn target;\n\t}\n\n\tgetBoundingBox(target) {\n\t\tif (this.isEmpty()) {\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\t\t}\n\n\t\ttarget.set(this.center, this.center);\n\t\ttarget.expandByScalar(this.radius);\n\t\treturn target;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.center.applyMatrix4(matrix);\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.center.add(offset);\n\t\treturn this;\n\t}\n\n\texpandByPoint(point) {\n\t\tif (this.isEmpty()) {\n\t\t\tthis.center.copy(point);\n\t\t\tthis.radius = 0;\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671\n\n\n\t\t_toPoint.subVectors(point, this.center);\n\n\t\tconst lengthSq = _toPoint.lengthSq();\n\n\t\tif (lengthSq > this.radius * this.radius) {\n\t\t\tconst length = Math.sqrt(lengthSq);\n\t\t\tconst missingRadiusHalf = (length - this.radius) * 0.5; // Nudge this sphere towards the target point. Add half the missing distance to radius,\n\t\t\t// and the other half to position. This gives a tighter enclosure, instead of if\n\t\t\t// the whole missing distance were just added to radius.\n\n\t\t\tthis.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length));\n\t\t\tthis.radius += missingRadiusHalf;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tunion(sphere) {\n\t\t// handle empty sphere cases\n\t\tif (sphere.isEmpty()) {\n\t\t\treturn;\n\t\t} else if (this.isEmpty()) {\n\t\t\tthis.copy(sphere);\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769\n\t\t// To enclose another sphere into this sphere, we only need to enclose two points:\n\t\t// 1) Enclose the farthest point on the other sphere into this sphere.\n\t\t// 2) Enclose the opposite point of the farthest point into this sphere.\n\n\n\t\tif (this.center.equals(sphere.center) === true) {\n\t\t\t_toFarthestPoint.set(0, 0, 1).multiplyScalar(sphere.radius);\n\t\t} else {\n\t\t\t_toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);\n\t\t}\n\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).add(_toFarthestPoint));\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).sub(_toFarthestPoint));\n\t\treturn this;\n\t}\n\n\tequals(sphere) {\n\t\treturn sphere.center.equals(this.center) && sphere.radius === this.radius;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\r\n *\r\n * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\r\n * The azimuthal angle (theta) is measured from the positive z-axis.\r\n */\n\nclass Spherical {\n\tconstructor(radius = 1, phi = 0, theta = 0) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi; // polar angle\n\n\t\tthis.theta = theta; // azimuthal angle\n\n\t\treturn this;\n\t}\n\n\tset(radius, phi, theta) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\t\treturn this;\n\t} // restrict phi to be between EPS and PI-EPS\n\n\n\tmakeSafe() {\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi));\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + y * y + z * z);\n\n\t\tif (this.radius === 0) {\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\t\t} else {\n\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\tthis.phi = Math.acos(clamp(y / this.radius, -1, 1));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/new Vector3();\n\nconst _v1 = /*@__PURE__*/new Vector3();\n\nconst _v2 = /*@__PURE__*/new Vector3();\n\nconst _v3 = /*@__PURE__*/new Vector3();\n\nconst _vab = /*@__PURE__*/new Vector3();\n\nconst _vac = /*@__PURE__*/new Vector3();\n\nconst _vbc = /*@__PURE__*/new Vector3();\n\nconst _vap = /*@__PURE__*/new Vector3();\n\nconst _vbp = /*@__PURE__*/new Vector3();\n\nconst _vcp = /*@__PURE__*/new Vector3();\n\nclass Triangle {\n\tconstructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\t}\n\n\tstatic getNormal(a, b, c, target) {\n\t\ttarget.subVectors(c, b);\n\n\t\t_v0.subVectors(a, b);\n\n\t\ttarget.cross(_v0);\n\t\tconst targetLengthSq = target.lengthSq();\n\n\t\tif (targetLengthSq > 0) {\n\t\t\treturn target.multiplyScalar(1 / Math.sqrt(targetLengthSq));\n\t\t}\n\n\t\treturn target.set(0, 0, 0);\n\t} // static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\n\tstatic getBarycoord(point, a, b, c, target) {\n\t\t_v0.subVectors(c, a);\n\n\t\t_v1.subVectors(b, a);\n\n\t\t_v2.subVectors(point, a);\n\n\t\tconst dot00 = _v0.dot(_v0);\n\n\t\tconst dot01 = _v0.dot(_v1);\n\n\t\tconst dot02 = _v0.dot(_v2);\n\n\t\tconst dot11 = _v1.dot(_v1);\n\n\t\tconst dot12 = _v1.dot(_v2);\n\n\t\tconst denom = dot00 * dot11 - dot01 * dot01; // collinear or singular triangle\n\n\t\tif (denom === 0) {\n\t\t\t// arbitrary location outside of triangle?\n\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\treturn target.set(-2, -1, -1);\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n\t\tconst v = (dot00 * dot12 - dot01 * dot02) * invDenom; // barycentric coordinates must always sum to 1\n\n\t\treturn target.set(1 - u - v, v, u);\n\t}\n\n\tstatic containsPoint(point, a, b, c) {\n\t\tthis.getBarycoord(point, a, b, c, _v3);\n\t\treturn _v3.x >= 0 && _v3.y >= 0 && _v3.x + _v3.y <= 1;\n\t}\n\n\tstatic getUV(point, p1, p2, p3, uv1, uv2, uv3, target) {\n\t\tthis.getBarycoord(point, p1, p2, p3, _v3);\n\t\ttarget.set(0, 0);\n\t\ttarget.addScaledVector(uv1, _v3.x);\n\t\ttarget.addScaledVector(uv2, _v3.y);\n\t\ttarget.addScaledVector(uv3, _v3.z);\n\t\treturn target;\n\t}\n\n\tstatic isFrontFacing(a, b, c, direction) {\n\t\t_v0.subVectors(c, b);\n\n\t\t_v1.subVectors(a, b); // strictly front facing\n\n\n\t\treturn _v0.cross(_v1).dot(direction) < 0 ? true : false;\n\t}\n\n\tset(a, b, c) {\n\t\tthis.a.copy(a);\n\t\tthis.b.copy(b);\n\t\tthis.c.copy(c);\n\t\treturn this;\n\t}\n\n\tsetFromPointsAndIndices(points, i0, i1, i2) {\n\t\tthis.a.copy(points[i0]);\n\t\tthis.b.copy(points[i1]);\n\t\tthis.c.copy(points[i2]);\n\t\treturn this;\n\t} // setFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\t// \tthis.a.fromBufferAttribute( attribute, i0 );\n\t// \tthis.b.fromBufferAttribute( attribute, i1 );\n\t// \tthis.c.fromBufferAttribute( attribute, i2 );\n\t// \treturn this;\n\t// }\n\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(triangle) {\n\t\tthis.a.copy(triangle.a);\n\t\tthis.b.copy(triangle.b);\n\t\tthis.c.copy(triangle.c);\n\t\treturn this;\n\t}\n\n\tgetArea() {\n\t\t_v0.subVectors(this.c, this.b);\n\n\t\t_v1.subVectors(this.a, this.b);\n\n\t\treturn _v0.cross(_v1).length() * 0.5;\n\t}\n\n\tgetMidpoint(target) {\n\t\treturn target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n\t}\n\n\tgetNormal(target) {\n\t\treturn Triangle.getNormal(this.a, this.b, this.c, target);\n\t}\n\n\tgetPlane(target) {\n\t\treturn target.setFromCoplanarPoints(this.a, this.b, this.c);\n\t}\n\n\tgetBarycoord(point, target) {\n\t\treturn Triangle.getBarycoord(point, this.a, this.b, this.c, target);\n\t}\n\n\tgetUV(point, uv1, uv2, uv3, target) {\n\t\treturn Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target);\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn Triangle.containsPoint(point, this.a, this.b, this.c);\n\t}\n\n\tisFrontFacing(direction) {\n\t\treturn Triangle.isFrontFacing(this.a, this.b, this.c, direction);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsTriangle(this);\n\t}\n\n\tclosestPointToPoint(p, target) {\n\t\tconst a = this.a,\n\t\t\t\t\tb = this.b,\n\t\t\t\t\tc = this.c;\n\t\tlet v, w; // algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors(b, a);\n\n\t\t_vac.subVectors(c, a);\n\n\t\t_vap.subVectors(p, a);\n\n\t\tconst d1 = _vab.dot(_vap);\n\n\t\tconst d2 = _vac.dot(_vap);\n\n\t\tif (d1 <= 0 && d2 <= 0) {\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy(a);\n\t\t}\n\n\t\t_vbp.subVectors(p, b);\n\n\t\tconst d3 = _vab.dot(_vbp);\n\n\t\tconst d4 = _vac.dot(_vbp);\n\n\t\tif (d3 >= 0 && d4 <= d3) {\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy(b);\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\n\t\tif (vc <= 0 && d1 >= 0 && d3 <= 0) {\n\t\t\tv = d1 / (d1 - d3); // edge region of AB; barycentric coords (1-v, v, 0)\n\n\t\t\treturn target.copy(a).addScaledVector(_vab, v);\n\t\t}\n\n\t\t_vcp.subVectors(p, c);\n\n\t\tconst d5 = _vab.dot(_vcp);\n\n\t\tconst d6 = _vac.dot(_vcp);\n\n\t\tif (d6 >= 0 && d5 <= d6) {\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy(c);\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\n\t\tif (vb <= 0 && d2 >= 0 && d6 <= 0) {\n\t\t\tw = d2 / (d2 - d6); // edge region of AC; barycentric coords (1-w, 0, w)\n\n\t\t\treturn target.copy(a).addScaledVector(_vac, w);\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\n\t\tif (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {\n\t\t\t_vbc.subVectors(c, b);\n\n\t\t\tw = (d4 - d3) / (d4 - d3 + (d5 - d6)); // edge region of BC; barycentric coords (0, 1-w, w)\n\n\t\t\treturn target.copy(b).addScaledVector(_vbc, w); // edge region of BC\n\t\t} // face region\n\n\n\t\tconst denom = 1 / (va + vb + vc); // u = va * denom\n\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\t\treturn target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w);\n\t}\n\n\tequals(triangle) {\n\t\treturn triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);\n\t}\n\n}\n\nclass Vector4 {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tVector4.prototype.isVector4 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t}\n\n\tget width() {\n\t\treturn this.z;\n\t}\n\n\tset width(value) {\n\t\tthis.z = value;\n\t}\n\n\tget height() {\n\t\treturn this.w;\n\t}\n\n\tset height(value) {\n\t\tthis.w = value;\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetW(w) {\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tthis.w = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tcase 3:\n\t\t\t\treturn this.w;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z, this.w);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = v.w !== undefined ? v.w : 1;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z,\n\t\t\t\t\tw = this.w;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w;\n\t\tthis.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tsetAxisAngleFromQuaternion(q) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\t\t// q is assumed to be normalized\n\t\tthis.w = 2 * Math.acos(q.w);\n\t\tconst s = Math.sqrt(1 - q.w * q.w);\n\n\t\tif (s < 0.0001) {\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\t\t} else {\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetAxisAngleFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tlet angle, x, y, z; // variables for result\n\n\t\tconst epsilon = 0.01,\n\t\t\t\t\t// margin to allow for rounding errors\n\t\tepsilon2 = 0.1,\n\t\t\t\t\t// margin to distinguish between 0 and 180 degrees\n\t\tte = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tif (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\t\t\tif (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\t\t\t\tthis.set(1, 0, 0, 0);\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\t\t\t} // otherwise this singularity is angle = 180\n\n\n\t\t\tangle = Math.PI;\n\t\t\tconst xx = (m11 + 1) / 2;\n\t\t\tconst yy = (m22 + 1) / 2;\n\t\t\tconst zz = (m33 + 1) / 2;\n\t\t\tconst xy = (m12 + m21) / 4;\n\t\t\tconst xz = (m13 + m31) / 4;\n\t\t\tconst yz = (m23 + m32) / 4;\n\n\t\t\tif (xx > yy && xx > zz) {\n\t\t\t\t// m11 is the largest diagonal term\n\t\t\t\tif (xx < epsilon) {\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\tx = Math.sqrt(xx);\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\t\t\t\t}\n\t\t\t} else if (yy > zz) {\n\t\t\t\t// m22 is the largest diagonal term\n\t\t\t\tif (yy < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\ty = Math.sqrt(yy);\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\t\t\t\tif (zz < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\t\t\t\t} else {\n\t\t\t\t\tz = Math.sqrt(zz);\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.set(x, y, z, angle);\n\t\t\treturn this; // return 180 deg rotation\n\t\t} // as we have reached here there are no singularities so we can handle normally\n\n\n\t\tlet s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); // used to normalize\n\n\t\tif (Math.abs(s) < 0.001) s = 1; // prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = (m32 - m23) / s;\n\t\tthis.y = (m13 - m31) / s;\n\t\tthis.z = (m21 - m12) / s;\n\t\tthis.w = Math.acos((m11 + m22 + m33 - 1) / 2);\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\tthis.w = Math.min(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\tthis.w = Math.max(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\tthis.w = Math.max(min.w, Math.min(max.w, this.w));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\tthis.w = Math.max(minVal, Math.min(maxVal, this.w));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\tthis.w = Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\tthis.w = Math.ceil(this.w);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\tthis.w = Math.round(this.w);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\tthis.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\tthis.w = -this.w;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\tthis.w += (v.w - this.w) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\tthis.w = v1.w + (v2.w - v1.w) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\tthis.w = array[offset + 3];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\tarray[offset + 3] = this.w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \tthis.w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\t}\n\n}\n\nexports.ACESFilmicToneMapping = ACESFilmicToneMapping;\nexports.AddEquation = AddEquation;\nexports.AddOperation = AddOperation;\nexports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;\nexports.AdditiveBlending = AdditiveBlending;\nexports.AlphaFormat = AlphaFormat;\nexports.AlwaysDepth = AlwaysDepth;\nexports.AlwaysStencilFunc = AlwaysStencilFunc;\nexports.BackSide = BackSide;\nexports.BasicDepthPacking = BasicDepthPacking;\nexports.BasicShadowMap = BasicShadowMap;\nexports.Box2 = Box2;\nexports.Box3 = Box3;\nexports.ByteType = ByteType;\nexports.CineonToneMapping = CineonToneMapping;\nexports.ClampToEdgeWrapping = ClampToEdgeWrapping;\nexports.Color = Color;\nexports.ColorManagement = ColorManagement;\nexports.CubeReflectionMapping = CubeReflectionMapping;\nexports.CubeRefractionMapping = CubeRefractionMapping;\nexports.CubeUVReflectionMapping = CubeUVReflectionMapping;\nexports.CullFaceBack = CullFaceBack;\nexports.CullFaceFront = CullFaceFront;\nexports.CullFaceFrontBack = CullFaceFrontBack;\nexports.CullFaceNone = CullFaceNone;\nexports.CustomBlending = CustomBlending;\nexports.CustomToneMapping = CustomToneMapping;\nexports.Cylindrical = Cylindrical;\nexports.DecrementStencilOp = DecrementStencilOp;\nexports.DecrementWrapStencilOp = DecrementWrapStencilOp;\nexports.DepthFormat = DepthFormat;\nexports.DepthStencilFormat = DepthStencilFormat;\nexports.DoubleSide = DoubleSide;\nexports.DstAlphaFactor = DstAlphaFactor;\nexports.DstColorFactor = DstColorFactor;\nexports.DynamicCopyUsage = DynamicCopyUsage;\nexports.DynamicDrawUsage = DynamicDrawUsage;\nexports.DynamicReadUsage = DynamicReadUsage;\nexports.EqualDepth = EqualDepth;\nexports.EqualStencilFunc = EqualStencilFunc;\nexports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;\nexports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;\nexports.Euler = Euler;\nexports.FloatType = FloatType;\nexports.FrontSide = FrontSide;\nexports.GLSL1 = GLSL1;\nexports.GLSL3 = GLSL3;\nexports.GreaterDepth = GreaterDepth;\nexports.GreaterEqualDepth = GreaterEqualDepth;\nexports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;\nexports.GreaterStencilFunc = GreaterStencilFunc;\nexports.HalfFloatType = HalfFloatType;\nexports.IncrementStencilOp = IncrementStencilOp;\nexports.IncrementWrapStencilOp = IncrementWrapStencilOp;\nexports.IntType = IntType;\nexports.Interpolant = Interpolant;\nexports.InterpolateDiscrete = InterpolateDiscrete;\nexports.InterpolateLinear = InterpolateLinear;\nexports.InterpolateSmooth = InterpolateSmooth;\nexports.InvertStencilOp = InvertStencilOp;\nexports.KeepStencilOp = KeepStencilOp;\nexports.LessDepth = LessDepth;\nexports.LessEqualDepth = LessEqualDepth;\nexports.LessEqualStencilFunc = LessEqualStencilFunc;\nexports.LessStencilFunc = LessStencilFunc;\nexports.Line3 = Line3;\nexports.LinearEncoding = LinearEncoding;\nexports.LinearFilter = LinearFilter;\nexports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;\nexports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;\nexports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;\nexports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;\nexports.LinearSRGBColorSpace = LinearSRGBColorSpace;\nexports.LinearToSRGB = LinearToSRGB;\nexports.LinearToneMapping = LinearToneMapping;\nexports.LoopOnce = LoopOnce;\nexports.LoopPingPong = LoopPingPong;\nexports.LoopRepeat = LoopRepeat;\nexports.LuminanceAlphaFormat = LuminanceAlphaFormat;\nexports.LuminanceFormat = LuminanceFormat;\nexports.MOUSE = MOUSE;\nexports.MathUtils = MathUtils;\nexports.Matrix3 = Matrix3;\nexports.Matrix4 = Matrix4;\nexports.MaxEquation = MaxEquation;\nexports.MinEquation = MinEquation;\nexports.MirroredRepeatWrapping = MirroredRepeatWrapping;\nexports.MixOperation = MixOperation;\nexports.MultiplyBlending = MultiplyBlending;\nexports.MultiplyOperation = MultiplyOperation;\nexports.NearestFilter = NearestFilter;\nexports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;\nexports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;\nexports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;\nexports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;\nexports.NeverDepth = NeverDepth;\nexports.NeverStencilFunc = NeverStencilFunc;\nexports.NoBlending = NoBlending;\nexports.NoColorSpace = NoColorSpace;\nexports.NoToneMapping = NoToneMapping;\nexports.NormalAnimationBlendMode = NormalAnimationBlendMode;\nexports.NormalBlending = NormalBlending;\nexports.NotEqualDepth = NotEqualDepth;\nexports.NotEqualStencilFunc = NotEqualStencilFunc;\nexports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;\nexports.OneFactor = OneFactor;\nexports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;\nexports.OneMinusDstColorFactor = OneMinusDstColorFactor;\nexports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;\nexports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;\nexports.PCFShadowMap = PCFShadowMap;\nexports.PCFSoftShadowMap = PCFSoftShadowMap;\nexports.Plane = Plane;\nexports.Quaternion = Quaternion;\nexports.REVISION = REVISION;\nexports.RGBADepthPacking = RGBADepthPacking;\nexports.RGBAFormat = RGBAFormat;\nexports.RGBAIntegerFormat = RGBAIntegerFormat;\nexports.RGBA_ASTC_10x10_Format = RGBA_ASTC_10x10_Format;\nexports.RGBA_ASTC_10x5_Format = RGBA_ASTC_10x5_Format;\nexports.RGBA_ASTC_10x6_Format = RGBA_ASTC_10x6_Format;\nexports.RGBA_ASTC_10x8_Format = RGBA_ASTC_10x8_Format;\nexports.RGBA_ASTC_12x10_Format = RGBA_ASTC_12x10_Format;\nexports.RGBA_ASTC_12x12_Format = RGBA_ASTC_12x12_Format;\nexports.RGBA_ASTC_4x4_Format = RGBA_ASTC_4x4_Format;\nexports.RGBA_ASTC_5x4_Format = RGBA_ASTC_5x4_Format;\nexports.RGBA_ASTC_5x5_Format = RGBA_ASTC_5x5_Format;\nexports.RGBA_ASTC_6x5_Format = RGBA_ASTC_6x5_Format;\nexports.RGBA_ASTC_6x6_Format = RGBA_ASTC_6x6_Format;\nexports.RGBA_ASTC_8x5_Format = RGBA_ASTC_8x5_Format;\nexports.RGBA_ASTC_8x6_Format = RGBA_ASTC_8x6_Format;\nexports.RGBA_ASTC_8x8_Format = RGBA_ASTC_8x8_Format;\nexports.RGBA_BPTC_Format = RGBA_BPTC_Format;\nexports.RGBA_ETC2_EAC_Format = RGBA_ETC2_EAC_Format;\nexports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format;\nexports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format;\nexports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;\nexports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;\nexports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;\nexports.RGBFormat = RGBFormat;\nexports.RGB_ETC1_Format = RGB_ETC1_Format;\nexports.RGB_ETC2_Format = RGB_ETC2_Format;\nexports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;\nexports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format;\nexports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format;\nexports.RGFormat = RGFormat;\nexports.RGIntegerFormat = RGIntegerFormat;\nexports.Ray = Ray;\nexports.RedFormat = RedFormat;\nexports.RedIntegerFormat = RedIntegerFormat;\nexports.ReinhardToneMapping = ReinhardToneMapping;\nexports.RepeatWrapping = RepeatWrapping;\nexports.ReplaceStencilOp = ReplaceStencilOp;\nexports.ReverseSubtractEquation = ReverseSubtractEquation;\nexports.SRGBColorSpace = SRGBColorSpace;\nexports.SRGBToLinear = SRGBToLinear;\nexports.ShortType = ShortType;\nexports.Sphere = Sphere;\nexports.Spherical = Spherical;\nexports.SrcAlphaFactor = SrcAlphaFactor;\nexports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;\nexports.SrcColorFactor = SrcColorFactor;\nexports.StaticCopyUsage = StaticCopyUsage;\nexports.StaticDrawUsage = StaticDrawUsage;\nexports.StaticReadUsage = StaticReadUsage;\nexports.StreamCopyUsage = StreamCopyUsage;\nexports.StreamDrawUsage = StreamDrawUsage;\nexports.StreamReadUsage = StreamReadUsage;\nexports.SubtractEquation = SubtractEquation;\nexports.SubtractiveBlending = SubtractiveBlending;\nexports.TOUCH = TOUCH;\nexports.TangentSpaceNormalMap = TangentSpaceNormalMap;\nexports.Triangle = Triangle;\nexports.TriangleFanDrawMode = TriangleFanDrawMode;\nexports.TriangleStripDrawMode = TriangleStripDrawMode;\nexports.TrianglesDrawMode = TrianglesDrawMode;\nexports.UVMapping = UVMapping;\nexports.UnsignedByteType = UnsignedByteType;\nexports.UnsignedInt248Type = UnsignedInt248Type;\nexports.UnsignedIntType = UnsignedIntType;\nexports.UnsignedShort4444Type = UnsignedShort4444Type;\nexports.UnsignedShort5551Type = UnsignedShort5551Type;\nexports.UnsignedShortType = UnsignedShortType;\nexports.VSMShadowMap = VSMShadowMap;\nexports.Vector2 = Vector2;\nexports.Vector3 = Vector3;\nexports.Vector4 = Vector4;\nexports.WrapAroundEnding = WrapAroundEnding;\nexports.ZeroCurvatureEnding = ZeroCurvatureEnding;\nexports.ZeroFactor = ZeroFactor;\nexports.ZeroSlopeEnding = ZeroSlopeEnding;\nexports.ZeroStencilOp = ZeroStencilOp;\nexports._SRGBAFormat = _SRGBAFormat;\nexports.sRGBEncoding = sRGBEncoding;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/threejs-math/build/threejs-math.cjs?")}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(t){var n=__webpack_module_cache__[t];if(void 0!==n)return n.exports;var e=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(e.exports,e,e.exports,__webpack_require__),e.exports}getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var e=Object.create(null);__webpack_require__.r(e);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&n&&t;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((n=>r[n]=()=>t[n]));return r.default=()=>t,__webpack_require__.d(e,r),e},__webpack_require__.d=(t,n)=>{for(var e in n)__webpack_require__.o(n,e)&&!__webpack_require__.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/index.ts");return __webpack_exports__})()));
\ No newline at end of file
diff --git a/dist-var/manifesto.js b/dist-var/manifesto.js
index 68668680..642d524c 100644
--- a/dist-var/manifesto.js
+++ b/dist-var/manifesto.js
@@ -1,2 +1,2 @@
/*! For license information please see manifesto.js.LICENSE.txt */
-var manifesto;(()=>{var __webpack_modules__={"./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\r\nObject.defineProperty(exports, "__esModule", ({ value: true }));\r\nexports.CONTINUE = 100;\r\nexports.SWITCHING_PROTOCOLS = 101;\r\nexports.PROCESSING = 102;\r\nexports.OK = 200;\r\nexports.CREATED = 201;\r\nexports.ACCEPTED = 202;\r\nexports.NON_AUTHORITATIVE_INFORMATION = 203;\r\nexports.NO_CONTENT = 204;\r\nexports.RESET_CONTENT = 205;\r\nexports.PARTIAL_CONTENT = 206;\r\nexports.MULTI_STATUS = 207;\r\nexports.MULTIPLE_CHOICES = 300;\r\nexports.MOVED_PERMANENTLY = 301;\r\nexports.MOVED_TEMPORARILY = 302;\r\nexports.SEE_OTHER = 303;\r\nexports.NOT_MODIFIED = 304;\r\nexports.USE_PROXY = 305;\r\nexports.TEMPORARY_REDIRECT = 307;\r\nexports.BAD_REQUEST = 400;\r\nexports.UNAUTHORIZED = 401;\r\nexports.PAYMENT_REQUIRED = 402;\r\nexports.FORBIDDEN = 403;\r\nexports.NOT_FOUND = 404;\r\nexports.METHOD_NOT_ALLOWED = 405;\r\nexports.NOT_ACCEPTABLE = 406;\r\nexports.PROXY_AUTHENTICATION_REQUIRED = 407;\r\nexports.REQUEST_TIME_OUT = 408;\r\nexports.CONFLICT = 409;\r\nexports.GONE = 410;\r\nexports.LENGTH_REQUIRED = 411;\r\nexports.PRECONDITION_FAILED = 412;\r\nexports.REQUEST_ENTITY_TOO_LARGE = 413;\r\nexports.REQUEST_URI_TOO_LARGE = 414;\r\nexports.UNSUPPORTED_MEDIA_TYPE = 415;\r\nexports.REQUESTED_RANGE_NOT_SATISFIABLE = 416;\r\nexports.EXPECTATION_FAILED = 417;\r\nexports.IM_A_TEAPOT = 418;\r\nexports.UNPROCESSABLE_ENTITY = 422;\r\nexports.LOCKED = 423;\r\nexports.FAILED_DEPENDENCY = 424;\r\nexports.UNORDERED_COLLECTION = 425;\r\nexports.UPGRADE_REQUIRED = 426;\r\nexports.PRECONDITION_REQUIRED = 428;\r\nexports.TOO_MANY_REQUESTS = 429;\r\nexports.REQUEST_HEADER_FIELDS_TOO_LARGE = 431;\r\nexports.INTERNAL_SERVER_ERROR = 500;\r\nexports.NOT_IMPLEMENTED = 501;\r\nexports.BAD_GATEWAY = 502;\r\nexports.SERVICE_UNAVAILABLE = 503;\r\nexports.GATEWAY_TIME_OUT = 504;\r\nexports.HTTP_VERSION_NOT_SUPPORTED = 505;\r\nexports.VARIANT_ALSO_NEGOTIATES = 506;\r\nexports.INSUFFICIENT_STORAGE = 507;\r\nexports.BANDWIDTH_LIMIT_EXCEEDED = 509;\r\nexports.NOT_EXTENDED = 510;\r\nexports.NETWORK_AUTHENTICATION_REQUIRED = 511;\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js?')},"./node_modules/@iiif/vocabulary/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar AnnotationMotivation;\n(function (AnnotationMotivation) {\n AnnotationMotivation["BOOKMARKING"] = "oa:bookmarking";\n AnnotationMotivation["CLASSIFYING"] = "oa:classifying";\n AnnotationMotivation["COMMENTING"] = "oa:commenting";\n AnnotationMotivation["DESCRIBING"] = "oa:describing";\n AnnotationMotivation["EDITING"] = "oa:editing";\n AnnotationMotivation["HIGHLIGHTING"] = "oa:highlighting";\n AnnotationMotivation["IDENTIFYING"] = "oa:identifying";\n AnnotationMotivation["LINKING"] = "oa:linking";\n AnnotationMotivation["MODERATING"] = "oa:moderating";\n AnnotationMotivation["PAINTING"] = "sc:painting";\n AnnotationMotivation["QUESTIONING"] = "oa:questioning";\n AnnotationMotivation["REPLYING"] = "oa:replying";\n AnnotationMotivation["TAGGING"] = "oa:tagging";\n AnnotationMotivation["TRANSCRIBING"] = "oad:transcribing";\n})(AnnotationMotivation = exports.AnnotationMotivation || (exports.AnnotationMotivation = {}));\nvar Behavior;\n(function (Behavior) {\n Behavior["AUTO_ADVANCE"] = "auto-advance";\n Behavior["CONTINUOUS"] = "continuous";\n Behavior["FACING_PAGES"] = "facing-pages";\n Behavior["HIDDEN"] = "hidden";\n Behavior["INDIVIDUALS"] = "individuals";\n Behavior["MULTI_PART"] = "multi-part";\n Behavior["NO_NAV"] = "no-nav";\n Behavior["NON_PAGED"] = "non-paged";\n Behavior["PAGED"] = "paged";\n Behavior["REPEAT"] = "repeat";\n Behavior["SEQUENCE"] = "sequence";\n Behavior["THUMBNAIL_NAV"] = "thumbnail-nav";\n Behavior["TOGETHER"] = "together";\n Behavior["UNORDERED"] = "unordered";\n})(Behavior = exports.Behavior || (exports.Behavior = {}));\nvar ExternalResourceType;\n(function (ExternalResourceType) {\n ExternalResourceType["CANVAS"] = "canvas";\n ExternalResourceType["CHOICE"] = "choice";\n ExternalResourceType["OA_CHOICE"] = "oa:choice";\n ExternalResourceType["CONTENT_AS_TEXT"] = "contentastext";\n ExternalResourceType["DATASET"] = "dataset";\n ExternalResourceType["DOCUMENT"] = "document";\n ExternalResourceType["IMAGE"] = "image";\n ExternalResourceType["MODEL"] = "model";\n ExternalResourceType["MOVING_IMAGE"] = "movingimage";\n ExternalResourceType["PDF"] = "pdf";\n ExternalResourceType["PHYSICAL_OBJECT"] = "physicalobject";\n ExternalResourceType["SOUND"] = "sound";\n ExternalResourceType["TEXT"] = "text";\n ExternalResourceType["TEXTUALBODY"] = "textualbody";\n ExternalResourceType["VIDEO"] = "video";\n})(ExternalResourceType = exports.ExternalResourceType || (exports.ExternalResourceType = {}));\nvar IIIFResourceType;\n(function (IIIFResourceType) {\n IIIFResourceType["ANNOTATION"] = "annotation";\n IIIFResourceType["CANVAS"] = "canvas";\n IIIFResourceType["COLLECTION"] = "collection";\n IIIFResourceType["MANIFEST"] = "manifest";\n IIIFResourceType["RANGE"] = "range";\n IIIFResourceType["SEQUENCE"] = "sequence";\n})(IIIFResourceType = exports.IIIFResourceType || (exports.IIIFResourceType = {}));\nvar MediaType;\n(function (MediaType) {\n MediaType["AUDIO_MP4"] = "audio/mp4";\n MediaType["CORTO"] = "application/corto";\n MediaType["DICOM"] = "application/dicom";\n MediaType["DRACO"] = "application/draco";\n MediaType["EPUB"] = "application/epub+zip";\n MediaType["GIRDER"] = "image/vnd.kitware.girder";\n MediaType["GLB"] = "model/gltf-binary";\n MediaType["GLTF"] = "model/gltf+json";\n MediaType["IIIF_PRESENTATION_2"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/2/context.json\\"";\n MediaType["IIIF_PRESENTATION_3"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/3/context.json\\"";\n MediaType["JPG"] = "image/jpeg";\n MediaType["M3U8"] = "application/vnd.apple.mpegurl";\n MediaType["MP3"] = "audio/mp3";\n MediaType["MPEG_DASH"] = "application/dash+xml";\n MediaType["OBJ"] = "text/plain";\n MediaType["OPF"] = "application/oebps-package+xml";\n MediaType["PDF"] = "application/pdf";\n MediaType["PLY"] = "application/ply";\n MediaType["THREEJS"] = "application/vnd.threejs+json";\n MediaType["USDZ"] = "model/vnd.usd+zip";\n MediaType["VIDEO_MP4"] = "video/mp4";\n MediaType["WAV"] = "audio/wav";\n MediaType["WEBM"] = "video/webm";\n})(MediaType = exports.MediaType || (exports.MediaType = {}));\nvar RenderingFormat;\n(function (RenderingFormat) {\n RenderingFormat["DOC"] = "application/msword";\n RenderingFormat["DOCX"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";\n RenderingFormat["PDF"] = "application/pdf";\n})(RenderingFormat = exports.RenderingFormat || (exports.RenderingFormat = {}));\nvar ServiceProfile;\n(function (ServiceProfile) {\n // image api\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level0";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level1";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level2";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level0";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level1";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level2";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2";\n ServiceProfile["IMAGE_1_LEVEL_0"] = "http://iiif.io/api/image/1/level0.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/1/profiles/level0.json";\n ServiceProfile["IMAGE_1_LEVEL_1"] = "http://iiif.io/api/image/1/level1.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/1/profiles/level1.json";\n ServiceProfile["IMAGE_1_LEVEL_2"] = "http://iiif.io/api/image/1/level2.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/1/profiles/level2.json";\n ServiceProfile["IMAGE_2_LEVEL_0"] = "http://iiif.io/api/image/2/level0.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/2/profiles/level0.json";\n ServiceProfile["IMAGE_2_LEVEL_1"] = "http://iiif.io/api/image/2/level1.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/2/profiles/level1.json";\n ServiceProfile["IMAGE_2_LEVEL_2"] = "http://iiif.io/api/image/2/level2.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/2/profiles/level2.json";\n // auth api\n ServiceProfile["AUTH_0_CLICK_THROUGH"] = "http://iiif.io/api/auth/0/login/clickthrough";\n ServiceProfile["AUTH_0_LOGIN"] = "http://iiif.io/api/auth/0/login";\n ServiceProfile["AUTH_0_LOGOUT"] = "http://iiif.io/api/auth/0/logout";\n ServiceProfile["AUTH_0_RESTRICTED"] = "http://iiif.io/api/auth/0/login/restricted";\n ServiceProfile["AUTH_0_TOKEN"] = "http://iiif.io/api/auth/0/token";\n ServiceProfile["AUTH_1_CLICK_THROUGH"] = "http://iiif.io/api/auth/1/clickthrough";\n ServiceProfile["AUTH_1_EXTERNAL"] = "http://iiif.io/api/auth/1/external";\n ServiceProfile["AUTH_1_KIOSK"] = "http://iiif.io/api/auth/1/kiosk";\n ServiceProfile["AUTH_1_LOGIN"] = "http://iiif.io/api/auth/1/login";\n ServiceProfile["AUTH_1_LOGOUT"] = "http://iiif.io/api/auth/1/logout";\n ServiceProfile["AUTH_1_PROBE"] = "http://iiif.io/api/auth/1/probe";\n ServiceProfile["AUTH_1_TOKEN"] = "http://iiif.io/api/auth/1/token";\n // search api\n ServiceProfile["SEARCH_0"] = "http://iiif.io/api/search/0/search";\n ServiceProfile["SEARCH_0_AUTO_COMPLETE"] = "http://iiif.io/api/search/0/autocomplete";\n ServiceProfile["SEARCH_1"] = "http://iiif.io/api/search/1/search";\n ServiceProfile["SEARCH_1_AUTO_COMPLETE"] = "http://iiif.io/api/search/1/autocomplete";\n // extensions\n ServiceProfile["TRACKING_EXTENSIONS"] = "http://universalviewer.io/tracking-extensions-profile";\n ServiceProfile["UI_EXTENSIONS"] = "http://universalviewer.io/ui-extensions-profile";\n ServiceProfile["PRINT_EXTENSIONS"] = "http://universalviewer.io/print-extensions-profile";\n ServiceProfile["SHARE_EXTENSIONS"] = "http://universalviewer.io/share-extensions-profile";\n ServiceProfile["DOWNLOAD_EXTENSIONS"] = "http://universalviewer.io/download-extensions-profile";\n // other\n ServiceProfile["OTHER_MANIFESTATIONS"] = "http://iiif.io/api/otherManifestations.json";\n ServiceProfile["IXIF"] = "http://wellcomelibrary.org/ld/ixif/0/alpha.json";\n})(ServiceProfile = exports.ServiceProfile || (exports.ServiceProfile = {}));\nvar ServiceType;\n(function (ServiceType) {\n ServiceType["IMAGE_SERVICE_2"] = "ImageService2";\n ServiceType["IMAGE_SERVICE_3"] = "ImageService3";\n})(ServiceType = exports.ServiceType || (exports.ServiceType = {}));\nvar ViewingDirection;\n(function (ViewingDirection) {\n ViewingDirection["BOTTOM_TO_TOP"] = "bottom-to-top";\n ViewingDirection["LEFT_TO_RIGHT"] = "left-to-right";\n ViewingDirection["RIGHT_TO_LEFT"] = "right-to-left";\n ViewingDirection["TOP_TO_BOTTOM"] = "top-to-bottom";\n})(ViewingDirection = exports.ViewingDirection || (exports.ViewingDirection = {}));\nvar ViewingHint;\n(function (ViewingHint) {\n ViewingHint["CONTINUOUS"] = "continuous";\n ViewingHint["INDIVIDUALS"] = "individuals";\n ViewingHint["NON_PAGED"] = "non-paged";\n ViewingHint["PAGED"] = "paged";\n ViewingHint["TOP"] = "top";\n})(ViewingHint = exports.ViewingHint || (exports.ViewingHint = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@iiif/vocabulary/dist-commonjs/index.js?')},"./node_modules/color-name/index.js":module=>{"use strict";eval('\r\n\r\nmodule.exports = {\r\n\t"aliceblue": [240, 248, 255],\r\n\t"antiquewhite": [250, 235, 215],\r\n\t"aqua": [0, 255, 255],\r\n\t"aquamarine": [127, 255, 212],\r\n\t"azure": [240, 255, 255],\r\n\t"beige": [245, 245, 220],\r\n\t"bisque": [255, 228, 196],\r\n\t"black": [0, 0, 0],\r\n\t"blanchedalmond": [255, 235, 205],\r\n\t"blue": [0, 0, 255],\r\n\t"blueviolet": [138, 43, 226],\r\n\t"brown": [165, 42, 42],\r\n\t"burlywood": [222, 184, 135],\r\n\t"cadetblue": [95, 158, 160],\r\n\t"chartreuse": [127, 255, 0],\r\n\t"chocolate": [210, 105, 30],\r\n\t"coral": [255, 127, 80],\r\n\t"cornflowerblue": [100, 149, 237],\r\n\t"cornsilk": [255, 248, 220],\r\n\t"crimson": [220, 20, 60],\r\n\t"cyan": [0, 255, 255],\r\n\t"darkblue": [0, 0, 139],\r\n\t"darkcyan": [0, 139, 139],\r\n\t"darkgoldenrod": [184, 134, 11],\r\n\t"darkgray": [169, 169, 169],\r\n\t"darkgreen": [0, 100, 0],\r\n\t"darkgrey": [169, 169, 169],\r\n\t"darkkhaki": [189, 183, 107],\r\n\t"darkmagenta": [139, 0, 139],\r\n\t"darkolivegreen": [85, 107, 47],\r\n\t"darkorange": [255, 140, 0],\r\n\t"darkorchid": [153, 50, 204],\r\n\t"darkred": [139, 0, 0],\r\n\t"darksalmon": [233, 150, 122],\r\n\t"darkseagreen": [143, 188, 143],\r\n\t"darkslateblue": [72, 61, 139],\r\n\t"darkslategray": [47, 79, 79],\r\n\t"darkslategrey": [47, 79, 79],\r\n\t"darkturquoise": [0, 206, 209],\r\n\t"darkviolet": [148, 0, 211],\r\n\t"deeppink": [255, 20, 147],\r\n\t"deepskyblue": [0, 191, 255],\r\n\t"dimgray": [105, 105, 105],\r\n\t"dimgrey": [105, 105, 105],\r\n\t"dodgerblue": [30, 144, 255],\r\n\t"firebrick": [178, 34, 34],\r\n\t"floralwhite": [255, 250, 240],\r\n\t"forestgreen": [34, 139, 34],\r\n\t"fuchsia": [255, 0, 255],\r\n\t"gainsboro": [220, 220, 220],\r\n\t"ghostwhite": [248, 248, 255],\r\n\t"gold": [255, 215, 0],\r\n\t"goldenrod": [218, 165, 32],\r\n\t"gray": [128, 128, 128],\r\n\t"green": [0, 128, 0],\r\n\t"greenyellow": [173, 255, 47],\r\n\t"grey": [128, 128, 128],\r\n\t"honeydew": [240, 255, 240],\r\n\t"hotpink": [255, 105, 180],\r\n\t"indianred": [205, 92, 92],\r\n\t"indigo": [75, 0, 130],\r\n\t"ivory": [255, 255, 240],\r\n\t"khaki": [240, 230, 140],\r\n\t"lavender": [230, 230, 250],\r\n\t"lavenderblush": [255, 240, 245],\r\n\t"lawngreen": [124, 252, 0],\r\n\t"lemonchiffon": [255, 250, 205],\r\n\t"lightblue": [173, 216, 230],\r\n\t"lightcoral": [240, 128, 128],\r\n\t"lightcyan": [224, 255, 255],\r\n\t"lightgoldenrodyellow": [250, 250, 210],\r\n\t"lightgray": [211, 211, 211],\r\n\t"lightgreen": [144, 238, 144],\r\n\t"lightgrey": [211, 211, 211],\r\n\t"lightpink": [255, 182, 193],\r\n\t"lightsalmon": [255, 160, 122],\r\n\t"lightseagreen": [32, 178, 170],\r\n\t"lightskyblue": [135, 206, 250],\r\n\t"lightslategray": [119, 136, 153],\r\n\t"lightslategrey": [119, 136, 153],\r\n\t"lightsteelblue": [176, 196, 222],\r\n\t"lightyellow": [255, 255, 224],\r\n\t"lime": [0, 255, 0],\r\n\t"limegreen": [50, 205, 50],\r\n\t"linen": [250, 240, 230],\r\n\t"magenta": [255, 0, 255],\r\n\t"maroon": [128, 0, 0],\r\n\t"mediumaquamarine": [102, 205, 170],\r\n\t"mediumblue": [0, 0, 205],\r\n\t"mediumorchid": [186, 85, 211],\r\n\t"mediumpurple": [147, 112, 219],\r\n\t"mediumseagreen": [60, 179, 113],\r\n\t"mediumslateblue": [123, 104, 238],\r\n\t"mediumspringgreen": [0, 250, 154],\r\n\t"mediumturquoise": [72, 209, 204],\r\n\t"mediumvioletred": [199, 21, 133],\r\n\t"midnightblue": [25, 25, 112],\r\n\t"mintcream": [245, 255, 250],\r\n\t"mistyrose": [255, 228, 225],\r\n\t"moccasin": [255, 228, 181],\r\n\t"navajowhite": [255, 222, 173],\r\n\t"navy": [0, 0, 128],\r\n\t"oldlace": [253, 245, 230],\r\n\t"olive": [128, 128, 0],\r\n\t"olivedrab": [107, 142, 35],\r\n\t"orange": [255, 165, 0],\r\n\t"orangered": [255, 69, 0],\r\n\t"orchid": [218, 112, 214],\r\n\t"palegoldenrod": [238, 232, 170],\r\n\t"palegreen": [152, 251, 152],\r\n\t"paleturquoise": [175, 238, 238],\r\n\t"palevioletred": [219, 112, 147],\r\n\t"papayawhip": [255, 239, 213],\r\n\t"peachpuff": [255, 218, 185],\r\n\t"peru": [205, 133, 63],\r\n\t"pink": [255, 192, 203],\r\n\t"plum": [221, 160, 221],\r\n\t"powderblue": [176, 224, 230],\r\n\t"purple": [128, 0, 128],\r\n\t"rebeccapurple": [102, 51, 153],\r\n\t"red": [255, 0, 0],\r\n\t"rosybrown": [188, 143, 143],\r\n\t"royalblue": [65, 105, 225],\r\n\t"saddlebrown": [139, 69, 19],\r\n\t"salmon": [250, 128, 114],\r\n\t"sandybrown": [244, 164, 96],\r\n\t"seagreen": [46, 139, 87],\r\n\t"seashell": [255, 245, 238],\r\n\t"sienna": [160, 82, 45],\r\n\t"silver": [192, 192, 192],\r\n\t"skyblue": [135, 206, 235],\r\n\t"slateblue": [106, 90, 205],\r\n\t"slategray": [112, 128, 144],\r\n\t"slategrey": [112, 128, 144],\r\n\t"snow": [255, 250, 250],\r\n\t"springgreen": [0, 255, 127],\r\n\t"steelblue": [70, 130, 180],\r\n\t"tan": [210, 180, 140],\r\n\t"teal": [0, 128, 128],\r\n\t"thistle": [216, 191, 216],\r\n\t"tomato": [255, 99, 71],\r\n\t"turquoise": [64, 224, 208],\r\n\t"violet": [238, 130, 238],\r\n\t"wheat": [245, 222, 179],\r\n\t"white": [255, 255, 255],\r\n\t"whitesmoke": [245, 245, 245],\r\n\t"yellow": [255, 255, 0],\r\n\t"yellowgreen": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-name/index.js?')},"./node_modules/color-string/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\nvar swizzle = __webpack_require__(/*! simple-swizzle */ \"./node_modules/simple-swizzle/index.js\");\nvar hasOwnProperty = Object.hasOwnProperty;\n\nvar reverseNames = Object.create(null);\n\n// create a list of reverse color names\nfor (var name in colorNames) {\n\tif (hasOwnProperty.call(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nvar cs = module.exports = {\n\tto: {},\n\tget: {}\n};\n\ncs.get = function (string) {\n\tvar prefix = string.substring(0, 3).toLowerCase();\n\tvar val;\n\tvar model;\n\tswitch (prefix) {\n\t\tcase 'hsl':\n\t\t\tval = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\tcase 'hwb':\n\t\t\tval = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tval = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t}\n\n\tif (!val) {\n\t\treturn null;\n\t}\n\n\treturn {model: model, value: val};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar abbr = /^#([a-f0-9]{3,4})$/i;\n\tvar hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;\n\tvar rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar keyword = /^(\\w+)$/;\n\n\tvar rgb = [0, 0, 0, 1];\n\tvar match;\n\tvar i;\n\tvar hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tvar i2 = i * 2;\n\t\t\trgb[i] = parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i + 1], 0);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!hasOwnProperty.call(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hsl = /^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hsl);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar s = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar l = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hwb = /^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hwb);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar w = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar b = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function () {\n\tvar rgba = swizzle(arguments);\n\n\tvar r = Math.round(rgba[0] / 255 * 100);\n\tvar g = Math.round(rgba[1] / 255 * 100);\n\tvar b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function () {\n\tvar hsla = swizzle(arguments);\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function () {\n\tvar hwba = swizzle(arguments);\n\n\tvar a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// helpers\nfunction clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n\tvar str = Math.round(num).toString(16).toUpperCase();\n\treturn (str.length < 2) ? '0' + str : str;\n}\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-string/index.js?")},"./node_modules/is-arrayish/index.js":module=>{eval("module.exports = function isArrayish(obj) {\n\tif (!obj || typeof obj === 'string') {\n\t\treturn false;\n\t}\n\n\treturn obj instanceof Array || Array.isArray(obj) ||\n\t\t(obj.length >= 0 && (obj.splice instanceof Function ||\n\t\t\t(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/is-arrayish/index.js?")},"./node_modules/isomorphic-unfetch/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('function r(m) {\n\treturn (m && m.default) || m;\n}\nmodule.exports = __webpack_require__.g.fetch =\n\t__webpack_require__.g.fetch ||\n\t(typeof process == "undefined"\n\t\t? r(__webpack_require__(/*! unfetch */ "./node_modules/unfetch/dist/unfetch.module.js"))\n\t\t: function (url, opts) {\n\t\t\t\tif (typeof url === "string" || url instanceof URL) {\n\t\t\t\t\turl = String(url).replace(/^\\/\\//g, "https://");\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! node-fetch */ "node-fetch", 23)).then((m) => r(m)(url, opts));\n\t\t });\n\n\n//# sourceURL=webpack://manifesto/./node_modules/isomorphic-unfetch/index.js?')},"./node_modules/lodash/_Symbol.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_Symbol.js?')},"./node_modules/lodash/_arrayPush.js":module=>{eval("/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_arrayPush.js?")},"./node_modules/lodash/_baseFlatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"),\n isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js");\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseFlatten.js?')},"./node_modules/lodash/_baseGetTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),\n objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");\n\n/** `Object#toString` result references. */\nvar nullTag = \'[object Null]\',\n undefinedTag = \'[object Undefined]\';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseGetTag.js?')},"./node_modules/lodash/_baseIsArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");\n\n/** `Object#toString` result references. */\nvar argsTag = \'[object Arguments]\';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseIsArguments.js?')},"./node_modules/lodash/_freeGlobal.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\nmodule.exports = freeGlobal;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_freeGlobal.js?")},"./node_modules/lodash/_getRawTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_getRawTag.js?')},"./node_modules/lodash/_isFlattenable.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"),\n isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js");\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_isFlattenable.js?')},"./node_modules/lodash/_objectToString.js":module=>{eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_objectToString.js?")},"./node_modules/lodash/_root.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_root.js?")},"./node_modules/lodash/flatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flatten.js?')},"./node_modules/lodash/flattenDeep.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flattenDeep.js?')},"./node_modules/lodash/isArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ \"./node_modules/lodash/_baseIsArguments.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArguments.js?")},"./node_modules/lodash/isArray.js":module=>{eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArray.js?")},"./node_modules/lodash/isObjectLike.js":module=>{eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isObjectLike.js?")},"./node_modules/simple-swizzle/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar isArrayish = __webpack_require__(/*! is-arrayish */ "./node_modules/is-arrayish/index.js");\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\nvar swizzle = module.exports = function swizzle(args) {\n\tvar results = [];\n\n\tfor (var i = 0, len = args.length; i < len; i++) {\n\t\tvar arg = args[i];\n\n\t\tif (isArrayish(arg)) {\n\t\t\t// http://jsperf.com/javascript-array-concat-vs-push/98\n\t\t\tresults = concat.call(results, slice.call(arg));\n\t\t} else {\n\t\t\tresults.push(arg);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nswizzle.wrap = function (fn) {\n\treturn function () {\n\t\treturn fn(swizzle(arguments));\n\t};\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/simple-swizzle/index.js?')},"./src/Annotation.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Annotation = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar Annotation = /** @class */ (function (_super) {\n __extends(Annotation, _super);\n function Annotation(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n /**\n In spite of its name, this method returns an array of objects, each of which\n represents a potential body annotations\n \n @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ }\n **/\n Annotation.prototype.getBody = function () {\n var bodies = [];\n var body = this.getProperty("body");\n // the following is intended to handle the following cases for\n /// the raw json of the body property of __jsonld\n // -- body is an array, each element of which is parsed\n // == body is an object with property items, each item is parsed\n // -- body is parsed\n if (body) {\n for (var _i = 0, _a = [].concat(body); _i < _a.length; _i++) {\n var bd = _a[_i];\n var items = bd.items;\n if (items)\n bodies = bodies.concat(this.parseBodiesFromItemsList(items));\n else\n bodies.push(this.parseSingletonBody(bd));\n }\n }\n return bodies;\n };\n Object.defineProperty(Annotation.prototype, "Body", {\n get: function () { return this.getBody(); },\n enumerable: false,\n configurable: true\n });\n /**\n auxiliary function to getBody; intended to hande an object that has an element items\n which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/\n seems to be the use case for this\n **/\n Annotation.prototype.parseBodiesFromItemsList = function (rawbodies) {\n var retVal = [];\n for (var _i = 0, _a = [].concat(rawbodies); _i < _a.length; _i++) {\n var bd = _a[_i];\n retVal.push(this.parseSingletonBody(bd));\n }\n return retVal;\n };\n /**\n auxiliary function to parseBodiesFromItemsList and getBody, this is the last\n step on recursively going through collections of bodies.\n **/\n Annotation.prototype.parseSingletonBody = function (rawbody) {\n if (rawbody.type === "SpecificResource") {\n return new internal_1.SpecificResource(rawbody, this.options);\n }\n else {\n return internal_1.AnnotationBodyParser.BuildFromJson(rawbody, this.options);\n }\n };\n /**\n Developer Note: 8 April 2024\n getBody3D function was developed in the early stages of the 3D API Feb-March 2024\n as alternative to the existing Annotation getBody function, but the signature for\n getBody3D was chosen to be a single object instance, not an array.\n \n At this stage, the merging of the 2D API anf the draft 3D API has been completed, so\n 3D applications can use the getBody() function to retrieve the body of an Annotation intended\n to target a scene. For compatibily the return value of the function is still an\n array.\n \n 3D clients using getBody are responsible for choosing the appropriate instance from the\n returned array. In most cases this will be the sole 0th element.\n **/\n Annotation.prototype.getBody3D = function () {\n console.warn("Annotation.getBody3D is deprecated: replace with getBody3D() with getBody()[0]");\n return this.getBody()[0];\n };\n Annotation.prototype.getMotivation = function () {\n var motivation = this.getProperty("motivation");\n if (motivation) {\n //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation);\n return motivation;\n }\n return null;\n };\n // open annotation\n Annotation.prototype.getOn = function () {\n return this.getProperty("on");\n };\n Annotation.prototype.getTarget = function () {\n var rawTarget = this.getPropertyAsObject("target");\n if (rawTarget.isIRI)\n return rawTarget;\n if (rawTarget.type && rawTarget.type == "SpecificResource") {\n return new internal_1.SpecificResource(rawTarget, this.options);\n }\n else {\n throw new Error("unknown target specified");\n }\n };\n Object.defineProperty(Annotation.prototype, "Target", {\n get: function () { return this.getTarget(); },\n enumerable: false,\n configurable: true\n });\n Annotation.prototype.getResource = function () {\n return new internal_1.Resource(this.getProperty("resource"), this.options);\n };\n Object.defineProperty(Annotation.prototype, "LookAtLocation", {\n /**\n * A 3D point coordinate object for the location of an Annotation\n * to satisfy the requirements of the lookAt property of camera and\n * spotlight resources, according to the draft v4 API as of April 1 2024\n *\n * Is the position of the point for a target which is a SpecificResource with\n * a PointSelector\n * Otherwise, for example when the annotation target is an entire Scene, the\n * location for lookAt is the origin (0,0,0)\n **/\n get: function () {\n var _a;\n var target = this.getTarget();\n if (target.isSpecificResource && ((_a = target.getSelector()) === null || _a === void 0 ? void 0 : _a.isPointSelector))\n return target.getSelector().getLocation();\n else\n return new threejs_math_1.Vector3(0.0, 0.0, 0.0);\n },\n enumerable: false,\n configurable: true\n });\n return Annotation;\n}(internal_1.ManifestResource));\nexports.Annotation = Annotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Annotation.ts?')},"./src/AnnotationBody.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBody = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\nWith the 3D extensions to the IIIF Presentation API the name of this\nclass is misleading, but for now is being retained for the sake backward\ncompatibility with earlier manifesto code and tests.\n\nThe 3D extensions allow that the body property of an annotation can be\na light, camera, or model, or a SpecificResource object wrapping a light, camera,\nor model.\n**/\nvar AnnotationBody = /** @class */ (function (_super) {\n __extends(AnnotationBody, _super);\n function AnnotationBody(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = true;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = false;\n // following class members were added to support 3D and mixed 2D/3D content\n // these boolean switches will be appropriately set when the manifest json is parsed\n _this.isModel = true;\n _this.isLight = false;\n _this.isCamera = false;\n return _this;\n }\n // Format, Type, Width, and Height are the body properties supported\n // in the code that supports Presentation 3\n AnnotationBody.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return internal_1.Utils.getMediaType(format);\n }\n return null;\n };\n AnnotationBody.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return (internal_1.Utils.normaliseType(this.getProperty("type")));\n }\n return null;\n };\n AnnotationBody.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n AnnotationBody.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n return AnnotationBody;\n}(internal_1.ManifestResource));\nexports.AnnotationBody = AnnotationBody;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBody.ts?')},"./src/AnnotationBodyParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBodyParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LightTypes = ["AmbientLight", "DirectionalLight"];\nvar CameraTypes = ["PerspectiveCamera", "OrthographicCamera"];\nvar DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"];\nvar AnnotationBodyParser = /** @class */ (function () {\n function AnnotationBodyParser() {\n }\n AnnotationBodyParser.BuildFromJson = function (jsonld, options) {\n if (DisplayedTypes.includes(jsonld.type))\n return new internal_1.AnnotationBody(jsonld, options);\n else if (LightTypes.includes(jsonld.type))\n return new internal_1.Light(jsonld, options);\n else if (CameraTypes.includes(jsonld.type))\n return new internal_1.Camera(jsonld, options);\n else\n throw new Error("unimplemented type for AnnotationBody: " + jsonld.type);\n };\n return AnnotationBodyParser;\n}());\nexports.AnnotationBodyParser = AnnotationBodyParser;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBodyParser.ts?')},"./src/AnnotationList.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationList = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationList = /** @class */ (function (_super) {\n __extends(AnnotationList, _super);\n function AnnotationList(label, jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.label = label;\n _this.options = options;\n return _this;\n }\n AnnotationList.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n AnnotationList.prototype.getLabel = function () {\n return this.label;\n };\n AnnotationList.prototype.getResources = function () {\n var _this = this;\n var resources = this.getProperty("resources");\n return resources.map(function (resource) { return new internal_1.Annotation(resource, _this.options); });\n };\n AnnotationList.prototype.load = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.isLoaded) {\n resolve(_this);\n }\n else {\n var id = _this.__jsonld.id;\n if (!id) {\n id = _this.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id)\n .then(function (data) {\n _this.__jsonld = data;\n _this.context = _this.getProperty("context");\n _this.id = _this.getProperty("id");\n _this.isLoaded = true;\n resolve(_this);\n })\n .catch(reject);\n }\n });\n };\n return AnnotationList;\n}(internal_1.JSONLDResource));\nexports.AnnotationList = AnnotationList;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationList.ts?')},"./src/AnnotationPage.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationPage = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationPage = /** @class */ (function (_super) {\n __extends(AnnotationPage, _super);\n function AnnotationPage(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n AnnotationPage.prototype.getItems = function () {\n return this.getProperty("items");\n };\n return AnnotationPage;\n}(internal_1.ManifestResource));\nexports.AnnotationPage = AnnotationPage;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationPage.ts?')},"./src/Camera.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Camera = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Camera = /** @class */ (function (_super) {\n __extends(Camera, _super);\n function Camera(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isModel = false;\n _this.isLight = false;\n _this.isCamera = true;\n return _this;\n }\n Object.defineProperty(Camera.prototype, "isPerspectiveCamera", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "perspectivecamera");\n },\n enumerable: false,\n configurable: true\n });\n /**\n @returns full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n Camera.prototype.getFieldOfView = function () {\n if (this.isPerspectiveCamera) {\n var value = this.getProperty("fieldOfView");\n if (value)\n return value;\n else\n return 45.0;\n }\n else\n return undefined;\n };\n Object.defineProperty(Camera.prototype, "FieldOfView", {\n /**\n Full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n get: function () { return this.getFieldOfView(); },\n enumerable: false,\n configurable: true\n });\n Camera.prototype.getLookAt = function () {\n return this.getPropertyAsObject("lookAt");\n };\n Object.defineProperty(Camera.prototype, "LookAt", {\n get: function () { return this.getLookAt(); },\n enumerable: false,\n configurable: true\n });\n return Camera;\n}(internal_1.AnnotationBody));\nexports.Camera = Camera;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/Camera.ts?')},"./src/Canvas.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Canvas = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n// @ts-ignore\nvar flatten_1 = __importDefault(__webpack_require__(/*! lodash/flatten */ "./node_modules/lodash/flatten.js"));\n// @ts-ignore\nvar flattenDeep_1 = __importDefault(__webpack_require__(/*! lodash/flattenDeep */ "./node_modules/lodash/flattenDeep.js"));\nvar Canvas = /** @class */ (function (_super) {\n __extends(Canvas, _super);\n function Canvas(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // http://iiif.io/api/image/2.1/#canonical-uri-syntax\n Canvas.prototype.getCanonicalImageUri = function (w) {\n var id = null;\n var region = "full";\n var rotation = 0;\n var quality = "default";\n var width = w;\n var size;\n // if an info.json has been loaded\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data["@id"]) {\n id = this.externalResource.data["@id"];\n if (!width) {\n width = this.externalResource.data.width;\n }\n if (this.externalResource.data["@context"]) {\n if (this.externalResource.data["@context"].indexOf("/1.0/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1.1/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1/context.json") > -1) {\n quality = "native";\n }\n }\n }\n else {\n // info.json hasn\'t been loaded yet\n var images = void 0;\n // presentation 2.0\n images = this.getImages();\n if (images && images.length) {\n var firstImage = images[0];\n var resource = firstImage.getResource();\n var services = resource.getServices();\n if (!width) {\n width = resource.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return (internal_1.Utils.isImageProfile(service.getProfile()) ||\n internal_1.Utils.isImageServiceType(service.getIIIFResourceType()));\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === resource.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return resource.id;\n }\n }\n // presentation 3.0\n images = this.getContent();\n if (images && images.length) {\n var firstImage = images[0];\n // Developer note: Since Canvas in Presentation 3 doesn\'t use\n // SpecificResource resources in the body, force a cast\n var body = firstImage.getBody();\n var anno = body[0];\n var services = anno.getServices();\n if (!width) {\n width = anno.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return internal_1.Utils.isImageServiceType(service.getIIIFResourceType());\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === anno.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return anno.id;\n }\n }\n // todo: should this be moved to getThumbUri?\n if (!id) {\n var thumbnail = this.getProperty("thumbnail");\n if (thumbnail) {\n if (typeof thumbnail === "string") {\n return thumbnail;\n }\n else {\n if (thumbnail["@id"]) {\n return thumbnail["@id"];\n }\n else if (thumbnail.length) {\n return thumbnail[0].id;\n }\n }\n }\n }\n }\n size = width + ",";\n // trim off trailing \'/\'\n if (id && id.endsWith("/")) {\n id = id.substr(0, id.length - 1);\n }\n var uri = [id, region, size, rotation, quality + ".jpg"].join("/");\n return uri;\n };\n Canvas.prototype.getMaxDimensions = function () {\n var maxDimensions = null;\n var profile;\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data.profile) {\n profile = this.externalResource.data.profile;\n if (Array.isArray(profile)) {\n profile = profile.filter(function (p) { return p["maxWidth" || 0]; })[0];\n if (profile) {\n maxDimensions = new internal_1.Size(profile.maxWidth, profile.maxHeight ? profile.maxHeight : profile.maxWidth);\n }\n }\n }\n return maxDimensions;\n };\n // Presentation API 3.0\n Canvas.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n return content;\n };\n Canvas.prototype.getDuration = function () {\n return this.getProperty("duration");\n };\n // presentation 2.0\n Canvas.prototype.getImages = function () {\n var images = [];\n if (!this.__jsonld.images)\n return images;\n for (var i = 0; i < this.__jsonld.images.length; i++) {\n var a = this.__jsonld.images[i];\n var annotation = new internal_1.Annotation(a, this.options);\n images.push(annotation);\n }\n return images;\n };\n Canvas.prototype.getIndex = function () {\n return this.getProperty("index");\n };\n Canvas.prototype.getOtherContent = function () {\n var _this = this;\n var otherContent = Array.isArray(this.getProperty("otherContent"))\n ? this.getProperty("otherContent")\n : [this.getProperty("otherContent")];\n var canonicalComparison = function (typeA, typeB) {\n if (typeof typeA !== "string" || typeof typeB !== "string") {\n return false;\n }\n return typeA.toLowerCase() === typeA.toLowerCase();\n };\n var otherPromises = otherContent\n .filter(function (otherContent) {\n return otherContent &&\n canonicalComparison(otherContent["@type"], "sc:AnnotationList");\n })\n .map(function (annotationList, i) {\n return new internal_1.AnnotationList(annotationList["label"] || "Annotation list ".concat(i), annotationList, _this.options);\n })\n .map(function (annotationList) { return annotationList.load(); });\n return Promise.all(otherPromises);\n };\n // Prefer thumbnail service to image service if supplied and if\n // the thumbnail service can provide a satisfactory size +/- x pixels.\n // this is used to get thumb URIs *before* the info.json has been requested\n // and populate thumbnails in a viewer.\n // the publisher may also provide pre-computed fixed-size thumbs for better performance.\n //getThumbUri(width: number): string {\n //\n // var uri;\n // var images: IAnnotation[] = this.getImages();\n //\n // if (images && images.length) {\n // var firstImage = images[0];\n // var resource: IResource = firstImage.getResource();\n // var services: IService[] = resource.getServices();\n //\n // for (let i = 0; i < services.length; i++) {\n // var service: IService = services[i];\n // var id = service.id;\n //\n // if (!_endsWith(id, \'/\')) {\n // id += \'/\';\n // }\n //\n // uri = id + \'full/\' + width + \',/0/\' + Utils.getImageQuality(service.getProfile()) + \'.jpg\';\n // }\n // }\n //\n // return uri;\n //}\n //getType(): CanvasType {\n // return new CanvasType(this.getProperty(\'@type\').toLowerCase());\n //}\n Canvas.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Canvas.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Canvas.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Canvas.prototype, "imageResources", {\n get: function () {\n var _this = this;\n var resources = (0, flattenDeep_1.default)([\n this.getImages().map(function (i) { return i.getResource(); }),\n this.getContent().map(function (i) { return i.getBody(); })\n ]);\n return (0, flatten_1.default)(resources.map(function (resource) {\n switch (resource.getProperty("type").toLowerCase()) {\n case dist_commonjs_1.ExternalResourceType.CHOICE:\n case dist_commonjs_1.ExternalResourceType.OA_CHOICE:\n return new Canvas({\n images: (0, flatten_1.default)([\n resource.getProperty("default"),\n resource.getProperty("item")\n ]).map(function (r) { return ({ resource: r }); })\n }, _this.options)\n .getImages()\n .map(function (i) { return i.getResource(); });\n default:\n return resource;\n }\n }));\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "resourceAnnotations", {\n get: function () {\n return (0, flattenDeep_1.default)([this.getImages(), this.getContent()]);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns a given resource Annotation, based on a contained resource or body\n * id\n */\n Canvas.prototype.resourceAnnotation = function (id) {\n return this.resourceAnnotations.find(function (anno) {\n return anno.getResource().id === id ||\n (0, flatten_1.default)(new Array(anno.getBody())).some(function (body) { return body.id === id; });\n });\n };\n /**\n * Returns the fragment placement values if a resourceAnnotation is placed on\n * a canvas somewhere besides the full extent\n */\n Canvas.prototype.onFragment = function (id) {\n var resourceAnnotation = this.resourceAnnotation(id);\n if (!resourceAnnotation)\n return undefined;\n // IIIF v2\n var on = resourceAnnotation.getProperty("on");\n // IIIF v3\n var target = resourceAnnotation.getProperty("target");\n if (!on || !target) {\n return undefined;\n }\n var fragmentMatch = (on || target).match(/xywh=(.*)$/);\n if (!fragmentMatch)\n return undefined;\n return fragmentMatch[1].split(",").map(function (str) { return parseInt(str, 10); });\n };\n Object.defineProperty(Canvas.prototype, "iiifImageResources", {\n get: function () {\n return this.imageResources.filter(function (r) { return r && r.getServices()[0] && r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "imageServiceIds", {\n get: function () {\n return this.iiifImageResources.map(function (r) { return r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "aspectRatio", {\n get: function () {\n return this.getWidth() / this.getHeight();\n },\n enumerable: false,\n configurable: true\n });\n return Canvas;\n}(internal_1.Resource));\nexports.Canvas = Canvas;\n\n\n//# sourceURL=webpack://manifesto/./src/Canvas.ts?')},"./src/Collection.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Collection = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Collection = /** @class */ (function (_super) {\n __extends(Collection, _super);\n function Collection(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._collections = null;\n _this._manifests = null;\n jsonld.__collection = _this;\n return _this;\n }\n Collection.prototype.getCollections = function () {\n if (this._collections) {\n return this._collections;\n }\n return (this._collections = (this.items.filter(function (m) { return m.isCollection(); })));\n };\n Collection.prototype.getManifests = function () {\n if (this._manifests) {\n return this._manifests;\n }\n return (this._manifests = (this.items.filter(function (m) { return m.isManifest(); })));\n };\n Collection.prototype.getCollectionByIndex = function (collectionIndex) {\n var collections = this.getCollections();\n var collection;\n for (var i = 0; i < collections.length; i++) {\n var c = collections[i];\n if (c.index === collectionIndex) {\n collection = c;\n }\n }\n if (collection) {\n collection.options.index = collectionIndex;\n // id for collection MUST be dereferenceable\n return collection.load();\n }\n else {\n throw new Error("Collection index not found");\n }\n };\n Collection.prototype.getManifestByIndex = function (manifestIndex) {\n var manifests = this.getManifests();\n var manifest;\n for (var i = 0; i < manifests.length; i++) {\n var m = manifests[i];\n if (m.index === manifestIndex) {\n manifest = m;\n }\n }\n if (manifest) {\n manifest.options.index = manifestIndex;\n return manifest.load();\n }\n else {\n throw new Error("Manifest index not found");\n }\n };\n Collection.prototype.getTotalCollections = function () {\n return this.getCollections().length;\n };\n Collection.prototype.getTotalManifests = function () {\n return this.getManifests().length;\n };\n Collection.prototype.getTotalItems = function () {\n return this.items.length;\n };\n Collection.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n return dist_commonjs_1.ViewingDirection.LEFT_TO_RIGHT;\n };\n /**\n * Note: this only will return the first behavior as per the manifesto convention\n * IIIF v3 supports multiple behaviors\n */\n Collection.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Collection.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n /**\n * Get a tree of sub collections and manifests, using each child manifest\'s first \'top\' range.\n */\n Collection.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n //console.log("get default tree for ", this.id);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n this._parseManifests(this);\n this._parseCollections(this);\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Collection.prototype._parseManifests = function (parentCollection) {\n if (parentCollection.getManifests() &&\n parentCollection.getManifests().length) {\n for (var i = 0; i < parentCollection.getManifests().length; i++) {\n var manifest = parentCollection.getManifests()[i];\n var tree = manifest.getDefaultTree();\n tree.label =\n manifest.parentLabel ||\n manifest.getLabel().getValue(this.options.locale) ||\n "manifest " + (i + 1);\n tree.navDate = manifest.getNavDate();\n tree.data.id = manifest.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n Collection.prototype._parseCollections = function (parentCollection) {\n //console.log("parse collections for ", parentCollection.id);\n if (parentCollection.getCollections() &&\n parentCollection.getCollections().length) {\n for (var i = 0; i < parentCollection.getCollections().length; i++) {\n var collection = parentCollection.getCollections()[i];\n var tree = collection.getDefaultTree();\n tree.label =\n collection.parentLabel ||\n collection.getLabel().getValue(this.options.locale) ||\n "collection " + (i + 1);\n tree.navDate = collection.getNavDate();\n tree.data.id = collection.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n return Collection;\n}(internal_1.IIIFResource));\nexports.Collection = Collection;\n\n\n//# sourceURL=webpack://manifesto/./src/Collection.ts?')},"./src/Color.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n//import { colorString } from "color-string"\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Color = void 0;\nvar colorString = __webpack_require__(/*! color-string */ "./node_modules/color-string/index.js");\n/**\n * class structure with red, green, blue values in 0-255 range\n * Uses the {@link https://www.npmjs.com/package.color-string | color-string }\n * library for conversion from and to string representations of color.\n**/\nvar Color = /** @class */ (function () {\n /**\n * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red\n **/\n function Color(rgbValue) {\n this.value = rgbValue;\n }\n /**\n * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red\n * @returns Color instance.\n **/\n Color.fromCSS = function (cssTerm) {\n var rv = colorString.get(cssTerm);\n if (rv.model !== \'rgb\')\n throw new Error("unsupported color string: " + cssTerm);\n return new Color([rv.value[0], rv.value[1], rv.value[2]]);\n };\n Object.defineProperty(Color.prototype, "red", {\n /**\n * @return 0 to 255 value of red color component\n **/\n get: function () { return this.value[0]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "green", {\n /**\n * @return 0 to 255 value of green color component\n **/\n get: function () { return this.value[1]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "blue", {\n /**\n * @return 0 to 255 value of blue color component\n **/\n get: function () { return this.value[2]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "CSS", {\n /**\n * @returns hex string (as for CSS ) representation of r,g,b components\n **/\n get: function () { return colorString.to.hex(this.value); },\n enumerable: false,\n configurable: true\n });\n return Color;\n}());\nexports.Color = Color;\n\n\n//# sourceURL=webpack://manifesto/./src/Color.ts?')},"./src/Duration.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Duration = void 0;\nvar Duration = /** @class */ (function () {\n function Duration(start, end) {\n this.start = start;\n this.end = end;\n }\n Duration.prototype.getLength = function () {\n return this.end - this.start;\n };\n return Duration;\n}());\nexports.Duration = Duration;\n\n\n//# sourceURL=webpack://manifesto/./src/Duration.ts?')},"./src/Geometry3d.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.lightRelativeRotation = exports.cameraRelativeRotation = void 0;\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\n// https://ros2jsguy.github.io/threejs-math/index.html\n/**\n* performs the calculation required for the lookAt\n* property of a camera resource. Determines the\n* required angles of two rotations, the first about\n* the x axis and the second about the y axis, which will\n* rotate the default camera direction (0,0,-1) into the\n* direction of the input arguments\n*\n* Result of calculation is returned as a instance of EulerAngle from the\n* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The\n* three-js library uses body-fixed axes to represent EulerAngles, which reverse\n* the ordering of the "relative rotation" algorithm described in the\n* draft 3d api.\n\n* @param direction A vector interpreted as a direction. Client code\n* responsible for not passing a 0-length vector, else a\n\n*\n* @returns threejs-math.EulerAngle instance\n**/\nfunction cameraRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n // projDirection is the direction projected onto the xz plane\n var projDirection = direction.clone().setComponent(1, 0.0);\n var projLength = projDirection.length();\n // handle the edge case, desired viewing direction is either straight up\n // or straight down\n if (projLength == 0.0) {\n if (direction.y > 0.0) {\n // looking straight up fro below\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(+90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n else {\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(-90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n }\n var yAngleRad = Math.atan2(-projDirection.x, -projDirection.z);\n var xAngleRad = Math.atan2(direction.y, projLength);\n return new threejs_math_1.Euler(xAngleRad, yAngleRad, 0.0, "YXZ");\n}\nexports.cameraRelativeRotation = cameraRelativeRotation;\n;\nfunction lightRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n var unit_direction = direction.clone().divideScalar(direction.length());\n // negative y axis is initial direction of DirectionalLight, SpotLight\n // in draft 3D API\n var ny_axis = new threejs_math_1.Vector3(0.0, -1.0, 0.0);\n var quat = new threejs_math_1.Quaternion().setFromUnitVectors(ny_axis, unit_direction);\n var tmp = new threejs_math_1.Euler().setFromQuaternion(quat, "ZXY");\n // standard be setting the final intrinsic Y rotation, which is\n // along desired direction, to 0\n return new threejs_math_1.Euler(tmp.x, 0.0, tmp.z, "ZXY");\n}\nexports.lightRelativeRotation = lightRelativeRotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Geometry3d.ts?')},"./src/IAccessToken.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IAccessToken.ts?')},"./src/IExternalImageResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalImageResourceData.ts?')},"./src/IExternalResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResource.ts?')},"./src/IExternalResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceData.ts?')},"./src/IExternalResourceOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceOptions.ts?')},"./src/IIIFResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.IIIFResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar IIIFResource = /** @class */ (function (_super) {\n __extends(IIIFResource, _super);\n function IIIFResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = -1;\n _this.isLoaded = false;\n var defaultOptions = {\n defaultLabel: "-",\n locale: "en-GB",\n resource: _this,\n pessimisticAccessControl: false\n };\n _this.options = Object.assign(defaultOptions, options);\n return _this;\n }\n /**\n * @deprecated\n */\n IIIFResource.prototype.getAttribution = function () {\n //console.warn(\'getAttribution will be deprecated, use getRequiredStatement instead.\');\n var attribution = this.getProperty("attribution");\n if (attribution) {\n return internal_1.PropertyValue.parse(attribution, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getDescription = function () {\n var description = this.getProperty("description");\n if (description) {\n return internal_1.PropertyValue.parse(description, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getHomepage = function () {\n var homepage = this.getProperty("homepage");\n if (!homepage)\n return null;\n if (typeof homepage == "string")\n return homepage;\n if (Array.isArray(homepage) && homepage.length) {\n homepage = homepage[0];\n }\n return homepage["@id"] || homepage.id;\n };\n IIIFResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n IIIFResource.prototype.getLogo = function () {\n var logo = this.getProperty("logo");\n // Presentation 3.\n // The logo is exclusive to the "provider" property, which is of type "Agent".\n // In order to fulfil `manifest.getLogo()` we should check\n // When P3 is fully supported, the following should work.\n // return this.getProvider()?.getLogo();\n if (!logo) {\n var provider = this.getProperty("provider");\n if (!provider) {\n return null;\n }\n logo = provider.logo;\n }\n if (!logo)\n return null;\n if (typeof logo === "string")\n return logo;\n if (Array.isArray(logo) && logo.length) {\n logo = logo[0];\n }\n return logo["@id"] || logo.id;\n };\n IIIFResource.prototype.getLicense = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("license"), this.options.locale);\n };\n IIIFResource.prototype.getNavDate = function () {\n return new Date(this.getProperty("navDate"));\n };\n IIIFResource.prototype.getRelated = function () {\n return this.getProperty("related");\n };\n IIIFResource.prototype.getSeeAlso = function () {\n return this.getProperty("seeAlso");\n };\n IIIFResource.prototype.getTrackingLabel = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.TRACKING_EXTENSIONS));\n if (service) {\n return service.getProperty("trackingLabel");\n }\n return "";\n };\n IIIFResource.prototype.getDefaultTree = function () {\n this.defaultTree = new internal_1.TreeNode("root");\n this.defaultTree.data = this;\n return this.defaultTree;\n };\n IIIFResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n else {\n // fall back to attribution (if it exists)\n var attribution = this.getAttribution();\n if (attribution) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.value = attribution;\n }\n }\n return requiredStatement;\n };\n IIIFResource.prototype.isCollection = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.isManifest = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.load = function () {\n var that = this;\n return new Promise(function (resolve) {\n if (that.isLoaded) {\n resolve(that);\n }\n else {\n var options_1 = that.options;\n options_1.navDate = that.getNavDate();\n var id = that.__jsonld.id;\n if (!id) {\n id = that.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id).then(function (data) {\n that.parentLabel = that.getLabel().getValue(options_1.locale);\n var parsed = internal_1.Deserialiser.parse(data, options_1);\n that = Object.assign(that, parsed);\n //that.parentCollection = options.resource.parentCollection;\n that.index = options_1.index;\n resolve(that);\n });\n }\n });\n };\n return IIIFResource;\n}(internal_1.ManifestResource));\nexports.IIIFResource = IIIFResource;\n\n\n//# sourceURL=webpack://manifesto/./src/IIIFResource.ts?')},"./src/IManifestoOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IManifestoOptions.ts?')},"./src/JSONLDResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.JSONLDResource = void 0;\nvar JSONLDResource = /** @class */ (function () {\n function JSONLDResource(jsonld) {\n this.__jsonld = jsonld;\n this.context = this.getProperty("context");\n this.id = this.getProperty("id");\n }\n JSONLDResource.prototype.getProperty = function (name) {\n var prop = null;\n if (this.__jsonld) {\n prop = this.__jsonld[name];\n if (!prop) {\n // property may have a prepended \'@\'\n prop = this.__jsonld["@" + name];\n }\n }\n return prop;\n };\n /**\n A function that wraps the getProperty function, which client\n code can use if it is needed to identify when the json value of\n a property is an IRI -- Internationalized Resource Identifier\n \n If the value of the json value is a bare string, then it will be\n wrapped in a json object with the string in the property \'id\',\n additionally that property will have a property \'isIRI\' which will\n be true for the literal string case, otherwise false meaning the\n returned getProperty should be parsed as before.\n \n **/\n JSONLDResource.prototype.getPropertyAsObject = function (name) {\n var prop = this.getProperty(name);\n if (prop === null)\n return prop;\n else if (typeof (prop) === \'string\')\n return { "id": prop,\n "isIRI": true\n };\n else if (prop === Object(prop))\n return prop;\n else {\n throw new Error("cannot resolve prop as object: " + prop);\n }\n };\n return JSONLDResource;\n}());\nexports.JSONLDResource = JSONLDResource;\n\n\n//# sourceURL=webpack://manifesto/./src/JSONLDResource.ts?')},"./src/LabelValuePair.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LabelValuePair = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LabelValuePair = /** @class */ (function () {\n function LabelValuePair(defaultLocale) {\n this.defaultLocale = defaultLocale;\n }\n LabelValuePair.prototype.parse = function (resource) {\n this.resource = resource;\n this.label = internal_1.PropertyValue.parse(this.resource.label, this.defaultLocale);\n this.value = internal_1.PropertyValue.parse(this.resource.value, this.defaultLocale);\n };\n // shortcuts to get/set values based on user or default locale\n LabelValuePair.prototype.getLabel = function (locale) {\n if (this.label === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.label.getValue(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setLabel = function (value) {\n if (this.label === null) {\n this.label = new internal_1.PropertyValue([]);\n }\n this.label.setValue(value, this.defaultLocale);\n };\n LabelValuePair.prototype.getValue = function (locale, joinWith) {\n if (joinWith === void 0) { joinWith = " "; }\n if (this.value === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValue(locale || this.defaultLocale, joinWith);\n };\n LabelValuePair.prototype.getValues = function (locale) {\n if (this.value === null) {\n return [];\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValues(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setValue = function (value) {\n if (this.value === null) {\n this.value = new internal_1.PropertyValue([]);\n }\n this.value.setValue(value, this.defaultLocale);\n };\n return LabelValuePair;\n}());\nexports.LabelValuePair = LabelValuePair;\n\n\n//# sourceURL=webpack://manifesto/./src/LabelValuePair.ts?')},"./src/Language.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/Language.ts?')},"./src/LanguageMap.ts":function(__unused_webpack_module,exports){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LanguageMap = void 0;\n/** @deprecated Use PropertyValue instead */\nvar LanguageMap = /** @class */ (function (_super) {\n __extends(LanguageMap, _super);\n function LanguageMap() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /** @deprecated Use the `PropertyValue#getValue` instance method instead */\n LanguageMap.getValue = function (languageCollection, locale) {\n return languageCollection.getValue(locale, " ");\n };\n /** @deprecated Use the `PropertyValue#getValues` instance method instead */\n LanguageMap.getValues = function (languageCollection, locale) {\n return languageCollection.getValues(locale);\n };\n return LanguageMap;\n}(Array));\nexports.LanguageMap = LanguageMap;\n\n\n//# sourceURL=webpack://manifesto/./src/LanguageMap.ts?')},"./src/Light.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Light = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Light = /** @class */ (function (_super) {\n __extends(Light, _super);\n function Light(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isLight = true;\n _this.isModel = false;\n return _this;\n }\n Object.defineProperty(Light.prototype, "isAmbientLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "ambientlight");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Light.prototype, "isDirectionalLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "directionallight");\n },\n enumerable: false,\n configurable: true\n });\n Light.prototype.getColor = function () {\n var hexColor = this.getProperty("color");\n if (hexColor)\n return internal_1.Color.fromCSS(hexColor);\n else\n return new internal_1.Color([255, 255, 255]); // white light\n };\n /**\n * The implementation of the intensity is based on\n * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md }\n * and the example 3D manifests\n * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights }\n * on 24 Mar 2024. The intensity property in the manifest is an object\n * with declared type \'Value\', a numeric property named \'value\' and a\n * property named unit . This implementation will only work with a unit == \'relative\'\n * and it will be assumed that a relative unit value of 1.0 corresponds to the\n * brightest light source a rendering engine supports.\n *\n * This code will implement a default intensity of 1.0\n **/\n Light.prototype.getIntensity = function () {\n var intObject = this.getProperty("intensity");\n if (intObject) {\n try {\n if (!(intObject.type === "Value" && intObject.unit === "relative"))\n throw new Error();\n return intObject.value;\n }\n catch (err) {\n throw new Error("unable to interpret raw intensity object " + JSON.stringify(intObject));\n }\n }\n else\n return 1.0;\n };\n return Light;\n}(internal_1.AnnotationBody));\nexports.Light = Light;\n\n\n//# sourceURL=webpack://manifesto/./src/Light.ts?')},"./src/Manifest.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Manifest = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n* @remarks Scenes are conveniently retrieved from a Manifest by iterating through\n* Sequence in the Manifest, inner loop the Scenes in each sequence\n* @see {@link Sequence }\n*\n* @example\n* var manifest: Manifest;\n* function doSomethingWithScene(scene:Scene)...\n* ...\n* foreach(var seq:Sequence of manifest.getSequences()\n* foreach(var scene : Scene of seq.getScenes()\n* doSomethingWithScene(scene);\n**/\nvar Manifest = /** @class */ (function (_super) {\n __extends(Manifest, _super);\n function Manifest(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = 0;\n _this._allRanges = null;\n _this.items = [];\n _this._topRanges = [];\n if (_this.__jsonld.structures && _this.__jsonld.structures.length) {\n var topRanges = _this._getTopRanges();\n for (var i = 0; i < topRanges.length; i++) {\n var range = topRanges[i];\n _this._parseRanges(range, String(i));\n }\n }\n // initialization the cached _annotationIdMap to null\n // it will be populated if and only if client calls make a request\n // to the getter annotationIdMap\n _this._annotationIdMap = null;\n return _this;\n }\n /** @deprecated Use getAccompanyingCanvas instead */\n Manifest.prototype.getPosterCanvas = function () {\n var posterCanvas = this.getProperty("posterCanvas");\n if (posterCanvas) {\n posterCanvas = new internal_1.Canvas(posterCanvas, this.options);\n }\n return posterCanvas;\n };\n Manifest.prototype.getAccompanyingCanvas = function () {\n var accompanyingCanvas = this.getProperty("accompanyingCanvas");\n if (accompanyingCanvas) {\n accompanyingCanvas = new internal_1.Canvas(accompanyingCanvas, this.options);\n }\n return accompanyingCanvas;\n };\n Manifest.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Manifest.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n if (!this.isLoaded) {\n return this.defaultTree;\n }\n var topRanges = this.getTopRanges();\n // if there are any ranges in the manifest, default to the first \'top\' range or generated placeholder\n if (topRanges.length) {\n topRanges[0].getTree(this.defaultTree);\n }\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Manifest.prototype._getTopRanges = function () {\n var topRanges = [];\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var json = this.__jsonld.structures[i];\n if (json.viewingHint === dist_commonjs_1.ViewingHint.TOP) {\n topRanges.push(json);\n }\n }\n // if no viewingHint="top" range was found, create a default one\n if (!topRanges.length) {\n var range = {};\n range.ranges = this.__jsonld.structures;\n topRanges.push(range);\n }\n }\n return topRanges;\n };\n Manifest.prototype.getTopRanges = function () {\n return this._topRanges;\n };\n Manifest.prototype._getRangeById = function (id) {\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var r = this.__jsonld.structures[i];\n if (r["@id"] === id || r.id === id) {\n return r;\n }\n }\n }\n return null;\n };\n //private _parseRangeCanvas(json: any, range: Range): void {\n // todo: currently this isn\'t needed\n //var canvas: IJSONLDResource = new JSONLDResource(json);\n //range.items.push(canvas);\n //}\n Manifest.prototype._parseRanges = function (r, path, parentRange) {\n var range;\n var id = null;\n if (typeof r === "string") {\n id = r;\n r = this._getRangeById(id);\n }\n if (!r) {\n console.warn("Range:", id, "does not exist");\n return;\n }\n range = new internal_1.Range(r, this.options);\n range.parentRange = parentRange;\n range.path = path;\n if (!parentRange) {\n this._topRanges.push(range);\n }\n else {\n parentRange.items.push(range);\n }\n var items = r.items || r.members;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n // todo: use an ItemType constant?\n if ((item["@type"] && item["@type"].toLowerCase() === "sc:range") ||\n (item["type"] && item["type"].toLowerCase() === "range")) {\n this._parseRanges(item, path + "/" + i, range);\n }\n else if ((item["@type"] && item["@type"].toLowerCase() === "sc:canvas") ||\n (item["type"] && item["type"].toLowerCase() === "canvas")) {\n // store the ids on the __jsonld object to be used by Range.getCanvasIds()\n if (!range.canvases) {\n range.canvases = [];\n }\n var id_1 = item.id || item["@id"];\n range.canvases.push(id_1);\n }\n }\n }\n else if (r.ranges) {\n for (var i = 0; i < r.ranges.length; i++) {\n this._parseRanges(r.ranges[i], path + "/" + i, range);\n }\n }\n };\n Manifest.prototype.getAllRanges = function () {\n if (this._allRanges != null)\n return this._allRanges;\n this._allRanges = [];\n var topRanges = this.getTopRanges();\n var _loop_1 = function (i) {\n var topRange = topRanges[i];\n if (topRange.id) {\n this_1._allRanges.push(topRange); // it might be a placeholder root range\n }\n var reducer = function (acc, next) {\n acc.add(next);\n var nextRanges = next.getRanges();\n if (nextRanges.length) {\n return nextRanges.reduce(reducer, acc);\n }\n return acc;\n };\n var subRanges = Array.from(topRange.getRanges().reduce(reducer, new Set()));\n this_1._allRanges = this_1._allRanges.concat(subRanges);\n };\n var this_1 = this;\n for (var i = 0; i < topRanges.length; i++) {\n _loop_1(i);\n }\n return this._allRanges;\n };\n Manifest.prototype.getRangeById = function (id) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.id === id) {\n return range;\n }\n }\n return null;\n };\n Manifest.prototype.getRangeByPath = function (path) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.path === path) {\n return range;\n }\n }\n return null;\n };\n /**\n * @returns Array of Sequence instances\n **/\n Manifest.prototype.getSequences = function () {\n if (this.items.length) {\n return this.items;\n }\n // IxIF mediaSequences overrode sequences, so need to be checked first.\n // deprecate this when presentation 3 ships\n var items = this.__jsonld.mediaSequences || this.__jsonld.sequences;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var s = items[i];\n var sequence = new internal_1.Sequence(s, this.options);\n this.items.push(sequence);\n }\n }\n else if (this.__jsonld.items) {\n var sequence = new internal_1.Sequence(this.__jsonld.items, this.options);\n this.items.push(sequence);\n }\n return this.items;\n };\n Manifest.prototype.getSequenceByIndex = function (sequenceIndex) {\n return this.getSequences()[sequenceIndex];\n };\n Manifest.prototype.getTotalSequences = function () {\n return this.getSequences().length;\n };\n Manifest.prototype.getManifestType = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.UI_EXTENSIONS));\n if (service) {\n return service.getProperty("manifestType");\n }\n return internal_1.ManifestType.EMPTY;\n };\n Manifest.prototype.isMultiSequence = function () {\n return this.getTotalSequences() > 1;\n };\n Manifest.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n var behavior = this.getBehavior();\n if (behavior) {\n return behavior === dist_commonjs_1.Behavior.PAGED;\n }\n return false;\n };\n Manifest.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Manifest.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Manifest.prototype, "annotationIdMap", {\n /**\n * Developer Note: The concept of the "id map" appear in the\n * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map\n * This functionality may be available as well in the \'nodeMap\' code of the\n * digitalbazaar/jsonld library\n *\n * this very simplified version just returns a mao of id -> Annotation nodes\n * in manifest\n *\n * THe annotationIdMap is a Javascript object whose property names are\n * IRI (id values) and property values are instances of the Annotation class\n **/\n get: function () {\n if (this._annotationIdMap == null) {\n this._annotationIdMap = {};\n for (var _i = 0, _a = this.getSequences(); _i < _a.length; _i++) {\n var seq = _a[_i];\n for (var _b = 0, _c = seq.getScenes(); _b < _c.length; _b++) {\n var scene = _c[_b];\n for (var _d = 0, _e = scene.getContent(); _d < _e.length; _d++) {\n var anno = _e[_d];\n this._annotationIdMap[anno.id] = anno;\n }\n }\n }\n }\n return this._annotationIdMap;\n },\n enumerable: false,\n configurable: true\n });\n return Manifest;\n}(internal_1.IIIFResource));\nexports.Manifest = Manifest;\n\n\n//# sourceURL=webpack://manifesto/./src/Manifest.ts?')},"./src/ManifestResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar ManifestResource = /** @class */ (function (_super) {\n __extends(ManifestResource, _super);\n function ManifestResource(jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.options = options;\n return _this;\n }\n ManifestResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n ManifestResource.prototype.getLabel = function () {\n var label = this.getProperty("label");\n if (label) {\n return internal_1.PropertyValue.parse(label, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n ManifestResource.prototype.getDefaultLabel = function () {\n return this.getLabel().getValue(this.options.locale);\n };\n ManifestResource.prototype.getMetadata = function () {\n var _metadata = this.getProperty("metadata");\n var metadata = [];\n if (!_metadata)\n return metadata;\n for (var i = 0; i < _metadata.length; i++) {\n var item = _metadata[i];\n var metadataItem = new internal_1.LabelValuePair(this.options.locale);\n metadataItem.parse(item);\n metadata.push(metadataItem);\n }\n return metadata;\n };\n ManifestResource.prototype.getRendering = function (format) {\n var renderings = this.getRenderings();\n for (var i = 0; i < renderings.length; i++) {\n var rendering = renderings[i];\n if (rendering.getFormat() === format) {\n return rendering;\n }\n }\n return null;\n };\n ManifestResource.prototype.getRenderings = function () {\n var rendering;\n // if passing a manifesto-parsed object, use the __jsonld.rendering property,\n // otherwise look for a rendering property\n if (this.__jsonld) {\n rendering = this.__jsonld.rendering;\n }\n else {\n rendering = this.rendering;\n }\n var renderings = [];\n if (!rendering)\n return renderings;\n // coerce to array\n if (!Array.isArray(rendering)) {\n rendering = [rendering];\n }\n for (var i = 0; i < rendering.length; i++) {\n var r = rendering[i];\n renderings.push(new internal_1.Rendering(r, this.options));\n }\n return renderings;\n };\n ManifestResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n return requiredStatement;\n };\n ManifestResource.prototype.getService = function (profile) {\n return internal_1.Utils.getService(this, profile);\n };\n ManifestResource.prototype.getServices = function () {\n return internal_1.Utils.getServices(this);\n };\n ManifestResource.prototype.getThumbnail = function () {\n var thumbnail = this.getProperty("thumbnail");\n if (Array.isArray(thumbnail)) {\n thumbnail = thumbnail[0];\n }\n if (thumbnail) {\n return new internal_1.Thumbnail(thumbnail, this.options);\n }\n return null;\n };\n ManifestResource.prototype.isAnnotation = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.ANNOTATION;\n };\n ManifestResource.prototype.isCanvas = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.CANVAS;\n };\n ManifestResource.prototype.isCollection = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION;\n };\n ManifestResource.prototype.isManifest = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST;\n };\n ManifestResource.prototype.isRange = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.RANGE;\n };\n // this different implementation is necessary until such time as the \n // SCENE is added to the @iiif/vocabulary package.\n ManifestResource.prototype.isScene = function () {\n return this.getIIIFResourceType() === internal_1.Utils.normaliseType(\'Scene\');\n };\n ManifestResource.prototype.isSequence = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.SEQUENCE;\n };\n return ManifestResource;\n}(internal_1.JSONLDResource));\nexports.ManifestResource = ManifestResource;\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestResource.ts?')},"./src/ManifestType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestType = void 0;\nvar ManifestType;\n(function (ManifestType) {\n ManifestType["EMPTY"] = "";\n ManifestType["MANUSCRIPT"] = "manuscript";\n ManifestType["MONOGRAPH"] = "monograph";\n})(ManifestType || (exports.ManifestType = ManifestType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestType.ts?')},"./src/PointSelector.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PointSelector = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar PointSelector = /** @class */ (function (_super) {\n __extends(PointSelector, _super);\n function PointSelector(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isPointSelector = true;\n return _this;\n }\n PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\n };\n return PointSelector;\n}(internal_1.JSONLDResource));\nexports.PointSelector = PointSelector;\n\n\n//# sourceURL=webpack://manifesto/./src/PointSelector.ts?')},"./src/PropertyValue.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PropertyValue = exports.LocalizedValue = void 0;\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/** Utility class to hold one or more values with their associated (optional) locale */\nvar LocalizedValue = /** @class */ (function () {\n function LocalizedValue(value, locale, defaultLocale) {\n if (defaultLocale === void 0) { defaultLocale = "none"; }\n if (Array.isArray(value) && value.length === 1) {\n this._value = value[0];\n }\n else {\n this._value = value;\n }\n if (locale === "none" || locale === "@none") {\n locale = undefined;\n }\n this._locale = locale;\n this._defaultLocale = defaultLocale;\n }\n /** Parse a localized value from a IIIF v2 property value\n *\n * @param {string | string[] | object | object[]} rawVal value from IIIF resource\n * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value\n */\n LocalizedValue.parseV2Value = function (rawVal, defaultLocale) {\n if (typeof rawVal === "string") {\n return new LocalizedValue(rawVal, undefined, defaultLocale);\n }\n else if (rawVal["@value"]) {\n return new LocalizedValue(rawVal["@value"], rawVal["@language"], defaultLocale);\n }\n return null;\n };\n Object.defineProperty(LocalizedValue.prototype, "value", {\n /*** @deprecated Use PropertyValue#getValue instead */\n get: function () {\n if (Array.isArray(this._value)) {\n return this._value.join(" ");\n }\n return this._value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizedValue.prototype, "locale", {\n /*** @deprecated Don\'t use, only used for backwards compatibility reasons */\n get: function () {\n if (this._locale === undefined) {\n return this._defaultLocale;\n }\n return this._locale;\n },\n enumerable: false,\n configurable: true\n });\n LocalizedValue.prototype.addValue = function (value) {\n if (!Array.isArray(this._value)) {\n this._value = [this._value];\n }\n if (Array.isArray(value)) {\n this._value = this._value.concat(value);\n }\n else {\n this._value.push(value);\n }\n };\n return LocalizedValue;\n}());\nexports.LocalizedValue = LocalizedValue;\n/***\n * Holds a collection of values and their (optional) languages and allows\n * language-based value retrieval as per the algorithm described in\n * https://iiif.io/api/presentation/2.1/#language-of-property-values\n */\nvar PropertyValue = /** @class */ (function (_super) {\n __extends(PropertyValue, _super);\n function PropertyValue(values, defaultLocale) {\n if (values === void 0) { values = []; }\n var _this = _super.apply(this, values) || this;\n // Needed for ES5 compatibility, see https://stackoverflow.com/a/40967939\n _this.__proto__ = PropertyValue.prototype;\n _this._defaultLocale = defaultLocale;\n return _this;\n }\n PropertyValue.parse = function (rawVal, defaultLocale) {\n if (!rawVal) {\n return new PropertyValue([], defaultLocale);\n }\n if (Array.isArray(rawVal)) {\n // Collection of IIIF v2 property values\n var parsed = rawVal\n .map(function (v) { return LocalizedValue.parseV2Value(v, defaultLocale); })\n .filter(function (v) { return v !== null; });\n var byLocale = parsed.reduce(function (acc, lv) {\n var loc = lv._locale;\n if (!loc) {\n // Cannot use undefined as an object key\n loc = "none";\n }\n if (acc[loc]) {\n acc[loc].addValue(lv._value);\n }\n else {\n acc[loc] = lv;\n }\n return acc;\n }, {});\n return new PropertyValue(Object.values(byLocale), defaultLocale);\n }\n else if (typeof rawVal === "string") {\n return new PropertyValue([new LocalizedValue(rawVal, undefined, defaultLocale)], defaultLocale);\n }\n else if (rawVal["@language"]) {\n // Single IIIF v2 property value\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else if (rawVal["@value"]) {\n // Single IIIF v2 property value without language\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else {\n // IIIF v3 property value\n return new PropertyValue(Object.keys(rawVal).map(function (locale) {\n var val = rawVal[locale];\n if (!Array.isArray(val)) {\n throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");\n }\n return new LocalizedValue(val, locale, defaultLocale);\n }), defaultLocale);\n }\n };\n /*** Try to find the available locale that best fit\'s the user\'s preferences. */\n PropertyValue.prototype.getSuitableLocale = function (locales) {\n // If any of the values have a language associated with them, the client\n // must display all of the values associated with the language that best\n // matches the language preference.\n if (locales.length == 0 && this._defaultLocale)\n locales.push(this._defaultLocale);\n // create an array of the language codes for all different LocalizedValue instances in this PropertyValue\n var allLocales = new Array();\n for (var _i = 0, _a = this; _i < _a.length; _i++) {\n var lv = _a[_i];\n if (lv._locale != undefined)\n allLocales.push(lv._locale);\n }\n var _loop_1 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return l === userLocale; });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // First, look for a precise match\n for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) {\n var userLocale = locales_1[_b];\n var state_1 = _loop_1(userLocale);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n var _loop_2 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return Utils_1.Utils.getInexactLocale(l) === Utils_1.Utils.getInexactLocale(userLocale); });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // Look for an inexact match\n for (var _c = 0, locales_2 = locales; _c < locales_2.length; _c++) {\n var userLocale = locales_2[_c];\n var state_2 = _loop_2(userLocale);\n if (typeof state_2 === "object")\n return state_2.value;\n }\n return undefined;\n };\n /**\n * Set the value(s) for a given locale.\n *\n * If there\'s an existing locale that matches the given locale, it will be updated.\n *\n * @param locale Locale to set the value for\n * @param value value to set\n */\n PropertyValue.prototype.setValue = function (value, locale) {\n var existing = undefined;\n if (!locale) {\n existing = this.find(function (lv) { return lv._locale === undefined; });\n }\n else {\n var bestLocale_1 = this.getSuitableLocale([locale]);\n if (bestLocale_1) {\n existing = this.find(function (lv) { return lv._locale === bestLocale_1; });\n }\n }\n if (existing) {\n // Mutate existing localized value\n existing._value = value;\n }\n else {\n // Create a new localized value\n this.push(new LocalizedValue(value, locale, this._defaultLocale));\n }\n };\n /**\n * Get a value in the most suitable locale.\n *\n * @param {string | string[] | undefined} locales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @param {string | undefined} joinWith String to join multiple available values by,\n * if undefined only the first available value will be returned\n * @returns the first value in the most suitable locale or null if none could be found\n */\n PropertyValue.prototype.getValue = function (locales, joinWith) {\n var vals = this.getValues(locales);\n if (vals.length === 0) {\n return null;\n }\n if (joinWith) {\n return vals.join(joinWith);\n }\n return vals[0];\n };\n /**\n * Get all values available in the most suitable locale.\n *\n * @param {string | string[]} userLocales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @returns the values for the most suitable locale, empty if none could be found\n */\n PropertyValue.prototype.getValues = function (userLocales) {\n if (!this.length) {\n return [];\n }\n var locales;\n if (!userLocales) {\n locales = [];\n }\n else if (!Array.isArray(userLocales)) {\n locales = [userLocales];\n }\n else {\n locales = userLocales;\n }\n // If none of the values have a language associated with them, the client\n // must display all of the values.\n if (this.length === 1 && this[0]._locale === undefined) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // Try to determine the available locale that best fits the user\'s preferences\n var matchingLocale = this.getSuitableLocale(locales);\n if (matchingLocale) {\n var val = this.find(function (lv) { return lv._locale === matchingLocale; })._value;\n return Array.isArray(val) ? val : [val];\n }\n // If all of the values have a language associated with them, and none match\n // the language preference, the client must select a language and display\n // all of the values associated with that language.\n var allHaveLang = !this.find(function (lv) { return lv._locale === undefined; });\n if (allHaveLang) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // If some of the values have a language associated with them, but none\n // match the language preference, the client must display all of the values\n // that do not have a language associated with them.\n var lv = this.find(function (lv) { return lv._locale === undefined; });\n if (lv) {\n return Array.isArray(lv._value) ? lv._value : [lv._value];\n }\n return [];\n };\n return PropertyValue;\n}(Array));\nexports.PropertyValue = PropertyValue;\n\n\n//# sourceURL=webpack://manifesto/./src/PropertyValue.ts?')},"./src/Range.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Range = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar Range = /** @class */ (function (_super) {\n __extends(Range, _super);\n function Range(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this._ranges = null;\n _this.canvases = null;\n _this.items = [];\n return _this;\n }\n Range.prototype.getCanvasIds = function () {\n if (this.__jsonld.canvases) {\n return this.__jsonld.canvases;\n }\n else if (this.canvases) {\n return this.canvases;\n }\n return [];\n };\n Range.prototype.getDuration = function () {\n // For this implementation, we want to catch SOME of the temporal cases - i.e. when there is a t=1,100\n if (this.canvases && this.canvases.length) {\n var startTimes = [];\n var endTimes = [];\n // When we loop through all of the canvases we store the recorded start and end times.\n // Then we choose the maximum and minimum values from this. This will give us a more accurate duration for the\n // Chosen range. However this is still not perfect and does not cover more complex ranges. These cases are out of\n // scope for this change.\n for (var _i = 0, _a = this.canvases; _i < _a.length; _i++) {\n var canvas = _a[_i];\n if (!canvas)\n continue;\n var _b = (canvas.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [undefined, canvas]), canvasId = _b[1], start_1 = _b[2], end_1 = _b[3];\n if (canvasId) {\n startTimes.push(parseFloat(start_1));\n endTimes.push(parseFloat(end_1));\n }\n }\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n else {\n // get child ranges and calculate the start and end based on them\n var childRanges = this.getRanges();\n var startTimes = [];\n var endTimes = [];\n // Once again, we use a max/min to get the ranges.\n for (var _c = 0, childRanges_1 = childRanges; _c < childRanges_1.length; _c++) {\n var childRange = childRanges_1[_c];\n var duration = childRange.getDuration();\n if (duration) {\n startTimes.push(duration.start);\n endTimes.push(duration.end);\n }\n }\n // And return the minimum as the start, and the maximum as the end.\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n var start;\n var end;\n // There are 2 paths for this implementation. Either we have a list of canvases, or a list of ranges\n // which may have a list of ranges.\n // This is one of the limitations of this implementation.\n if (this.canvases && this.canvases.length) {\n // When we loop through each of the canvases we are expecting to see a fragment or a link to the whole canvas.\n // For example - if we have http://example.org/canvas#t=1,100 it will extract 1 and 100 as the start and end.\n for (var i = 0; i < this.canvases.length; i++) {\n var canvas = this.canvases[i];\n var temporal = internal_1.Utils.getTemporalComponent(canvas);\n if (temporal && temporal.length > 1) {\n if (i === 0) {\n // Note: Cannot guarantee ranges are sequential (fixed above)\n start = Number(temporal[0]);\n }\n if (i === this.canvases.length - 1) {\n end = Number(temporal[1]); // Note: The end of this duration may be targeting a different canvas.\n }\n }\n }\n }\n else {\n // In this second case, where there are nested ranges, we recursively get the duration\n // from each of the child ranges (a start and end) and then choose the first and last for the bounds of this range.\n var childRanges = this.getRanges();\n for (var i = 0; i < childRanges.length; i++) {\n var childRange = childRanges[i];\n var duration = childRange.getDuration();\n if (duration) {\n if (i === 0) {\n start = duration.start;\n }\n if (i === childRanges.length - 1) {\n end = duration.end;\n }\n }\n }\n }\n if (start !== undefined && end !== undefined) {\n return new internal_1.Duration(start, end);\n }\n return undefined;\n };\n // getCanvases(): ICanvas[] {\n // if (this._canvases) {\n // return this._canvases;\n // }\n // return this._canvases = this.items.en().where(m => m.isCanvas()).toArray();\n // }\n Range.prototype.getRanges = function () {\n if (this._ranges) {\n return this._ranges;\n }\n return (this._ranges = this.items.filter(function (m) { return m.isRange(); }));\n };\n Range.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Range.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Range.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Range.prototype.getTree = function (treeRoot) {\n treeRoot.data = this;\n this.treeNode = treeRoot;\n var ranges = this.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var node = new internal_1.TreeNode();\n treeRoot.addNode(node);\n this._parseTreeNode(node, range);\n }\n }\n internal_1.Utils.generateTreeNodeIds(treeRoot);\n return treeRoot;\n };\n Range.prototype.spansTime = function (time) {\n var duration = this.getDuration();\n if (duration) {\n if (time >= duration.start && time <= duration.end) {\n return true;\n }\n }\n return false;\n };\n Range.prototype._parseTreeNode = function (node, range) {\n node.label = range.getLabel().getValue(this.options.locale);\n node.data = range;\n node.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n range.treeNode = node;\n var ranges = range.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var childRange = ranges[i];\n var behavior = childRange.getBehavior();\n if (behavior === dist_commonjs_1.Behavior.NO_NAV) {\n continue;\n }\n else {\n var childNode = new internal_1.TreeNode();\n node.addNode(childNode);\n this._parseTreeNode(childNode, childRange);\n }\n }\n }\n };\n return Range;\n}(internal_1.ManifestResource));\nexports.Range = Range;\n\n\n//# sourceURL=webpack://manifesto/./src/Range.ts?')},"./src/Rendering.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Rendering = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Rendering = /** @class */ (function (_super) {\n __extends(Rendering, _super);\n function Rendering(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Rendering.prototype.getFormat = function () {\n return this.getProperty("format");\n };\n return Rendering;\n}(internal_1.ManifestResource));\nexports.Rendering = Rendering;\n\n\n//# sourceURL=webpack://manifesto/./src/Rendering.ts?')},"./src/Resource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Resource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Resource = /** @class */ (function (_super) {\n __extends(Resource, _super);\n function Resource(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Resource.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return format.toLowerCase();\n }\n return null;\n };\n Resource.prototype.getResources = function () {\n var resources = [];\n if (!this.__jsonld.resources)\n return resources;\n for (var i = 0; i < this.__jsonld.resources.length; i++) {\n var a = this.__jsonld.resources[i];\n var annotation = new internal_1.Annotation(a, this.options);\n resources.push(annotation);\n }\n return resources;\n };\n Resource.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return internal_1.Utils.normaliseType(type);\n }\n return null;\n };\n Resource.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Resource.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Resource.prototype.getMaxWidth = function () {\n return this.getProperty("maxWidth");\n };\n Resource.prototype.getMaxHeight = function () {\n var maxHeight = this.getProperty("maxHeight");\n // if a maxHeight hasn\'t been specified, default to maxWidth.\n // maxWidth in essence becomes maxEdge\n if (!maxHeight) {\n return this.getMaxWidth();\n }\n return null;\n };\n return Resource;\n}(internal_1.ManifestResource));\nexports.Resource = Resource;\n\n\n//# sourceURL=webpack://manifesto/./src/Resource.ts?')},"./src/RotateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.RotateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar RotateTransform = /** @class */ (function (_super) {\n __extends(RotateTransform, _super);\n function RotateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isRotateTransform = true;\n return _this;\n }\n RotateTransform.prototype.getRotation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return RotateTransform;\n}(internal_1.Transform));\nexports.RotateTransform = RotateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/RotateTransform.ts?')},"./src/ScaleTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ScaleTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar ScaleTransform = /** @class */ (function (_super) {\n __extends(ScaleTransform, _super);\n function ScaleTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isScaleTransform = true;\n return _this;\n }\n ScaleTransform.prototype.getScale = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n // note that default scaling is 1.0\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 1.0;\n }\n return retVal;\n };\n return ScaleTransform;\n}(internal_1.Transform));\nexports.ScaleTransform = ScaleTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/ScaleTransform.ts?')},"./src/Scene.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Scene = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Scene = /** @class */ (function (_super) {\n __extends(Scene, _super);\n function Scene(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // Presentation API 3.0\n Scene.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n ;\n return content;\n };\n ;\n Object.defineProperty(Scene.prototype, "Content", {\n // 3D extension\n get: function () { return this.getContent(); },\n enumerable: false,\n configurable: true\n });\n Scene.prototype.getAnnotationById = function (searchId) {\n for (var _i = 0, _a = this.Content; _i < _a.length; _i++) {\n var anno = _a[_i];\n if (anno.id === searchId)\n return anno;\n }\n return null;\n };\n Scene.prototype.getBackgroundColor = function () {\n // regular expression intended to match strings like\n // "#FF00FF" -- interpreted as three hexadecimal values\n // in range 0-255 . Not that the \\w escape matches digits,\n // upper and lower case latin characters, and underscore\n // currently only supports the form for CSS\n // https://www.w3.org/wiki/CSS/Properties/color/RGB\n // with 6 hexadecimal digits\n var bgc = this.getProperty("backgroundColor");\n if (bgc)\n return internal_1.Color.fromCSS(bgc);\n else\n return null;\n };\n ;\n return Scene;\n}(internal_1.ManifestResource));\nexports.Scene = Scene;\n\n\n//# sourceURL=webpack://manifesto/./src/Scene.ts?')},"./src/Sequence.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Sequence = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Sequence = /** @class */ (function (_super) {\n __extends(Sequence, _super);\n function Sequence(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._thumbnails = null;\n return _this;\n }\n Sequence.prototype.getCanvases = function () {\n if (this.items.length) {\n return this.items;\n }\n var items = this.__jsonld.canvases || this.__jsonld.elements;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var c = items[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n else if (this.__jsonld) {\n for (var i = 0; i < this.__jsonld.length; i++) {\n var c = this.__jsonld[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n return this.items;\n };\n Sequence.prototype.getCanvasById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // normalise canvas id\n var canvasId = internal_1.Utils.normaliseUrl(canvas.id);\n if (internal_1.Utils.normaliseUrl(id) === canvasId) {\n return canvas;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasByIndex = function (canvasIndex) {\n return this.getCanvases()[canvasIndex];\n };\n Sequence.prototype.getCanvasIndexById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === id) {\n return i;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasIndexByLabel = function (label, foliated) {\n label = label.trim();\n if (!isNaN(label)) {\n // if the label is numeric\n label = parseInt(label, 10).toString(); // trim any preceding zeros.\n if (foliated)\n label += "r"; // default to recto\n }\n var doublePageRegExp = /(\\d*)\\D+(\\d*)/;\n var match, regExp, regStr, labelPart1, labelPart2;\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // check if there\'s a literal match\n if (canvas.getLabel().getValue(this.options.locale) === label) {\n return i;\n }\n // check if there\'s a match for double-page spreads e.g. 100-101, 100_101, 100 101\n match = doublePageRegExp.exec(label);\n if (!match)\n continue;\n labelPart1 = match[1];\n labelPart2 = match[2];\n if (!labelPart2)\n continue;\n regStr = "^" + labelPart1 + "\\\\D+" + labelPart2 + "$";\n regExp = new RegExp(regStr);\n if (regExp.test(canvas.getLabel().toString())) {\n return i;\n }\n }\n return -1;\n };\n Sequence.prototype.getLastCanvasLabel = function (alphanumeric) {\n for (var i = this.getTotalCanvases() - 1; i >= 0; i--) {\n var canvas = this.getCanvasByIndex(i);\n var label = (canvas.getLabel().getValue(this.options.locale));\n if (alphanumeric) {\n var regExp = /^[a-zA-Z0-9]*$/;\n if (regExp.test(label)) {\n return label;\n }\n }\n else if (label) {\n return label;\n }\n }\n return this.options.defaultLabel;\n };\n Sequence.prototype.getLastPageIndex = function () {\n return this.getTotalCanvases() - 1;\n };\n Sequence.prototype.getNextPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[0] + 1;\n }\n else {\n index = indices[indices.length - 1] + 1;\n }\n }\n else {\n index = canvasIndex + 1;\n }\n if (index > this.getLastPageIndex()) {\n return -1;\n }\n return index;\n };\n Sequence.prototype.getPagedIndices = function (canvasIndex, pagingEnabled) {\n var indices = [];\n if (!pagingEnabled) {\n indices.push(canvasIndex);\n }\n else {\n if (this.isFirstCanvas(canvasIndex) || this.isLastCanvas(canvasIndex)) {\n indices = [canvasIndex];\n }\n else if (canvasIndex % 2) {\n indices = [canvasIndex, canvasIndex + 1];\n }\n else {\n indices = [canvasIndex - 1, canvasIndex];\n }\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n indices = indices.reverse();\n }\n }\n return indices;\n };\n Sequence.prototype.getPrevPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[indices.length - 1] - 1;\n }\n else {\n index = indices[0] - 1;\n }\n }\n else {\n index = canvasIndex - 1;\n }\n return index;\n };\n /**\n * @returns Array of Scene instances in the Sequence\n **/\n Sequence.prototype.getScenes = function () {\n var returnVal = [];\n var low_items = this.__jsonld.elements || this.__jsonld;\n if (low_items) {\n for (var i = 0; i < low_items.length; ++i) {\n var c = low_items[i];\n if (c.type === \'Scene\') {\n var scene = new internal_1.Scene(c, this.options);\n //scene.index = i;\n returnVal.push(scene);\n }\n }\n }\n return returnVal;\n };\n Sequence.prototype.getStartCanvasIndex = function () {\n var startCanvas = this.getStartCanvas();\n if (startCanvas) {\n // if there\'s a startCanvas attribute, loop through the canvases and return the matching index.\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === startCanvas)\n return i;\n }\n }\n // default to first canvas.\n return 0;\n };\n // todo: deprecate\n Sequence.prototype.getThumbs = function (width, height) {\n //console.warn(\'getThumbs will be deprecated, use getThumbnails instead\');\n var thumbs = [];\n var totalCanvases = this.getTotalCanvases();\n for (var i = 0; i < totalCanvases; i++) {\n var canvas = this.getCanvasByIndex(i);\n var thumb = new internal_1.Thumb(width, canvas);\n thumbs.push(thumb);\n }\n return thumbs;\n };\n Sequence.prototype.getThumbnails = function () {\n if (this._thumbnails != null)\n return this._thumbnails;\n this._thumbnails = [];\n var canvases = this.getCanvases();\n for (var i = 0; i < canvases.length; i++) {\n var thumbnail = canvases[i].getThumbnail();\n if (thumbnail) {\n this._thumbnails.push(thumbnail);\n }\n }\n return this._thumbnails;\n };\n Sequence.prototype.getStartCanvas = function () {\n return this.getProperty("startCanvas");\n };\n Sequence.prototype.getTotalCanvases = function () {\n return this.getCanvases().length;\n };\n Sequence.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n else if (this.options.resource.getViewingDirection) {\n return this.options.resource.getViewingDirection();\n }\n return null;\n };\n Sequence.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Sequence.prototype.isCanvasIndexOutOfRange = function (canvasIndex) {\n return canvasIndex > this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isFirstCanvas = function (canvasIndex) {\n return canvasIndex === 0;\n };\n Sequence.prototype.isLastCanvas = function (canvasIndex) {\n return canvasIndex === this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isMultiCanvas = function () {\n return this.getTotalCanvases() > 1;\n };\n Sequence.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n return false;\n };\n // checks if the number of canvases is even - therefore has a front and back cover\n Sequence.prototype.isTotalCanvasesEven = function () {\n return this.getTotalCanvases() % 2 === 0;\n };\n return Sequence;\n}(internal_1.ManifestResource));\nexports.Sequence = Sequence;\n\n\n//# sourceURL=webpack://manifesto/./src/Sequence.ts?')},"./src/Serialisation.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Deserialiser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Deserialiser = /** @class */ (function () {\n function Deserialiser() {\n }\n Deserialiser.parse = function (manifest, options) {\n if (typeof manifest === "string") {\n manifest = JSON.parse(manifest);\n }\n return this.parseJson(manifest, options);\n };\n Deserialiser.parseJson = function (json, options) {\n var resource;\n // have options been passed for the manifest to inherit?\n if (options) {\n if (options.navDate && !isNaN(options.navDate.getTime())) {\n json.navDate = options.navDate.toString();\n }\n }\n if (json["@type"]) {\n switch (json["@type"]) {\n case "sc:Collection":\n resource = this.parseCollection(json, options);\n break;\n case "sc:Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n else {\n // presentation 3\n switch (json["type"]) {\n case "Collection":\n resource = this.parseCollection(json, options);\n break;\n case "Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n // Top-level resource was loaded from a URI, so flag it to prevent\n // unnecessary reload:\n resource.isLoaded = true;\n return resource;\n };\n Deserialiser.parseCollection = function (json, options) {\n var collection = new internal_1.Collection(json, options);\n if (options) {\n collection.index = options.index || 0;\n if (options.resource) {\n collection.parentCollection = options.resource.parentCollection;\n }\n }\n else {\n collection.index = 0;\n }\n this.parseCollections(collection, options);\n this.parseManifests(collection, options);\n this.parseItems(collection, options);\n return collection;\n };\n Deserialiser.parseCollections = function (collection, options) {\n var items;\n if (collection.__jsonld.collections) {\n items = collection.__jsonld.collections;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "collection"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (options) {\n options.index = i;\n }\n var item = this.parseCollection(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseManifest = function (json, options) {\n var manifest = new internal_1.Manifest(json, options);\n return manifest;\n };\n Deserialiser.parseManifests = function (collection, options) {\n var items;\n if (collection.__jsonld.manifests) {\n items = collection.__jsonld.manifests;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "manifest"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = this.parseManifest(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseItem = function (json, options) {\n if (json["@type"]) {\n if (json["@type"].toLowerCase() === "sc:manifest") {\n return this.parseManifest(json, options);\n }\n else if (json["@type"].toLowerCase() === "sc:collection") {\n return this.parseCollection(json, options);\n }\n }\n else if (json.type) {\n if (json.type.toLowerCase() === "manifest") {\n return this.parseManifest(json, options);\n }\n else if (json.type.toLowerCase() === "collection") {\n return this.parseCollection(json, options);\n }\n }\n return null;\n };\n Deserialiser.parseItems = function (collection, options) {\n var items = collection.__jsonld.members || collection.__jsonld.items;\n if (items) {\n var _loop_1 = function (i) {\n if (options) {\n options.index = i;\n }\n var item = this_1.parseItem(items[i], options);\n if (!item)\n return { value: void 0 };\n // only add to items if not already parsed from backwards-compatible collections/manifests arrays\n if (collection.items.filter(function (m) { return m.id === item.id; })[0]) {\n return "continue";\n }\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n };\n var this_1 = this;\n for (var i = 0; i < items.length; i++) {\n var state_1 = _loop_1(i);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n }\n };\n return Deserialiser;\n}());\nexports.Deserialiser = Deserialiser;\n\n\n//# sourceURL=webpack://manifesto/./src/Serialisation.ts?')},"./src/Service.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Service = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Service = /** @class */ (function (_super) {\n __extends(Service, _super);\n function Service(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Service.prototype.getProfile = function () {\n var profile = this.getProperty("profile");\n if (!profile) {\n profile = this.getProperty("dcterms:conformsTo");\n }\n if (Array.isArray(profile)) {\n return profile[0];\n }\n return profile;\n };\n Service.prototype.getConfirmLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale);\n };\n Service.prototype.getDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("description"), this.options.locale);\n };\n Service.prototype.getFailureDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale);\n };\n Service.prototype.getFailureHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale);\n };\n Service.prototype.getHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("header"), this.options.locale);\n };\n Service.prototype.getServiceLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("label"), this.options.locale);\n };\n Service.prototype.getInfoUri = function () {\n var infoUri = this.id;\n if (!infoUri.endsWith("/")) {\n infoUri += "/";\n }\n infoUri += "info.json";\n return infoUri;\n };\n return Service;\n}(internal_1.ManifestResource));\nexports.Service = Service;\n\n\n//# sourceURL=webpack://manifesto/./src/Service.ts?')},"./src/Size.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Size = void 0;\nvar Size = /** @class */ (function () {\n function Size(width, height) {\n this.width = width;\n this.height = height;\n }\n return Size;\n}());\nexports.Size = Size;\n\n\n//# sourceURL=webpack://manifesto/./src/Size.ts?')},"./src/SpecificResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.SpecificResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n Developer note: This implementation does not strictly adhere\n to the description of SpecificResource in the Web Annotation Model\n document https://www.w3.org/TR/annotation-model/\n section 4 : https://www.w3.org/TR/annotation-model/#specific-resources\n \n The getTransform() method returning an Array of 3D Transfom resources, is\n an extension of SpecificResource beyond the web annotation model.\n*/\nvar SpecificResource = /** @class */ (function (_super) {\n __extends(SpecificResource, _super);\n function SpecificResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = false;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = true;\n _this.isSpecificResource = true;\n return _this;\n }\n ;\n SpecificResource.prototype.getSource = function () {\n var raw = this.getPropertyAsObject("source");\n if (raw.isIRI)\n return raw;\n /*\n this logic gets a little convoluted, because we have to preserve\n the cases where the raw json is an array for the sources of a\n SpecificResource applied to an annotation body, while for a target\n of an Annotation we just want a single object\n */\n // case of a source of a SpecificResource which is an Annotation target\n if (raw) {\n var containerTypes = ["Scene", "Canvas"];\n var singleItem = ([].concat(raw))[0];\n if (containerTypes.includes(singleItem["type"]))\n return singleItem;\n }\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n return internal_1.AnnotationBodyParser.BuildFromJson(item, this.options);\n }\n }\n throw new Error("cannot resolve Source " + JSON.stringify(raw));\n };\n SpecificResource.prototype.getSelector = function () {\n var raw = this.getProperty("selector");\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n if (item["type"] === "PointSelector")\n return new internal_1.PointSelector(item);\n }\n throw new Error("unable to resolve SpecificResource selector " + JSON.stringify(this.__jsonld));\n }\n return null;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Selector", {\n get: function () { return this.getSelector(); },\n enumerable: false,\n configurable: true\n });\n SpecificResource.prototype.getTransform = function () {\n var retVal = [];\n var transformItems = this.getProperty("transform");\n for (var i = 0; i < transformItems.length; ++i) {\n var transformItem = transformItems[i];\n retVal.push(internal_1.TransformParser.BuildFromJson(transformItem));\n }\n return retVal;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Transform", {\n get: function () { return this.getTransform(); },\n enumerable: false,\n configurable: true\n });\n return SpecificResource;\n}(internal_1.ManifestResource));\nexports.SpecificResource = SpecificResource;\n\n\n//# sourceURL=webpack://manifesto/./src/SpecificResource.ts?')},"./src/StatusCode.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.StatusCode = void 0;\nvar StatusCode;\n(function (StatusCode) {\n StatusCode[StatusCode["AUTHORIZATION_FAILED"] = 1] = "AUTHORIZATION_FAILED";\n StatusCode[StatusCode["FORBIDDEN"] = 2] = "FORBIDDEN";\n StatusCode[StatusCode["INTERNAL_SERVER_ERROR"] = 3] = "INTERNAL_SERVER_ERROR";\n StatusCode[StatusCode["RESTRICTED"] = 4] = "RESTRICTED";\n})(StatusCode || (exports.StatusCode = StatusCode = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/StatusCode.ts?')},"./src/Thumb.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumb = void 0;\n// todo: deprecate\n// this is used by Sequence.getThumbs\nvar Thumb = /** @class */ (function () {\n function Thumb(width, canvas) {\n this.data = canvas;\n this.index = canvas.index;\n this.width = width;\n var heightRatio = canvas.getHeight() / canvas.getWidth();\n if (heightRatio) {\n this.height = Math.floor(this.width * heightRatio);\n }\n else {\n this.height = width;\n }\n this.uri = canvas.getCanonicalImageUri(width);\n this.label = canvas.getLabel().getValue(); // todo: pass locale?\n this.viewingHint = canvas.getViewingHint();\n }\n return Thumb;\n}());\nexports.Thumb = Thumb;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumb.ts?')},"./src/Thumbnail.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumbnail = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Thumbnail = /** @class */ (function (_super) {\n __extends(Thumbnail, _super);\n function Thumbnail(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n return Thumbnail;\n}(internal_1.Resource));\nexports.Thumbnail = Thumbnail;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumbnail.ts?')},"./src/Transform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Transform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Transform = /** @class */ (function (_super) {\n __extends(Transform, _super);\n function Transform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTransform = true;\n _this.isTransform = true;\n return _this;\n }\n return Transform;\n}(internal_1.JSONLDResource));\nexports.Transform = Transform;\n\n\n//# sourceURL=webpack://manifesto/./src/Transform.ts?')},"./src/TransformParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TransformParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TransformParser = /** @class */ (function () {\n function TransformParser() {\n }\n TransformParser.BuildFromJson = function (jsonld) {\n if (jsonld.type === "TranslateTransform")\n return new internal_1.TranslateTransform(jsonld);\n else if (jsonld.type === "RotateTransform")\n return new internal_1.RotateTransform(jsonld);\n else if (jsonld.type === "ScaleTransform")\n return new internal_1.ScaleTransform(jsonld);\n else\n throw new Error("Unknown transform type " + jsonld.type);\n };\n return TransformParser;\n}());\nexports.TransformParser = TransformParser;\n\n\n//# sourceURL=webpack://manifesto/./src/TransformParser.ts?')},"./src/TranslateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TranslateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TranslateTransform = /** @class */ (function (_super) {\n __extends(TranslateTransform, _super);\n function TranslateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTranslateTransform = true;\n return _this;\n }\n TranslateTransform.prototype.getTranslation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return TranslateTransform;\n}(internal_1.Transform));\nexports.TranslateTransform = TranslateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/TranslateTransform.ts?')},"./src/TreeNode.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNode = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TreeNode = /** @class */ (function () {\n function TreeNode(label, data) {\n this.label = label;\n this.data = data || {};\n this.nodes = [];\n }\n TreeNode.prototype.addNode = function (node) {\n this.nodes.push(node);\n node.parentNode = this;\n };\n TreeNode.prototype.isCollection = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n };\n TreeNode.prototype.isManifest = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n };\n TreeNode.prototype.isRange = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n };\n return TreeNode;\n}());\nexports.TreeNode = TreeNode;\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNode.ts?')},"./src/TreeNodeType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNodeType = void 0;\nvar TreeNodeType;\n(function (TreeNodeType) {\n TreeNodeType["COLLECTION"] = "collection";\n TreeNodeType["MANIFEST"] = "manifest";\n TreeNodeType["RANGE"] = "range";\n})(TreeNodeType || (exports.TreeNodeType = TreeNodeType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNodeType.ts?')},"./src/Utils.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Utils = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar dist_commonjs_2 = __webpack_require__(/*! @edsilv/http-status-codes/dist-commonjs */ "./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js");\n__webpack_require__(/*! isomorphic-unfetch */ "./node_modules/isomorphic-unfetch/index.js");\nvar Utils = /** @class */ (function () {\n function Utils() {\n }\n Utils.getMediaType = function (type) {\n type = type.toLowerCase();\n type = type.split(";")[0];\n return type.trim();\n };\n Utils.getImageQuality = function (profile) {\n if (profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) {\n return "native";\n }\n return "default";\n };\n Utils.getInexactLocale = function (locale) {\n if (locale.indexOf("-") !== -1) {\n return locale.substr(0, locale.indexOf("-"));\n }\n return locale;\n };\n Utils.getLocalisedValue = function (resource, locale) {\n // if the resource is not an array of translations, return the string.\n if (!Array.isArray(resource)) {\n return resource;\n }\n // test for exact match\n for (var i = 0; i < resource.length; i++) {\n var value_1 = resource[i];\n var language_1 = value_1["@language"];\n if (locale === language_1) {\n return value_1["@value"];\n }\n }\n // test for inexact match\n var match = locale.substr(0, locale.indexOf("-"));\n for (var i = 0; i < resource.length; i++) {\n var value = resource[i];\n var language = value["@language"];\n if (language === match) {\n return value["@value"];\n }\n }\n return null;\n };\n Utils.generateTreeNodeIds = function (treeNode, index) {\n if (index === void 0) { index = 0; }\n var id;\n if (!treeNode.parentNode) {\n id = "0";\n }\n else {\n id = treeNode.parentNode.id + "-" + index;\n }\n treeNode.id = id;\n for (var i = 0; i < treeNode.nodes.length; i++) {\n var n = treeNode.nodes[i];\n Utils.generateTreeNodeIds(n, i);\n }\n };\n Utils.normaliseType = function (type) {\n type = (type || "").toLowerCase();\n if (type.indexOf(":") !== -1) {\n var split = type.split(":");\n return split[1];\n }\n return type;\n };\n Utils.normaliseUrl = function (url) {\n url = url.substr(url.indexOf("://"));\n if (url.indexOf("#") !== -1) {\n url = url.split("#")[0];\n }\n return url;\n };\n Utils.normalisedUrlsMatch = function (url1, url2) {\n return Utils.normaliseUrl(url1) === Utils.normaliseUrl(url2);\n };\n Utils.isImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.isImageServiceType = function (type) {\n return ((type !== null &&\n type.toLowerCase() === dist_commonjs_1.ServiceType.IMAGE_SERVICE_2.toLowerCase()) ||\n type === dist_commonjs_1.ServiceType.IMAGE_SERVICE_3.toLowerCase());\n };\n Utils.isLevel0ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) {\n return true;\n }\n return false;\n };\n Utils.isLevel1ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) {\n return true;\n }\n return false;\n };\n Utils.isLevel2ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.parseManifest = function (manifest, options) {\n return internal_1.Deserialiser.parse(manifest, options);\n };\n Utils.checkStatus = function (response) {\n if (response.ok) {\n return response;\n }\n else {\n var error = new Error(response.statusText);\n error.response = response;\n return Promise.reject(error);\n }\n };\n Utils.loadManifest = function (url) {\n return new Promise(function (resolve, reject) {\n fetch(url)\n .then(Utils.checkStatus)\n .then(function (r) { return r.json(); })\n .then(function (data) {\n resolve(data);\n })\n .catch(function (err) {\n reject();\n });\n });\n };\n Utils.loadExternalResourcesAuth1 = function (resources, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth1(resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n Utils.loadExternalResourceAuth1 = function (resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var storedAccessToken;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, getStoredAccessToken(resource)];\n case 1:\n storedAccessToken = _a.sent();\n if (!storedAccessToken) return [3 /*break*/, 6];\n return [4 /*yield*/, resource.getData(storedAccessToken)];\n case 2:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.OK)) return [3 /*break*/, 3];\n return [2 /*return*/, resource];\n case 3: \n // the stored token is no good for this resource\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 4:\n // the stored token is no good for this resource\n _a.sent();\n _a.label = 5;\n case 5:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n case 6: return [4 /*yield*/, resource.getData()];\n case 7:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.MOVED_TEMPORARILY ||\n resource.status === dist_commonjs_2.UNAUTHORIZED)) return [3 /*break*/, 9];\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 8:\n _a.sent();\n _a.label = 9;\n case 9:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n }\n });\n });\n };\n Utils.doAuthChain = function (resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var externalService, kioskService, clickThroughService, loginService, serviceToTry, lastAttempted, kioskInteraction, contentProviderInteraction, contentProviderInteraction;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // This function enters the flowchart at the < External? > junction\n // http://iiif.io/api/auth/1.0/#workflow-from-the-browser-client-perspective\n if (!resource.isAccessControlled()) {\n return [2 /*return*/, resource]; // no services found\n }\n externalService = resource.externalService;\n if (externalService) {\n externalService.options = resource.options;\n }\n kioskService = resource.kioskService;\n if (kioskService) {\n kioskService.options = resource.options;\n }\n clickThroughService = resource.clickThroughService;\n if (clickThroughService) {\n clickThroughService.options = resource.options;\n }\n loginService = resource.loginService;\n if (loginService) {\n loginService.options = resource.options;\n }\n if (!(!resource.isResponseHandled && resource.status === dist_commonjs_2.MOVED_TEMPORARILY)) return [3 /*break*/, 2];\n return [4 /*yield*/, handleMovedTemporarily(resource)];\n case 1:\n _a.sent();\n return [2 /*return*/, resource];\n case 2:\n serviceToTry = null;\n lastAttempted = null;\n // repetition of logic is left in these steps for clarity:\n // Looking for external pattern\n serviceToTry = externalService;\n if (!serviceToTry) return [3 /*break*/, 4];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 3:\n _a.sent();\n return [2 /*return*/, resource];\n case 4:\n // Looking for kiosk pattern\n serviceToTry = kioskService;\n if (!serviceToTry) return [3 /*break*/, 7];\n lastAttempted = serviceToTry;\n kioskInteraction = openContentProviderInteraction(serviceToTry);\n if (!kioskInteraction) return [3 /*break*/, 7];\n return [4 /*yield*/, userInteractedWithContentProvider(kioskInteraction)];\n case 5:\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 6:\n _a.sent();\n return [2 /*return*/, resource];\n case 7:\n // The code for the next two patterns is identical (other than the profile name).\n // The difference is in the expected behaviour of\n //\n // await userInteractedWithContentProvider(contentProviderInteraction);\n //\n // For clickthrough the opened window should close immediately having established\n // a session, whereas for login the user might spend some time entering credentials etc.\n // Looking for clickthrough pattern\n serviceToTry = clickThroughService;\n if (!serviceToTry) return [3 /*break*/, 11];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 8:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 11];\n // should close immediately\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 9:\n // should close immediately\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 10:\n _a.sent();\n return [2 /*return*/, resource];\n case 11:\n // Looking for login pattern\n serviceToTry = loginService;\n if (!serviceToTry) return [3 /*break*/, 15];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 12:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 15];\n // we expect the user to spend some time interacting\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 13:\n // we expect the user to spend some time interacting\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 14:\n _a.sent();\n return [2 /*return*/, resource];\n case 15:\n // nothing worked! Use the most recently tried service as the source of\n // messages to show to the user.\n if (lastAttempted) {\n showOutOfOptionsMessages(resource, lastAttempted);\n }\n return [2 /*return*/];\n }\n });\n });\n };\n Utils.attemptResourceWithToken = function (resource, openTokenService, authService) {\n return __awaiter(this, void 0, void 0, function () {\n var tokenService, tokenMessage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n tokenService = authService.getService(dist_commonjs_1.ServiceProfile.AUTH_1_TOKEN);\n if (!tokenService) return [3 /*break*/, 3];\n return [4 /*yield*/, openTokenService(resource, tokenService)];\n case 1:\n tokenMessage = _a.sent();\n if (!(tokenMessage && tokenMessage.accessToken)) return [3 /*break*/, 3];\n return [4 /*yield*/, resource.getData(tokenMessage)];\n case 2:\n _a.sent();\n return [2 /*return*/, resource];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n Utils.loadExternalResourcesAuth09 = function (resources, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth09(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n // IIIF auth api pre v1.0\n // Keeping this around for now until the auth 1.0 implementation is stable\n Utils.loadExternalResourceAuth09 = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n if (options && options.pessimisticAccessControl) {\n // pessimistic: access control cookies may have been deleted.\n // always request the access token for every access controlled info.json request\n // returned access tokens are not stored, therefore the login window flashes for every request.\n resource\n .getData()\n .then(function () {\n if (resource.isAccessControlled()) {\n // if the resource has a click through service, use that.\n if (resource.clickThroughService) {\n resolve(clickThrough(resource));\n //} else if(resource.restrictedService) {\n resolve(restricted(resource));\n }\n else {\n login(resource)\n .then(function () {\n getAccessToken(resource, true)\n .then(function (token) {\n resource\n .getData(token)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n }\n else {\n // this info.json isn\'t access controlled, therefore no need to request an access token.\n resolve(resource);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // optimistic: access control cookies may not have been deleted.\n // store access tokens to avoid login window flashes.\n // if cookies are deleted a page refresh is required.\n // try loading the resource using an access token that matches the info.json domain.\n // if an access token is found, request the resource using it regardless of whether it is access controlled.\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n // if the info.json loaded using the stored access token\n if (resource.status === dist_commonjs_2.OK) {\n resolve(handleResourceResponse(resource));\n }\n else {\n // otherwise, load the resource data to determine the correct access control services.\n // if access controlled, do login.\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n // if (resource.restrictedService){\n // reject(Utils.createRestrictedError());\n // } else {\n reject(Utils.createAuthorizationFailedError());\n //}\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n else {\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n });\n };\n Utils.createError = function (name, message) {\n var error = new Error();\n error.message = message;\n error.name = String(name);\n return error;\n };\n Utils.createAuthorizationFailedError = function () {\n return Utils.createError(internal_1.StatusCode.AUTHORIZATION_FAILED, "Authorization failed");\n };\n Utils.createRestrictedError = function () {\n return Utils.createError(internal_1.StatusCode.RESTRICTED, "Restricted");\n };\n Utils.createInternalServerError = function (message) {\n return Utils.createError(internal_1.StatusCode.INTERNAL_SERVER_ERROR, message);\n };\n Utils.authorize = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) {\n return new Promise(function (resolve, reject) {\n resource.getData().then(function () {\n if (resource.isAccessControlled()) {\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource); // happy path ended\n }\n else {\n // the stored token is no good for this resource\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // There was no stored token, but the user might have a cookie that will grant a token\n getAccessToken(resource, false).then(function (accessToken) {\n if (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n // try using the fresh access token\n resource\n .getData(accessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource);\n }\n else {\n // User has a token, but it\'s not good enough\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n // not able to store access token\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // The user did not have a cookie that granted a token\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n });\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // this info.json isn\'t access controlled, therefore there\'s no need to request an access token\n resolve(resource);\n }\n });\n });\n };\n Utils.showAuthInteraction = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject) {\n if (resource.status === dist_commonjs_2.MOVED_TEMPORARILY && !resource.isResponseHandled) {\n // if the resource was redirected to a degraded version\n // and the response hasn\'t been handled yet.\n // if the client wishes to trigger a login, set resource.isResponseHandled to true\n // and call loadExternalResources() again passing the resource.\n resolve(resource);\n // } else if (resource.restrictedService) {\n // resolve(restricted(resource));\n // // TODO: move to next etc\n }\n else if (resource.clickThroughService && !resource.isResponseHandled) {\n // if the resource has a click through service, use that.\n clickThrough(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n else {\n // get an access token\n login(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n };\n Utils.getService = function (resource, profile) {\n var services = this.getServices(resource);\n for (var i = 0; i < services.length; i++) {\n var service = services[i];\n if (service.getProfile() === profile) {\n return service;\n }\n }\n return null;\n };\n Utils.getResourceById = function (parentResource, id) {\n return (Utils.traverseAndFind(parentResource.__jsonld, "@id", id));\n };\n /**\n * Does a depth first traversal of an Object, returning an Object that\n * matches provided k and v arguments\n * @example Utils.traverseAndFind({foo: \'bar\'}, \'foo\', \'bar\')\n */\n Utils.traverseAndFind = function (object, k, v) {\n if (object.hasOwnProperty(k) && object[k] === v) {\n return object;\n }\n for (var i = 0; i < Object.keys(object).length; i++) {\n if (typeof object[Object.keys(object)[i]] === "object") {\n var o = Utils.traverseAndFind(object[Object.keys(object)[i]], k, v);\n if (o != null) {\n return o;\n }\n }\n }\n return undefined;\n };\n Utils.getServices = function (resource, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.onlyService, onlyService = _c === void 0 ? false : _c, _d = _b.onlyServices, onlyServices = _d === void 0 ? false : _d, _e = _b.skipParentResources, skipParentResources = _e === void 0 ? false : _e;\n var services = [];\n // Resources can reference "services" on the manifest. This is a bit of a hack to just get the services from the manifest\n // too. What would be better is if this was used as a "Map" of full services.\n // So when you come across { id: \'...\' } without any data, you can "lookup" services from the manifest.\n // I would have implemented this if I was confident that it was reliable. Instead, I opted for the safest option that\n // should not break any existing services.\n if (!skipParentResources &&\n resource &&\n resource.options &&\n resource.options.resource &&\n resource.options.resource !== resource) {\n services.push.apply(services, Utils.getServices(resource.options.resource, { onlyServices: true }));\n }\n var service = !onlyServices\n ? (resource.__jsonld || resource).service || []\n : [];\n // coerce to array\n if (!Array.isArray(service)) {\n service = [service];\n }\n if (!onlyService) {\n // Some resources also have a `.services` property.\n // https://iiif.io/api/presentation/3.0/#services\n service.push.apply(service, ((resource.__jsonld || resource).services || []));\n }\n if (service.length === 0) {\n return services;\n }\n for (var i = 0; i < service.length; i++) {\n var s = service[i];\n if (typeof s === "string") {\n var r = this.getResourceById(resource.options.resource, s);\n if (r) {\n services.push(new internal_1.Service(r.__jsonld || r, resource.options));\n }\n }\n else {\n services.push(new internal_1.Service(s, resource.options));\n }\n }\n return services;\n };\n Utils.getTemporalComponent = function (target) {\n var temporal = /t=([^&]+)/g.exec(target);\n var t = null;\n if (temporal && temporal[1]) {\n t = temporal[1].split(",");\n }\n return t;\n };\n return Utils;\n}());\nexports.Utils = Utils;\n\n\n//# sourceURL=webpack://manifesto/./src/Utils.ts?')},"./src/index.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.parseManifest = exports.loadManifest = void 0;\n__exportStar(__webpack_require__(/*! ./internal */ "./src/internal.ts"), exports);\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/**\nInitiates downloading an IIIF manifest json file from URL. Returns a Promise\nto allow subsequent processing on a successful fetch.\n\n@param url string containing the URL to Fetch\n@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text.\n**/\nvar loadManifest = function (url) {\n return Utils_1.Utils.loadManifest(url);\n};\nexports.loadManifest = loadManifest;\n/**\nParses IIIF manifest file to return a manifesto Manifest instance\n\n@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file.\n@param options? TODO Not yet documented\n@returns instance of Manifest class.\n**/\nvar parseManifest = function (manifest, options) {\n return Utils_1.Utils.parseManifest(manifest, options);\n};\nexports.parseManifest = parseManifest;\n\n\n//# sourceURL=webpack://manifesto/./src/index.ts?')},"./src/internal.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./JSONLDResource */ "./src/JSONLDResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestResource */ "./src/ManifestResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Resource */ "./src/Resource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IIIFResource */ "./src/IIIFResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./SpecificResource */ "./src/SpecificResource.ts"), exports);\n//export * from "./SpecificResourceForTarget";\n//export * from "./SpecificResourceForBody";\n__exportStar(__webpack_require__(/*! ./AnnotationBody */ "./src/AnnotationBody.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Light */ "./src/Light.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Camera */ "./src/Camera.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationBodyParser */ "./src/AnnotationBodyParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Annotation */ "./src/Annotation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationList */ "./src/AnnotationList.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationPage */ "./src/AnnotationPage.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Canvas */ "./src/Canvas.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Collection */ "./src/Collection.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Duration */ "./src/Duration.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IAccessToken */ "./src/IAccessToken.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalImageResourceData */ "./src/IExternalImageResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResource */ "./src/IExternalResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceData */ "./src/IExternalResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceOptions */ "./src/IExternalResourceOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IManifestoOptions */ "./src/IManifestoOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LabelValuePair */ "./src/LabelValuePair.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Language */ "./src/Language.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LanguageMap */ "./src/LanguageMap.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PropertyValue */ "./src/PropertyValue.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Manifest */ "./src/Manifest.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestType */ "./src/ManifestType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PointSelector */ "./src/PointSelector.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Range */ "./src/Range.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Rendering */ "./src/Rendering.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Scene */ "./src/Scene.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Sequence */ "./src/Sequence.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Serialisation */ "./src/Serialisation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Service */ "./src/Service.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Size */ "./src/Size.ts"), exports);\n__exportStar(__webpack_require__(/*! ./StatusCode */ "./src/StatusCode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumb */ "./src/Thumb.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumbnail */ "./src/Thumbnail.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TransformParser */ "./src/TransformParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNode */ "./src/TreeNode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNodeType */ "./src/TreeNodeType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Utils */ "./src/Utils.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./RotateTransform */ "./src/RotateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ScaleTransform */ "./src/ScaleTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Color */ "./src/Color.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Geometry3d */ "./src/Geometry3d.ts"), exports);\n\n\n//# sourceURL=webpack://manifesto/./src/internal.ts?')},"./node_modules/unfetch/dist/unfetch.module.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},s.onerror=r,s.withCredentials="include"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})}\n//# sourceMappingURL=unfetch.module.js.map\n\n\n//# sourceURL=webpack://manifesto/./node_modules/unfetch/dist/unfetch.module.js?')},"node-fetch":t=>{"use strict";t.exports=node-fetch},"./node_modules/threejs-math/build/threejs-math.cjs":(__unused_webpack_module,exports)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nconst REVISION = '144dev';\nconst MOUSE = {\n\tLEFT: 0,\n\tMIDDLE: 1,\n\tRIGHT: 2,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2\n};\nconst TOUCH = {\n\tROTATE: 0,\n\tPAN: 1,\n\tDOLLY_PAN: 2,\n\tDOLLY_ROTATE: 3\n};\nconst CullFaceNone = 0;\nconst CullFaceBack = 1;\nconst CullFaceFront = 2;\nconst CullFaceFrontBack = 3;\nconst BasicShadowMap = 0;\nconst PCFShadowMap = 1;\nconst PCFSoftShadowMap = 2;\nconst VSMShadowMap = 3;\nconst FrontSide = 0;\nconst BackSide = 1;\nconst DoubleSide = 2;\nconst NoBlending = 0;\nconst NormalBlending = 1;\nconst AdditiveBlending = 2;\nconst SubtractiveBlending = 3;\nconst MultiplyBlending = 4;\nconst CustomBlending = 5;\nconst AddEquation = 100;\nconst SubtractEquation = 101;\nconst ReverseSubtractEquation = 102;\nconst MinEquation = 103;\nconst MaxEquation = 104;\nconst ZeroFactor = 200;\nconst OneFactor = 201;\nconst SrcColorFactor = 202;\nconst OneMinusSrcColorFactor = 203;\nconst SrcAlphaFactor = 204;\nconst OneMinusSrcAlphaFactor = 205;\nconst DstAlphaFactor = 206;\nconst OneMinusDstAlphaFactor = 207;\nconst DstColorFactor = 208;\nconst OneMinusDstColorFactor = 209;\nconst SrcAlphaSaturateFactor = 210;\nconst NeverDepth = 0;\nconst AlwaysDepth = 1;\nconst LessDepth = 2;\nconst LessEqualDepth = 3;\nconst EqualDepth = 4;\nconst GreaterEqualDepth = 5;\nconst GreaterDepth = 6;\nconst NotEqualDepth = 7;\nconst MultiplyOperation = 0;\nconst MixOperation = 1;\nconst AddOperation = 2;\nconst NoToneMapping = 0;\nconst LinearToneMapping = 1;\nconst ReinhardToneMapping = 2;\nconst CineonToneMapping = 3;\nconst ACESFilmicToneMapping = 4;\nconst CustomToneMapping = 5;\nconst UVMapping = 300;\nconst CubeReflectionMapping = 301;\nconst CubeRefractionMapping = 302;\nconst EquirectangularReflectionMapping = 303;\nconst EquirectangularRefractionMapping = 304;\nconst CubeUVReflectionMapping = 306;\nconst RepeatWrapping = 1000;\nconst ClampToEdgeWrapping = 1001;\nconst MirroredRepeatWrapping = 1002;\nconst NearestFilter = 1003;\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004;\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005;\nconst LinearFilter = 1006;\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007;\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008;\nconst UnsignedByteType = 1009;\nconst ByteType = 1010;\nconst ShortType = 1011;\nconst UnsignedShortType = 1012;\nconst IntType = 1013;\nconst UnsignedIntType = 1014;\nconst FloatType = 1015;\nconst HalfFloatType = 1016;\nconst UnsignedShort4444Type = 1017;\nconst UnsignedShort5551Type = 1018;\nconst UnsignedInt248Type = 1020;\nconst AlphaFormat = 1021;\nconst RGBFormat = 1022; // @deprecated since r137\n\nconst RGBAFormat = 1023;\nconst LuminanceFormat = 1024;\nconst LuminanceAlphaFormat = 1025;\nconst DepthFormat = 1026;\nconst DepthStencilFormat = 1027;\nconst RedFormat = 1028;\nconst RedIntegerFormat = 1029;\nconst RGFormat = 1030;\nconst RGIntegerFormat = 1031;\nconst RGBAIntegerFormat = 1033;\nconst RGB_S3TC_DXT1_Format = 33776;\nconst RGBA_S3TC_DXT1_Format = 33777;\nconst RGBA_S3TC_DXT3_Format = 33778;\nconst RGBA_S3TC_DXT5_Format = 33779;\nconst RGB_PVRTC_4BPPV1_Format = 35840;\nconst RGB_PVRTC_2BPPV1_Format = 35841;\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\nconst RGB_ETC1_Format = 36196;\nconst RGB_ETC2_Format = 37492;\nconst RGBA_ETC2_EAC_Format = 37496;\nconst RGBA_ASTC_4x4_Format = 37808;\nconst RGBA_ASTC_5x4_Format = 37809;\nconst RGBA_ASTC_5x5_Format = 37810;\nconst RGBA_ASTC_6x5_Format = 37811;\nconst RGBA_ASTC_6x6_Format = 37812;\nconst RGBA_ASTC_8x5_Format = 37813;\nconst RGBA_ASTC_8x6_Format = 37814;\nconst RGBA_ASTC_8x8_Format = 37815;\nconst RGBA_ASTC_10x5_Format = 37816;\nconst RGBA_ASTC_10x6_Format = 37817;\nconst RGBA_ASTC_10x8_Format = 37818;\nconst RGBA_ASTC_10x10_Format = 37819;\nconst RGBA_ASTC_12x10_Format = 37820;\nconst RGBA_ASTC_12x12_Format = 37821;\nconst RGBA_BPTC_Format = 36492;\nconst LoopOnce = 2200;\nconst LoopRepeat = 2201;\nconst LoopPingPong = 2202;\nconst InterpolateDiscrete = 2300;\nconst InterpolateLinear = 2301;\nconst InterpolateSmooth = 2302;\nconst ZeroCurvatureEnding = 2400;\nconst ZeroSlopeEnding = 2401;\nconst WrapAroundEnding = 2402;\nconst NormalAnimationBlendMode = 2500;\nconst AdditiveAnimationBlendMode = 2501;\nconst TrianglesDrawMode = 0;\nconst TriangleStripDrawMode = 1;\nconst TriangleFanDrawMode = 2;\nconst LinearEncoding = 3000;\nconst sRGBEncoding = 3001;\nconst BasicDepthPacking = 3200;\nconst RGBADepthPacking = 3201;\nconst TangentSpaceNormalMap = 0;\nconst ObjectSpaceNormalMap = 1; // Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\n\nconst NoColorSpace = '';\nconst SRGBColorSpace = 'srgb';\nconst LinearSRGBColorSpace = 'srgb-linear';\nconst ZeroStencilOp = 0;\nconst KeepStencilOp = 7680;\nconst ReplaceStencilOp = 7681;\nconst IncrementStencilOp = 7682;\nconst DecrementStencilOp = 7683;\nconst IncrementWrapStencilOp = 34055;\nconst DecrementWrapStencilOp = 34056;\nconst InvertStencilOp = 5386;\nconst NeverStencilFunc = 512;\nconst LessStencilFunc = 513;\nconst EqualStencilFunc = 514;\nconst LessEqualStencilFunc = 515;\nconst GreaterStencilFunc = 516;\nconst NotEqualStencilFunc = 517;\nconst GreaterEqualStencilFunc = 518;\nconst AlwaysStencilFunc = 519;\nconst StaticDrawUsage = 35044;\nconst DynamicDrawUsage = 35048;\nconst StreamDrawUsage = 35040;\nconst StaticReadUsage = 35045;\nconst DynamicReadUsage = 35049;\nconst StreamReadUsage = 35041;\nconst StaticCopyUsage = 35046;\nconst DynamicCopyUsage = 35050;\nconst StreamCopyUsage = 35042;\nconst GLSL1 = '100';\nconst GLSL3 = '300 es';\nconst _SRGBAFormat = 1035; // fallback for WebGL 1\n\nclass Vector2 {\n\tconstructor(x = 0, y = 0) {\n\t\tVector2.prototype.isVector2 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tget width() {\n\t\treturn this.x;\n\t}\n\n\tset width(value) {\n\t\tthis.x = value;\n\t}\n\n\tget height() {\n\t\treturn this.y;\n\t}\n\n\tset height(value) {\n\t\tthis.y = value;\n\t}\n\n\tset(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\treturn this;\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6];\n\t\tthis.y = e[1] * x + e[4] * y + e[7];\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y;\n\t}\n\n\tcross(v) {\n\t\treturn this.x * v.y - this.y * v.x;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tangle() {\n\t\t// computes the angle in radians with respect to the positive x-axis\n\t\tconst angle = Math.atan2(-this.y, -this.x) + Math.PI;\n\t\treturn angle;\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \treturn this;\n\t// }\n\n\n\trotateAround(center, angle) {\n\t\tconst c = Math.cos(angle),\n\t\t\t\t\ts = Math.sin(angle);\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\t\treturn this;\n\t}\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t}\n\n}\n\nconst _lut = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff'];\nlet _seed = 1234567;\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI; // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\nfunction generateUUID() {\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[d0 & 0xff] + _lut[d0 >> 8 & 0xff] + _lut[d0 >> 16 & 0xff] + _lut[d0 >> 24 & 0xff] + '-' + _lut[d1 & 0xff] + _lut[d1 >> 8 & 0xff] + '-' + _lut[d1 >> 16 & 0x0f | 0x40] + _lut[d1 >> 24 & 0xff] + '-' + _lut[d2 & 0x3f | 0x80] + _lut[d2 >> 8 & 0xff] + '-' + _lut[d2 >> 16 & 0xff] + _lut[d2 >> 24 & 0xff] + _lut[d3 & 0xff] + _lut[d3 >> 8 & 0xff] + _lut[d3 >> 16 & 0xff] + _lut[d3 >> 24 & 0xff]; // .toLowerCase() here flattens concatenated strings to save heap memory space.\n\n\treturn uuid.toLowerCase();\n}\n\nfunction clamp(value, min, max) {\n\treturn Math.max(min, Math.min(max, value));\n} // compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\n\n\nfunction euclideanModulo(n, m) {\n\treturn (n % m + m) % m;\n} // Linear mapping from range to range \n\n\nfunction mapLinear(x, a1, a2, b1, b2) {\n\treturn b1 + (x - a1) * (b2 - b1) / (a2 - a1);\n} // https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\nfunction inverseLerp(x, y, value) {\n\tif (x !== y) {\n\t\treturn (value - x) / (y - x);\n\t} else {\n\t\treturn 0;\n\t}\n} // https://en.wikipedia.org/wiki/Linear_interpolation\n\n\nfunction lerp(x, y, t) {\n\treturn (1 - t) * x + t * y;\n} // http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\n\n\nfunction damp(x, y, lambda, dt) {\n\treturn lerp(x, y, 1 - Math.exp(-lambda * dt));\n} // https://www.desmos.com/calculator/vcsjnyz7x4\n\n\nfunction pingpong(x, length = 1) {\n\treturn length - Math.abs(euclideanModulo(x, length * 2) - length);\n} // http://en.wikipedia.org/wiki/Smoothstep\n\n\nfunction smoothstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * (3 - 2 * x);\n}\n\nfunction smootherstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * x * (x * (x * 6 - 15) + 10);\n} // Random integer from interval\n\n\nfunction randInt(low, high) {\n\treturn low + Math.floor(Math.random() * (high - low + 1));\n} // Random float from interval\n\n\nfunction randFloat(low, high) {\n\treturn low + Math.random() * (high - low);\n} // Random float from <-range/2, range/2> interval\n\n\nfunction randFloatSpread(range) {\n\treturn range * (0.5 - Math.random());\n} // Deterministic pseudo-random float in the interval [ 0, 1 ]\n\n\nfunction seededRandom(s) {\n\tif (s !== undefined) _seed = s; // Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\tt = Math.imul(t ^ t >>> 15, t | 1);\n\tt ^= t + Math.imul(t ^ t >>> 7, t | 61);\n\treturn ((t ^ t >>> 14) >>> 0) / 4294967296;\n}\n\nfunction degToRad(degrees) {\n\treturn degrees * DEG2RAD;\n}\n\nfunction radToDeg(radians) {\n\treturn radians * RAD2DEG;\n}\n\nfunction isPowerOfTwo(value) {\n\treturn (value & value - 1) === 0 && value !== 0;\n}\n\nfunction ceilPowerOfTwo(value) {\n\treturn Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n}\n\nfunction floorPowerOfTwo(value) {\n\treturn Math.pow(2, Math.floor(Math.log(value) / Math.LN2));\n}\n\nfunction setQuaternionFromProperEuler(q, a, b, c, order) {\n\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\t// rotations are applied to the axes in the order specified by 'order'\n\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t// angles are in radians\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\tconst c2 = cos(b / 2);\n\tconst s2 = sin(b / 2);\n\tconst c13 = cos((a + c) / 2);\n\tconst s13 = sin((a + c) / 2);\n\tconst c1_3 = cos((a - c) / 2);\n\tconst s1_3 = sin((a - c) / 2);\n\tconst c3_1 = cos((c - a) / 2);\n\tconst s3_1 = sin((c - a) / 2);\n\n\tswitch (order) {\n\t\tcase 'XYX':\n\t\t\tq.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order);\n\t}\n}\n\nfunction denormalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\t\t\treturn value / 255.0;\n\n\t\tcase Int16Array:\n\t\t\treturn Math.max(value / 32767.0, -1.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.max(value / 127.0, -1.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nfunction normalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn Math.round(value * 65535.0);\n\n\t\tcase Uint8Array:\n\t\t\treturn Math.round(value * 255.0);\n\n\t\tcase Int16Array:\n\t\t\treturn Math.round(value * 32767.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.round(value * 127.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nvar MathUtils = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\tgenerateUUID: generateUUID,\n\tclamp: clamp,\n\teuclideanModulo: euclideanModulo,\n\tmapLinear: mapLinear,\n\tinverseLerp: inverseLerp,\n\tlerp: lerp,\n\tdamp: damp,\n\tpingpong: pingpong,\n\tsmoothstep: smoothstep,\n\tsmootherstep: smootherstep,\n\trandInt: randInt,\n\trandFloat: randFloat,\n\trandFloatSpread: randFloatSpread,\n\tseededRandom: seededRandom,\n\tdegToRad: degToRad,\n\tradToDeg: radToDeg,\n\tisPowerOfTwo: isPowerOfTwo,\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\tnormalize: normalize,\n\tdenormalize: denormalize\n});\n\nclass Quaternion {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tthis.isQuaternion = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\t}\n\n\tstatic slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) {\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\t\tlet x0 = src0[srcOffset0 + 0],\n\t\t\t\ty0 = src0[srcOffset0 + 1],\n\t\t\t\tz0 = src0[srcOffset0 + 2],\n\t\t\t\tw0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1 + 0],\n\t\t\t\t\ty1 = src1[srcOffset1 + 1],\n\t\t\t\t\tz1 = src1[srcOffset1 + 2],\n\t\t\t\t\tw1 = src1[srcOffset1 + 3];\n\n\t\tif (t === 0) {\n\t\t\tdst[dstOffset + 0] = x0;\n\t\t\tdst[dstOffset + 1] = y0;\n\t\t\tdst[dstOffset + 2] = z0;\n\t\t\tdst[dstOffset + 3] = w0;\n\t\t\treturn;\n\t\t}\n\n\t\tif (t === 1) {\n\t\t\tdst[dstOffset + 0] = x1;\n\t\t\tdst[dstOffset + 1] = y1;\n\t\t\tdst[dstOffset + 2] = z1;\n\t\t\tdst[dstOffset + 3] = w1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\t\t\tdir = cos >= 0 ? 1 : -1,\n\t\t\t\t\t\tsqrSin = 1 - cos * cos; // Skip the Slerp for tiny steps to avoid numeric problems:\n\n\t\t\tif (sqrSin > Number.EPSILON) {\n\t\t\t\tconst sin = Math.sqrt(sqrSin),\n\t\t\t\t\t\t\tlen = Math.atan2(sin, cos * dir);\n\t\t\t\ts = Math.sin(s * len) / sin;\n\t\t\t\tt = Math.sin(t * len) / sin;\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir; // Normalize in case we just did a lerp:\n\n\t\t\tif (s === 1 - t) {\n\t\t\t\tconst f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\t\t\t}\n\t\t}\n\n\t\tdst[dstOffset] = x0;\n\t\tdst[dstOffset + 1] = y0;\n\t\tdst[dstOffset + 2] = z0;\n\t\tdst[dstOffset + 3] = w0;\n\t}\n\n\tstatic multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {\n\t\tconst x0 = src0[srcOffset0];\n\t\tconst y0 = src0[srcOffset0 + 1];\n\t\tconst z0 = src0[srcOffset0 + 2];\n\t\tconst w0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1];\n\t\tconst y1 = src1[srcOffset1 + 1];\n\t\tconst z1 = src1[srcOffset1 + 2];\n\t\tconst w1 = src1[srcOffset1 + 3];\n\t\tdst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\t\treturn dst;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget w() {\n\t\treturn this._w;\n\t}\n\n\tset w(value) {\n\t\tthis._w = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._w);\n\t}\n\n\tcopy(quaternion) {\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromEuler(euler, update) {\n\t\tconst x = euler._x,\n\t\t\t\t\ty = euler._y,\n\t\t\t\t\tz = euler._z,\n\t\t\t\t\torder = euler._order; // http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\t\tconst c1 = cos(x / 2);\n\t\tconst c2 = cos(y / 2);\n\t\tconst c3 = cos(z / 2);\n\t\tconst s1 = sin(x / 2);\n\t\tconst s2 = sin(y / 2);\n\t\tconst s3 = sin(z / 2);\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tif (update !== false) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromAxisAngle(axis, angle) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\t\t// assumes axis is normalized\n\t\tconst halfAngle = angle / 2,\n\t\t\t\t\ts = Math.sin(halfAngle);\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos(halfAngle);\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10],\n\t\t\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif (trace > 0) {\n\t\t\tconst s = 0.5 / Math.sqrt(trace + 1.0);\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = (m32 - m23) * s;\n\t\t\tthis._y = (m13 - m31) * s;\n\t\t\tthis._z = (m21 - m12) * s;\n\t\t} else if (m11 > m22 && m11 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\t\t\tthis._w = (m32 - m23) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = (m12 + m21) / s;\n\t\t\tthis._z = (m13 + m31) / s;\n\t\t} else if (m22 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\t\t\tthis._w = (m13 - m31) / s;\n\t\t\tthis._x = (m12 + m21) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = (m23 + m32) / s;\n\t\t} else {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\t\t\tthis._w = (m21 - m12) / s;\n\t\t\tthis._x = (m13 + m31) / s;\n\t\t\tthis._y = (m23 + m32) / s;\n\t\t\tthis._z = 0.25 * s;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromUnitVectors(vFrom, vTo) {\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\t\tlet r = vFrom.dot(vTo) + 1;\n\n\t\tif (r < Number.EPSILON) {\n\t\t\t// vFrom and vTo point in opposite directions\n\t\t\tr = 0;\n\n\t\t\tif (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n\t\t\t\tthis._x = -vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\t\t\t} else {\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = -vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\t\t\t}\n\t\t} else {\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\t\t}\n\n\t\treturn this.normalize();\n\t}\n\n\tangleTo(q) {\n\t\treturn 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));\n\t}\n\n\trotateTowards(q, step) {\n\t\tconst angle = this.angleTo(q);\n\t\tif (angle === 0) return this;\n\t\tconst t = Math.min(1, step / angle);\n\t\tthis.slerp(q, t);\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\treturn this.set(0, 0, 0, 1);\n\t}\n\n\tinvert() {\n\t\t// quaternion is assumed to have unit length\n\t\treturn this.conjugate();\n\t}\n\n\tconjugate() {\n\t\tthis._x *= -1;\n\t\tthis._y *= -1;\n\t\tthis._z *= -1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\t}\n\n\tlengthSq() {\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n\t}\n\n\tnormalize() {\n\t\tlet l = this.length();\n\n\t\tif (l === 0) {\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\t\t} else {\n\t\t\tl = 1 / l;\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tmultiply(q) {\n\t\treturn this.multiplyQuaternions(this, q);\n\t}\n\n\tpremultiply(q) {\n\t\treturn this.multiplyQuaternions(q, this);\n\t}\n\n\tmultiplyQuaternions(a, b) {\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\t\tconst qax = a._x,\n\t\t\t\t\tqay = a._y,\n\t\t\t\t\tqaz = a._z,\n\t\t\t\t\tqaw = a._w;\n\t\tconst qbx = b._x,\n\t\t\t\t\tqby = b._y,\n\t\t\t\t\tqbz = b._z,\n\t\t\t\t\tqbw = b._w;\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerp(qb, t) {\n\t\tif (t === 0) return this;\n\t\tif (t === 1) return this.copy(qb);\n\t\tconst x = this._x,\n\t\t\t\t\ty = this._y,\n\t\t\t\t\tz = this._z,\n\t\t\t\t\tw = this._w; // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif (cosHalfTheta < 0) {\n\t\t\tthis._w = -qb._w;\n\t\t\tthis._x = -qb._x;\n\t\t\tthis._y = -qb._y;\n\t\t\tthis._z = -qb._z;\n\t\t\tcosHalfTheta = -cosHalfTheta;\n\t\t} else {\n\t\t\tthis.copy(qb);\n\t\t}\n\n\t\tif (cosHalfTheta >= 1.0) {\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif (sqrSinHalfTheta <= Number.EPSILON) {\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\t\t\tthis.normalize();\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt(sqrSinHalfTheta);\n\t\tconst halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);\n\t\tconst ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n\t\t\t\t\tratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n\t\tthis._w = w * ratioA + this._w * ratioB;\n\t\tthis._x = x * ratioA + this._x * ratioB;\n\t\tthis._y = y * ratioA + this._y * ratioB;\n\t\tthis._z = z * ratioA + this._z * ratioB;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerpQuaternions(qa, qb, t) {\n\t\treturn this.copy(qa).slerp(qb, t);\n\t}\n\n\trandom() {\n\t\t// Derived from http://planning.cs.uiuc.edu/node198.html\n\t\t// Note, this source uses w, x, y, z ordering,\n\t\t// so we swap the order below.\n\t\tconst u1 = Math.random();\n\t\tconst sqrt1u1 = Math.sqrt(1 - u1);\n\t\tconst sqrtu1 = Math.sqrt(u1);\n\t\tconst u2 = 2 * Math.PI * Math.random();\n\t\tconst u3 = 2 * Math.PI * Math.random();\n\t\treturn this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2));\n\t}\n\n\tequals(quaternion) {\n\t\treturn quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis._x = array[offset];\n\t\tthis._y = array[offset + 1];\n\t\tthis._z = array[offset + 2];\n\t\tthis._w = array[offset + 3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis._x = attribute.getX( index );\n\t// \tthis._y = attribute.getY( index );\n\t// \tthis._z = attribute.getZ( index );\n\t// \tthis._w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\t}\n\n}\n\nclass Vector3 {\n\tconstructor(x = 0, y = 0, z = 0) {\n\t\tVector3.prototype.isVector3 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}\n\n\tset(x, y, z) {\n\t\tif (z === undefined) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\treturn this;\n\t}\n\n\tmultiplyVectors(a, b) {\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\t\treturn this;\n\t}\n\n\tapplyEuler(euler) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromEuler(euler));\n\t}\n\n\tapplyAxisAngle(axis, angle) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromAxisAngle(axis, angle));\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6] * z;\n\t\tthis.y = e[1] * x + e[4] * y + e[7] * z;\n\t\tthis.z = e[2] * x + e[5] * y + e[8] * z;\n\t\treturn this;\n\t}\n\n\tapplyNormalMatrix(m) {\n\t\treturn this.applyMatrix3(m).normalize();\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\tthis.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w;\n\t\tthis.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w;\n\t\tthis.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w;\n\t\treturn this;\n\t}\n\n\tapplyQuaternion(q) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst qx = q.x,\n\t\t\t\t\tqy = q.y,\n\t\t\t\t\tqz = q.z,\n\t\t\t\t\tqw = q.w; // calculate quat * vector\n\n\t\tconst ix = qw * x + qy * z - qz * y;\n\t\tconst iy = qw * y + qz * x - qx * z;\n\t\tconst iz = qw * z + qx * y - qy * x;\n\t\tconst iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n\t\tthis.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t\tthis.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t\tthis.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t\treturn this;\n\t} // project( camera ) {\n\t// \treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\t// }\n\t// unproject( camera ) {\n\t// \treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\t// }\n\n\n\ttransformDirection(m) {\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z;\n\t\treturn this.normalize();\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t} // TODO lengthSquared?\n\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\treturn this;\n\t}\n\n\tcross(v) {\n\t\treturn this.crossVectors(this, v);\n\t}\n\n\tcrossVectors(a, b) {\n\t\tconst ax = a.x,\n\t\t\t\t\tay = a.y,\n\t\t\t\t\taz = a.z;\n\t\tconst bx = b.x,\n\t\t\t\t\tby = b.y,\n\t\t\t\t\tbz = b.z;\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\t\treturn this;\n\t}\n\n\tprojectOnVector(v) {\n\t\tconst denominator = v.lengthSq();\n\t\tif (denominator === 0) return this.set(0, 0, 0);\n\t\tconst scalar = v.dot(this) / denominator;\n\t\treturn this.copy(v).multiplyScalar(scalar);\n\t}\n\n\tprojectOnPlane(planeNormal) {\n\t\t_vector$3.copy(this).projectOnVector(planeNormal);\n\n\t\treturn this.sub(_vector$3);\n\t}\n\n\treflect(normal) {\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\t\treturn this.sub(_vector$3.copy(normal).multiplyScalar(2 * this.dot(normal)));\n\t}\n\n\tangleTo(v) {\n\t\tconst denominator = Math.sqrt(this.lengthSq() * v.lengthSq());\n\t\tif (denominator === 0) return Math.PI / 2;\n\t\tconst theta = this.dot(v) / denominator; // clamp, to handle numerical problems\n\n\t\treturn Math.acos(clamp(theta, -1, 1));\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y,\n\t\t\t\t\tdz = this.z - v.z;\n\t\treturn dx * dx + dy * dy + dz * dz;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);\n\t}\n\n\tsetFromSpherical(s) {\n\t\treturn this.setFromSphericalCoords(s.radius, s.phi, s.theta);\n\t}\n\n\tsetFromSphericalCoords(radius, phi, theta) {\n\t\tconst sinPhiRadius = Math.sin(phi) * radius;\n\t\tthis.x = sinPhiRadius * Math.sin(theta);\n\t\tthis.y = Math.cos(phi) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromCylindrical(c) {\n\t\treturn this.setFromCylindricalCoords(c.radius, c.theta, c.y);\n\t}\n\n\tsetFromCylindricalCoords(radius, theta, y) {\n\t\tthis.x = radius * Math.sin(theta);\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromMatrixPosition(m) {\n\t\tconst e = m.elements;\n\t\tthis.x = e[12];\n\t\tthis.y = e[13];\n\t\tthis.z = e[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrixScale(m) {\n\t\tconst sx = this.setFromMatrixColumn(m, 0).length();\n\t\tconst sy = this.setFromMatrixColumn(m, 1).length();\n\t\tconst sz = this.setFromMatrixColumn(m, 2).length();\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\t\treturn this;\n\t}\n\n\tsetFromMatrixColumn(m, index) {\n\t\treturn this.fromArray(m.elements, index * 4);\n\t}\n\n\tsetFromMatrix3Column(m, index) {\n\t\treturn this.fromArray(m.elements, index * 3);\n\t}\n\n\tsetFromEuler(e) {\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\treturn this;\n\t}\n\n\trandomDirection() {\n\t\t// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\n\t\tconst u = (Math.random() - 0.5) * 2;\n\t\tconst t = Math.random() * Math.PI * 2;\n\t\tconst f = Math.sqrt(1 - u ** 2);\n\t\tthis.x = f * Math.cos(t);\n\t\tthis.y = f * Math.sin(t);\n\t\tthis.z = u;\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/new Vector3();\n\nconst _quaternion$1 = /*@__PURE__*/new Quaternion();\n\nconst _vector$2 = /*@__PURE__*/new Vector2();\n\nclass Box2 {\n\tconstructor(min = new Vector2(+Infinity, +Infinity), max = new Vector2(-Infinity, -Infinity)) {\n\t\tthis.isBox2 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$2.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = +Infinity;\n\t\tthis.max.x = this.max.y = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y;\n\t}\n\n\tgetCenter(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 4 splitting planes to rule out intersections\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$2.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max);\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nclass Box3 {\n\tconstructor(min = new Vector3(+Infinity, +Infinity, +Infinity), max = new Vector3(-Infinity, -Infinity, -Infinity)) {\n\t\tthis.isBox3 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromArray(array) {\n\t\tlet minX = +Infinity;\n\t\tlet minY = +Infinity;\n\t\tlet minZ = +Infinity;\n\t\tlet maxX = -Infinity;\n\t\tlet maxY = -Infinity;\n\t\tlet maxZ = -Infinity;\n\n\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\tconst x = array[i];\n\t\t\tconst y = array[i + 1];\n\t\t\tconst z = array[i + 2];\n\t\t\tif (x < minX) minX = x;\n\t\t\tif (y < minY) minY = y;\n\t\t\tif (z < minZ) minZ = z;\n\t\t\tif (x > maxX) maxX = x;\n\t\t\tif (y > maxY) maxY = y;\n\t\t\tif (z > maxZ) maxZ = z;\n\t\t}\n\n\t\tthis.min.set(minX, minY, minZ);\n\t\tthis.max.set(maxX, maxY, maxZ);\n\t\treturn this;\n\t} // setFromBufferAttribute( attribute ) {\n\t// \tlet minX = + Infinity;\n\t// \tlet minY = + Infinity;\n\t// \tlet minZ = + Infinity;\n\t// \tlet maxX = - Infinity;\n\t// \tlet maxY = - Infinity;\n\t// \tlet maxZ = - Infinity;\n\t// \tfor ( let i = 0, l = attribute.count; i < l; i ++ ) {\n\t// \t\tconst x = attribute.getX( i );\n\t// \t\tconst y = attribute.getY( i );\n\t// \t\tconst z = attribute.getZ( i );\n\t// \t\tif ( x < minX ) minX = x;\n\t// \t\tif ( y < minY ) minY = y;\n\t// \t\tif ( z < minZ ) minZ = z;\n\t// \t\tif ( x > maxX ) maxX = x;\n\t// \t\tif ( y > maxY ) maxY = y;\n\t// \t\tif ( z > maxZ ) maxZ = z;\n\t// \t}\n\t// \tthis.min.set( minX, minY, minZ );\n\t// \tthis.max.set( maxX, maxY, maxZ );\n\t// \treturn this;\n\t// }\n\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$1.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tsetFromObject(object, precise = false) {\n\t\tthis.makeEmpty();\n\t\treturn this.expandByObject(object, precise);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = this.min.z = +Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n\t}\n\n\tgetCenter(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t} // expandByObject( object, precise = false ) {\n\t// \t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t// \t// accounting for both the object's, and children's, world transforms\n\t// \tobject.updateWorldMatrix( false, false );\n\t// \tconst geometry = object.geometry;\n\t// \tif ( geometry !== undefined ) {\n\t// \t\tif ( precise && geometry.attributes != undefined && geometry.attributes.position !== undefined ) {\n\t// \t\t\tconst position = geometry.attributes.position;\n\t// \t\t\tfor ( let i = 0, l = position.count; i < l; i ++ ) {\n\t// \t\t\t\t_vector.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );\n\t// \t\t\t\tthis.expandByPoint( _vector );\n\t// \t\t\t}\n\t// \t\t} else {\n\t// \t\t\tif ( geometry.boundingBox === null ) {\n\t// \t\t\t\tgeometry.computeBoundingBox();\n\t// \t\t\t}\n\t// \t\t\t_box.copy( geometry.boundingBox );\n\t// \t\t\t_box.applyMatrix4( object.matrixWorld );\n\t// \t\t\tthis.union( _box );\n\t// \t\t}\n\t// \t}\n\t// \tconst children = object.children;\n\t// \tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\t// \t\tthis.expandByObject( children[ i ], precise );\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint(sphere.center, _vector$1); // If that point is inside the sphere, the AABB and sphere intersect.\n\n\t\treturn _vector$1.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\t\tlet min, max;\n\n\t\tif (plane.normal.x > 0) {\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\t\t} else {\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\t\t}\n\n\t\tif (plane.normal.y > 0) {\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\t\t} else {\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\t\t}\n\n\t\tif (plane.normal.z > 0) {\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\t\t} else {\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\t\t}\n\n\t\treturn min <= -plane.constant && max >= -plane.constant;\n\t}\n\n\tintersectsTriangle(triangle) {\n\t\tif (this.isEmpty()) {\n\t\t\treturn false;\n\t\t} // compute box center and extents\n\n\n\t\tthis.getCenter(_center);\n\n\t\t_extents.subVectors(this.max, _center); // translate triangle to aabb origin\n\n\n\t\t_v0$1.subVectors(triangle.a, _center);\n\n\t\t_v1$3.subVectors(triangle.b, _center);\n\n\t\t_v2$1.subVectors(triangle.c, _center); // compute edge vectors for triangle\n\n\n\t\t_f0.subVectors(_v1$3, _v0$1);\n\n\t\t_f1.subVectors(_v2$1, _v1$3);\n\n\t\t_f2.subVectors(_v0$1, _v2$1); // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\n\n\t\tlet axes = [0, -_f0.z, _f0.y, 0, -_f1.z, _f1.y, 0, -_f2.z, _f2.y, _f0.z, 0, -_f0.x, _f1.z, 0, -_f1.x, _f2.z, 0, -_f2.x, -_f0.y, _f0.x, 0, -_f1.y, _f1.x, 0, -_f2.y, _f2.x, 0];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // test 3 face normals from the aabb\n\n\n\t\taxes = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\n\n\t\t_triangleNormal.crossVectors(_f0, _f1);\n\n\t\taxes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];\n\t\treturn satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents);\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$1.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tgetBoundingSphere(target) {\n\t\tthis.getCenter(target.center);\n\t\ttarget.radius = this.getSize(_vector$1).length() * 0.5;\n\t\treturn target;\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max); // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\n\t\tif (this.isEmpty()) this.makeEmpty();\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\t// transform of empty box is an empty box.\n\t\tif (this.isEmpty()) return this; // NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\n\t\t_points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); // 000\n\n\n\t\t_points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); // 001\n\n\n\t\t_points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); // 010\n\n\n\t\t_points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); // 011\n\n\n\t\t_points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); // 100\n\n\n\t\t_points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); // 101\n\n\n\t\t_points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); // 110\n\n\n\t\t_points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); // 111\n\n\n\t\tthis.setFromPoints(_points);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nconst _points = [/*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3()];\n\nconst _vector$1 = /*@__PURE__*/new Vector3();\n\nconst _box$1 = /*@__PURE__*/new Box3(); // triangle centered vertices\n\n\nconst _v0$1 = /*@__PURE__*/new Vector3();\n\nconst _v1$3 = /*@__PURE__*/new Vector3();\n\nconst _v2$1 = /*@__PURE__*/new Vector3(); // triangle edge vectors\n\n\nconst _f0 = /*@__PURE__*/new Vector3();\n\nconst _f1 = /*@__PURE__*/new Vector3();\n\nconst _f2 = /*@__PURE__*/new Vector3();\n\nconst _center = /*@__PURE__*/new Vector3();\n\nconst _extents = /*@__PURE__*/new Vector3();\n\nconst _triangleNormal = /*@__PURE__*/new Vector3();\n\nconst _testAxis = /*@__PURE__*/new Vector3();\n\nfunction satForAxes(axes, v0, v1, v2, extents) {\n\tfor (let i = 0, j = axes.length - 3; i <= j; i += 3) {\n\t\t_testAxis.fromArray(axes, i); // project the aabb onto the separating axis\n\n\n\t\tconst r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); // project all 3 vertices of the triangle onto the separating axis\n\n\t\tconst p0 = v0.dot(_testAxis);\n\t\tconst p1 = v1.dot(_testAxis);\n\t\tconst p2 = v2.dot(_testAxis); // actual test, basically see if either of the most extreme of the triangle points intersects r\n\n\t\tif (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) {\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nfunction SRGBToLinear(c) {\n\treturn c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);\n}\nfunction LinearToSRGB(c) {\n\treturn c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;\n} // JavaScript RGB-to-RGB transforms, defined as\n// FN[InputColorSpace][OutputColorSpace] callback functions.\n\nconst FN = {\n\t[SRGBColorSpace]: {\n\t\t[LinearSRGBColorSpace]: SRGBToLinear\n\t},\n\t[LinearSRGBColorSpace]: {\n\t\t[SRGBColorSpace]: LinearToSRGB\n\t}\n};\nconst ColorManagement = {\n\tlegacyMode: true,\n\n\tget workingColorSpace() {\n\t\treturn LinearSRGBColorSpace;\n\t},\n\n\tset workingColorSpace(colorSpace) {\n\t\tconsole.warn('THREE.ColorManagement: .workingColorSpace is readonly.');\n\t},\n\n\tconvert: function (color, sourceColorSpace, targetColorSpace) {\n\t\tif (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {\n\t\t\treturn color;\n\t\t}\n\n\t\tif (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== undefined) {\n\t\t\tconst fn = FN[sourceColorSpace][targetColorSpace];\n\t\t\tcolor.r = fn(color.r);\n\t\t\tcolor.g = fn(color.g);\n\t\t\tcolor.b = fn(color.b);\n\t\t\treturn color;\n\t\t}\n\n\t\tthrow new Error('Unsupported color space conversion.');\n\t},\n\tfromWorkingColorSpace: function (color, targetColorSpace) {\n\t\treturn this.convert(color, this.workingColorSpace, targetColorSpace);\n\t},\n\ttoWorkingColorSpace: function (color, sourceColorSpace) {\n\t\treturn this.convert(color, sourceColorSpace, this.workingColorSpace);\n\t}\n};\n\nconst _colorKeywords = {\n\t'aliceblue': 0xF0F8FF,\n\t'antiquewhite': 0xFAEBD7,\n\t'aqua': 0x00FFFF,\n\t'aquamarine': 0x7FFFD4,\n\t'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC,\n\t'bisque': 0xFFE4C4,\n\t'black': 0x000000,\n\t'blanchedalmond': 0xFFEBCD,\n\t'blue': 0x0000FF,\n\t'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A,\n\t'burlywood': 0xDEB887,\n\t'cadetblue': 0x5F9EA0,\n\t'chartreuse': 0x7FFF00,\n\t'chocolate': 0xD2691E,\n\t'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED,\n\t'cornsilk': 0xFFF8DC,\n\t'crimson': 0xDC143C,\n\t'cyan': 0x00FFFF,\n\t'darkblue': 0x00008B,\n\t'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B,\n\t'darkgray': 0xA9A9A9,\n\t'darkgreen': 0x006400,\n\t'darkgrey': 0xA9A9A9,\n\t'darkkhaki': 0xBDB76B,\n\t'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F,\n\t'darkorange': 0xFF8C00,\n\t'darkorchid': 0x9932CC,\n\t'darkred': 0x8B0000,\n\t'darksalmon': 0xE9967A,\n\t'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B,\n\t'darkslategray': 0x2F4F4F,\n\t'darkslategrey': 0x2F4F4F,\n\t'darkturquoise': 0x00CED1,\n\t'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493,\n\t'deepskyblue': 0x00BFFF,\n\t'dimgray': 0x696969,\n\t'dimgrey': 0x696969,\n\t'dodgerblue': 0x1E90FF,\n\t'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0,\n\t'forestgreen': 0x228B22,\n\t'fuchsia': 0xFF00FF,\n\t'gainsboro': 0xDCDCDC,\n\t'ghostwhite': 0xF8F8FF,\n\t'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520,\n\t'gray': 0x808080,\n\t'green': 0x008000,\n\t'greenyellow': 0xADFF2F,\n\t'grey': 0x808080,\n\t'honeydew': 0xF0FFF0,\n\t'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C,\n\t'indigo': 0x4B0082,\n\t'ivory': 0xFFFFF0,\n\t'khaki': 0xF0E68C,\n\t'lavender': 0xE6E6FA,\n\t'lavenderblush': 0xFFF0F5,\n\t'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD,\n\t'lightblue': 0xADD8E6,\n\t'lightcoral': 0xF08080,\n\t'lightcyan': 0xE0FFFF,\n\t'lightgoldenrodyellow': 0xFAFAD2,\n\t'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90,\n\t'lightgrey': 0xD3D3D3,\n\t'lightpink': 0xFFB6C1,\n\t'lightsalmon': 0xFFA07A,\n\t'lightseagreen': 0x20B2AA,\n\t'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899,\n\t'lightslategrey': 0x778899,\n\t'lightsteelblue': 0xB0C4DE,\n\t'lightyellow': 0xFFFFE0,\n\t'lime': 0x00FF00,\n\t'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6,\n\t'magenta': 0xFF00FF,\n\t'maroon': 0x800000,\n\t'mediumaquamarine': 0x66CDAA,\n\t'mediumblue': 0x0000CD,\n\t'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB,\n\t'mediumseagreen': 0x3CB371,\n\t'mediumslateblue': 0x7B68EE,\n\t'mediumspringgreen': 0x00FA9A,\n\t'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585,\n\t'midnightblue': 0x191970,\n\t'mintcream': 0xF5FFFA,\n\t'mistyrose': 0xFFE4E1,\n\t'moccasin': 0xFFE4B5,\n\t'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080,\n\t'oldlace': 0xFDF5E6,\n\t'olive': 0x808000,\n\t'olivedrab': 0x6B8E23,\n\t'orange': 0xFFA500,\n\t'orangered': 0xFF4500,\n\t'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA,\n\t'palegreen': 0x98FB98,\n\t'paleturquoise': 0xAFEEEE,\n\t'palevioletred': 0xDB7093,\n\t'papayawhip': 0xFFEFD5,\n\t'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F,\n\t'pink': 0xFFC0CB,\n\t'plum': 0xDDA0DD,\n\t'powderblue': 0xB0E0E6,\n\t'purple': 0x800080,\n\t'rebeccapurple': 0x663399,\n\t'red': 0xFF0000,\n\t'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1,\n\t'saddlebrown': 0x8B4513,\n\t'salmon': 0xFA8072,\n\t'sandybrown': 0xF4A460,\n\t'seagreen': 0x2E8B57,\n\t'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D,\n\t'silver': 0xC0C0C0,\n\t'skyblue': 0x87CEEB,\n\t'slateblue': 0x6A5ACD,\n\t'slategray': 0x708090,\n\t'slategrey': 0x708090,\n\t'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F,\n\t'steelblue': 0x4682B4,\n\t'tan': 0xD2B48C,\n\t'teal': 0x008080,\n\t'thistle': 0xD8BFD8,\n\t'tomato': 0xFF6347,\n\t'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE,\n\t'wheat': 0xF5DEB3,\n\t'white': 0xFFFFFF,\n\t'whitesmoke': 0xF5F5F5,\n\t'yellow': 0xFFFF00,\n\t'yellowgreen': 0x9ACD32\n};\nconst _rgb = {\n\tr: 0,\n\tg: 0,\n\tb: 0\n};\nconst _hslA = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\nconst _hslB = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\n\nfunction hue2rgb(p, q, t) {\n\tif (t < 0) t += 1;\n\tif (t > 1) t -= 1;\n\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\tif (t < 1 / 2) return q;\n\tif (t < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t);\n\treturn p;\n}\n\nfunction toComponents(source, target) {\n\ttarget.r = source.r;\n\ttarget.g = source.g;\n\ttarget.b = source.b;\n\treturn target;\n}\n\nclass Color {\n\tconstructor(r, g, b) {\n\t\tthis.isColor = true;\n\t\tthis.r = 1;\n\t\tthis.g = 1;\n\t\tthis.b = 1;\n\n\t\tif (g === undefined && b === undefined) {\n\t\t\t// r is THREE.Color, hex or string\n\t\t\treturn this.set(r);\n\t\t}\n\n\t\treturn this.setRGB(r, g, b);\n\t}\n\n\tset(value) {\n\t\tif (value && value.isColor) {\n\t\t\tthis.copy(value);\n\t\t} else if (typeof value === 'number') {\n\t\t\tthis.setHex(value);\n\t\t} else if (typeof value === 'string') {\n\t\t\tthis.setStyle(value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\t\treturn this;\n\t}\n\n\tsetHex(hex, colorSpace = SRGBColorSpace) {\n\t\thex = Math.floor(hex);\n\t\tthis.r = (hex >> 16 & 255) / 255;\n\t\tthis.g = (hex >> 8 & 255) / 255;\n\t\tthis.b = (hex & 255) / 255;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetRGB(r, g, b, colorSpace = ColorManagement.workingColorSpace) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetHSL(h, s, l, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo(h, 1);\n\t\ts = clamp(s, 0, 1);\n\t\tl = clamp(l, 0, 1);\n\n\t\tif (s === 0) {\n\t\t\tthis.r = this.g = this.b = l;\n\t\t} else {\n\t\t\tconst p = l <= 0.5 ? l * (1 + s) : l + s - l * s;\n\t\t\tconst q = 2 * l - p;\n\t\t\tthis.r = hue2rgb(q, p, h + 1 / 3);\n\t\t\tthis.g = hue2rgb(q, p, h);\n\t\t\tthis.b = hue2rgb(q, p, h - 1 / 3);\n\t\t}\n\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetStyle(style, colorSpace = SRGBColorSpace) {\n\t\tfunction handleAlpha(string) {\n\t\t\tif (string === undefined) return;\n\n\t\t\tif (parseFloat(string) < 1) {\n\t\t\t\tconsole.warn('THREE.Color: Alpha component of ' + style + ' will be ignored.');\n\t\t\t}\n\t\t}\n\n\t\tlet m;\n\n\t\tif (m = /^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(style)) {\n\t\t\t// rgb / hsl\n\t\t\tlet color;\n\t\t\tconst name = m[1];\n\t\t\tconst components = m[2];\n\n\t\t\tswitch (name) {\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\tthis.r = Math.min(255, parseInt(color[1], 10)) / 255;\n\t\t\t\t\t\tthis.g = Math.min(255, parseInt(color[2], 10)) / 255;\n\t\t\t\t\t\tthis.b = Math.min(255, parseInt(color[3], 10)) / 255;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\tthis.r = Math.min(100, parseInt(color[1], 10)) / 100;\n\t\t\t\t\t\tthis.g = Math.min(100, parseInt(color[2], 10)) / 100;\n\t\t\t\t\t\tthis.b = Math.min(100, parseInt(color[3], 10)) / 100;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\t\t\t\t\tif (color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\tconst h = parseFloat(color[1]) / 360;\n\t\t\t\t\t\tconst s = parseFloat(color[2]) / 100;\n\t\t\t\t\t\tconst l = parseFloat(color[3]) / 100;\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this.setHSL(h, s, l, colorSpace);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (m = /^\\#([A-Fa-f\\d]+)$/.exec(style)) {\n\t\t\t// hex color\n\t\t\tconst hex = m[1];\n\t\t\tconst size = hex.length;\n\n\t\t\tif (size === 3) {\n\t\t\t\t// #ff0\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t} else if (size === 6) {\n\t\t\t\t// #ff0000\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tif (style && style.length > 0) {\n\t\t\treturn this.setColorName(style, colorSpace);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetColorName(style, colorSpace = SRGBColorSpace) {\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[style.toLowerCase()];\n\n\t\tif (hex !== undefined) {\n\t\t\t// red\n\t\t\tthis.setHex(hex, colorSpace);\n\t\t} else {\n\t\t\t// unknown color\n\t\t\tconsole.warn('THREE.Color: Unknown color ' + style);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.r, this.g, this.b);\n\t}\n\n\tcopy(color) {\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\t\treturn this;\n\t}\n\n\tcopySRGBToLinear(color) {\n\t\tthis.r = SRGBToLinear(color.r);\n\t\tthis.g = SRGBToLinear(color.g);\n\t\tthis.b = SRGBToLinear(color.b);\n\t\treturn this;\n\t}\n\n\tcopyLinearToSRGB(color) {\n\t\tthis.r = LinearToSRGB(color.r);\n\t\tthis.g = LinearToSRGB(color.g);\n\t\tthis.b = LinearToSRGB(color.b);\n\t\treturn this;\n\t}\n\n\tconvertSRGBToLinear() {\n\t\tthis.copySRGBToLinear(this);\n\t\treturn this;\n\t}\n\n\tconvertLinearToSRGB() {\n\t\tthis.copyLinearToSRGB(this);\n\t\treturn this;\n\t}\n\n\tgetHex(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\treturn clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0;\n\t}\n\n\tgetHexString(colorSpace = SRGBColorSpace) {\n\t\treturn ('000000' + this.getHex(colorSpace).toString(16)).slice(-6);\n\t}\n\n\tgetHSL(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\tconst r = _rgb.r,\n\t\t\t\t\tg = _rgb.g,\n\t\t\t\t\tb = _rgb.b;\n\t\tconst max = Math.max(r, g, b);\n\t\tconst min = Math.min(r, g, b);\n\t\tlet hue, saturation;\n\t\tconst lightness = (min + max) / 2.0;\n\n\t\tif (min === max) {\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\t\t} else {\n\t\t\tconst delta = max - min;\n\t\t\tsaturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\n\n\t\t\tswitch (max) {\n\t\t\t\tcase r:\n\t\t\t\t\thue = (g - b) / delta + (g < b ? 6 : 0);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase g:\n\t\t\t\t\thue = (b - r) / delta + 2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase b:\n\t\t\t\t\thue = (r - g) / delta + 4;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\thue /= 6;\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\t\treturn target;\n\t}\n\n\tgetRGB(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\ttarget.r = _rgb.r;\n\t\ttarget.g = _rgb.g;\n\t\ttarget.b = _rgb.b;\n\t\treturn target;\n\t}\n\n\tgetStyle(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\n\t\tif (colorSpace !== SRGBColorSpace) {\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;\n\t\t}\n\n\t\treturn `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`;\n\t}\n\n\toffsetHSL(h, s, l) {\n\t\tthis.getHSL(_hslA);\n\t\t_hslA.h += h;\n\t\t_hslA.s += s;\n\t\t_hslA.l += l;\n\t\tthis.setHSL(_hslA.h, _hslA.s, _hslA.l);\n\t\treturn this;\n\t}\n\n\tadd(color) {\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\t\treturn this;\n\t}\n\n\taddColors(color1, color2) {\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\t\treturn this;\n\t}\n\n\tsub(color) {\n\t\tthis.r = Math.max(0, this.r - color.r);\n\t\tthis.g = Math.max(0, this.g - color.g);\n\t\tthis.b = Math.max(0, this.b - color.b);\n\t\treturn this;\n\t}\n\n\tmultiply(color) {\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\t\treturn this;\n\t}\n\n\tlerp(color, alpha) {\n\t\tthis.r += (color.r - this.r) * alpha;\n\t\tthis.g += (color.g - this.g) * alpha;\n\t\tthis.b += (color.b - this.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpColors(color1, color2, alpha) {\n\t\tthis.r = color1.r + (color2.r - color1.r) * alpha;\n\t\tthis.g = color1.g + (color2.g - color1.g) * alpha;\n\t\tthis.b = color1.b + (color2.b - color1.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpHSL(color, alpha) {\n\t\tthis.getHSL(_hslA);\n\t\tcolor.getHSL(_hslB);\n\t\tconst h = lerp(_hslA.h, _hslB.h, alpha);\n\t\tconst s = lerp(_hslA.s, _hslB.s, alpha);\n\t\tconst l = lerp(_hslA.l, _hslB.l, alpha);\n\t\tthis.setHSL(h, s, l);\n\t\treturn this;\n\t}\n\n\tequals(c) {\n\t\treturn c.r === this.r && c.g === this.g && c.b === this.b;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.r = array[offset];\n\t\tthis.g = array[offset + 1];\n\t\tthis.b = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.r;\n\t\tarray[offset + 1] = this.g;\n\t\tarray[offset + 2] = this.b;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.r = attribute.getX( index );\n\t// \tthis.g = attribute.getY( index );\n\t// \tthis.b = attribute.getZ( index );\n\t// \tif ( attribute.normalized === true ) {\n\t// \t\t// assuming Uint8Array\n\t// \t\tthis.r /= 255;\n\t// \t\tthis.g /= 255;\n\t// \t\tthis.b /= 255;\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\ttoJSON() {\n\t\treturn this.getHex();\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\t}\n\n}\n\nColor.NAMES = _colorKeywords;\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\r\n */\nclass Cylindrical {\n\tconstructor(radius = 1, theta = 0, y = 0) {\n\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\n\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\n\t\tthis.y = y; // height above the x-z plane\n\n\t\treturn this;\n\t}\n\n\tset(radius, theta, y) {\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + z * z);\n\t\tthis.theta = Math.atan2(x, z);\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix4 {\n\tconstructor() {\n\t\tMatrix4.prototype.isMatrix4 = true;\n\t\tthis.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[4] = n12;\n\t\tte[8] = n13;\n\t\tte[12] = n14;\n\t\tte[1] = n21;\n\t\tte[5] = n22;\n\t\tte[9] = n23;\n\t\tte[13] = n24;\n\t\tte[2] = n31;\n\t\tte[6] = n32;\n\t\tte[10] = n33;\n\t\tte[14] = n34;\n\t\tte[3] = n41;\n\t\tte[7] = n42;\n\t\tte[11] = n43;\n\t\tte[15] = n44;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Matrix4().fromArray(this.elements);\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\tte[9] = me[9];\n\t\tte[10] = me[10];\n\t\tte[11] = me[11];\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\tte[15] = me[15];\n\t\treturn this;\n\t}\n\n\tcopyPosition(m) {\n\t\tconst te = this.elements,\n\t\t\t\t\tme = m.elements;\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrix3(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[3], me[6], 0, me[1], me[4], me[7], 0, me[2], me[5], me[8], 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrixColumn(this, 0);\n\t\tyAxis.setFromMatrixColumn(this, 1);\n\t\tzAxis.setFromMatrixColumn(this, 2);\n\t\treturn this;\n\t}\n\n\tmakeBasis(xAxis, yAxis, zAxis) {\n\t\tthis.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractRotation(m) {\n\t\t// this method does not support reflection matrices\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$2.setFromMatrixColumn(m, 0).length();\n\n\t\tconst scaleY = 1 / _v1$2.setFromMatrixColumn(m, 1).length();\n\n\t\tconst scaleZ = 1 / _v1$2.setFromMatrixColumn(m, 2).length();\n\n\t\tte[0] = me[0] * scaleX;\n\t\tte[1] = me[1] * scaleX;\n\t\tte[2] = me[2] * scaleX;\n\t\tte[3] = 0;\n\t\tte[4] = me[4] * scaleY;\n\t\tte[5] = me[5] * scaleY;\n\t\tte[6] = me[6] * scaleY;\n\t\tte[7] = 0;\n\t\tte[8] = me[8] * scaleZ;\n\t\tte[9] = me[9] * scaleZ;\n\t\tte[10] = me[10] * scaleZ;\n\t\tte[11] = 0;\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromEuler(euler) {\n\t\tconst te = this.elements;\n\t\tconst x = euler.x,\n\t\t\t\t\ty = euler.y,\n\t\t\t\t\tz = euler.z;\n\t\tconst a = Math.cos(x),\n\t\t\t\t\tb = Math.sin(x);\n\t\tconst c = Math.cos(y),\n\t\t\t\t\td = Math.sin(y);\n\t\tconst e = Math.cos(z),\n\t\t\t\t\tf = Math.sin(z);\n\n\t\tif (euler.order === 'XYZ') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -c * f;\n\t\t\tte[8] = d;\n\t\t\tte[1] = af + be * d;\n\t\t\tte[5] = ae - bf * d;\n\t\t\tte[9] = -b * c;\n\t\t\tte[2] = bf - ae * d;\n\t\t\tte[6] = be + af * d;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YXZ') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce + df * b;\n\t\t\tte[4] = de * b - cf;\n\t\t\tte[8] = a * d;\n\t\t\tte[1] = a * f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b;\n\t\t\tte[2] = cf * b - de;\n\t\t\tte[6] = df + ce * b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZXY') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce - df * b;\n\t\t\tte[4] = -a * f;\n\t\t\tte[8] = de + cf * b;\n\t\t\tte[1] = cf + de * b;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = df - ce * b;\n\t\t\tte[2] = -a * d;\n\t\t\tte[6] = b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZYX') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = be * d - af;\n\t\t\tte[8] = ae * d + bf;\n\t\t\tte[1] = c * f;\n\t\t\tte[5] = bf * d + ae;\n\t\t\tte[9] = af * d - be;\n\t\t\tte[2] = -d;\n\t\t\tte[6] = b * c;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YZX') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = bd - ac * f;\n\t\t\tte[8] = bc * f + ad;\n\t\t\tte[1] = f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b * e;\n\t\t\tte[2] = -d * e;\n\t\t\tte[6] = ad * f + bc;\n\t\t\tte[10] = ac - bd * f;\n\t\t} else if (euler.order === 'XZY') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -f;\n\t\t\tte[8] = d * e;\n\t\t\tte[1] = ac * f + bd;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = ad * f - bc;\n\t\t\tte[2] = bc * f - ad;\n\t\t\tte[6] = b * e;\n\t\t\tte[10] = bd * f + ac;\n\t\t} // bottom row\n\n\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0; // last column\n\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromQuaternion(q) {\n\t\treturn this.compose(_zero, q, _one);\n\t}\n\n\tlookAt(eye, target, up) {\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors(eye, target);\n\n\t\tif (_z.lengthSq() === 0) {\n\t\t\t// eye and target are in the same position\n\t\t\t_z.z = 1;\n\t\t}\n\n\t\t_z.normalize();\n\n\t\t_x.crossVectors(up, _z);\n\n\t\tif (_x.lengthSq() === 0) {\n\t\t\t// up and z are parallel\n\t\t\tif (Math.abs(up.z) === 1) {\n\t\t\t\t_z.x += 0.0001;\n\t\t\t} else {\n\t\t\t\t_z.z += 0.0001;\n\t\t\t}\n\n\t\t\t_z.normalize();\n\n\t\t\t_x.crossVectors(up, _z);\n\t\t}\n\n\t\t_x.normalize();\n\n\t\t_y.crossVectors(_z, _x);\n\n\t\tte[0] = _x.x;\n\t\tte[4] = _y.x;\n\t\tte[8] = _z.x;\n\t\tte[1] = _x.y;\n\t\tte[5] = _y.y;\n\t\tte[9] = _z.y;\n\t\tte[2] = _x.z;\n\t\tte[6] = _y.z;\n\t\tte[10] = _z.z;\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[4],\n\t\t\t\t\ta13 = ae[8],\n\t\t\t\t\ta14 = ae[12];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[5],\n\t\t\t\t\ta23 = ae[9],\n\t\t\t\t\ta24 = ae[13];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[6],\n\t\t\t\t\ta33 = ae[10],\n\t\t\t\t\ta34 = ae[14];\n\t\tconst a41 = ae[3],\n\t\t\t\t\ta42 = ae[7],\n\t\t\t\t\ta43 = ae[11],\n\t\t\t\t\ta44 = ae[15];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[4],\n\t\t\t\t\tb13 = be[8],\n\t\t\t\t\tb14 = be[12];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[5],\n\t\t\t\t\tb23 = be[9],\n\t\t\t\t\tb24 = be[13];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[6],\n\t\t\t\t\tb33 = be[10],\n\t\t\t\t\tb34 = be[14];\n\t\tconst b41 = be[3],\n\t\t\t\t\tb42 = be[7],\n\t\t\t\t\tb43 = be[11],\n\t\t\t\t\tb44 = be[15];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\t\tte[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[4] *= s;\n\t\tte[8] *= s;\n\t\tte[12] *= s;\n\t\tte[1] *= s;\n\t\tte[5] *= s;\n\t\tte[9] *= s;\n\t\tte[13] *= s;\n\t\tte[2] *= s;\n\t\tte[6] *= s;\n\t\tte[10] *= s;\n\t\tte[14] *= s;\n\t\tte[3] *= s;\n\t\tte[7] *= s;\n\t\tte[11] *= s;\n\t\tte[15] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst n11 = te[0],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn14 = te[12];\n\t\tconst n21 = te[1],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn24 = te[13];\n\t\tconst n31 = te[2],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn34 = te[14];\n\t\tconst n41 = te[3],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn44 = te[15]; //TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);\n\t}\n\n\ttranspose() {\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\t\ttmp = te[1];\n\t\tte[1] = te[4];\n\t\tte[4] = tmp;\n\t\ttmp = te[2];\n\t\tte[2] = te[8];\n\t\tte[8] = tmp;\n\t\ttmp = te[6];\n\t\tte[6] = te[9];\n\t\tte[9] = tmp;\n\t\ttmp = te[3];\n\t\tte[3] = te[12];\n\t\tte[12] = tmp;\n\t\ttmp = te[7];\n\t\tte[7] = te[13];\n\t\tte[13] = tmp;\n\t\ttmp = te[11];\n\t\tte[11] = te[14];\n\t\tte[14] = tmp;\n\t\treturn this;\n\t}\n\n\tsetPosition(x, y, z) {\n\t\tconst te = this.elements;\n\n\t\tif (x.isVector3) {\n\t\t\tte[12] = x.x;\n\t\t\tte[13] = x.y;\n\t\t\tte[14] = x.z;\n\t\t} else {\n\t\t\tte[12] = x;\n\t\t\tte[13] = y;\n\t\t\tte[14] = z;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tinvert() {\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn41 = te[3],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn14 = te[12],\n\t\t\t\t\tn24 = te[13],\n\t\t\t\t\tn34 = te[14],\n\t\t\t\t\tn44 = te[15],\n\t\t\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;\n\t\tte[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;\n\t\tte[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;\n\t\tte[4] = t12 * detInv;\n\t\tte[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;\n\t\tte[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;\n\t\tte[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;\n\t\tte[8] = t13 * detInv;\n\t\tte[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;\n\t\tte[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;\n\t\tte[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;\n\t\tte[12] = t14 * detInv;\n\t\tte[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;\n\t\tte[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;\n\t\tte[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;\n\t\treturn this;\n\t}\n\n\tscale(v) {\n\t\tconst te = this.elements;\n\t\tconst x = v.x,\n\t\t\t\t\ty = v.y,\n\t\t\t\t\tz = v.z;\n\t\tte[0] *= x;\n\t\tte[4] *= y;\n\t\tte[8] *= z;\n\t\tte[1] *= x;\n\t\tte[5] *= y;\n\t\tte[9] *= z;\n\t\tte[2] *= x;\n\t\tte[6] *= y;\n\t\tte[10] *= z;\n\t\tte[3] *= x;\n\t\tte[7] *= y;\n\t\tte[11] *= z;\n\t\treturn this;\n\t}\n\n\tgetMaxScaleOnAxis() {\n\t\tconst te = this.elements;\n\t\tconst scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];\n\t\tconst scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];\n\t\tconst scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];\n\t\treturn Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));\n\t}\n\n\tmakeTranslation(x, y, z) {\n\t\tthis.set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationX(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationY(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationZ(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationAxis(axis, angle) {\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\t\tconst c = Math.cos(angle);\n\t\tconst s = Math.sin(angle);\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x,\n\t\t\t\t\ty = axis.y,\n\t\t\t\t\tz = axis.z;\n\t\tconst tx = t * x,\n\t\t\t\t\tty = t * y;\n\t\tthis.set(tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y, z) {\n\t\tthis.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeShear(xy, xz, yx, yz, zx, zy) {\n\t\tthis.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\t\tconst x = quaternion._x,\n\t\t\t\t\ty = quaternion._y,\n\t\t\t\t\tz = quaternion._z,\n\t\t\t\t\tw = quaternion._w;\n\t\tconst x2 = x + x,\n\t\t\t\t\ty2 = y + y,\n\t\t\t\t\tz2 = z + z;\n\t\tconst xx = x * x2,\n\t\t\t\t\txy = x * y2,\n\t\t\t\t\txz = x * z2;\n\t\tconst yy = y * y2,\n\t\t\t\t\tyz = y * z2,\n\t\t\t\t\tzz = z * z2;\n\t\tconst wx = w * x2,\n\t\t\t\t\twy = w * y2,\n\t\t\t\t\twz = w * z2;\n\t\tconst sx = scale.x,\n\t\t\t\t\tsy = scale.y,\n\t\t\t\t\tsz = scale.z;\n\t\tte[0] = (1 - (yy + zz)) * sx;\n\t\tte[1] = (xy + wz) * sx;\n\t\tte[2] = (xz - wy) * sx;\n\t\tte[3] = 0;\n\t\tte[4] = (xy - wz) * sy;\n\t\tte[5] = (1 - (xx + zz)) * sy;\n\t\tte[6] = (yz + wx) * sy;\n\t\tte[7] = 0;\n\t\tte[8] = (xz + wy) * sz;\n\t\tte[9] = (yz - wx) * sz;\n\t\tte[10] = (1 - (xx + yy)) * sz;\n\t\tte[11] = 0;\n\t\tte[12] = position.x;\n\t\tte[13] = position.y;\n\t\tte[14] = position.z;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tdecompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$2.set(te[0], te[1], te[2]).length();\n\n\t\tconst sy = _v1$2.set(te[4], te[5], te[6]).length();\n\n\t\tconst sz = _v1$2.set(te[8], te[9], te[10]).length(); // if determine is negative, we need to invert one scale\n\n\n\t\tconst det = this.determinant();\n\t\tif (det < 0) sx = -sx;\n\t\tposition.x = te[12];\n\t\tposition.y = te[13];\n\t\tposition.z = te[14]; // scale the rotation part\n\n\t\t_m1.copy(this);\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\t\t_m1.elements[0] *= invSX;\n\t\t_m1.elements[1] *= invSX;\n\t\t_m1.elements[2] *= invSX;\n\t\t_m1.elements[4] *= invSY;\n\t\t_m1.elements[5] *= invSY;\n\t\t_m1.elements[6] *= invSY;\n\t\t_m1.elements[8] *= invSZ;\n\t\t_m1.elements[9] *= invSZ;\n\t\t_m1.elements[10] *= invSZ;\n\t\tquaternion.setFromRotationMatrix(_m1);\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\t\treturn this;\n\t}\n\n\tmakePerspective(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst x = 2 * near / (right - left);\n\t\tconst y = 2 * near / (top - bottom);\n\t\tconst a = (right + left) / (right - left);\n\t\tconst b = (top + bottom) / (top - bottom);\n\t\tconst c = -(far + near) / (far - near);\n\t\tconst d = -2 * far * near / (far - near);\n\t\tte[0] = x;\n\t\tte[4] = 0;\n\t\tte[8] = a;\n\t\tte[12] = 0;\n\t\tte[1] = 0;\n\t\tte[5] = y;\n\t\tte[9] = b;\n\t\tte[13] = 0;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = c;\n\t\tte[14] = d;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = -1;\n\t\tte[15] = 0;\n\t\treturn this;\n\t}\n\n\tmakeOrthographic(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst w = 1.0 / (right - left);\n\t\tconst h = 1.0 / (top - bottom);\n\t\tconst p = 1.0 / (far - near);\n\t\tconst x = (right + left) * w;\n\t\tconst y = (top + bottom) * h;\n\t\tconst z = (far + near) * p;\n\t\tte[0] = 2 * w;\n\t\tte[4] = 0;\n\t\tte[8] = 0;\n\t\tte[12] = -x;\n\t\tte[1] = 0;\n\t\tte[5] = 2 * h;\n\t\tte[9] = 0;\n\t\tte[13] = -y;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = -2 * p;\n\t\tte[14] = -z;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\tarray[offset + 9] = te[9];\n\t\tarray[offset + 10] = te[10];\n\t\tarray[offset + 11] = te[11];\n\t\tarray[offset + 12] = te[12];\n\t\tarray[offset + 13] = te[13];\n\t\tarray[offset + 14] = te[14];\n\t\tarray[offset + 15] = te[15];\n\t\treturn array;\n\t}\n\n}\n\nconst _v1$2 = /*@__PURE__*/new Vector3();\n\nconst _m1 = /*@__PURE__*/new Matrix4();\n\nconst _zero = /*@__PURE__*/new Vector3(0, 0, 0);\n\nconst _one = /*@__PURE__*/new Vector3(1, 1, 1);\n\nconst _x = /*@__PURE__*/new Vector3();\n\nconst _y = /*@__PURE__*/new Vector3();\n\nconst _z = /*@__PURE__*/new Vector3();\n\nconst _matrix = /*@__PURE__*/new Matrix4();\n\nconst _quaternion = /*@__PURE__*/new Quaternion();\n\nclass Euler {\n\tconstructor(x = 0, y = 0, z = 0, order = Euler.DefaultOrder) {\n\t\tthis.isEuler = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget order() {\n\t\treturn this._order;\n\t}\n\n\tset order(value) {\n\t\tthis._order = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, order = this._order) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._order);\n\t}\n\n\tcopy(euler) {\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m, order = this._order, update = true) {\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements;\n\t\tconst m11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8];\n\t\tconst m21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9];\n\t\tconst m31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._y = Math.asin(clamp(m13, -1, 1));\n\n\t\t\t\tif (Math.abs(m13) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = Math.asin(-clamp(m23, -1, 1));\n\n\t\t\t\tif (Math.abs(m23) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = Math.asin(clamp(m32, -1, 1));\n\n\t\t\t\tif (Math.abs(m32) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._y = Math.asin(-clamp(m31, -1, 1));\n\n\t\t\t\tif (Math.abs(m31) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._z = Math.asin(clamp(m21, -1, 1));\n\n\t\t\t\tif (Math.abs(m21) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m22);\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._z = Math.asin(-clamp(m12, -1, 1));\n\n\t\t\t\tif (Math.abs(m12) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._y = Math.atan2(m13, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tthis._order = order;\n\t\tif (update === true) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromQuaternion(q, order, update) {\n\t\t_matrix.makeRotationFromQuaternion(q);\n\n\t\treturn this.setFromRotationMatrix(_matrix, order, update);\n\t}\n\n\tsetFromVector3(v, order = this._order) {\n\t\treturn this.set(v.x, v.y, v.z, order);\n\t}\n\n\treorder(newOrder) {\n\t\t// WARNING: this discards revolution information -bhouston\n\t\t_quaternion.setFromEuler(this);\n\n\t\treturn this.setFromQuaternion(_quaternion, newOrder);\n\t}\n\n\tequals(euler) {\n\t\treturn euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;\n\t}\n\n\tfromArray(array) {\n\t\tthis._x = array[0];\n\t\tthis._y = array[1];\n\t\tthis._z = array[2];\n\t\tif (array[3] !== undefined) this._order = array[3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._order;\n\t\treturn array;\n\t}\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\t} // @deprecated since r138, 02cf0df1cb4575d5842fef9c85bb5a89fe020d53\n\n\n\ttoVector3() {\n\t\tconsole.error('THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead');\n\t}\n\n}\n\nEuler.DefaultOrder = 'XYZ';\nEuler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX'];\n\n/**\r\n * Abstract base class of interpolants over parametric samples.\r\n *\r\n * The parameter domain is one dimensional, typically the time or a path\r\n * along a curve defined by the data.\r\n *\r\n * The sample values can have any dimensionality and derived classes may\r\n * apply special interpretations to the data.\r\n *\r\n * This class provides the interval seek in a Template Method, deferring\r\n * the actual interpolation to derived classes.\r\n *\r\n * Time complexity is O(1) for linear access crossing at most two points\r\n * and O(log N) for random access, where N is the number of positions.\r\n *\r\n * References:\r\n *\r\n * \t\thttp://www.oodesign.com/template-method-pattern.html\r\n *\r\n */\nclass Interpolant {\n\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor(sampleSize);\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\t\tthis.settings = null;\n\t\tthis.DefaultSettings_ = {};\n\t}\n\n\tevaluate(t) {\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\t\tt1 = pp[i1],\n\t\t\t\tt0 = pp[i1 - 1];\n\n\t\tvalidate_interval: {\n\t\t\tseek: {\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if (!(t < t1)) {\n\t\t\t\t\t\tfor (let giveUpAt = i1 + 2;;) {\n\t\t\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\t\t\tif (t < t0) break forward_scan; // after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[++i1];\n\n\t\t\t\t\t\t\tif (t < t1) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the right side of the index\n\n\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} //- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\n\n\t\t\t\t\tif (!(t >= t0)) {\n\t\t\t\t\t\t// looping?\n\t\t\t\t\t\tconst t1global = pp[1];\n\n\t\t\t\t\t\tif (t < t1global) {\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\n\t\t\t\t\t\t\tt0 = t1global;\n\t\t\t\t\t\t} // linear reverse scan\n\n\n\t\t\t\t\t\tfor (let giveUpAt = i1 - 2;;) {\n\t\t\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\t\t\t// before start\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[--i1 - 1];\n\n\t\t\t\t\t\t\tif (t >= t0) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the left side of the index\n\n\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} // the interval is valid\n\n\n\t\t\t\t\tbreak validate_interval;\n\t\t\t\t} // linear scan\n\t\t\t\t// binary search\n\n\n\t\t\t\twhile (i1 < right) {\n\t\t\t\t\tconst mid = i1 + right >>> 1;\n\n\t\t\t\t\tif (t < pp[mid]) {\n\t\t\t\t\t\tright = mid;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti1 = mid + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[i1];\n\t\t\t\tt0 = pp[i1 - 1]; // check boundary cases, again\n\n\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t}\n\n\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t}\n\t\t\t} // seek\n\n\n\t\t\tthis._cachedIndex = i1;\n\t\t\tthis.intervalChanged_(i1, t0, t1);\n\t\t} // validate_interval\n\n\n\t\treturn this.interpolate_(i1, t0, t, t1);\n\t}\n\n\tgetSettings_() {\n\t\treturn this.settings || this.DefaultSettings_;\n\t}\n\n\tcopySampleValue_(index) {\n\t\t// copies a sample value to the result buffer\n\t\tconst result = this.resultBuffer,\n\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\toffset = index * stride;\n\n\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\tresult[i] = values[offset + i];\n\t\t}\n\n\t\treturn result;\n\t} // Template methods for derived classes:\n\n\n\tinterpolate_() {\n\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t}\n\n\tintervalChanged_() {// empty\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/new Vector3();\n\nconst _startEnd = /*@__PURE__*/new Vector3();\n\nclass Line3 {\n\tconstructor(start = new Vector3(), end = new Vector3()) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t}\n\n\tset(start, end) {\n\t\tthis.start.copy(start);\n\t\tthis.end.copy(end);\n\t\treturn this;\n\t}\n\n\tcopy(line) {\n\t\tthis.start.copy(line.start);\n\t\tthis.end.copy(line.end);\n\t\treturn this;\n\t}\n\n\tgetCenter(target) {\n\t\treturn target.addVectors(this.start, this.end).multiplyScalar(0.5);\n\t}\n\n\tdelta(target) {\n\t\treturn target.subVectors(this.end, this.start);\n\t}\n\n\tdistanceSq() {\n\t\treturn this.start.distanceToSquared(this.end);\n\t}\n\n\tdistance() {\n\t\treturn this.start.distanceTo(this.end);\n\t}\n\n\tat(t, target) {\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tclosestPointToPointParameter(point, clampToLine) {\n\t\t_startP.subVectors(point, this.start);\n\n\t\t_startEnd.subVectors(this.end, this.start);\n\n\t\tconst startEnd2 = _startEnd.dot(_startEnd);\n\n\t\tconst startEnd_startP = _startEnd.dot(_startP);\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif (clampToLine) {\n\t\t\tt = clamp(t, 0, 1);\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tclosestPointToPoint(point, clampToLine, target) {\n\t\tconst t = this.closestPointToPointParameter(point, clampToLine);\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.start.applyMatrix4(matrix);\n\t\tthis.end.applyMatrix4(matrix);\n\t\treturn this;\n\t}\n\n\tequals(line) {\n\t\treturn line.start.equals(this.start) && line.end.equals(this.end);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix3 {\n\tconstructor() {\n\t\tMatrix3.prototype.isMatrix3 = true;\n\t\tthis.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n21, n22, n23, n31, n32, n33) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[1] = n21;\n\t\tte[2] = n31;\n\t\tte[3] = n12;\n\t\tte[4] = n22;\n\t\tte[5] = n32;\n\t\tte[6] = n13;\n\t\tte[7] = n23;\n\t\tte[8] = n33;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 1, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrix3Column(this, 0);\n\t\tyAxis.setFromMatrix3Column(this, 1);\n\t\tzAxis.setFromMatrix3Column(this, 2);\n\t\treturn this;\n\t}\n\n\tsetFromMatrix4(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10]);\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[3],\n\t\t\t\t\ta13 = ae[6];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[4],\n\t\t\t\t\ta23 = ae[7];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[5],\n\t\t\t\t\ta33 = ae[8];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[3],\n\t\t\t\t\tb13 = be[6];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[4],\n\t\t\t\t\tb23 = be[7];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[5],\n\t\t\t\t\tb33 = be[8];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[3] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[4] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[5] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[3] *= s;\n\t\tte[6] *= s;\n\t\tte[1] *= s;\n\t\tte[4] *= s;\n\t\tte[7] *= s;\n\t\tte[2] *= s;\n\t\tte[5] *= s;\n\t\tte[8] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst a = te[0],\n\t\t\t\t\tb = te[1],\n\t\t\t\t\tc = te[2],\n\t\t\t\t\td = te[3],\n\t\t\t\t\te = te[4],\n\t\t\t\t\tf = te[5],\n\t\t\t\t\tg = te[6],\n\t\t\t\t\th = te[7],\n\t\t\t\t\ti = te[8];\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\t}\n\n\tinvert() {\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn12 = te[3],\n\t\t\t\t\tn22 = te[4],\n\t\t\t\t\tn32 = te[5],\n\t\t\t\t\tn13 = te[6],\n\t\t\t\t\tn23 = te[7],\n\t\t\t\t\tn33 = te[8],\n\t\t\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\t\t\tt13 = n23 * n12 - n22 * n13,\n\t\t\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n31 * n23 - n33 * n21) * detInv;\n\t\tte[2] = (n32 * n21 - n31 * n22) * detInv;\n\t\tte[3] = t12 * detInv;\n\t\tte[4] = (n33 * n11 - n31 * n13) * detInv;\n\t\tte[5] = (n31 * n12 - n32 * n11) * detInv;\n\t\tte[6] = t13 * detInv;\n\t\tte[7] = (n21 * n13 - n23 * n11) * detInv;\n\t\tte[8] = (n22 * n11 - n21 * n12) * detInv;\n\t\treturn this;\n\t}\n\n\ttranspose() {\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\t\ttmp = m[1];\n\t\tm[1] = m[3];\n\t\tm[3] = tmp;\n\t\ttmp = m[2];\n\t\tm[2] = m[6];\n\t\tm[6] = tmp;\n\t\ttmp = m[5];\n\t\tm[5] = m[7];\n\t\tm[7] = tmp;\n\t\treturn this;\n\t}\n\n\tgetNormalMatrix(matrix4) {\n\t\treturn this.setFromMatrix4(matrix4).invert().transpose();\n\t}\n\n\ttransposeIntoArray(r) {\n\t\tconst m = this.elements;\n\t\tr[0] = m[0];\n\t\tr[1] = m[3];\n\t\tr[2] = m[6];\n\t\tr[3] = m[1];\n\t\tr[4] = m[4];\n\t\tr[5] = m[7];\n\t\tr[6] = m[2];\n\t\tr[7] = m[5];\n\t\tr[8] = m[8];\n\t\treturn this;\n\t}\n\n\tsetUvTransform(tx, ty, sx, sy, rotation, cx, cy) {\n\t\tconst c = Math.cos(rotation);\n\t\tconst s = Math.sin(rotation);\n\t\tthis.set(sx * c, sx * s, -sx * (c * cx + s * cy) + cx + tx, -sy * s, sy * c, -sy * (-s * cx + c * cy) + cy + ty, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tscale(sx, sy) {\n\t\tthis.premultiply(_m3.makeScale(sx, sy));\n\t\treturn this;\n\t}\n\n\trotate(theta) {\n\t\tthis.premultiply(_m3.makeRotation(-theta));\n\t\treturn this;\n\t}\n\n\ttranslate(tx, ty) {\n\t\tthis.premultiply(_m3.makeTranslation(tx, ty));\n\t\treturn this;\n\t} // for 2D Transforms\n\n\n\tmakeTranslation(x, y) {\n\t\tthis.set(1, 0, x, 0, 1, y, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotation(theta) {\n\t\t// counterclockwise\n\t\tconst c = Math.cos(theta);\n\t\tconst s = Math.sin(theta);\n\t\tthis.set(c, -s, 0, s, c, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y) {\n\t\tthis.set(x, 0, 0, 0, y, 0, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\treturn array;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().fromArray(this.elements);\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/new Matrix3();\n\nconst _vector1 = /*@__PURE__*/new Vector3();\n\nconst _vector2 = /*@__PURE__*/new Vector3();\n\nconst _normalMatrix = /*@__PURE__*/new Matrix3();\n\nclass Plane {\n\tconstructor(normal = new Vector3(1, 0, 0), constant = 0) {\n\t\tthis.isPlane = true; // normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\t}\n\n\tset(normal, constant) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = constant;\n\t\treturn this;\n\t}\n\n\tsetComponents(x, y, z, w) {\n\t\tthis.normal.set(x, y, z);\n\t\tthis.constant = w;\n\t\treturn this;\n\t}\n\n\tsetFromNormalAndCoplanarPoint(normal, point) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = -point.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tsetFromCoplanarPoints(a, b, c) {\n\t\tconst normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize(); // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\n\t\tthis.setFromNormalAndCoplanarPoint(normal, a);\n\t\treturn this;\n\t}\n\n\tcopy(plane) {\n\t\tthis.normal.copy(plane.normal);\n\t\tthis.constant = plane.constant;\n\t\treturn this;\n\t}\n\n\tnormalize() {\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar(inverseNormalLength);\n\t\tthis.constant *= inverseNormalLength;\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.constant *= -1;\n\t\tthis.normal.negate();\n\t\treturn this;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn this.normal.dot(point) + this.constant;\n\t}\n\n\tdistanceToSphere(sphere) {\n\t\treturn this.distanceToPoint(sphere.center) - sphere.radius;\n\t}\n\n\tprojectPoint(point, target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);\n\t}\n\n\tintersectLine(line, target) {\n\t\tconst direction = line.delta(_vector1);\n\t\tconst denominator = this.normal.dot(direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (this.distanceToPoint(line.start) === 0) {\n\t\t\t\treturn target.copy(line.start);\n\t\t\t} // Unsure if this is the correct method to handle this case.\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(line.start.dot(this.normal) + this.constant) / denominator;\n\n\t\tif (t < 0 || t > 1) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn target.copy(direction).multiplyScalar(t).add(line.start);\n\t}\n\n\tintersectsLine(line) {\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\t\tconst startSign = this.distanceToPoint(line.start);\n\t\tconst endSign = this.distanceToPoint(line.end);\n\t\treturn startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsPlane(this);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn sphere.intersectsPlane(this);\n\t}\n\n\tcoplanarPoint(target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.constant);\n\t}\n\n\tapplyMatrix4(matrix, optionalNormalMatrix) {\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);\n\n\t\tconst referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);\n\t\tconst normal = this.normal.applyMatrix3(normalMatrix).normalize();\n\t\tthis.constant = -referencePoint.dot(normal);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.constant -= offset.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tequals(plane) {\n\t\treturn plane.normal.equals(this.normal) && plane.constant === this.constant;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/new Vector3();\n\nconst _segCenter = /*@__PURE__*/new Vector3();\n\nconst _segDir = /*@__PURE__*/new Vector3();\n\nconst _diff = /*@__PURE__*/new Vector3();\n\nconst _edge1 = /*@__PURE__*/new Vector3();\n\nconst _edge2 = /*@__PURE__*/new Vector3();\n\nconst _normal = /*@__PURE__*/new Vector3();\n\nclass Ray {\n\tconstructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\t}\n\n\tset(origin, direction) {\n\t\tthis.origin.copy(origin);\n\t\tthis.direction.copy(direction);\n\t\treturn this;\n\t}\n\n\tcopy(ray) {\n\t\tthis.origin.copy(ray.origin);\n\t\tthis.direction.copy(ray.direction);\n\t\treturn this;\n\t}\n\n\tat(t, target = new Vector3()) {\n\t\treturn target.copy(this.direction).multiplyScalar(t).add(this.origin);\n\t}\n\n\tlookAt(v) {\n\t\tthis.direction.copy(v).sub(this.origin).normalize();\n\t\treturn this;\n\t}\n\n\trecast(t) {\n\t\tthis.origin.copy(this.at(t, _vector));\n\t\treturn this;\n\t}\n\n\tclosestPointToPoint(point, target = new Vector3()) {\n\t\ttarget.subVectors(point, this.origin);\n\t\tconst directionDistance = target.dot(this.direction);\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn target.copy(this.origin);\n\t\t}\n\n\t\treturn target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn Math.sqrt(this.distanceSqToPoint(point));\n\t}\n\n\tdistanceSqToPoint(point) {\n\t\tconst directionDistance = _vector.subVectors(point, this.origin).dot(this.direction); // point behind the ray\n\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn this.origin.distanceToSquared(point);\n\t\t}\n\n\t\t_vector.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\n\t\treturn _vector.distanceToSquared(point);\n\t}\n\n\tdistanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\t\t_segCenter.copy(v0).add(v1).multiplyScalar(0.5);\n\n\t\t_segDir.copy(v1).sub(v0).normalize();\n\n\t\t_diff.copy(this.origin).sub(_segCenter);\n\n\t\tconst segExtent = v0.distanceTo(v1) * 0.5;\n\t\tconst a01 = -this.direction.dot(_segDir);\n\n\t\tconst b0 = _diff.dot(this.direction);\n\n\t\tconst b1 = -_diff.dot(_segDir);\n\n\t\tconst c = _diff.lengthSq();\n\n\t\tconst det = Math.abs(1 - a01 * a01);\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif (det > 0) {\n\t\t\t// The ray and segment are not parallel.\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif (s0 >= 0) {\n\t\t\t\tif (s1 >= -extDet) {\n\t\t\t\t\tif (s1 <= extDet) {\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 1\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// region 5\n\t\t\t\t\ts1 = -segExtent;\n\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s1 <= -extDet) {\n\t\t\t\t\t// region 4\n\t\t\t\t\ts0 = Math.max(0, -(-a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else if (s1 <= extDet) {\n\t\t\t\t\t// region 3\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else {\n\t\t\t\t\t// region 2\n\t\t\t\t\ts0 = Math.max(0, -(a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Ray and segment are parallel.\n\t\t\ts1 = a01 > 0 ? -segExtent : segExtent;\n\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t}\n\n\t\tif (optionalPointOnRay) {\n\t\t\toptionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);\n\t\t}\n\n\t\tif (optionalPointOnSegment) {\n\t\t\toptionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);\n\t\t}\n\n\t\treturn sqrDist;\n\t}\n\n\tintersectSphere(sphere, target = new Vector3()) {\n\t\t_vector.subVectors(sphere.center, this.origin);\n\n\t\tconst tca = _vector.dot(this.direction);\n\n\t\tconst d2 = _vector.dot(_vector) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\t\tif (d2 > radius2) return null;\n\t\tconst thc = Math.sqrt(radius2 - d2); // t0 = first intersect point - entrance on front of sphere\n\n\t\tconst t0 = tca - thc; // t1 = second intersect point - exit point on back of sphere\n\n\t\tconst t1 = tca + thc; // test to see if both t0 and t1 are behind the ray - if so, return null\n\n\t\tif (t0 < 0 && t1 < 0) return null; // test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\n\t\tif (t0 < 0) return this.at(t1, target); // else t0 is in front of the ray, so return the first collision point scaled by t0\n\n\t\treturn this.at(t0, target);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tdistanceToPlane(plane) {\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (plane.distanceToPoint(this.origin) === 0) {\n\t\t\t\treturn 0;\n\t\t\t} // Null is preferable to undefined since undefined means.... it is undefined\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(this.origin.dot(plane.normal) + plane.constant) / denominator; // Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\t}\n\n\tintersectPlane(plane, target) {\n\t\tconst t = this.distanceToPlane(plane);\n\n\t\tif (t === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.at(t, target);\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// check if the ray lies on the plane first\n\t\tconst distToPoint = plane.distanceToPoint(this.origin);\n\n\t\tif (distToPoint === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator * distToPoint < 0) {\n\t\t\treturn true;\n\t\t} // ray origin is behind the plane (and is pointing behind it)\n\n\n\t\treturn false;\n\t}\n\n\tintersectBox(box, target) {\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\t\t\tinvdirz = 1 / this.direction.z;\n\t\tconst origin = this.origin;\n\n\t\tif (invdirx >= 0) {\n\t\t\ttmin = (box.min.x - origin.x) * invdirx;\n\t\t\ttmax = (box.max.x - origin.x) * invdirx;\n\t\t} else {\n\t\t\ttmin = (box.max.x - origin.x) * invdirx;\n\t\t\ttmax = (box.min.x - origin.x) * invdirx;\n\t\t}\n\n\t\tif (invdiry >= 0) {\n\t\t\ttymin = (box.min.y - origin.y) * invdiry;\n\t\t\ttymax = (box.max.y - origin.y) * invdiry;\n\t\t} else {\n\t\t\ttymin = (box.max.y - origin.y) * invdiry;\n\t\t\ttymax = (box.min.y - origin.y) * invdiry;\n\t\t}\n\n\t\tif (tmin > tymax || tymin > tmax) return null; // These lines also handle the case where tmin or tmax is NaN\n\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\tif (tymin > tmin || tmin !== tmin) tmin = tymin;\n\t\tif (tymax < tmax || tmax !== tmax) tmax = tymax;\n\n\t\tif (invdirz >= 0) {\n\t\t\ttzmin = (box.min.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.max.z - origin.z) * invdirz;\n\t\t} else {\n\t\t\ttzmin = (box.max.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.min.z - origin.z) * invdirz;\n\t\t}\n\n\t\tif (tmin > tzmax || tzmin > tmax) return null;\n\t\tif (tzmin > tmin || tmin !== tmin) tmin = tzmin;\n\t\tif (tzmax < tmax || tmax !== tmax) tmax = tzmax; //return point closest to the ray (positive side)\n\n\t\tif (tmax < 0) return null;\n\t\treturn this.at(tmin >= 0 ? tmin : tmax, target);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn this.intersectBox(box, _vector) !== null;\n\t}\n\n\tintersectTriangle(a, b, c, backfaceCulling, target) {\n\t\t// Compute the offset origin, edges, and normal.\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\t\t_edge1.subVectors(b, a);\n\n\t\t_edge2.subVectors(c, a);\n\n\t\t_normal.crossVectors(_edge1, _edge2); // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t//\t |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t//\t |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t//\t |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\n\n\t\tlet DdN = this.direction.dot(_normal);\n\t\tlet sign;\n\n\t\tif (DdN > 0) {\n\t\t\tif (backfaceCulling) return null;\n\t\t\tsign = 1;\n\t\t} else if (DdN < 0) {\n\t\t\tsign = -1;\n\t\t\tDdN = -DdN;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\n\t\t_diff.subVectors(this.origin, a);\n\n\t\tconst DdQxE2 = sign * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); // b1 < 0, no intersection\n\n\t\tif (DdQxE2 < 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot(_edge1.cross(_diff)); // b2 < 0, no intersection\n\n\t\tif (DdE1xQ < 0) {\n\t\t\treturn null;\n\t\t} // b1+b2 > 1, no intersection\n\n\n\t\tif (DdQxE2 + DdE1xQ > DdN) {\n\t\t\treturn null;\n\t\t} // Line intersects triangle, check if ray does.\n\n\n\t\tconst QdN = -sign * _diff.dot(_normal); // t < 0, no intersection\n\n\n\t\tif (QdN < 0) {\n\t\t\treturn null;\n\t\t} // Ray intersects triangle.\n\n\n\t\treturn this.at(QdN / DdN, target);\n\t}\n\n\tapplyMatrix4(matrix4) {\n\t\tthis.origin.applyMatrix4(matrix4);\n\t\tthis.direction.transformDirection(matrix4);\n\t\treturn this;\n\t}\n\n\tequals(ray) {\n\t\treturn ray.origin.equals(this.origin) && ray.direction.equals(this.direction);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _box = /*@__PURE__*/new Box3();\n\nconst _v1$1 = /*@__PURE__*/new Vector3();\n\nconst _toFarthestPoint = /*@__PURE__*/new Vector3();\n\nconst _toPoint = /*@__PURE__*/new Vector3();\n\nclass Sphere {\n\tconstructor(center = new Vector3(), radius = -1) {\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\t}\n\n\tset(center, radius) {\n\t\tthis.center.copy(center);\n\t\tthis.radius = radius;\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points, optionalCenter) {\n\t\tconst center = this.center;\n\n\t\tif (optionalCenter !== undefined) {\n\t\t\tcenter.copy(optionalCenter);\n\t\t} else {\n\t\t\t_box.setFromPoints(points).getCenter(center);\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));\n\t\t}\n\n\t\tthis.radius = Math.sqrt(maxRadiusSq);\n\t\treturn this;\n\t}\n\n\tcopy(sphere) {\n\t\tthis.center.copy(sphere.center);\n\t\tthis.radius = sphere.radius;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\treturn this.radius < 0;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.center.set(0, 0, 0);\n\t\tthis.radius = -1;\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.distanceToSquared(this.center) <= this.radius * this.radius;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn point.distanceTo(this.center) - this.radius;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\tconst radiusSum = this.radius + sphere.radius;\n\t\treturn sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsSphere(this);\n\t}\n\n\tintersectsPlane(plane) {\n\t\treturn Math.abs(plane.distanceToPoint(this.center)) <= this.radius;\n\t}\n\n\tclampPoint(point, target) {\n\t\tconst deltaLengthSq = this.center.distanceToSquared(point);\n\t\ttarget.copy(point);\n\n\t\tif (deltaLengthSq > this.radius * this.radius) {\n\t\t\ttarget.sub(this.center).normalize();\n\t\t\ttarget.multiplyScalar(this.radius).add(this.center);\n\t\t}\n\n\t\treturn target;\n\t}\n\n\tgetBoundingBox(target) {\n\t\tif (this.isEmpty()) {\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\t\t}\n\n\t\ttarget.set(this.center, this.center);\n\t\ttarget.expandByScalar(this.radius);\n\t\treturn target;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.center.applyMatrix4(matrix);\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.center.add(offset);\n\t\treturn this;\n\t}\n\n\texpandByPoint(point) {\n\t\tif (this.isEmpty()) {\n\t\t\tthis.center.copy(point);\n\t\t\tthis.radius = 0;\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671\n\n\n\t\t_toPoint.subVectors(point, this.center);\n\n\t\tconst lengthSq = _toPoint.lengthSq();\n\n\t\tif (lengthSq > this.radius * this.radius) {\n\t\t\tconst length = Math.sqrt(lengthSq);\n\t\t\tconst missingRadiusHalf = (length - this.radius) * 0.5; // Nudge this sphere towards the target point. Add half the missing distance to radius,\n\t\t\t// and the other half to position. This gives a tighter enclosure, instead of if\n\t\t\t// the whole missing distance were just added to radius.\n\n\t\t\tthis.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length));\n\t\t\tthis.radius += missingRadiusHalf;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tunion(sphere) {\n\t\t// handle empty sphere cases\n\t\tif (sphere.isEmpty()) {\n\t\t\treturn;\n\t\t} else if (this.isEmpty()) {\n\t\t\tthis.copy(sphere);\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769\n\t\t// To enclose another sphere into this sphere, we only need to enclose two points:\n\t\t// 1) Enclose the farthest point on the other sphere into this sphere.\n\t\t// 2) Enclose the opposite point of the farthest point into this sphere.\n\n\n\t\tif (this.center.equals(sphere.center) === true) {\n\t\t\t_toFarthestPoint.set(0, 0, 1).multiplyScalar(sphere.radius);\n\t\t} else {\n\t\t\t_toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);\n\t\t}\n\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).add(_toFarthestPoint));\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).sub(_toFarthestPoint));\n\t\treturn this;\n\t}\n\n\tequals(sphere) {\n\t\treturn sphere.center.equals(this.center) && sphere.radius === this.radius;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\r\n *\r\n * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\r\n * The azimuthal angle (theta) is measured from the positive z-axis.\r\n */\n\nclass Spherical {\n\tconstructor(radius = 1, phi = 0, theta = 0) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi; // polar angle\n\n\t\tthis.theta = theta; // azimuthal angle\n\n\t\treturn this;\n\t}\n\n\tset(radius, phi, theta) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\t\treturn this;\n\t} // restrict phi to be between EPS and PI-EPS\n\n\n\tmakeSafe() {\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi));\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + y * y + z * z);\n\n\t\tif (this.radius === 0) {\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\t\t} else {\n\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\tthis.phi = Math.acos(clamp(y / this.radius, -1, 1));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/new Vector3();\n\nconst _v1 = /*@__PURE__*/new Vector3();\n\nconst _v2 = /*@__PURE__*/new Vector3();\n\nconst _v3 = /*@__PURE__*/new Vector3();\n\nconst _vab = /*@__PURE__*/new Vector3();\n\nconst _vac = /*@__PURE__*/new Vector3();\n\nconst _vbc = /*@__PURE__*/new Vector3();\n\nconst _vap = /*@__PURE__*/new Vector3();\n\nconst _vbp = /*@__PURE__*/new Vector3();\n\nconst _vcp = /*@__PURE__*/new Vector3();\n\nclass Triangle {\n\tconstructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\t}\n\n\tstatic getNormal(a, b, c, target) {\n\t\ttarget.subVectors(c, b);\n\n\t\t_v0.subVectors(a, b);\n\n\t\ttarget.cross(_v0);\n\t\tconst targetLengthSq = target.lengthSq();\n\n\t\tif (targetLengthSq > 0) {\n\t\t\treturn target.multiplyScalar(1 / Math.sqrt(targetLengthSq));\n\t\t}\n\n\t\treturn target.set(0, 0, 0);\n\t} // static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\n\tstatic getBarycoord(point, a, b, c, target) {\n\t\t_v0.subVectors(c, a);\n\n\t\t_v1.subVectors(b, a);\n\n\t\t_v2.subVectors(point, a);\n\n\t\tconst dot00 = _v0.dot(_v0);\n\n\t\tconst dot01 = _v0.dot(_v1);\n\n\t\tconst dot02 = _v0.dot(_v2);\n\n\t\tconst dot11 = _v1.dot(_v1);\n\n\t\tconst dot12 = _v1.dot(_v2);\n\n\t\tconst denom = dot00 * dot11 - dot01 * dot01; // collinear or singular triangle\n\n\t\tif (denom === 0) {\n\t\t\t// arbitrary location outside of triangle?\n\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\treturn target.set(-2, -1, -1);\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n\t\tconst v = (dot00 * dot12 - dot01 * dot02) * invDenom; // barycentric coordinates must always sum to 1\n\n\t\treturn target.set(1 - u - v, v, u);\n\t}\n\n\tstatic containsPoint(point, a, b, c) {\n\t\tthis.getBarycoord(point, a, b, c, _v3);\n\t\treturn _v3.x >= 0 && _v3.y >= 0 && _v3.x + _v3.y <= 1;\n\t}\n\n\tstatic getUV(point, p1, p2, p3, uv1, uv2, uv3, target) {\n\t\tthis.getBarycoord(point, p1, p2, p3, _v3);\n\t\ttarget.set(0, 0);\n\t\ttarget.addScaledVector(uv1, _v3.x);\n\t\ttarget.addScaledVector(uv2, _v3.y);\n\t\ttarget.addScaledVector(uv3, _v3.z);\n\t\treturn target;\n\t}\n\n\tstatic isFrontFacing(a, b, c, direction) {\n\t\t_v0.subVectors(c, b);\n\n\t\t_v1.subVectors(a, b); // strictly front facing\n\n\n\t\treturn _v0.cross(_v1).dot(direction) < 0 ? true : false;\n\t}\n\n\tset(a, b, c) {\n\t\tthis.a.copy(a);\n\t\tthis.b.copy(b);\n\t\tthis.c.copy(c);\n\t\treturn this;\n\t}\n\n\tsetFromPointsAndIndices(points, i0, i1, i2) {\n\t\tthis.a.copy(points[i0]);\n\t\tthis.b.copy(points[i1]);\n\t\tthis.c.copy(points[i2]);\n\t\treturn this;\n\t} // setFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\t// \tthis.a.fromBufferAttribute( attribute, i0 );\n\t// \tthis.b.fromBufferAttribute( attribute, i1 );\n\t// \tthis.c.fromBufferAttribute( attribute, i2 );\n\t// \treturn this;\n\t// }\n\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(triangle) {\n\t\tthis.a.copy(triangle.a);\n\t\tthis.b.copy(triangle.b);\n\t\tthis.c.copy(triangle.c);\n\t\treturn this;\n\t}\n\n\tgetArea() {\n\t\t_v0.subVectors(this.c, this.b);\n\n\t\t_v1.subVectors(this.a, this.b);\n\n\t\treturn _v0.cross(_v1).length() * 0.5;\n\t}\n\n\tgetMidpoint(target) {\n\t\treturn target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n\t}\n\n\tgetNormal(target) {\n\t\treturn Triangle.getNormal(this.a, this.b, this.c, target);\n\t}\n\n\tgetPlane(target) {\n\t\treturn target.setFromCoplanarPoints(this.a, this.b, this.c);\n\t}\n\n\tgetBarycoord(point, target) {\n\t\treturn Triangle.getBarycoord(point, this.a, this.b, this.c, target);\n\t}\n\n\tgetUV(point, uv1, uv2, uv3, target) {\n\t\treturn Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target);\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn Triangle.containsPoint(point, this.a, this.b, this.c);\n\t}\n\n\tisFrontFacing(direction) {\n\t\treturn Triangle.isFrontFacing(this.a, this.b, this.c, direction);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsTriangle(this);\n\t}\n\n\tclosestPointToPoint(p, target) {\n\t\tconst a = this.a,\n\t\t\t\t\tb = this.b,\n\t\t\t\t\tc = this.c;\n\t\tlet v, w; // algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors(b, a);\n\n\t\t_vac.subVectors(c, a);\n\n\t\t_vap.subVectors(p, a);\n\n\t\tconst d1 = _vab.dot(_vap);\n\n\t\tconst d2 = _vac.dot(_vap);\n\n\t\tif (d1 <= 0 && d2 <= 0) {\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy(a);\n\t\t}\n\n\t\t_vbp.subVectors(p, b);\n\n\t\tconst d3 = _vab.dot(_vbp);\n\n\t\tconst d4 = _vac.dot(_vbp);\n\n\t\tif (d3 >= 0 && d4 <= d3) {\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy(b);\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\n\t\tif (vc <= 0 && d1 >= 0 && d3 <= 0) {\n\t\t\tv = d1 / (d1 - d3); // edge region of AB; barycentric coords (1-v, v, 0)\n\n\t\t\treturn target.copy(a).addScaledVector(_vab, v);\n\t\t}\n\n\t\t_vcp.subVectors(p, c);\n\n\t\tconst d5 = _vab.dot(_vcp);\n\n\t\tconst d6 = _vac.dot(_vcp);\n\n\t\tif (d6 >= 0 && d5 <= d6) {\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy(c);\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\n\t\tif (vb <= 0 && d2 >= 0 && d6 <= 0) {\n\t\t\tw = d2 / (d2 - d6); // edge region of AC; barycentric coords (1-w, 0, w)\n\n\t\t\treturn target.copy(a).addScaledVector(_vac, w);\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\n\t\tif (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {\n\t\t\t_vbc.subVectors(c, b);\n\n\t\t\tw = (d4 - d3) / (d4 - d3 + (d5 - d6)); // edge region of BC; barycentric coords (0, 1-w, w)\n\n\t\t\treturn target.copy(b).addScaledVector(_vbc, w); // edge region of BC\n\t\t} // face region\n\n\n\t\tconst denom = 1 / (va + vb + vc); // u = va * denom\n\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\t\treturn target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w);\n\t}\n\n\tequals(triangle) {\n\t\treturn triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);\n\t}\n\n}\n\nclass Vector4 {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tVector4.prototype.isVector4 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t}\n\n\tget width() {\n\t\treturn this.z;\n\t}\n\n\tset width(value) {\n\t\tthis.z = value;\n\t}\n\n\tget height() {\n\t\treturn this.w;\n\t}\n\n\tset height(value) {\n\t\tthis.w = value;\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetW(w) {\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tthis.w = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tcase 3:\n\t\t\t\treturn this.w;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z, this.w);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = v.w !== undefined ? v.w : 1;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z,\n\t\t\t\t\tw = this.w;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w;\n\t\tthis.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tsetAxisAngleFromQuaternion(q) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\t\t// q is assumed to be normalized\n\t\tthis.w = 2 * Math.acos(q.w);\n\t\tconst s = Math.sqrt(1 - q.w * q.w);\n\n\t\tif (s < 0.0001) {\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\t\t} else {\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetAxisAngleFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tlet angle, x, y, z; // variables for result\n\n\t\tconst epsilon = 0.01,\n\t\t\t\t\t// margin to allow for rounding errors\n\t\tepsilon2 = 0.1,\n\t\t\t\t\t// margin to distinguish between 0 and 180 degrees\n\t\tte = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tif (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\t\t\tif (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\t\t\t\tthis.set(1, 0, 0, 0);\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\t\t\t} // otherwise this singularity is angle = 180\n\n\n\t\t\tangle = Math.PI;\n\t\t\tconst xx = (m11 + 1) / 2;\n\t\t\tconst yy = (m22 + 1) / 2;\n\t\t\tconst zz = (m33 + 1) / 2;\n\t\t\tconst xy = (m12 + m21) / 4;\n\t\t\tconst xz = (m13 + m31) / 4;\n\t\t\tconst yz = (m23 + m32) / 4;\n\n\t\t\tif (xx > yy && xx > zz) {\n\t\t\t\t// m11 is the largest diagonal term\n\t\t\t\tif (xx < epsilon) {\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\tx = Math.sqrt(xx);\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\t\t\t\t}\n\t\t\t} else if (yy > zz) {\n\t\t\t\t// m22 is the largest diagonal term\n\t\t\t\tif (yy < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\ty = Math.sqrt(yy);\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\t\t\t\tif (zz < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\t\t\t\t} else {\n\t\t\t\t\tz = Math.sqrt(zz);\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.set(x, y, z, angle);\n\t\t\treturn this; // return 180 deg rotation\n\t\t} // as we have reached here there are no singularities so we can handle normally\n\n\n\t\tlet s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); // used to normalize\n\n\t\tif (Math.abs(s) < 0.001) s = 1; // prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = (m32 - m23) / s;\n\t\tthis.y = (m13 - m31) / s;\n\t\tthis.z = (m21 - m12) / s;\n\t\tthis.w = Math.acos((m11 + m22 + m33 - 1) / 2);\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\tthis.w = Math.min(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\tthis.w = Math.max(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\tthis.w = Math.max(min.w, Math.min(max.w, this.w));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\tthis.w = Math.max(minVal, Math.min(maxVal, this.w));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\tthis.w = Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\tthis.w = Math.ceil(this.w);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\tthis.w = Math.round(this.w);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\tthis.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\tthis.w = -this.w;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\tthis.w += (v.w - this.w) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\tthis.w = v1.w + (v2.w - v1.w) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\tthis.w = array[offset + 3];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\tarray[offset + 3] = this.w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \tthis.w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\t}\n\n}\n\nexports.ACESFilmicToneMapping = ACESFilmicToneMapping;\nexports.AddEquation = AddEquation;\nexports.AddOperation = AddOperation;\nexports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;\nexports.AdditiveBlending = AdditiveBlending;\nexports.AlphaFormat = AlphaFormat;\nexports.AlwaysDepth = AlwaysDepth;\nexports.AlwaysStencilFunc = AlwaysStencilFunc;\nexports.BackSide = BackSide;\nexports.BasicDepthPacking = BasicDepthPacking;\nexports.BasicShadowMap = BasicShadowMap;\nexports.Box2 = Box2;\nexports.Box3 = Box3;\nexports.ByteType = ByteType;\nexports.CineonToneMapping = CineonToneMapping;\nexports.ClampToEdgeWrapping = ClampToEdgeWrapping;\nexports.Color = Color;\nexports.ColorManagement = ColorManagement;\nexports.CubeReflectionMapping = CubeReflectionMapping;\nexports.CubeRefractionMapping = CubeRefractionMapping;\nexports.CubeUVReflectionMapping = CubeUVReflectionMapping;\nexports.CullFaceBack = CullFaceBack;\nexports.CullFaceFront = CullFaceFront;\nexports.CullFaceFrontBack = CullFaceFrontBack;\nexports.CullFaceNone = CullFaceNone;\nexports.CustomBlending = CustomBlending;\nexports.CustomToneMapping = CustomToneMapping;\nexports.Cylindrical = Cylindrical;\nexports.DecrementStencilOp = DecrementStencilOp;\nexports.DecrementWrapStencilOp = DecrementWrapStencilOp;\nexports.DepthFormat = DepthFormat;\nexports.DepthStencilFormat = DepthStencilFormat;\nexports.DoubleSide = DoubleSide;\nexports.DstAlphaFactor = DstAlphaFactor;\nexports.DstColorFactor = DstColorFactor;\nexports.DynamicCopyUsage = DynamicCopyUsage;\nexports.DynamicDrawUsage = DynamicDrawUsage;\nexports.DynamicReadUsage = DynamicReadUsage;\nexports.EqualDepth = EqualDepth;\nexports.EqualStencilFunc = EqualStencilFunc;\nexports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;\nexports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;\nexports.Euler = Euler;\nexports.FloatType = FloatType;\nexports.FrontSide = FrontSide;\nexports.GLSL1 = GLSL1;\nexports.GLSL3 = GLSL3;\nexports.GreaterDepth = GreaterDepth;\nexports.GreaterEqualDepth = GreaterEqualDepth;\nexports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;\nexports.GreaterStencilFunc = GreaterStencilFunc;\nexports.HalfFloatType = HalfFloatType;\nexports.IncrementStencilOp = IncrementStencilOp;\nexports.IncrementWrapStencilOp = IncrementWrapStencilOp;\nexports.IntType = IntType;\nexports.Interpolant = Interpolant;\nexports.InterpolateDiscrete = InterpolateDiscrete;\nexports.InterpolateLinear = InterpolateLinear;\nexports.InterpolateSmooth = InterpolateSmooth;\nexports.InvertStencilOp = InvertStencilOp;\nexports.KeepStencilOp = KeepStencilOp;\nexports.LessDepth = LessDepth;\nexports.LessEqualDepth = LessEqualDepth;\nexports.LessEqualStencilFunc = LessEqualStencilFunc;\nexports.LessStencilFunc = LessStencilFunc;\nexports.Line3 = Line3;\nexports.LinearEncoding = LinearEncoding;\nexports.LinearFilter = LinearFilter;\nexports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;\nexports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;\nexports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;\nexports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;\nexports.LinearSRGBColorSpace = LinearSRGBColorSpace;\nexports.LinearToSRGB = LinearToSRGB;\nexports.LinearToneMapping = LinearToneMapping;\nexports.LoopOnce = LoopOnce;\nexports.LoopPingPong = LoopPingPong;\nexports.LoopRepeat = LoopRepeat;\nexports.LuminanceAlphaFormat = LuminanceAlphaFormat;\nexports.LuminanceFormat = LuminanceFormat;\nexports.MOUSE = MOUSE;\nexports.MathUtils = MathUtils;\nexports.Matrix3 = Matrix3;\nexports.Matrix4 = Matrix4;\nexports.MaxEquation = MaxEquation;\nexports.MinEquation = MinEquation;\nexports.MirroredRepeatWrapping = MirroredRepeatWrapping;\nexports.MixOperation = MixOperation;\nexports.MultiplyBlending = MultiplyBlending;\nexports.MultiplyOperation = MultiplyOperation;\nexports.NearestFilter = NearestFilter;\nexports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;\nexports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;\nexports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;\nexports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;\nexports.NeverDepth = NeverDepth;\nexports.NeverStencilFunc = NeverStencilFunc;\nexports.NoBlending = NoBlending;\nexports.NoColorSpace = NoColorSpace;\nexports.NoToneMapping = NoToneMapping;\nexports.NormalAnimationBlendMode = NormalAnimationBlendMode;\nexports.NormalBlending = NormalBlending;\nexports.NotEqualDepth = NotEqualDepth;\nexports.NotEqualStencilFunc = NotEqualStencilFunc;\nexports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;\nexports.OneFactor = OneFactor;\nexports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;\nexports.OneMinusDstColorFactor = OneMinusDstColorFactor;\nexports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;\nexports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;\nexports.PCFShadowMap = PCFShadowMap;\nexports.PCFSoftShadowMap = PCFSoftShadowMap;\nexports.Plane = Plane;\nexports.Quaternion = Quaternion;\nexports.REVISION = REVISION;\nexports.RGBADepthPacking = RGBADepthPacking;\nexports.RGBAFormat = RGBAFormat;\nexports.RGBAIntegerFormat = RGBAIntegerFormat;\nexports.RGBA_ASTC_10x10_Format = RGBA_ASTC_10x10_Format;\nexports.RGBA_ASTC_10x5_Format = RGBA_ASTC_10x5_Format;\nexports.RGBA_ASTC_10x6_Format = RGBA_ASTC_10x6_Format;\nexports.RGBA_ASTC_10x8_Format = RGBA_ASTC_10x8_Format;\nexports.RGBA_ASTC_12x10_Format = RGBA_ASTC_12x10_Format;\nexports.RGBA_ASTC_12x12_Format = RGBA_ASTC_12x12_Format;\nexports.RGBA_ASTC_4x4_Format = RGBA_ASTC_4x4_Format;\nexports.RGBA_ASTC_5x4_Format = RGBA_ASTC_5x4_Format;\nexports.RGBA_ASTC_5x5_Format = RGBA_ASTC_5x5_Format;\nexports.RGBA_ASTC_6x5_Format = RGBA_ASTC_6x5_Format;\nexports.RGBA_ASTC_6x6_Format = RGBA_ASTC_6x6_Format;\nexports.RGBA_ASTC_8x5_Format = RGBA_ASTC_8x5_Format;\nexports.RGBA_ASTC_8x6_Format = RGBA_ASTC_8x6_Format;\nexports.RGBA_ASTC_8x8_Format = RGBA_ASTC_8x8_Format;\nexports.RGBA_BPTC_Format = RGBA_BPTC_Format;\nexports.RGBA_ETC2_EAC_Format = RGBA_ETC2_EAC_Format;\nexports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format;\nexports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format;\nexports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;\nexports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;\nexports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;\nexports.RGBFormat = RGBFormat;\nexports.RGB_ETC1_Format = RGB_ETC1_Format;\nexports.RGB_ETC2_Format = RGB_ETC2_Format;\nexports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;\nexports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format;\nexports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format;\nexports.RGFormat = RGFormat;\nexports.RGIntegerFormat = RGIntegerFormat;\nexports.Ray = Ray;\nexports.RedFormat = RedFormat;\nexports.RedIntegerFormat = RedIntegerFormat;\nexports.ReinhardToneMapping = ReinhardToneMapping;\nexports.RepeatWrapping = RepeatWrapping;\nexports.ReplaceStencilOp = ReplaceStencilOp;\nexports.ReverseSubtractEquation = ReverseSubtractEquation;\nexports.SRGBColorSpace = SRGBColorSpace;\nexports.SRGBToLinear = SRGBToLinear;\nexports.ShortType = ShortType;\nexports.Sphere = Sphere;\nexports.Spherical = Spherical;\nexports.SrcAlphaFactor = SrcAlphaFactor;\nexports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;\nexports.SrcColorFactor = SrcColorFactor;\nexports.StaticCopyUsage = StaticCopyUsage;\nexports.StaticDrawUsage = StaticDrawUsage;\nexports.StaticReadUsage = StaticReadUsage;\nexports.StreamCopyUsage = StreamCopyUsage;\nexports.StreamDrawUsage = StreamDrawUsage;\nexports.StreamReadUsage = StreamReadUsage;\nexports.SubtractEquation = SubtractEquation;\nexports.SubtractiveBlending = SubtractiveBlending;\nexports.TOUCH = TOUCH;\nexports.TangentSpaceNormalMap = TangentSpaceNormalMap;\nexports.Triangle = Triangle;\nexports.TriangleFanDrawMode = TriangleFanDrawMode;\nexports.TriangleStripDrawMode = TriangleStripDrawMode;\nexports.TrianglesDrawMode = TrianglesDrawMode;\nexports.UVMapping = UVMapping;\nexports.UnsignedByteType = UnsignedByteType;\nexports.UnsignedInt248Type = UnsignedInt248Type;\nexports.UnsignedIntType = UnsignedIntType;\nexports.UnsignedShort4444Type = UnsignedShort4444Type;\nexports.UnsignedShort5551Type = UnsignedShort5551Type;\nexports.UnsignedShortType = UnsignedShortType;\nexports.VSMShadowMap = VSMShadowMap;\nexports.Vector2 = Vector2;\nexports.Vector3 = Vector3;\nexports.Vector4 = Vector4;\nexports.WrapAroundEnding = WrapAroundEnding;\nexports.ZeroCurvatureEnding = ZeroCurvatureEnding;\nexports.ZeroFactor = ZeroFactor;\nexports.ZeroSlopeEnding = ZeroSlopeEnding;\nexports.ZeroStencilOp = ZeroStencilOp;\nexports._SRGBAFormat = _SRGBAFormat;\nexports.sRGBEncoding = sRGBEncoding;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/threejs-math/build/threejs-math.cjs?")}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(t){var n=__webpack_module_cache__[t];if(void 0!==n)return n.exports;var e=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(e.exports,e,e.exports,__webpack_require__),e.exports}getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var e=Object.create(null);__webpack_require__.r(e);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&n&&t;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((n=>r[n]=()=>t[n]));return r.default=()=>t,__webpack_require__.d(e,r),e},__webpack_require__.d=(t,n)=>{for(var e in n)__webpack_require__.o(n,e)&&!__webpack_require__.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/index.ts");manifesto=__webpack_exports__})();
\ No newline at end of file
+var manifesto;(()=>{var __webpack_modules__={"./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\r\nObject.defineProperty(exports, "__esModule", ({ value: true }));\r\nexports.CONTINUE = 100;\r\nexports.SWITCHING_PROTOCOLS = 101;\r\nexports.PROCESSING = 102;\r\nexports.OK = 200;\r\nexports.CREATED = 201;\r\nexports.ACCEPTED = 202;\r\nexports.NON_AUTHORITATIVE_INFORMATION = 203;\r\nexports.NO_CONTENT = 204;\r\nexports.RESET_CONTENT = 205;\r\nexports.PARTIAL_CONTENT = 206;\r\nexports.MULTI_STATUS = 207;\r\nexports.MULTIPLE_CHOICES = 300;\r\nexports.MOVED_PERMANENTLY = 301;\r\nexports.MOVED_TEMPORARILY = 302;\r\nexports.SEE_OTHER = 303;\r\nexports.NOT_MODIFIED = 304;\r\nexports.USE_PROXY = 305;\r\nexports.TEMPORARY_REDIRECT = 307;\r\nexports.BAD_REQUEST = 400;\r\nexports.UNAUTHORIZED = 401;\r\nexports.PAYMENT_REQUIRED = 402;\r\nexports.FORBIDDEN = 403;\r\nexports.NOT_FOUND = 404;\r\nexports.METHOD_NOT_ALLOWED = 405;\r\nexports.NOT_ACCEPTABLE = 406;\r\nexports.PROXY_AUTHENTICATION_REQUIRED = 407;\r\nexports.REQUEST_TIME_OUT = 408;\r\nexports.CONFLICT = 409;\r\nexports.GONE = 410;\r\nexports.LENGTH_REQUIRED = 411;\r\nexports.PRECONDITION_FAILED = 412;\r\nexports.REQUEST_ENTITY_TOO_LARGE = 413;\r\nexports.REQUEST_URI_TOO_LARGE = 414;\r\nexports.UNSUPPORTED_MEDIA_TYPE = 415;\r\nexports.REQUESTED_RANGE_NOT_SATISFIABLE = 416;\r\nexports.EXPECTATION_FAILED = 417;\r\nexports.IM_A_TEAPOT = 418;\r\nexports.UNPROCESSABLE_ENTITY = 422;\r\nexports.LOCKED = 423;\r\nexports.FAILED_DEPENDENCY = 424;\r\nexports.UNORDERED_COLLECTION = 425;\r\nexports.UPGRADE_REQUIRED = 426;\r\nexports.PRECONDITION_REQUIRED = 428;\r\nexports.TOO_MANY_REQUESTS = 429;\r\nexports.REQUEST_HEADER_FIELDS_TOO_LARGE = 431;\r\nexports.INTERNAL_SERVER_ERROR = 500;\r\nexports.NOT_IMPLEMENTED = 501;\r\nexports.BAD_GATEWAY = 502;\r\nexports.SERVICE_UNAVAILABLE = 503;\r\nexports.GATEWAY_TIME_OUT = 504;\r\nexports.HTTP_VERSION_NOT_SUPPORTED = 505;\r\nexports.VARIANT_ALSO_NEGOTIATES = 506;\r\nexports.INSUFFICIENT_STORAGE = 507;\r\nexports.BANDWIDTH_LIMIT_EXCEEDED = 509;\r\nexports.NOT_EXTENDED = 510;\r\nexports.NETWORK_AUTHENTICATION_REQUIRED = 511;\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js?')},"./node_modules/@iiif/vocabulary/dist-commonjs/index.js":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar AnnotationMotivation;\n(function (AnnotationMotivation) {\n AnnotationMotivation["BOOKMARKING"] = "oa:bookmarking";\n AnnotationMotivation["CLASSIFYING"] = "oa:classifying";\n AnnotationMotivation["COMMENTING"] = "oa:commenting";\n AnnotationMotivation["DESCRIBING"] = "oa:describing";\n AnnotationMotivation["EDITING"] = "oa:editing";\n AnnotationMotivation["HIGHLIGHTING"] = "oa:highlighting";\n AnnotationMotivation["IDENTIFYING"] = "oa:identifying";\n AnnotationMotivation["LINKING"] = "oa:linking";\n AnnotationMotivation["MODERATING"] = "oa:moderating";\n AnnotationMotivation["PAINTING"] = "sc:painting";\n AnnotationMotivation["QUESTIONING"] = "oa:questioning";\n AnnotationMotivation["REPLYING"] = "oa:replying";\n AnnotationMotivation["TAGGING"] = "oa:tagging";\n AnnotationMotivation["TRANSCRIBING"] = "oad:transcribing";\n})(AnnotationMotivation = exports.AnnotationMotivation || (exports.AnnotationMotivation = {}));\nvar Behavior;\n(function (Behavior) {\n Behavior["AUTO_ADVANCE"] = "auto-advance";\n Behavior["CONTINUOUS"] = "continuous";\n Behavior["FACING_PAGES"] = "facing-pages";\n Behavior["HIDDEN"] = "hidden";\n Behavior["INDIVIDUALS"] = "individuals";\n Behavior["MULTI_PART"] = "multi-part";\n Behavior["NO_NAV"] = "no-nav";\n Behavior["NON_PAGED"] = "non-paged";\n Behavior["PAGED"] = "paged";\n Behavior["REPEAT"] = "repeat";\n Behavior["SEQUENCE"] = "sequence";\n Behavior["THUMBNAIL_NAV"] = "thumbnail-nav";\n Behavior["TOGETHER"] = "together";\n Behavior["UNORDERED"] = "unordered";\n})(Behavior = exports.Behavior || (exports.Behavior = {}));\nvar ExternalResourceType;\n(function (ExternalResourceType) {\n ExternalResourceType["CANVAS"] = "canvas";\n ExternalResourceType["CHOICE"] = "choice";\n ExternalResourceType["OA_CHOICE"] = "oa:choice";\n ExternalResourceType["CONTENT_AS_TEXT"] = "contentastext";\n ExternalResourceType["DATASET"] = "dataset";\n ExternalResourceType["DOCUMENT"] = "document";\n ExternalResourceType["IMAGE"] = "image";\n ExternalResourceType["MODEL"] = "model";\n ExternalResourceType["MOVING_IMAGE"] = "movingimage";\n ExternalResourceType["PDF"] = "pdf";\n ExternalResourceType["PHYSICAL_OBJECT"] = "physicalobject";\n ExternalResourceType["SOUND"] = "sound";\n ExternalResourceType["TEXT"] = "text";\n ExternalResourceType["TEXTUALBODY"] = "textualbody";\n ExternalResourceType["VIDEO"] = "video";\n})(ExternalResourceType = exports.ExternalResourceType || (exports.ExternalResourceType = {}));\nvar IIIFResourceType;\n(function (IIIFResourceType) {\n IIIFResourceType["ANNOTATION"] = "annotation";\n IIIFResourceType["CANVAS"] = "canvas";\n IIIFResourceType["COLLECTION"] = "collection";\n IIIFResourceType["MANIFEST"] = "manifest";\n IIIFResourceType["RANGE"] = "range";\n IIIFResourceType["SEQUENCE"] = "sequence";\n})(IIIFResourceType = exports.IIIFResourceType || (exports.IIIFResourceType = {}));\nvar MediaType;\n(function (MediaType) {\n MediaType["AUDIO_MP4"] = "audio/mp4";\n MediaType["CORTO"] = "application/corto";\n MediaType["DICOM"] = "application/dicom";\n MediaType["DRACO"] = "application/draco";\n MediaType["EPUB"] = "application/epub+zip";\n MediaType["GIRDER"] = "image/vnd.kitware.girder";\n MediaType["GLB"] = "model/gltf-binary";\n MediaType["GLTF"] = "model/gltf+json";\n MediaType["IIIF_PRESENTATION_2"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/2/context.json\\"";\n MediaType["IIIF_PRESENTATION_3"] = "application/ld+json;profile=\\"http://iiif.io/api/presentation/3/context.json\\"";\n MediaType["JPG"] = "image/jpeg";\n MediaType["M3U8"] = "application/vnd.apple.mpegurl";\n MediaType["MP3"] = "audio/mp3";\n MediaType["MPEG_DASH"] = "application/dash+xml";\n MediaType["OBJ"] = "text/plain";\n MediaType["OPF"] = "application/oebps-package+xml";\n MediaType["PDF"] = "application/pdf";\n MediaType["PLY"] = "application/ply";\n MediaType["THREEJS"] = "application/vnd.threejs+json";\n MediaType["USDZ"] = "model/vnd.usd+zip";\n MediaType["VIDEO_MP4"] = "video/mp4";\n MediaType["WAV"] = "audio/wav";\n MediaType["WEBM"] = "video/webm";\n})(MediaType = exports.MediaType || (exports.MediaType = {}));\nvar RenderingFormat;\n(function (RenderingFormat) {\n RenderingFormat["DOC"] = "application/msword";\n RenderingFormat["DOCX"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";\n RenderingFormat["PDF"] = "application/pdf";\n})(RenderingFormat = exports.RenderingFormat || (exports.RenderingFormat = {}));\nvar ServiceProfile;\n(function (ServiceProfile) {\n // image api\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level0";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level1";\n ServiceProfile["IMAGE_0_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/compliance.html#level2";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level0";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level1";\n ServiceProfile["IMAGE_0_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/conformance.html#level2";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1";\n ServiceProfile["IMAGE_1_COMPLIANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_0"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_1"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1";\n ServiceProfile["IMAGE_1_CONFORMANCE_LEVEL_2"] = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2";\n ServiceProfile["IMAGE_1_LEVEL_0"] = "http://iiif.io/api/image/1/level0.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/1/profiles/level0.json";\n ServiceProfile["IMAGE_1_LEVEL_1"] = "http://iiif.io/api/image/1/level1.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/1/profiles/level1.json";\n ServiceProfile["IMAGE_1_LEVEL_2"] = "http://iiif.io/api/image/1/level2.json";\n ServiceProfile["IMAGE_1_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/1/profiles/level2.json";\n ServiceProfile["IMAGE_2_LEVEL_0"] = "http://iiif.io/api/image/2/level0.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_0"] = "http://iiif.io/api/image/2/profiles/level0.json";\n ServiceProfile["IMAGE_2_LEVEL_1"] = "http://iiif.io/api/image/2/level1.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_1"] = "http://iiif.io/api/image/2/profiles/level1.json";\n ServiceProfile["IMAGE_2_LEVEL_2"] = "http://iiif.io/api/image/2/level2.json";\n ServiceProfile["IMAGE_2_PROFILE_LEVEL_2"] = "http://iiif.io/api/image/2/profiles/level2.json";\n // auth api\n ServiceProfile["AUTH_0_CLICK_THROUGH"] = "http://iiif.io/api/auth/0/login/clickthrough";\n ServiceProfile["AUTH_0_LOGIN"] = "http://iiif.io/api/auth/0/login";\n ServiceProfile["AUTH_0_LOGOUT"] = "http://iiif.io/api/auth/0/logout";\n ServiceProfile["AUTH_0_RESTRICTED"] = "http://iiif.io/api/auth/0/login/restricted";\n ServiceProfile["AUTH_0_TOKEN"] = "http://iiif.io/api/auth/0/token";\n ServiceProfile["AUTH_1_CLICK_THROUGH"] = "http://iiif.io/api/auth/1/clickthrough";\n ServiceProfile["AUTH_1_EXTERNAL"] = "http://iiif.io/api/auth/1/external";\n ServiceProfile["AUTH_1_KIOSK"] = "http://iiif.io/api/auth/1/kiosk";\n ServiceProfile["AUTH_1_LOGIN"] = "http://iiif.io/api/auth/1/login";\n ServiceProfile["AUTH_1_LOGOUT"] = "http://iiif.io/api/auth/1/logout";\n ServiceProfile["AUTH_1_PROBE"] = "http://iiif.io/api/auth/1/probe";\n ServiceProfile["AUTH_1_TOKEN"] = "http://iiif.io/api/auth/1/token";\n // search api\n ServiceProfile["SEARCH_0"] = "http://iiif.io/api/search/0/search";\n ServiceProfile["SEARCH_0_AUTO_COMPLETE"] = "http://iiif.io/api/search/0/autocomplete";\n ServiceProfile["SEARCH_1"] = "http://iiif.io/api/search/1/search";\n ServiceProfile["SEARCH_1_AUTO_COMPLETE"] = "http://iiif.io/api/search/1/autocomplete";\n // extensions\n ServiceProfile["TRACKING_EXTENSIONS"] = "http://universalviewer.io/tracking-extensions-profile";\n ServiceProfile["UI_EXTENSIONS"] = "http://universalviewer.io/ui-extensions-profile";\n ServiceProfile["PRINT_EXTENSIONS"] = "http://universalviewer.io/print-extensions-profile";\n ServiceProfile["SHARE_EXTENSIONS"] = "http://universalviewer.io/share-extensions-profile";\n ServiceProfile["DOWNLOAD_EXTENSIONS"] = "http://universalviewer.io/download-extensions-profile";\n // other\n ServiceProfile["OTHER_MANIFESTATIONS"] = "http://iiif.io/api/otherManifestations.json";\n ServiceProfile["IXIF"] = "http://wellcomelibrary.org/ld/ixif/0/alpha.json";\n})(ServiceProfile = exports.ServiceProfile || (exports.ServiceProfile = {}));\nvar ServiceType;\n(function (ServiceType) {\n ServiceType["IMAGE_SERVICE_2"] = "ImageService2";\n ServiceType["IMAGE_SERVICE_3"] = "ImageService3";\n})(ServiceType = exports.ServiceType || (exports.ServiceType = {}));\nvar ViewingDirection;\n(function (ViewingDirection) {\n ViewingDirection["BOTTOM_TO_TOP"] = "bottom-to-top";\n ViewingDirection["LEFT_TO_RIGHT"] = "left-to-right";\n ViewingDirection["RIGHT_TO_LEFT"] = "right-to-left";\n ViewingDirection["TOP_TO_BOTTOM"] = "top-to-bottom";\n})(ViewingDirection = exports.ViewingDirection || (exports.ViewingDirection = {}));\nvar ViewingHint;\n(function (ViewingHint) {\n ViewingHint["CONTINUOUS"] = "continuous";\n ViewingHint["INDIVIDUALS"] = "individuals";\n ViewingHint["NON_PAGED"] = "non-paged";\n ViewingHint["PAGED"] = "paged";\n ViewingHint["TOP"] = "top";\n})(ViewingHint = exports.ViewingHint || (exports.ViewingHint = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://manifesto/./node_modules/@iiif/vocabulary/dist-commonjs/index.js?')},"./node_modules/color-name/index.js":module=>{"use strict";eval('\r\n\r\nmodule.exports = {\r\n\t"aliceblue": [240, 248, 255],\r\n\t"antiquewhite": [250, 235, 215],\r\n\t"aqua": [0, 255, 255],\r\n\t"aquamarine": [127, 255, 212],\r\n\t"azure": [240, 255, 255],\r\n\t"beige": [245, 245, 220],\r\n\t"bisque": [255, 228, 196],\r\n\t"black": [0, 0, 0],\r\n\t"blanchedalmond": [255, 235, 205],\r\n\t"blue": [0, 0, 255],\r\n\t"blueviolet": [138, 43, 226],\r\n\t"brown": [165, 42, 42],\r\n\t"burlywood": [222, 184, 135],\r\n\t"cadetblue": [95, 158, 160],\r\n\t"chartreuse": [127, 255, 0],\r\n\t"chocolate": [210, 105, 30],\r\n\t"coral": [255, 127, 80],\r\n\t"cornflowerblue": [100, 149, 237],\r\n\t"cornsilk": [255, 248, 220],\r\n\t"crimson": [220, 20, 60],\r\n\t"cyan": [0, 255, 255],\r\n\t"darkblue": [0, 0, 139],\r\n\t"darkcyan": [0, 139, 139],\r\n\t"darkgoldenrod": [184, 134, 11],\r\n\t"darkgray": [169, 169, 169],\r\n\t"darkgreen": [0, 100, 0],\r\n\t"darkgrey": [169, 169, 169],\r\n\t"darkkhaki": [189, 183, 107],\r\n\t"darkmagenta": [139, 0, 139],\r\n\t"darkolivegreen": [85, 107, 47],\r\n\t"darkorange": [255, 140, 0],\r\n\t"darkorchid": [153, 50, 204],\r\n\t"darkred": [139, 0, 0],\r\n\t"darksalmon": [233, 150, 122],\r\n\t"darkseagreen": [143, 188, 143],\r\n\t"darkslateblue": [72, 61, 139],\r\n\t"darkslategray": [47, 79, 79],\r\n\t"darkslategrey": [47, 79, 79],\r\n\t"darkturquoise": [0, 206, 209],\r\n\t"darkviolet": [148, 0, 211],\r\n\t"deeppink": [255, 20, 147],\r\n\t"deepskyblue": [0, 191, 255],\r\n\t"dimgray": [105, 105, 105],\r\n\t"dimgrey": [105, 105, 105],\r\n\t"dodgerblue": [30, 144, 255],\r\n\t"firebrick": [178, 34, 34],\r\n\t"floralwhite": [255, 250, 240],\r\n\t"forestgreen": [34, 139, 34],\r\n\t"fuchsia": [255, 0, 255],\r\n\t"gainsboro": [220, 220, 220],\r\n\t"ghostwhite": [248, 248, 255],\r\n\t"gold": [255, 215, 0],\r\n\t"goldenrod": [218, 165, 32],\r\n\t"gray": [128, 128, 128],\r\n\t"green": [0, 128, 0],\r\n\t"greenyellow": [173, 255, 47],\r\n\t"grey": [128, 128, 128],\r\n\t"honeydew": [240, 255, 240],\r\n\t"hotpink": [255, 105, 180],\r\n\t"indianred": [205, 92, 92],\r\n\t"indigo": [75, 0, 130],\r\n\t"ivory": [255, 255, 240],\r\n\t"khaki": [240, 230, 140],\r\n\t"lavender": [230, 230, 250],\r\n\t"lavenderblush": [255, 240, 245],\r\n\t"lawngreen": [124, 252, 0],\r\n\t"lemonchiffon": [255, 250, 205],\r\n\t"lightblue": [173, 216, 230],\r\n\t"lightcoral": [240, 128, 128],\r\n\t"lightcyan": [224, 255, 255],\r\n\t"lightgoldenrodyellow": [250, 250, 210],\r\n\t"lightgray": [211, 211, 211],\r\n\t"lightgreen": [144, 238, 144],\r\n\t"lightgrey": [211, 211, 211],\r\n\t"lightpink": [255, 182, 193],\r\n\t"lightsalmon": [255, 160, 122],\r\n\t"lightseagreen": [32, 178, 170],\r\n\t"lightskyblue": [135, 206, 250],\r\n\t"lightslategray": [119, 136, 153],\r\n\t"lightslategrey": [119, 136, 153],\r\n\t"lightsteelblue": [176, 196, 222],\r\n\t"lightyellow": [255, 255, 224],\r\n\t"lime": [0, 255, 0],\r\n\t"limegreen": [50, 205, 50],\r\n\t"linen": [250, 240, 230],\r\n\t"magenta": [255, 0, 255],\r\n\t"maroon": [128, 0, 0],\r\n\t"mediumaquamarine": [102, 205, 170],\r\n\t"mediumblue": [0, 0, 205],\r\n\t"mediumorchid": [186, 85, 211],\r\n\t"mediumpurple": [147, 112, 219],\r\n\t"mediumseagreen": [60, 179, 113],\r\n\t"mediumslateblue": [123, 104, 238],\r\n\t"mediumspringgreen": [0, 250, 154],\r\n\t"mediumturquoise": [72, 209, 204],\r\n\t"mediumvioletred": [199, 21, 133],\r\n\t"midnightblue": [25, 25, 112],\r\n\t"mintcream": [245, 255, 250],\r\n\t"mistyrose": [255, 228, 225],\r\n\t"moccasin": [255, 228, 181],\r\n\t"navajowhite": [255, 222, 173],\r\n\t"navy": [0, 0, 128],\r\n\t"oldlace": [253, 245, 230],\r\n\t"olive": [128, 128, 0],\r\n\t"olivedrab": [107, 142, 35],\r\n\t"orange": [255, 165, 0],\r\n\t"orangered": [255, 69, 0],\r\n\t"orchid": [218, 112, 214],\r\n\t"palegoldenrod": [238, 232, 170],\r\n\t"palegreen": [152, 251, 152],\r\n\t"paleturquoise": [175, 238, 238],\r\n\t"palevioletred": [219, 112, 147],\r\n\t"papayawhip": [255, 239, 213],\r\n\t"peachpuff": [255, 218, 185],\r\n\t"peru": [205, 133, 63],\r\n\t"pink": [255, 192, 203],\r\n\t"plum": [221, 160, 221],\r\n\t"powderblue": [176, 224, 230],\r\n\t"purple": [128, 0, 128],\r\n\t"rebeccapurple": [102, 51, 153],\r\n\t"red": [255, 0, 0],\r\n\t"rosybrown": [188, 143, 143],\r\n\t"royalblue": [65, 105, 225],\r\n\t"saddlebrown": [139, 69, 19],\r\n\t"salmon": [250, 128, 114],\r\n\t"sandybrown": [244, 164, 96],\r\n\t"seagreen": [46, 139, 87],\r\n\t"seashell": [255, 245, 238],\r\n\t"sienna": [160, 82, 45],\r\n\t"silver": [192, 192, 192],\r\n\t"skyblue": [135, 206, 235],\r\n\t"slateblue": [106, 90, 205],\r\n\t"slategray": [112, 128, 144],\r\n\t"slategrey": [112, 128, 144],\r\n\t"snow": [255, 250, 250],\r\n\t"springgreen": [0, 255, 127],\r\n\t"steelblue": [70, 130, 180],\r\n\t"tan": [210, 180, 140],\r\n\t"teal": [0, 128, 128],\r\n\t"thistle": [216, 191, 216],\r\n\t"tomato": [255, 99, 71],\r\n\t"turquoise": [64, 224, 208],\r\n\t"violet": [238, 130, 238],\r\n\t"wheat": [245, 222, 179],\r\n\t"white": [255, 255, 255],\r\n\t"whitesmoke": [245, 245, 245],\r\n\t"yellow": [255, 255, 0],\r\n\t"yellowgreen": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-name/index.js?')},"./node_modules/color-string/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\nvar swizzle = __webpack_require__(/*! simple-swizzle */ \"./node_modules/simple-swizzle/index.js\");\nvar hasOwnProperty = Object.hasOwnProperty;\n\nvar reverseNames = Object.create(null);\n\n// create a list of reverse color names\nfor (var name in colorNames) {\n\tif (hasOwnProperty.call(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nvar cs = module.exports = {\n\tto: {},\n\tget: {}\n};\n\ncs.get = function (string) {\n\tvar prefix = string.substring(0, 3).toLowerCase();\n\tvar val;\n\tvar model;\n\tswitch (prefix) {\n\t\tcase 'hsl':\n\t\t\tval = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\tcase 'hwb':\n\t\t\tval = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tval = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t}\n\n\tif (!val) {\n\t\treturn null;\n\t}\n\n\treturn {model: model, value: val};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar abbr = /^#([a-f0-9]{3,4})$/i;\n\tvar hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;\n\tvar rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar keyword = /^(\\w+)$/;\n\n\tvar rgb = [0, 0, 0, 1];\n\tvar match;\n\tvar i;\n\tvar hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tvar i2 = i * 2;\n\t\t\trgb[i] = parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i + 1], 0);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!hasOwnProperty.call(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hsl = /^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hsl);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar s = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar l = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hwb = /^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tvar match = string.match(hwb);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar w = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar b = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function () {\n\tvar rgba = swizzle(arguments);\n\n\tvar r = Math.round(rgba[0] / 255 * 100);\n\tvar g = Math.round(rgba[1] / 255 * 100);\n\tvar b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function () {\n\tvar hsla = swizzle(arguments);\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function () {\n\tvar hwba = swizzle(arguments);\n\n\tvar a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// helpers\nfunction clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n\tvar str = Math.round(num).toString(16).toUpperCase();\n\treturn (str.length < 2) ? '0' + str : str;\n}\n\n\n//# sourceURL=webpack://manifesto/./node_modules/color-string/index.js?")},"./node_modules/is-arrayish/index.js":module=>{eval("module.exports = function isArrayish(obj) {\n\tif (!obj || typeof obj === 'string') {\n\t\treturn false;\n\t}\n\n\treturn obj instanceof Array || Array.isArray(obj) ||\n\t\t(obj.length >= 0 && (obj.splice instanceof Function ||\n\t\t\t(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/is-arrayish/index.js?")},"./node_modules/isomorphic-unfetch/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('function r(m) {\n\treturn (m && m.default) || m;\n}\nmodule.exports = __webpack_require__.g.fetch =\n\t__webpack_require__.g.fetch ||\n\t(typeof process == "undefined"\n\t\t? r(__webpack_require__(/*! unfetch */ "./node_modules/unfetch/dist/unfetch.module.js"))\n\t\t: function (url, opts) {\n\t\t\t\tif (typeof url === "string" || url instanceof URL) {\n\t\t\t\t\turl = String(url).replace(/^\\/\\//g, "https://");\n\t\t\t\t}\n\t\t\t\treturn Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! node-fetch */ "node-fetch", 23)).then((m) => r(m)(url, opts));\n\t\t });\n\n\n//# sourceURL=webpack://manifesto/./node_modules/isomorphic-unfetch/index.js?')},"./node_modules/lodash/_Symbol.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_Symbol.js?')},"./node_modules/lodash/_arrayPush.js":module=>{eval("/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_arrayPush.js?")},"./node_modules/lodash/_baseFlatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var arrayPush = __webpack_require__(/*! ./_arrayPush */ "./node_modules/lodash/_arrayPush.js"),\n isFlattenable = __webpack_require__(/*! ./_isFlattenable */ "./node_modules/lodash/_isFlattenable.js");\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseFlatten.js?')},"./node_modules/lodash/_baseGetTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),\n objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");\n\n/** `Object#toString` result references. */\nvar nullTag = \'[object Null]\',\n undefinedTag = \'[object Undefined]\';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseGetTag.js?')},"./node_modules/lodash/_baseIsArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");\n\n/** `Object#toString` result references. */\nvar argsTag = \'[object Arguments]\';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_baseIsArguments.js?')},"./node_modules/lodash/_freeGlobal.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;\n\nmodule.exports = freeGlobal;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_freeGlobal.js?")},"./node_modules/lodash/_getRawTag.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_getRawTag.js?')},"./node_modules/lodash/_isFlattenable.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),\n isArguments = __webpack_require__(/*! ./isArguments */ "./node_modules/lodash/isArguments.js"),\n isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js");\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_isFlattenable.js?')},"./node_modules/lodash/_objectToString.js":module=>{eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_objectToString.js?")},"./node_modules/lodash/_root.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/_root.js?")},"./node_modules/lodash/flatten.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flatten.js?')},"./node_modules/lodash/flattenDeep.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval('var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ "./node_modules/lodash/_baseFlatten.js");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/flattenDeep.js?')},"./node_modules/lodash/isArguments.js":(module,__unused_webpack_exports,__webpack_require__)=>{eval("var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ \"./node_modules/lodash/_baseIsArguments.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArguments.js?")},"./node_modules/lodash/isArray.js":module=>{eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isArray.js?")},"./node_modules/lodash/isObjectLike.js":module=>{eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/lodash/isObjectLike.js?")},"./node_modules/simple-swizzle/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nvar isArrayish = __webpack_require__(/*! is-arrayish */ "./node_modules/is-arrayish/index.js");\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\nvar swizzle = module.exports = function swizzle(args) {\n\tvar results = [];\n\n\tfor (var i = 0, len = args.length; i < len; i++) {\n\t\tvar arg = args[i];\n\n\t\tif (isArrayish(arg)) {\n\t\t\t// http://jsperf.com/javascript-array-concat-vs-push/98\n\t\t\tresults = concat.call(results, slice.call(arg));\n\t\t} else {\n\t\t\tresults.push(arg);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nswizzle.wrap = function (fn) {\n\treturn function () {\n\t\treturn fn(swizzle(arguments));\n\t};\n};\n\n\n//# sourceURL=webpack://manifesto/./node_modules/simple-swizzle/index.js?')},"./src/Annotation.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Annotation = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar Annotation = /** @class */ (function (_super) {\n __extends(Annotation, _super);\n function Annotation(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n /**\n In spite of its name, this method returns an array of objects, each of which\n represents a potential body annotations\n \n @see{ https://iiif.io/api/cookbook/recipe/0033-choice/ }\n **/\n Annotation.prototype.getBody = function () {\n var bodies = [];\n var body = this.getProperty("body");\n // the following is intended to handle the following cases for\n /// the raw json of the body property of __jsonld\n // -- body is an array, each element of which is parsed\n // == body is an object with property items, each item is parsed\n // -- body is parsed\n if (body) {\n for (var _i = 0, _a = [].concat(body); _i < _a.length; _i++) {\n var bd = _a[_i];\n var items = bd.items;\n if (items)\n bodies = bodies.concat(this.parseBodiesFromItemsList(items));\n else\n bodies.push(this.parseSingletonBody(bd));\n }\n }\n return bodies;\n };\n Object.defineProperty(Annotation.prototype, "Body", {\n get: function () { return this.getBody(); },\n enumerable: false,\n configurable: true\n });\n /**\n auxiliary function to getBody; intended to hande an object that has an element items\n which is a array of annotation- body-like objects. This : https://iiif.io/api/cookbook/recipe/0033-choice/\n seems to be the use case for this\n **/\n Annotation.prototype.parseBodiesFromItemsList = function (rawbodies) {\n var retVal = [];\n for (var _i = 0, _a = [].concat(rawbodies); _i < _a.length; _i++) {\n var bd = _a[_i];\n retVal.push(this.parseSingletonBody(bd));\n }\n return retVal;\n };\n /**\n auxiliary function to parseBodiesFromItemsList and getBody, this is the last\n step on recursively going through collections of bodies.\n **/\n Annotation.prototype.parseSingletonBody = function (rawbody) {\n if (rawbody.type === "SpecificResource") {\n return new internal_1.SpecificResource(rawbody, this.options);\n }\n else {\n return internal_1.AnnotationBodyParser.BuildFromJson(rawbody, this.options);\n }\n };\n /**\n Developer Note: 8 April 2024\n getBody3D function was developed in the early stages of the 3D API Feb-March 2024\n as alternative to the existing Annotation getBody function, but the signature for\n getBody3D was chosen to be a single object instance, not an array.\n \n At this stage, the merging of the 2D API anf the draft 3D API has been completed, so\n 3D applications can use the getBody() function to retrieve the body of an Annotation intended\n to target a scene. For compatibily the return value of the function is still an\n array.\n \n 3D clients using getBody are responsible for choosing the appropriate instance from the\n returned array. In most cases this will be the sole 0th element.\n **/\n Annotation.prototype.getBody3D = function () {\n console.warn("Annotation.getBody3D is deprecated: replace with getBody3D() with getBody()[0]");\n return this.getBody()[0];\n };\n Annotation.prototype.getMotivation = function () {\n var motivation = this.getProperty("motivation");\n if (motivation) {\n //const key: string | undefined = Object.keys(AnnotationMotivationEnum).find(k => AnnotationMotivationEnum[k] === motivation);\n return motivation;\n }\n return null;\n };\n // open annotation\n Annotation.prototype.getOn = function () {\n return this.getProperty("on");\n };\n Annotation.prototype.getTarget = function () {\n var rawTarget = this.getPropertyAsObject("target");\n if (rawTarget.isIRI)\n return rawTarget;\n if (rawTarget.type && rawTarget.type == "SpecificResource") {\n return new internal_1.SpecificResource(rawTarget, this.options);\n }\n else {\n throw new Error("unknown target specified");\n }\n };\n Object.defineProperty(Annotation.prototype, "Target", {\n get: function () { return this.getTarget(); },\n enumerable: false,\n configurable: true\n });\n Annotation.prototype.getResource = function () {\n return new internal_1.Resource(this.getProperty("resource"), this.options);\n };\n Object.defineProperty(Annotation.prototype, "LookAtLocation", {\n /**\n * A 3D point coordinate object for the location of an Annotation\n * to satisfy the requirements of the lookAt property of camera and\n * spotlight resources, according to the draft v4 API as of April 1 2024\n *\n * Is the position of the point for a target which is a SpecificResource with\n * a PointSelector\n * Otherwise, for example when the annotation target is an entire Scene, the\n * location for lookAt is the origin (0,0,0)\n **/\n get: function () {\n var _a;\n var target = this.getTarget();\n if (target.isSpecificResource && ((_a = target.getSelector()) === null || _a === void 0 ? void 0 : _a.isPointSelector))\n return target.getSelector().getLocation();\n else\n return new threejs_math_1.Vector3(0.0, 0.0, 0.0);\n },\n enumerable: false,\n configurable: true\n });\n return Annotation;\n}(internal_1.ManifestResource));\nexports.Annotation = Annotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Annotation.ts?')},"./src/AnnotationBody.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBody = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\nWith the 3D extensions to the IIIF Presentation API the name of this\nclass is misleading, but for now is being retained for the sake backward\ncompatibility with earlier manifesto code and tests.\n\nThe 3D extensions allow that the body property of an annotation can be\na light, camera, or model, or a SpecificResource object wrapping a light, camera,\nor model.\n**/\nvar AnnotationBody = /** @class */ (function (_super) {\n __extends(AnnotationBody, _super);\n function AnnotationBody(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = true;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = false;\n // following class members were added to support 3D and mixed 2D/3D content\n // these boolean switches will be appropriately set when the manifest json is parsed\n _this.isModel = true;\n _this.isLight = false;\n _this.isCamera = false;\n return _this;\n }\n // Format, Type, Width, and Height are the body properties supported\n // in the code that supports Presentation 3\n AnnotationBody.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return internal_1.Utils.getMediaType(format);\n }\n return null;\n };\n AnnotationBody.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return (internal_1.Utils.normaliseType(this.getProperty("type")));\n }\n return null;\n };\n AnnotationBody.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n AnnotationBody.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n return AnnotationBody;\n}(internal_1.ManifestResource));\nexports.AnnotationBody = AnnotationBody;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBody.ts?')},"./src/AnnotationBodyParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationBodyParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LightTypes = ["AmbientLight", "DirectionalLight"];\nvar CameraTypes = ["PerspectiveCamera", "OrthographicCamera"];\nvar DisplayedTypes = ["Image", "Document", "Audio", "Model", "Video"];\nvar AnnotationBodyParser = /** @class */ (function () {\n function AnnotationBodyParser() {\n }\n AnnotationBodyParser.BuildFromJson = function (jsonld, options) {\n if (DisplayedTypes.includes(jsonld.type))\n return new internal_1.AnnotationBody(jsonld, options);\n else if (LightTypes.includes(jsonld.type))\n return new internal_1.Light(jsonld, options);\n else if (CameraTypes.includes(jsonld.type))\n return new internal_1.Camera(jsonld, options);\n else\n throw new Error("unimplemented type for AnnotationBody: " + jsonld.type);\n };\n return AnnotationBodyParser;\n}());\nexports.AnnotationBodyParser = AnnotationBodyParser;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationBodyParser.ts?')},"./src/AnnotationList.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationList = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationList = /** @class */ (function (_super) {\n __extends(AnnotationList, _super);\n function AnnotationList(label, jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.label = label;\n _this.options = options;\n return _this;\n }\n AnnotationList.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n AnnotationList.prototype.getLabel = function () {\n return this.label;\n };\n AnnotationList.prototype.getResources = function () {\n var _this = this;\n var resources = this.getProperty("resources");\n return resources.map(function (resource) { return new internal_1.Annotation(resource, _this.options); });\n };\n AnnotationList.prototype.load = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.isLoaded) {\n resolve(_this);\n }\n else {\n var id = _this.__jsonld.id;\n if (!id) {\n id = _this.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id)\n .then(function (data) {\n _this.__jsonld = data;\n _this.context = _this.getProperty("context");\n _this.id = _this.getProperty("id");\n _this.isLoaded = true;\n resolve(_this);\n })\n .catch(reject);\n }\n });\n };\n return AnnotationList;\n}(internal_1.JSONLDResource));\nexports.AnnotationList = AnnotationList;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationList.ts?')},"./src/AnnotationPage.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.AnnotationPage = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar AnnotationPage = /** @class */ (function (_super) {\n __extends(AnnotationPage, _super);\n function AnnotationPage(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n AnnotationPage.prototype.getItems = function () {\n return this.getProperty("items");\n };\n return AnnotationPage;\n}(internal_1.ManifestResource));\nexports.AnnotationPage = AnnotationPage;\n\n\n//# sourceURL=webpack://manifesto/./src/AnnotationPage.ts?')},"./src/Camera.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Camera = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Camera = /** @class */ (function (_super) {\n __extends(Camera, _super);\n function Camera(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isModel = false;\n _this.isLight = false;\n _this.isCamera = true;\n return _this;\n }\n Object.defineProperty(Camera.prototype, "isPerspectiveCamera", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "perspectivecamera");\n },\n enumerable: false,\n configurable: true\n });\n /**\n @returns full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n Camera.prototype.getFieldOfView = function () {\n if (this.isPerspectiveCamera) {\n var value = this.getProperty("fieldOfView");\n if (value)\n return value;\n else\n return 45.0;\n }\n else\n return undefined;\n };\n Object.defineProperty(Camera.prototype, "FieldOfView", {\n /**\n Full angular size of perspective viewport in vertical direction.\n Angular unit is degrees\n **/\n get: function () { return this.getFieldOfView(); },\n enumerable: false,\n configurable: true\n });\n /**\n * @return : if not null, is either a PointSelector, or an object\n * with an id matching the id of an Annotation instance.\n **/\n Camera.prototype.getLookAt = function () {\n var rawObj = this.getPropertyAsObject("lookAt");\n var rawType = (rawObj["type"] || rawObj["@type"]);\n if (rawType == "Annotation") {\n return rawObj;\n }\n if (rawType == "PointSelector") {\n return new internal_1.PointSelector(rawObj);\n }\n throw new Error(\'unidentified value of lookAt ${rawType}\');\n };\n Object.defineProperty(Camera.prototype, "LookAt", {\n get: function () { return this.getLookAt(); },\n enumerable: false,\n configurable: true\n });\n return Camera;\n}(internal_1.AnnotationBody));\nexports.Camera = Camera;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/Camera.ts?')},"./src/Canvas.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Canvas = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n// @ts-ignore\nvar flatten_1 = __importDefault(__webpack_require__(/*! lodash/flatten */ "./node_modules/lodash/flatten.js"));\n// @ts-ignore\nvar flattenDeep_1 = __importDefault(__webpack_require__(/*! lodash/flattenDeep */ "./node_modules/lodash/flattenDeep.js"));\nvar Canvas = /** @class */ (function (_super) {\n __extends(Canvas, _super);\n function Canvas(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // http://iiif.io/api/image/2.1/#canonical-uri-syntax\n Canvas.prototype.getCanonicalImageUri = function (w) {\n var id = null;\n var region = "full";\n var rotation = 0;\n var quality = "default";\n var width = w;\n var size;\n // if an info.json has been loaded\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data["@id"]) {\n id = this.externalResource.data["@id"];\n if (!width) {\n width = this.externalResource.data.width;\n }\n if (this.externalResource.data["@context"]) {\n if (this.externalResource.data["@context"].indexOf("/1.0/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1.1/context.json") >\n -1 ||\n this.externalResource.data["@context"].indexOf("/1/context.json") > -1) {\n quality = "native";\n }\n }\n }\n else {\n // info.json hasn\'t been loaded yet\n var images = void 0;\n // presentation 2.0\n images = this.getImages();\n if (images && images.length) {\n var firstImage = images[0];\n var resource = firstImage.getResource();\n var services = resource.getServices();\n if (!width) {\n width = resource.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return (internal_1.Utils.isImageProfile(service.getProfile()) ||\n internal_1.Utils.isImageServiceType(service.getIIIFResourceType()));\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === resource.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return resource.id;\n }\n }\n // presentation 3.0\n images = this.getContent();\n if (images && images.length) {\n var firstImage = images[0];\n // Developer note: Since Canvas in Presentation 3 doesn\'t use\n // SpecificResource resources in the body, force a cast\n var body = firstImage.getBody();\n var anno = body[0];\n var services = anno.getServices();\n if (!width) {\n width = anno.getWidth();\n }\n var service = services\n ? services.find(function (service) {\n return internal_1.Utils.isImageServiceType(service.getIIIFResourceType());\n })\n : null;\n if (service) {\n id = service.id;\n quality = internal_1.Utils.getImageQuality(service.getProfile());\n }\n else if (width === anno.getWidth()) {\n // if the passed width is the same as the resource width\n // i.e. not looking for a thumbnail\n // return the full size image.\n // used for download options when loading static images.\n return anno.id;\n }\n }\n // todo: should this be moved to getThumbUri?\n if (!id) {\n var thumbnail = this.getProperty("thumbnail");\n if (thumbnail) {\n if (typeof thumbnail === "string") {\n return thumbnail;\n }\n else {\n if (thumbnail["@id"]) {\n return thumbnail["@id"];\n }\n else if (thumbnail.length) {\n return thumbnail[0].id;\n }\n }\n }\n }\n }\n size = width + ",";\n // trim off trailing \'/\'\n if (id && id.endsWith("/")) {\n id = id.substr(0, id.length - 1);\n }\n var uri = [id, region, size, rotation, quality + ".jpg"].join("/");\n return uri;\n };\n Canvas.prototype.getMaxDimensions = function () {\n var maxDimensions = null;\n var profile;\n if (this.externalResource &&\n this.externalResource.data &&\n this.externalResource.data.profile) {\n profile = this.externalResource.data.profile;\n if (Array.isArray(profile)) {\n profile = profile.filter(function (p) { return p["maxWidth" || 0]; })[0];\n if (profile) {\n maxDimensions = new internal_1.Size(profile.maxWidth, profile.maxHeight ? profile.maxHeight : profile.maxWidth);\n }\n }\n }\n return maxDimensions;\n };\n // Presentation API 3.0\n Canvas.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n return content;\n };\n Canvas.prototype.getDuration = function () {\n return this.getProperty("duration");\n };\n // presentation 2.0\n Canvas.prototype.getImages = function () {\n var images = [];\n if (!this.__jsonld.images)\n return images;\n for (var i = 0; i < this.__jsonld.images.length; i++) {\n var a = this.__jsonld.images[i];\n var annotation = new internal_1.Annotation(a, this.options);\n images.push(annotation);\n }\n return images;\n };\n Canvas.prototype.getIndex = function () {\n return this.getProperty("index");\n };\n Canvas.prototype.getOtherContent = function () {\n var _this = this;\n var otherContent = Array.isArray(this.getProperty("otherContent"))\n ? this.getProperty("otherContent")\n : [this.getProperty("otherContent")];\n var canonicalComparison = function (typeA, typeB) {\n if (typeof typeA !== "string" || typeof typeB !== "string") {\n return false;\n }\n return typeA.toLowerCase() === typeA.toLowerCase();\n };\n var otherPromises = otherContent\n .filter(function (otherContent) {\n return otherContent &&\n canonicalComparison(otherContent["@type"], "sc:AnnotationList");\n })\n .map(function (annotationList, i) {\n return new internal_1.AnnotationList(annotationList["label"] || "Annotation list ".concat(i), annotationList, _this.options);\n })\n .map(function (annotationList) { return annotationList.load(); });\n return Promise.all(otherPromises);\n };\n // Prefer thumbnail service to image service if supplied and if\n // the thumbnail service can provide a satisfactory size +/- x pixels.\n // this is used to get thumb URIs *before* the info.json has been requested\n // and populate thumbnails in a viewer.\n // the publisher may also provide pre-computed fixed-size thumbs for better performance.\n //getThumbUri(width: number): string {\n //\n // var uri;\n // var images: IAnnotation[] = this.getImages();\n //\n // if (images && images.length) {\n // var firstImage = images[0];\n // var resource: IResource = firstImage.getResource();\n // var services: IService[] = resource.getServices();\n //\n // for (let i = 0; i < services.length; i++) {\n // var service: IService = services[i];\n // var id = service.id;\n //\n // if (!_endsWith(id, \'/\')) {\n // id += \'/\';\n // }\n //\n // uri = id + \'full/\' + width + \',/0/\' + Utils.getImageQuality(service.getProfile()) + \'.jpg\';\n // }\n // }\n //\n // return uri;\n //}\n //getType(): CanvasType {\n // return new CanvasType(this.getProperty(\'@type\').toLowerCase());\n //}\n Canvas.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Canvas.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Canvas.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Canvas.prototype, "imageResources", {\n get: function () {\n var _this = this;\n var resources = (0, flattenDeep_1.default)([\n this.getImages().map(function (i) { return i.getResource(); }),\n this.getContent().map(function (i) { return i.getBody(); })\n ]);\n return (0, flatten_1.default)(resources.map(function (resource) {\n switch (resource.getProperty("type").toLowerCase()) {\n case dist_commonjs_1.ExternalResourceType.CHOICE:\n case dist_commonjs_1.ExternalResourceType.OA_CHOICE:\n return new Canvas({\n images: (0, flatten_1.default)([\n resource.getProperty("default"),\n resource.getProperty("item")\n ]).map(function (r) { return ({ resource: r }); })\n }, _this.options)\n .getImages()\n .map(function (i) { return i.getResource(); });\n default:\n return resource;\n }\n }));\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "resourceAnnotations", {\n get: function () {\n return (0, flattenDeep_1.default)([this.getImages(), this.getContent()]);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns a given resource Annotation, based on a contained resource or body\n * id\n */\n Canvas.prototype.resourceAnnotation = function (id) {\n return this.resourceAnnotations.find(function (anno) {\n return anno.getResource().id === id ||\n (0, flatten_1.default)(new Array(anno.getBody())).some(function (body) { return body.id === id; });\n });\n };\n /**\n * Returns the fragment placement values if a resourceAnnotation is placed on\n * a canvas somewhere besides the full extent\n */\n Canvas.prototype.onFragment = function (id) {\n var resourceAnnotation = this.resourceAnnotation(id);\n if (!resourceAnnotation)\n return undefined;\n // IIIF v2\n var on = resourceAnnotation.getProperty("on");\n // IIIF v3\n var target = resourceAnnotation.getProperty("target");\n if (!on || !target) {\n return undefined;\n }\n var fragmentMatch = (on || target).match(/xywh=(.*)$/);\n if (!fragmentMatch)\n return undefined;\n return fragmentMatch[1].split(",").map(function (str) { return parseInt(str, 10); });\n };\n Object.defineProperty(Canvas.prototype, "iiifImageResources", {\n get: function () {\n return this.imageResources.filter(function (r) { return r && r.getServices()[0] && r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "imageServiceIds", {\n get: function () {\n return this.iiifImageResources.map(function (r) { return r.getServices()[0].id; });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Canvas.prototype, "aspectRatio", {\n get: function () {\n return this.getWidth() / this.getHeight();\n },\n enumerable: false,\n configurable: true\n });\n return Canvas;\n}(internal_1.Resource));\nexports.Canvas = Canvas;\n\n\n//# sourceURL=webpack://manifesto/./src/Canvas.ts?')},"./src/Collection.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Collection = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Collection = /** @class */ (function (_super) {\n __extends(Collection, _super);\n function Collection(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._collections = null;\n _this._manifests = null;\n jsonld.__collection = _this;\n return _this;\n }\n Collection.prototype.getCollections = function () {\n if (this._collections) {\n return this._collections;\n }\n return (this._collections = (this.items.filter(function (m) { return m.isCollection(); })));\n };\n Collection.prototype.getManifests = function () {\n if (this._manifests) {\n return this._manifests;\n }\n return (this._manifests = (this.items.filter(function (m) { return m.isManifest(); })));\n };\n Collection.prototype.getCollectionByIndex = function (collectionIndex) {\n var collections = this.getCollections();\n var collection;\n for (var i = 0; i < collections.length; i++) {\n var c = collections[i];\n if (c.index === collectionIndex) {\n collection = c;\n }\n }\n if (collection) {\n collection.options.index = collectionIndex;\n // id for collection MUST be dereferenceable\n return collection.load();\n }\n else {\n throw new Error("Collection index not found");\n }\n };\n Collection.prototype.getManifestByIndex = function (manifestIndex) {\n var manifests = this.getManifests();\n var manifest;\n for (var i = 0; i < manifests.length; i++) {\n var m = manifests[i];\n if (m.index === manifestIndex) {\n manifest = m;\n }\n }\n if (manifest) {\n manifest.options.index = manifestIndex;\n return manifest.load();\n }\n else {\n throw new Error("Manifest index not found");\n }\n };\n Collection.prototype.getTotalCollections = function () {\n return this.getCollections().length;\n };\n Collection.prototype.getTotalManifests = function () {\n return this.getManifests().length;\n };\n Collection.prototype.getTotalItems = function () {\n return this.items.length;\n };\n Collection.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n return dist_commonjs_1.ViewingDirection.LEFT_TO_RIGHT;\n };\n /**\n * Note: this only will return the first behavior as per the manifesto convention\n * IIIF v3 supports multiple behaviors\n */\n Collection.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Collection.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n /**\n * Get a tree of sub collections and manifests, using each child manifest\'s first \'top\' range.\n */\n Collection.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n //console.log("get default tree for ", this.id);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n this._parseManifests(this);\n this._parseCollections(this);\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Collection.prototype._parseManifests = function (parentCollection) {\n if (parentCollection.getManifests() &&\n parentCollection.getManifests().length) {\n for (var i = 0; i < parentCollection.getManifests().length; i++) {\n var manifest = parentCollection.getManifests()[i];\n var tree = manifest.getDefaultTree();\n tree.label =\n manifest.parentLabel ||\n manifest.getLabel().getValue(this.options.locale) ||\n "manifest " + (i + 1);\n tree.navDate = manifest.getNavDate();\n tree.data.id = manifest.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n Collection.prototype._parseCollections = function (parentCollection) {\n //console.log("parse collections for ", parentCollection.id);\n if (parentCollection.getCollections() &&\n parentCollection.getCollections().length) {\n for (var i = 0; i < parentCollection.getCollections().length; i++) {\n var collection = parentCollection.getCollections()[i];\n var tree = collection.getDefaultTree();\n tree.label =\n collection.parentLabel ||\n collection.getLabel().getValue(this.options.locale) ||\n "collection " + (i + 1);\n tree.navDate = collection.getNavDate();\n tree.data.id = collection.id;\n tree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n parentCollection.defaultTree.addNode(tree);\n }\n }\n };\n return Collection;\n}(internal_1.IIIFResource));\nexports.Collection = Collection;\n\n\n//# sourceURL=webpack://manifesto/./src/Collection.ts?')},"./src/Color.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n//import { colorString } from "color-string"\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Color = void 0;\nvar colorString = __webpack_require__(/*! color-string */ "./node_modules/color-string/index.js");\n/**\n * class structure with red, green, blue values in 0-255 range\n * Uses the {@link https://www.npmjs.com/package.color-string | color-string }\n * library for conversion from and to string representations of color.\n**/\nvar Color = /** @class */ (function () {\n /**\n * @param rgbValue - Array of three 0-255 integers for r,g,b value. Ex: [255.0,0] for red\n **/\n function Color(rgbValue) {\n this.value = rgbValue;\n }\n /**\n * @param cssTerm - hex representtion of color as used in CSS. Ex "#FF0000" as red\n * @returns Color instance.\n **/\n Color.fromCSS = function (cssTerm) {\n var rv = colorString.get(cssTerm);\n if (rv.model !== \'rgb\')\n throw new Error("unsupported color string: " + cssTerm);\n return new Color([rv.value[0], rv.value[1], rv.value[2]]);\n };\n Object.defineProperty(Color.prototype, "red", {\n /**\n * @return 0 to 255 value of red color component\n **/\n get: function () { return this.value[0]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "green", {\n /**\n * @return 0 to 255 value of green color component\n **/\n get: function () { return this.value[1]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "blue", {\n /**\n * @return 0 to 255 value of blue color component\n **/\n get: function () { return this.value[2]; },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Color.prototype, "CSS", {\n /**\n * @returns hex string (as for CSS ) representation of r,g,b components\n **/\n get: function () { return colorString.to.hex(this.value); },\n enumerable: false,\n configurable: true\n });\n return Color;\n}());\nexports.Color = Color;\n\n\n//# sourceURL=webpack://manifesto/./src/Color.ts?')},"./src/Duration.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Duration = void 0;\nvar Duration = /** @class */ (function () {\n function Duration(start, end) {\n this.start = start;\n this.end = end;\n }\n Duration.prototype.getLength = function () {\n return this.end - this.start;\n };\n return Duration;\n}());\nexports.Duration = Duration;\n\n\n//# sourceURL=webpack://manifesto/./src/Duration.ts?')},"./src/Geometry3d.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.lightRelativeRotation = exports.cameraRelativeRotation = void 0;\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\n// https://ros2jsguy.github.io/threejs-math/index.html\n/**\n* performs the calculation required for the lookAt\n* property of a camera resource. Determines the\n* required angles of two rotations, the first about\n* the x axis and the second about the y axis, which will\n* rotate the default camera direction (0,0,-1) into the\n* direction of the input arguments\n*\n* Result of calculation is returned as a instance of EulerAngle from the\n* threejs-math library. The "axes order" of the EulerAngle is "YXZ": The\n* three-js library uses body-fixed axes to represent EulerAngles, which reverse\n* the ordering of the "relative rotation" algorithm described in the\n* draft 3d api.\n\n* @param direction A vector interpreted as a direction. Client code\n* responsible for not passing a 0-length vector, else a\n\n*\n* @returns threejs-math.EulerAngle instance\n**/\nfunction cameraRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n // projDirection is the direction projected onto the xz plane\n var projDirection = direction.clone().setComponent(1, 0.0);\n var projLength = projDirection.length();\n // handle the edge case, desired viewing direction is either straight up\n // or straight down\n if (projLength == 0.0) {\n if (direction.y > 0.0) {\n // looking straight up fro below\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(+90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n else {\n return new threejs_math_1.Euler(threejs_math_1.MathUtils.degToRad(-90.0), threejs_math_1.MathUtils.degToRad(180.0), 0, "YXZ");\n }\n }\n var yAngleRad = Math.atan2(-projDirection.x, -projDirection.z);\n var xAngleRad = Math.atan2(direction.y, projLength);\n return new threejs_math_1.Euler(xAngleRad, yAngleRad, 0.0, "YXZ");\n}\nexports.cameraRelativeRotation = cameraRelativeRotation;\n;\nfunction lightRelativeRotation(direction) {\n if (direction.length() == 0.0)\n throw new Error("degenerate geometry: cameraRelativeRotation");\n var unit_direction = direction.clone().divideScalar(direction.length());\n // negative y axis is initial direction of DirectionalLight, SpotLight\n // in draft 3D API\n var ny_axis = new threejs_math_1.Vector3(0.0, -1.0, 0.0);\n var quat = new threejs_math_1.Quaternion().setFromUnitVectors(ny_axis, unit_direction);\n var tmp = new threejs_math_1.Euler().setFromQuaternion(quat, "ZXY");\n // standard be setting the final intrinsic Y rotation, which is\n // along desired direction, to 0\n return new threejs_math_1.Euler(tmp.x, 0.0, tmp.z, "ZXY");\n}\nexports.lightRelativeRotation = lightRelativeRotation;\n\n\n//# sourceURL=webpack://manifesto/./src/Geometry3d.ts?')},"./src/IAccessToken.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IAccessToken.ts?')},"./src/IExternalImageResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalImageResourceData.ts?')},"./src/IExternalResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResource.ts?')},"./src/IExternalResourceData.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceData.ts?')},"./src/IExternalResourceOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IExternalResourceOptions.ts?')},"./src/IIIFResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.IIIFResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar IIIFResource = /** @class */ (function (_super) {\n __extends(IIIFResource, _super);\n function IIIFResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = -1;\n _this.isLoaded = false;\n var defaultOptions = {\n defaultLabel: "-",\n locale: "en-GB",\n resource: _this,\n pessimisticAccessControl: false\n };\n _this.options = Object.assign(defaultOptions, options);\n return _this;\n }\n /**\n * @deprecated\n */\n IIIFResource.prototype.getAttribution = function () {\n //console.warn(\'getAttribution will be deprecated, use getRequiredStatement instead.\');\n var attribution = this.getProperty("attribution");\n if (attribution) {\n return internal_1.PropertyValue.parse(attribution, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getDescription = function () {\n var description = this.getProperty("description");\n if (description) {\n return internal_1.PropertyValue.parse(description, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n IIIFResource.prototype.getHomepage = function () {\n var homepage = this.getProperty("homepage");\n if (!homepage)\n return null;\n if (typeof homepage == "string")\n return homepage;\n if (Array.isArray(homepage) && homepage.length) {\n homepage = homepage[0];\n }\n return homepage["@id"] || homepage.id;\n };\n IIIFResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n IIIFResource.prototype.getLogo = function () {\n var logo = this.getProperty("logo");\n // Presentation 3.\n // The logo is exclusive to the "provider" property, which is of type "Agent".\n // In order to fulfil `manifest.getLogo()` we should check\n // When P3 is fully supported, the following should work.\n // return this.getProvider()?.getLogo();\n if (!logo) {\n var provider = this.getProperty("provider");\n if (!provider) {\n return null;\n }\n logo = provider.logo;\n }\n if (!logo)\n return null;\n if (typeof logo === "string")\n return logo;\n if (Array.isArray(logo) && logo.length) {\n logo = logo[0];\n }\n return logo["@id"] || logo.id;\n };\n IIIFResource.prototype.getLicense = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("license"), this.options.locale);\n };\n IIIFResource.prototype.getNavDate = function () {\n return new Date(this.getProperty("navDate"));\n };\n IIIFResource.prototype.getRelated = function () {\n return this.getProperty("related");\n };\n IIIFResource.prototype.getSeeAlso = function () {\n return this.getProperty("seeAlso");\n };\n IIIFResource.prototype.getTrackingLabel = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.TRACKING_EXTENSIONS));\n if (service) {\n return service.getProperty("trackingLabel");\n }\n return "";\n };\n IIIFResource.prototype.getDefaultTree = function () {\n this.defaultTree = new internal_1.TreeNode("root");\n this.defaultTree.data = this;\n return this.defaultTree;\n };\n IIIFResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n else {\n // fall back to attribution (if it exists)\n var attribution = this.getAttribution();\n if (attribution) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.value = attribution;\n }\n }\n return requiredStatement;\n };\n IIIFResource.prototype.isCollection = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.isManifest = function () {\n if (this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST) {\n return true;\n }\n return false;\n };\n IIIFResource.prototype.load = function () {\n var that = this;\n return new Promise(function (resolve) {\n if (that.isLoaded) {\n resolve(that);\n }\n else {\n var options_1 = that.options;\n options_1.navDate = that.getNavDate();\n var id = that.__jsonld.id;\n if (!id) {\n id = that.__jsonld["@id"];\n }\n internal_1.Utils.loadManifest(id).then(function (data) {\n that.parentLabel = that.getLabel().getValue(options_1.locale);\n var parsed = internal_1.Deserialiser.parse(data, options_1);\n that = Object.assign(that, parsed);\n //that.parentCollection = options.resource.parentCollection;\n that.index = options_1.index;\n resolve(that);\n });\n }\n });\n };\n return IIIFResource;\n}(internal_1.ManifestResource));\nexports.IIIFResource = IIIFResource;\n\n\n//# sourceURL=webpack://manifesto/./src/IIIFResource.ts?')},"./src/IManifestoOptions.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/IManifestoOptions.ts?')},"./src/JSONLDResource.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.JSONLDResource = void 0;\nvar JSONLDResource = /** @class */ (function () {\n function JSONLDResource(jsonld) {\n this.__jsonld = jsonld;\n this.context = this.getProperty("context");\n this.id = this.getProperty("id");\n }\n JSONLDResource.prototype.getProperty = function (name) {\n var prop = null;\n if (this.__jsonld) {\n prop = this.__jsonld[name];\n if (!prop) {\n // property may have a prepended \'@\'\n prop = this.__jsonld["@" + name];\n }\n }\n return prop;\n };\n /**\n A function that wraps the getProperty function, which client\n code can use if it is needed to identify when the json value of\n a property is an IRI -- Internationalized Resource Identifier\n \n If the value of the json value is a bare string, then it will be\n wrapped in a json object with the string in the property \'id\',\n additionally that property will have a property \'isIRI\' which will\n be true for the literal string case, otherwise false meaning the\n returned getProperty should be parsed as before.\n \n **/\n JSONLDResource.prototype.getPropertyAsObject = function (name) {\n var prop = this.getProperty(name);\n if (prop === null)\n return prop;\n else if (typeof (prop) === \'string\')\n return { "id": prop,\n "isIRI": true\n };\n else if (prop === Object(prop))\n return prop;\n else {\n throw new Error("cannot resolve prop as object: " + prop);\n }\n };\n return JSONLDResource;\n}());\nexports.JSONLDResource = JSONLDResource;\n\n\n//# sourceURL=webpack://manifesto/./src/JSONLDResource.ts?')},"./src/LabelValuePair.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LabelValuePair = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar LabelValuePair = /** @class */ (function () {\n function LabelValuePair(defaultLocale) {\n this.defaultLocale = defaultLocale;\n }\n LabelValuePair.prototype.parse = function (resource) {\n this.resource = resource;\n this.label = internal_1.PropertyValue.parse(this.resource.label, this.defaultLocale);\n this.value = internal_1.PropertyValue.parse(this.resource.value, this.defaultLocale);\n };\n // shortcuts to get/set values based on user or default locale\n LabelValuePair.prototype.getLabel = function (locale) {\n if (this.label === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.label.getValue(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setLabel = function (value) {\n if (this.label === null) {\n this.label = new internal_1.PropertyValue([]);\n }\n this.label.setValue(value, this.defaultLocale);\n };\n LabelValuePair.prototype.getValue = function (locale, joinWith) {\n if (joinWith === void 0) { joinWith = " "; }\n if (this.value === null) {\n return null;\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValue(locale || this.defaultLocale, joinWith);\n };\n LabelValuePair.prototype.getValues = function (locale) {\n if (this.value === null) {\n return [];\n }\n if (Array.isArray(locale) && !locale.length) {\n locale = undefined;\n }\n return this.value.getValues(locale || this.defaultLocale);\n };\n LabelValuePair.prototype.setValue = function (value) {\n if (this.value === null) {\n this.value = new internal_1.PropertyValue([]);\n }\n this.value.setValue(value, this.defaultLocale);\n };\n return LabelValuePair;\n}());\nexports.LabelValuePair = LabelValuePair;\n\n\n//# sourceURL=webpack://manifesto/./src/LabelValuePair.ts?')},"./src/Language.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n\n\n//# sourceURL=webpack://manifesto/./src/Language.ts?')},"./src/LanguageMap.ts":function(__unused_webpack_module,exports){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.LanguageMap = void 0;\n/** @deprecated Use PropertyValue instead */\nvar LanguageMap = /** @class */ (function (_super) {\n __extends(LanguageMap, _super);\n function LanguageMap() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /** @deprecated Use the `PropertyValue#getValue` instance method instead */\n LanguageMap.getValue = function (languageCollection, locale) {\n return languageCollection.getValue(locale, " ");\n };\n /** @deprecated Use the `PropertyValue#getValues` instance method instead */\n LanguageMap.getValues = function (languageCollection, locale) {\n return languageCollection.getValues(locale);\n };\n return LanguageMap;\n}(Array));\nexports.LanguageMap = LanguageMap;\n\n\n//# sourceURL=webpack://manifesto/./src/LanguageMap.ts?')},"./src/Light.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Light = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Light = /** @class */ (function (_super) {\n __extends(Light, _super);\n function Light(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.isLight = true;\n _this.isModel = false;\n return _this;\n }\n Object.defineProperty(Light.prototype, "isAmbientLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "ambientlight");\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Light.prototype, "isDirectionalLight", {\n get: function () {\n return (internal_1.Utils.normaliseType(this.getProperty("type")) === "directionallight");\n },\n enumerable: false,\n configurable: true\n });\n Light.prototype.getColor = function () {\n var hexColor = this.getProperty("color");\n if (hexColor)\n return internal_1.Color.fromCSS(hexColor);\n else\n return new internal_1.Color([255, 255, 255]); // white light\n };\n /**\n * The implementation of the intensity is based on\n * {@link https://github.com/IIIF/3d/blob/main/temp-draft-4.md | temp-draft-4.md }\n * and the example 3D manifests\n * {@link https://github.com/IIIF/3d/tree/main/manifests/3_lights | lights }\n * on 24 Mar 2024. The intensity property in the manifest is an object\n * with declared type \'Value\', a numeric property named \'value\' and a\n * property named unit . This implementation will only work with a unit == \'relative\'\n * and it will be assumed that a relative unit value of 1.0 corresponds to the\n * brightest light source a rendering engine supports.\n *\n * This code will implement a default intensity of 1.0\n **/\n Light.prototype.getIntensity = function () {\n var intObject = this.getProperty("intensity");\n if (intObject) {\n try {\n if (!(intObject.type === "Value" && intObject.unit === "relative"))\n throw new Error();\n return intObject.value;\n }\n catch (err) {\n throw new Error("unable to interpret raw intensity object " + JSON.stringify(intObject));\n }\n }\n else\n return 1.0;\n };\n return Light;\n}(internal_1.AnnotationBody));\nexports.Light = Light;\n\n\n//# sourceURL=webpack://manifesto/./src/Light.ts?')},"./src/Manifest.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Manifest = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n* @remarks Scenes are conveniently retrieved from a Manifest by iterating through\n* Sequence in the Manifest, inner loop the Scenes in each sequence\n* @see {@link Sequence }\n*\n* @example\n* var manifest: Manifest;\n* function doSomethingWithScene(scene:Scene)...\n* ...\n* foreach(var seq:Sequence of manifest.getSequences()\n* foreach(var scene : Scene of seq.getScenes()\n* doSomethingWithScene(scene);\n**/\nvar Manifest = /** @class */ (function (_super) {\n __extends(Manifest, _super);\n function Manifest(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.index = 0;\n _this._allRanges = null;\n _this.items = [];\n _this._topRanges = [];\n if (_this.__jsonld.structures && _this.__jsonld.structures.length) {\n var topRanges = _this._getTopRanges();\n for (var i = 0; i < topRanges.length; i++) {\n var range = topRanges[i];\n _this._parseRanges(range, String(i));\n }\n }\n // initialization the cached _annotationIdMap to null\n // it will be populated if and only if client calls make a request\n // to the getter annotationIdMap\n _this._annotationIdMap = null;\n return _this;\n }\n /** @deprecated Use getAccompanyingCanvas instead */\n Manifest.prototype.getPosterCanvas = function () {\n var posterCanvas = this.getProperty("posterCanvas");\n if (posterCanvas) {\n posterCanvas = new internal_1.Canvas(posterCanvas, this.options);\n }\n return posterCanvas;\n };\n Manifest.prototype.getAccompanyingCanvas = function () {\n var accompanyingCanvas = this.getProperty("accompanyingCanvas");\n if (accompanyingCanvas) {\n accompanyingCanvas = new internal_1.Canvas(accompanyingCanvas, this.options);\n }\n return accompanyingCanvas;\n };\n Manifest.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Manifest.prototype.getDefaultTree = function () {\n _super.prototype.getDefaultTree.call(this);\n this.defaultTree.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n if (!this.isLoaded) {\n return this.defaultTree;\n }\n var topRanges = this.getTopRanges();\n // if there are any ranges in the manifest, default to the first \'top\' range or generated placeholder\n if (topRanges.length) {\n topRanges[0].getTree(this.defaultTree);\n }\n internal_1.Utils.generateTreeNodeIds(this.defaultTree);\n return this.defaultTree;\n };\n Manifest.prototype._getTopRanges = function () {\n var topRanges = [];\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var json = this.__jsonld.structures[i];\n if (json.viewingHint === dist_commonjs_1.ViewingHint.TOP) {\n topRanges.push(json);\n }\n }\n // if no viewingHint="top" range was found, create a default one\n if (!topRanges.length) {\n var range = {};\n range.ranges = this.__jsonld.structures;\n topRanges.push(range);\n }\n }\n return topRanges;\n };\n Manifest.prototype.getTopRanges = function () {\n return this._topRanges;\n };\n Manifest.prototype._getRangeById = function (id) {\n if (this.__jsonld.structures && this.__jsonld.structures.length) {\n for (var i = 0; i < this.__jsonld.structures.length; i++) {\n var r = this.__jsonld.structures[i];\n if (r["@id"] === id || r.id === id) {\n return r;\n }\n }\n }\n return null;\n };\n //private _parseRangeCanvas(json: any, range: Range): void {\n // todo: currently this isn\'t needed\n //var canvas: IJSONLDResource = new JSONLDResource(json);\n //range.items.push(canvas);\n //}\n Manifest.prototype._parseRanges = function (r, path, parentRange) {\n var range;\n var id = null;\n if (typeof r === "string") {\n id = r;\n r = this._getRangeById(id);\n }\n if (!r) {\n console.warn("Range:", id, "does not exist");\n return;\n }\n range = new internal_1.Range(r, this.options);\n range.parentRange = parentRange;\n range.path = path;\n if (!parentRange) {\n this._topRanges.push(range);\n }\n else {\n parentRange.items.push(range);\n }\n var items = r.items || r.members;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n // todo: use an ItemType constant?\n if ((item["@type"] && item["@type"].toLowerCase() === "sc:range") ||\n (item["type"] && item["type"].toLowerCase() === "range")) {\n this._parseRanges(item, path + "/" + i, range);\n }\n else if ((item["@type"] && item["@type"].toLowerCase() === "sc:canvas") ||\n (item["type"] && item["type"].toLowerCase() === "canvas")) {\n // store the ids on the __jsonld object to be used by Range.getCanvasIds()\n if (!range.canvases) {\n range.canvases = [];\n }\n var id_1 = item.id || item["@id"];\n range.canvases.push(id_1);\n }\n }\n }\n else if (r.ranges) {\n for (var i = 0; i < r.ranges.length; i++) {\n this._parseRanges(r.ranges[i], path + "/" + i, range);\n }\n }\n };\n Manifest.prototype.getAllRanges = function () {\n if (this._allRanges != null)\n return this._allRanges;\n this._allRanges = [];\n var topRanges = this.getTopRanges();\n var _loop_1 = function (i) {\n var topRange = topRanges[i];\n if (topRange.id) {\n this_1._allRanges.push(topRange); // it might be a placeholder root range\n }\n var reducer = function (acc, next) {\n acc.add(next);\n var nextRanges = next.getRanges();\n if (nextRanges.length) {\n return nextRanges.reduce(reducer, acc);\n }\n return acc;\n };\n var subRanges = Array.from(topRange.getRanges().reduce(reducer, new Set()));\n this_1._allRanges = this_1._allRanges.concat(subRanges);\n };\n var this_1 = this;\n for (var i = 0; i < topRanges.length; i++) {\n _loop_1(i);\n }\n return this._allRanges;\n };\n Manifest.prototype.getRangeById = function (id) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.id === id) {\n return range;\n }\n }\n return null;\n };\n Manifest.prototype.getRangeByPath = function (path) {\n var ranges = this.getAllRanges();\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (range.path === path) {\n return range;\n }\n }\n return null;\n };\n /**\n * @returns Array of Sequence instances\n **/\n Manifest.prototype.getSequences = function () {\n if (this.items.length) {\n return this.items;\n }\n // IxIF mediaSequences overrode sequences, so need to be checked first.\n // deprecate this when presentation 3 ships\n var items = this.__jsonld.mediaSequences || this.__jsonld.sequences;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var s = items[i];\n var sequence = new internal_1.Sequence(s, this.options);\n this.items.push(sequence);\n }\n }\n else if (this.__jsonld.items) {\n var sequence = new internal_1.Sequence(this.__jsonld.items, this.options);\n this.items.push(sequence);\n }\n return this.items;\n };\n Manifest.prototype.getSequenceByIndex = function (sequenceIndex) {\n return this.getSequences()[sequenceIndex];\n };\n Manifest.prototype.getTotalSequences = function () {\n return this.getSequences().length;\n };\n Manifest.prototype.getManifestType = function () {\n var service = (this.getService(dist_commonjs_1.ServiceProfile.UI_EXTENSIONS));\n if (service) {\n return service.getProperty("manifestType");\n }\n return internal_1.ManifestType.EMPTY;\n };\n Manifest.prototype.isMultiSequence = function () {\n return this.getTotalSequences() > 1;\n };\n Manifest.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n var behavior = this.getBehavior();\n if (behavior) {\n return behavior === dist_commonjs_1.Behavior.PAGED;\n }\n return false;\n };\n Manifest.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Manifest.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Object.defineProperty(Manifest.prototype, "annotationIdMap", {\n /**\n * Developer Note: The concept of the "id map" appear in the\n * JSON-LD specification https://www.w3.org/TR/json-ld11/#dfn-id-map\n * This functionality may be available as well in the \'nodeMap\' code of the\n * digitalbazaar/jsonld library\n *\n * this very simplified version just returns a mao of id -> Annotation nodes\n * in manifest\n *\n * THe annotationIdMap is a Javascript object whose property names are\n * IRI (id values) and property values are instances of the Annotation class\n **/\n get: function () {\n if (this._annotationIdMap == null) {\n this._annotationIdMap = {};\n for (var _i = 0, _a = this.getSequences(); _i < _a.length; _i++) {\n var seq = _a[_i];\n for (var _b = 0, _c = seq.getScenes(); _b < _c.length; _b++) {\n var scene = _c[_b];\n for (var _d = 0, _e = scene.getContent(); _d < _e.length; _d++) {\n var anno = _e[_d];\n this._annotationIdMap[anno.id] = anno;\n }\n }\n }\n }\n return this._annotationIdMap;\n },\n enumerable: false,\n configurable: true\n });\n return Manifest;\n}(internal_1.IIIFResource));\nexports.Manifest = Manifest;\n\n\n//# sourceURL=webpack://manifesto/./src/Manifest.ts?')},"./src/ManifestResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar ManifestResource = /** @class */ (function (_super) {\n __extends(ManifestResource, _super);\n function ManifestResource(jsonld, options) {\n var _this = _super.call(this, jsonld) || this;\n _this.options = options;\n return _this;\n }\n ManifestResource.prototype.getIIIFResourceType = function () {\n return internal_1.Utils.normaliseType(this.getProperty("type"));\n };\n ManifestResource.prototype.getLabel = function () {\n var label = this.getProperty("label");\n if (label) {\n return internal_1.PropertyValue.parse(label, this.options.locale);\n }\n return new internal_1.PropertyValue([], this.options.locale);\n };\n ManifestResource.prototype.getDefaultLabel = function () {\n return this.getLabel().getValue(this.options.locale);\n };\n ManifestResource.prototype.getMetadata = function () {\n var _metadata = this.getProperty("metadata");\n var metadata = [];\n if (!_metadata)\n return metadata;\n for (var i = 0; i < _metadata.length; i++) {\n var item = _metadata[i];\n var metadataItem = new internal_1.LabelValuePair(this.options.locale);\n metadataItem.parse(item);\n metadata.push(metadataItem);\n }\n return metadata;\n };\n ManifestResource.prototype.getRendering = function (format) {\n var renderings = this.getRenderings();\n for (var i = 0; i < renderings.length; i++) {\n var rendering = renderings[i];\n if (rendering.getFormat() === format) {\n return rendering;\n }\n }\n return null;\n };\n ManifestResource.prototype.getRenderings = function () {\n var rendering;\n // if passing a manifesto-parsed object, use the __jsonld.rendering property,\n // otherwise look for a rendering property\n if (this.__jsonld) {\n rendering = this.__jsonld.rendering;\n }\n else {\n rendering = this.rendering;\n }\n var renderings = [];\n if (!rendering)\n return renderings;\n // coerce to array\n if (!Array.isArray(rendering)) {\n rendering = [rendering];\n }\n for (var i = 0; i < rendering.length; i++) {\n var r = rendering[i];\n renderings.push(new internal_1.Rendering(r, this.options));\n }\n return renderings;\n };\n ManifestResource.prototype.getRequiredStatement = function () {\n var requiredStatement = null;\n var _requiredStatement = this.getProperty("requiredStatement");\n if (_requiredStatement) {\n requiredStatement = new internal_1.LabelValuePair(this.options.locale);\n requiredStatement.parse(_requiredStatement);\n }\n return requiredStatement;\n };\n ManifestResource.prototype.getService = function (profile) {\n return internal_1.Utils.getService(this, profile);\n };\n ManifestResource.prototype.getServices = function () {\n return internal_1.Utils.getServices(this);\n };\n ManifestResource.prototype.getThumbnail = function () {\n var thumbnail = this.getProperty("thumbnail");\n if (Array.isArray(thumbnail)) {\n thumbnail = thumbnail[0];\n }\n if (thumbnail) {\n return new internal_1.Thumbnail(thumbnail, this.options);\n }\n return null;\n };\n ManifestResource.prototype.isAnnotation = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.ANNOTATION;\n };\n ManifestResource.prototype.isCanvas = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.CANVAS;\n };\n ManifestResource.prototype.isCollection = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.COLLECTION;\n };\n ManifestResource.prototype.isManifest = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.MANIFEST;\n };\n ManifestResource.prototype.isRange = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.RANGE;\n };\n // this different implementation is necessary until such time as the \n // SCENE is added to the @iiif/vocabulary package.\n ManifestResource.prototype.isScene = function () {\n return this.getIIIFResourceType() === internal_1.Utils.normaliseType(\'Scene\');\n };\n ManifestResource.prototype.isSequence = function () {\n return this.getIIIFResourceType() === dist_commonjs_1.IIIFResourceType.SEQUENCE;\n };\n return ManifestResource;\n}(internal_1.JSONLDResource));\nexports.ManifestResource = ManifestResource;\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestResource.ts?')},"./src/ManifestType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ManifestType = void 0;\nvar ManifestType;\n(function (ManifestType) {\n ManifestType["EMPTY"] = "";\n ManifestType["MANUSCRIPT"] = "manuscript";\n ManifestType["MONOGRAPH"] = "monograph";\n})(ManifestType || (exports.ManifestType = ManifestType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/ManifestType.ts?')},"./src/PointSelector.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PointSelector = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar threejs_math_1 = __webpack_require__(/*! threejs-math */ "./node_modules/threejs-math/build/threejs-math.cjs");\nvar PointSelector = /** @class */ (function (_super) {\n __extends(PointSelector, _super);\n function PointSelector(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isPointSelector = true;\n return _this;\n }\n PointSelector.prototype.getLocation = function () {\n return new threejs_math_1.Vector3(this.__jsonld.x, this.__jsonld.y, this.__jsonld.z);\n /*\n return { x:Number(this.__jsonld.x),\n y:Number(this.__jsonld.y),\n z:Number(this.__jsonld.z)\n }\n */\n };\n return PointSelector;\n}(internal_1.JSONLDResource));\nexports.PointSelector = PointSelector;\n\n\n//# sourceURL=webpack://manifesto/./src/PointSelector.ts?')},"./src/PropertyValue.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.PropertyValue = exports.LocalizedValue = void 0;\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/** Utility class to hold one or more values with their associated (optional) locale */\nvar LocalizedValue = /** @class */ (function () {\n function LocalizedValue(value, locale, defaultLocale) {\n if (defaultLocale === void 0) { defaultLocale = "none"; }\n if (Array.isArray(value) && value.length === 1) {\n this._value = value[0];\n }\n else {\n this._value = value;\n }\n if (locale === "none" || locale === "@none") {\n locale = undefined;\n }\n this._locale = locale;\n this._defaultLocale = defaultLocale;\n }\n /** Parse a localized value from a IIIF v2 property value\n *\n * @param {string | string[] | object | object[]} rawVal value from IIIF resource\n * @param {string | undefined} defaultLocale deprecated: defaultLocale the default locale to use for this value\n */\n LocalizedValue.parseV2Value = function (rawVal, defaultLocale) {\n if (typeof rawVal === "string") {\n return new LocalizedValue(rawVal, undefined, defaultLocale);\n }\n else if (rawVal["@value"]) {\n return new LocalizedValue(rawVal["@value"], rawVal["@language"], defaultLocale);\n }\n return null;\n };\n Object.defineProperty(LocalizedValue.prototype, "value", {\n /*** @deprecated Use PropertyValue#getValue instead */\n get: function () {\n if (Array.isArray(this._value)) {\n return this._value.join(" ");\n }\n return this._value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LocalizedValue.prototype, "locale", {\n /*** @deprecated Don\'t use, only used for backwards compatibility reasons */\n get: function () {\n if (this._locale === undefined) {\n return this._defaultLocale;\n }\n return this._locale;\n },\n enumerable: false,\n configurable: true\n });\n LocalizedValue.prototype.addValue = function (value) {\n if (!Array.isArray(this._value)) {\n this._value = [this._value];\n }\n if (Array.isArray(value)) {\n this._value = this._value.concat(value);\n }\n else {\n this._value.push(value);\n }\n };\n return LocalizedValue;\n}());\nexports.LocalizedValue = LocalizedValue;\n/***\n * Holds a collection of values and their (optional) languages and allows\n * language-based value retrieval as per the algorithm described in\n * https://iiif.io/api/presentation/2.1/#language-of-property-values\n */\nvar PropertyValue = /** @class */ (function (_super) {\n __extends(PropertyValue, _super);\n function PropertyValue(values, defaultLocale) {\n if (values === void 0) { values = []; }\n var _this = _super.apply(this, values) || this;\n // Needed for ES5 compatibility, see https://stackoverflow.com/a/40967939\n _this.__proto__ = PropertyValue.prototype;\n _this._defaultLocale = defaultLocale;\n return _this;\n }\n PropertyValue.parse = function (rawVal, defaultLocale) {\n if (!rawVal) {\n return new PropertyValue([], defaultLocale);\n }\n if (Array.isArray(rawVal)) {\n // Collection of IIIF v2 property values\n var parsed = rawVal\n .map(function (v) { return LocalizedValue.parseV2Value(v, defaultLocale); })\n .filter(function (v) { return v !== null; });\n var byLocale = parsed.reduce(function (acc, lv) {\n var loc = lv._locale;\n if (!loc) {\n // Cannot use undefined as an object key\n loc = "none";\n }\n if (acc[loc]) {\n acc[loc].addValue(lv._value);\n }\n else {\n acc[loc] = lv;\n }\n return acc;\n }, {});\n return new PropertyValue(Object.values(byLocale), defaultLocale);\n }\n else if (typeof rawVal === "string") {\n return new PropertyValue([new LocalizedValue(rawVal, undefined, defaultLocale)], defaultLocale);\n }\n else if (rawVal["@language"]) {\n // Single IIIF v2 property value\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else if (rawVal["@value"]) {\n // Single IIIF v2 property value without language\n var parsed = LocalizedValue.parseV2Value(rawVal);\n return new PropertyValue(parsed !== null ? [parsed] : [], defaultLocale);\n }\n else {\n // IIIF v3 property value\n return new PropertyValue(Object.keys(rawVal).map(function (locale) {\n var val = rawVal[locale];\n if (!Array.isArray(val)) {\n throw new Error("A IIIF v3 localized property value must have an array as the value for a given language.");\n }\n return new LocalizedValue(val, locale, defaultLocale);\n }), defaultLocale);\n }\n };\n /*** Try to find the available locale that best fit\'s the user\'s preferences. */\n PropertyValue.prototype.getSuitableLocale = function (locales) {\n // If any of the values have a language associated with them, the client\n // must display all of the values associated with the language that best\n // matches the language preference.\n if (locales.length == 0 && this._defaultLocale)\n locales.push(this._defaultLocale);\n // create an array of the language codes for all different LocalizedValue instances in this PropertyValue\n var allLocales = new Array();\n for (var _i = 0, _a = this; _i < _a.length; _i++) {\n var lv = _a[_i];\n if (lv._locale != undefined)\n allLocales.push(lv._locale);\n }\n var _loop_1 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return l === userLocale; });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // First, look for a precise match\n for (var _b = 0, locales_1 = locales; _b < locales_1.length; _b++) {\n var userLocale = locales_1[_b];\n var state_1 = _loop_1(userLocale);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n var _loop_2 = function (userLocale) {\n var matchingLocale = allLocales.find(function (l) { return Utils_1.Utils.getInexactLocale(l) === Utils_1.Utils.getInexactLocale(userLocale); });\n if (matchingLocale) {\n return { value: matchingLocale };\n }\n };\n // Look for an inexact match\n for (var _c = 0, locales_2 = locales; _c < locales_2.length; _c++) {\n var userLocale = locales_2[_c];\n var state_2 = _loop_2(userLocale);\n if (typeof state_2 === "object")\n return state_2.value;\n }\n return undefined;\n };\n /**\n * Set the value(s) for a given locale.\n *\n * If there\'s an existing locale that matches the given locale, it will be updated.\n *\n * @param locale Locale to set the value for\n * @param value value to set\n */\n PropertyValue.prototype.setValue = function (value, locale) {\n var existing = undefined;\n if (!locale) {\n existing = this.find(function (lv) { return lv._locale === undefined; });\n }\n else {\n var bestLocale_1 = this.getSuitableLocale([locale]);\n if (bestLocale_1) {\n existing = this.find(function (lv) { return lv._locale === bestLocale_1; });\n }\n }\n if (existing) {\n // Mutate existing localized value\n existing._value = value;\n }\n else {\n // Create a new localized value\n this.push(new LocalizedValue(value, locale, this._defaultLocale));\n }\n };\n /**\n * Get a value in the most suitable locale.\n *\n * @param {string | string[] | undefined} locales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @param {string | undefined} joinWith String to join multiple available values by,\n * if undefined only the first available value will be returned\n * @returns the first value in the most suitable locale or null if none could be found\n */\n PropertyValue.prototype.getValue = function (locales, joinWith) {\n var vals = this.getValues(locales);\n if (vals.length === 0) {\n return null;\n }\n if (joinWith) {\n return vals.join(joinWith);\n }\n return vals[0];\n };\n /**\n * Get all values available in the most suitable locale.\n *\n * @param {string | string[]} userLocales Desired locale, can be a list of\n * locales sorted by descending priority.\n * @returns the values for the most suitable locale, empty if none could be found\n */\n PropertyValue.prototype.getValues = function (userLocales) {\n if (!this.length) {\n return [];\n }\n var locales;\n if (!userLocales) {\n locales = [];\n }\n else if (!Array.isArray(userLocales)) {\n locales = [userLocales];\n }\n else {\n locales = userLocales;\n }\n // If none of the values have a language associated with them, the client\n // must display all of the values.\n if (this.length === 1 && this[0]._locale === undefined) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // Try to determine the available locale that best fits the user\'s preferences\n var matchingLocale = this.getSuitableLocale(locales);\n if (matchingLocale) {\n var val = this.find(function (lv) { return lv._locale === matchingLocale; })._value;\n return Array.isArray(val) ? val : [val];\n }\n // If all of the values have a language associated with them, and none match\n // the language preference, the client must select a language and display\n // all of the values associated with that language.\n var allHaveLang = !this.find(function (lv) { return lv._locale === undefined; });\n if (allHaveLang) {\n var val = this[0]._value;\n return Array.isArray(val) ? val : [val];\n }\n // If some of the values have a language associated with them, but none\n // match the language preference, the client must display all of the values\n // that do not have a language associated with them.\n var lv = this.find(function (lv) { return lv._locale === undefined; });\n if (lv) {\n return Array.isArray(lv._value) ? lv._value : [lv._value];\n }\n return [];\n };\n return PropertyValue;\n}(Array));\nexports.PropertyValue = PropertyValue;\n\n\n//# sourceURL=webpack://manifesto/./src/PropertyValue.ts?')},"./src/Range.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Range = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar Range = /** @class */ (function (_super) {\n __extends(Range, _super);\n function Range(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this._ranges = null;\n _this.canvases = null;\n _this.items = [];\n return _this;\n }\n Range.prototype.getCanvasIds = function () {\n if (this.__jsonld.canvases) {\n return this.__jsonld.canvases;\n }\n else if (this.canvases) {\n return this.canvases;\n }\n return [];\n };\n Range.prototype.getDuration = function () {\n // For this implementation, we want to catch SOME of the temporal cases - i.e. when there is a t=1,100\n if (this.canvases && this.canvases.length) {\n var startTimes = [];\n var endTimes = [];\n // When we loop through all of the canvases we store the recorded start and end times.\n // Then we choose the maximum and minimum values from this. This will give us a more accurate duration for the\n // Chosen range. However this is still not perfect and does not cover more complex ranges. These cases are out of\n // scope for this change.\n for (var _i = 0, _a = this.canvases; _i < _a.length; _i++) {\n var canvas = _a[_i];\n if (!canvas)\n continue;\n var _b = (canvas.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [undefined, canvas]), canvasId = _b[1], start_1 = _b[2], end_1 = _b[3];\n if (canvasId) {\n startTimes.push(parseFloat(start_1));\n endTimes.push(parseFloat(end_1));\n }\n }\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n else {\n // get child ranges and calculate the start and end based on them\n var childRanges = this.getRanges();\n var startTimes = [];\n var endTimes = [];\n // Once again, we use a max/min to get the ranges.\n for (var _c = 0, childRanges_1 = childRanges; _c < childRanges_1.length; _c++) {\n var childRange = childRanges_1[_c];\n var duration = childRange.getDuration();\n if (duration) {\n startTimes.push(duration.start);\n endTimes.push(duration.end);\n }\n }\n // And return the minimum as the start, and the maximum as the end.\n if (startTimes.length && endTimes.length) {\n return new internal_1.Duration(Math.min.apply(Math, startTimes), Math.max.apply(Math, endTimes));\n }\n }\n var start;\n var end;\n // There are 2 paths for this implementation. Either we have a list of canvases, or a list of ranges\n // which may have a list of ranges.\n // This is one of the limitations of this implementation.\n if (this.canvases && this.canvases.length) {\n // When we loop through each of the canvases we are expecting to see a fragment or a link to the whole canvas.\n // For example - if we have http://example.org/canvas#t=1,100 it will extract 1 and 100 as the start and end.\n for (var i = 0; i < this.canvases.length; i++) {\n var canvas = this.canvases[i];\n var temporal = internal_1.Utils.getTemporalComponent(canvas);\n if (temporal && temporal.length > 1) {\n if (i === 0) {\n // Note: Cannot guarantee ranges are sequential (fixed above)\n start = Number(temporal[0]);\n }\n if (i === this.canvases.length - 1) {\n end = Number(temporal[1]); // Note: The end of this duration may be targeting a different canvas.\n }\n }\n }\n }\n else {\n // In this second case, where there are nested ranges, we recursively get the duration\n // from each of the child ranges (a start and end) and then choose the first and last for the bounds of this range.\n var childRanges = this.getRanges();\n for (var i = 0; i < childRanges.length; i++) {\n var childRange = childRanges[i];\n var duration = childRange.getDuration();\n if (duration) {\n if (i === 0) {\n start = duration.start;\n }\n if (i === childRanges.length - 1) {\n end = duration.end;\n }\n }\n }\n }\n if (start !== undefined && end !== undefined) {\n return new internal_1.Duration(start, end);\n }\n return undefined;\n };\n // getCanvases(): ICanvas[] {\n // if (this._canvases) {\n // return this._canvases;\n // }\n // return this._canvases = this.items.en().where(m => m.isCanvas()).toArray();\n // }\n Range.prototype.getRanges = function () {\n if (this._ranges) {\n return this._ranges;\n }\n return (this._ranges = this.items.filter(function (m) { return m.isRange(); }));\n };\n Range.prototype.getBehavior = function () {\n var behavior = this.getProperty("behavior");\n if (Array.isArray(behavior)) {\n behavior = behavior[0];\n }\n if (behavior) {\n return behavior;\n }\n return null;\n };\n Range.prototype.getViewingDirection = function () {\n return this.getProperty("viewingDirection");\n };\n Range.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Range.prototype.getTree = function (treeRoot) {\n treeRoot.data = this;\n this.treeNode = treeRoot;\n var ranges = this.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n var node = new internal_1.TreeNode();\n treeRoot.addNode(node);\n this._parseTreeNode(node, range);\n }\n }\n internal_1.Utils.generateTreeNodeIds(treeRoot);\n return treeRoot;\n };\n Range.prototype.spansTime = function (time) {\n var duration = this.getDuration();\n if (duration) {\n if (time >= duration.start && time <= duration.end) {\n return true;\n }\n }\n return false;\n };\n Range.prototype._parseTreeNode = function (node, range) {\n node.label = range.getLabel().getValue(this.options.locale);\n node.data = range;\n node.data.type = internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n range.treeNode = node;\n var ranges = range.getRanges();\n if (ranges && ranges.length) {\n for (var i = 0; i < ranges.length; i++) {\n var childRange = ranges[i];\n var behavior = childRange.getBehavior();\n if (behavior === dist_commonjs_1.Behavior.NO_NAV) {\n continue;\n }\n else {\n var childNode = new internal_1.TreeNode();\n node.addNode(childNode);\n this._parseTreeNode(childNode, childRange);\n }\n }\n }\n };\n return Range;\n}(internal_1.ManifestResource));\nexports.Range = Range;\n\n\n//# sourceURL=webpack://manifesto/./src/Range.ts?')},"./src/Rendering.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Rendering = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Rendering = /** @class */ (function (_super) {\n __extends(Rendering, _super);\n function Rendering(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Rendering.prototype.getFormat = function () {\n return this.getProperty("format");\n };\n return Rendering;\n}(internal_1.ManifestResource));\nexports.Rendering = Rendering;\n\n\n//# sourceURL=webpack://manifesto/./src/Rendering.ts?')},"./src/Resource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Resource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Resource = /** @class */ (function (_super) {\n __extends(Resource, _super);\n function Resource(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Resource.prototype.getFormat = function () {\n var format = this.getProperty("format");\n if (format) {\n return format.toLowerCase();\n }\n return null;\n };\n Resource.prototype.getResources = function () {\n var resources = [];\n if (!this.__jsonld.resources)\n return resources;\n for (var i = 0; i < this.__jsonld.resources.length; i++) {\n var a = this.__jsonld.resources[i];\n var annotation = new internal_1.Annotation(a, this.options);\n resources.push(annotation);\n }\n return resources;\n };\n Resource.prototype.getType = function () {\n var type = this.getProperty("type");\n if (type) {\n return internal_1.Utils.normaliseType(type);\n }\n return null;\n };\n Resource.prototype.getWidth = function () {\n return this.getProperty("width");\n };\n Resource.prototype.getHeight = function () {\n return this.getProperty("height");\n };\n Resource.prototype.getMaxWidth = function () {\n return this.getProperty("maxWidth");\n };\n Resource.prototype.getMaxHeight = function () {\n var maxHeight = this.getProperty("maxHeight");\n // if a maxHeight hasn\'t been specified, default to maxWidth.\n // maxWidth in essence becomes maxEdge\n if (!maxHeight) {\n return this.getMaxWidth();\n }\n return null;\n };\n return Resource;\n}(internal_1.ManifestResource));\nexports.Resource = Resource;\n\n\n//# sourceURL=webpack://manifesto/./src/Resource.ts?')},"./src/RotateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.RotateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar RotateTransform = /** @class */ (function (_super) {\n __extends(RotateTransform, _super);\n function RotateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isRotateTransform = true;\n return _this;\n }\n RotateTransform.prototype.getRotation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return RotateTransform;\n}(internal_1.Transform));\nexports.RotateTransform = RotateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/RotateTransform.ts?')},"./src/ScaleTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.ScaleTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar ScaleTransform = /** @class */ (function (_super) {\n __extends(ScaleTransform, _super);\n function ScaleTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isScaleTransform = true;\n return _this;\n }\n ScaleTransform.prototype.getScale = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n // note that default scaling is 1.0\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 1.0;\n }\n return retVal;\n };\n return ScaleTransform;\n}(internal_1.Transform));\nexports.ScaleTransform = ScaleTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/ScaleTransform.ts?')},"./src/Scene.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Scene = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Scene = /** @class */ (function (_super) {\n __extends(Scene, _super);\n function Scene(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n // Presentation API 3.0\n Scene.prototype.getContent = function () {\n var content = [];\n var items = this.__jsonld.items || this.__jsonld.content;\n if (!items)\n return content;\n // should be contained in an AnnotationPage\n var annotationPage = null;\n if (items.length) {\n annotationPage = new internal_1.AnnotationPage(items[0], this.options);\n }\n if (!annotationPage) {\n return content;\n }\n var annotations = annotationPage.getItems();\n for (var i = 0; i < annotations.length; i++) {\n var a = annotations[i];\n var annotation = new internal_1.Annotation(a, this.options);\n content.push(annotation);\n }\n ;\n return content;\n };\n ;\n Object.defineProperty(Scene.prototype, "Content", {\n // 3D extension\n get: function () { return this.getContent(); },\n enumerable: false,\n configurable: true\n });\n Scene.prototype.getAnnotationById = function (searchId) {\n for (var _i = 0, _a = this.Content; _i < _a.length; _i++) {\n var anno = _a[_i];\n if (anno.id === searchId)\n return anno;\n }\n return null;\n };\n Scene.prototype.getBackgroundColor = function () {\n // regular expression intended to match strings like\n // "#FF00FF" -- interpreted as three hexadecimal values\n // in range 0-255 . Not that the \\w escape matches digits,\n // upper and lower case latin characters, and underscore\n // currently only supports the form for CSS\n // https://www.w3.org/wiki/CSS/Properties/color/RGB\n // with 6 hexadecimal digits\n var bgc = this.getProperty("backgroundColor");\n if (bgc)\n return internal_1.Color.fromCSS(bgc);\n else\n return null;\n };\n ;\n return Scene;\n}(internal_1.ManifestResource));\nexports.Scene = Scene;\n\n\n//# sourceURL=webpack://manifesto/./src/Scene.ts?')},"./src/Sequence.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Sequence = void 0;\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Sequence = /** @class */ (function (_super) {\n __extends(Sequence, _super);\n function Sequence(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n _this.items = [];\n _this._thumbnails = null;\n return _this;\n }\n Sequence.prototype.getCanvases = function () {\n if (this.items.length) {\n return this.items;\n }\n var items = this.__jsonld.canvases || this.__jsonld.elements;\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var c = items[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n else if (this.__jsonld) {\n for (var i = 0; i < this.__jsonld.length; i++) {\n var c = this.__jsonld[i];\n var canvas = new internal_1.Canvas(c, this.options);\n canvas.index = i;\n this.items.push(canvas);\n }\n }\n return this.items;\n };\n Sequence.prototype.getCanvasById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // normalise canvas id\n var canvasId = internal_1.Utils.normaliseUrl(canvas.id);\n if (internal_1.Utils.normaliseUrl(id) === canvasId) {\n return canvas;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasByIndex = function (canvasIndex) {\n return this.getCanvases()[canvasIndex];\n };\n Sequence.prototype.getCanvasIndexById = function (id) {\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === id) {\n return i;\n }\n }\n return null;\n };\n Sequence.prototype.getCanvasIndexByLabel = function (label, foliated) {\n label = label.trim();\n if (!isNaN(label)) {\n // if the label is numeric\n label = parseInt(label, 10).toString(); // trim any preceding zeros.\n if (foliated)\n label += "r"; // default to recto\n }\n var doublePageRegExp = /(\\d*)\\D+(\\d*)/;\n var match, regExp, regStr, labelPart1, labelPart2;\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n // check if there\'s a literal match\n if (canvas.getLabel().getValue(this.options.locale) === label) {\n return i;\n }\n // check if there\'s a match for double-page spreads e.g. 100-101, 100_101, 100 101\n match = doublePageRegExp.exec(label);\n if (!match)\n continue;\n labelPart1 = match[1];\n labelPart2 = match[2];\n if (!labelPart2)\n continue;\n regStr = "^" + labelPart1 + "\\\\D+" + labelPart2 + "$";\n regExp = new RegExp(regStr);\n if (regExp.test(canvas.getLabel().toString())) {\n return i;\n }\n }\n return -1;\n };\n Sequence.prototype.getLastCanvasLabel = function (alphanumeric) {\n for (var i = this.getTotalCanvases() - 1; i >= 0; i--) {\n var canvas = this.getCanvasByIndex(i);\n var label = (canvas.getLabel().getValue(this.options.locale));\n if (alphanumeric) {\n var regExp = /^[a-zA-Z0-9]*$/;\n if (regExp.test(label)) {\n return label;\n }\n }\n else if (label) {\n return label;\n }\n }\n return this.options.defaultLabel;\n };\n Sequence.prototype.getLastPageIndex = function () {\n return this.getTotalCanvases() - 1;\n };\n Sequence.prototype.getNextPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[0] + 1;\n }\n else {\n index = indices[indices.length - 1] + 1;\n }\n }\n else {\n index = canvasIndex + 1;\n }\n if (index > this.getLastPageIndex()) {\n return -1;\n }\n return index;\n };\n Sequence.prototype.getPagedIndices = function (canvasIndex, pagingEnabled) {\n var indices = [];\n if (!pagingEnabled) {\n indices.push(canvasIndex);\n }\n else {\n if (this.isFirstCanvas(canvasIndex) || this.isLastCanvas(canvasIndex)) {\n indices = [canvasIndex];\n }\n else if (canvasIndex % 2) {\n indices = [canvasIndex, canvasIndex + 1];\n }\n else {\n indices = [canvasIndex - 1, canvasIndex];\n }\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n indices = indices.reverse();\n }\n }\n return indices;\n };\n Sequence.prototype.getPrevPageIndex = function (canvasIndex, pagingEnabled) {\n var index;\n if (pagingEnabled) {\n var indices = this.getPagedIndices(canvasIndex);\n var viewingDirection = this.getViewingDirection();\n if (viewingDirection &&\n viewingDirection === dist_commonjs_1.ViewingDirection.RIGHT_TO_LEFT) {\n index = indices[indices.length - 1] - 1;\n }\n else {\n index = indices[0] - 1;\n }\n }\n else {\n index = canvasIndex - 1;\n }\n return index;\n };\n /**\n * @returns Array of Scene instances in the Sequence\n **/\n Sequence.prototype.getScenes = function () {\n var returnVal = [];\n var low_items = this.__jsonld.elements || this.__jsonld;\n if (low_items) {\n for (var i = 0; i < low_items.length; ++i) {\n var c = low_items[i];\n if (c.type === \'Scene\') {\n var scene = new internal_1.Scene(c, this.options);\n //scene.index = i;\n returnVal.push(scene);\n }\n }\n }\n return returnVal;\n };\n Sequence.prototype.getStartCanvasIndex = function () {\n var startCanvas = this.getStartCanvas();\n if (startCanvas) {\n // if there\'s a startCanvas attribute, loop through the canvases and return the matching index.\n for (var i = 0; i < this.getTotalCanvases(); i++) {\n var canvas = this.getCanvasByIndex(i);\n if (canvas.id === startCanvas)\n return i;\n }\n }\n // default to first canvas.\n return 0;\n };\n // todo: deprecate\n Sequence.prototype.getThumbs = function (width, height) {\n //console.warn(\'getThumbs will be deprecated, use getThumbnails instead\');\n var thumbs = [];\n var totalCanvases = this.getTotalCanvases();\n for (var i = 0; i < totalCanvases; i++) {\n var canvas = this.getCanvasByIndex(i);\n var thumb = new internal_1.Thumb(width, canvas);\n thumbs.push(thumb);\n }\n return thumbs;\n };\n Sequence.prototype.getThumbnails = function () {\n if (this._thumbnails != null)\n return this._thumbnails;\n this._thumbnails = [];\n var canvases = this.getCanvases();\n for (var i = 0; i < canvases.length; i++) {\n var thumbnail = canvases[i].getThumbnail();\n if (thumbnail) {\n this._thumbnails.push(thumbnail);\n }\n }\n return this._thumbnails;\n };\n Sequence.prototype.getStartCanvas = function () {\n return this.getProperty("startCanvas");\n };\n Sequence.prototype.getTotalCanvases = function () {\n return this.getCanvases().length;\n };\n Sequence.prototype.getViewingDirection = function () {\n if (this.getProperty("viewingDirection")) {\n return this.getProperty("viewingDirection");\n }\n else if (this.options.resource.getViewingDirection) {\n return this.options.resource.getViewingDirection();\n }\n return null;\n };\n Sequence.prototype.getViewingHint = function () {\n return this.getProperty("viewingHint");\n };\n Sequence.prototype.isCanvasIndexOutOfRange = function (canvasIndex) {\n return canvasIndex > this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isFirstCanvas = function (canvasIndex) {\n return canvasIndex === 0;\n };\n Sequence.prototype.isLastCanvas = function (canvasIndex) {\n return canvasIndex === this.getTotalCanvases() - 1;\n };\n Sequence.prototype.isMultiCanvas = function () {\n return this.getTotalCanvases() > 1;\n };\n Sequence.prototype.isPagingEnabled = function () {\n var viewingHint = this.getViewingHint();\n if (viewingHint) {\n return viewingHint === dist_commonjs_1.ViewingHint.PAGED;\n }\n return false;\n };\n // checks if the number of canvases is even - therefore has a front and back cover\n Sequence.prototype.isTotalCanvasesEven = function () {\n return this.getTotalCanvases() % 2 === 0;\n };\n return Sequence;\n}(internal_1.ManifestResource));\nexports.Sequence = Sequence;\n\n\n//# sourceURL=webpack://manifesto/./src/Sequence.ts?')},"./src/Serialisation.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Deserialiser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Deserialiser = /** @class */ (function () {\n function Deserialiser() {\n }\n Deserialiser.parse = function (manifest, options) {\n if (typeof manifest === "string") {\n manifest = JSON.parse(manifest);\n }\n return this.parseJson(manifest, options);\n };\n Deserialiser.parseJson = function (json, options) {\n var resource;\n // have options been passed for the manifest to inherit?\n if (options) {\n if (options.navDate && !isNaN(options.navDate.getTime())) {\n json.navDate = options.navDate.toString();\n }\n }\n if (json["@type"]) {\n switch (json["@type"]) {\n case "sc:Collection":\n resource = this.parseCollection(json, options);\n break;\n case "sc:Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n else {\n // presentation 3\n switch (json["type"]) {\n case "Collection":\n resource = this.parseCollection(json, options);\n break;\n case "Manifest":\n resource = this.parseManifest(json, options);\n break;\n default:\n return null;\n }\n }\n // Top-level resource was loaded from a URI, so flag it to prevent\n // unnecessary reload:\n resource.isLoaded = true;\n return resource;\n };\n Deserialiser.parseCollection = function (json, options) {\n var collection = new internal_1.Collection(json, options);\n if (options) {\n collection.index = options.index || 0;\n if (options.resource) {\n collection.parentCollection = options.resource.parentCollection;\n }\n }\n else {\n collection.index = 0;\n }\n this.parseCollections(collection, options);\n this.parseManifests(collection, options);\n this.parseItems(collection, options);\n return collection;\n };\n Deserialiser.parseCollections = function (collection, options) {\n var items;\n if (collection.__jsonld.collections) {\n items = collection.__jsonld.collections;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "collection"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n if (options) {\n options.index = i;\n }\n var item = this.parseCollection(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseManifest = function (json, options) {\n var manifest = new internal_1.Manifest(json, options);\n return manifest;\n };\n Deserialiser.parseManifests = function (collection, options) {\n var items;\n if (collection.__jsonld.manifests) {\n items = collection.__jsonld.manifests;\n }\n else if (collection.__jsonld.items) {\n items = collection.__jsonld.items.filter(function (m) { return m.type.toLowerCase() === "manifest"; });\n }\n if (items) {\n for (var i = 0; i < items.length; i++) {\n var item = this.parseManifest(items[i], options);\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n }\n }\n };\n Deserialiser.parseItem = function (json, options) {\n if (json["@type"]) {\n if (json["@type"].toLowerCase() === "sc:manifest") {\n return this.parseManifest(json, options);\n }\n else if (json["@type"].toLowerCase() === "sc:collection") {\n return this.parseCollection(json, options);\n }\n }\n else if (json.type) {\n if (json.type.toLowerCase() === "manifest") {\n return this.parseManifest(json, options);\n }\n else if (json.type.toLowerCase() === "collection") {\n return this.parseCollection(json, options);\n }\n }\n return null;\n };\n Deserialiser.parseItems = function (collection, options) {\n var items = collection.__jsonld.members || collection.__jsonld.items;\n if (items) {\n var _loop_1 = function (i) {\n if (options) {\n options.index = i;\n }\n var item = this_1.parseItem(items[i], options);\n if (!item)\n return { value: void 0 };\n // only add to items if not already parsed from backwards-compatible collections/manifests arrays\n if (collection.items.filter(function (m) { return m.id === item.id; })[0]) {\n return "continue";\n }\n item.index = i;\n item.parentCollection = collection;\n collection.items.push(item);\n };\n var this_1 = this;\n for (var i = 0; i < items.length; i++) {\n var state_1 = _loop_1(i);\n if (typeof state_1 === "object")\n return state_1.value;\n }\n }\n };\n return Deserialiser;\n}());\nexports.Deserialiser = Deserialiser;\n\n\n//# sourceURL=webpack://manifesto/./src/Serialisation.ts?')},"./src/Service.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Service = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Service = /** @class */ (function (_super) {\n __extends(Service, _super);\n function Service(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n Service.prototype.getProfile = function () {\n var profile = this.getProperty("profile");\n if (!profile) {\n profile = this.getProperty("dcterms:conformsTo");\n }\n if (Array.isArray(profile)) {\n return profile[0];\n }\n return profile;\n };\n Service.prototype.getConfirmLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale);\n };\n Service.prototype.getDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("description"), this.options.locale);\n };\n Service.prototype.getFailureDescription = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale);\n };\n Service.prototype.getFailureHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale);\n };\n Service.prototype.getHeader = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("header"), this.options.locale);\n };\n Service.prototype.getServiceLabel = function () {\n return internal_1.Utils.getLocalisedValue(this.getProperty("label"), this.options.locale);\n };\n Service.prototype.getInfoUri = function () {\n var infoUri = this.id;\n if (!infoUri.endsWith("/")) {\n infoUri += "/";\n }\n infoUri += "info.json";\n return infoUri;\n };\n return Service;\n}(internal_1.ManifestResource));\nexports.Service = Service;\n\n\n//# sourceURL=webpack://manifesto/./src/Service.ts?')},"./src/Size.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Size = void 0;\nvar Size = /** @class */ (function () {\n function Size(width, height) {\n this.width = width;\n this.height = height;\n }\n return Size;\n}());\nexports.Size = Size;\n\n\n//# sourceURL=webpack://manifesto/./src/Size.ts?')},"./src/SpecificResource.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.SpecificResource = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\n/**\n Developer note: This implementation does not strictly adhere\n to the description of SpecificResource in the Web Annotation Model\n document https://www.w3.org/TR/annotation-model/\n section 4 : https://www.w3.org/TR/annotation-model/#specific-resources\n \n The getTransform() method returning an Array of 3D Transfom resources, is\n an extension of SpecificResource beyond the web annotation model.\n*/\nvar SpecificResource = /** @class */ (function (_super) {\n __extends(SpecificResource, _super);\n function SpecificResource(jsonld, options) {\n var _this = _super.call(this, jsonld, options) || this;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isAnnotationBody = false;\n /*\n property distinguishing instances of SpecificResource from instances of AnnotionBody.\n The return type of the Annotation.getBody() method is an array of instances of the\n union type ( AnnotationBody | SpecificResource )\n */\n _this.isSpecificResource = true;\n _this.isSpecificResource = true;\n return _this;\n }\n ;\n SpecificResource.prototype.getSource = function () {\n var raw = this.getPropertyAsObject("source");\n if (raw.isIRI)\n return raw;\n /*\n this logic gets a little convoluted, because we have to preserve\n the cases where the raw json is an array for the sources of a\n SpecificResource applied to an annotation body, while for a target\n of an Annotation we just want a single object\n */\n // case of a source of a SpecificResource which is an Annotation target\n if (raw) {\n var containerTypes = ["Scene", "Canvas"];\n var singleItem = ([].concat(raw))[0];\n if (containerTypes.includes(singleItem["type"]))\n return singleItem;\n }\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n return internal_1.AnnotationBodyParser.BuildFromJson(item, this.options);\n }\n }\n throw new Error("cannot resolve Source " + JSON.stringify(raw));\n };\n SpecificResource.prototype.getSelector = function () {\n var raw = this.getProperty("selector");\n if (raw) {\n var item = ([].concat(raw))[0];\n if (item) {\n if (item["type"] === "PointSelector")\n return new internal_1.PointSelector(item);\n }\n throw new Error("unable to resolve SpecificResource selector " + JSON.stringify(this.__jsonld));\n }\n return null;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Selector", {\n get: function () { return this.getSelector(); },\n enumerable: false,\n configurable: true\n });\n SpecificResource.prototype.getTransform = function () {\n var retVal = [];\n var transformItems = this.getProperty("transform");\n for (var i = 0; i < transformItems.length; ++i) {\n var transformItem = transformItems[i];\n retVal.push(internal_1.TransformParser.BuildFromJson(transformItem));\n }\n return retVal;\n };\n ;\n Object.defineProperty(SpecificResource.prototype, "Transform", {\n get: function () { return this.getTransform(); },\n enumerable: false,\n configurable: true\n });\n return SpecificResource;\n}(internal_1.ManifestResource));\nexports.SpecificResource = SpecificResource;\n\n\n//# sourceURL=webpack://manifesto/./src/SpecificResource.ts?')},"./src/StatusCode.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.StatusCode = void 0;\nvar StatusCode;\n(function (StatusCode) {\n StatusCode[StatusCode["AUTHORIZATION_FAILED"] = 1] = "AUTHORIZATION_FAILED";\n StatusCode[StatusCode["FORBIDDEN"] = 2] = "FORBIDDEN";\n StatusCode[StatusCode["INTERNAL_SERVER_ERROR"] = 3] = "INTERNAL_SERVER_ERROR";\n StatusCode[StatusCode["RESTRICTED"] = 4] = "RESTRICTED";\n})(StatusCode || (exports.StatusCode = StatusCode = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/StatusCode.ts?')},"./src/Thumb.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumb = void 0;\n// todo: deprecate\n// this is used by Sequence.getThumbs\nvar Thumb = /** @class */ (function () {\n function Thumb(width, canvas) {\n this.data = canvas;\n this.index = canvas.index;\n this.width = width;\n var heightRatio = canvas.getHeight() / canvas.getWidth();\n if (heightRatio) {\n this.height = Math.floor(this.width * heightRatio);\n }\n else {\n this.height = width;\n }\n this.uri = canvas.getCanonicalImageUri(width);\n this.label = canvas.getLabel().getValue(); // todo: pass locale?\n this.viewingHint = canvas.getViewingHint();\n }\n return Thumb;\n}());\nexports.Thumb = Thumb;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumb.ts?')},"./src/Thumbnail.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Thumbnail = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Thumbnail = /** @class */ (function (_super) {\n __extends(Thumbnail, _super);\n function Thumbnail(jsonld, options) {\n return _super.call(this, jsonld, options) || this;\n }\n return Thumbnail;\n}(internal_1.Resource));\nexports.Thumbnail = Thumbnail;\n\n\n//# sourceURL=webpack://manifesto/./src/Thumbnail.ts?')},"./src/Transform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Transform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar Transform = /** @class */ (function (_super) {\n __extends(Transform, _super);\n function Transform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTransform = true;\n _this.isTransform = true;\n return _this;\n }\n return Transform;\n}(internal_1.JSONLDResource));\nexports.Transform = Transform;\n\n\n//# sourceURL=webpack://manifesto/./src/Transform.ts?')},"./src/TransformParser.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TransformParser = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TransformParser = /** @class */ (function () {\n function TransformParser() {\n }\n TransformParser.BuildFromJson = function (jsonld) {\n if (jsonld.type === "TranslateTransform")\n return new internal_1.TranslateTransform(jsonld);\n else if (jsonld.type === "RotateTransform")\n return new internal_1.RotateTransform(jsonld);\n else if (jsonld.type === "ScaleTransform")\n return new internal_1.ScaleTransform(jsonld);\n else\n throw new Error("Unknown transform type " + jsonld.type);\n };\n return TransformParser;\n}());\nexports.TransformParser = TransformParser;\n\n\n//# sourceURL=webpack://manifesto/./src/TransformParser.ts?')},"./src/TranslateTransform.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TranslateTransform = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TranslateTransform = /** @class */ (function (_super) {\n __extends(TranslateTransform, _super);\n function TranslateTransform(jsonld) {\n var _this = _super.call(this, jsonld) || this;\n _this.isTranslateTransform = true;\n return _this;\n }\n TranslateTransform.prototype.getTranslation = function () {\n var retVal = {};\n for (var _i = 0, _a = ["x", "y", "z"]; _i < _a.length; _i++) {\n var attrib = _a[_i];\n var raw = this.__jsonld[attrib];\n retVal[attrib] = (raw !== undefined) ? Number(raw) : 0.0;\n }\n return retVal;\n };\n return TranslateTransform;\n}(internal_1.Transform));\nexports.TranslateTransform = TranslateTransform;\n;\n\n\n//# sourceURL=webpack://manifesto/./src/TranslateTransform.ts?')},"./src/TreeNode.ts":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNode = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar TreeNode = /** @class */ (function () {\n function TreeNode(label, data) {\n this.label = label;\n this.data = data || {};\n this.nodes = [];\n }\n TreeNode.prototype.addNode = function (node) {\n this.nodes.push(node);\n node.parentNode = this;\n };\n TreeNode.prototype.isCollection = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.COLLECTION);\n };\n TreeNode.prototype.isManifest = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.MANIFEST);\n };\n TreeNode.prototype.isRange = function () {\n return this.data.type === internal_1.Utils.normaliseType(internal_1.TreeNodeType.RANGE);\n };\n return TreeNode;\n}());\nexports.TreeNode = TreeNode;\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNode.ts?')},"./src/TreeNodeType.ts":(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.TreeNodeType = void 0;\nvar TreeNodeType;\n(function (TreeNodeType) {\n TreeNodeType["COLLECTION"] = "collection";\n TreeNodeType["MANIFEST"] = "manifest";\n TreeNodeType["RANGE"] = "range";\n})(TreeNodeType || (exports.TreeNodeType = TreeNodeType = {}));\n\n\n//# sourceURL=webpack://manifesto/./src/TreeNodeType.ts?')},"./src/Utils.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Utils = void 0;\nvar internal_1 = __webpack_require__(/*! ./internal */ "./src/internal.ts");\nvar dist_commonjs_1 = __webpack_require__(/*! @iiif/vocabulary/dist-commonjs */ "./node_modules/@iiif/vocabulary/dist-commonjs/index.js");\nvar dist_commonjs_2 = __webpack_require__(/*! @edsilv/http-status-codes/dist-commonjs */ "./node_modules/@edsilv/http-status-codes/dist-commonjs/index.js");\n__webpack_require__(/*! isomorphic-unfetch */ "./node_modules/isomorphic-unfetch/index.js");\nvar Utils = /** @class */ (function () {\n function Utils() {\n }\n Utils.getMediaType = function (type) {\n type = type.toLowerCase();\n type = type.split(";")[0];\n return type.trim();\n };\n Utils.getImageQuality = function (profile) {\n if (profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2 ||\n profile === dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) {\n return "native";\n }\n return "default";\n };\n Utils.getInexactLocale = function (locale) {\n if (locale.indexOf("-") !== -1) {\n return locale.substr(0, locale.indexOf("-"));\n }\n return locale;\n };\n Utils.getLocalisedValue = function (resource, locale) {\n // if the resource is not an array of translations, return the string.\n if (!Array.isArray(resource)) {\n return resource;\n }\n // test for exact match\n for (var i = 0; i < resource.length; i++) {\n var value_1 = resource[i];\n var language_1 = value_1["@language"];\n if (locale === language_1) {\n return value_1["@value"];\n }\n }\n // test for inexact match\n var match = locale.substr(0, locale.indexOf("-"));\n for (var i = 0; i < resource.length; i++) {\n var value = resource[i];\n var language = value["@language"];\n if (language === match) {\n return value["@value"];\n }\n }\n return null;\n };\n Utils.generateTreeNodeIds = function (treeNode, index) {\n if (index === void 0) { index = 0; }\n var id;\n if (!treeNode.parentNode) {\n id = "0";\n }\n else {\n id = treeNode.parentNode.id + "-" + index;\n }\n treeNode.id = id;\n for (var i = 0; i < treeNode.nodes.length; i++) {\n var n = treeNode.nodes[i];\n Utils.generateTreeNodeIds(n, i);\n }\n };\n Utils.normaliseType = function (type) {\n type = (type || "").toLowerCase();\n if (type.indexOf(":") !== -1) {\n var split = type.split(":");\n return split[1];\n }\n return type;\n };\n Utils.normaliseUrl = function (url) {\n url = url.substr(url.indexOf("://"));\n if (url.indexOf("#") !== -1) {\n url = url.split("#")[0];\n }\n return url;\n };\n Utils.normalisedUrlsMatch = function (url1, url2) {\n return Utils.normaliseUrl(url1) === Utils.normaliseUrl(url2);\n };\n Utils.isImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.isImageServiceType = function (type) {\n return ((type !== null &&\n type.toLowerCase() === dist_commonjs_1.ServiceType.IMAGE_SERVICE_2.toLowerCase()) ||\n type === dist_commonjs_1.ServiceType.IMAGE_SERVICE_3.toLowerCase());\n };\n Utils.isLevel0ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_0) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)) {\n return true;\n }\n return false;\n };\n Utils.isLevel1ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_1) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)) {\n return true;\n }\n return false;\n };\n Utils.isLevel2ImageProfile = function (profile) {\n if (Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_LEVEL_2) ||\n Utils.normalisedUrlsMatch(profile, dist_commonjs_1.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2)) {\n return true;\n }\n return false;\n };\n Utils.parseManifest = function (manifest, options) {\n return internal_1.Deserialiser.parse(manifest, options);\n };\n Utils.checkStatus = function (response) {\n if (response.ok) {\n return response;\n }\n else {\n var error = new Error(response.statusText);\n error.response = response;\n return Promise.reject(error);\n }\n };\n Utils.loadManifest = function (url) {\n return new Promise(function (resolve, reject) {\n fetch(url)\n .then(Utils.checkStatus)\n .then(function (r) { return r.json(); })\n .then(function (data) {\n resolve(data);\n })\n .catch(function (err) {\n reject();\n });\n });\n };\n Utils.loadExternalResourcesAuth1 = function (resources, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth1(resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n Utils.loadExternalResourceAuth1 = function (resource, openContentProviderInteraction, openTokenService, getStoredAccessToken, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var storedAccessToken;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, getStoredAccessToken(resource)];\n case 1:\n storedAccessToken = _a.sent();\n if (!storedAccessToken) return [3 /*break*/, 6];\n return [4 /*yield*/, resource.getData(storedAccessToken)];\n case 2:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.OK)) return [3 /*break*/, 3];\n return [2 /*return*/, resource];\n case 3: \n // the stored token is no good for this resource\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 4:\n // the stored token is no good for this resource\n _a.sent();\n _a.label = 5;\n case 5:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n case 6: return [4 /*yield*/, resource.getData()];\n case 7:\n _a.sent();\n if (!(resource.status === dist_commonjs_2.MOVED_TEMPORARILY ||\n resource.status === dist_commonjs_2.UNAUTHORIZED)) return [3 /*break*/, 9];\n return [4 /*yield*/, Utils.doAuthChain(resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages)];\n case 8:\n _a.sent();\n _a.label = 9;\n case 9:\n if (resource.status === dist_commonjs_2.OK || resource.status === dist_commonjs_2.MOVED_TEMPORARILY) {\n return [2 /*return*/, resource];\n }\n throw Utils.createAuthorizationFailedError();\n }\n });\n });\n };\n Utils.doAuthChain = function (resource, openContentProviderInteraction, openTokenService, userInteractedWithContentProvider, getContentProviderInteraction, handleMovedTemporarily, showOutOfOptionsMessages) {\n return __awaiter(this, void 0, void 0, function () {\n var externalService, kioskService, clickThroughService, loginService, serviceToTry, lastAttempted, kioskInteraction, contentProviderInteraction, contentProviderInteraction;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n // This function enters the flowchart at the < External? > junction\n // http://iiif.io/api/auth/1.0/#workflow-from-the-browser-client-perspective\n if (!resource.isAccessControlled()) {\n return [2 /*return*/, resource]; // no services found\n }\n externalService = resource.externalService;\n if (externalService) {\n externalService.options = resource.options;\n }\n kioskService = resource.kioskService;\n if (kioskService) {\n kioskService.options = resource.options;\n }\n clickThroughService = resource.clickThroughService;\n if (clickThroughService) {\n clickThroughService.options = resource.options;\n }\n loginService = resource.loginService;\n if (loginService) {\n loginService.options = resource.options;\n }\n if (!(!resource.isResponseHandled && resource.status === dist_commonjs_2.MOVED_TEMPORARILY)) return [3 /*break*/, 2];\n return [4 /*yield*/, handleMovedTemporarily(resource)];\n case 1:\n _a.sent();\n return [2 /*return*/, resource];\n case 2:\n serviceToTry = null;\n lastAttempted = null;\n // repetition of logic is left in these steps for clarity:\n // Looking for external pattern\n serviceToTry = externalService;\n if (!serviceToTry) return [3 /*break*/, 4];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 3:\n _a.sent();\n return [2 /*return*/, resource];\n case 4:\n // Looking for kiosk pattern\n serviceToTry = kioskService;\n if (!serviceToTry) return [3 /*break*/, 7];\n lastAttempted = serviceToTry;\n kioskInteraction = openContentProviderInteraction(serviceToTry);\n if (!kioskInteraction) return [3 /*break*/, 7];\n return [4 /*yield*/, userInteractedWithContentProvider(kioskInteraction)];\n case 5:\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 6:\n _a.sent();\n return [2 /*return*/, resource];\n case 7:\n // The code for the next two patterns is identical (other than the profile name).\n // The difference is in the expected behaviour of\n //\n // await userInteractedWithContentProvider(contentProviderInteraction);\n //\n // For clickthrough the opened window should close immediately having established\n // a session, whereas for login the user might spend some time entering credentials etc.\n // Looking for clickthrough pattern\n serviceToTry = clickThroughService;\n if (!serviceToTry) return [3 /*break*/, 11];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 8:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 11];\n // should close immediately\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 9:\n // should close immediately\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 10:\n _a.sent();\n return [2 /*return*/, resource];\n case 11:\n // Looking for login pattern\n serviceToTry = loginService;\n if (!serviceToTry) return [3 /*break*/, 15];\n lastAttempted = serviceToTry;\n return [4 /*yield*/, getContentProviderInteraction(resource, serviceToTry)];\n case 12:\n contentProviderInteraction = _a.sent();\n if (!contentProviderInteraction) return [3 /*break*/, 15];\n // we expect the user to spend some time interacting\n return [4 /*yield*/, userInteractedWithContentProvider(contentProviderInteraction)];\n case 13:\n // we expect the user to spend some time interacting\n _a.sent();\n return [4 /*yield*/, Utils.attemptResourceWithToken(resource, openTokenService, serviceToTry)];\n case 14:\n _a.sent();\n return [2 /*return*/, resource];\n case 15:\n // nothing worked! Use the most recently tried service as the source of\n // messages to show to the user.\n if (lastAttempted) {\n showOutOfOptionsMessages(resource, lastAttempted);\n }\n return [2 /*return*/];\n }\n });\n });\n };\n Utils.attemptResourceWithToken = function (resource, openTokenService, authService) {\n return __awaiter(this, void 0, void 0, function () {\n var tokenService, tokenMessage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n tokenService = authService.getService(dist_commonjs_1.ServiceProfile.AUTH_1_TOKEN);\n if (!tokenService) return [3 /*break*/, 3];\n return [4 /*yield*/, openTokenService(resource, tokenService)];\n case 1:\n tokenMessage = _a.sent();\n if (!(tokenMessage && tokenMessage.accessToken)) return [3 /*break*/, 3];\n return [4 /*yield*/, resource.getData(tokenMessage)];\n case 2:\n _a.sent();\n return [2 /*return*/, resource];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n Utils.loadExternalResourcesAuth09 = function (resources, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n var promises = resources.map(function (resource) {\n return Utils.loadExternalResourceAuth09(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options);\n });\n Promise.all(promises)\n .then(function () {\n resolve(resources);\n })["catch"](function (error) {\n reject(error);\n });\n });\n };\n // IIIF auth api pre v1.0\n // Keeping this around for now until the auth 1.0 implementation is stable\n Utils.loadExternalResourceAuth09 = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken, handleResourceResponse, options) {\n return new Promise(function (resolve, reject) {\n if (options && options.pessimisticAccessControl) {\n // pessimistic: access control cookies may have been deleted.\n // always request the access token for every access controlled info.json request\n // returned access tokens are not stored, therefore the login window flashes for every request.\n resource\n .getData()\n .then(function () {\n if (resource.isAccessControlled()) {\n // if the resource has a click through service, use that.\n if (resource.clickThroughService) {\n resolve(clickThrough(resource));\n //} else if(resource.restrictedService) {\n resolve(restricted(resource));\n }\n else {\n login(resource)\n .then(function () {\n getAccessToken(resource, true)\n .then(function (token) {\n resource\n .getData(token)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n }\n else {\n // this info.json isn\'t access controlled, therefore no need to request an access token.\n resolve(resource);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // optimistic: access control cookies may not have been deleted.\n // store access tokens to avoid login window flashes.\n // if cookies are deleted a page refresh is required.\n // try loading the resource using an access token that matches the info.json domain.\n // if an access token is found, request the resource using it regardless of whether it is access controlled.\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n // if the info.json loaded using the stored access token\n if (resource.status === dist_commonjs_2.OK) {\n resolve(handleResourceResponse(resource));\n }\n else {\n // otherwise, load the resource data to determine the correct access control services.\n // if access controlled, do login.\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n // if (resource.restrictedService){\n // reject(Utils.createRestrictedError());\n // } else {\n reject(Utils.createAuthorizationFailedError());\n //}\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n else {\n Utils.authorize(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken)\n .then(function () {\n resolve(handleResourceResponse(resource));\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n })["catch"](function (error) {\n reject(Utils.createAuthorizationFailedError());\n });\n }\n });\n };\n Utils.createError = function (name, message) {\n var error = new Error();\n error.message = message;\n error.name = String(name);\n return error;\n };\n Utils.createAuthorizationFailedError = function () {\n return Utils.createError(internal_1.StatusCode.AUTHORIZATION_FAILED, "Authorization failed");\n };\n Utils.createRestrictedError = function () {\n return Utils.createError(internal_1.StatusCode.RESTRICTED, "Restricted");\n };\n Utils.createInternalServerError = function (message) {\n return Utils.createError(internal_1.StatusCode.INTERNAL_SERVER_ERROR, message);\n };\n Utils.authorize = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, getStoredAccessToken) {\n return new Promise(function (resolve, reject) {\n resource.getData().then(function () {\n if (resource.isAccessControlled()) {\n getStoredAccessToken(resource, tokenStorageStrategy)\n .then(function (storedAccessToken) {\n if (storedAccessToken) {\n // try using the stored access token\n resource\n .getData(storedAccessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource); // happy path ended\n }\n else {\n // the stored token is no good for this resource\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // There was no stored token, but the user might have a cookie that will grant a token\n getAccessToken(resource, false).then(function (accessToken) {\n if (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n // try using the fresh access token\n resource\n .getData(accessToken)\n .then(function () {\n if (resource.status === dist_commonjs_2.OK) {\n resolve(resource);\n }\n else {\n // User has a token, but it\'s not good enough\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n // not able to store access token\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // The user did not have a cookie that granted a token\n Utils.showAuthInteraction(resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject);\n }\n });\n }\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n }\n else {\n // this info.json isn\'t access controlled, therefore there\'s no need to request an access token\n resolve(resource);\n }\n });\n });\n };\n Utils.showAuthInteraction = function (resource, tokenStorageStrategy, clickThrough, restricted, login, getAccessToken, storeAccessToken, resolve, reject) {\n if (resource.status === dist_commonjs_2.MOVED_TEMPORARILY && !resource.isResponseHandled) {\n // if the resource was redirected to a degraded version\n // and the response hasn\'t been handled yet.\n // if the client wishes to trigger a login, set resource.isResponseHandled to true\n // and call loadExternalResources() again passing the resource.\n resolve(resource);\n // } else if (resource.restrictedService) {\n // resolve(restricted(resource));\n // // TODO: move to next etc\n }\n else if (resource.clickThroughService && !resource.isResponseHandled) {\n // if the resource has a click through service, use that.\n clickThrough(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n else {\n // get an access token\n login(resource).then(function () {\n getAccessToken(resource, true)\n .then(function (accessToken) {\n storeAccessToken(resource, accessToken, tokenStorageStrategy)\n .then(function () {\n resource\n .getData(accessToken)\n .then(function () {\n resolve(resource);\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n })["catch"](function (message) {\n reject(Utils.createInternalServerError(message));\n });\n });\n }\n };\n Utils.getService = function (resource, profile) {\n var services = this.getServices(resource);\n for (var i = 0; i < services.length; i++) {\n var service = services[i];\n if (service.getProfile() === profile) {\n return service;\n }\n }\n return null;\n };\n Utils.getResourceById = function (parentResource, id) {\n return (Utils.traverseAndFind(parentResource.__jsonld, "@id", id));\n };\n /**\n * Does a depth first traversal of an Object, returning an Object that\n * matches provided k and v arguments\n * @example Utils.traverseAndFind({foo: \'bar\'}, \'foo\', \'bar\')\n */\n Utils.traverseAndFind = function (object, k, v) {\n if (object.hasOwnProperty(k) && object[k] === v) {\n return object;\n }\n for (var i = 0; i < Object.keys(object).length; i++) {\n if (typeof object[Object.keys(object)[i]] === "object") {\n var o = Utils.traverseAndFind(object[Object.keys(object)[i]], k, v);\n if (o != null) {\n return o;\n }\n }\n }\n return undefined;\n };\n Utils.getServices = function (resource, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.onlyService, onlyService = _c === void 0 ? false : _c, _d = _b.onlyServices, onlyServices = _d === void 0 ? false : _d, _e = _b.skipParentResources, skipParentResources = _e === void 0 ? false : _e;\n var services = [];\n // Resources can reference "services" on the manifest. This is a bit of a hack to just get the services from the manifest\n // too. What would be better is if this was used as a "Map" of full services.\n // So when you come across { id: \'...\' } without any data, you can "lookup" services from the manifest.\n // I would have implemented this if I was confident that it was reliable. Instead, I opted for the safest option that\n // should not break any existing services.\n if (!skipParentResources &&\n resource &&\n resource.options &&\n resource.options.resource &&\n resource.options.resource !== resource) {\n services.push.apply(services, Utils.getServices(resource.options.resource, { onlyServices: true }));\n }\n var service = !onlyServices\n ? (resource.__jsonld || resource).service || []\n : [];\n // coerce to array\n if (!Array.isArray(service)) {\n service = [service];\n }\n if (!onlyService) {\n // Some resources also have a `.services` property.\n // https://iiif.io/api/presentation/3.0/#services\n service.push.apply(service, ((resource.__jsonld || resource).services || []));\n }\n if (service.length === 0) {\n return services;\n }\n for (var i = 0; i < service.length; i++) {\n var s = service[i];\n if (typeof s === "string") {\n var r = this.getResourceById(resource.options.resource, s);\n if (r) {\n services.push(new internal_1.Service(r.__jsonld || r, resource.options));\n }\n }\n else {\n services.push(new internal_1.Service(s, resource.options));\n }\n }\n return services;\n };\n Utils.getTemporalComponent = function (target) {\n var temporal = /t=([^&]+)/g.exec(target);\n var t = null;\n if (temporal && temporal[1]) {\n t = temporal[1].split(",");\n }\n return t;\n };\n return Utils;\n}());\nexports.Utils = Utils;\n\n\n//# sourceURL=webpack://manifesto/./src/Utils.ts?')},"./src/index.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.parseManifest = exports.loadManifest = void 0;\n__exportStar(__webpack_require__(/*! ./internal */ "./src/internal.ts"), exports);\nvar Utils_1 = __webpack_require__(/*! ./Utils */ "./src/Utils.ts");\n/**\nInitiates downloading an IIIF manifest json file from URL. Returns a Promise\nto allow subsequent processing on a successful fetch.\n\n@param url string containing the URL to Fetch\n@returns Promise The object returned through the Promise is the javascript object obtained by deserializing the json text.\n**/\nvar loadManifest = function (url) {\n return Utils_1.Utils.loadManifest(url);\n};\nexports.loadManifest = loadManifest;\n/**\nParses IIIF manifest file to return a manifesto Manifest instance\n\n@param manifest Either a string containing text of a manifest file or an javascript object obtained by deserializing by the JSON.parse function a manifest file.\n@param options? TODO Not yet documented\n@returns instance of Manifest class.\n**/\nvar parseManifest = function (manifest, options) {\n return Utils_1.Utils.parseManifest(manifest, options);\n};\nexports.parseManifest = parseManifest;\n\n\n//# sourceURL=webpack://manifesto/./src/index.ts?')},"./src/internal.ts":function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./JSONLDResource */ "./src/JSONLDResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestResource */ "./src/ManifestResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Resource */ "./src/Resource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IIIFResource */ "./src/IIIFResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./SpecificResource */ "./src/SpecificResource.ts"), exports);\n//export * from "./SpecificResourceForTarget";\n//export * from "./SpecificResourceForBody";\n__exportStar(__webpack_require__(/*! ./AnnotationBody */ "./src/AnnotationBody.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Light */ "./src/Light.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Camera */ "./src/Camera.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationBodyParser */ "./src/AnnotationBodyParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Annotation */ "./src/Annotation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationList */ "./src/AnnotationList.ts"), exports);\n__exportStar(__webpack_require__(/*! ./AnnotationPage */ "./src/AnnotationPage.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Canvas */ "./src/Canvas.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Collection */ "./src/Collection.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Duration */ "./src/Duration.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IAccessToken */ "./src/IAccessToken.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalImageResourceData */ "./src/IExternalImageResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResource */ "./src/IExternalResource.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceData */ "./src/IExternalResourceData.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IExternalResourceOptions */ "./src/IExternalResourceOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./IManifestoOptions */ "./src/IManifestoOptions.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LabelValuePair */ "./src/LabelValuePair.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Language */ "./src/Language.ts"), exports);\n__exportStar(__webpack_require__(/*! ./LanguageMap */ "./src/LanguageMap.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PropertyValue */ "./src/PropertyValue.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Manifest */ "./src/Manifest.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ManifestType */ "./src/ManifestType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./PointSelector */ "./src/PointSelector.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Range */ "./src/Range.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Rendering */ "./src/Rendering.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Scene */ "./src/Scene.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Sequence */ "./src/Sequence.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Serialisation */ "./src/Serialisation.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Service */ "./src/Service.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Size */ "./src/Size.ts"), exports);\n__exportStar(__webpack_require__(/*! ./StatusCode */ "./src/StatusCode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumb */ "./src/Thumb.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Thumbnail */ "./src/Thumbnail.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Transform */ "./src/Transform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TransformParser */ "./src/TransformParser.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNode */ "./src/TreeNode.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TreeNodeType */ "./src/TreeNodeType.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Utils */ "./src/Utils.ts"), exports);\n__exportStar(__webpack_require__(/*! ./TranslateTransform */ "./src/TranslateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./RotateTransform */ "./src/RotateTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./ScaleTransform */ "./src/ScaleTransform.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Color */ "./src/Color.ts"), exports);\n__exportStar(__webpack_require__(/*! ./Geometry3d */ "./src/Geometry3d.ts"), exports);\n\n\n//# sourceURL=webpack://manifesto/./src/internal.ts?')},"./node_modules/unfetch/dist/unfetch.module.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},s.onerror=r,s.withCredentials="include"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})}\n//# sourceMappingURL=unfetch.module.js.map\n\n\n//# sourceURL=webpack://manifesto/./node_modules/unfetch/dist/unfetch.module.js?')},"node-fetch":t=>{"use strict";t.exports=node-fetch},"./node_modules/threejs-math/build/threejs-math.cjs":(__unused_webpack_module,exports)=>{"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nconst REVISION = '144dev';\nconst MOUSE = {\n\tLEFT: 0,\n\tMIDDLE: 1,\n\tRIGHT: 2,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2\n};\nconst TOUCH = {\n\tROTATE: 0,\n\tPAN: 1,\n\tDOLLY_PAN: 2,\n\tDOLLY_ROTATE: 3\n};\nconst CullFaceNone = 0;\nconst CullFaceBack = 1;\nconst CullFaceFront = 2;\nconst CullFaceFrontBack = 3;\nconst BasicShadowMap = 0;\nconst PCFShadowMap = 1;\nconst PCFSoftShadowMap = 2;\nconst VSMShadowMap = 3;\nconst FrontSide = 0;\nconst BackSide = 1;\nconst DoubleSide = 2;\nconst NoBlending = 0;\nconst NormalBlending = 1;\nconst AdditiveBlending = 2;\nconst SubtractiveBlending = 3;\nconst MultiplyBlending = 4;\nconst CustomBlending = 5;\nconst AddEquation = 100;\nconst SubtractEquation = 101;\nconst ReverseSubtractEquation = 102;\nconst MinEquation = 103;\nconst MaxEquation = 104;\nconst ZeroFactor = 200;\nconst OneFactor = 201;\nconst SrcColorFactor = 202;\nconst OneMinusSrcColorFactor = 203;\nconst SrcAlphaFactor = 204;\nconst OneMinusSrcAlphaFactor = 205;\nconst DstAlphaFactor = 206;\nconst OneMinusDstAlphaFactor = 207;\nconst DstColorFactor = 208;\nconst OneMinusDstColorFactor = 209;\nconst SrcAlphaSaturateFactor = 210;\nconst NeverDepth = 0;\nconst AlwaysDepth = 1;\nconst LessDepth = 2;\nconst LessEqualDepth = 3;\nconst EqualDepth = 4;\nconst GreaterEqualDepth = 5;\nconst GreaterDepth = 6;\nconst NotEqualDepth = 7;\nconst MultiplyOperation = 0;\nconst MixOperation = 1;\nconst AddOperation = 2;\nconst NoToneMapping = 0;\nconst LinearToneMapping = 1;\nconst ReinhardToneMapping = 2;\nconst CineonToneMapping = 3;\nconst ACESFilmicToneMapping = 4;\nconst CustomToneMapping = 5;\nconst UVMapping = 300;\nconst CubeReflectionMapping = 301;\nconst CubeRefractionMapping = 302;\nconst EquirectangularReflectionMapping = 303;\nconst EquirectangularRefractionMapping = 304;\nconst CubeUVReflectionMapping = 306;\nconst RepeatWrapping = 1000;\nconst ClampToEdgeWrapping = 1001;\nconst MirroredRepeatWrapping = 1002;\nconst NearestFilter = 1003;\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004;\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005;\nconst LinearFilter = 1006;\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007;\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008;\nconst UnsignedByteType = 1009;\nconst ByteType = 1010;\nconst ShortType = 1011;\nconst UnsignedShortType = 1012;\nconst IntType = 1013;\nconst UnsignedIntType = 1014;\nconst FloatType = 1015;\nconst HalfFloatType = 1016;\nconst UnsignedShort4444Type = 1017;\nconst UnsignedShort5551Type = 1018;\nconst UnsignedInt248Type = 1020;\nconst AlphaFormat = 1021;\nconst RGBFormat = 1022; // @deprecated since r137\n\nconst RGBAFormat = 1023;\nconst LuminanceFormat = 1024;\nconst LuminanceAlphaFormat = 1025;\nconst DepthFormat = 1026;\nconst DepthStencilFormat = 1027;\nconst RedFormat = 1028;\nconst RedIntegerFormat = 1029;\nconst RGFormat = 1030;\nconst RGIntegerFormat = 1031;\nconst RGBAIntegerFormat = 1033;\nconst RGB_S3TC_DXT1_Format = 33776;\nconst RGBA_S3TC_DXT1_Format = 33777;\nconst RGBA_S3TC_DXT3_Format = 33778;\nconst RGBA_S3TC_DXT5_Format = 33779;\nconst RGB_PVRTC_4BPPV1_Format = 35840;\nconst RGB_PVRTC_2BPPV1_Format = 35841;\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\nconst RGB_ETC1_Format = 36196;\nconst RGB_ETC2_Format = 37492;\nconst RGBA_ETC2_EAC_Format = 37496;\nconst RGBA_ASTC_4x4_Format = 37808;\nconst RGBA_ASTC_5x4_Format = 37809;\nconst RGBA_ASTC_5x5_Format = 37810;\nconst RGBA_ASTC_6x5_Format = 37811;\nconst RGBA_ASTC_6x6_Format = 37812;\nconst RGBA_ASTC_8x5_Format = 37813;\nconst RGBA_ASTC_8x6_Format = 37814;\nconst RGBA_ASTC_8x8_Format = 37815;\nconst RGBA_ASTC_10x5_Format = 37816;\nconst RGBA_ASTC_10x6_Format = 37817;\nconst RGBA_ASTC_10x8_Format = 37818;\nconst RGBA_ASTC_10x10_Format = 37819;\nconst RGBA_ASTC_12x10_Format = 37820;\nconst RGBA_ASTC_12x12_Format = 37821;\nconst RGBA_BPTC_Format = 36492;\nconst LoopOnce = 2200;\nconst LoopRepeat = 2201;\nconst LoopPingPong = 2202;\nconst InterpolateDiscrete = 2300;\nconst InterpolateLinear = 2301;\nconst InterpolateSmooth = 2302;\nconst ZeroCurvatureEnding = 2400;\nconst ZeroSlopeEnding = 2401;\nconst WrapAroundEnding = 2402;\nconst NormalAnimationBlendMode = 2500;\nconst AdditiveAnimationBlendMode = 2501;\nconst TrianglesDrawMode = 0;\nconst TriangleStripDrawMode = 1;\nconst TriangleFanDrawMode = 2;\nconst LinearEncoding = 3000;\nconst sRGBEncoding = 3001;\nconst BasicDepthPacking = 3200;\nconst RGBADepthPacking = 3201;\nconst TangentSpaceNormalMap = 0;\nconst ObjectSpaceNormalMap = 1; // Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\n\nconst NoColorSpace = '';\nconst SRGBColorSpace = 'srgb';\nconst LinearSRGBColorSpace = 'srgb-linear';\nconst ZeroStencilOp = 0;\nconst KeepStencilOp = 7680;\nconst ReplaceStencilOp = 7681;\nconst IncrementStencilOp = 7682;\nconst DecrementStencilOp = 7683;\nconst IncrementWrapStencilOp = 34055;\nconst DecrementWrapStencilOp = 34056;\nconst InvertStencilOp = 5386;\nconst NeverStencilFunc = 512;\nconst LessStencilFunc = 513;\nconst EqualStencilFunc = 514;\nconst LessEqualStencilFunc = 515;\nconst GreaterStencilFunc = 516;\nconst NotEqualStencilFunc = 517;\nconst GreaterEqualStencilFunc = 518;\nconst AlwaysStencilFunc = 519;\nconst StaticDrawUsage = 35044;\nconst DynamicDrawUsage = 35048;\nconst StreamDrawUsage = 35040;\nconst StaticReadUsage = 35045;\nconst DynamicReadUsage = 35049;\nconst StreamReadUsage = 35041;\nconst StaticCopyUsage = 35046;\nconst DynamicCopyUsage = 35050;\nconst StreamCopyUsage = 35042;\nconst GLSL1 = '100';\nconst GLSL3 = '300 es';\nconst _SRGBAFormat = 1035; // fallback for WebGL 1\n\nclass Vector2 {\n\tconstructor(x = 0, y = 0) {\n\t\tVector2.prototype.isVector2 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tget width() {\n\t\treturn this.x;\n\t}\n\n\tset width(value) {\n\t\tthis.x = value;\n\t}\n\n\tget height() {\n\t\treturn this.y;\n\t}\n\n\tset height(value) {\n\t\tthis.y = value;\n\t}\n\n\tset(x, y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\treturn this;\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6];\n\t\tthis.y = e[1] * x + e[4] * y + e[7];\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y;\n\t}\n\n\tcross(v) {\n\t\treturn this.x * v.y - this.y * v.x;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tangle() {\n\t\t// computes the angle in radians with respect to the positive x-axis\n\t\tconst angle = Math.atan2(-this.y, -this.x) + Math.PI;\n\t\treturn angle;\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \treturn this;\n\t// }\n\n\n\trotateAround(center, angle) {\n\t\tconst c = Math.cos(angle),\n\t\t\t\t\ts = Math.sin(angle);\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\t\treturn this;\n\t}\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t}\n\n}\n\nconst _lut = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff'];\nlet _seed = 1234567;\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI; // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\nfunction generateUUID() {\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[d0 & 0xff] + _lut[d0 >> 8 & 0xff] + _lut[d0 >> 16 & 0xff] + _lut[d0 >> 24 & 0xff] + '-' + _lut[d1 & 0xff] + _lut[d1 >> 8 & 0xff] + '-' + _lut[d1 >> 16 & 0x0f | 0x40] + _lut[d1 >> 24 & 0xff] + '-' + _lut[d2 & 0x3f | 0x80] + _lut[d2 >> 8 & 0xff] + '-' + _lut[d2 >> 16 & 0xff] + _lut[d2 >> 24 & 0xff] + _lut[d3 & 0xff] + _lut[d3 >> 8 & 0xff] + _lut[d3 >> 16 & 0xff] + _lut[d3 >> 24 & 0xff]; // .toLowerCase() here flattens concatenated strings to save heap memory space.\n\n\treturn uuid.toLowerCase();\n}\n\nfunction clamp(value, min, max) {\n\treturn Math.max(min, Math.min(max, value));\n} // compute euclidean modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\n\n\nfunction euclideanModulo(n, m) {\n\treturn (n % m + m) % m;\n} // Linear mapping from range to range \n\n\nfunction mapLinear(x, a1, a2, b1, b2) {\n\treturn b1 + (x - a1) * (b2 - b1) / (a2 - a1);\n} // https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\nfunction inverseLerp(x, y, value) {\n\tif (x !== y) {\n\t\treturn (value - x) / (y - x);\n\t} else {\n\t\treturn 0;\n\t}\n} // https://en.wikipedia.org/wiki/Linear_interpolation\n\n\nfunction lerp(x, y, t) {\n\treturn (1 - t) * x + t * y;\n} // http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\n\n\nfunction damp(x, y, lambda, dt) {\n\treturn lerp(x, y, 1 - Math.exp(-lambda * dt));\n} // https://www.desmos.com/calculator/vcsjnyz7x4\n\n\nfunction pingpong(x, length = 1) {\n\treturn length - Math.abs(euclideanModulo(x, length * 2) - length);\n} // http://en.wikipedia.org/wiki/Smoothstep\n\n\nfunction smoothstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * (3 - 2 * x);\n}\n\nfunction smootherstep(x, min, max) {\n\tif (x <= min) return 0;\n\tif (x >= max) return 1;\n\tx = (x - min) / (max - min);\n\treturn x * x * x * (x * (x * 6 - 15) + 10);\n} // Random integer from interval\n\n\nfunction randInt(low, high) {\n\treturn low + Math.floor(Math.random() * (high - low + 1));\n} // Random float from interval\n\n\nfunction randFloat(low, high) {\n\treturn low + Math.random() * (high - low);\n} // Random float from <-range/2, range/2> interval\n\n\nfunction randFloatSpread(range) {\n\treturn range * (0.5 - Math.random());\n} // Deterministic pseudo-random float in the interval [ 0, 1 ]\n\n\nfunction seededRandom(s) {\n\tif (s !== undefined) _seed = s; // Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\tt = Math.imul(t ^ t >>> 15, t | 1);\n\tt ^= t + Math.imul(t ^ t >>> 7, t | 61);\n\treturn ((t ^ t >>> 14) >>> 0) / 4294967296;\n}\n\nfunction degToRad(degrees) {\n\treturn degrees * DEG2RAD;\n}\n\nfunction radToDeg(radians) {\n\treturn radians * RAD2DEG;\n}\n\nfunction isPowerOfTwo(value) {\n\treturn (value & value - 1) === 0 && value !== 0;\n}\n\nfunction ceilPowerOfTwo(value) {\n\treturn Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n}\n\nfunction floorPowerOfTwo(value) {\n\treturn Math.pow(2, Math.floor(Math.log(value) / Math.LN2));\n}\n\nfunction setQuaternionFromProperEuler(q, a, b, c, order) {\n\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\t// rotations are applied to the axes in the order specified by 'order'\n\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t// angles are in radians\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\tconst c2 = cos(b / 2);\n\tconst s2 = sin(b / 2);\n\tconst c13 = cos((a + c) / 2);\n\tconst s13 = sin((a + c) / 2);\n\tconst c1_3 = cos((a - c) / 2);\n\tconst s1_3 = sin((a - c) / 2);\n\tconst c3_1 = cos((c - a) / 2);\n\tconst s3_1 = sin((c - a) / 2);\n\n\tswitch (order) {\n\t\tcase 'XYX':\n\t\t\tq.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order);\n\t}\n}\n\nfunction denormalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\t\t\treturn value / 255.0;\n\n\t\tcase Int16Array:\n\t\t\treturn Math.max(value / 32767.0, -1.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.max(value / 127.0, -1.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nfunction normalize(value, array) {\n\tswitch (array.constructor) {\n\t\tcase Float32Array:\n\t\t\treturn value;\n\n\t\tcase Uint16Array:\n\t\t\treturn Math.round(value * 65535.0);\n\n\t\tcase Uint8Array:\n\t\t\treturn Math.round(value * 255.0);\n\n\t\tcase Int16Array:\n\t\t\treturn Math.round(value * 32767.0);\n\n\t\tcase Int8Array:\n\t\t\treturn Math.round(value * 127.0);\n\n\t\tdefault:\n\t\t\tthrow new Error('Invalid component type.');\n\t}\n}\n\nvar MathUtils = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\tgenerateUUID: generateUUID,\n\tclamp: clamp,\n\teuclideanModulo: euclideanModulo,\n\tmapLinear: mapLinear,\n\tinverseLerp: inverseLerp,\n\tlerp: lerp,\n\tdamp: damp,\n\tpingpong: pingpong,\n\tsmoothstep: smoothstep,\n\tsmootherstep: smootherstep,\n\trandInt: randInt,\n\trandFloat: randFloat,\n\trandFloatSpread: randFloatSpread,\n\tseededRandom: seededRandom,\n\tdegToRad: degToRad,\n\tradToDeg: radToDeg,\n\tisPowerOfTwo: isPowerOfTwo,\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\tnormalize: normalize,\n\tdenormalize: denormalize\n});\n\nclass Quaternion {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tthis.isQuaternion = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\t}\n\n\tstatic slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) {\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\t\tlet x0 = src0[srcOffset0 + 0],\n\t\t\t\ty0 = src0[srcOffset0 + 1],\n\t\t\t\tz0 = src0[srcOffset0 + 2],\n\t\t\t\tw0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1 + 0],\n\t\t\t\t\ty1 = src1[srcOffset1 + 1],\n\t\t\t\t\tz1 = src1[srcOffset1 + 2],\n\t\t\t\t\tw1 = src1[srcOffset1 + 3];\n\n\t\tif (t === 0) {\n\t\t\tdst[dstOffset + 0] = x0;\n\t\t\tdst[dstOffset + 1] = y0;\n\t\t\tdst[dstOffset + 2] = z0;\n\t\t\tdst[dstOffset + 3] = w0;\n\t\t\treturn;\n\t\t}\n\n\t\tif (t === 1) {\n\t\t\tdst[dstOffset + 0] = x1;\n\t\t\tdst[dstOffset + 1] = y1;\n\t\t\tdst[dstOffset + 2] = z1;\n\t\t\tdst[dstOffset + 3] = w1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\t\t\tdir = cos >= 0 ? 1 : -1,\n\t\t\t\t\t\tsqrSin = 1 - cos * cos; // Skip the Slerp for tiny steps to avoid numeric problems:\n\n\t\t\tif (sqrSin > Number.EPSILON) {\n\t\t\t\tconst sin = Math.sqrt(sqrSin),\n\t\t\t\t\t\t\tlen = Math.atan2(sin, cos * dir);\n\t\t\t\ts = Math.sin(s * len) / sin;\n\t\t\t\tt = Math.sin(t * len) / sin;\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir; // Normalize in case we just did a lerp:\n\n\t\t\tif (s === 1 - t) {\n\t\t\t\tconst f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\t\t\t}\n\t\t}\n\n\t\tdst[dstOffset] = x0;\n\t\tdst[dstOffset + 1] = y0;\n\t\tdst[dstOffset + 2] = z0;\n\t\tdst[dstOffset + 3] = w0;\n\t}\n\n\tstatic multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {\n\t\tconst x0 = src0[srcOffset0];\n\t\tconst y0 = src0[srcOffset0 + 1];\n\t\tconst z0 = src0[srcOffset0 + 2];\n\t\tconst w0 = src0[srcOffset0 + 3];\n\t\tconst x1 = src1[srcOffset1];\n\t\tconst y1 = src1[srcOffset1 + 1];\n\t\tconst z1 = src1[srcOffset1 + 2];\n\t\tconst w1 = src1[srcOffset1 + 3];\n\t\tdst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\t\treturn dst;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget w() {\n\t\treturn this._w;\n\t}\n\n\tset w(value) {\n\t\tthis._w = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._w);\n\t}\n\n\tcopy(quaternion) {\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromEuler(euler, update) {\n\t\tconst x = euler._x,\n\t\t\t\t\ty = euler._y,\n\t\t\t\t\tz = euler._z,\n\t\t\t\t\torder = euler._order; // http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\t\tconst c1 = cos(x / 2);\n\t\tconst c2 = cos(y / 2);\n\t\tconst c3 = cos(z / 2);\n\t\tconst s1 = sin(x / 2);\n\t\tconst s2 = sin(y / 2);\n\t\tconst s3 = sin(z / 2);\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tif (update !== false) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromAxisAngle(axis, angle) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\t\t// assumes axis is normalized\n\t\tconst halfAngle = angle / 2,\n\t\t\t\t\ts = Math.sin(halfAngle);\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos(halfAngle);\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10],\n\t\t\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif (trace > 0) {\n\t\t\tconst s = 0.5 / Math.sqrt(trace + 1.0);\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = (m32 - m23) * s;\n\t\t\tthis._y = (m13 - m31) * s;\n\t\t\tthis._z = (m21 - m12) * s;\n\t\t} else if (m11 > m22 && m11 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\t\t\tthis._w = (m32 - m23) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = (m12 + m21) / s;\n\t\t\tthis._z = (m13 + m31) / s;\n\t\t} else if (m22 > m33) {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\t\t\tthis._w = (m13 - m31) / s;\n\t\t\tthis._x = (m12 + m21) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = (m23 + m32) / s;\n\t\t} else {\n\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\t\t\tthis._w = (m21 - m12) / s;\n\t\t\tthis._x = (m13 + m31) / s;\n\t\t\tthis._y = (m23 + m32) / s;\n\t\t\tthis._z = 0.25 * s;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromUnitVectors(vFrom, vTo) {\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\t\tlet r = vFrom.dot(vTo) + 1;\n\n\t\tif (r < Number.EPSILON) {\n\t\t\t// vFrom and vTo point in opposite directions\n\t\t\tr = 0;\n\n\t\t\tif (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n\t\t\t\tthis._x = -vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\t\t\t} else {\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = -vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\t\t\t}\n\t\t} else {\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\t\t}\n\n\t\treturn this.normalize();\n\t}\n\n\tangleTo(q) {\n\t\treturn 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));\n\t}\n\n\trotateTowards(q, step) {\n\t\tconst angle = this.angleTo(q);\n\t\tif (angle === 0) return this;\n\t\tconst t = Math.min(1, step / angle);\n\t\tthis.slerp(q, t);\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\treturn this.set(0, 0, 0, 1);\n\t}\n\n\tinvert() {\n\t\t// quaternion is assumed to have unit length\n\t\treturn this.conjugate();\n\t}\n\n\tconjugate() {\n\t\tthis._x *= -1;\n\t\tthis._y *= -1;\n\t\tthis._z *= -1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\t}\n\n\tlengthSq() {\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n\t}\n\n\tnormalize() {\n\t\tlet l = this.length();\n\n\t\tif (l === 0) {\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\t\t} else {\n\t\t\tl = 1 / l;\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tmultiply(q) {\n\t\treturn this.multiplyQuaternions(this, q);\n\t}\n\n\tpremultiply(q) {\n\t\treturn this.multiplyQuaternions(q, this);\n\t}\n\n\tmultiplyQuaternions(a, b) {\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\t\tconst qax = a._x,\n\t\t\t\t\tqay = a._y,\n\t\t\t\t\tqaz = a._z,\n\t\t\t\t\tqaw = a._w;\n\t\tconst qbx = b._x,\n\t\t\t\t\tqby = b._y,\n\t\t\t\t\tqbz = b._z,\n\t\t\t\t\tqbw = b._w;\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerp(qb, t) {\n\t\tif (t === 0) return this;\n\t\tif (t === 1) return this.copy(qb);\n\t\tconst x = this._x,\n\t\t\t\t\ty = this._y,\n\t\t\t\t\tz = this._z,\n\t\t\t\t\tw = this._w; // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif (cosHalfTheta < 0) {\n\t\t\tthis._w = -qb._w;\n\t\t\tthis._x = -qb._x;\n\t\t\tthis._y = -qb._y;\n\t\t\tthis._z = -qb._z;\n\t\t\tcosHalfTheta = -cosHalfTheta;\n\t\t} else {\n\t\t\tthis.copy(qb);\n\t\t}\n\n\t\tif (cosHalfTheta >= 1.0) {\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif (sqrSinHalfTheta <= Number.EPSILON) {\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\t\t\tthis.normalize();\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt(sqrSinHalfTheta);\n\t\tconst halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);\n\t\tconst ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n\t\t\t\t\tratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n\t\tthis._w = w * ratioA + this._w * ratioB;\n\t\tthis._x = x * ratioA + this._x * ratioB;\n\t\tthis._y = y * ratioA + this._y * ratioB;\n\t\tthis._z = z * ratioA + this._z * ratioB;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tslerpQuaternions(qa, qb, t) {\n\t\treturn this.copy(qa).slerp(qb, t);\n\t}\n\n\trandom() {\n\t\t// Derived from http://planning.cs.uiuc.edu/node198.html\n\t\t// Note, this source uses w, x, y, z ordering,\n\t\t// so we swap the order below.\n\t\tconst u1 = Math.random();\n\t\tconst sqrt1u1 = Math.sqrt(1 - u1);\n\t\tconst sqrtu1 = Math.sqrt(u1);\n\t\tconst u2 = 2 * Math.PI * Math.random();\n\t\tconst u3 = 2 * Math.PI * Math.random();\n\t\treturn this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2));\n\t}\n\n\tequals(quaternion) {\n\t\treturn quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis._x = array[offset];\n\t\tthis._y = array[offset + 1];\n\t\tthis._z = array[offset + 2];\n\t\tthis._w = array[offset + 3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis._x = attribute.getX( index );\n\t// \tthis._y = attribute.getY( index );\n\t// \tthis._z = attribute.getZ( index );\n\t// \tthis._w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\t}\n\n}\n\nclass Vector3 {\n\tconstructor(x = 0, y = 0, z = 0) {\n\t\tVector3.prototype.isVector3 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}\n\n\tset(x, y, z) {\n\t\tif (z === undefined) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\treturn this;\n\t}\n\n\tmultiplyVectors(a, b) {\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\t\treturn this;\n\t}\n\n\tapplyEuler(euler) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromEuler(euler));\n\t}\n\n\tapplyAxisAngle(axis, angle) {\n\t\treturn this.applyQuaternion(_quaternion$1.setFromAxisAngle(axis, angle));\n\t}\n\n\tapplyMatrix3(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[3] * y + e[6] * z;\n\t\tthis.y = e[1] * x + e[4] * y + e[7] * z;\n\t\tthis.z = e[2] * x + e[5] * y + e[8] * z;\n\t\treturn this;\n\t}\n\n\tapplyNormalMatrix(m) {\n\t\treturn this.applyMatrix3(m).normalize();\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\tthis.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w;\n\t\tthis.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w;\n\t\tthis.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w;\n\t\treturn this;\n\t}\n\n\tapplyQuaternion(q) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst qx = q.x,\n\t\t\t\t\tqy = q.y,\n\t\t\t\t\tqz = q.z,\n\t\t\t\t\tqw = q.w; // calculate quat * vector\n\n\t\tconst ix = qw * x + qy * z - qz * y;\n\t\tconst iy = qw * y + qz * x - qx * z;\n\t\tconst iz = qw * z + qx * y - qy * x;\n\t\tconst iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n\t\tthis.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t\tthis.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t\tthis.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t\treturn this;\n\t} // project( camera ) {\n\t// \treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\t// }\n\t// unproject( camera ) {\n\t// \treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\t// }\n\n\n\ttransformDirection(m) {\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z;\n\t\treturn this.normalize();\n\t}\n\n\tdivide(v) {\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t} // TODO lengthSquared?\n\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\treturn this;\n\t}\n\n\tcross(v) {\n\t\treturn this.crossVectors(this, v);\n\t}\n\n\tcrossVectors(a, b) {\n\t\tconst ax = a.x,\n\t\t\t\t\tay = a.y,\n\t\t\t\t\taz = a.z;\n\t\tconst bx = b.x,\n\t\t\t\t\tby = b.y,\n\t\t\t\t\tbz = b.z;\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\t\treturn this;\n\t}\n\n\tprojectOnVector(v) {\n\t\tconst denominator = v.lengthSq();\n\t\tif (denominator === 0) return this.set(0, 0, 0);\n\t\tconst scalar = v.dot(this) / denominator;\n\t\treturn this.copy(v).multiplyScalar(scalar);\n\t}\n\n\tprojectOnPlane(planeNormal) {\n\t\t_vector$3.copy(this).projectOnVector(planeNormal);\n\n\t\treturn this.sub(_vector$3);\n\t}\n\n\treflect(normal) {\n\t\t// reflect incident vector off plane orthogonal to normal\n\t\t// normal is assumed to have unit length\n\t\treturn this.sub(_vector$3.copy(normal).multiplyScalar(2 * this.dot(normal)));\n\t}\n\n\tangleTo(v) {\n\t\tconst denominator = Math.sqrt(this.lengthSq() * v.lengthSq());\n\t\tif (denominator === 0) return Math.PI / 2;\n\t\tconst theta = this.dot(v) / denominator; // clamp, to handle numerical problems\n\n\t\treturn Math.acos(clamp(theta, -1, 1));\n\t}\n\n\tdistanceTo(v) {\n\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t}\n\n\tdistanceToSquared(v) {\n\t\tconst dx = this.x - v.x,\n\t\t\t\t\tdy = this.y - v.y,\n\t\t\t\t\tdz = this.z - v.z;\n\t\treturn dx * dx + dy * dy + dz * dz;\n\t}\n\n\tmanhattanDistanceTo(v) {\n\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);\n\t}\n\n\tsetFromSpherical(s) {\n\t\treturn this.setFromSphericalCoords(s.radius, s.phi, s.theta);\n\t}\n\n\tsetFromSphericalCoords(radius, phi, theta) {\n\t\tconst sinPhiRadius = Math.sin(phi) * radius;\n\t\tthis.x = sinPhiRadius * Math.sin(theta);\n\t\tthis.y = Math.cos(phi) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromCylindrical(c) {\n\t\treturn this.setFromCylindricalCoords(c.radius, c.theta, c.y);\n\t}\n\n\tsetFromCylindricalCoords(radius, theta, y) {\n\t\tthis.x = radius * Math.sin(theta);\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos(theta);\n\t\treturn this;\n\t}\n\n\tsetFromMatrixPosition(m) {\n\t\tconst e = m.elements;\n\t\tthis.x = e[12];\n\t\tthis.y = e[13];\n\t\tthis.z = e[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrixScale(m) {\n\t\tconst sx = this.setFromMatrixColumn(m, 0).length();\n\t\tconst sy = this.setFromMatrixColumn(m, 1).length();\n\t\tconst sz = this.setFromMatrixColumn(m, 2).length();\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\t\treturn this;\n\t}\n\n\tsetFromMatrixColumn(m, index) {\n\t\treturn this.fromArray(m.elements, index * 4);\n\t}\n\n\tsetFromMatrix3Column(m, index) {\n\t\treturn this.fromArray(m.elements, index * 3);\n\t}\n\n\tsetFromEuler(e) {\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\treturn this;\n\t}\n\n\trandomDirection() {\n\t\t// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\n\t\tconst u = (Math.random() - 0.5) * 2;\n\t\tconst t = Math.random() * Math.PI * 2;\n\t\tconst f = Math.sqrt(1 - u ** 2);\n\t\tthis.x = f * Math.cos(t);\n\t\tthis.y = f * Math.sin(t);\n\t\tthis.z = u;\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/new Vector3();\n\nconst _quaternion$1 = /*@__PURE__*/new Quaternion();\n\nconst _vector$2 = /*@__PURE__*/new Vector2();\n\nclass Box2 {\n\tconstructor(min = new Vector2(+Infinity, +Infinity), max = new Vector2(-Infinity, -Infinity)) {\n\t\tthis.isBox2 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$2.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = +Infinity;\n\t\tthis.max.x = this.max.y = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y;\n\t}\n\n\tgetCenter(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector2()) {\n\t\treturn this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 4 splitting planes to rule out intersections\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$2.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max);\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nclass Box3 {\n\tconstructor(min = new Vector3(+Infinity, +Infinity, +Infinity), max = new Vector3(-Infinity, -Infinity, -Infinity)) {\n\t\tthis.isBox3 = true;\n\t\tthis.min = min;\n\t\tthis.max = max;\n\t}\n\n\tset(min, max) {\n\t\tthis.min.copy(min);\n\t\tthis.max.copy(max);\n\t\treturn this;\n\t}\n\n\tsetFromArray(array) {\n\t\tlet minX = +Infinity;\n\t\tlet minY = +Infinity;\n\t\tlet minZ = +Infinity;\n\t\tlet maxX = -Infinity;\n\t\tlet maxY = -Infinity;\n\t\tlet maxZ = -Infinity;\n\n\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\tconst x = array[i];\n\t\t\tconst y = array[i + 1];\n\t\t\tconst z = array[i + 2];\n\t\t\tif (x < minX) minX = x;\n\t\t\tif (y < minY) minY = y;\n\t\t\tif (z < minZ) minZ = z;\n\t\t\tif (x > maxX) maxX = x;\n\t\t\tif (y > maxY) maxY = y;\n\t\t\tif (z > maxZ) maxZ = z;\n\t\t}\n\n\t\tthis.min.set(minX, minY, minZ);\n\t\tthis.max.set(maxX, maxY, maxZ);\n\t\treturn this;\n\t} // setFromBufferAttribute( attribute ) {\n\t// \tlet minX = + Infinity;\n\t// \tlet minY = + Infinity;\n\t// \tlet minZ = + Infinity;\n\t// \tlet maxX = - Infinity;\n\t// \tlet maxY = - Infinity;\n\t// \tlet maxZ = - Infinity;\n\t// \tfor ( let i = 0, l = attribute.count; i < l; i ++ ) {\n\t// \t\tconst x = attribute.getX( i );\n\t// \t\tconst y = attribute.getY( i );\n\t// \t\tconst z = attribute.getZ( i );\n\t// \t\tif ( x < minX ) minX = x;\n\t// \t\tif ( y < minY ) minY = y;\n\t// \t\tif ( z < minZ ) minZ = z;\n\t// \t\tif ( x > maxX ) maxX = x;\n\t// \t\tif ( y > maxY ) maxY = y;\n\t// \t\tif ( z > maxZ ) maxZ = z;\n\t// \t}\n\t// \tthis.min.set( minX, minY, minZ );\n\t// \tthis.max.set( maxX, maxY, maxZ );\n\t// \treturn this;\n\t// }\n\n\n\tsetFromPoints(points) {\n\t\tthis.makeEmpty();\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tthis.expandByPoint(points[i]);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetFromCenterAndSize(center, size) {\n\t\tconst halfSize = _vector$1.copy(size).multiplyScalar(0.5);\n\n\t\tthis.min.copy(center).sub(halfSize);\n\t\tthis.max.copy(center).add(halfSize);\n\t\treturn this;\n\t}\n\n\tsetFromObject(object, precise = false) {\n\t\tthis.makeEmpty();\n\t\treturn this.expandByObject(object, precise);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(box) {\n\t\tthis.min.copy(box.min);\n\t\tthis.max.copy(box.max);\n\t\treturn this;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.min.x = this.min.y = this.min.z = +Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = -Infinity;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\treturn this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n\t}\n\n\tgetCenter(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t}\n\n\tgetSize(target = new Vector3()) {\n\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);\n\t}\n\n\texpandByPoint(point) {\n\t\tthis.min.min(point);\n\t\tthis.max.max(point);\n\t\treturn this;\n\t}\n\n\texpandByVector(vector) {\n\t\tthis.min.sub(vector);\n\t\tthis.max.add(vector);\n\t\treturn this;\n\t}\n\n\texpandByScalar(scalar) {\n\t\tthis.min.addScalar(-scalar);\n\t\tthis.max.addScalar(scalar);\n\t\treturn this;\n\t} // expandByObject( object, precise = false ) {\n\t// \t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t// \t// accounting for both the object's, and children's, world transforms\n\t// \tobject.updateWorldMatrix( false, false );\n\t// \tconst geometry = object.geometry;\n\t// \tif ( geometry !== undefined ) {\n\t// \t\tif ( precise && geometry.attributes != undefined && geometry.attributes.position !== undefined ) {\n\t// \t\t\tconst position = geometry.attributes.position;\n\t// \t\t\tfor ( let i = 0, l = position.count; i < l; i ++ ) {\n\t// \t\t\t\t_vector.fromBufferAttribute( position, i ).applyMatrix4( object.matrixWorld );\n\t// \t\t\t\tthis.expandByPoint( _vector );\n\t// \t\t\t}\n\t// \t\t} else {\n\t// \t\t\tif ( geometry.boundingBox === null ) {\n\t// \t\t\t\tgeometry.computeBoundingBox();\n\t// \t\t\t}\n\t// \t\t\t_box.copy( geometry.boundingBox );\n\t// \t\t\t_box.applyMatrix4( object.matrixWorld );\n\t// \t\t\tthis.union( _box );\n\t// \t\t}\n\t// \t}\n\t// \tconst children = object.children;\n\t// \tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\t// \t\tthis.expandByObject( children[ i ], precise );\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\tcontainsPoint(point) {\n\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true;\n\t}\n\n\tcontainsBox(box) {\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;\n\t}\n\n\tgetParameter(point, target) {\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z));\n\t}\n\n\tintersectsBox(box) {\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint(sphere.center, _vector$1); // If that point is inside the sphere, the AABB and sphere intersect.\n\n\t\treturn _vector$1.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\t\tlet min, max;\n\n\t\tif (plane.normal.x > 0) {\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\t\t} else {\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\t\t}\n\n\t\tif (plane.normal.y > 0) {\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\t\t} else {\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\t\t}\n\n\t\tif (plane.normal.z > 0) {\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\t\t} else {\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\t\t}\n\n\t\treturn min <= -plane.constant && max >= -plane.constant;\n\t}\n\n\tintersectsTriangle(triangle) {\n\t\tif (this.isEmpty()) {\n\t\t\treturn false;\n\t\t} // compute box center and extents\n\n\n\t\tthis.getCenter(_center);\n\n\t\t_extents.subVectors(this.max, _center); // translate triangle to aabb origin\n\n\n\t\t_v0$1.subVectors(triangle.a, _center);\n\n\t\t_v1$3.subVectors(triangle.b, _center);\n\n\t\t_v2$1.subVectors(triangle.c, _center); // compute edge vectors for triangle\n\n\n\t\t_f0.subVectors(_v1$3, _v0$1);\n\n\t\t_f1.subVectors(_v2$1, _v1$3);\n\n\t\t_f2.subVectors(_v0$1, _v2$1); // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\n\n\t\tlet axes = [0, -_f0.z, _f0.y, 0, -_f1.z, _f1.y, 0, -_f2.z, _f2.y, _f0.z, 0, -_f0.x, _f1.z, 0, -_f1.x, _f2.z, 0, -_f2.x, -_f0.y, _f0.x, 0, -_f1.y, _f1.x, 0, -_f2.y, _f2.x, 0];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // test 3 face normals from the aabb\n\n\n\t\taxes = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\tif (!satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents)) {\n\t\t\treturn false;\n\t\t} // finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\n\n\t\t_triangleNormal.crossVectors(_f0, _f1);\n\n\t\taxes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];\n\t\treturn satForAxes(axes, _v0$1, _v1$3, _v2$1, _extents);\n\t}\n\n\tclampPoint(point, target) {\n\t\treturn target.copy(point).clamp(this.min, this.max);\n\t}\n\n\tdistanceToPoint(point) {\n\t\tconst clampedPoint = _vector$1.copy(point).clamp(this.min, this.max);\n\n\t\treturn clampedPoint.sub(point).length();\n\t}\n\n\tgetBoundingSphere(target) {\n\t\tthis.getCenter(target.center);\n\t\ttarget.radius = this.getSize(_vector$1).length() * 0.5;\n\t\treturn target;\n\t}\n\n\tintersect(box) {\n\t\tthis.min.max(box.min);\n\t\tthis.max.min(box.max); // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\n\t\tif (this.isEmpty()) this.makeEmpty();\n\t\treturn this;\n\t}\n\n\tunion(box) {\n\t\tthis.min.min(box.min);\n\t\tthis.max.max(box.max);\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\t// transform of empty box is an empty box.\n\t\tif (this.isEmpty()) return this; // NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\n\t\t_points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); // 000\n\n\n\t\t_points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); // 001\n\n\n\t\t_points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); // 010\n\n\n\t\t_points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); // 011\n\n\n\t\t_points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); // 100\n\n\n\t\t_points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); // 101\n\n\n\t\t_points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); // 110\n\n\n\t\t_points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); // 111\n\n\n\t\tthis.setFromPoints(_points);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.min.add(offset);\n\t\tthis.max.add(offset);\n\t\treturn this;\n\t}\n\n\tequals(box) {\n\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t}\n\n}\n\nconst _points = [/*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3()];\n\nconst _vector$1 = /*@__PURE__*/new Vector3();\n\nconst _box$1 = /*@__PURE__*/new Box3(); // triangle centered vertices\n\n\nconst _v0$1 = /*@__PURE__*/new Vector3();\n\nconst _v1$3 = /*@__PURE__*/new Vector3();\n\nconst _v2$1 = /*@__PURE__*/new Vector3(); // triangle edge vectors\n\n\nconst _f0 = /*@__PURE__*/new Vector3();\n\nconst _f1 = /*@__PURE__*/new Vector3();\n\nconst _f2 = /*@__PURE__*/new Vector3();\n\nconst _center = /*@__PURE__*/new Vector3();\n\nconst _extents = /*@__PURE__*/new Vector3();\n\nconst _triangleNormal = /*@__PURE__*/new Vector3();\n\nconst _testAxis = /*@__PURE__*/new Vector3();\n\nfunction satForAxes(axes, v0, v1, v2, extents) {\n\tfor (let i = 0, j = axes.length - 3; i <= j; i += 3) {\n\t\t_testAxis.fromArray(axes, i); // project the aabb onto the separating axis\n\n\n\t\tconst r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); // project all 3 vertices of the triangle onto the separating axis\n\n\t\tconst p0 = v0.dot(_testAxis);\n\t\tconst p1 = v1.dot(_testAxis);\n\t\tconst p2 = v2.dot(_testAxis); // actual test, basically see if either of the most extreme of the triangle points intersects r\n\n\t\tif (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) {\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nfunction SRGBToLinear(c) {\n\treturn c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);\n}\nfunction LinearToSRGB(c) {\n\treturn c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;\n} // JavaScript RGB-to-RGB transforms, defined as\n// FN[InputColorSpace][OutputColorSpace] callback functions.\n\nconst FN = {\n\t[SRGBColorSpace]: {\n\t\t[LinearSRGBColorSpace]: SRGBToLinear\n\t},\n\t[LinearSRGBColorSpace]: {\n\t\t[SRGBColorSpace]: LinearToSRGB\n\t}\n};\nconst ColorManagement = {\n\tlegacyMode: true,\n\n\tget workingColorSpace() {\n\t\treturn LinearSRGBColorSpace;\n\t},\n\n\tset workingColorSpace(colorSpace) {\n\t\tconsole.warn('THREE.ColorManagement: .workingColorSpace is readonly.');\n\t},\n\n\tconvert: function (color, sourceColorSpace, targetColorSpace) {\n\t\tif (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {\n\t\t\treturn color;\n\t\t}\n\n\t\tif (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== undefined) {\n\t\t\tconst fn = FN[sourceColorSpace][targetColorSpace];\n\t\t\tcolor.r = fn(color.r);\n\t\t\tcolor.g = fn(color.g);\n\t\t\tcolor.b = fn(color.b);\n\t\t\treturn color;\n\t\t}\n\n\t\tthrow new Error('Unsupported color space conversion.');\n\t},\n\tfromWorkingColorSpace: function (color, targetColorSpace) {\n\t\treturn this.convert(color, this.workingColorSpace, targetColorSpace);\n\t},\n\ttoWorkingColorSpace: function (color, sourceColorSpace) {\n\t\treturn this.convert(color, sourceColorSpace, this.workingColorSpace);\n\t}\n};\n\nconst _colorKeywords = {\n\t'aliceblue': 0xF0F8FF,\n\t'antiquewhite': 0xFAEBD7,\n\t'aqua': 0x00FFFF,\n\t'aquamarine': 0x7FFFD4,\n\t'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC,\n\t'bisque': 0xFFE4C4,\n\t'black': 0x000000,\n\t'blanchedalmond': 0xFFEBCD,\n\t'blue': 0x0000FF,\n\t'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A,\n\t'burlywood': 0xDEB887,\n\t'cadetblue': 0x5F9EA0,\n\t'chartreuse': 0x7FFF00,\n\t'chocolate': 0xD2691E,\n\t'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED,\n\t'cornsilk': 0xFFF8DC,\n\t'crimson': 0xDC143C,\n\t'cyan': 0x00FFFF,\n\t'darkblue': 0x00008B,\n\t'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B,\n\t'darkgray': 0xA9A9A9,\n\t'darkgreen': 0x006400,\n\t'darkgrey': 0xA9A9A9,\n\t'darkkhaki': 0xBDB76B,\n\t'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F,\n\t'darkorange': 0xFF8C00,\n\t'darkorchid': 0x9932CC,\n\t'darkred': 0x8B0000,\n\t'darksalmon': 0xE9967A,\n\t'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B,\n\t'darkslategray': 0x2F4F4F,\n\t'darkslategrey': 0x2F4F4F,\n\t'darkturquoise': 0x00CED1,\n\t'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493,\n\t'deepskyblue': 0x00BFFF,\n\t'dimgray': 0x696969,\n\t'dimgrey': 0x696969,\n\t'dodgerblue': 0x1E90FF,\n\t'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0,\n\t'forestgreen': 0x228B22,\n\t'fuchsia': 0xFF00FF,\n\t'gainsboro': 0xDCDCDC,\n\t'ghostwhite': 0xF8F8FF,\n\t'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520,\n\t'gray': 0x808080,\n\t'green': 0x008000,\n\t'greenyellow': 0xADFF2F,\n\t'grey': 0x808080,\n\t'honeydew': 0xF0FFF0,\n\t'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C,\n\t'indigo': 0x4B0082,\n\t'ivory': 0xFFFFF0,\n\t'khaki': 0xF0E68C,\n\t'lavender': 0xE6E6FA,\n\t'lavenderblush': 0xFFF0F5,\n\t'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD,\n\t'lightblue': 0xADD8E6,\n\t'lightcoral': 0xF08080,\n\t'lightcyan': 0xE0FFFF,\n\t'lightgoldenrodyellow': 0xFAFAD2,\n\t'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90,\n\t'lightgrey': 0xD3D3D3,\n\t'lightpink': 0xFFB6C1,\n\t'lightsalmon': 0xFFA07A,\n\t'lightseagreen': 0x20B2AA,\n\t'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899,\n\t'lightslategrey': 0x778899,\n\t'lightsteelblue': 0xB0C4DE,\n\t'lightyellow': 0xFFFFE0,\n\t'lime': 0x00FF00,\n\t'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6,\n\t'magenta': 0xFF00FF,\n\t'maroon': 0x800000,\n\t'mediumaquamarine': 0x66CDAA,\n\t'mediumblue': 0x0000CD,\n\t'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB,\n\t'mediumseagreen': 0x3CB371,\n\t'mediumslateblue': 0x7B68EE,\n\t'mediumspringgreen': 0x00FA9A,\n\t'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585,\n\t'midnightblue': 0x191970,\n\t'mintcream': 0xF5FFFA,\n\t'mistyrose': 0xFFE4E1,\n\t'moccasin': 0xFFE4B5,\n\t'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080,\n\t'oldlace': 0xFDF5E6,\n\t'olive': 0x808000,\n\t'olivedrab': 0x6B8E23,\n\t'orange': 0xFFA500,\n\t'orangered': 0xFF4500,\n\t'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA,\n\t'palegreen': 0x98FB98,\n\t'paleturquoise': 0xAFEEEE,\n\t'palevioletred': 0xDB7093,\n\t'papayawhip': 0xFFEFD5,\n\t'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F,\n\t'pink': 0xFFC0CB,\n\t'plum': 0xDDA0DD,\n\t'powderblue': 0xB0E0E6,\n\t'purple': 0x800080,\n\t'rebeccapurple': 0x663399,\n\t'red': 0xFF0000,\n\t'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1,\n\t'saddlebrown': 0x8B4513,\n\t'salmon': 0xFA8072,\n\t'sandybrown': 0xF4A460,\n\t'seagreen': 0x2E8B57,\n\t'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D,\n\t'silver': 0xC0C0C0,\n\t'skyblue': 0x87CEEB,\n\t'slateblue': 0x6A5ACD,\n\t'slategray': 0x708090,\n\t'slategrey': 0x708090,\n\t'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F,\n\t'steelblue': 0x4682B4,\n\t'tan': 0xD2B48C,\n\t'teal': 0x008080,\n\t'thistle': 0xD8BFD8,\n\t'tomato': 0xFF6347,\n\t'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE,\n\t'wheat': 0xF5DEB3,\n\t'white': 0xFFFFFF,\n\t'whitesmoke': 0xF5F5F5,\n\t'yellow': 0xFFFF00,\n\t'yellowgreen': 0x9ACD32\n};\nconst _rgb = {\n\tr: 0,\n\tg: 0,\n\tb: 0\n};\nconst _hslA = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\nconst _hslB = {\n\th: 0,\n\ts: 0,\n\tl: 0\n};\n\nfunction hue2rgb(p, q, t) {\n\tif (t < 0) t += 1;\n\tif (t > 1) t -= 1;\n\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\tif (t < 1 / 2) return q;\n\tif (t < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t);\n\treturn p;\n}\n\nfunction toComponents(source, target) {\n\ttarget.r = source.r;\n\ttarget.g = source.g;\n\ttarget.b = source.b;\n\treturn target;\n}\n\nclass Color {\n\tconstructor(r, g, b) {\n\t\tthis.isColor = true;\n\t\tthis.r = 1;\n\t\tthis.g = 1;\n\t\tthis.b = 1;\n\n\t\tif (g === undefined && b === undefined) {\n\t\t\t// r is THREE.Color, hex or string\n\t\t\treturn this.set(r);\n\t\t}\n\n\t\treturn this.setRGB(r, g, b);\n\t}\n\n\tset(value) {\n\t\tif (value && value.isColor) {\n\t\t\tthis.copy(value);\n\t\t} else if (typeof value === 'number') {\n\t\t\tthis.setHex(value);\n\t\t} else if (typeof value === 'string') {\n\t\t\tthis.setStyle(value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\t\treturn this;\n\t}\n\n\tsetHex(hex, colorSpace = SRGBColorSpace) {\n\t\thex = Math.floor(hex);\n\t\tthis.r = (hex >> 16 & 255) / 255;\n\t\tthis.g = (hex >> 8 & 255) / 255;\n\t\tthis.b = (hex & 255) / 255;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetRGB(r, g, b, colorSpace = ColorManagement.workingColorSpace) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetHSL(h, s, l, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo(h, 1);\n\t\ts = clamp(s, 0, 1);\n\t\tl = clamp(l, 0, 1);\n\n\t\tif (s === 0) {\n\t\t\tthis.r = this.g = this.b = l;\n\t\t} else {\n\t\t\tconst p = l <= 0.5 ? l * (1 + s) : l + s - l * s;\n\t\t\tconst q = 2 * l - p;\n\t\t\tthis.r = hue2rgb(q, p, h + 1 / 3);\n\t\t\tthis.g = hue2rgb(q, p, h);\n\t\t\tthis.b = hue2rgb(q, p, h - 1 / 3);\n\t\t}\n\n\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\treturn this;\n\t}\n\n\tsetStyle(style, colorSpace = SRGBColorSpace) {\n\t\tfunction handleAlpha(string) {\n\t\t\tif (string === undefined) return;\n\n\t\t\tif (parseFloat(string) < 1) {\n\t\t\t\tconsole.warn('THREE.Color: Alpha component of ' + style + ' will be ignored.');\n\t\t\t}\n\t\t}\n\n\t\tlet m;\n\n\t\tif (m = /^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(style)) {\n\t\t\t// rgb / hsl\n\t\t\tlet color;\n\t\t\tconst name = m[1];\n\t\t\tconst components = m[2];\n\n\t\t\tswitch (name) {\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\tthis.r = Math.min(255, parseInt(color[1], 10)) / 255;\n\t\t\t\t\t\tthis.g = Math.min(255, parseInt(color[2], 10)) / 255;\n\t\t\t\t\t\tthis.b = Math.min(255, parseInt(color[3], 10)) / 255;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\tthis.r = Math.min(100, parseInt(color[1], 10)) / 100;\n\t\t\t\t\t\tthis.g = Math.min(100, parseInt(color[2], 10)) / 100;\n\t\t\t\t\t\tthis.b = Math.min(100, parseInt(color[3], 10)) / 100;\n\t\t\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\t\t\t\t\tif (color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\tconst h = parseFloat(color[1]) / 360;\n\t\t\t\t\t\tconst s = parseFloat(color[2]) / 100;\n\t\t\t\t\t\tconst l = parseFloat(color[3]) / 100;\n\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\treturn this.setHSL(h, s, l, colorSpace);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (m = /^\\#([A-Fa-f\\d]+)$/.exec(style)) {\n\t\t\t// hex color\n\t\t\tconst hex = m[1];\n\t\t\tconst size = hex.length;\n\n\t\t\tif (size === 3) {\n\t\t\t\t// #ff0\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t} else if (size === 6) {\n\t\t\t\t// #ff0000\n\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;\n\t\t\t\tthis.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;\n\t\t\t\tthis.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;\n\t\t\t\tColorManagement.toWorkingColorSpace(this, colorSpace);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tif (style && style.length > 0) {\n\t\t\treturn this.setColorName(style, colorSpace);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetColorName(style, colorSpace = SRGBColorSpace) {\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[style.toLowerCase()];\n\n\t\tif (hex !== undefined) {\n\t\t\t// red\n\t\t\tthis.setHex(hex, colorSpace);\n\t\t} else {\n\t\t\t// unknown color\n\t\t\tconsole.warn('THREE.Color: Unknown color ' + style);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.r, this.g, this.b);\n\t}\n\n\tcopy(color) {\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\t\treturn this;\n\t}\n\n\tcopySRGBToLinear(color) {\n\t\tthis.r = SRGBToLinear(color.r);\n\t\tthis.g = SRGBToLinear(color.g);\n\t\tthis.b = SRGBToLinear(color.b);\n\t\treturn this;\n\t}\n\n\tcopyLinearToSRGB(color) {\n\t\tthis.r = LinearToSRGB(color.r);\n\t\tthis.g = LinearToSRGB(color.g);\n\t\tthis.b = LinearToSRGB(color.b);\n\t\treturn this;\n\t}\n\n\tconvertSRGBToLinear() {\n\t\tthis.copySRGBToLinear(this);\n\t\treturn this;\n\t}\n\n\tconvertLinearToSRGB() {\n\t\tthis.copyLinearToSRGB(this);\n\t\treturn this;\n\t}\n\n\tgetHex(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\treturn clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0;\n\t}\n\n\tgetHexString(colorSpace = SRGBColorSpace) {\n\t\treturn ('000000' + this.getHex(colorSpace).toString(16)).slice(-6);\n\t}\n\n\tgetHSL(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\tconst r = _rgb.r,\n\t\t\t\t\tg = _rgb.g,\n\t\t\t\t\tb = _rgb.b;\n\t\tconst max = Math.max(r, g, b);\n\t\tconst min = Math.min(r, g, b);\n\t\tlet hue, saturation;\n\t\tconst lightness = (min + max) / 2.0;\n\n\t\tif (min === max) {\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\t\t} else {\n\t\t\tconst delta = max - min;\n\t\t\tsaturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\n\n\t\t\tswitch (max) {\n\t\t\t\tcase r:\n\t\t\t\t\thue = (g - b) / delta + (g < b ? 6 : 0);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase g:\n\t\t\t\t\thue = (b - r) / delta + 2;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase b:\n\t\t\t\t\thue = (r - g) / delta + 4;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\thue /= 6;\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\t\treturn target;\n\t}\n\n\tgetRGB(target, colorSpace = ColorManagement.workingColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\t\ttarget.r = _rgb.r;\n\t\ttarget.g = _rgb.g;\n\t\ttarget.b = _rgb.b;\n\t\treturn target;\n\t}\n\n\tgetStyle(colorSpace = SRGBColorSpace) {\n\t\tColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);\n\n\t\tif (colorSpace !== SRGBColorSpace) {\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;\n\t\t}\n\n\t\treturn `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`;\n\t}\n\n\toffsetHSL(h, s, l) {\n\t\tthis.getHSL(_hslA);\n\t\t_hslA.h += h;\n\t\t_hslA.s += s;\n\t\t_hslA.l += l;\n\t\tthis.setHSL(_hslA.h, _hslA.s, _hslA.l);\n\t\treturn this;\n\t}\n\n\tadd(color) {\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\t\treturn this;\n\t}\n\n\taddColors(color1, color2) {\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\t\treturn this;\n\t}\n\n\tsub(color) {\n\t\tthis.r = Math.max(0, this.r - color.r);\n\t\tthis.g = Math.max(0, this.g - color.g);\n\t\tthis.b = Math.max(0, this.b - color.b);\n\t\treturn this;\n\t}\n\n\tmultiply(color) {\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\t\treturn this;\n\t}\n\n\tlerp(color, alpha) {\n\t\tthis.r += (color.r - this.r) * alpha;\n\t\tthis.g += (color.g - this.g) * alpha;\n\t\tthis.b += (color.b - this.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpColors(color1, color2, alpha) {\n\t\tthis.r = color1.r + (color2.r - color1.r) * alpha;\n\t\tthis.g = color1.g + (color2.g - color1.g) * alpha;\n\t\tthis.b = color1.b + (color2.b - color1.b) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpHSL(color, alpha) {\n\t\tthis.getHSL(_hslA);\n\t\tcolor.getHSL(_hslB);\n\t\tconst h = lerp(_hslA.h, _hslB.h, alpha);\n\t\tconst s = lerp(_hslA.s, _hslB.s, alpha);\n\t\tconst l = lerp(_hslA.l, _hslB.l, alpha);\n\t\tthis.setHSL(h, s, l);\n\t\treturn this;\n\t}\n\n\tequals(c) {\n\t\treturn c.r === this.r && c.g === this.g && c.b === this.b;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.r = array[offset];\n\t\tthis.g = array[offset + 1];\n\t\tthis.b = array[offset + 2];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.r;\n\t\tarray[offset + 1] = this.g;\n\t\tarray[offset + 2] = this.b;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.r = attribute.getX( index );\n\t// \tthis.g = attribute.getY( index );\n\t// \tthis.b = attribute.getZ( index );\n\t// \tif ( attribute.normalized === true ) {\n\t// \t\t// assuming Uint8Array\n\t// \t\tthis.r /= 255;\n\t// \t\tthis.g /= 255;\n\t// \t\tthis.b /= 255;\n\t// \t}\n\t// \treturn this;\n\t// }\n\n\n\ttoJSON() {\n\t\treturn this.getHex();\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\t}\n\n}\n\nColor.NAMES = _colorKeywords;\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\r\n */\nclass Cylindrical {\n\tconstructor(radius = 1, theta = 0, y = 0) {\n\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\n\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\n\t\tthis.y = y; // height above the x-z plane\n\n\t\treturn this;\n\t}\n\n\tset(radius, theta, y) {\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + z * z);\n\t\tthis.theta = Math.atan2(x, z);\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix4 {\n\tconstructor() {\n\t\tMatrix4.prototype.isMatrix4 = true;\n\t\tthis.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[4] = n12;\n\t\tte[8] = n13;\n\t\tte[12] = n14;\n\t\tte[1] = n21;\n\t\tte[5] = n22;\n\t\tte[9] = n23;\n\t\tte[13] = n24;\n\t\tte[2] = n31;\n\t\tte[6] = n32;\n\t\tte[10] = n33;\n\t\tte[14] = n34;\n\t\tte[3] = n41;\n\t\tte[7] = n42;\n\t\tte[11] = n43;\n\t\tte[15] = n44;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Matrix4().fromArray(this.elements);\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\tte[9] = me[9];\n\t\tte[10] = me[10];\n\t\tte[11] = me[11];\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\tte[15] = me[15];\n\t\treturn this;\n\t}\n\n\tcopyPosition(m) {\n\t\tconst te = this.elements,\n\t\t\t\t\tme = m.elements;\n\t\tte[12] = me[12];\n\t\tte[13] = me[13];\n\t\tte[14] = me[14];\n\t\treturn this;\n\t}\n\n\tsetFromMatrix3(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[3], me[6], 0, me[1], me[4], me[7], 0, me[2], me[5], me[8], 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrixColumn(this, 0);\n\t\tyAxis.setFromMatrixColumn(this, 1);\n\t\tzAxis.setFromMatrixColumn(this, 2);\n\t\treturn this;\n\t}\n\n\tmakeBasis(xAxis, yAxis, zAxis) {\n\t\tthis.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\textractRotation(m) {\n\t\t// this method does not support reflection matrices\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$2.setFromMatrixColumn(m, 0).length();\n\n\t\tconst scaleY = 1 / _v1$2.setFromMatrixColumn(m, 1).length();\n\n\t\tconst scaleZ = 1 / _v1$2.setFromMatrixColumn(m, 2).length();\n\n\t\tte[0] = me[0] * scaleX;\n\t\tte[1] = me[1] * scaleX;\n\t\tte[2] = me[2] * scaleX;\n\t\tte[3] = 0;\n\t\tte[4] = me[4] * scaleY;\n\t\tte[5] = me[5] * scaleY;\n\t\tte[6] = me[6] * scaleY;\n\t\tte[7] = 0;\n\t\tte[8] = me[8] * scaleZ;\n\t\tte[9] = me[9] * scaleZ;\n\t\tte[10] = me[10] * scaleZ;\n\t\tte[11] = 0;\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromEuler(euler) {\n\t\tconst te = this.elements;\n\t\tconst x = euler.x,\n\t\t\t\t\ty = euler.y,\n\t\t\t\t\tz = euler.z;\n\t\tconst a = Math.cos(x),\n\t\t\t\t\tb = Math.sin(x);\n\t\tconst c = Math.cos(y),\n\t\t\t\t\td = Math.sin(y);\n\t\tconst e = Math.cos(z),\n\t\t\t\t\tf = Math.sin(z);\n\n\t\tif (euler.order === 'XYZ') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -c * f;\n\t\t\tte[8] = d;\n\t\t\tte[1] = af + be * d;\n\t\t\tte[5] = ae - bf * d;\n\t\t\tte[9] = -b * c;\n\t\t\tte[2] = bf - ae * d;\n\t\t\tte[6] = be + af * d;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YXZ') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce + df * b;\n\t\t\tte[4] = de * b - cf;\n\t\t\tte[8] = a * d;\n\t\t\tte[1] = a * f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b;\n\t\t\tte[2] = cf * b - de;\n\t\t\tte[6] = df + ce * b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZXY') {\n\t\t\tconst ce = c * e,\n\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\tdf = d * f;\n\t\t\tte[0] = ce - df * b;\n\t\t\tte[4] = -a * f;\n\t\t\tte[8] = de + cf * b;\n\t\t\tte[1] = cf + de * b;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = df - ce * b;\n\t\t\tte[2] = -a * d;\n\t\t\tte[6] = b;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'ZYX') {\n\t\t\tconst ae = a * e,\n\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\tbf = b * f;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = be * d - af;\n\t\t\tte[8] = ae * d + bf;\n\t\t\tte[1] = c * f;\n\t\t\tte[5] = bf * d + ae;\n\t\t\tte[9] = af * d - be;\n\t\t\tte[2] = -d;\n\t\t\tte[6] = b * c;\n\t\t\tte[10] = a * c;\n\t\t} else if (euler.order === 'YZX') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = bd - ac * f;\n\t\t\tte[8] = bc * f + ad;\n\t\t\tte[1] = f;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = -b * e;\n\t\t\tte[2] = -d * e;\n\t\t\tte[6] = ad * f + bc;\n\t\t\tte[10] = ac - bd * f;\n\t\t} else if (euler.order === 'XZY') {\n\t\t\tconst ac = a * c,\n\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\tbd = b * d;\n\t\t\tte[0] = c * e;\n\t\t\tte[4] = -f;\n\t\t\tte[8] = d * e;\n\t\t\tte[1] = ac * f + bd;\n\t\t\tte[5] = a * e;\n\t\t\tte[9] = ad * f - bc;\n\t\t\tte[2] = bc * f - ad;\n\t\t\tte[6] = b * e;\n\t\t\tte[10] = bd * f + ac;\n\t\t} // bottom row\n\n\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0; // last column\n\n\t\tte[12] = 0;\n\t\tte[13] = 0;\n\t\tte[14] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tmakeRotationFromQuaternion(q) {\n\t\treturn this.compose(_zero, q, _one);\n\t}\n\n\tlookAt(eye, target, up) {\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors(eye, target);\n\n\t\tif (_z.lengthSq() === 0) {\n\t\t\t// eye and target are in the same position\n\t\t\t_z.z = 1;\n\t\t}\n\n\t\t_z.normalize();\n\n\t\t_x.crossVectors(up, _z);\n\n\t\tif (_x.lengthSq() === 0) {\n\t\t\t// up and z are parallel\n\t\t\tif (Math.abs(up.z) === 1) {\n\t\t\t\t_z.x += 0.0001;\n\t\t\t} else {\n\t\t\t\t_z.z += 0.0001;\n\t\t\t}\n\n\t\t\t_z.normalize();\n\n\t\t\t_x.crossVectors(up, _z);\n\t\t}\n\n\t\t_x.normalize();\n\n\t\t_y.crossVectors(_z, _x);\n\n\t\tte[0] = _x.x;\n\t\tte[4] = _y.x;\n\t\tte[8] = _z.x;\n\t\tte[1] = _x.y;\n\t\tte[5] = _y.y;\n\t\tte[9] = _z.y;\n\t\tte[2] = _x.z;\n\t\tte[6] = _y.z;\n\t\tte[10] = _z.z;\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[4],\n\t\t\t\t\ta13 = ae[8],\n\t\t\t\t\ta14 = ae[12];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[5],\n\t\t\t\t\ta23 = ae[9],\n\t\t\t\t\ta24 = ae[13];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[6],\n\t\t\t\t\ta33 = ae[10],\n\t\t\t\t\ta34 = ae[14];\n\t\tconst a41 = ae[3],\n\t\t\t\t\ta42 = ae[7],\n\t\t\t\t\ta43 = ae[11],\n\t\t\t\t\ta44 = ae[15];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[4],\n\t\t\t\t\tb13 = be[8],\n\t\t\t\t\tb14 = be[12];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[5],\n\t\t\t\t\tb23 = be[9],\n\t\t\t\t\tb24 = be[13];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[6],\n\t\t\t\t\tb33 = be[10],\n\t\t\t\t\tb34 = be[14];\n\t\tconst b41 = be[3],\n\t\t\t\t\tb42 = be[7],\n\t\t\t\t\tb43 = be[11],\n\t\t\t\t\tb44 = be[15];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\t\tte[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[4] *= s;\n\t\tte[8] *= s;\n\t\tte[12] *= s;\n\t\tte[1] *= s;\n\t\tte[5] *= s;\n\t\tte[9] *= s;\n\t\tte[13] *= s;\n\t\tte[2] *= s;\n\t\tte[6] *= s;\n\t\tte[10] *= s;\n\t\tte[14] *= s;\n\t\tte[3] *= s;\n\t\tte[7] *= s;\n\t\tte[11] *= s;\n\t\tte[15] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst n11 = te[0],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn14 = te[12];\n\t\tconst n21 = te[1],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn24 = te[13];\n\t\tconst n31 = te[2],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn34 = te[14];\n\t\tconst n41 = te[3],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn44 = te[15]; //TODO: make this more efficient\n\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\treturn n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);\n\t}\n\n\ttranspose() {\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\t\ttmp = te[1];\n\t\tte[1] = te[4];\n\t\tte[4] = tmp;\n\t\ttmp = te[2];\n\t\tte[2] = te[8];\n\t\tte[8] = tmp;\n\t\ttmp = te[6];\n\t\tte[6] = te[9];\n\t\tte[9] = tmp;\n\t\ttmp = te[3];\n\t\tte[3] = te[12];\n\t\tte[12] = tmp;\n\t\ttmp = te[7];\n\t\tte[7] = te[13];\n\t\tte[13] = tmp;\n\t\ttmp = te[11];\n\t\tte[11] = te[14];\n\t\tte[14] = tmp;\n\t\treturn this;\n\t}\n\n\tsetPosition(x, y, z) {\n\t\tconst te = this.elements;\n\n\t\tif (x.isVector3) {\n\t\t\tte[12] = x.x;\n\t\t\tte[13] = x.y;\n\t\t\tte[14] = x.z;\n\t\t} else {\n\t\t\tte[12] = x;\n\t\t\tte[13] = y;\n\t\t\tte[14] = z;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tinvert() {\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn41 = te[3],\n\t\t\t\t\tn12 = te[4],\n\t\t\t\t\tn22 = te[5],\n\t\t\t\t\tn32 = te[6],\n\t\t\t\t\tn42 = te[7],\n\t\t\t\t\tn13 = te[8],\n\t\t\t\t\tn23 = te[9],\n\t\t\t\t\tn33 = te[10],\n\t\t\t\t\tn43 = te[11],\n\t\t\t\t\tn14 = te[12],\n\t\t\t\t\tn24 = te[13],\n\t\t\t\t\tn34 = te[14],\n\t\t\t\t\tn44 = te[15],\n\t\t\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;\n\t\tte[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;\n\t\tte[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;\n\t\tte[4] = t12 * detInv;\n\t\tte[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;\n\t\tte[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;\n\t\tte[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;\n\t\tte[8] = t13 * detInv;\n\t\tte[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;\n\t\tte[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;\n\t\tte[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;\n\t\tte[12] = t14 * detInv;\n\t\tte[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;\n\t\tte[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;\n\t\tte[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;\n\t\treturn this;\n\t}\n\n\tscale(v) {\n\t\tconst te = this.elements;\n\t\tconst x = v.x,\n\t\t\t\t\ty = v.y,\n\t\t\t\t\tz = v.z;\n\t\tte[0] *= x;\n\t\tte[4] *= y;\n\t\tte[8] *= z;\n\t\tte[1] *= x;\n\t\tte[5] *= y;\n\t\tte[9] *= z;\n\t\tte[2] *= x;\n\t\tte[6] *= y;\n\t\tte[10] *= z;\n\t\tte[3] *= x;\n\t\tte[7] *= y;\n\t\tte[11] *= z;\n\t\treturn this;\n\t}\n\n\tgetMaxScaleOnAxis() {\n\t\tconst te = this.elements;\n\t\tconst scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];\n\t\tconst scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];\n\t\tconst scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];\n\t\treturn Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));\n\t}\n\n\tmakeTranslation(x, y, z) {\n\t\tthis.set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationX(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationY(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationZ(theta) {\n\t\tconst c = Math.cos(theta),\n\t\t\t\t\ts = Math.sin(theta);\n\t\tthis.set(c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotationAxis(axis, angle) {\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\t\tconst c = Math.cos(angle);\n\t\tconst s = Math.sin(angle);\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x,\n\t\t\t\t\ty = axis.y,\n\t\t\t\t\tz = axis.z;\n\t\tconst tx = t * x,\n\t\t\t\t\tty = t * y;\n\t\tthis.set(tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y, z) {\n\t\tthis.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeShear(xy, xz, yx, yz, zx, zy) {\n\t\tthis.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\t\tconst x = quaternion._x,\n\t\t\t\t\ty = quaternion._y,\n\t\t\t\t\tz = quaternion._z,\n\t\t\t\t\tw = quaternion._w;\n\t\tconst x2 = x + x,\n\t\t\t\t\ty2 = y + y,\n\t\t\t\t\tz2 = z + z;\n\t\tconst xx = x * x2,\n\t\t\t\t\txy = x * y2,\n\t\t\t\t\txz = x * z2;\n\t\tconst yy = y * y2,\n\t\t\t\t\tyz = y * z2,\n\t\t\t\t\tzz = z * z2;\n\t\tconst wx = w * x2,\n\t\t\t\t\twy = w * y2,\n\t\t\t\t\twz = w * z2;\n\t\tconst sx = scale.x,\n\t\t\t\t\tsy = scale.y,\n\t\t\t\t\tsz = scale.z;\n\t\tte[0] = (1 - (yy + zz)) * sx;\n\t\tte[1] = (xy + wz) * sx;\n\t\tte[2] = (xz - wy) * sx;\n\t\tte[3] = 0;\n\t\tte[4] = (xy - wz) * sy;\n\t\tte[5] = (1 - (xx + zz)) * sy;\n\t\tte[6] = (yz + wx) * sy;\n\t\tte[7] = 0;\n\t\tte[8] = (xz + wy) * sz;\n\t\tte[9] = (yz - wx) * sz;\n\t\tte[10] = (1 - (xx + yy)) * sz;\n\t\tte[11] = 0;\n\t\tte[12] = position.x;\n\t\tte[13] = position.y;\n\t\tte[14] = position.z;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tdecompose(position, quaternion, scale) {\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$2.set(te[0], te[1], te[2]).length();\n\n\t\tconst sy = _v1$2.set(te[4], te[5], te[6]).length();\n\n\t\tconst sz = _v1$2.set(te[8], te[9], te[10]).length(); // if determine is negative, we need to invert one scale\n\n\n\t\tconst det = this.determinant();\n\t\tif (det < 0) sx = -sx;\n\t\tposition.x = te[12];\n\t\tposition.y = te[13];\n\t\tposition.z = te[14]; // scale the rotation part\n\n\t\t_m1.copy(this);\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\t\t_m1.elements[0] *= invSX;\n\t\t_m1.elements[1] *= invSX;\n\t\t_m1.elements[2] *= invSX;\n\t\t_m1.elements[4] *= invSY;\n\t\t_m1.elements[5] *= invSY;\n\t\t_m1.elements[6] *= invSY;\n\t\t_m1.elements[8] *= invSZ;\n\t\t_m1.elements[9] *= invSZ;\n\t\t_m1.elements[10] *= invSZ;\n\t\tquaternion.setFromRotationMatrix(_m1);\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\t\treturn this;\n\t}\n\n\tmakePerspective(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst x = 2 * near / (right - left);\n\t\tconst y = 2 * near / (top - bottom);\n\t\tconst a = (right + left) / (right - left);\n\t\tconst b = (top + bottom) / (top - bottom);\n\t\tconst c = -(far + near) / (far - near);\n\t\tconst d = -2 * far * near / (far - near);\n\t\tte[0] = x;\n\t\tte[4] = 0;\n\t\tte[8] = a;\n\t\tte[12] = 0;\n\t\tte[1] = 0;\n\t\tte[5] = y;\n\t\tte[9] = b;\n\t\tte[13] = 0;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = c;\n\t\tte[14] = d;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = -1;\n\t\tte[15] = 0;\n\t\treturn this;\n\t}\n\n\tmakeOrthographic(left, right, top, bottom, near, far) {\n\t\tconst te = this.elements;\n\t\tconst w = 1.0 / (right - left);\n\t\tconst h = 1.0 / (top - bottom);\n\t\tconst p = 1.0 / (far - near);\n\t\tconst x = (right + left) * w;\n\t\tconst y = (top + bottom) * h;\n\t\tconst z = (far + near) * p;\n\t\tte[0] = 2 * w;\n\t\tte[4] = 0;\n\t\tte[8] = 0;\n\t\tte[12] = -x;\n\t\tte[1] = 0;\n\t\tte[5] = 2 * h;\n\t\tte[9] = 0;\n\t\tte[13] = -y;\n\t\tte[2] = 0;\n\t\tte[6] = 0;\n\t\tte[10] = -2 * p;\n\t\tte[14] = -z;\n\t\tte[3] = 0;\n\t\tte[7] = 0;\n\t\tte[11] = 0;\n\t\tte[15] = 1;\n\t\treturn this;\n\t}\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 16; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\tarray[offset + 9] = te[9];\n\t\tarray[offset + 10] = te[10];\n\t\tarray[offset + 11] = te[11];\n\t\tarray[offset + 12] = te[12];\n\t\tarray[offset + 13] = te[13];\n\t\tarray[offset + 14] = te[14];\n\t\tarray[offset + 15] = te[15];\n\t\treturn array;\n\t}\n\n}\n\nconst _v1$2 = /*@__PURE__*/new Vector3();\n\nconst _m1 = /*@__PURE__*/new Matrix4();\n\nconst _zero = /*@__PURE__*/new Vector3(0, 0, 0);\n\nconst _one = /*@__PURE__*/new Vector3(1, 1, 1);\n\nconst _x = /*@__PURE__*/new Vector3();\n\nconst _y = /*@__PURE__*/new Vector3();\n\nconst _z = /*@__PURE__*/new Vector3();\n\nconst _matrix = /*@__PURE__*/new Matrix4();\n\nconst _quaternion = /*@__PURE__*/new Quaternion();\n\nclass Euler {\n\tconstructor(x = 0, y = 0, z = 0, order = Euler.DefaultOrder) {\n\t\tthis.isEuler = true;\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\t}\n\n\tget x() {\n\t\treturn this._x;\n\t}\n\n\tset x(value) {\n\t\tthis._x = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget y() {\n\t\treturn this._y;\n\t}\n\n\tset y(value) {\n\t\tthis._y = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget z() {\n\t\treturn this._z;\n\t}\n\n\tset z(value) {\n\t\tthis._z = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tget order() {\n\t\treturn this._order;\n\t}\n\n\tset order(value) {\n\t\tthis._order = value;\n\n\t\tthis._onChangeCallback();\n\t}\n\n\tset(x, y, z, order = this._order) {\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this._x, this._y, this._z, this._order);\n\t}\n\n\tcopy(euler) {\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\tsetFromRotationMatrix(m, order = this._order, update = true) {\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tconst te = m.elements;\n\t\tconst m11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8];\n\t\tconst m21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9];\n\t\tconst m31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tswitch (order) {\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._y = Math.asin(clamp(m13, -1, 1));\n\n\t\t\t\tif (Math.abs(m13) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = Math.asin(-clamp(m23, -1, 1));\n\n\t\t\t\tif (Math.abs(m23) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = Math.asin(clamp(m32, -1, 1));\n\n\t\t\t\tif (Math.abs(m32) < 0.9999999) {\n\t\t\t\t\tthis._y = Math.atan2(-m31, m33);\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t} else {\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._y = Math.asin(-clamp(m31, -1, 1));\n\n\t\t\t\tif (Math.abs(m31) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m33);\n\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._z = Math.asin(clamp(m21, -1, 1));\n\n\t\t\t\tif (Math.abs(m21) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m22);\n\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._z = Math.asin(-clamp(m12, -1, 1));\n\n\t\t\t\tif (Math.abs(m12) < 0.9999999) {\n\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\tthis._y = Math.atan2(m13, m11);\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order);\n\t\t}\n\n\t\tthis._order = order;\n\t\tif (update === true) this._onChangeCallback();\n\t\treturn this;\n\t}\n\n\tsetFromQuaternion(q, order, update) {\n\t\t_matrix.makeRotationFromQuaternion(q);\n\n\t\treturn this.setFromRotationMatrix(_matrix, order, update);\n\t}\n\n\tsetFromVector3(v, order = this._order) {\n\t\treturn this.set(v.x, v.y, v.z, order);\n\t}\n\n\treorder(newOrder) {\n\t\t// WARNING: this discards revolution information -bhouston\n\t\t_quaternion.setFromEuler(this);\n\n\t\treturn this.setFromQuaternion(_quaternion, newOrder);\n\t}\n\n\tequals(euler) {\n\t\treturn euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;\n\t}\n\n\tfromArray(array) {\n\t\tthis._x = array[0];\n\t\tthis._y = array[1];\n\t\tthis._z = array[2];\n\t\tif (array[3] !== undefined) this._order = array[3];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this._x;\n\t\tarray[offset + 1] = this._y;\n\t\tarray[offset + 2] = this._z;\n\t\tarray[offset + 3] = this._order;\n\t\treturn array;\n\t}\n\n\t_onChange(callback) {\n\t\tthis._onChangeCallback = callback;\n\t\treturn this;\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[Symbol.iterator]() {\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\t} // @deprecated since r138, 02cf0df1cb4575d5842fef9c85bb5a89fe020d53\n\n\n\ttoVector3() {\n\t\tconsole.error('THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead');\n\t}\n\n}\n\nEuler.DefaultOrder = 'XYZ';\nEuler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX'];\n\n/**\r\n * Abstract base class of interpolants over parametric samples.\r\n *\r\n * The parameter domain is one dimensional, typically the time or a path\r\n * along a curve defined by the data.\r\n *\r\n * The sample values can have any dimensionality and derived classes may\r\n * apply special interpretations to the data.\r\n *\r\n * This class provides the interval seek in a Template Method, deferring\r\n * the actual interpolation to derived classes.\r\n *\r\n * Time complexity is O(1) for linear access crossing at most two points\r\n * and O(log N) for random access, where N is the number of positions.\r\n *\r\n * References:\r\n *\r\n * \t\thttp://www.oodesign.com/template-method-pattern.html\r\n *\r\n */\nclass Interpolant {\n\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\tthis.parameterPositions = parameterPositions;\n\t\tthis._cachedIndex = 0;\n\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor(sampleSize);\n\t\tthis.sampleValues = sampleValues;\n\t\tthis.valueSize = sampleSize;\n\t\tthis.settings = null;\n\t\tthis.DefaultSettings_ = {};\n\t}\n\n\tevaluate(t) {\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\t\tt1 = pp[i1],\n\t\t\t\tt0 = pp[i1 - 1];\n\n\t\tvalidate_interval: {\n\t\t\tseek: {\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if (!(t < t1)) {\n\t\t\t\t\t\tfor (let giveUpAt = i1 + 2;;) {\n\t\t\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\t\t\tif (t < t0) break forward_scan; // after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[++i1];\n\n\t\t\t\t\t\t\tif (t < t1) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the right side of the index\n\n\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} //- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\n\n\t\t\t\t\tif (!(t >= t0)) {\n\t\t\t\t\t\t// looping?\n\t\t\t\t\t\tconst t1global = pp[1];\n\n\t\t\t\t\t\tif (t < t1global) {\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\n\t\t\t\t\t\t\tt0 = t1global;\n\t\t\t\t\t\t} // linear reverse scan\n\n\n\t\t\t\t\t\tfor (let giveUpAt = i1 - 2;;) {\n\t\t\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\t\t\t// before start\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[--i1 - 1];\n\n\t\t\t\t\t\t\tif (t >= t0) {\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // prepare binary search on the left side of the index\n\n\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t} // the interval is valid\n\n\n\t\t\t\t\tbreak validate_interval;\n\t\t\t\t} // linear scan\n\t\t\t\t// binary search\n\n\n\t\t\t\twhile (i1 < right) {\n\t\t\t\t\tconst mid = i1 + right >>> 1;\n\n\t\t\t\t\tif (t < pp[mid]) {\n\t\t\t\t\t\tright = mid;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti1 = mid + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[i1];\n\t\t\t\tt0 = pp[i1 - 1]; // check boundary cases, again\n\n\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_(0);\n\t\t\t\t}\n\n\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t\t\t}\n\t\t\t} // seek\n\n\n\t\t\tthis._cachedIndex = i1;\n\t\t\tthis.intervalChanged_(i1, t0, t1);\n\t\t} // validate_interval\n\n\n\t\treturn this.interpolate_(i1, t0, t, t1);\n\t}\n\n\tgetSettings_() {\n\t\treturn this.settings || this.DefaultSettings_;\n\t}\n\n\tcopySampleValue_(index) {\n\t\t// copies a sample value to the result buffer\n\t\tconst result = this.resultBuffer,\n\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\toffset = index * stride;\n\n\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\tresult[i] = values[offset + i];\n\t\t}\n\n\t\treturn result;\n\t} // Template methods for derived classes:\n\n\n\tinterpolate_() {\n\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t}\n\n\tintervalChanged_() {// empty\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/new Vector3();\n\nconst _startEnd = /*@__PURE__*/new Vector3();\n\nclass Line3 {\n\tconstructor(start = new Vector3(), end = new Vector3()) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t}\n\n\tset(start, end) {\n\t\tthis.start.copy(start);\n\t\tthis.end.copy(end);\n\t\treturn this;\n\t}\n\n\tcopy(line) {\n\t\tthis.start.copy(line.start);\n\t\tthis.end.copy(line.end);\n\t\treturn this;\n\t}\n\n\tgetCenter(target) {\n\t\treturn target.addVectors(this.start, this.end).multiplyScalar(0.5);\n\t}\n\n\tdelta(target) {\n\t\treturn target.subVectors(this.end, this.start);\n\t}\n\n\tdistanceSq() {\n\t\treturn this.start.distanceToSquared(this.end);\n\t}\n\n\tdistance() {\n\t\treturn this.start.distanceTo(this.end);\n\t}\n\n\tat(t, target) {\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tclosestPointToPointParameter(point, clampToLine) {\n\t\t_startP.subVectors(point, this.start);\n\n\t\t_startEnd.subVectors(this.end, this.start);\n\n\t\tconst startEnd2 = _startEnd.dot(_startEnd);\n\n\t\tconst startEnd_startP = _startEnd.dot(_startP);\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif (clampToLine) {\n\t\t\tt = clamp(t, 0, 1);\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tclosestPointToPoint(point, clampToLine, target) {\n\t\tconst t = this.closestPointToPointParameter(point, clampToLine);\n\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.start.applyMatrix4(matrix);\n\t\tthis.end.applyMatrix4(matrix);\n\t\treturn this;\n\t}\n\n\tequals(line) {\n\t\treturn line.start.equals(this.start) && line.end.equals(this.end);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nclass Matrix3 {\n\tconstructor() {\n\t\tMatrix3.prototype.isMatrix3 = true;\n\t\tthis.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\t}\n\n\tset(n11, n12, n13, n21, n22, n23, n31, n32, n33) {\n\t\tconst te = this.elements;\n\t\tte[0] = n11;\n\t\tte[1] = n21;\n\t\tte[2] = n31;\n\t\tte[3] = n12;\n\t\tte[4] = n22;\n\t\tte[5] = n32;\n\t\tte[6] = n13;\n\t\tte[7] = n23;\n\t\tte[8] = n33;\n\t\treturn this;\n\t}\n\n\tidentity() {\n\t\tthis.set(1, 0, 0, 0, 1, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tcopy(m) {\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\t\tte[0] = me[0];\n\t\tte[1] = me[1];\n\t\tte[2] = me[2];\n\t\tte[3] = me[3];\n\t\tte[4] = me[4];\n\t\tte[5] = me[5];\n\t\tte[6] = me[6];\n\t\tte[7] = me[7];\n\t\tte[8] = me[8];\n\t\treturn this;\n\t}\n\n\textractBasis(xAxis, yAxis, zAxis) {\n\t\txAxis.setFromMatrix3Column(this, 0);\n\t\tyAxis.setFromMatrix3Column(this, 1);\n\t\tzAxis.setFromMatrix3Column(this, 2);\n\t\treturn this;\n\t}\n\n\tsetFromMatrix4(m) {\n\t\tconst me = m.elements;\n\t\tthis.set(me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10]);\n\t\treturn this;\n\t}\n\n\tmultiply(m) {\n\t\treturn this.multiplyMatrices(this, m);\n\t}\n\n\tpremultiply(m) {\n\t\treturn this.multiplyMatrices(m, this);\n\t}\n\n\tmultiplyMatrices(a, b) {\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\t\tconst a11 = ae[0],\n\t\t\t\t\ta12 = ae[3],\n\t\t\t\t\ta13 = ae[6];\n\t\tconst a21 = ae[1],\n\t\t\t\t\ta22 = ae[4],\n\t\t\t\t\ta23 = ae[7];\n\t\tconst a31 = ae[2],\n\t\t\t\t\ta32 = ae[5],\n\t\t\t\t\ta33 = ae[8];\n\t\tconst b11 = be[0],\n\t\t\t\t\tb12 = be[3],\n\t\t\t\t\tb13 = be[6];\n\t\tconst b21 = be[1],\n\t\t\t\t\tb22 = be[4],\n\t\t\t\t\tb23 = be[7];\n\t\tconst b31 = be[2],\n\t\t\t\t\tb32 = be[5],\n\t\t\t\t\tb33 = be[8];\n\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[3] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[4] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[5] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(s) {\n\t\tconst te = this.elements;\n\t\tte[0] *= s;\n\t\tte[3] *= s;\n\t\tte[6] *= s;\n\t\tte[1] *= s;\n\t\tte[4] *= s;\n\t\tte[7] *= s;\n\t\tte[2] *= s;\n\t\tte[5] *= s;\n\t\tte[8] *= s;\n\t\treturn this;\n\t}\n\n\tdeterminant() {\n\t\tconst te = this.elements;\n\t\tconst a = te[0],\n\t\t\t\t\tb = te[1],\n\t\t\t\t\tc = te[2],\n\t\t\t\t\td = te[3],\n\t\t\t\t\te = te[4],\n\t\t\t\t\tf = te[5],\n\t\t\t\t\tg = te[6],\n\t\t\t\t\th = te[7],\n\t\t\t\t\ti = te[8];\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\t}\n\n\tinvert() {\n\t\tconst te = this.elements,\n\t\t\t\t\tn11 = te[0],\n\t\t\t\t\tn21 = te[1],\n\t\t\t\t\tn31 = te[2],\n\t\t\t\t\tn12 = te[3],\n\t\t\t\t\tn22 = te[4],\n\t\t\t\t\tn32 = te[5],\n\t\t\t\t\tn13 = te[6],\n\t\t\t\t\tn23 = te[7],\n\t\t\t\t\tn33 = te[8],\n\t\t\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\t\t\tt13 = n23 * n12 - n22 * n13,\n\t\t\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\tconst detInv = 1 / det;\n\t\tte[0] = t11 * detInv;\n\t\tte[1] = (n31 * n23 - n33 * n21) * detInv;\n\t\tte[2] = (n32 * n21 - n31 * n22) * detInv;\n\t\tte[3] = t12 * detInv;\n\t\tte[4] = (n33 * n11 - n31 * n13) * detInv;\n\t\tte[5] = (n31 * n12 - n32 * n11) * detInv;\n\t\tte[6] = t13 * detInv;\n\t\tte[7] = (n21 * n13 - n23 * n11) * detInv;\n\t\tte[8] = (n22 * n11 - n21 * n12) * detInv;\n\t\treturn this;\n\t}\n\n\ttranspose() {\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\t\ttmp = m[1];\n\t\tm[1] = m[3];\n\t\tm[3] = tmp;\n\t\ttmp = m[2];\n\t\tm[2] = m[6];\n\t\tm[6] = tmp;\n\t\ttmp = m[5];\n\t\tm[5] = m[7];\n\t\tm[7] = tmp;\n\t\treturn this;\n\t}\n\n\tgetNormalMatrix(matrix4) {\n\t\treturn this.setFromMatrix4(matrix4).invert().transpose();\n\t}\n\n\ttransposeIntoArray(r) {\n\t\tconst m = this.elements;\n\t\tr[0] = m[0];\n\t\tr[1] = m[3];\n\t\tr[2] = m[6];\n\t\tr[3] = m[1];\n\t\tr[4] = m[4];\n\t\tr[5] = m[7];\n\t\tr[6] = m[2];\n\t\tr[7] = m[5];\n\t\tr[8] = m[8];\n\t\treturn this;\n\t}\n\n\tsetUvTransform(tx, ty, sx, sy, rotation, cx, cy) {\n\t\tconst c = Math.cos(rotation);\n\t\tconst s = Math.sin(rotation);\n\t\tthis.set(sx * c, sx * s, -sx * (c * cx + s * cy) + cx + tx, -sy * s, sy * c, -sy * (-s * cx + c * cy) + cy + ty, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tscale(sx, sy) {\n\t\tthis.premultiply(_m3.makeScale(sx, sy));\n\t\treturn this;\n\t}\n\n\trotate(theta) {\n\t\tthis.premultiply(_m3.makeRotation(-theta));\n\t\treturn this;\n\t}\n\n\ttranslate(tx, ty) {\n\t\tthis.premultiply(_m3.makeTranslation(tx, ty));\n\t\treturn this;\n\t} // for 2D Transforms\n\n\n\tmakeTranslation(x, y) {\n\t\tthis.set(1, 0, x, 0, 1, y, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeRotation(theta) {\n\t\t// counterclockwise\n\t\tconst c = Math.cos(theta);\n\t\tconst s = Math.sin(theta);\n\t\tthis.set(c, -s, 0, s, c, 0, 0, 0, 1);\n\t\treturn this;\n\t}\n\n\tmakeScale(x, y) {\n\t\tthis.set(x, 0, 0, 0, y, 0, 0, 0, 1);\n\t\treturn this;\n\t} //\n\n\n\tequals(matrix) {\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tif (te[i] !== me[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tfor (let i = 0; i < 9; i++) {\n\t\t\tthis.elements[i] = array[i + offset];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tconst te = this.elements;\n\t\tarray[offset] = te[0];\n\t\tarray[offset + 1] = te[1];\n\t\tarray[offset + 2] = te[2];\n\t\tarray[offset + 3] = te[3];\n\t\tarray[offset + 4] = te[4];\n\t\tarray[offset + 5] = te[5];\n\t\tarray[offset + 6] = te[6];\n\t\tarray[offset + 7] = te[7];\n\t\tarray[offset + 8] = te[8];\n\t\treturn array;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().fromArray(this.elements);\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/new Matrix3();\n\nconst _vector1 = /*@__PURE__*/new Vector3();\n\nconst _vector2 = /*@__PURE__*/new Vector3();\n\nconst _normalMatrix = /*@__PURE__*/new Matrix3();\n\nclass Plane {\n\tconstructor(normal = new Vector3(1, 0, 0), constant = 0) {\n\t\tthis.isPlane = true; // normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\t}\n\n\tset(normal, constant) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = constant;\n\t\treturn this;\n\t}\n\n\tsetComponents(x, y, z, w) {\n\t\tthis.normal.set(x, y, z);\n\t\tthis.constant = w;\n\t\treturn this;\n\t}\n\n\tsetFromNormalAndCoplanarPoint(normal, point) {\n\t\tthis.normal.copy(normal);\n\t\tthis.constant = -point.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tsetFromCoplanarPoints(a, b, c) {\n\t\tconst normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize(); // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\n\t\tthis.setFromNormalAndCoplanarPoint(normal, a);\n\t\treturn this;\n\t}\n\n\tcopy(plane) {\n\t\tthis.normal.copy(plane.normal);\n\t\tthis.constant = plane.constant;\n\t\treturn this;\n\t}\n\n\tnormalize() {\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar(inverseNormalLength);\n\t\tthis.constant *= inverseNormalLength;\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.constant *= -1;\n\t\tthis.normal.negate();\n\t\treturn this;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn this.normal.dot(point) + this.constant;\n\t}\n\n\tdistanceToSphere(sphere) {\n\t\treturn this.distanceToPoint(sphere.center) - sphere.radius;\n\t}\n\n\tprojectPoint(point, target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);\n\t}\n\n\tintersectLine(line, target) {\n\t\tconst direction = line.delta(_vector1);\n\t\tconst denominator = this.normal.dot(direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (this.distanceToPoint(line.start) === 0) {\n\t\t\t\treturn target.copy(line.start);\n\t\t\t} // Unsure if this is the correct method to handle this case.\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(line.start.dot(this.normal) + this.constant) / denominator;\n\n\t\tif (t < 0 || t > 1) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn target.copy(direction).multiplyScalar(t).add(line.start);\n\t}\n\n\tintersectsLine(line) {\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\t\tconst startSign = this.distanceToPoint(line.start);\n\t\tconst endSign = this.distanceToPoint(line.end);\n\t\treturn startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsPlane(this);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn sphere.intersectsPlane(this);\n\t}\n\n\tcoplanarPoint(target) {\n\t\treturn target.copy(this.normal).multiplyScalar(-this.constant);\n\t}\n\n\tapplyMatrix4(matrix, optionalNormalMatrix) {\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);\n\n\t\tconst referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);\n\t\tconst normal = this.normal.applyMatrix3(normalMatrix).normalize();\n\t\tthis.constant = -referencePoint.dot(normal);\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.constant -= offset.dot(this.normal);\n\t\treturn this;\n\t}\n\n\tequals(plane) {\n\t\treturn plane.normal.equals(this.normal) && plane.constant === this.constant;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/new Vector3();\n\nconst _segCenter = /*@__PURE__*/new Vector3();\n\nconst _segDir = /*@__PURE__*/new Vector3();\n\nconst _diff = /*@__PURE__*/new Vector3();\n\nconst _edge1 = /*@__PURE__*/new Vector3();\n\nconst _edge2 = /*@__PURE__*/new Vector3();\n\nconst _normal = /*@__PURE__*/new Vector3();\n\nclass Ray {\n\tconstructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\t}\n\n\tset(origin, direction) {\n\t\tthis.origin.copy(origin);\n\t\tthis.direction.copy(direction);\n\t\treturn this;\n\t}\n\n\tcopy(ray) {\n\t\tthis.origin.copy(ray.origin);\n\t\tthis.direction.copy(ray.direction);\n\t\treturn this;\n\t}\n\n\tat(t, target = new Vector3()) {\n\t\treturn target.copy(this.direction).multiplyScalar(t).add(this.origin);\n\t}\n\n\tlookAt(v) {\n\t\tthis.direction.copy(v).sub(this.origin).normalize();\n\t\treturn this;\n\t}\n\n\trecast(t) {\n\t\tthis.origin.copy(this.at(t, _vector));\n\t\treturn this;\n\t}\n\n\tclosestPointToPoint(point, target = new Vector3()) {\n\t\ttarget.subVectors(point, this.origin);\n\t\tconst directionDistance = target.dot(this.direction);\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn target.copy(this.origin);\n\t\t}\n\n\t\treturn target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn Math.sqrt(this.distanceSqToPoint(point));\n\t}\n\n\tdistanceSqToPoint(point) {\n\t\tconst directionDistance = _vector.subVectors(point, this.origin).dot(this.direction); // point behind the ray\n\n\n\t\tif (directionDistance < 0) {\n\t\t\treturn this.origin.distanceToSquared(point);\n\t\t}\n\n\t\t_vector.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\n\t\treturn _vector.distanceToSquared(point);\n\t}\n\n\tdistanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\t\t_segCenter.copy(v0).add(v1).multiplyScalar(0.5);\n\n\t\t_segDir.copy(v1).sub(v0).normalize();\n\n\t\t_diff.copy(this.origin).sub(_segCenter);\n\n\t\tconst segExtent = v0.distanceTo(v1) * 0.5;\n\t\tconst a01 = -this.direction.dot(_segDir);\n\n\t\tconst b0 = _diff.dot(this.direction);\n\n\t\tconst b1 = -_diff.dot(_segDir);\n\n\t\tconst c = _diff.lengthSq();\n\n\t\tconst det = Math.abs(1 - a01 * a01);\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif (det > 0) {\n\t\t\t// The ray and segment are not parallel.\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif (s0 >= 0) {\n\t\t\t\tif (s1 >= -extDet) {\n\t\t\t\t\tif (s1 <= extDet) {\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 1\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// region 5\n\t\t\t\t\ts1 = -segExtent;\n\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (s1 <= -extDet) {\n\t\t\t\t\t// region 4\n\t\t\t\t\ts0 = Math.max(0, -(-a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else if (s1 <= extDet) {\n\t\t\t\t\t// region 3\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = s1 * (s1 + 2 * b1) + c;\n\t\t\t\t} else {\n\t\t\t\t\t// region 2\n\t\t\t\t\ts0 = Math.max(0, -(a01 * segExtent + b0));\n\t\t\t\t\ts1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Ray and segment are parallel.\n\t\t\ts1 = a01 > 0 ? -segExtent : segExtent;\n\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t}\n\n\t\tif (optionalPointOnRay) {\n\t\t\toptionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);\n\t\t}\n\n\t\tif (optionalPointOnSegment) {\n\t\t\toptionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);\n\t\t}\n\n\t\treturn sqrDist;\n\t}\n\n\tintersectSphere(sphere, target = new Vector3()) {\n\t\t_vector.subVectors(sphere.center, this.origin);\n\n\t\tconst tca = _vector.dot(this.direction);\n\n\t\tconst d2 = _vector.dot(_vector) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\t\tif (d2 > radius2) return null;\n\t\tconst thc = Math.sqrt(radius2 - d2); // t0 = first intersect point - entrance on front of sphere\n\n\t\tconst t0 = tca - thc; // t1 = second intersect point - exit point on back of sphere\n\n\t\tconst t1 = tca + thc; // test to see if both t0 and t1 are behind the ray - if so, return null\n\n\t\tif (t0 < 0 && t1 < 0) return null; // test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\n\t\tif (t0 < 0) return this.at(t1, target); // else t0 is in front of the ray, so return the first collision point scaled by t0\n\n\t\treturn this.at(t0, target);\n\t}\n\n\tintersectsSphere(sphere) {\n\t\treturn this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;\n\t}\n\n\tdistanceToPlane(plane) {\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator === 0) {\n\t\t\t// line is coplanar, return origin\n\t\t\tif (plane.distanceToPoint(this.origin) === 0) {\n\t\t\t\treturn 0;\n\t\t\t} // Null is preferable to undefined since undefined means.... it is undefined\n\n\n\t\t\treturn null;\n\t\t}\n\n\t\tconst t = -(this.origin.dot(plane.normal) + plane.constant) / denominator; // Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\t}\n\n\tintersectPlane(plane, target) {\n\t\tconst t = this.distanceToPlane(plane);\n\n\t\tif (t === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this.at(t, target);\n\t}\n\n\tintersectsPlane(plane) {\n\t\t// check if the ray lies on the plane first\n\t\tconst distToPoint = plane.distanceToPoint(this.origin);\n\n\t\tif (distToPoint === 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\tif (denominator * distToPoint < 0) {\n\t\t\treturn true;\n\t\t} // ray origin is behind the plane (and is pointing behind it)\n\n\n\t\treturn false;\n\t}\n\n\tintersectBox(box, target) {\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\t\t\tinvdirz = 1 / this.direction.z;\n\t\tconst origin = this.origin;\n\n\t\tif (invdirx >= 0) {\n\t\t\ttmin = (box.min.x - origin.x) * invdirx;\n\t\t\ttmax = (box.max.x - origin.x) * invdirx;\n\t\t} else {\n\t\t\ttmin = (box.max.x - origin.x) * invdirx;\n\t\t\ttmax = (box.min.x - origin.x) * invdirx;\n\t\t}\n\n\t\tif (invdiry >= 0) {\n\t\t\ttymin = (box.min.y - origin.y) * invdiry;\n\t\t\ttymax = (box.max.y - origin.y) * invdiry;\n\t\t} else {\n\t\t\ttymin = (box.max.y - origin.y) * invdiry;\n\t\t\ttymax = (box.min.y - origin.y) * invdiry;\n\t\t}\n\n\t\tif (tmin > tymax || tymin > tmax) return null; // These lines also handle the case where tmin or tmax is NaN\n\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\tif (tymin > tmin || tmin !== tmin) tmin = tymin;\n\t\tif (tymax < tmax || tmax !== tmax) tmax = tymax;\n\n\t\tif (invdirz >= 0) {\n\t\t\ttzmin = (box.min.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.max.z - origin.z) * invdirz;\n\t\t} else {\n\t\t\ttzmin = (box.max.z - origin.z) * invdirz;\n\t\t\ttzmax = (box.min.z - origin.z) * invdirz;\n\t\t}\n\n\t\tif (tmin > tzmax || tzmin > tmax) return null;\n\t\tif (tzmin > tmin || tmin !== tmin) tmin = tzmin;\n\t\tif (tzmax < tmax || tmax !== tmax) tmax = tzmax; //return point closest to the ray (positive side)\n\n\t\tif (tmax < 0) return null;\n\t\treturn this.at(tmin >= 0 ? tmin : tmax, target);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn this.intersectBox(box, _vector) !== null;\n\t}\n\n\tintersectTriangle(a, b, c, backfaceCulling, target) {\n\t\t// Compute the offset origin, edges, and normal.\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\t\t_edge1.subVectors(b, a);\n\n\t\t_edge2.subVectors(c, a);\n\n\t\t_normal.crossVectors(_edge1, _edge2); // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t//\t |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t//\t |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t//\t |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\n\n\t\tlet DdN = this.direction.dot(_normal);\n\t\tlet sign;\n\n\t\tif (DdN > 0) {\n\t\t\tif (backfaceCulling) return null;\n\t\t\tsign = 1;\n\t\t} else if (DdN < 0) {\n\t\t\tsign = -1;\n\t\t\tDdN = -DdN;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\n\t\t_diff.subVectors(this.origin, a);\n\n\t\tconst DdQxE2 = sign * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); // b1 < 0, no intersection\n\n\t\tif (DdQxE2 < 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot(_edge1.cross(_diff)); // b2 < 0, no intersection\n\n\t\tif (DdE1xQ < 0) {\n\t\t\treturn null;\n\t\t} // b1+b2 > 1, no intersection\n\n\n\t\tif (DdQxE2 + DdE1xQ > DdN) {\n\t\t\treturn null;\n\t\t} // Line intersects triangle, check if ray does.\n\n\n\t\tconst QdN = -sign * _diff.dot(_normal); // t < 0, no intersection\n\n\n\t\tif (QdN < 0) {\n\t\t\treturn null;\n\t\t} // Ray intersects triangle.\n\n\n\t\treturn this.at(QdN / DdN, target);\n\t}\n\n\tapplyMatrix4(matrix4) {\n\t\tthis.origin.applyMatrix4(matrix4);\n\t\tthis.direction.transformDirection(matrix4);\n\t\treturn this;\n\t}\n\n\tequals(ray) {\n\t\treturn ray.origin.equals(this.origin) && ray.direction.equals(this.direction);\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _box = /*@__PURE__*/new Box3();\n\nconst _v1$1 = /*@__PURE__*/new Vector3();\n\nconst _toFarthestPoint = /*@__PURE__*/new Vector3();\n\nconst _toPoint = /*@__PURE__*/new Vector3();\n\nclass Sphere {\n\tconstructor(center = new Vector3(), radius = -1) {\n\t\tthis.center = center;\n\t\tthis.radius = radius;\n\t}\n\n\tset(center, radius) {\n\t\tthis.center.copy(center);\n\t\tthis.radius = radius;\n\t\treturn this;\n\t}\n\n\tsetFromPoints(points, optionalCenter) {\n\t\tconst center = this.center;\n\n\t\tif (optionalCenter !== undefined) {\n\t\t\tcenter.copy(optionalCenter);\n\t\t} else {\n\t\t\t_box.setFromPoints(points).getCenter(center);\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));\n\t\t}\n\n\t\tthis.radius = Math.sqrt(maxRadiusSq);\n\t\treturn this;\n\t}\n\n\tcopy(sphere) {\n\t\tthis.center.copy(sphere.center);\n\t\tthis.radius = sphere.radius;\n\t\treturn this;\n\t}\n\n\tisEmpty() {\n\t\treturn this.radius < 0;\n\t}\n\n\tmakeEmpty() {\n\t\tthis.center.set(0, 0, 0);\n\t\tthis.radius = -1;\n\t\treturn this;\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn point.distanceToSquared(this.center) <= this.radius * this.radius;\n\t}\n\n\tdistanceToPoint(point) {\n\t\treturn point.distanceTo(this.center) - this.radius;\n\t}\n\n\tintersectsSphere(sphere) {\n\t\tconst radiusSum = this.radius + sphere.radius;\n\t\treturn sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsSphere(this);\n\t}\n\n\tintersectsPlane(plane) {\n\t\treturn Math.abs(plane.distanceToPoint(this.center)) <= this.radius;\n\t}\n\n\tclampPoint(point, target) {\n\t\tconst deltaLengthSq = this.center.distanceToSquared(point);\n\t\ttarget.copy(point);\n\n\t\tif (deltaLengthSq > this.radius * this.radius) {\n\t\t\ttarget.sub(this.center).normalize();\n\t\t\ttarget.multiplyScalar(this.radius).add(this.center);\n\t\t}\n\n\t\treturn target;\n\t}\n\n\tgetBoundingBox(target) {\n\t\tif (this.isEmpty()) {\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\t\t}\n\n\t\ttarget.set(this.center, this.center);\n\t\ttarget.expandByScalar(this.radius);\n\t\treturn target;\n\t}\n\n\tapplyMatrix4(matrix) {\n\t\tthis.center.applyMatrix4(matrix);\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\t\treturn this;\n\t}\n\n\ttranslate(offset) {\n\t\tthis.center.add(offset);\n\t\treturn this;\n\t}\n\n\texpandByPoint(point) {\n\t\tif (this.isEmpty()) {\n\t\t\tthis.center.copy(point);\n\t\t\tthis.radius = 0;\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671\n\n\n\t\t_toPoint.subVectors(point, this.center);\n\n\t\tconst lengthSq = _toPoint.lengthSq();\n\n\t\tif (lengthSq > this.radius * this.radius) {\n\t\t\tconst length = Math.sqrt(lengthSq);\n\t\t\tconst missingRadiusHalf = (length - this.radius) * 0.5; // Nudge this sphere towards the target point. Add half the missing distance to radius,\n\t\t\t// and the other half to position. This gives a tighter enclosure, instead of if\n\t\t\t// the whole missing distance were just added to radius.\n\n\t\t\tthis.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length));\n\t\t\tthis.radius += missingRadiusHalf;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tunion(sphere) {\n\t\t// handle empty sphere cases\n\t\tif (sphere.isEmpty()) {\n\t\t\treturn;\n\t\t} else if (this.isEmpty()) {\n\t\t\tthis.copy(sphere);\n\t\t\treturn this;\n\t\t} // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769\n\t\t// To enclose another sphere into this sphere, we only need to enclose two points:\n\t\t// 1) Enclose the farthest point on the other sphere into this sphere.\n\t\t// 2) Enclose the opposite point of the farthest point into this sphere.\n\n\n\t\tif (this.center.equals(sphere.center) === true) {\n\t\t\t_toFarthestPoint.set(0, 0, 1).multiplyScalar(sphere.radius);\n\t\t} else {\n\t\t\t_toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);\n\t\t}\n\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).add(_toFarthestPoint));\n\t\tthis.expandByPoint(_v1$1.copy(sphere.center).sub(_toFarthestPoint));\n\t\treturn this;\n\t}\n\n\tequals(sphere) {\n\t\treturn sphere.center.equals(this.center) && sphere.radius === this.radius;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\n/**\r\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\r\n *\r\n * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\r\n * The azimuthal angle (theta) is measured from the positive z-axis.\r\n */\n\nclass Spherical {\n\tconstructor(radius = 1, phi = 0, theta = 0) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi; // polar angle\n\n\t\tthis.theta = theta; // azimuthal angle\n\n\t\treturn this;\n\t}\n\n\tset(radius, phi, theta) {\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\t\treturn this;\n\t}\n\n\tcopy(other) {\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\t\treturn this;\n\t} // restrict phi to be between EPS and PI-EPS\n\n\n\tmakeSafe() {\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi));\n\t\treturn this;\n\t}\n\n\tsetFromVector3(v) {\n\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t}\n\n\tsetFromCartesianCoords(x, y, z) {\n\t\tthis.radius = Math.sqrt(x * x + y * y + z * z);\n\n\t\tif (this.radius === 0) {\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\t\t} else {\n\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\tthis.phi = Math.acos(clamp(y / this.radius, -1, 1));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/new Vector3();\n\nconst _v1 = /*@__PURE__*/new Vector3();\n\nconst _v2 = /*@__PURE__*/new Vector3();\n\nconst _v3 = /*@__PURE__*/new Vector3();\n\nconst _vab = /*@__PURE__*/new Vector3();\n\nconst _vac = /*@__PURE__*/new Vector3();\n\nconst _vbc = /*@__PURE__*/new Vector3();\n\nconst _vap = /*@__PURE__*/new Vector3();\n\nconst _vbp = /*@__PURE__*/new Vector3();\n\nconst _vcp = /*@__PURE__*/new Vector3();\n\nclass Triangle {\n\tconstructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {\n\t\tthis.a = a;\n\t\tthis.b = b;\n\t\tthis.c = c;\n\t}\n\n\tstatic getNormal(a, b, c, target) {\n\t\ttarget.subVectors(c, b);\n\n\t\t_v0.subVectors(a, b);\n\n\t\ttarget.cross(_v0);\n\t\tconst targetLengthSq = target.lengthSq();\n\n\t\tif (targetLengthSq > 0) {\n\t\t\treturn target.multiplyScalar(1 / Math.sqrt(targetLengthSq));\n\t\t}\n\n\t\treturn target.set(0, 0, 0);\n\t} // static/instance method to calculate barycentric coordinates\n\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\n\tstatic getBarycoord(point, a, b, c, target) {\n\t\t_v0.subVectors(c, a);\n\n\t\t_v1.subVectors(b, a);\n\n\t\t_v2.subVectors(point, a);\n\n\t\tconst dot00 = _v0.dot(_v0);\n\n\t\tconst dot01 = _v0.dot(_v1);\n\n\t\tconst dot02 = _v0.dot(_v2);\n\n\t\tconst dot11 = _v1.dot(_v1);\n\n\t\tconst dot12 = _v1.dot(_v2);\n\n\t\tconst denom = dot00 * dot11 - dot01 * dot01; // collinear or singular triangle\n\n\t\tif (denom === 0) {\n\t\t\t// arbitrary location outside of triangle?\n\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\treturn target.set(-2, -1, -1);\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n\t\tconst v = (dot00 * dot12 - dot01 * dot02) * invDenom; // barycentric coordinates must always sum to 1\n\n\t\treturn target.set(1 - u - v, v, u);\n\t}\n\n\tstatic containsPoint(point, a, b, c) {\n\t\tthis.getBarycoord(point, a, b, c, _v3);\n\t\treturn _v3.x >= 0 && _v3.y >= 0 && _v3.x + _v3.y <= 1;\n\t}\n\n\tstatic getUV(point, p1, p2, p3, uv1, uv2, uv3, target) {\n\t\tthis.getBarycoord(point, p1, p2, p3, _v3);\n\t\ttarget.set(0, 0);\n\t\ttarget.addScaledVector(uv1, _v3.x);\n\t\ttarget.addScaledVector(uv2, _v3.y);\n\t\ttarget.addScaledVector(uv3, _v3.z);\n\t\treturn target;\n\t}\n\n\tstatic isFrontFacing(a, b, c, direction) {\n\t\t_v0.subVectors(c, b);\n\n\t\t_v1.subVectors(a, b); // strictly front facing\n\n\n\t\treturn _v0.cross(_v1).dot(direction) < 0 ? true : false;\n\t}\n\n\tset(a, b, c) {\n\t\tthis.a.copy(a);\n\t\tthis.b.copy(b);\n\t\tthis.c.copy(c);\n\t\treturn this;\n\t}\n\n\tsetFromPointsAndIndices(points, i0, i1, i2) {\n\t\tthis.a.copy(points[i0]);\n\t\tthis.b.copy(points[i1]);\n\t\tthis.c.copy(points[i2]);\n\t\treturn this;\n\t} // setFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\t// \tthis.a.fromBufferAttribute( attribute, i0 );\n\t// \tthis.b.fromBufferAttribute( attribute, i1 );\n\t// \tthis.c.fromBufferAttribute( attribute, i2 );\n\t// \treturn this;\n\t// }\n\n\n\tclone() {\n\t\treturn new this.constructor().copy(this);\n\t}\n\n\tcopy(triangle) {\n\t\tthis.a.copy(triangle.a);\n\t\tthis.b.copy(triangle.b);\n\t\tthis.c.copy(triangle.c);\n\t\treturn this;\n\t}\n\n\tgetArea() {\n\t\t_v0.subVectors(this.c, this.b);\n\n\t\t_v1.subVectors(this.a, this.b);\n\n\t\treturn _v0.cross(_v1).length() * 0.5;\n\t}\n\n\tgetMidpoint(target) {\n\t\treturn target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n\t}\n\n\tgetNormal(target) {\n\t\treturn Triangle.getNormal(this.a, this.b, this.c, target);\n\t}\n\n\tgetPlane(target) {\n\t\treturn target.setFromCoplanarPoints(this.a, this.b, this.c);\n\t}\n\n\tgetBarycoord(point, target) {\n\t\treturn Triangle.getBarycoord(point, this.a, this.b, this.c, target);\n\t}\n\n\tgetUV(point, uv1, uv2, uv3, target) {\n\t\treturn Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target);\n\t}\n\n\tcontainsPoint(point) {\n\t\treturn Triangle.containsPoint(point, this.a, this.b, this.c);\n\t}\n\n\tisFrontFacing(direction) {\n\t\treturn Triangle.isFrontFacing(this.a, this.b, this.c, direction);\n\t}\n\n\tintersectsBox(box) {\n\t\treturn box.intersectsTriangle(this);\n\t}\n\n\tclosestPointToPoint(p, target) {\n\t\tconst a = this.a,\n\t\t\t\t\tb = this.b,\n\t\t\t\t\tc = this.c;\n\t\tlet v, w; // algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors(b, a);\n\n\t\t_vac.subVectors(c, a);\n\n\t\t_vap.subVectors(p, a);\n\n\t\tconst d1 = _vab.dot(_vap);\n\n\t\tconst d2 = _vac.dot(_vap);\n\n\t\tif (d1 <= 0 && d2 <= 0) {\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy(a);\n\t\t}\n\n\t\t_vbp.subVectors(p, b);\n\n\t\tconst d3 = _vab.dot(_vbp);\n\n\t\tconst d4 = _vac.dot(_vbp);\n\n\t\tif (d3 >= 0 && d4 <= d3) {\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy(b);\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\n\t\tif (vc <= 0 && d1 >= 0 && d3 <= 0) {\n\t\t\tv = d1 / (d1 - d3); // edge region of AB; barycentric coords (1-v, v, 0)\n\n\t\t\treturn target.copy(a).addScaledVector(_vab, v);\n\t\t}\n\n\t\t_vcp.subVectors(p, c);\n\n\t\tconst d5 = _vab.dot(_vcp);\n\n\t\tconst d6 = _vac.dot(_vcp);\n\n\t\tif (d6 >= 0 && d5 <= d6) {\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy(c);\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\n\t\tif (vb <= 0 && d2 >= 0 && d6 <= 0) {\n\t\t\tw = d2 / (d2 - d6); // edge region of AC; barycentric coords (1-w, 0, w)\n\n\t\t\treturn target.copy(a).addScaledVector(_vac, w);\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\n\t\tif (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {\n\t\t\t_vbc.subVectors(c, b);\n\n\t\t\tw = (d4 - d3) / (d4 - d3 + (d5 - d6)); // edge region of BC; barycentric coords (0, 1-w, w)\n\n\t\t\treturn target.copy(b).addScaledVector(_vbc, w); // edge region of BC\n\t\t} // face region\n\n\n\t\tconst denom = 1 / (va + vb + vc); // u = va * denom\n\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\t\treturn target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w);\n\t}\n\n\tequals(triangle) {\n\t\treturn triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);\n\t}\n\n}\n\nclass Vector4 {\n\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\tVector4.prototype.isVector4 = true;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t}\n\n\tget width() {\n\t\treturn this.z;\n\t}\n\n\tset width(value) {\n\t\tthis.z = value;\n\t}\n\n\tget height() {\n\t\treturn this.w;\n\t}\n\n\tset height(value) {\n\t\tthis.w = value;\n\t}\n\n\tset(x, y, z, w) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetScalar(scalar) {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\t\treturn this;\n\t}\n\n\tsetX(x) {\n\t\tthis.x = x;\n\t\treturn this;\n\t}\n\n\tsetY(y) {\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tsetZ(z) {\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tsetW(w) {\n\t\tthis.w = w;\n\t\treturn this;\n\t}\n\n\tsetComponent(index, value) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tthis.x = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tthis.y = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tthis.z = value;\n\t\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tthis.w = value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tgetComponent(index) {\n\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\treturn this.x;\n\n\t\t\tcase 1:\n\t\t\t\treturn this.y;\n\n\t\t\tcase 2:\n\t\t\t\treturn this.z;\n\n\t\t\tcase 3:\n\t\t\t\treturn this.w;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t}\n\t}\n\n\tclone() {\n\t\treturn new this.constructor(this.x, this.y, this.z, this.w);\n\t}\n\n\tcopy(v) {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = v.w !== undefined ? v.w : 1;\n\t\treturn this;\n\t}\n\n\tadd(v) {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\t\treturn this;\n\t}\n\n\taddScalar(s) {\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\t\treturn this;\n\t}\n\n\taddVectors(a, b) {\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\t\treturn this;\n\t}\n\n\taddScaledVector(v, s) {\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\t\treturn this;\n\t}\n\n\tsub(v) {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\t\treturn this;\n\t}\n\n\tsubScalar(s) {\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\t\treturn this;\n\t}\n\n\tsubVectors(a, b) {\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\t\treturn this;\n\t}\n\n\tmultiply(v) {\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\t\treturn this;\n\t}\n\n\tmultiplyScalar(scalar) {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\t\treturn this;\n\t}\n\n\tapplyMatrix4(m) {\n\t\tconst x = this.x,\n\t\t\t\t\ty = this.y,\n\t\t\t\t\tz = this.z,\n\t\t\t\t\tw = this.w;\n\t\tconst e = m.elements;\n\t\tthis.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w;\n\t\tthis.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w;\n\t\tthis.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w;\n\t\tthis.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w;\n\t\treturn this;\n\t}\n\n\tdivideScalar(scalar) {\n\t\treturn this.multiplyScalar(1 / scalar);\n\t}\n\n\tsetAxisAngleFromQuaternion(q) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\t\t// q is assumed to be normalized\n\t\tthis.w = 2 * Math.acos(q.w);\n\t\tconst s = Math.sqrt(1 - q.w * q.w);\n\n\t\tif (s < 0.0001) {\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\t\t} else {\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsetAxisAngleFromRotationMatrix(m) {\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\tlet angle, x, y, z; // variables for result\n\n\t\tconst epsilon = 0.01,\n\t\t\t\t\t// margin to allow for rounding errors\n\t\tepsilon2 = 0.1,\n\t\t\t\t\t// margin to distinguish between 0 and 180 degrees\n\t\tte = m.elements,\n\t\t\t\t\tm11 = te[0],\n\t\t\t\t\tm12 = te[4],\n\t\t\t\t\tm13 = te[8],\n\t\t\t\t\tm21 = te[1],\n\t\t\t\t\tm22 = te[5],\n\t\t\t\t\tm23 = te[9],\n\t\t\t\t\tm31 = te[2],\n\t\t\t\t\tm32 = te[6],\n\t\t\t\t\tm33 = te[10];\n\n\t\tif (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\t\t\tif (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\t\t\t\tthis.set(1, 0, 0, 0);\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\t\t\t} // otherwise this singularity is angle = 180\n\n\n\t\t\tangle = Math.PI;\n\t\t\tconst xx = (m11 + 1) / 2;\n\t\t\tconst yy = (m22 + 1) / 2;\n\t\t\tconst zz = (m33 + 1) / 2;\n\t\t\tconst xy = (m12 + m21) / 4;\n\t\t\tconst xz = (m13 + m31) / 4;\n\t\t\tconst yz = (m23 + m32) / 4;\n\n\t\t\tif (xx > yy && xx > zz) {\n\t\t\t\t// m11 is the largest diagonal term\n\t\t\t\tif (xx < epsilon) {\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\tx = Math.sqrt(xx);\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\t\t\t\t}\n\t\t\t} else if (yy > zz) {\n\t\t\t\t// m22 is the largest diagonal term\n\t\t\t\tif (yy < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\t\t\t\t} else {\n\t\t\t\t\ty = Math.sqrt(yy);\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\t\t\t\tif (zz < epsilon) {\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\t\t\t\t} else {\n\t\t\t\t\tz = Math.sqrt(zz);\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.set(x, y, z, angle);\n\t\t\treturn this; // return 180 deg rotation\n\t\t} // as we have reached here there are no singularities so we can handle normally\n\n\n\t\tlet s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); // used to normalize\n\n\t\tif (Math.abs(s) < 0.001) s = 1; // prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = (m32 - m23) / s;\n\t\tthis.y = (m13 - m31) / s;\n\t\tthis.z = (m21 - m12) / s;\n\t\tthis.w = Math.acos((m11 + m22 + m33 - 1) / 2);\n\t\treturn this;\n\t}\n\n\tmin(v) {\n\t\tthis.x = Math.min(this.x, v.x);\n\t\tthis.y = Math.min(this.y, v.y);\n\t\tthis.z = Math.min(this.z, v.z);\n\t\tthis.w = Math.min(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tmax(v) {\n\t\tthis.x = Math.max(this.x, v.x);\n\t\tthis.y = Math.max(this.y, v.y);\n\t\tthis.z = Math.max(this.z, v.z);\n\t\tthis.w = Math.max(this.w, v.w);\n\t\treturn this;\n\t}\n\n\tclamp(min, max) {\n\t\t// assumes min < max, componentwise\n\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\tthis.w = Math.max(min.w, Math.min(max.w, this.w));\n\t\treturn this;\n\t}\n\n\tclampScalar(minVal, maxVal) {\n\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\tthis.w = Math.max(minVal, Math.min(maxVal, this.w));\n\t\treturn this;\n\t}\n\n\tclampLength(min, max) {\n\t\tconst length = this.length();\n\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t}\n\n\tfloor() {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.z = Math.floor(this.z);\n\t\tthis.w = Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tceil() {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\t\tthis.z = Math.ceil(this.z);\n\t\tthis.w = Math.ceil(this.w);\n\t\treturn this;\n\t}\n\n\tround() {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\t\tthis.z = Math.round(this.z);\n\t\tthis.w = Math.round(this.w);\n\t\treturn this;\n\t}\n\n\troundToZero() {\n\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\tthis.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);\n\t\treturn this;\n\t}\n\n\tnegate() {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\t\tthis.z = -this.z;\n\t\tthis.w = -this.w;\n\t\treturn this;\n\t}\n\n\tdot(v) {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\t}\n\n\tlengthSq() {\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\t}\n\n\tlength() {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\t}\n\n\tmanhattanLength() {\n\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n\t}\n\n\tnormalize() {\n\t\treturn this.divideScalar(this.length() || 1);\n\t}\n\n\tsetLength(length) {\n\t\treturn this.normalize().multiplyScalar(length);\n\t}\n\n\tlerp(v, alpha) {\n\t\tthis.x += (v.x - this.x) * alpha;\n\t\tthis.y += (v.y - this.y) * alpha;\n\t\tthis.z += (v.z - this.z) * alpha;\n\t\tthis.w += (v.w - this.w) * alpha;\n\t\treturn this;\n\t}\n\n\tlerpVectors(v1, v2, alpha) {\n\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\tthis.w = v1.w + (v2.w - v1.w) * alpha;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w;\n\t}\n\n\tfromArray(array, offset = 0) {\n\t\tthis.x = array[offset];\n\t\tthis.y = array[offset + 1];\n\t\tthis.z = array[offset + 2];\n\t\tthis.w = array[offset + 3];\n\t\treturn this;\n\t}\n\n\ttoArray(array = [], offset = 0) {\n\t\tarray[offset] = this.x;\n\t\tarray[offset + 1] = this.y;\n\t\tarray[offset + 2] = this.z;\n\t\tarray[offset + 3] = this.w;\n\t\treturn array;\n\t} // fromBufferAttribute( attribute, index ) {\n\t// \tthis.x = attribute.getX( index );\n\t// \tthis.y = attribute.getY( index );\n\t// \tthis.z = attribute.getZ( index );\n\t// \tthis.w = attribute.getW( index );\n\t// \treturn this;\n\t// }\n\n\n\trandom() {\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\t}\n\n}\n\nexports.ACESFilmicToneMapping = ACESFilmicToneMapping;\nexports.AddEquation = AddEquation;\nexports.AddOperation = AddOperation;\nexports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;\nexports.AdditiveBlending = AdditiveBlending;\nexports.AlphaFormat = AlphaFormat;\nexports.AlwaysDepth = AlwaysDepth;\nexports.AlwaysStencilFunc = AlwaysStencilFunc;\nexports.BackSide = BackSide;\nexports.BasicDepthPacking = BasicDepthPacking;\nexports.BasicShadowMap = BasicShadowMap;\nexports.Box2 = Box2;\nexports.Box3 = Box3;\nexports.ByteType = ByteType;\nexports.CineonToneMapping = CineonToneMapping;\nexports.ClampToEdgeWrapping = ClampToEdgeWrapping;\nexports.Color = Color;\nexports.ColorManagement = ColorManagement;\nexports.CubeReflectionMapping = CubeReflectionMapping;\nexports.CubeRefractionMapping = CubeRefractionMapping;\nexports.CubeUVReflectionMapping = CubeUVReflectionMapping;\nexports.CullFaceBack = CullFaceBack;\nexports.CullFaceFront = CullFaceFront;\nexports.CullFaceFrontBack = CullFaceFrontBack;\nexports.CullFaceNone = CullFaceNone;\nexports.CustomBlending = CustomBlending;\nexports.CustomToneMapping = CustomToneMapping;\nexports.Cylindrical = Cylindrical;\nexports.DecrementStencilOp = DecrementStencilOp;\nexports.DecrementWrapStencilOp = DecrementWrapStencilOp;\nexports.DepthFormat = DepthFormat;\nexports.DepthStencilFormat = DepthStencilFormat;\nexports.DoubleSide = DoubleSide;\nexports.DstAlphaFactor = DstAlphaFactor;\nexports.DstColorFactor = DstColorFactor;\nexports.DynamicCopyUsage = DynamicCopyUsage;\nexports.DynamicDrawUsage = DynamicDrawUsage;\nexports.DynamicReadUsage = DynamicReadUsage;\nexports.EqualDepth = EqualDepth;\nexports.EqualStencilFunc = EqualStencilFunc;\nexports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;\nexports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;\nexports.Euler = Euler;\nexports.FloatType = FloatType;\nexports.FrontSide = FrontSide;\nexports.GLSL1 = GLSL1;\nexports.GLSL3 = GLSL3;\nexports.GreaterDepth = GreaterDepth;\nexports.GreaterEqualDepth = GreaterEqualDepth;\nexports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;\nexports.GreaterStencilFunc = GreaterStencilFunc;\nexports.HalfFloatType = HalfFloatType;\nexports.IncrementStencilOp = IncrementStencilOp;\nexports.IncrementWrapStencilOp = IncrementWrapStencilOp;\nexports.IntType = IntType;\nexports.Interpolant = Interpolant;\nexports.InterpolateDiscrete = InterpolateDiscrete;\nexports.InterpolateLinear = InterpolateLinear;\nexports.InterpolateSmooth = InterpolateSmooth;\nexports.InvertStencilOp = InvertStencilOp;\nexports.KeepStencilOp = KeepStencilOp;\nexports.LessDepth = LessDepth;\nexports.LessEqualDepth = LessEqualDepth;\nexports.LessEqualStencilFunc = LessEqualStencilFunc;\nexports.LessStencilFunc = LessStencilFunc;\nexports.Line3 = Line3;\nexports.LinearEncoding = LinearEncoding;\nexports.LinearFilter = LinearFilter;\nexports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;\nexports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;\nexports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;\nexports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;\nexports.LinearSRGBColorSpace = LinearSRGBColorSpace;\nexports.LinearToSRGB = LinearToSRGB;\nexports.LinearToneMapping = LinearToneMapping;\nexports.LoopOnce = LoopOnce;\nexports.LoopPingPong = LoopPingPong;\nexports.LoopRepeat = LoopRepeat;\nexports.LuminanceAlphaFormat = LuminanceAlphaFormat;\nexports.LuminanceFormat = LuminanceFormat;\nexports.MOUSE = MOUSE;\nexports.MathUtils = MathUtils;\nexports.Matrix3 = Matrix3;\nexports.Matrix4 = Matrix4;\nexports.MaxEquation = MaxEquation;\nexports.MinEquation = MinEquation;\nexports.MirroredRepeatWrapping = MirroredRepeatWrapping;\nexports.MixOperation = MixOperation;\nexports.MultiplyBlending = MultiplyBlending;\nexports.MultiplyOperation = MultiplyOperation;\nexports.NearestFilter = NearestFilter;\nexports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;\nexports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;\nexports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;\nexports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;\nexports.NeverDepth = NeverDepth;\nexports.NeverStencilFunc = NeverStencilFunc;\nexports.NoBlending = NoBlending;\nexports.NoColorSpace = NoColorSpace;\nexports.NoToneMapping = NoToneMapping;\nexports.NormalAnimationBlendMode = NormalAnimationBlendMode;\nexports.NormalBlending = NormalBlending;\nexports.NotEqualDepth = NotEqualDepth;\nexports.NotEqualStencilFunc = NotEqualStencilFunc;\nexports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;\nexports.OneFactor = OneFactor;\nexports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;\nexports.OneMinusDstColorFactor = OneMinusDstColorFactor;\nexports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;\nexports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;\nexports.PCFShadowMap = PCFShadowMap;\nexports.PCFSoftShadowMap = PCFSoftShadowMap;\nexports.Plane = Plane;\nexports.Quaternion = Quaternion;\nexports.REVISION = REVISION;\nexports.RGBADepthPacking = RGBADepthPacking;\nexports.RGBAFormat = RGBAFormat;\nexports.RGBAIntegerFormat = RGBAIntegerFormat;\nexports.RGBA_ASTC_10x10_Format = RGBA_ASTC_10x10_Format;\nexports.RGBA_ASTC_10x5_Format = RGBA_ASTC_10x5_Format;\nexports.RGBA_ASTC_10x6_Format = RGBA_ASTC_10x6_Format;\nexports.RGBA_ASTC_10x8_Format = RGBA_ASTC_10x8_Format;\nexports.RGBA_ASTC_12x10_Format = RGBA_ASTC_12x10_Format;\nexports.RGBA_ASTC_12x12_Format = RGBA_ASTC_12x12_Format;\nexports.RGBA_ASTC_4x4_Format = RGBA_ASTC_4x4_Format;\nexports.RGBA_ASTC_5x4_Format = RGBA_ASTC_5x4_Format;\nexports.RGBA_ASTC_5x5_Format = RGBA_ASTC_5x5_Format;\nexports.RGBA_ASTC_6x5_Format = RGBA_ASTC_6x5_Format;\nexports.RGBA_ASTC_6x6_Format = RGBA_ASTC_6x6_Format;\nexports.RGBA_ASTC_8x5_Format = RGBA_ASTC_8x5_Format;\nexports.RGBA_ASTC_8x6_Format = RGBA_ASTC_8x6_Format;\nexports.RGBA_ASTC_8x8_Format = RGBA_ASTC_8x8_Format;\nexports.RGBA_BPTC_Format = RGBA_BPTC_Format;\nexports.RGBA_ETC2_EAC_Format = RGBA_ETC2_EAC_Format;\nexports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format;\nexports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format;\nexports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;\nexports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;\nexports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;\nexports.RGBFormat = RGBFormat;\nexports.RGB_ETC1_Format = RGB_ETC1_Format;\nexports.RGB_ETC2_Format = RGB_ETC2_Format;\nexports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;\nexports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format;\nexports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format;\nexports.RGFormat = RGFormat;\nexports.RGIntegerFormat = RGIntegerFormat;\nexports.Ray = Ray;\nexports.RedFormat = RedFormat;\nexports.RedIntegerFormat = RedIntegerFormat;\nexports.ReinhardToneMapping = ReinhardToneMapping;\nexports.RepeatWrapping = RepeatWrapping;\nexports.ReplaceStencilOp = ReplaceStencilOp;\nexports.ReverseSubtractEquation = ReverseSubtractEquation;\nexports.SRGBColorSpace = SRGBColorSpace;\nexports.SRGBToLinear = SRGBToLinear;\nexports.ShortType = ShortType;\nexports.Sphere = Sphere;\nexports.Spherical = Spherical;\nexports.SrcAlphaFactor = SrcAlphaFactor;\nexports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;\nexports.SrcColorFactor = SrcColorFactor;\nexports.StaticCopyUsage = StaticCopyUsage;\nexports.StaticDrawUsage = StaticDrawUsage;\nexports.StaticReadUsage = StaticReadUsage;\nexports.StreamCopyUsage = StreamCopyUsage;\nexports.StreamDrawUsage = StreamDrawUsage;\nexports.StreamReadUsage = StreamReadUsage;\nexports.SubtractEquation = SubtractEquation;\nexports.SubtractiveBlending = SubtractiveBlending;\nexports.TOUCH = TOUCH;\nexports.TangentSpaceNormalMap = TangentSpaceNormalMap;\nexports.Triangle = Triangle;\nexports.TriangleFanDrawMode = TriangleFanDrawMode;\nexports.TriangleStripDrawMode = TriangleStripDrawMode;\nexports.TrianglesDrawMode = TrianglesDrawMode;\nexports.UVMapping = UVMapping;\nexports.UnsignedByteType = UnsignedByteType;\nexports.UnsignedInt248Type = UnsignedInt248Type;\nexports.UnsignedIntType = UnsignedIntType;\nexports.UnsignedShort4444Type = UnsignedShort4444Type;\nexports.UnsignedShort5551Type = UnsignedShort5551Type;\nexports.UnsignedShortType = UnsignedShortType;\nexports.VSMShadowMap = VSMShadowMap;\nexports.Vector2 = Vector2;\nexports.Vector3 = Vector3;\nexports.Vector4 = Vector4;\nexports.WrapAroundEnding = WrapAroundEnding;\nexports.ZeroCurvatureEnding = ZeroCurvatureEnding;\nexports.ZeroFactor = ZeroFactor;\nexports.ZeroSlopeEnding = ZeroSlopeEnding;\nexports.ZeroStencilOp = ZeroStencilOp;\nexports._SRGBAFormat = _SRGBAFormat;\nexports.sRGBEncoding = sRGBEncoding;\n\n\n//# sourceURL=webpack://manifesto/./node_modules/threejs-math/build/threejs-math.cjs?")}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(t){var n=__webpack_module_cache__[t];if(void 0!==n)return n.exports;var e=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(e.exports,e,e.exports,__webpack_require__),e.exports}getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var e=Object.create(null);__webpack_require__.r(e);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var i=2&n&&t;"object"==typeof i&&!~leafPrototypes.indexOf(i);i=getProto(i))Object.getOwnPropertyNames(i).forEach((n=>r[n]=()=>t[n]));return r.default=()=>t,__webpack_require__.d(e,r),e},__webpack_require__.d=(t,n)=>{for(var e in n)__webpack_require__.o(n,e)&&!__webpack_require__.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/index.ts");manifesto=__webpack_exports__})();
\ No newline at end of file
diff --git a/docs/classes/Annotation.html b/docs/classes/Annotation.html
index 2a416ef0..134bf185 100644
--- a/docs/classes/Annotation.html
+++ b/docs/classes/Annotation.html
@@ -1,4 +1,4 @@
-Annotation | manifesto.js IndexConstructors constructor
+
Annotation | manifesto.js Accessors Look At Location get LookAtLocation( ) : Vector3 Accessors Look At Location get LookAtLocation( ) : Vector3 Returns Vector3 Target get Target( ) : any Returns any Methods Target get Target( ) : any Returns any Methods get Default Label get Default Label ( ) : null | string Returns null | string getIIIFResource Type getIIIFResource Type ( ) : IIIFResourceType Returns IIIFResourceType get Motivation get Motivation ( ) : null | AnnotationMotivation Returns null | AnnotationMotivation get On get On ( ) : string Returns string get Property get Property ( name ) : any Returns any get Property As Object get Property As Object ( name ) : any get Default Label get Default Label ( ) : null | string Returns null | string getIIIFResource Type getIIIFResource Type ( ) : IIIFResourceType Returns IIIFResourceType get Motivation get Motivation ( ) : null | AnnotationMotivation Returns null | AnnotationMotivation get On get On ( ) : string Returns string get Property get Property ( name ) : any Returns any get Property As Object get Property As Object ( name ) : any Returns any get Target get Target ( ) : any Returns any is Annotation is Annotation ( ) : boolean Returns boolean is Canvas is Canvas ( ) : boolean Returns boolean is Collection is Collection ( ) : boolean Returns boolean is Manifest is Manifest ( ) : boolean Returns boolean is Range is Range ( ) : boolean Returns boolean is Scene is Scene ( ) : boolean Returns boolean is Sequence is Sequence ( ) : boolean Returns boolean Private
parse Bodies From Items List get Target get Target ( ) : any Returns any is Annotation is Annotation ( ) : boolean Returns boolean is Canvas is Canvas ( ) : boolean Returns boolean is Collection is Collection ( ) : boolean Returns boolean is Manifest is Manifest ( ) : boolean Returns boolean is Range is Range ( ) : boolean Returns boolean is Scene is Scene ( ) : boolean Returns boolean is Sequence is Sequence ( ) : boolean Returns boolean Private
parse Bodies From Items List Private
parse Singleton Body Private
parse Singleton Body
\ No newline at end of file
+
\ No newline at end of file
diff --git a/docs/classes/AnnotationBody.html b/docs/classes/AnnotationBody.html
index 4f1d02b2..3dc38052 100644
--- a/docs/classes/AnnotationBody.html
+++ b/docs/classes/AnnotationBody.html
@@ -5,7 +5,7 @@
a light, camera, or model, or a SpecificResource object wrapping a light, camera,
or model.
*
- IndexProperties is Annotation Body is Annotation Body : boolean = true
is Camera is Camera : boolean = false
is Light is Light : boolean = false
is Model is Model : boolean = true
is Specific Resource is Specific Resource : boolean = false
Methods get Default Label get Default Label ( ) : null | string Returns null | string get Format get Format ( ) : null | MediaType Returns null | MediaType get Height get Height ( ) : number Returns number getIIIFResource Type getIIIFResource Type ( ) : IIIFResourceType Returns IIIFResourceType get Property get Property ( name ) : any Returns any get Property As Object get Property As Object ( name ) : any Properties is Annotation Body is Annotation Body : boolean = true
is Camera is Camera : boolean = false
is Light is Light : boolean = false
is Model is Model : boolean = true
is Specific Resource is Specific Resource : boolean = false
Methods get Default Label get Default Label ( ) : null | string Returns null | string get Format get Format ( ) : null | MediaType Returns null | MediaType get Height get Height ( ) : number Returns number getIIIFResource Type getIIIFResource Type ( ) : IIIFResourceType Returns IIIFResourceType get Property get Property ( name ) : any Returns any get Property As Object get Property As Object ( name ) : any Returns any get Type get Type ( ) : null | ExternalResourceType Returns null | ExternalResourceType get Width get Width ( ) : number Returns number is Annotation is Annotation ( ) : boolean Returns boolean is Canvas is Canvas ( ) : boolean Returns boolean is Collection is Collection ( ) : boolean Returns boolean is Manifest is Manifest ( ) : boolean Returns boolean is Range is Range ( ) : boolean Returns boolean is Scene is Scene ( ) : boolean Returns boolean is Sequence is Sequence ( ) : boolean Returns boolean
A 3D point coordinate object for the location of an Annotation +