@mappedin/mappedin-js 6.0.1-beta.48 → 6.0.1-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/{GLTFExporter-E2W4AY7T.js → GLTFExporter-ESCDGZUC.js} +2 -2
- package/lib/esm/{GLTFLoader-5VLIZ4BL.js → GLTFLoader-KRE6VVI2.js} +2 -2
- package/lib/esm/{browser-RLBZMV2G.js → browser-BKM6BTVQ.js} +2 -2
- package/lib/esm/{chunk-SBJEVJF3.js → chunk-34JGYGBQ.js} +2 -2
- package/lib/esm/chunk-5N73RBNE.js +2 -0
- package/lib/esm/{chunk-QSFIJRMY.js.map → chunk-5N73RBNE.js.map} +1 -1
- package/lib/esm/{chunk-XFQBHAWO.js → chunk-BBNTGIFB.js} +2 -2
- package/lib/esm/{chunk-XFQBHAWO.js.map → chunk-BBNTGIFB.js.map} +1 -1
- package/lib/esm/chunk-EBEZBJTY.js +2 -0
- package/lib/esm/chunk-EBEZBJTY.js.map +7 -0
- package/lib/esm/{chunk-F7Z3R7GK.js → chunk-QSDIHKLQ.js} +2 -2
- package/lib/esm/{chunk-KTTWH67L.js → chunk-TQZZUEDW.js} +41 -41
- package/lib/esm/{chunk-KTTWH67L.js.map → chunk-TQZZUEDW.js.map} +4 -4
- package/lib/esm/index.d.ts +137 -85
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-PKJEJRJY.js → inspector-UVCVD35T.js} +3 -3
- package/lib/esm/{inspector-PKJEJRJY.js.map → inspector-UVCVD35T.js.map} +2 -2
- package/lib/esm/{internal-DKUILLGA.js → internal-ZOHXUIA6.js} +2 -2
- package/lib/esm/{outdoor-context-v4-4RHE5GJB.js → outdoor-context-v4-B6ZFZFG7.js} +2 -2
- package/lib/esm/{text3d-FHQNCDB4.js → text3d-ACVNKUMC.js} +2 -2
- package/lib/index-rn.js +55 -55
- package/package.json +2 -2
- package/lib/esm/chunk-KDY73CVP.js +0 -2
- package/lib/esm/chunk-KDY73CVP.js.map +0 -7
- package/lib/esm/chunk-QSFIJRMY.js +0 -2
- /package/lib/esm/{GLTFExporter-E2W4AY7T.js.map → GLTFExporter-ESCDGZUC.js.map} +0 -0
- /package/lib/esm/{GLTFLoader-5VLIZ4BL.js.map → GLTFLoader-KRE6VVI2.js.map} +0 -0
- /package/lib/esm/{browser-RLBZMV2G.js.map → browser-BKM6BTVQ.js.map} +0 -0
- /package/lib/esm/{chunk-SBJEVJF3.js.map → chunk-34JGYGBQ.js.map} +0 -0
- /package/lib/esm/{chunk-F7Z3R7GK.js.map → chunk-QSDIHKLQ.js.map} +0 -0
- /package/lib/esm/{internal-DKUILLGA.js.map → internal-ZOHXUIA6.js.map} +0 -0
- /package/lib/esm/{outdoor-context-v4-4RHE5GJB.js.map → outdoor-context-v4-B6ZFZFG7.js.map} +0 -0
- /package/lib/esm/{text3d-FHQNCDB4.js.map → text3d-ACVNKUMC.js.map} +0 -0
package/lib/esm/index.d.ts
CHANGED
|
@@ -368,7 +368,8 @@ declare module '@mappedin/mappedin-js' {
|
|
|
368
368
|
export type { TSpaceType } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
369
369
|
export { Coordinate, Annotation, Connection, Door, Floor, FloorStack, MapObject, PointOfInterest, Space, ImageMetaData, Hyperlink, EnterpriseLocation, EnterpriseCategory, EnterpriseVenue, LocationProfile, LocationCategory, Facade, Node, Area, type Places, } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
370
370
|
export { setWorkersUrl } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api';
|
|
371
|
-
export type { Camera, Models, Labels, BlueDot, Markers, Paths, Exporter,
|
|
371
|
+
export type { Camera, Models, Labels, BlueDot, Markers, Paths, Exporter, Style, Shapes, Outdoor, Images, StackedMaps, } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
|
|
372
|
+
export { Directions } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/directions';
|
|
372
373
|
export type { SearchResult, SearchResultItem, SearchResultEnterpriseCategory, SearchResultEnterpriseLocations, SearchResultPlaces, SearchOptions, Search, Suggestion, MatchInfo, } from '@mappedin/mappedin-js/mappedin-js/src/search';
|
|
373
374
|
export type { TFindNearestOptions, TFindNearestResult, TQueriables, Query } from '@mappedin/mappedin-js/mappedin-js/src/query';
|
|
374
375
|
export type { Analytics, TAnalyticsUpdateState } from '@mappedin/mappedin-js/mappedin-js/src/analytics';
|
|
@@ -422,6 +423,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data' {
|
|
|
422
423
|
*/
|
|
423
424
|
Search: Search;
|
|
424
425
|
Query: Query;
|
|
426
|
+
/**
|
|
427
|
+
* @internal
|
|
428
|
+
*/
|
|
429
|
+
internal: MapDataInternal;
|
|
425
430
|
/**
|
|
426
431
|
* Constructs a new instance of {@link MapData}.
|
|
427
432
|
*
|
|
@@ -2084,6 +2089,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
|
|
|
2084
2089
|
* Height of the geometry element in meters.
|
|
2085
2090
|
*/
|
|
2086
2091
|
height: number;
|
|
2092
|
+
/**
|
|
2093
|
+
* The altitude of the geometry element in meters.
|
|
2094
|
+
*/
|
|
2095
|
+
altitude: number;
|
|
2087
2096
|
/**
|
|
2088
2097
|
* Texture to apply to the geometry element.
|
|
2089
2098
|
*/
|
|
@@ -2182,7 +2191,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
|
|
|
2182
2191
|
/**
|
|
2183
2192
|
* The type for updating the state of map elements (colors, texts, etc.).
|
|
2184
2193
|
*/
|
|
2185
|
-
export type TUpdateState<T> = T extends WALLS ? Partial<TWallsState> : T extends DOORS | Door ? Partial<TDoorsState> : T extends Model ? Partial<UpdateModelState> : T extends Marker ? Partial<TMarkerState> : T extends Label ? Partial<TLabelState> : T extends Space | MapObject ? Partial<TGeometryState> : T extends Floor ? DeepPartial<TFloorState> : T extends Facade ? Partial<TFacadeState> : T extends Shape ? Partial<Omit<TShapeState, '
|
|
2194
|
+
export type TUpdateState<T> = T extends WALLS ? Partial<TWallsState> : T extends DOORS | Door ? Partial<TDoorsState> : T extends Model ? Partial<UpdateModelState> : T extends Marker ? Partial<TMarkerState> : T extends Label ? Partial<TLabelState> : T extends Space | MapObject ? Partial<TGeometryState> : T extends Floor ? DeepPartial<TFloorState> : T extends Facade ? Partial<TFacadeState> : T extends Shape ? Partial<Omit<TShapeState, 'type'>> : T extends Text3D ? UpdatableText3DState : T extends Path ? Partial<TPathState> : T extends PathSegment ? Partial<TPathState> : T extends string ? Record<string, any> : never;
|
|
2186
2195
|
export type TUpdateStates = Partial<Omit<TGeometryState, 'interactive' | 'hoverColor' | 'type'>> | Partial<TMarkerState> | Partial<TLabelState> | Partial<TGeometryState> | Partial<TPathState>;
|
|
2187
2196
|
export type TGetState<T> = T extends WALLS ? TWallsState | undefined : T extends DOORS ? TDoorsState | undefined : T extends Marker ? TMarkerState | undefined : T extends Shape ? TShapeState | undefined : T extends Model ? TModelState | undefined : T extends Label ? TLabelState | undefined : T extends Image ? TImageState | undefined : T extends Text3D ? Text3DState | undefined : T extends Space | MapObject ? TGeometryState | undefined : T extends Floor ? TFloorState | undefined : T extends Facade ? TFacadeState | undefined : T extends Path ? TPathState | undefined : T extends PathSegment ? TPathState | undefined : T extends string ? TLabelState | TGeometryState | TMarkerState | TModelState | TPathState | undefined : never;
|
|
2188
2197
|
/**
|
|
@@ -3769,28 +3778,11 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson' {
|
|
|
3769
3778
|
export { StackedMaps } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/stacked-maps/stacked-maps';
|
|
3770
3779
|
}
|
|
3771
3780
|
|
|
3772
|
-
declare module '@mappedin/mappedin-js/mappedin-js/src/
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
}
|
|
3777
|
-
|
|
3778
|
-
declare module '@mappedin/mappedin-js/mappedin-js/src/query' {
|
|
3779
|
-
export { Query } from '@mappedin/mappedin-js/mappedin-js/src/query/external';
|
|
3780
|
-
export type { TFindNearestOptions, TFindNearestResult, TQueriables } from '@mappedin/mappedin-js/mappedin-js/src/query/external';
|
|
3781
|
-
}
|
|
3782
|
-
|
|
3783
|
-
declare module '@mappedin/mappedin-js/mappedin-js/src/analytics' {
|
|
3784
|
-
export { Analytics, AnalyticsInternal } from '@mappedin/mappedin-js/mappedin-js/src/analytics/customer';
|
|
3785
|
-
export type { AnalyticsUpdateOptions, AnalyticState, TAnalyticsUpdateState } from '@mappedin/mappedin-js/mappedin-js/src/analytics/customer';
|
|
3786
|
-
}
|
|
3787
|
-
|
|
3788
|
-
declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions' {
|
|
3789
|
-
import type { ParsedMVF } from '@mappedin/mvf-v2';
|
|
3790
|
-
import type { DirectionsCollection } from '@packages/internal/geojson-navigator';
|
|
3791
|
-
import { Navigator } from '@packages/internal/geojson-navigator';
|
|
3792
|
-
import { Connection, Coordinate, Node, type MapDataInternal } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
3793
|
-
import type { TDirectionInstruction, TDirectionZone, TNavigationTarget } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
3781
|
+
declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/directions' {
|
|
3782
|
+
import type { DirectionFeature, DirectionsCollection } from '@packages/internal/geojson-navigator';
|
|
3783
|
+
import type { Node, MapDataInternal } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
3784
|
+
import { Coordinate } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
3785
|
+
import type { TDirectionInstruction, TNavigationTarget } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
3794
3786
|
/**
|
|
3795
3787
|
* Represents a set of directions between two points.
|
|
3796
3788
|
*
|
|
@@ -3810,11 +3802,11 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions' {
|
|
|
3810
3802
|
/**
|
|
3811
3803
|
* The selected departure.
|
|
3812
3804
|
*/
|
|
3813
|
-
get departure(): TNavigationTarget;
|
|
3805
|
+
get departure(): TNavigationTarget | undefined;
|
|
3814
3806
|
/**
|
|
3815
3807
|
* The selected destination.
|
|
3816
3808
|
*/
|
|
3817
|
-
get destination(): TNavigationTarget;
|
|
3809
|
+
get destination(): TNavigationTarget | undefined;
|
|
3818
3810
|
/**
|
|
3819
3811
|
* All the coordinates ({@link Coordinate}) of the directions.
|
|
3820
3812
|
*/
|
|
@@ -3827,63 +3819,39 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions' {
|
|
|
3827
3819
|
* The array of instructions ({@link TDirectionInstruction}).
|
|
3828
3820
|
*/
|
|
3829
3821
|
get instructions(): TDirectionInstruction[];
|
|
3830
|
-
}
|
|
3831
|
-
export class DirectionsInternal {
|
|
3832
|
-
navigator: Navigator;
|
|
3833
3822
|
/**
|
|
3834
|
-
*
|
|
3835
|
-
|
|
3836
|
-
constructor({ nodes, geojsonCollection, connections, groupBy, multiplicativeDistanceWeightScaling, }: {
|
|
3837
|
-
nodes: ParsedMVF['node.geojson'];
|
|
3838
|
-
geojsonCollection: ParsedMVF['obstruction'] | ParsedMVF['space'];
|
|
3839
|
-
connections: ParsedMVF['connection.json'];
|
|
3840
|
-
groupBy?: string;
|
|
3841
|
-
multiplicativeDistanceWeightScaling?: boolean;
|
|
3842
|
-
});
|
|
3843
|
-
/**
|
|
3844
|
-
* Get directions between two navigation targets.
|
|
3823
|
+
* Serializes the directions to JSON.
|
|
3824
|
+
* All getter properties are evaluated and included in the serialized output.
|
|
3845
3825
|
*
|
|
3846
|
-
* @
|
|
3847
|
-
* @param from
|
|
3848
|
-
* @param to
|
|
3849
|
-
* @param options
|
|
3850
|
-
* @param mapData
|
|
3851
|
-
*/
|
|
3852
|
-
getDirections: (from: TNavigationTarget[], to: TNavigationTarget[], options: {
|
|
3853
|
-
accessible: boolean;
|
|
3854
|
-
smoothing: {
|
|
3855
|
-
enabled: boolean;
|
|
3856
|
-
radius: number;
|
|
3857
|
-
};
|
|
3858
|
-
zones: TDirectionZone[];
|
|
3859
|
-
excludedConnections: Connection[];
|
|
3860
|
-
connectionIdWeightMap: Record<string, number>;
|
|
3861
|
-
}, mapData: MapDataInternal) => Directions | undefined;
|
|
3862
|
-
/**
|
|
3863
|
-
* Get the node IDs that should be excluded from the navigation graph.
|
|
3864
|
-
*
|
|
3865
|
-
* @hidden
|
|
3866
|
-
* @param excludedConnections {Connection[]}
|
|
3867
|
-
*/
|
|
3868
|
-
getExcludedNodeIds: (excludedConnections: Connection[]) => string[];
|
|
3869
|
-
/**
|
|
3870
|
-
* Get the node IDs of connections that do not match the accessibility setting provided.
|
|
3871
|
-
* A disabled connection node is a connection node that acts as a regular node
|
|
3872
|
-
* (ie. the edges that would cause a floor change are ignored).
|
|
3873
|
-
*
|
|
3874
|
-
* @hidden
|
|
3875
|
-
* @param accessible {boolean}
|
|
3826
|
+
* @returns An object representing the directions with all properties evaluated.
|
|
3876
3827
|
*/
|
|
3877
|
-
|
|
3828
|
+
toJSON(): {
|
|
3829
|
+
directions: DirectionFeature[];
|
|
3830
|
+
__type: string;
|
|
3831
|
+
from: TNavigationTarget[];
|
|
3832
|
+
to: TNavigationTarget[];
|
|
3833
|
+
};
|
|
3878
3834
|
}
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3835
|
+
}
|
|
3836
|
+
|
|
3837
|
+
declare module '@mappedin/mappedin-js/mappedin-js/src/search' {
|
|
3838
|
+
export type { SearchResult, SearchResultItem, SearchOptions, Suggestion, SearchResultEnterpriseCategory, SearchResultEnterpriseLocations, SearchResultPlaces, MatchInfo, } from '@mappedin/mappedin-js/mappedin-js/src/search/internal';
|
|
3839
|
+
export type { SearchState } from '@mappedin/mappedin-js/mappedin-js/src/search/external';
|
|
3840
|
+
export { Search } from '@mappedin/mappedin-js/mappedin-js/src/search/external';
|
|
3841
|
+
}
|
|
3842
|
+
|
|
3843
|
+
declare module '@mappedin/mappedin-js/mappedin-js/src/query' {
|
|
3844
|
+
export { Query } from '@mappedin/mappedin-js/mappedin-js/src/query/external';
|
|
3845
|
+
export type { TFindNearestOptions, TFindNearestResult, TQueriables } from '@mappedin/mappedin-js/mappedin-js/src/query/external';
|
|
3846
|
+
}
|
|
3847
|
+
|
|
3848
|
+
declare module '@mappedin/mappedin-js/mappedin-js/src/analytics' {
|
|
3849
|
+
export { Analytics, AnalyticsInternal } from '@mappedin/mappedin-js/mappedin-js/src/analytics/customer';
|
|
3850
|
+
export type { AnalyticsUpdateOptions, AnalyticState, TAnalyticsUpdateState } from '@mappedin/mappedin-js/mappedin-js/src/analytics/customer';
|
|
3851
|
+
}
|
|
3852
|
+
|
|
3853
|
+
declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions' {
|
|
3854
|
+
export { Directions, DirectionsInternal, getNodesFromTarget } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/index';
|
|
3887
3855
|
}
|
|
3888
3856
|
|
|
3889
3857
|
declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/types' {
|
|
@@ -4326,7 +4294,8 @@ declare module '@mappedin/mappedin-js/mappedin-js/src' {
|
|
|
4326
4294
|
export type { TSpaceType } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
4327
4295
|
export { Coordinate, Annotation, Connection, Door, Floor, FloorStack, MapObject, PointOfInterest, Space, ImageMetaData, Hyperlink, EnterpriseLocation, EnterpriseCategory, EnterpriseVenue, LocationProfile, LocationCategory, Facade, Node, Area, type Places, } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
4328
4296
|
export { setWorkersUrl } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api';
|
|
4329
|
-
export type { Camera, Models, Labels, BlueDot, Markers, Paths, Exporter,
|
|
4297
|
+
export type { Camera, Models, Labels, BlueDot, Markers, Paths, Exporter, Style, Shapes, Outdoor, Images, StackedMaps, } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
|
|
4298
|
+
export { Directions } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/directions';
|
|
4330
4299
|
export type { SearchResult, SearchResultItem, SearchResultEnterpriseCategory, SearchResultEnterpriseLocations, SearchResultPlaces, SearchOptions, Search, Suggestion, MatchInfo, } from '@mappedin/mappedin-js/mappedin-js/src/search';
|
|
4331
4300
|
export type { TFindNearestOptions, TFindNearestResult, TQueriables, Query } from '@mappedin/mappedin-js/mappedin-js/src/query';
|
|
4332
4301
|
export type { Analytics, TAnalyticsUpdateState } from '@mappedin/mappedin-js/mappedin-js/src/analytics';
|
|
@@ -7350,6 +7319,12 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/path' {
|
|
|
7350
7319
|
id: string | number;
|
|
7351
7320
|
coordinates: Coordinate[];
|
|
7352
7321
|
}[]);
|
|
7322
|
+
toJSON(): {
|
|
7323
|
+
__type: string;
|
|
7324
|
+
id: string;
|
|
7325
|
+
coordinates: Coordinate[];
|
|
7326
|
+
segments: PathSegment[];
|
|
7327
|
+
};
|
|
7353
7328
|
}
|
|
7354
7329
|
}
|
|
7355
7330
|
|
|
@@ -9217,6 +9192,10 @@ declare module '@mappedin/mappedin-js/geojson/src/components/mesh' {
|
|
|
9217
9192
|
* The render order of the geometry
|
|
9218
9193
|
*/
|
|
9219
9194
|
renderOrder?: number;
|
|
9195
|
+
/**
|
|
9196
|
+
* The altitude of the geometry element in meters.
|
|
9197
|
+
*/
|
|
9198
|
+
altitude: number;
|
|
9220
9199
|
};
|
|
9221
9200
|
export class MeshComponent {
|
|
9222
9201
|
#private;
|
|
@@ -9250,8 +9229,7 @@ declare module '@mappedin/mappedin-js/geojson/src/components/mesh' {
|
|
|
9250
9229
|
topColor: Color;
|
|
9251
9230
|
} | undefined;
|
|
9252
9231
|
position: Vector3;
|
|
9253
|
-
|
|
9254
|
-
set altitude(value: number);
|
|
9232
|
+
altitude: number;
|
|
9255
9233
|
get opacity(): number;
|
|
9256
9234
|
set opacity(value: number);
|
|
9257
9235
|
get texture(): string;
|
|
@@ -13113,6 +13091,12 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/analytics/customer' {
|
|
|
13113
13091
|
export {};
|
|
13114
13092
|
}
|
|
13115
13093
|
|
|
13094
|
+
declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/index' {
|
|
13095
|
+
export { Directions } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/directions';
|
|
13096
|
+
export { DirectionsInternal } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/directions-internal';
|
|
13097
|
+
export { getNodesFromTarget } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/utils';
|
|
13098
|
+
}
|
|
13099
|
+
|
|
13116
13100
|
declare module '@mappedin/mappedin-js/packages/common/types' {
|
|
13117
13101
|
type Primitive = string | number | boolean | null | undefined;
|
|
13118
13102
|
export type PartialExcept<T, K extends string> = {
|
|
@@ -14966,7 +14950,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/utils' {
|
|
|
14966
14950
|
import type { EntranceCollection, LineString, Polygon, Point, SpaceProperties, ObstructionProperties, StyleCollection, PolygonStyle, LineStringStyle, Feature, ObstructionCollection, PointStyle } from '@mappedin/mvf-v2';
|
|
14967
14951
|
import type { PolygonFeatureProperties } from '@packages/internal/mvf-utils';
|
|
14968
14952
|
import type { BBox, FeatureCollection, MultiLineString } from 'geojson';
|
|
14969
|
-
import type { LabelState, MarkerState, GeometryState, CollisionRankingTier, LineStyle, PaintStyle, Position, EntityId, PathState } from '@mappedin/core-sdk';
|
|
14953
|
+
import type { LabelState, MarkerState, GeometryState, CollisionRankingTier, LineStyle, PaintStyle, Position, EntityId, PathState, GeometryGroupState } from '@mappedin/core-sdk';
|
|
14970
14954
|
import { type TGeometryState, type TLabelState, type TDirectionInstructionAction, type TShow3DMapOptions, type Label, type Marker, type Model, MapData } from '@mappedin/mappedin-js/mappedin-js/src';
|
|
14971
14955
|
import type { IAnchorable, TDoorsState, TMarkerState, TWallsState } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
14972
14956
|
import type { Image, Path, Shape, Text3D } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
|
|
@@ -14984,7 +14968,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/utils' {
|
|
|
14984
14968
|
export function translateMarkerStateToGeojsonCore(state: Partial<TMarkerState>, currentState: Partial<MarkerState>): Partial<MarkerState>;
|
|
14985
14969
|
export function translateDoorsStateToGeojsonCore(state: Partial<TDoorsState>, currentState: Partial<GeometryState>): Partial<GeometryState>;
|
|
14986
14970
|
export function translateWallsStateToGeojsonCore(state: Partial<TWallsState>, currentState: Partial<GeometryState>): Partial<GeometryState>;
|
|
14987
|
-
export function translateSpaceStateToGeojsonCore(state: Partial<TGeometryState>, currentState: Partial<GeometryState>): Partial<GeometryState>;
|
|
14971
|
+
export function translateSpaceStateToGeojsonCore(state: Partial<TGeometryState>, currentState: Partial<GeometryState>, parentState?: Partial<GeometryGroupState>): Partial<GeometryState>;
|
|
14988
14972
|
export function differenceBetweenAngles(a: number, b: number): number;
|
|
14989
14973
|
export function getRelativeBearing(relativeBearingAngle: number, threshold: number): TDirectionInstructionAction['bearing'];
|
|
14990
14974
|
export function convertCollisionRankingTeirToNumber(tier: CollisionRankingTier): number;
|
|
@@ -15038,6 +15022,75 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/floor-stack-ob
|
|
|
15038
15022
|
}
|
|
15039
15023
|
}
|
|
15040
15024
|
|
|
15025
|
+
declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/directions-internal' {
|
|
15026
|
+
import type { ParsedMVF } from '@mappedin/mvf-v2';
|
|
15027
|
+
import { Navigator } from '@packages/internal/geojson-navigator';
|
|
15028
|
+
import type { Connection, MapDataInternal } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
15029
|
+
import type { TDirectionZone, TNavigationTarget } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
15030
|
+
import { Directions } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/directions';
|
|
15031
|
+
export class DirectionsInternal {
|
|
15032
|
+
navigator: Navigator;
|
|
15033
|
+
/**
|
|
15034
|
+
* @hidden
|
|
15035
|
+
*/
|
|
15036
|
+
constructor({ nodes, geojsonCollection, connections, groupBy, multiplicativeDistanceWeightScaling, }: {
|
|
15037
|
+
nodes: ParsedMVF['node.geojson'];
|
|
15038
|
+
geojsonCollection: ParsedMVF['obstruction'] | ParsedMVF['space'];
|
|
15039
|
+
connections: ParsedMVF['connection.json'];
|
|
15040
|
+
groupBy?: string;
|
|
15041
|
+
multiplicativeDistanceWeightScaling?: boolean;
|
|
15042
|
+
});
|
|
15043
|
+
/**
|
|
15044
|
+
* Get directions between two navigation targets.
|
|
15045
|
+
*
|
|
15046
|
+
* @hidden
|
|
15047
|
+
* @param from
|
|
15048
|
+
* @param to
|
|
15049
|
+
* @param options
|
|
15050
|
+
* @param mapData
|
|
15051
|
+
*/
|
|
15052
|
+
getDirections: (from: TNavigationTarget[], to: TNavigationTarget[], options: {
|
|
15053
|
+
accessible: boolean;
|
|
15054
|
+
smoothing: {
|
|
15055
|
+
enabled: boolean;
|
|
15056
|
+
radius: number;
|
|
15057
|
+
};
|
|
15058
|
+
zones: TDirectionZone[];
|
|
15059
|
+
excludedConnections: Connection[];
|
|
15060
|
+
connectionIdWeightMap: Record<string, number>;
|
|
15061
|
+
}, mapData: MapDataInternal) => Directions | undefined;
|
|
15062
|
+
/**
|
|
15063
|
+
* Get the node IDs that should be excluded from the navigation graph.
|
|
15064
|
+
*
|
|
15065
|
+
* @hidden
|
|
15066
|
+
* @param excludedConnections {Connection[]}
|
|
15067
|
+
*/
|
|
15068
|
+
getExcludedNodeIds: (excludedConnections: Connection[]) => string[];
|
|
15069
|
+
/**
|
|
15070
|
+
* Get the node IDs of connections that do not match the accessibility setting provided.
|
|
15071
|
+
* A disabled connection node is a connection node that acts as a regular node
|
|
15072
|
+
* (ie. the edges that would cause a floor change are ignored).
|
|
15073
|
+
*
|
|
15074
|
+
* @hidden
|
|
15075
|
+
* @param accessible {boolean}
|
|
15076
|
+
*/
|
|
15077
|
+
getDisabledConnectionNodeIds: (accessible: boolean) => string[];
|
|
15078
|
+
}
|
|
15079
|
+
}
|
|
15080
|
+
|
|
15081
|
+
declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/utils' {
|
|
15082
|
+
import type { MapDataInternal } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
15083
|
+
import type { TNavigationTarget } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
15084
|
+
/**
|
|
15085
|
+
* Get the nodes from the navigation target.
|
|
15086
|
+
*
|
|
15087
|
+
* @hidden
|
|
15088
|
+
* @param target
|
|
15089
|
+
* @param mapData
|
|
15090
|
+
*/
|
|
15091
|
+
export function getNodesFromTarget(target: TNavigationTarget, mapData: MapDataInternal): string[];
|
|
15092
|
+
}
|
|
15093
|
+
|
|
15041
15094
|
declare module '@mappedin/mappedin-js/geojson/src/components/outline' {
|
|
15042
15095
|
import type { BufferAttribute, BufferGeometry } from 'three';
|
|
15043
15096
|
type Outline = {
|
|
@@ -15157,7 +15210,6 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/interactions/system' {
|
|
|
15157
15210
|
dirty3D: boolean;
|
|
15158
15211
|
get _hitBoxes(): {
|
|
15159
15212
|
entities: (Object3D | EntityMesh<Geometry3D> | EntityBatchedMesh)[];
|
|
15160
|
-
groups: GroupContainerObject3D[];
|
|
15161
15213
|
};
|
|
15162
15214
|
getMouseRayIntersects(): Intersection<Object3D<Object3DEventMap>>[];
|
|
15163
15215
|
destroy(): void;
|
package/lib/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,N as M,O as N,a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r,q as s,r as t,s as u,t as v,u as w,w as x,x as y,z}from"./chunk-TQZZUEDW.js";import{b as a,c as b}from"./chunk-EBEZBJTY.js";import"./chunk-BBNTGIFB.js";import"./chunk-34JGYGBQ.js";import"./chunk-QSDIHKLQ.js";import"./chunk-5N73RBNE.js";import"./chunk-AHC6OWNT.js";export{o as Annotation,g as Area,l as Connection,c as Coordinate,C as DOORS,w as Directions,h as Door,a as E_SDK_LOG_LEVEL,s as EnterpriseCategory,r as EnterpriseLocation,t as EnterpriseVenue,q as Facade,j as Floor,p as FloorStack,e as Hyperlink,f as ImageMetaData,y as LocationCategory,x as LocationProfile,k as MAPPEDIN_COLORS,m as MapObject,d as Node,n as PointOfInterest,i as Space,B as WALLS,G as __setWatermarkOnClickFn,L as createMapLibreOverlay,D as disableText3DWorker,z as enableTestMode,J as getMapData,K as getMapDataEnterprise,F as hydrateMapData,H as hydrateMapDataFromMVF,u as parseMVF,A as preloadFont,b as setLoggerLevel,I as setUseEnterpriseAPI,E as setWorkersUrl,M as show3dMap,N as show3dMapGeojson,v as unzipMVF};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as ut,a as ht,g as j,p as T,q as X}from"./chunk-KTTWH67L.js";import{r as H}from"./chunk-KDY73CVP.js";import"./chunk-XFQBHAWO.js";import"./chunk-SBJEVJF3.js";import{W as ct}from"./chunk-F7Z3R7GK.js";import{a as v}from"./chunk-QSFIJRMY.js";import{f as O,g as y,h as D,i as dt,j as B}from"./chunk-AHC6OWNT.js";v();v();v();v();var S=class i{constructor(t,o,e,n,r="div"){this.parent=t,this.object=o,this.property=e,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(r),this.domElement.classList.add("controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("name"),i.nextNameID=i.nextNameID||0,this.$name.id=`lil-gui-name-${++i.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",s=>s.stopPropagation()),this.domElement.addEventListener("keyup",s=>s.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(e)}name(t){return this._name=t,this.$name.textContent=t,this}onChange(t){return this._onChange=t,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(t=!0){return this.disable(!t)}disable(t=!0){return t===this._disabled?this:(this._disabled=t,this.domElement.classList.toggle("disabled",t),this.$disable.toggleAttribute("disabled",t),this)}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(t){let o=this.parent.add(this.object,this.property,t);return o.name(this._name),this.destroy(),o}min(t){return this}max(t){return this}step(t){return this}decimals(t){return this}listen(t=!0){return this._listening=t,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let t=this.save();t!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=t}getValue(){return this.object[this.property]}setValue(t){return this.getValue()!==t&&(this.object[this.property]=t,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(t){return this.setValue(t),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},Z=class extends S{constructor(t,o,e){super(t,o,e,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function Q(i){let t,o;return(t=i.match(/(#|0x)?([a-f0-9]{6})/i))?o=t[2]:(t=i.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?o=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=i.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(o=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),o?"#"+o:!1}var Ot={isPrimitive:!0,match:i=>typeof i=="string",fromHexString:Q,toHexString:Q},z={isPrimitive:!0,match:i=>typeof i=="number",fromHexString:i=>parseInt(i.substring(1),16),toHexString:i=>"#"+i.toString(16).padStart(6,0)},Dt={isPrimitive:!1,match:i=>Array.isArray(i),fromHexString(i,t,o=1){let e=z.fromHexString(i);t[0]=(e>>16&255)/255*o,t[1]=(e>>8&255)/255*o,t[2]=(e&255)/255*o},toHexString([i,t,o],e=1){e=255/e;let n=i*e<<16^t*e<<8^o*e<<0;return z.toHexString(n)}},Tt={isPrimitive:!1,match:i=>Object(i)===i,fromHexString(i,t,o=1){let e=z.fromHexString(i);t.r=(e>>16&255)/255*o,t.g=(e>>8&255)/255*o,t.b=(e&255)/255*o},toHexString({r:i,g:t,b:o},e=1){e=255/e;let n=i*e<<16^t*e<<8^o*e<<0;return z.toHexString(n)}},Gt=[Ot,z,Dt,Tt];function Bt(i){return Gt.find(t=>t.match(i))}var K=class extends S{constructor(t,o,e,n){super(t,o,e,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=Bt(this.initialValue),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let r=Q(this.$text.value);r&&this._setValueFromHexString(r)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(t){if(this._format.isPrimitive){let o=this._format.fromHexString(t);this.setValue(o)}else this._format.fromHexString(t,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(t){return this._setValueFromHexString(t),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},U=class extends S{constructor(t,o,e){super(t,o,e,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},q=class extends S{constructor(t,o,e,n,r,s){super(t,o,e,"number"),this._initInput(),this.min(n),this.max(r);let a=s!==void 0;this.step(a?s:this._getImplicitStep(),a),this.updateDisplay()}decimals(t){return this._decimals=t,this.updateDisplay(),this}min(t){return this._min=t,this._onUpdateMinMax(),this}max(t){return this._max=t,this._onUpdateMinMax(),this}step(t,o=!0){return this._step=t,this._stepExplicit=o,this}updateDisplay(){let t=this.getValue();if(this._hasSlider){let o=(t-this._min)/(this._max-this._min);o=Math.max(0,Math.min(o,1)),this.$fill.style.width=o*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?t:t.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let o=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},e=b=>{let A=parseFloat(this.$input.value);isNaN(A)||(this._snapClampSetValue(A+b),this.$input.value=this.getValue())},n=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),e(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),e(this._step*this._arrowKeyMultiplier(b)*-1))},r=b=>{this._inputFocused&&(b.preventDefault(),e(this._step*this._normalizeMouseWheel(b)))},s=!1,a,d,g,c,u,p=5,l=b=>{a=b.clientX,d=g=b.clientY,s=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",h),window.addEventListener("mouseup",m)},h=b=>{if(s){let A=b.clientX-a,I=b.clientY-d;Math.abs(I)>p?(b.preventDefault(),this.$input.blur(),s=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(A)>p&&m()}if(!s){let A=b.clientY-g;u-=A*this._step*this._arrowKeyMultiplier(b),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}g=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",m)},C=()=>{this._inputFocused=!0},f=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",o),this.$input.addEventListener("keydown",n),this.$input.addEventListener("wheel",r,{passive:!1}),this.$input.addEventListener("mousedown",l),this.$input.addEventListener("focus",C),this.$input.addEventListener("blur",f)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let t=(f,b,A,I,x)=>(f-b)/(A-b)*(x-I)+I,o=f=>{let b=this.$slider.getBoundingClientRect(),A=t(f,b.left,b.right,this._min,this._max);this._snapClampSetValue(A)},e=f=>{this._setDraggingStyle(!0),o(f.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",r)},n=f=>{o(f.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",r)},s=!1,a,d,g=f=>{f.preventDefault(),this._setDraggingStyle(!0),o(f.touches[0].clientX),s=!1},c=f=>{f.touches.length>1||(this._hasScrollBar?(a=f.touches[0].clientX,d=f.touches[0].clientY,s=!0):g(f),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",p))},u=f=>{if(s){let b=f.touches[0].clientX-a,A=f.touches[0].clientY-d;Math.abs(b)>Math.abs(A)?g(f):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",p))}else f.preventDefault(),o(f.touches[0].clientX)},p=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",p)},l=this._callOnFinishChange.bind(this),h=400,m,C=f=>{if(Math.abs(f.deltaX)<Math.abs(f.deltaY)&&this._hasScrollBar)return;f.preventDefault();let A=this._normalizeMouseWheel(f)*this._step;this._snapClampSetValue(this.getValue()+A),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(l,h)};this.$slider.addEventListener("mousedown",e),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",C,{passive:!1})}_setDraggingStyle(t,o="horizontal"){this.$slider&&this.$slider.classList.toggle("active",t),document.body.classList.toggle("lil-gui-dragging",t),document.body.classList.toggle(`lil-gui-${o}`,t)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(t){let{deltaX:o,deltaY:e}=t;return Math.floor(t.deltaY)!==t.deltaY&&t.wheelDelta&&(o=0,e=-t.wheelDelta/120,e*=this._stepExplicit?1:10),o+-e}_arrowKeyMultiplier(t){let o=this._stepExplicit?1:10;return t.shiftKey?o*=10:t.altKey&&(o/=10),o}_snap(t){let o=Math.round(t/this._step)*this._step;return parseFloat(o.toPrecision(15))}_clamp(t){return t<this._min&&(t=this._min),t>this._max&&(t=this._max),t}_snapClampSetValue(t){this.setValue(this._clamp(this._snap(t)))}get _hasScrollBar(){let t=this.parent.root.$children;return t.scrollHeight>t.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},V=class extends S{constructor(t,o,e,n){super(t,o,e,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(n)}options(t){return this._values=Array.isArray(t)?t:Object.values(t),this._names=Array.isArray(t)?t:Object.keys(t),this.$select.replaceChildren(),this._names.forEach(o=>{let e=document.createElement("option");e.textContent=o,this.$select.appendChild(e)}),this.updateDisplay(),this}updateDisplay(){let t=this.getValue(),o=this._values.indexOf(t);return this.$select.selectedIndex=o,this.$display.textContent=o===-1?t:this._names[o],this}},tt=class extends S{constructor(t,o,e){super(t,o,e,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},Ht=`.lil-gui {
|
|
1
|
+
import{B as ut,a as ht,g as j,p as T,q as X}from"./chunk-TQZZUEDW.js";import{r as H}from"./chunk-EBEZBJTY.js";import"./chunk-BBNTGIFB.js";import"./chunk-34JGYGBQ.js";import{W as ct}from"./chunk-QSDIHKLQ.js";import{a as v}from"./chunk-5N73RBNE.js";import{f as O,g as y,h as D,i as dt,j as B}from"./chunk-AHC6OWNT.js";v();v();v();v();var S=class i{constructor(t,o,e,n,r="div"){this.parent=t,this.object=o,this.property=e,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(r),this.domElement.classList.add("controller"),this.domElement.classList.add(n),this.$name=document.createElement("div"),this.$name.classList.add("name"),i.nextNameID=i.nextNameID||0,this.$name.id=`lil-gui-name-${++i.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",s=>s.stopPropagation()),this.domElement.addEventListener("keyup",s=>s.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(e)}name(t){return this._name=t,this.$name.textContent=t,this}onChange(t){return this._onChange=t,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(t=!0){return this.disable(!t)}disable(t=!0){return t===this._disabled?this:(this._disabled=t,this.domElement.classList.toggle("disabled",t),this.$disable.toggleAttribute("disabled",t),this)}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(t){let o=this.parent.add(this.object,this.property,t);return o.name(this._name),this.destroy(),o}min(t){return this}max(t){return this}step(t){return this}decimals(t){return this}listen(t=!0){return this._listening=t,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let t=this.save();t!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=t}getValue(){return this.object[this.property]}setValue(t){return this.getValue()!==t&&(this.object[this.property]=t,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(t){return this.setValue(t),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},Z=class extends S{constructor(t,o,e){super(t,o,e,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function Q(i){let t,o;return(t=i.match(/(#|0x)?([a-f0-9]{6})/i))?o=t[2]:(t=i.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?o=parseInt(t[1]).toString(16).padStart(2,0)+parseInt(t[2]).toString(16).padStart(2,0)+parseInt(t[3]).toString(16).padStart(2,0):(t=i.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(o=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]),o?"#"+o:!1}var Ot={isPrimitive:!0,match:i=>typeof i=="string",fromHexString:Q,toHexString:Q},z={isPrimitive:!0,match:i=>typeof i=="number",fromHexString:i=>parseInt(i.substring(1),16),toHexString:i=>"#"+i.toString(16).padStart(6,0)},Dt={isPrimitive:!1,match:i=>Array.isArray(i),fromHexString(i,t,o=1){let e=z.fromHexString(i);t[0]=(e>>16&255)/255*o,t[1]=(e>>8&255)/255*o,t[2]=(e&255)/255*o},toHexString([i,t,o],e=1){e=255/e;let n=i*e<<16^t*e<<8^o*e<<0;return z.toHexString(n)}},Tt={isPrimitive:!1,match:i=>Object(i)===i,fromHexString(i,t,o=1){let e=z.fromHexString(i);t.r=(e>>16&255)/255*o,t.g=(e>>8&255)/255*o,t.b=(e&255)/255*o},toHexString({r:i,g:t,b:o},e=1){e=255/e;let n=i*e<<16^t*e<<8^o*e<<0;return z.toHexString(n)}},Gt=[Ot,z,Dt,Tt];function Bt(i){return Gt.find(t=>t.match(i))}var K=class extends S{constructor(t,o,e,n){super(t,o,e,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=Bt(this.initialValue),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let r=Q(this.$text.value);r&&this._setValueFromHexString(r)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(t){if(this._format.isPrimitive){let o=this._format.fromHexString(t);this.setValue(o)}else this._format.fromHexString(t,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(t){return this._setValueFromHexString(t),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},U=class extends S{constructor(t,o,e){super(t,o,e,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",n=>{n.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},q=class extends S{constructor(t,o,e,n,r,s){super(t,o,e,"number"),this._initInput(),this.min(n),this.max(r);let a=s!==void 0;this.step(a?s:this._getImplicitStep(),a),this.updateDisplay()}decimals(t){return this._decimals=t,this.updateDisplay(),this}min(t){return this._min=t,this._onUpdateMinMax(),this}max(t){return this._max=t,this._onUpdateMinMax(),this}step(t,o=!0){return this._step=t,this._stepExplicit=o,this}updateDisplay(){let t=this.getValue();if(this._hasSlider){let o=(t-this._min)/(this._max-this._min);o=Math.max(0,Math.min(o,1)),this.$fill.style.width=o*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?t:t.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let o=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},e=b=>{let A=parseFloat(this.$input.value);isNaN(A)||(this._snapClampSetValue(A+b),this.$input.value=this.getValue())},n=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),e(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),e(this._step*this._arrowKeyMultiplier(b)*-1))},r=b=>{this._inputFocused&&(b.preventDefault(),e(this._step*this._normalizeMouseWheel(b)))},s=!1,a,d,g,c,u,p=5,l=b=>{a=b.clientX,d=g=b.clientY,s=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",h),window.addEventListener("mouseup",m)},h=b=>{if(s){let A=b.clientX-a,I=b.clientY-d;Math.abs(I)>p?(b.preventDefault(),this.$input.blur(),s=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(A)>p&&m()}if(!s){let A=b.clientY-g;u-=A*this._step*this._arrowKeyMultiplier(b),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}g=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",m)},C=()=>{this._inputFocused=!0},f=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",o),this.$input.addEventListener("keydown",n),this.$input.addEventListener("wheel",r,{passive:!1}),this.$input.addEventListener("mousedown",l),this.$input.addEventListener("focus",C),this.$input.addEventListener("blur",f)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let t=(f,b,A,I,x)=>(f-b)/(A-b)*(x-I)+I,o=f=>{let b=this.$slider.getBoundingClientRect(),A=t(f,b.left,b.right,this._min,this._max);this._snapClampSetValue(A)},e=f=>{this._setDraggingStyle(!0),o(f.clientX),window.addEventListener("mousemove",n),window.addEventListener("mouseup",r)},n=f=>{o(f.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",r)},s=!1,a,d,g=f=>{f.preventDefault(),this._setDraggingStyle(!0),o(f.touches[0].clientX),s=!1},c=f=>{f.touches.length>1||(this._hasScrollBar?(a=f.touches[0].clientX,d=f.touches[0].clientY,s=!0):g(f),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",p))},u=f=>{if(s){let b=f.touches[0].clientX-a,A=f.touches[0].clientY-d;Math.abs(b)>Math.abs(A)?g(f):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",p))}else f.preventDefault(),o(f.touches[0].clientX)},p=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",p)},l=this._callOnFinishChange.bind(this),h=400,m,C=f=>{if(Math.abs(f.deltaX)<Math.abs(f.deltaY)&&this._hasScrollBar)return;f.preventDefault();let A=this._normalizeMouseWheel(f)*this._step;this._snapClampSetValue(this.getValue()+A),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(l,h)};this.$slider.addEventListener("mousedown",e),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",C,{passive:!1})}_setDraggingStyle(t,o="horizontal"){this.$slider&&this.$slider.classList.toggle("active",t),document.body.classList.toggle("lil-gui-dragging",t),document.body.classList.toggle(`lil-gui-${o}`,t)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(t){let{deltaX:o,deltaY:e}=t;return Math.floor(t.deltaY)!==t.deltaY&&t.wheelDelta&&(o=0,e=-t.wheelDelta/120,e*=this._stepExplicit?1:10),o+-e}_arrowKeyMultiplier(t){let o=this._stepExplicit?1:10;return t.shiftKey?o*=10:t.altKey&&(o/=10),o}_snap(t){let o=Math.round(t/this._step)*this._step;return parseFloat(o.toPrecision(15))}_clamp(t){return t<this._min&&(t=this._min),t>this._max&&(t=this._max),t}_snapClampSetValue(t){this.setValue(this._clamp(this._snap(t)))}get _hasScrollBar(){let t=this.parent.root.$children;return t.scrollHeight>t.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},V=class extends S{constructor(t,o,e,n){super(t,o,e,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(n)}options(t){return this._values=Array.isArray(t)?t:Object.values(t),this._names=Array.isArray(t)?t:Object.keys(t),this.$select.replaceChildren(),this._names.forEach(o=>{let e=document.createElement("option");e.textContent=o,this.$select.appendChild(e)}),this.updateDisplay(),this}updateDisplay(){let t=this.getValue(),o=this._values.indexOf(t);return this.$select.selectedIndex=o,this.$display.textContent=o===-1?t:this._names[o],this}},tt=class extends S{constructor(t,o,e){super(t,o,e,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",n=>{n.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},Ht=`.lil-gui {
|
|
2
2
|
font-family: var(--font-family);
|
|
3
3
|
font-size: var(--font-size);
|
|
4
4
|
line-height: 1;
|
|
@@ -422,7 +422,7 @@ import{A as ut,a as ht,g as j,p as T,q as X}from"./chunk-KTTWH67L.js";import{r a
|
|
|
422
422
|
}`;function Ut(i){let t=document.createElement("style");t.innerHTML=i;let o=document.querySelector("head link[rel=stylesheet], head style");o?document.head.insertBefore(t,o):document.head.appendChild(t)}var pt=!1,G=class i{constructor({parent:t,autoPlace:o=t===void 0,container:e,width:n,title:r="Controls",closeFolders:s=!1,injectStyles:a=!0,touchStyles:d=!0}={}){if(this.parent=t,this.root=t?t.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",g=>{(g.code==="Enter"||g.code==="Space")&&(g.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(r),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),d&&this.domElement.classList.add("allow-touch-styles"),!pt&&a&&(Ut(Ht),pt=!0),e?e.appendChild(this.domElement):o&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this._closeFolders=s}add(t,o,e,n,r){if(Object(e)===e)return new V(this,t,o,e);let s=t[o];switch(typeof s){case"number":return new q(this,t,o,e,n,r);case"boolean":return new Z(this,t,o);case"string":return new tt(this,t,o);case"function":return new U(this,t,o)}console.error(`gui.add failed
|
|
423
423
|
property:`,o,`
|
|
424
424
|
object:`,t,`
|
|
425
|
-
value:`,s)}addColor(t,o,e=1){return new K(this,t,o,e)}addFolder(t){let o=new i({parent:this,title:t});return this.root._closeFolders&&o.close(),o}load(t,o=!0){return t.controllers&&this.controllers.forEach(e=>{e instanceof U||e._name in t.controllers&&e.load(t.controllers[e._name])}),o&&t.folders&&this.folders.forEach(e=>{e._title in t.folders&&e.load(t.folders[e._title])}),this}save(t=!0){let o={controllers:{},folders:{}};return this.controllers.forEach(e=>{if(!(e instanceof U)){if(e._name in o.controllers)throw new Error(`Cannot save GUI with duplicate property "${e._name}"`);o.controllers[e._name]=e.save()}}),t&&this.folders.forEach(e=>{if(e._title in o.folders)throw new Error(`Cannot save GUI with duplicate folder "${e._title}"`);o.folders[e._title]=e.save()}),o}open(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(t){this._closed!==t&&(this._closed=t,this._callOnOpenClose(this))}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let o=this.$children.clientHeight;this.$children.style.height=o+"px",this.domElement.classList.add("transition");let e=r=>{r.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",e))};this.$children.addEventListener("transitionend",e);let n=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(t){return this._title=t,this.$title.textContent=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(e=>e.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onOpenClose(t){return this._onOpenClose=t,this}_callOnOpenClose(t){this.parent&&this.parent._callOnOpenClose(t),this._onOpenClose!==void 0&&this._onOpenClose.call(this,t)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(o=>{t=t.concat(o.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(o=>{t=t.concat(o.foldersRecursive())}),t}},Y=G;v();v();var w=(()=>{let i=new ct;return function(o){return i.set(o),`#${i.getHexString()}`}})();function gt(i){let t;for(t of i)t()}function et(i,t){let o=window.location.href,e=new URL(o),n=new URLSearchParams(e.search);for(let r in i)if(i.hasOwnProperty(r)){let s=`${t}.${r}`;n.set(s,i[r])}e.search=n.toString(),history.pushState({path:e.toString()},"",e.toString())}function it(i,t){let o=new URLSearchParams(window.location.search),e={};for(let[n,r]of o)if(n.startsWith(`${i}.`)){let s=n.slice(i.length+1);r==="true"||r==="false"?e[s]=r==="true":typeof t?.[s]=="number"?e[s]=Number(r):e[s]=r}return{namespace:i,params:e}}var zt=["interactive"];function N(i,t,o){let e=o.addFolder(`${t.type}-${t.id}`);for(let n in t){if(n==="visible"&&e.add(t,n).onChange(r=>{i.updateState(t.id,{[n]:r})}),n==="color"||n==="hoverColor"){t[n]=w(t[n]),e.addColor(t,n).onChange(r=>{i.updateState(t.id,{[n]:r})});continue}if(n==="height"){e.add(t,n,0,20,1).onChange(r=>{i.updateState(t.id,{[n]:r})});continue}if(n==="texture"&&t.texture){e.addFolder("Texture - side").add(t,"texture")?.onChange(s=>{i.updateState(t.id,{texture:{url:s}})});continue}if(n==="topTexture"&&t.topTexture){e.addFolder("Texture - top").add(t,"topTexture")?.onChange(s=>{i.updateState(t.id,{topTexture:{url:s}})});continue}if(n==="opacity"){e.add(t,n,0,1,.1).onChange(r=>{i.updateState(t.id,{[n]:r})});continue}zt.includes(n)&&e.add(t,n).onChange(r=>{i.updateState(t.id,{[n]:r})})}return t.isInView&&(e.add(t,"isInView").listen().disable(),e.add(t,"isInViewCheck")),{cleanup(){e.destroy()}}}v();v();function Pt(){let i=[];function t(n,r){let s=Object.values(n.getMapData())[0],a=r;if(a&&j.is(a)){let d=s.getByType("enterprise-location")?.find(g=>g.spaces.some(c=>c.id===a.id));d&&(a=d)}return a}async function o(n,r){return r instanceof X?n.Camera.focusOn(r.locations.flatMap(s=>s.spaces),P):r instanceof T?n.Camera.focusOn(r.spaces,P):n.Camera.focusOn(r,P)}function e(n,r,{focus:s=!1}={}){if(!window.enableHighlightCard)return()=>{};let a=t(n,r),d=document.createElement("div");if(d.style.cssText=`
|
|
425
|
+
value:`,s)}addColor(t,o,e=1){return new K(this,t,o,e)}addFolder(t){let o=new i({parent:this,title:t});return this.root._closeFolders&&o.close(),o}load(t,o=!0){return t.controllers&&this.controllers.forEach(e=>{e instanceof U||e._name in t.controllers&&e.load(t.controllers[e._name])}),o&&t.folders&&this.folders.forEach(e=>{e._title in t.folders&&e.load(t.folders[e._title])}),this}save(t=!0){let o={controllers:{},folders:{}};return this.controllers.forEach(e=>{if(!(e instanceof U)){if(e._name in o.controllers)throw new Error(`Cannot save GUI with duplicate property "${e._name}"`);o.controllers[e._name]=e.save()}}),t&&this.folders.forEach(e=>{if(e._title in o.folders)throw new Error(`Cannot save GUI with duplicate folder "${e._title}"`);o.folders[e._title]=e.save()}),o}open(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(t){this._closed!==t&&(this._closed=t,this._callOnOpenClose(this))}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._setClosed(!t),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let o=this.$children.clientHeight;this.$children.style.height=o+"px",this.domElement.classList.add("transition");let e=r=>{r.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",e))};this.$children.addEventListener("transitionend",e);let n=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(t){return this._title=t,this.$title.textContent=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(e=>e.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),this._onChange!==void 0&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onOpenClose(t){return this._onOpenClose=t,this}_callOnOpenClose(t){this.parent&&this.parent._callOnOpenClose(t),this._onOpenClose!==void 0&&this._onOpenClose.call(this,t)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(o=>{t=t.concat(o.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(o=>{t=t.concat(o.foldersRecursive())}),t}},Y=G;v();v();var w=(()=>{let i=new ct;return function(o){return i.set(o),`#${i.getHexString()}`}})();function gt(i){let t;for(t of i)t()}function et(i,t){let o=window.location.href,e=new URL(o),n=new URLSearchParams(e.search);for(let r in i)if(i.hasOwnProperty(r)){let s=`${t}.${r}`;n.set(s,i[r])}e.search=n.toString(),history.pushState({path:e.toString()},"",e.toString())}function it(i,t){let o=new URLSearchParams(window.location.search),e={};for(let[n,r]of o)if(n.startsWith(`${i}.`)){let s=n.slice(i.length+1);r==="true"||r==="false"?e[s]=r==="true":typeof t?.[s]=="number"?e[s]=Number(r):e[s]=r}return{namespace:i,params:e}}var zt=["interactive"];function N(i,t,o){let e=o.addFolder(`${t.type}-${t.id}`);for(let n in t){if(n==="visible"&&e.add(t,n).onChange(r=>{i.updateState(t.id,{[n]:r})}),n==="color"||n==="hoverColor"){t[n]=w(t[n]),e.addColor(t,n).onChange(r=>{i.updateState(t.id,{[n]:r})});continue}if(n==="height"){e.add(t,n,0,20,1).onChange(r=>{i.updateState(t.id,{[n]:r})});continue}if(n==="texture"&&t.texture){e.addFolder("Texture - side").add(t,"texture")?.onChange(s=>{i.updateState(t.id,{texture:{url:s}})});continue}if(n==="topTexture"&&t.topTexture){e.addFolder("Texture - top").add(t,"topTexture")?.onChange(s=>{i.updateState(t.id,{topTexture:{url:s}})});continue}if(n==="opacity"){e.add(t,n,0,1,.1).onChange(r=>{i.updateState(t.id,{[n]:r})});continue}if(n==="altitude"){e.add(t,n,0,100,1).onChange(r=>{i.updateState(t.id,{[n]:r})});continue}zt.includes(n)&&e.add(t,n).onChange(r=>{i.updateState(t.id,{[n]:r})})}return t.isInView&&(e.add(t,"isInView").listen().disable(),e.add(t,"isInViewCheck")),{cleanup(){e.destroy()}}}v();v();function Pt(){let i=[];function t(n,r){let s=Object.values(n.getMapData())[0],a=r;if(a&&j.is(a)){let d=s.getByType("enterprise-location")?.find(g=>g.spaces.some(c=>c.id===a.id));d&&(a=d)}return a}async function o(n,r){return r instanceof X?n.Camera.focusOn(r.locations.flatMap(s=>s.spaces),P):r instanceof T?n.Camera.focusOn(r.spaces,P):n.Camera.focusOn(r,P)}function e(n,r,{focus:s=!1}={}){if(!window.enableHighlightCard)return()=>{};let a=t(n,r),d=document.createElement("div");if(d.style.cssText=`
|
|
426
426
|
position: absolute;
|
|
427
427
|
top: 20px;
|
|
428
428
|
left: 20px;
|
|
@@ -480,4 +480,4 @@ import{A as ut,a as ht,g as j,p as T,q as X}from"./chunk-KTTWH67L.js";import{r a
|
|
|
480
480
|
<br>
|
|
481
481
|
<span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>
|
|
482
482
|
</div>`,{rank:"always-visible"});g.add(p),i.push(l)}})})}return()=>{i.forEach(d=>n.Markers.remove(d))}}}}var P={duration:300,easing:"ease-in-out"},W=Pt();v();var E={search:"",results:void 0,options:{places:{fields:{name:!0,description:!0,link:!0,category:!0},limit:5},locations:{fields:{name:!0,tag:!0,description:!0},limit:5},categories:{fields:{name:!0},limit:5}}};function Rt(i){i.add(E.options.places.fields,"name").name("Places: Name"),i.add(E.options.places.fields,"description").name("Places: Description"),i.add(E.options.places.fields,"link").name("Places: Link"),i.add(E.options.places.fields,"category").name("Places: Category"),i.add(E.options.places,"limit"),i.add(E.options.locations.fields,"name").name("Locations: Name"),i.add(E.options.locations.fields,"tag").name("Locations: Tag"),i.add(E.options.locations.fields,"description").name("Locations: Description"),i.add(E.options.places,"limit"),i.add(E.options.categories.fields,"name").name("Categories: Name")}function ft(i,t,o){let e=new H,n=o.addFolder("Search");n.open();let r=n.add(E,"search").onChange(async c=>{let u=await t.Search.query(c,E.options);u&&(E.results=u,a(u,e))}),s=document.createElement("div");s.style.marginLeft="10px",r.domElement.parentElement?.appendChild(s);let{renderSearch:a,close:d}=jt(i,t,s,r.$input),g=n.addFolder("Advanced");return g.close(),Rt(g),document.addEventListener("keydown",c=>{(c.metaKey||c.ctrlKey)&&c.key==="k"?(c.preventDefault(),n._closed&&n.open(),r.$input.focus()):c.key==="Escape"&&(d(),e.publish("highlight",void 0))}),{pubsub:e}}function jt(i,t,o,e){let n,r;e.addEventListener("input",async a=>{a instanceof InputEvent&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")&&(clearTimeout(n),n=setTimeout(async()=>{let d=await t.Search.suggest(e.value);d&&d.length>0&&s(d[0]?.suggestion)},100))});function s(a){if(!a){e.placeholder="";return}let d=e.value;e.value=a,e.setSelectionRange(d.length,a.length)}return{renderSearch(a,d){if(a.places.length===0&&a.enterpriseCategories?.length===0&&a.enterpriseLocations?.length===0){o.textContent="No results found.";return}r=Xt(o,a,i,d)},close(){r.destroy()}}}function Xt(i,t,o,e){i.innerHTML="";let n=document.createElement("div");Object.assign(n.style,J.dropdownContainer);let r=document.createElement("ul");r.className="options-list",Object.assign(r.style,J.optionsList),r.style.display="block";let s=[],a=(p,l)=>{if(l&&l.length>0){let h=document.createElement("li");h.textContent=p,Object.assign(h.style,J.sectionHeader),r.appendChild(h),l.forEach((m,C)=>{let f=document.createElement("li");f.textContent=`${"name"in m.item?m.item.name:""} (${m.type})`,Object.assign(f.style,J.option),f.tabIndex=0,f.addEventListener("focus",()=>{g(s.indexOf(f))}),f.addEventListener("mouseover",()=>{f.style.backgroundColor="#f0f0f0"}),f.addEventListener("mouseout",()=>{f.style.backgroundColor=""}),f.addEventListener("click",()=>{}),f.setAttribute("data-type",p),f.setAttribute("data-index",C.toString()),r.appendChild(f),s.push(f)})}};a("enterpriseLocations",t.enterpriseLocations),a("enterpriseCategories",t.enterpriseCategories),a("Places",t.places),n.appendChild(r),i.appendChild(n);let d=[],g=p=>{d.forEach(f=>f()),d=[],s.forEach((f,b)=>{b===p?f.style.backgroundColor="#e0e0e0":f.style.backgroundColor=""});let l=s[p],h=l.getAttribute("data-type"),m=parseInt(l.getAttribute("data-index")||"0",10);if(!h)return;let{item:C}=t[h.toLowerCase()][m];e.publish("highlight",C)},c=p=>{!n.contains(p.target)&&p.target!==i&&u()};document.addEventListener("click",c);let u=()=>{i.innerHTML="",document.removeEventListener("click",c)};return{destroy(){i.innerHTML="",e.publish("highlight",void 0)}}}var J={dropdownContainer:{position:"absolute",color:"#202020"},optionsList:{display:"block",zIndex:"1002",position:"relative",maxHeight:"200px",overflowY:"auto",border:"1px solid #ccc",backgroundColor:"#fff",listStyleType:"none",margin:"0",padding:"0"},sectionHeader:{fontWeight:"bold",padding:"5px",backgroundColor:"#f0f0f0"},option:{padding:"5px",cursor:"pointer"}};function mt(i,t,o){o.domElement.id="interactionPanel";let e=[],{pubsub:n}=ft(i,t,o);n.on("highlight",c=>{if(c){e.forEach(p=>p()),e=[];let u=c instanceof T?c.spaces[0]:c;if(i.Camera.focusOn(c),u&&!j.is(u))return;e.push(W.highlightCard(i,u,{focus:!0}))}else e.forEach(u=>u()),e=[]});let r=o.addFolder("Click \u{1F447}").close(),{sub:s}=Yt(i,r);s.on("click",c=>{e.forEach(u=>u()),e=[],c.spaces[0]&&(e=[W.highlightCard(i,c.spaces[0])])});let a=o.addFolder("Hover \u{1F681}").close(),{sub:d}=Nt(i,a),g;d.on("hover",c=>{c.spaces[0]?(g?.(),e.length===0&&(g=W.highlightCard(i,c.spaces[0]))):(g?.(),g=void 0)})}function Yt(i,t){let o=new H,e={position:"",hoverColor:w(i.getHoverColor())},n=t.add(e,"position").disable(),r=[];function s(){r.forEach(d=>d()),r.length=0}let a=0;return i.on("click",d=>{let{labels:g,markers:c,coordinate:u}=d;s(),o.publish("click",d),clearInterval(a),n.load(JSON.stringify([u.longitude,u.latitude]));let p=g[0]||c[0];if(p){let h=nt(i,p,t);if(!h)return;r.push(h.destroy),h.labelItemFolder.openAnimated()}let l=d.spaces[0]??d.objects[0];if(l){let h={id:l.id,...i.getState(l.id),type:l.type,isInView:!1,isInViewCheck:ot(i,l.id)},{cleanup:m}=N(i,h,t);a=setInterval(()=>{h.isInView=i.isInView(p||l)},500),r.push(m)}}),{sub:o}}function Nt(i,t){let o=new H;i.setHoverColor("#1f3a7a");let e={position:"",hoverColor:w(i.getHoverColor()),intersected:"",type:"",id:""},n=t.add(e,"position").disable();t.add(e,"id").disable().listen(),t.add(e,"type").disable().listen(),t.addColor(e,"hoverColor").onChange(a=>{i.setHoverColor(a)});let r=[];function s(){r.forEach(a=>a()),r.length=0}return i.on("hover",a=>{let{coordinate:d,spaces:g,objects:c,markers:u,labels:p}=a;s(),o.publish("hover",a),n.load(JSON.stringify([d.longitude,d.latitude]));let l=g[0]??c[0]??u[0]??p[0];if(!l)return;let h=i.getState(l);h&&(e.type=h.type,e.id=l.id)}),{sub:o}}function ot(i,t){return function(){console.log("isInView",i.isInView(t))}}function bt(i,t,o){let e={labels:{},all(){o.Labels.all().forEach(l=>{this.labels[l.id]=l}),d()},removeAllLabels(){o.Labels.removeAll().forEach(l=>{delete this.labels[l.id]}),d()}},{addLabel:n,destroy:r}=Wt(i,o);i.add(e,"all"),i.add(e,"removeAllLabels");let s=i.addFolder("Label List");i.close();let a=new Map,{rerender:d}=g();function g(){function p(m){delete e.labels[m.id],a.get(m.id)?.destroy()}function l(m){let C=nt(o,m,s,{onRemove:b=>{p(b)}});if(!C)return;let{labelItemFolder:f}=C;a.set(m.id,f)}function h(){s.destroy(),s=i.addFolder("Label");for(let m in e.labels){let C=e.labels[m];l(C)}}return{rerender:h,add:l,remove:p}}i.domElement.classList.add("list-items");let c;o.on("click",({labels:p,coordinate:l})=>{if(!i._closed)if(p[0]){c?.close();let h=a.get(p[0].id);if(i.open(),!h)return;h?.open(),h?.domElement.scrollIntoView({block:"start"}),h?.domElement.focus(),c=h}else n(l)});function u(p){for(let l of p)e.labels[l.id]=l;d()}return{populatelabels:u,destroy(){r()}}}function nt(i,t,o,{onRemove:e}={}){let n=o.addFolder(`${t.text?.substring(0,12)}`);n.onChange(g=>{i.updateState(t,{appearance:d.appearance,interactive:d.interactive})}),n.close();let r=i.getState(t);if(r?.type!=="label")throw new Error(`error getting state for label: ${t.id}`);let{appearance:s,interactive:a}=r;if(!s||s.margin==null||a==null)throw new Error("incomplte label state");let d={text:t.text,interactive:a,appearance:{...s,margin:s.margin||0,marker:{foregroundColor:s.marker?.foregroundColor?.active?w(s.marker.foregroundColor?.active):"black"},text:{foregroundColor:w(s.text.foregroundColor)}},remove(){i.Labels.remove(t),e?.(t),n.destroy()},isInView:ot(i,t.id)};return n.add(d.appearance,"margin",0,20).name("margin"),n.add(d,"text"),n.add(d,"interactive"),n.addColor(d.appearance.marker,"foregroundColor").name("marker foreground"),n.addColor(d.appearance.text,"foregroundColor").name("text forground"),n.add(d,"isInView"),n.add(d,"remove"),{labelItemFolder:n,destroy(){n.destroy()}}}function Wt(i,t){let o=i.addFolder("Add"),e={onClick:!1,margin:0,text:"New Label!",interactive:!0,marginForegroundColor:w("skyblue"),marginBackgroundColor:w("coral"),textForegroundColor:w("slategray"),textBackgroundColor:w("white")};return o.add(e,"onClick"),o.add(e,"margin"),o.add(e,"interactive"),o.add(e,"text"),o.addColor(e,"marginForegroundColor"),o.addColor(e,"marginBackgroundColor"),o.addColor(e,"textForegroundColor"),o.addColor(e,"textBackgroundColor"),{destroy(){o.destroy()},addLabel(n){return o._closed||!e.onClick?void 0:t.Labels.add(n,e.text,{appearance:{margin:e.margin,marker:{foregroundColor:{active:e.marginForegroundColor,inactive:e.marginForegroundColor},backgroundColor:{active:e.marginBackgroundColor,inactive:e.marginBackgroundColor}},text:{foregroundColor:e.textForegroundColor,backgroundColor:e.marginBackgroundColor}},interactive:e.interactive})}}}var vt={};v();var yt="camera-ui";function Ct(i,t,o){let e=i.addFolder("Camera \u{1F4F7}").onOpenClose(x=>{et({opened:!x._closed},yt)}),{params:n}=it(yt);n.opened||e.close();let r=t.Camera.center.toJSON(),s=document.createElement("div");Object.assign(s.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),t.__core.container.appendChild(s);let{innerHeight:a,innerWidth:d}=window,[g,c,u,p]=o?.padding??[t.Camera.screenOffsets.top,t.Camera.screenOffsets.right,t.Camera.screenOffsets.bottom,t.Camera.screenOffsets.left],l={center_lat:r.latitude,center_lon:r.longitude,zoomLevel:t.Camera.zoomLevel,pitch:t.Camera.pitch,bearing:t.Camera.bearing,minZoomLevel:t.Camera.minZoomLevel,maxZoomLevel:t.Camera.maxZoomLevel,inset_type:o?.padding?"pixel":t.Camera.screenOffsets.type,inset_top:g??0,inset_left:p??0,inset_right:c??0,inset_bottom:u??0,animateOnLoad:!0,persist:()=>{et(e.save().controllers,"camera"),navigator.clipboard.writeText(window.location.href)},visualizeInset:!!(g||c||u||p),"Focus on click":o?.focusOnClick??!0,"Focus on current floor":()=>{t.Camera.focusOn([t.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function h(){l.inset_type=t.Camera.screenOffsets.type,l.inset_left=t.Camera.screenOffsets.left,l.inset_top=t.Camera.screenOffsets.top,l.inset_right=t.Camera.screenOffsets.right,l.inset_bottom=t.Camera.screenOffsets.bottom,l.inset_type==="portion"?Object.assign(s.style,{left:l.inset_left*d+"px",top:l.inset_top*a+"px",bottom:l.inset_bottom*a+"px",right:l.inset_right*d+"px"}):Object.assign(s.style,{left:l.inset_left+"px",top:l.inset_top+"px",bottom:l.inset_bottom+"px",right:l.inset_right+"px"})}e.add(l,"center_lat").listen().disable(),e.add(l,"center_lon").listen().disable(),e.add(l,"zoomLevel",16,22,.5).listen().disable(),e.add(l,"pitch").listen().disable(),e.add(l,"bearing").listen().disable(),e.add(l,"minZoomLevel",5,22,.5).onChange(x=>{t.Camera.setMinZoomLevel(x)}),e.add(l,"maxZoomLevel",10,22,.5).onChange(x=>{t.Camera.setMaxZoomLevel(x)}),e.add(l,"animateOnLoad"),e.add(l,"visualizeInset").onChange(I),I(l.visualizeInset),e.add(l,"inset_type",["pixel","portion"]).onChange(A),e.add(l,"inset_top",0,a).onChange(A),e.add(l,"inset_bottom",0,a).onChange(A),e.add(l,"inset_left",0,d).onChange(A),e.add(l,"inset_right",0,d).onChange(A);let m=Zt(t);e.add(l,"Focus on click").onChange(x=>{x?t.on("click",m):t.off("click",m)}),l["Focus on click"]&&t.on("click",m),e.add(l,"persist"),e.add(l,"Focus on current floor");let C=x=>{e._closed||(l.center_lat=x.center.latitude,l.center_lon=x.center.longitude,l.zoomLevel=x.zoomLevel,l.bearing=x.bearing,l.pitch=x.pitch)};t.on("camera-change",C);let{params:f}=it("camera",l);if(Object.keys(f).length>0){let x=f;t.Camera.setScreenOffsets({top:x.inset_top,left:x.inset_left,right:x.inset_right,bottom:x.inset_bottom,type:x.inset_type});let lt={pitch:x.pitch,center:new ht(x.center_lat,x.center_lon),bearing:x.bearing,zoomLevel:x.zoomLevel};x.animateOnLoad?t.Camera.animateTo(lt):t.Camera.set(lt),e.load({controllers:x,folders:{}}),h()}let b=[()=>{t.off("camera-change",C)}];function A(){t.Camera.setScreenOffsets({top:l.inset_top,left:l.inset_left,right:l.inset_right,bottom:l.inset_bottom,type:l.inset_type}),h()}(l.inset_top||l.inset_right||l.inset_bottom||l.inset_left)&&A();function I(x){h(),x?s.style.display="block":s.style.display="none"}return()=>({destroy(){e.destroy(),gt(b)}})}function Zt(i){return function(o){let{spaces:e,objects:n}=o,r=e[0]??n[0];r&&i.Camera.focusOn(r)}}v();function xt(i,t,o){let e={markers:{},removeAllMarkers(){o.Markers.removeAll().forEach(l=>{delete this.markers[l.id]}),d()}},{addMarker:n,destroy:r}=Kt(i,o);i.add(e,"removeAllMarkers");let s=i.addFolder("Marker List");i.close();let a=new Map,{rerender:d}=g();function g(){function p(m){delete e.markers[m.id],a.get(m.id)?.destroy()}function l(m){let C=Qt(o,m,s,{onRemove:b=>{p(b)}});if(!C)return;let{markerItemFolder:f}=C;a.set(m.id,f)}function h(){s.destroy(),s=i.addFolder("marker");for(let m in e.markers){let C=e.markers[m];l(C)}}return{rerender:h,add:l,remove:p}}i.domElement.classList.add("list-items");let c;o.on("click",({markers:p,coordinate:l})=>{if(!i._closed)if(p[0]){c?.close();let h=a.get(p[0].id);if(i.open(),!h)return;h?.open(),h?.domElement.scrollIntoView({block:"start"}),h?.domElement.focus(),c=h}else n(l)});function u(p){for(let l of p)e.markers[l.id]=l;d()}return{populateMarkers:u,destroy(){r()}}}function Qt(i,t,o,{onRemove:e}={}){let n=o.addFolder(`${t.id.toString().substring(0,8)}`);n.onChange(d=>{i.updateState(t,{interactive:a.interactive})}),n.close();let r=i.getState(t);if(r?.type!=="marker")throw new Error(`error getting state for marker: ${t.id}`);let{interactive:s}=r;if(s==null)throw new Error("incomplte label state");let a={interactive:s,remove(){i.Markers.remove(t),e?.(t),n.destroy()}};return n.add(a,"interactive"),n.add(a,"remove"),{markerItemFolder:n,destroy(){n.destroy()}}}function Kt(i,t){let o=i.addFolder("Add"),e={onClick:!1,interactive:!0};return o.add(e,"onClick"),o.add(e,"interactive"),{destroy(){o.destroy()},addMarker(n){return o._closed||!e.onClick?void 0:t.Markers.add(n,"<div>New Marker</div>",{interactive:e.interactive})}}}v();function At(i,t){let o=i.addFolder("Walls").close(),e={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};o.add(e,"visible").onChange(s=>{t.updateState("walls",{visible:s})}),o.addColor(e,"topColor").onChange(s=>{t.updateState("walls",{topColor:s})}),o.addColor(e,"color").onChange(s=>{t.updateState("walls",{color:s})}),o.addFolder("Texture - side").add(e.texture,"url").onFinishChange(s=>{t.updateState("walls",{texture:{url:s}})}),o.addFolder("Texture - top").add(e.topTexture,"url").onFinishChange(s=>{t.updateState("walls",{topTexture:{url:s}})}),t.updateState("walls",{topColor:e.topColor}),t.updateState("walls",{color:e.color})}v();function kt(i,t,o){i.close();let e={language:o.currentLanguage?.code??"en"},n=o.getByType("enterprise-venue");i.add(e,"language",n?.languages.map(r=>r.code)).onChange(r=>{o.changeLanguage(r)})}v();function Mt(i,t,o){let e=i.addFolder("Debug");e.close();let n=t.Debug.state,r={showPolygonLabelTextAreaMesh:n.showPolygonLabelTextAreaMesh,showCollisionBoxes:n.showCollisionBoxes,showEnvMap:n.showEnvMap};e.add(r,"showPolygonLabelTextAreaMesh").onChange(s=>{t.Debug.update({showPolygonLabelTextAreaMesh:s})}).name("Show Flat Label Text Area Mesh"),e.add(r,"showCollisionBoxes").onChange(s=>{t.Debug.update({showCollisionBoxes:s})}).name("Show Collision Boxes"),e.add(r,"showEnvMap").onChange(s=>{t.Debug.update({showEnvMap:s})}).name("Show Environment Map"),t.Debug.update(r)}v();function Et(i,t,o){let e=i.addFolder("Text3D").close(),n={all:()=>{t.Text3D.labelAll()},removeAll:()=>{t.Text3D.removeAll()}};e.add(n,"all").name("Show All"),e.add(n,"removeAll").name("Remove All")}v();v();v();var _,R,L,k,$,F,wt,st,_t,rt=class{constructor(t=new G({autoPlace:!0})){D(this,F);D(this,_);D(this,R,[]);D(this,L,{});D(this,k,{});D(this,$,{});dt(this,_,t),y(this,_).domElement.style.left="0"}add(t,o,e){if(y(this,k)[t])throw new Error(`Control ${t} already exists`);y(this,L)[t]=o,y(this,$)[t]=o.default,B(this,F,wt).call(this,t,o,e),this.show()}addColor(t,o,e){if(y(this,k)[t])throw new Error(`Control ${t} already exists`);y(this,L)[t]=o,y(this,$)[t]=o.default,B(this,F,_t).call(this,t,o,e),this.show()}update(t,o){if(!y(this,k)[t])throw new Error(`Control ${t} does not exist`);y(this,k)[t].setValue(o),y(this,L)[t].onChange&&y(this,L)[t].onChange(o,t)}replace(t,o,e){if(!y(this,k)[t]){this.add(t,o,e);return}o.args&&y(this,k)[t].options(o.args),o.default&&y(this,k)[t].setValue(o.default),o.onChange&&y(this,k)[t].onChange(n=>{o.onChange(n,t)})}remove(t){if(!y(this,k)[t])throw new Error(`Control ${t} does not exist`);y(this,k)[t].destroy(),y(this,k)[t].parent.children.length===0&&y(this,k)[t].parent.hide(),delete y(this,k)[t],delete y(this,L)[t],delete y(this,$)[t]}show(){y(this,_).show()}hide(){y(this,_).hide()}removeAll(){for(let t in y(this,k))this.remove(t)}destroy(){y(this,_).destroy()}};_=new WeakMap,R=new WeakMap,L=new WeakMap,k=new WeakMap,$=new WeakMap,F=new WeakSet,wt=function(t,o,e){let r=B(this,F,st).call(this,e).add(y(this,$),t,o.args,o.max,o.step);o.onChange&&r.onChange(s=>{o.onChange(s,t)}),o.onAdd&&o.onAdd(o.default,t),y(this,k)[t]=r},st=function(t){if(!t)return y(this,_);let o=y(this,R).find(e=>e._title===t);return o?(o.show(),o):(o=y(this,_).addFolder(t),y(this,R).push(o),o)},_t=function(t,o,e){let r=B(this,F,st).call(this,e).addColor(y(this,$),t);o.onChange&&r.onChange(s=>{o.onChange(s,t)}),y(this,k)[t]=r};function qt(i,t,o){let e={},n=i.getByType("floor"),r=i.getByType("floor-stack");r.length>1&&(e.FloorStack={default:t.currentFloorStack.id,args:r.reduce((a,{id:d,name:g})=>({...a,[g]:d}),{}),onChange:a=>{a!==t.currentFloorStack.id&&(t.setFloorStack(a),o.replace("Floor",{default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((d,{id:g,name:c})=>({...d,[c]:g}),{})}))}}),n.length>1&&(e.Floor={default:t.currentFloor.id,args:[...t.currentFloorStack.floors.sort((a,d)=>d.elevation-a.elevation)].reduce((a,{id:d,name:g})=>({...a,[g]:d}),{}),onChange:a=>{a!==t.currentFloor.id&&t.setFloor(a)},onAdd:()=>{t.on("floor-change",a=>{a?.floor.id&&(r.length>1&&o.replace("FloorStack",{default:t.currentFloorStack.id}),o.replace("Floor",{default:t.currentFloor.id,args:t.currentFloorStack.floors.reduce((g,{id:c,name:u})=>({...g,[u]:c}),{})}))})}});let s=i.getByType("enterprise-venue");return s&&s.languages.length>1&&(e.Language={default:i.currentLanguage?.code||s.languages[0].code,args:s.languages.reduce((a,{code:d,name:g})=>({...a,[g]:d}),{}),onChange:a=>{i.changeLanguage(a)}}),e}function Ft(i,t,o=new G){let e=new rt(o),n=qt(i,t,e);Object.keys(n).length||e.hide();for(let r in n)e.add(r,n[r]);return e}async function St(i,t,{initialfloorsInStack:o,root:e,floorsInDirections:n,showLabelsPerFloor:r=!0}){async function s(h){i.StackedMaps.changeFloorOnElevationChanges(!1),i.Outdoor.setOpacity(.15),i.StackedMaps.setFloorVisiblityMode("only-current-floor"),i.Camera.setPanMode("default"),await i.Camera.focusOn(h,{pitch:10})}async function a(){i.Outdoor.setOpacity(.25),i.StackedMaps.changeFloorOnElevationChanges(!0),i.Camera.setPanMode("elevation"),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.focusOn(i.currentFloor,{axisAlignedPadding:{vertical:i.StackedMaps.distanceBetweenFloors},pitch:90})}async function d(h){await i.Camera.animateElevation(h.elevation*i.StackedMaps.distanceBetweenFloors)}let g=i.currentFloor;i.on("floor-change",async h=>{i.StackedMaps.expanded&&h.reason!=="stacked-maps-elevation-change"&&(i.StackedMaps.changeFloorOnElevationChanges(!1),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.focusOn(g,{axisAlignedPadding:{vertical:i.StackedMaps.distanceBetweenFloors},pitch:90,duration:500}),i.StackedMaps.changeFloorOnElevationChanges(!0),await d(i.currentFloor),await s(i.currentFloor),i.StackedMaps.setFloorVisiblityMode("only-current-floor")),g=i.currentFloor}),i.on("stacked-maps-state-change",({state:h})=>{console.log("stacked-maps-state-change",h)});let c=t.getByType("space");if(r){let h=c.reduce((m,C)=>(m.has(C.floor)||m.set(C.floor,[]),C.name&&C.name!==""&&m.get(C.floor).push(i.Labels.add(C,C.name)),m),new Map);i.on("floor-change",()=>{h.forEach((m,C)=>{m.forEach(f=>{i.updateState(f,{enabled:i.currentFloor===C})})})})}let u=Ft(t,i,e),p=o??[];async function l(){i.Outdoor.setOpacity(.25),p=t.getByType("floor"),await i.Camera.animateTo({pitch:90}),await i.StackedMaps.collapse(),i.StackedMaps.clearCachedFloorSeparationDistance(),await i.StackedMaps.expand({distanceBetweenFloors:"auto"})}return u.add("Expand - All",{default:async()=>{await l()}},"Stack Maps"),n&&u.add("Expand - Only Navigation",{default:async()=>{i.Outdoor.setOpacity(.25),p=n,await i.StackedMaps.collapse(),i.setFloor(n[0]),await i.StackedMaps.expand({includedFloors:n,distanceBetweenFloors:"auto"})}},"Stack Maps"),u.add("Show All Floors",{default:async()=>{p=t.getByType("floor"),i.Outdoor.setOpacity(.25),i.StackedMaps.setFloorVisiblityMode("all-floors"),i.StackedMaps.changeFloorOnElevationChanges(!1),i.Camera.setPanMode("elevation"),i.Camera.focusOn(p,{pitch:90})}},"Stack Maps"),u.add("Show Current Floor with padding",{default:async()=>{await a()}},"Stack Maps"),u.add("Zoom to Current Floor",{default:async()=>{s(i.currentFloor)}},"Stack Maps"),u.add("Collapse",{default:()=>{i.Outdoor.setOpacity("initial"),i.StackedMaps.collapse()}},"Stack Maps"),u.add("Default",{default:async()=>{i.Camera.setPanMode("default")}},"Camera Pan Mode"),u.add("Elevation",{default:async()=>{i.Camera.setPanMode("elevation")}},"Camera Pan Mode"),u.add("zoom in to floor 2",{default:async()=>{i.Outdoor.setOpacity(.25),console.log(i.currentFloor.name),await i.Camera.focusOn(i.currentFloor,{axisAlignedPadding:{vertical:i.StackedMaps.distanceBetweenFloors},pitch:90}),i.StackedMaps.expanded||await i.StackedMaps.expand({distanceBetweenFloors:i.StackedMaps.distanceBetweenFloors});let h=i.StackedMaps.includedFloors[2],m=p.findIndex(C=>C.id===h.id);i.StackedMaps.changeFloorOnElevationChanges(!0),i.Camera.setPanMode("elevation"),i.StackedMaps.setFloorVisiblityMode("all-floors"),await i.Camera.animateElevation(m*i.StackedMaps.distanceBetweenFloors),i.Outdoor.setOpacity(.15),console.log("focusing on",h.name),await i.Camera.focusOn(h,{pitch:10}),i.StackedMaps.setFloorVisiblityMode("only-current-floor"),i.Camera.setPanMode("default"),i.StackedMaps.changeFloorOnElevationChanges(!1)}},"Camera Pan Mode"),u.add("All Floors",{default:async()=>{i.StackedMaps.setFloorVisiblityMode("all-floors")}},"Visibility Mode"),u.add("Only Active Floor",{default:async()=>{i.StackedMaps.setFloorVisiblityMode("only-current-floor")}},"Visibility Mode"),u.add("Up",{default:async()=>{let h=p.find(m=>m.elevation===i.currentFloor.elevation+1);h&&await d(h)}},"Floors Up/Down"),u.add("Down",{default:async()=>{let h=p.find(m=>m.elevation===i.currentFloor.elevation-1);h&&await d(h)}},"Floors Up/Down"),{zoomToFloor:s,expandAll:l}}function Lt(i,t,o){let e=i.addFolder("StackedMaps");e.close(),St(t,o,{root:e,showLabelsPerFloor:!1})}function It(i,t,o){Vt();let e=new Y({title:"SDK Controls"});e.domElement.classList.add("mappedin-js-inspector"),mt(t,i,e),Ct(e,t,o?.camera);let n=e.addFolder("Levels").close(),r=e.addFolder("Scene Controls");r.close();let s=e.addFolder("Labels");Et(e,t,i);let a=e.addFolder("Markers");At(e,t),Lt(e,t,i);let d=e.addFolder("misc");Mt(e,t,i),kt(d,t,i);let g={level:t.currentFloor.id},{populatelabels:c}=bt(s,i,t),{populateMarkers:u}=xt(a,i,t),p=i.getByType("floor").reduce((h,m)=>(h[m.name]=m.id,h),{}),l=n.add(g,"level",p).onChange(h=>{t.setFloor(h),g.level=t.currentFloor.id,l.updateDisplay()});return t.on("floor-change-start",h=>{n.controllers[0].setValue(h.floor.id)}),i.getByType("space").forEach(h=>{t.updateState(h,{interactive:!0})}),i.getByType("object").forEach(h=>{t.updateState(h,{interactive:!0})}),i.getByType("object").forEach(h=>{t.updateState(h,{interactive:!0})}),t.setHoverColor("#a2b7e6"),t.Camera.setMaxZoomLevel(20),{populatelabels:c,sceneFolder:r,populateMarkers:u}}var $t="mappedin-sdk-debug-css";function Vt(){if(document.getElementById($t))return;let i=document.createElement("style");i.id=$t,i.textContent=vt,document.head.appendChild(i)}var at=class{constructor(t,o){O(this,"_enabled",!1);O(this,"mv");O(this,"api");O(this,"mapData");O(this,"scenegraphVisualizerMounted",!1);O(this,"storeStateToLocalStorageEnabled",!1);this.mv=t,this.api=o,this.mapData=this.api.getMapData()}setMapData(t){this.mapData=t}async enable(t={}){if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:o}=It(this.mapData,this.mv,t);o.onOpenClose(e=>{e===o&&!e._closed&&!this.scenegraphVisualizerMounted&&(this.scenegraphVisualizerMounted=!0,ut(this.api.core,o))}),this.api.getMapDataInternal()?.spaces.forEach(e=>{this.mv.updateState(e.id,{interactive:!0})})}get enabled(){return this._enabled}};export{at as Inspector};
|
|
483
|
-
//# sourceMappingURL=inspector-
|
|
483
|
+
//# sourceMappingURL=inspector-UVCVD35T.js.map
|