@mappedin/mappedin-js 6.0.1-beta.49 → 6.0.1-beta.50
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-ESCDGZUC.js → GLTFExporter-NSCWM6JS.js} +2 -2
- package/lib/esm/{GLTFLoader-KRE6VVI2.js → GLTFLoader-P7OIN6GY.js} +2 -2
- package/lib/esm/{browser-BKM6BTVQ.js → browser-6V77MKQS.js} +2 -2
- package/lib/esm/{chunk-TQZZUEDW.js → chunk-3JJZGEB7.js} +24 -24
- package/lib/esm/{chunk-TQZZUEDW.js.map → chunk-3JJZGEB7.js.map} +3 -3
- package/lib/esm/{chunk-EBEZBJTY.js → chunk-DSSOZXRM.js} +2 -2
- package/lib/esm/{chunk-BBNTGIFB.js → chunk-I5GOIM6Y.js} +2 -2
- package/lib/esm/{chunk-BBNTGIFB.js.map → chunk-I5GOIM6Y.js.map} +1 -1
- package/lib/esm/chunk-JEQGUEFF.js +2 -0
- package/lib/esm/{chunk-5N73RBNE.js.map → chunk-JEQGUEFF.js.map} +1 -1
- package/lib/esm/{chunk-QSDIHKLQ.js → chunk-SPVBFPOK.js} +2 -2
- package/lib/esm/{chunk-34JGYGBQ.js → chunk-YDKOKGLT.js} +2 -2
- package/lib/esm/index.d.ts +45 -16
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-UVCVD35T.js → inspector-GKTULNKY.js} +2 -2
- package/lib/esm/{internal-ZOHXUIA6.js → internal-CE37LADZ.js} +2 -2
- package/lib/esm/{outdoor-context-v4-B6ZFZFG7.js → outdoor-context-v4-OHJPVR4U.js} +2 -2
- package/lib/esm/{text3d-ACVNKUMC.js → text3d-QUUOTI5N.js} +2 -2
- package/lib/index-rn.js +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-5N73RBNE.js +0 -2
- /package/lib/esm/{GLTFExporter-ESCDGZUC.js.map → GLTFExporter-NSCWM6JS.js.map} +0 -0
- /package/lib/esm/{GLTFLoader-KRE6VVI2.js.map → GLTFLoader-P7OIN6GY.js.map} +0 -0
- /package/lib/esm/{browser-BKM6BTVQ.js.map → browser-6V77MKQS.js.map} +0 -0
- /package/lib/esm/{chunk-EBEZBJTY.js.map → chunk-DSSOZXRM.js.map} +0 -0
- /package/lib/esm/{chunk-QSDIHKLQ.js.map → chunk-SPVBFPOK.js.map} +0 -0
- /package/lib/esm/{chunk-34JGYGBQ.js.map → chunk-YDKOKGLT.js.map} +0 -0
- /package/lib/esm/{inspector-UVCVD35T.js.map → inspector-GKTULNKY.js.map} +0 -0
- /package/lib/esm/{internal-ZOHXUIA6.js.map → internal-CE37LADZ.js.map} +0 -0
- /package/lib/esm/{outdoor-context-v4-B6ZFZFG7.js.map → outdoor-context-v4-OHJPVR4U.js.map} +0 -0
- /package/lib/esm/{text3d-ACVNKUMC.js.map → text3d-QUUOTI5N.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Z as x,_ as y,u as A,v as w,w as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{Z as x,_ as y,u as A,v as w,w as g}from"./chunk-SPVBFPOK.js";import{a as b}from"./chunk-JEQGUEFF.js";b();function M(o,l=!1){let r=o[0].index!==null,f=new Set(Object.keys(o[0].attributes)),i=new Set(Object.keys(o[0].morphAttributes)),c={},e={},h=o[0].morphTargetsRelative,u=new y,d=0;for(let t=0;t<o.length;++t){let s=o[t],a=0;if(r!==(s.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let n in s.attributes){if(!f.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+'. All geometries must have compatible attributes; make sure "'+n+'" attribute exists among all geometries, or in none of them.'),null;c[n]===void 0&&(c[n]=[]),c[n].push(s.attributes[n]),a++}if(a!==f.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". Make sure all geometries have the same number of attributes."),null;if(h!==s.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let n in s.morphAttributes){if(!i.has(n))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". .morphAttributes must be consistent throughout all geometries."),null;e[n]===void 0&&(e[n]=[]),e[n].push(s.morphAttributes[n])}if(l){let n;if(r)n=s.index.count;else if(s.attributes.position!==void 0)n=s.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+t+". The geometry must have either an index or a position attribute"),null;u.addGroup(d,n,t),d+=n}}if(r){let t=0,s=[];for(let a=0;a<o.length;++a){let n=o[a].index;for(let m=0;m<n.count;++m)s.push(n.getX(m)+t);t+=o[a].attributes.position.count}u.setIndex(s)}for(let t in c){let s=B(c[t]);if(!s)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;u.setAttribute(t,s)}for(let t in e){let s=e[t][0].length;if(s===0)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[t]=[];for(let a=0;a<s;++a){let n=[];for(let p=0;p<e[t].length;++p)n.push(e[t][p][a]);let m=B(n);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;u.morphAttributes[t].push(m)}}return u}function B(o){let l,r,f,i=-1,c=0;for(let d=0;d<o.length;++d){let t=o[d];if(l===void 0&&(l=t.array.constructor),l!==t.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(r===void 0&&(r=t.itemSize),r!==t.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(f===void 0&&(f=t.normalized),f!==t.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=t.gpuType),i!==t.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;c+=t.count*r}let e=new l(c),h=new x(e,r,f),u=0;for(let d=0;d<o.length;++d){let t=o[d];if(t.isInterleavedBufferAttribute){let s=u/r;for(let a=0,n=t.count;a<n;a++)for(let m=0;m<r;m++){let p=t.getComponent(a,m);h.setComponent(a+s,m,p)}}else e.set(t.array,u);u+=t.count*r}return i!==void 0&&(h.gpuType=i),h}function R(o,l){if(l===A)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),o;if(l===g||l===w){let r=o.getIndex();if(r===null){let e=[],h=o.getAttribute("position");if(h!==void 0){for(let u=0;u<h.count;u++)e.push(u);o.setIndex(e),r=o.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),o}let f=r.count-2,i=[];if(l===g)for(let e=1;e<=f;e++)i.push(r.getX(0)),i.push(r.getX(e)),i.push(r.getX(e+1));else for(let e=0;e<f;e++)e%2===0?(i.push(r.getX(e)),i.push(r.getX(e+1)),i.push(r.getX(e+2))):(i.push(r.getX(e+2)),i.push(r.getX(e+1)),i.push(r.getX(e)));i.length/3!==f&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let c=o.clone();return c.setIndex(i),c.clearGroups(),c}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",l),o}export{M as a,R as b};
|
|
2
|
+
//# sourceMappingURL=chunk-YDKOKGLT.js.map
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -360,7 +360,7 @@ declare module '@mappedin/mappedin-js' {
|
|
|
360
360
|
export { parseMVF, unzipMVF, enableTestMode, preloadFont, MAPPEDIN_COLORS };
|
|
361
361
|
export type { MapView, MapData, MapViewState, MappedinMapLibreOverlay, TMappedinMapLibreOverlayEvents, TBlueDotEvents, TBlueDotAction, TBlueDotState, GeolocationPositionExtended, TStackedMapsEvents, TExpandOptions, TStackedMapsState, TFollowMode, TFollowCameraOptions, TEvents, TEventPayload, TFloorChangeReason, TClickPayload, THoverPayload, TShow3DMapOptions, TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TGetMapDataSharedOptions, TAntialiasingOptions, TMVF, PaintStyle, LineStyle, EnvMapOptions, Shading, TMVFStyleCollection, TMVFStyle, TMVFLineStringStyle, TMVFPolygonStyle, TMVFPointStyle, Environment, InsetPadding, InsetPaddingOption, OperationHours, SiblingGroup, LocationState, Text3DState, AddText3DOptions, UpdatableText3DState, InitializeText3DState, UpdateModelState, InitializeModelState, };
|
|
362
362
|
export type * from 'geojson';
|
|
363
|
-
export type { TUpdateState, TUpdateStates, TLabelState, TGeometryState, TModelState, TShapeState, TDoorsState, TImageState, TWallsState, TCameraAnimationOptions, TAnimationOptions, TFocusOnOptions, TEasingFunction, TCameraTarget, TNavigationTarget, TDirectionZone, TAddMarkerOptions, TAddPathOptions, TLabelAppearance, TAddLabelOptions, TAddModelOptions, TAddModel, TAddImageOptions, TGetDirectionsOptions, TCollisionRankingTier, TMarkerAnchor, TDirectionInstruction, TDirectionInstructionAction, TGetState, TMarkerState, TBlueDotOptions, TBlueDotPositionUpdate, TFocusTarget, IFocusable, IAnchorable, TMapDataObjectTypes, TFloorState, TFacadeState, TSetFloorOptions, } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
363
|
+
export type { TUpdateState, TUpdateStates, TLabelState, TGeometryState, TModelState, TShapeState, TDoorsState, TImageState, TWallsState, TCameraAnimationOptions, TAnimationOptions, TFocusOnOptions, TEasingFunction, TCameraTarget, TNavigationTarget, TDirectionZone, TAddMarkerOptions, TAddPathOptions, TLabelAppearance, TAddLabelOptions, TAddModelOptions, TAddModel, TAddImageOptions, TGetDirectionsOptions, TCollisionRankingTier, TMarkerAnchor, TDirectionInstruction, TDirectionInstructionAction, TGetState, TMarkerState, TBlueDotOptions, TBlueDotPositionUpdate, TFocusTarget, IFocusable, IAnchorable, TMapDataObjectTypes, TFloorState, TFacadeState, TSetFloorOptions, TCancellablePromise, TAnimateStateResult, } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
364
364
|
export { WALLS, DOORS } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
365
365
|
export type { Label, Marker, Path, PathSegment, Shape, CameraTransform, Model, Image, Text3D, } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
|
|
366
366
|
export type { Debug } from '@mappedin/mappedin-js/mappedin-js/src/debug';
|
|
@@ -687,7 +687,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/events' {
|
|
|
687
687
|
import type { ClickPayload } from '@mappedin/core-sdk';
|
|
688
688
|
import type { TStackedMapsEvents } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/stacked-maps/stacked-maps';
|
|
689
689
|
import type { Coordinate, Facade, Floor, MapObject, Space } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
690
|
-
import type { Label, Marker, Model, Path } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
|
|
690
|
+
import type { Label, Marker, Model, Path, Shape } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
|
|
691
691
|
import type { CameraTransform } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/camera-transform';
|
|
692
692
|
import type { TBlueDotEvents } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot';
|
|
693
693
|
import type { TDirectionInstruction } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
@@ -734,6 +734,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/events' {
|
|
|
734
734
|
* The interactive facades which the user interaction passed through.
|
|
735
735
|
*/
|
|
736
736
|
facades: Facade[];
|
|
737
|
+
/**
|
|
738
|
+
* The interactive shapes which the user interaction passed through.
|
|
739
|
+
*/
|
|
740
|
+
shapes: Shape[];
|
|
737
741
|
/**
|
|
738
742
|
* Whether the user clicked on the Blue Dot.
|
|
739
743
|
*/
|
|
@@ -1181,7 +1185,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
|
|
|
1181
1185
|
import { Coordinate } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
1182
1186
|
import type { Annotation, Door, Floor, MapObject, PointOfInterest, Space, Node, EnterpriseLocation, FloorStack, Facade } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
|
|
1183
1187
|
import type { TCoordinateParams } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/coordinate';
|
|
1184
|
-
import type { DOORS, WALLS, TGetDirectionsOptions, TGetState, TNavigationTarget, TUpdateState, TUpdateStates, GlobalState, UpdateGlobalState, TSetFloorOptions, DeepPartial } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
1188
|
+
import type { DOORS, WALLS, TGetDirectionsOptions, TGetState, TNavigationTarget, TUpdateState, TUpdateStates, GlobalState, UpdateGlobalState, TSetFloorOptions, DeepPartial, TCancellablePromise, TAnimateStateResult } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
1185
1189
|
import type { Label, Marker, Image, Shape, Text3D as Text3DView, Model, Path } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
|
|
1186
1190
|
import type { TEventPayload } from '@mappedin/mappedin-js/mappedin-js/src/events';
|
|
1187
1191
|
import type { Shapes } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/shapes';
|
|
@@ -1191,7 +1195,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
|
|
|
1191
1195
|
import type { Text3D } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/text3d';
|
|
1192
1196
|
import type { PathSegment } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/path';
|
|
1193
1197
|
import type { ExtractDeep } from '@mappedin/mappedin-js/mappedin-js/src/utils/types';
|
|
1194
|
-
import { Tween } from '@tweenjs/tween.js';
|
|
1198
|
+
import type { Tween } from '@tweenjs/tween.js';
|
|
1195
1199
|
/**
|
|
1196
1200
|
* The MapView class is the main class for rendering and interacting with the map.
|
|
1197
1201
|
*
|
|
@@ -1300,9 +1304,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
|
|
|
1300
1304
|
animateState<T extends Space | Model | Text3DView | MapObject | Label | Marker | Shape | Path | PathSegment | Floor>(target: T, state: DeepPartial<ExtractDeep<TGetState<T>, number | string | undefined>>, options?: {
|
|
1301
1305
|
duration?: number;
|
|
1302
1306
|
easing?: EasingCurve;
|
|
1303
|
-
}):
|
|
1304
|
-
cancel: () => void;
|
|
1305
|
-
};
|
|
1307
|
+
}): TCancellablePromise<TAnimateStateResult>;
|
|
1306
1308
|
/**
|
|
1307
1309
|
* Update global state of the MapView
|
|
1308
1310
|
*/
|
|
@@ -1375,6 +1377,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
|
|
|
1375
1377
|
* @param tween The tween to remove.
|
|
1376
1378
|
*/
|
|
1377
1379
|
removeTween(tween: Tween<any>): void;
|
|
1380
|
+
/**
|
|
1381
|
+
* The group which manages all tweens created with {@link tween} or {@link animateState}.
|
|
1382
|
+
*/
|
|
1383
|
+
get tweenGroup(): import("@tweenjs/tween.js").Group;
|
|
1378
1384
|
/**
|
|
1379
1385
|
* The current floor stack ({@link FloorStack}) of the map.
|
|
1380
1386
|
*/
|
|
@@ -1819,8 +1825,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
|
|
|
1819
1825
|
export type DeepPartial<T> = Partial<{
|
|
1820
1826
|
[K in keyof T]: T[K] extends Partial<T[K]> ? DeepPartial<T[K]> : T[K];
|
|
1821
1827
|
}>;
|
|
1822
|
-
export type
|
|
1823
|
-
|
|
1828
|
+
export type TAnimateStateResult = {
|
|
1829
|
+
result: 'completed' | 'cancelled';
|
|
1830
|
+
};
|
|
1831
|
+
export type TCancellablePromise<T> = Promise<T> & {
|
|
1824
1832
|
cancel: () => void;
|
|
1825
1833
|
};
|
|
1826
1834
|
/**
|
|
@@ -1991,6 +1999,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
|
|
|
1991
1999
|
* Whether the Marker is enabled.
|
|
1992
2000
|
*/
|
|
1993
2001
|
enabled: boolean;
|
|
2002
|
+
contentHTML?: string;
|
|
1994
2003
|
};
|
|
1995
2004
|
export type TPathState = {
|
|
1996
2005
|
type: 'path';
|
|
@@ -2044,6 +2053,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
|
|
|
2044
2053
|
* The opacity of the shape.
|
|
2045
2054
|
*/
|
|
2046
2055
|
opacity: number;
|
|
2056
|
+
/**
|
|
2057
|
+
* Whether the shape is interactive.
|
|
2058
|
+
*/
|
|
2059
|
+
interactive: boolean;
|
|
2047
2060
|
};
|
|
2048
2061
|
export type TFacadeState = {
|
|
2049
2062
|
type: 'facade';
|
|
@@ -3614,7 +3627,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/navigation' {
|
|
|
3614
3627
|
* @param directions The directions to be drawn.
|
|
3615
3628
|
* @param options Optional additional options for the navigation.
|
|
3616
3629
|
*/
|
|
3617
|
-
draw(directions: Directions | Directions[], options?: TNavigationOptions): Promise<
|
|
3630
|
+
draw(directions: Directions | Directions[], options?: TNavigationOptions): Promise<void>;
|
|
3618
3631
|
/**
|
|
3619
3632
|
* Clears any drawn navigation paths or directions from the map.
|
|
3620
3633
|
*/
|
|
@@ -3716,6 +3729,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
|
|
|
3716
3729
|
};
|
|
3717
3730
|
tween<T extends Record<string, unknown>>(object: T): Tween<T>;
|
|
3718
3731
|
removeTween(tween: Tween<any>): void;
|
|
3732
|
+
tweenGroup(): import("@tweenjs/tween.js").Group;
|
|
3719
3733
|
/**
|
|
3720
3734
|
* @internal
|
|
3721
3735
|
*/
|
|
@@ -4286,7 +4300,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src' {
|
|
|
4286
4300
|
export { parseMVF, unzipMVF, enableTestMode, preloadFont, MAPPEDIN_COLORS };
|
|
4287
4301
|
export type { MapView, MapData, MapViewState, MappedinMapLibreOverlay, TMappedinMapLibreOverlayEvents, TBlueDotEvents, TBlueDotAction, TBlueDotState, GeolocationPositionExtended, TStackedMapsEvents, TExpandOptions, TStackedMapsState, TFollowMode, TFollowCameraOptions, TEvents, TEventPayload, TFloorChangeReason, TClickPayload, THoverPayload, TShow3DMapOptions, TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TGetMapDataSharedOptions, TAntialiasingOptions, TMVF, PaintStyle, LineStyle, EnvMapOptions, Shading, TMVFStyleCollection, TMVFStyle, TMVFLineStringStyle, TMVFPolygonStyle, TMVFPointStyle, Environment, InsetPadding, InsetPaddingOption, OperationHours, SiblingGroup, LocationState, Text3DState, AddText3DOptions, UpdatableText3DState, InitializeText3DState, UpdateModelState, InitializeModelState, };
|
|
4288
4302
|
export type * from 'geojson';
|
|
4289
|
-
export type { TUpdateState, TUpdateStates, TLabelState, TGeometryState, TModelState, TShapeState, TDoorsState, TImageState, TWallsState, TCameraAnimationOptions, TAnimationOptions, TFocusOnOptions, TEasingFunction, TCameraTarget, TNavigationTarget, TDirectionZone, TAddMarkerOptions, TAddPathOptions, TLabelAppearance, TAddLabelOptions, TAddModelOptions, TAddModel, TAddImageOptions, TGetDirectionsOptions, TCollisionRankingTier, TMarkerAnchor, TDirectionInstruction, TDirectionInstructionAction, TGetState, TMarkerState, TBlueDotOptions, TBlueDotPositionUpdate, TFocusTarget, IFocusable, IAnchorable, TMapDataObjectTypes, TFloorState, TFacadeState, TSetFloorOptions, } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
4303
|
+
export type { TUpdateState, TUpdateStates, TLabelState, TGeometryState, TModelState, TShapeState, TDoorsState, TImageState, TWallsState, TCameraAnimationOptions, TAnimationOptions, TFocusOnOptions, TEasingFunction, TCameraTarget, TNavigationTarget, TDirectionZone, TAddMarkerOptions, TAddPathOptions, TLabelAppearance, TAddLabelOptions, TAddModelOptions, TAddModel, TAddImageOptions, TGetDirectionsOptions, TCollisionRankingTier, TMarkerAnchor, TDirectionInstruction, TDirectionInstructionAction, TGetState, TMarkerState, TBlueDotOptions, TBlueDotPositionUpdate, TFocusTarget, IFocusable, IAnchorable, TMapDataObjectTypes, TFloorState, TFacadeState, TSetFloorOptions, TCancellablePromise, TAnimateStateResult, } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
4290
4304
|
export { WALLS, DOORS } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
4291
4305
|
export type { Label, Marker, Path, PathSegment, Shape, CameraTransform, Model, Image, Text3D, } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
|
|
4292
4306
|
export type { Debug } from '@mappedin/mappedin-js/mappedin-js/src/debug';
|
|
@@ -9011,8 +9025,10 @@ declare module '@mappedin/mappedin-js/geojson/src/types' {
|
|
|
9011
9025
|
pixelRatio: number;
|
|
9012
9026
|
canvasWidth: number;
|
|
9013
9027
|
canvasHeight: number;
|
|
9014
|
-
/**
|
|
9015
|
-
|
|
9028
|
+
/** Group for all tweens that are created internally by the SDK */
|
|
9029
|
+
internalTweenGroup: TweenGroup;
|
|
9030
|
+
/** Group for all tweens that are created externally, such as from animateState */
|
|
9031
|
+
externalTweenGroup: TweenGroup;
|
|
9016
9032
|
cameraObject: Camera;
|
|
9017
9033
|
naturalBearing: number;
|
|
9018
9034
|
containerOffset: [number, number];
|
|
@@ -9290,6 +9306,10 @@ declare module '@mappedin/mappedin-js/geojson/src/components/custom' {
|
|
|
9290
9306
|
* The parent container of the geometry.
|
|
9291
9307
|
*/
|
|
9292
9308
|
readonly parent: EntityId<GroupContainerState> | string | number;
|
|
9309
|
+
/**
|
|
9310
|
+
* Whether the geometry is interactive.
|
|
9311
|
+
*/
|
|
9312
|
+
interactive?: boolean;
|
|
9293
9313
|
};
|
|
9294
9314
|
export type CustomGeometryBuilder = {
|
|
9295
9315
|
/**
|
|
@@ -9977,7 +9997,9 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
|
|
|
9977
9997
|
* @internal for testing
|
|
9978
9998
|
*/
|
|
9979
9999
|
getInternalState(): RendererState;
|
|
9980
|
-
|
|
10000
|
+
/** @internal */
|
|
10001
|
+
getInternalTweenGroup(): TweenGroup;
|
|
10002
|
+
getExternalTweenGroup(): TweenGroup;
|
|
9981
10003
|
/**
|
|
9982
10004
|
* Subscribe a function to an event.
|
|
9983
10005
|
*
|
|
@@ -11221,6 +11243,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object' {
|
|
|
11221
11243
|
#private;
|
|
11222
11244
|
floorStacksById: Map<string, FloorStackObject>;
|
|
11223
11245
|
floorsById: Map<string, FloorObject>;
|
|
11246
|
+
startingFloorId: string;
|
|
11224
11247
|
currentFloorId: string;
|
|
11225
11248
|
currentFloorStackId: string;
|
|
11226
11249
|
outdoorFloorStacks: Set<string>;
|
|
@@ -11381,6 +11404,12 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/marker' {
|
|
|
11381
11404
|
static readonly __type = "Marker";
|
|
11382
11405
|
get target(): IAnchorable;
|
|
11383
11406
|
get coordinate(): import("..").Coordinate;
|
|
11407
|
+
toJSON(): {
|
|
11408
|
+
id: string;
|
|
11409
|
+
__type: string;
|
|
11410
|
+
target: IAnchorable;
|
|
11411
|
+
coordinate: import("..").Coordinate;
|
|
11412
|
+
};
|
|
11384
11413
|
/**
|
|
11385
11414
|
* @internal
|
|
11386
11415
|
*/
|
|
@@ -12500,7 +12529,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/navigation/index' {
|
|
|
12500
12529
|
* @param directions The directions to be drawn.
|
|
12501
12530
|
* @param options Optional additional options for the navigation.
|
|
12502
12531
|
*/
|
|
12503
|
-
draw(directions: Directions | Directions[], options?: TNavigationOptions): Promise<
|
|
12532
|
+
draw(directions: Directions | Directions[], options?: TNavigationOptions): Promise<void>;
|
|
12504
12533
|
/**
|
|
12505
12534
|
* Clears any drawn navigation paths or directions from the map.
|
|
12506
12535
|
*/
|
|
@@ -14951,7 +14980,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/utils' {
|
|
|
14951
14980
|
import type { PolygonFeatureProperties } from '@packages/internal/mvf-utils';
|
|
14952
14981
|
import type { BBox, FeatureCollection, MultiLineString } from 'geojson';
|
|
14953
14982
|
import type { LabelState, MarkerState, GeometryState, CollisionRankingTier, LineStyle, PaintStyle, Position, EntityId, PathState, GeometryGroupState } from '@mappedin/core-sdk';
|
|
14954
|
-
import {
|
|
14983
|
+
import type { MapData, TGeometryState, TLabelState, TDirectionInstructionAction, TShow3DMapOptions, Label, Marker, Model } from '@mappedin/mappedin-js/mappedin-js/src';
|
|
14955
14984
|
import type { IAnchorable, TDoorsState, TMarkerState, TWallsState } from '@mappedin/mappedin-js/mappedin-js/src/types';
|
|
14956
14985
|
import type { Image, Path, Shape, Text3D } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
|
|
14957
14986
|
import type { GeoJsonApi } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api';
|
package/lib/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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-3JJZGEB7.js";import{b as a,c as b}from"./chunk-DSSOZXRM.js";import"./chunk-I5GOIM6Y.js";import"./chunk-YDKOKGLT.js";import"./chunk-SPVBFPOK.js";import"./chunk-JEQGUEFF.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{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 {
|
|
1
|
+
import{B as ut,a as ht,g as j,p as T,q as X}from"./chunk-3JJZGEB7.js";import{r as H}from"./chunk-DSSOZXRM.js";import"./chunk-I5GOIM6Y.js";import"./chunk-YDKOKGLT.js";import{W as ct}from"./chunk-SPVBFPOK.js";import{a as v}from"./chunk-JEQGUEFF.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;
|
|
@@ -480,4 +480,4 @@ import{B as ut,a as ht,g as j,p as T,q as X}from"./chunk-TQZZUEDW.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-GKTULNKY.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as H,n as X,o as ee,p as te,q as se,v as g,y as Se}from"./chunk-TQZZUEDW.js";import{o as Z}from"./chunk-EBEZBJTY.js";import"./chunk-BBNTGIFB.js";import"./chunk-34JGYGBQ.js";import"./chunk-QSDIHKLQ.js";import{a as O}from"./chunk-5N73RBNE.js";import{e as ye,f as L,g as G,h as D,i as K,j as Y}from"./chunk-AHC6OWNT.js";O();O();var be="ENTRIES",ce="KEYS",ae="VALUES",y="",v=class{constructor(e,t){let s=e._tree,i=Array.from(s.keys());this.set=e,this._type=t,this._path=i.length>0?[{node:s,keys:i}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=I(this._path);if(I(t)===y)return{done:!1,value:this.result()};let s=e.get(I(t));return this._path.push({node:s,keys:Array.from(s.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=I(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>I(e)).filter(e=>e!==y).join("")}value(){return I(this._path).node.get(y)}result(){switch(this._type){case ae:return this.value();case ce:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},I=n=>n[n.length-1],xe=(n,e,t)=>{let s=new Map;if(e===void 0)return s;let i=e.length+1,o=i+t,r=new Uint8Array(o*i).fill(t+1);for(let c=0;c<i;++c)r[c]=c;for(let c=1;c<o;++c)r[c*i]=c;return ue(n,e,t,s,r,1,i,""),s},ue=(n,e,t,s,i,o,r,c)=>{let a=o*r;e:for(let u of n.keys())if(u===y){let l=i[a-1];l<=t&&s.set(c,[n.get(u),l])}else{let l=o;for(let h=0;h<u.length;++h,++l){let d=u[h],p=r*l,_=p-r,f=i[p],m=Math.max(0,l-t-1),w=Math.min(r-1,l+t);for(let S=m;S<w;++S){let V=d!==e[S],R=i[_+S]+ +V,C=i[_+S+1]+1,b=i[p+S]+1,z=i[p+S+1]=Math.min(R,C,b);z<f&&(f=z)}if(f>t)continue e}ue(n.get(u),e,t,s,i,l,r,c+u)}},F=class n{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[t,s]=T(this._tree,e.slice(this._prefix.length));if(t===void 0){let[i,o]=q(s);for(let r of i.keys())if(r!==y&&r.startsWith(o)){let c=new Map;return c.set(r.slice(o.length),i.get(r)),new n(c,e)}}return new n(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Ie(this._tree,e)}entries(){return new v(this,be)}forEach(e){for(let[t,s]of this)e(t,s,this)}fuzzyGet(e,t){return xe(this._tree,e,t)}get(e){let t=N(this._tree,e);return t!==void 0?t.get(y):void 0}has(e){let t=N(this._tree,e);return t!==void 0&&t.has(y)}keys(){return new v(this,ce)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,j(this._tree,e).set(y,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e);return s.set(y,t(s.get(y))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e),i=s.get(y);return i===void 0&&s.set(y,i=t()),i}values(){return new v(this,ae)}[Symbol.iterator](){return this.entries()}static from(e){let t=new n;for(let[s,i]of e)t.set(s,i);return t}static fromObject(e){return n.from(Object.entries(e))}},T=(n,e,t=[])=>{if(e.length===0||n==null)return[n,t];for(let s of n.keys())if(s!==y&&e.startsWith(s))return t.push([n,s]),T(n.get(s),e.slice(s.length),t);return t.push([n,e]),T(void 0,"",t)},N=(n,e)=>{if(e.length===0||n==null)return n;for(let t of n.keys())if(t!==y&&e.startsWith(t))return N(n.get(t),e.slice(t.length))},j=(n,e)=>{let t=e.length;e:for(let s=0;n&&s<t;){for(let o of n.keys())if(o!==y&&e[s]===o[0]){let r=Math.min(t-s,o.length),c=1;for(;c<r&&e[s+c]===o[c];)++c;let a=n.get(o);if(c===o.length)n=a;else{let u=new Map;u.set(o.slice(c),a),n.set(e.slice(s,s+c),u),n.delete(o),n=u}s+=c;continue e}let i=new Map;return n.set(e.slice(s),i),i}return n},Ie=(n,e)=>{let[t,s]=T(n,e);if(t!==void 0){if(t.delete(y),t.size===0)le(s);else if(t.size===1){let[i,o]=t.entries().next().value;de(s,i,o)}}},le=n=>{if(n.length===0)return;let[e,t]=q(n);if(e.delete(t),e.size===0)le(n.slice(0,-1));else if(e.size===1){let[s,i]=e.entries().next().value;s!==y&&de(n.slice(0,-1),s,i)}},de=(n,e,t)=>{if(n.length===0)return;let[s,i]=q(n);s.set(i+e,t),s.delete(i)},q=n=>n[n.length-1],Q="or",he="and",ze="and_not",x=class n{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let t=e.autoVacuum==null||e.autoVacuum===!0?B:e.autoVacuum;this._options={...W,...e,autoVacuum:t,searchOptions:{...ie,...e.searchOptions||{}},autoSuggestOptions:{...Le,...e.autoSuggestOptions||{}}},this._index=new F,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=J,this.addFields(this._options.fields)}add(e){let{extractField:t,tokenize:s,processTerm:i,fields:o,idField:r}=this._options,c=t(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let a=this.addDocumentId(c);this.saveStoredFields(a,e);for(let u of o){let l=t(e,u);if(l==null)continue;let h=s(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.addFieldLength(a,d,this._documentCount-1,p);for(let _ of h){let f=i(_,u);if(Array.isArray(f))for(let m of f)this.addTerm(d,a,m);else f&&this.addTerm(d,a,f)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:s=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:r}=e.reduce(({chunk:c,promise:a},u,l)=>(c.push(u),(l+1)%s===0?{chunk:[],promise:a.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(c))}:{chunk:c,promise:a}),i);return r.then(()=>this.addAll(o))}remove(e){let{tokenize:t,processTerm:s,extractField:i,fields:o,idField:r}=this._options,c=i(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);let a=this._idToShortId.get(c);if(a==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let u of o){let l=i(e,u);if(l==null)continue;let h=t(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.removeFieldLength(a,d,this._documentCount,p);for(let _ of h){let f=s(_,u);if(Array.isArray(f))for(let m of f)this.removeTerm(d,a,m);else f&&this.removeTerm(d,a,f)}}this._storedFields.delete(a),this._documentIds.delete(a),this._idToShortId.delete(c),this._fieldLength.delete(a),this._documentCount-=1}removeAll(e){if(e)for(let t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new F,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){let t=this._idToShortId.get(e);if(t==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((s,i)=>{this.removeFieldLength(t,i,this._documentCount,s)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:s,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:s,batchWait:i},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let s of e)this.discard(s)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:s}=this._options,i=s(e,t);this.discard(i),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let s=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=J,this.performVacuuming(e,s)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let s=this._dirtCount;if(this.vacuumConditionsMet(t)){let i=e.batchSize||$.batchSize,o=e.batchWait||$.batchWait,r=1;for(let[c,a]of this._index){for(let[u,l]of a)for(let[h]of l)this._documentIds.has(h)||(l.size<=1?a.delete(u):l.delete(h));this._index.get(c).size===0&&this._index.delete(c),r%i===0&&await new Promise(u=>setTimeout(u,o)),r+=1}this._dirtCount-=s}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:s}=e;return t=t||B.minDirtCount,s=s||B.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=s}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){let{searchOptions:s}=this._options,i={...s,...t},o=this.executeQuery(e,t),r=[];for(let[c,{score:a,terms:u,match:l}]of o){let h=u.length||1,d={id:this._documentIds.get(c),score:a*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(c)),(i.filter==null||i.filter(d))&&r.push(d)}return e===n.wildcard&&i.boostDocument==null||r.sort(oe),r}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let s=new Map;for(let{score:o,terms:r}of this.search(e,t)){let c=r.join(" "),a=s.get(c);a!=null?(a.score+=o,a.count+=1):s.set(c,{score:o,terms:r,count:1})}let i=[];for(let[o,{score:r,terms:c,count:a}]of s)i.push({suggestion:o,terms:c,score:r/a});return i.sort(oe),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(W.hasOwnProperty(e))return P(W,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=k(i),a._fieldLength=k(o),a._storedFields=k(r);for(let[u,l]of a._documentIds)a._idToShortId.set(l,u);for(let[u,l]of s){let h=new Map;for(let d of Object.keys(l)){let p=l[d];c===1&&(p=p.ds),h.set(parseInt(d,10),k(p))}a._index.set(u,h)}return a}static async loadJSAsync(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=await A(i),a._fieldLength=await A(o),a._storedFields=await A(r);for(let[l,h]of a._documentIds)a._idToShortId.set(h,l);let u=0;for(let[l,h]of s){let d=new Map;for(let p of Object.keys(h)){let _=h[p];c===1&&(_=_.ds),d.set(parseInt(p,10),await A(_))}++u%1e3===0&&await fe(0),a._index.set(l,d)}return a}static instantiateMiniSearch(e,t){let{documentCount:s,nextId:i,fieldIds:o,averageFieldLength:r,dirtCount:c,serializationVersion:a}=e;if(a!==1&&a!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new n(t);return u._documentCount=s,u._nextId=i,u._idToShortId=new Map,u._fieldIds=o,u._avgFieldLength=r,u._dirtCount=c||0,u._index=new F,u}executeQuery(e,t={}){if(e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){let d={...t,...e,queries:void 0},p=e.queries.map(_=>this.executeQuery(_,d));return this.combineResults(p,d.combineWith)}let{tokenize:s,processTerm:i,searchOptions:o}=this._options,r={tokenize:s,processTerm:i,...o,...t},{tokenize:c,processTerm:a}=r,h=c(e).flatMap(d=>a(d)).filter(d=>!!d).map(Ce(r)).map(d=>this.executeQuerySpec(d,r));return this.combineResults(h,r.combineWith)}executeQuerySpec(e,t){let s={...this._options.searchOptions,...t},i=(s.fields||this._options.fields).reduce((f,m)=>({...f,[m]:P(s.boost,m)||1}),{}),{boostDocument:o,weights:r,maxFuzzy:c,bm25:a}=s,{fuzzy:u,prefix:l}={...ie.weights,...r},h=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,h,i,o,a),p,_;if(e.prefix&&(p=this._index.atPrefix(e.term)),e.fuzzy){let f=e.fuzzy===!0?.2:e.fuzzy,m=f<1?Math.min(c,Math.round(e.term.length*f)):f;m&&(_=this._index.fuzzyGet(e.term,m))}if(p)for(let[f,m]of p){let w=f.length-e.term.length;if(!w)continue;_?.delete(f);let S=l*f.length/(f.length+.3*w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}if(_)for(let f of _.keys()){let[m,w]=_.get(f);if(!w)continue;let S=u*f.length/(f.length+w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}return d}executeWildcardQuery(e){let t=new Map,s={...this._options.searchOptions,...e};for(let[i,o]of this._documentIds){let r=s.boostDocument?s.boostDocument(o,"",this._storedFields.get(i)):1;t.set(i,{score:r,terms:[],match:{}})}return t}combineResults(e,t=Q){if(e.length===0)return new Map;let s=t.toLowerCase(),i=ve[s];if(!i)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(i)||new Map}toJSON(){let e=[];for(let[t,s]of this._index){let i={};for(let[o,r]of s)i[o]=Object.fromEntries(r);e.push([t,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,s,i,o,r,c,a,u=new Map){if(o==null)return u;for(let l of Object.keys(r)){let h=r[l],d=this._fieldIds[l],p=o.get(d);if(p==null)continue;let _=p.size,f=this._avgFieldLength[d];for(let m of p.keys()){if(!this._documentIds.has(m)){this.removeTerm(d,m,t),_-=1;continue}let w=c?c(this._documentIds.get(m),t,this._storedFields.get(m)):1;if(!w)continue;let S=p.get(m),V=this._fieldLength.get(m)[d],R=Me(S,_,this._documentCount,V,f,a),C=s*i*h*w*R,b=u.get(m);if(b){b.score+=C,Oe(b.terms,e);let z=P(b.match,t);z?z.push(l):b.match[t]=[l]}else u.set(m,{score:C,terms:[e],match:{[t]:[l]}})}}return u}addTerm(e,t,s){let i=this._index.fetch(s,re),o=i.get(e);if(o==null)o=new Map,o.set(t,1),i.set(e,o);else{let r=o.get(t);o.set(t,(r||0)+1)}}removeTerm(e,t,s){if(!this._index.has(s)){this.warnDocumentChanged(t,e,s);return}let i=this._index.fetch(s,re),o=i.get(e);o==null||o.get(t)==null?this.warnDocumentChanged(t,e,s):o.get(t)<=1?o.size<=1?i.delete(e):o.delete(t):o.set(t,o.get(t)-1),this._index.get(s).size===0&&this._index.delete(s)}warnDocumentChanged(e,t,s){for(let i of Object.keys(this._fieldIds))if(this._fieldIds[i]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${s}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,s,i){let o=this._fieldLength.get(e);o==null&&this._fieldLength.set(e,o=[]),o[t]=i;let c=(this._avgFieldLength[t]||0)*s+i;this._avgFieldLength[t]=c/(s+1)}removeFieldLength(e,t,s,i){if(s===1){this._avgFieldLength[t]=0;return}let o=this._avgFieldLength[t]*s-i;this._avgFieldLength[t]=o/(s-1)}saveStoredFields(e,t){let{storeFields:s,extractField:i}=this._options;if(s==null||s.length===0)return;let o=this._storedFields.get(e);o==null&&this._storedFields.set(e,o={});for(let r of s){let c=i(t,r);c!==void 0&&(o[r]=c)}}};x.wildcard=Symbol("*");var P=(n,e)=>Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,ve={[Q]:(n,e)=>{for(let t of e.keys()){let s=n.get(t);if(s==null)n.set(t,e.get(t));else{let{score:i,terms:o,match:r}=e.get(t);s.score=s.score+i,s.match=Object.assign(s.match,r),ne(s.terms,o)}}return n},[he]:(n,e)=>{let t=new Map;for(let s of e.keys()){let i=n.get(s);if(i==null)continue;let{score:o,terms:r,match:c}=e.get(s);ne(i.terms,r),t.set(s,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,c)})}return t},[ze]:(n,e)=>{for(let t of e.keys())n.delete(t);return n}},Fe={k:1.2,b:.7,d:.5},Me=(n,e,t,s,i,o)=>{let{k:r,b:c,d:a}=o;return Math.log(1+(t-e+.5)/(e+.5))*(a+n*(r+1)/(n+r*(1-c+c*s/i)))},Ce=n=>(e,t,s)=>{let i=typeof n.fuzzy=="function"?n.fuzzy(e,t,s):n.fuzzy||!1,o=typeof n.prefix=="function"?n.prefix(e,t,s):n.prefix===!0,r=typeof n.boostTerm=="function"?n.boostTerm(e,t,s):1;return{term:e,fuzzy:i,prefix:o,termBoost:r}},W={idField:"id",extractField:(n,e)=>n[e],tokenize:n=>n.split(ke),processTerm:n=>n.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(n,e)=>{typeof console?.[n]=="function"&&console[n](e)},autoVacuum:!0},ie={combineWith:Q,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Fe},Le={combineWith:he,prefix:(n,e,t)=>e===t.length-1},$={batchSize:1e3,batchWait:10},J={minDirtFactor:.1,minDirtCount:20},B={...$,...J},Oe=(n,e)=>{n.includes(e)||n.push(e)},ne=(n,e)=>{for(let t of e)n.includes(t)||n.push(t)},oe=({score:n},{score:e})=>e-n,re=()=>new Map,k=n=>{let e=new Map;for(let t of Object.keys(n))e.set(parseInt(t,10),n[t]);return e},A=async n=>{let e=new Map,t=0;for(let s of Object.keys(n))e.set(parseInt(s,10),n[s]),++t%1e3===0&&await fe(0);return e},fe=n=>new Promise(e=>setTimeout(e,n)),ke=/[\n\r\p{Z}\p{P}]+/u;var ge=ye(Se(),1);var M,E,_e,pe=class{constructor(e){D(this,E);L(this,"mapData");L(this,"indexes");L(this,"ready");D(this,M);this.mapData=e,this.indexes=Ee(e),this.ready=this.populate(),K(this,M,Z(Y(this,E,_e).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:t,enterpriseCategories:s}=this.indexes,i=this.mapData,o=[];return e.removeAll(),o=o.concat([e.addAllAsync(i.getByType("space")),e.addAllAsync(i.getByType("point-of-interest")),e.addAllAsync(i.getByType("connection")),e.addAllAsync(i.getByType("floor")),e.addAllAsync(i.getByType("door")),e.addAllAsync(i.getByType("annotation")),e.addAllAsync(i.getByType("area"))]),t&&(t?.removeAll(),o.push(t.addAllAsync(i.getByType("enterprise-location")))),s&&(s?.removeAll(),o.push(s.addAllAsync(i.getByType("enterprise-category")))),Promise.all(o)}async search(e,t={}){await this.ready,Ve.parse(t);let s=(0,ge.default)({},t,Te),i=this.indexes.places.search(e,{fields:Object.keys(s.places.fields).filter(a=>s.places.fields[a])});s.places.limit&&(i=i.slice(0,s.places.limit));let o=this.indexes.enterpriseLocations?.search(e,{fields:Object.keys(s.enterpriseLocations.fields).filter(a=>s.enterpriseLocations.fields[a])});o&&s.enterpriseLocations.limit&&(o=o.slice(0,s.enterpriseLocations.limit));let r=this.indexes.enterpriseCategories?.search(e,{fields:Object.keys(s.enterpriseCategories.fields).filter(a=>s.enterpriseCategories.fields[a])});r&&s.enterpriseCategories.limit&&(r=r.slice(0,s.enterpriseCategories.limit));let c=Ae(this.mapData,{placesResult:i,locationsResult:o,categoriesResult:r});return G(this,M).call(this,e),c}async suggest(e,t={}){await this.ready,Re.parse(t);let s=[],{places:{enabled:i=!0}={},enterpriseLocations:{enabled:o=!0}={}}=t;return o&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(r=>s.push(r)),i&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(r=>s.push(r)),s.sort((r,c)=>c.score-r.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:s.map(r=>r.suggestion)}),s}};M=new WeakMap,E=new WeakSet,_e=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function Ae(n,{placesResult:e,locationsResult:t,categoriesResult:s}){let i=e.reduce((c,{id:a,match:u,score:l,__type:h})=>{let d=n.getById(h,a);return d!=null&&!H.is(d)&&!X.is(d)&&!ee.is(d)&&!te.is(d)&&!se.is(d)&&c.push({type:d.__type,match:u,score:l,item:d}),c},[]),o;if(t){o=[];for(let{id:c,match:a,score:u}of t){let l=n.getById("enterprise-location",c);l&&o.push({type:l.__type,match:a,score:u,item:l})}}let r;if(s){r=[];for(let{id:c,match:a,score:u}of s){let l=n.getById("enterprise-category",c);l&&r.push({type:l.__type,match:a,score:u,item:l})}}return{places:i,enterpriseLocations:o,enterpriseCategories:r}}var Te={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function U(n){return n.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Ee(n){let e=new x({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(r,c)=>{let a=r[c];return typeof a=="string"?U(a):r[c]},processTerm:r=>De.has(r)?"":r.toLowerCase()}),t=n.getByType("enterprise-location"),s;t&&(s=new x({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(r,c)=>Array.isArray(r[c])?r[c].join(" "):typeof r[c]=="string"?U(r[c]):r[c]}));let i=n.getByType("enterprise-category"),o;return i&&(o=new x({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(r,c){return c==="locations.name"?r.locations.reduce((u,l)=>u+` ${me} `+l.name,"")+` ${me}`:typeof r[c]=="string"?U(r[c]):r[c]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:o,enterpriseLocations:s,places:e}}var Ve=g.object({places:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseCategories:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional(),"locations.name":g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseLocations:g.object({fields:g.object({name:g.boolean().optional(),tags:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional()}),Re=g.object({places:g.object({enabled:g.boolean().optional()}).optional(),enterpriseLocations:g.object({enabled:g.boolean().optional()}).optional()}),De=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),me="";export{pe as InternalSearch,U as removeAccents};
|
|
2
|
-
//# sourceMappingURL=internal-
|
|
1
|
+
import{b as H,n as X,o as ee,p as te,q as se,v as g,y as Se}from"./chunk-3JJZGEB7.js";import{o as Z}from"./chunk-DSSOZXRM.js";import"./chunk-I5GOIM6Y.js";import"./chunk-YDKOKGLT.js";import"./chunk-SPVBFPOK.js";import{a as O}from"./chunk-JEQGUEFF.js";import{e as ye,f as L,g as G,h as D,i as K,j as Y}from"./chunk-AHC6OWNT.js";O();O();var be="ENTRIES",ce="KEYS",ae="VALUES",y="",v=class{constructor(e,t){let s=e._tree,i=Array.from(s.keys());this.set=e,this._type=t,this._path=i.length>0?[{node:s,keys:i}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=I(this._path);if(I(t)===y)return{done:!1,value:this.result()};let s=e.get(I(t));return this._path.push({node:s,keys:Array.from(s.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=I(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>I(e)).filter(e=>e!==y).join("")}value(){return I(this._path).node.get(y)}result(){switch(this._type){case ae:return this.value();case ce:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},I=n=>n[n.length-1],xe=(n,e,t)=>{let s=new Map;if(e===void 0)return s;let i=e.length+1,o=i+t,r=new Uint8Array(o*i).fill(t+1);for(let c=0;c<i;++c)r[c]=c;for(let c=1;c<o;++c)r[c*i]=c;return ue(n,e,t,s,r,1,i,""),s},ue=(n,e,t,s,i,o,r,c)=>{let a=o*r;e:for(let u of n.keys())if(u===y){let l=i[a-1];l<=t&&s.set(c,[n.get(u),l])}else{let l=o;for(let h=0;h<u.length;++h,++l){let d=u[h],p=r*l,_=p-r,f=i[p],m=Math.max(0,l-t-1),w=Math.min(r-1,l+t);for(let S=m;S<w;++S){let V=d!==e[S],R=i[_+S]+ +V,C=i[_+S+1]+1,b=i[p+S]+1,z=i[p+S+1]=Math.min(R,C,b);z<f&&(f=z)}if(f>t)continue e}ue(n.get(u),e,t,s,i,l,r,c+u)}},F=class n{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");let[t,s]=T(this._tree,e.slice(this._prefix.length));if(t===void 0){let[i,o]=q(s);for(let r of i.keys())if(r!==y&&r.startsWith(o)){let c=new Map;return c.set(r.slice(o.length),i.get(r)),new n(c,e)}}return new n(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Ie(this._tree,e)}entries(){return new v(this,be)}forEach(e){for(let[t,s]of this)e(t,s,this)}fuzzyGet(e,t){return xe(this._tree,e,t)}get(e){let t=N(this._tree,e);return t!==void 0?t.get(y):void 0}has(e){let t=N(this._tree,e);return t!==void 0&&t.has(y)}keys(){return new v(this,ce)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,j(this._tree,e).set(y,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e);return s.set(y,t(s.get(y))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;let s=j(this._tree,e),i=s.get(y);return i===void 0&&s.set(y,i=t()),i}values(){return new v(this,ae)}[Symbol.iterator](){return this.entries()}static from(e){let t=new n;for(let[s,i]of e)t.set(s,i);return t}static fromObject(e){return n.from(Object.entries(e))}},T=(n,e,t=[])=>{if(e.length===0||n==null)return[n,t];for(let s of n.keys())if(s!==y&&e.startsWith(s))return t.push([n,s]),T(n.get(s),e.slice(s.length),t);return t.push([n,e]),T(void 0,"",t)},N=(n,e)=>{if(e.length===0||n==null)return n;for(let t of n.keys())if(t!==y&&e.startsWith(t))return N(n.get(t),e.slice(t.length))},j=(n,e)=>{let t=e.length;e:for(let s=0;n&&s<t;){for(let o of n.keys())if(o!==y&&e[s]===o[0]){let r=Math.min(t-s,o.length),c=1;for(;c<r&&e[s+c]===o[c];)++c;let a=n.get(o);if(c===o.length)n=a;else{let u=new Map;u.set(o.slice(c),a),n.set(e.slice(s,s+c),u),n.delete(o),n=u}s+=c;continue e}let i=new Map;return n.set(e.slice(s),i),i}return n},Ie=(n,e)=>{let[t,s]=T(n,e);if(t!==void 0){if(t.delete(y),t.size===0)le(s);else if(t.size===1){let[i,o]=t.entries().next().value;de(s,i,o)}}},le=n=>{if(n.length===0)return;let[e,t]=q(n);if(e.delete(t),e.size===0)le(n.slice(0,-1));else if(e.size===1){let[s,i]=e.entries().next().value;s!==y&&de(n.slice(0,-1),s,i)}},de=(n,e,t)=>{if(n.length===0)return;let[s,i]=q(n);s.set(i+e,t),s.delete(i)},q=n=>n[n.length-1],Q="or",he="and",ze="and_not",x=class n{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');let t=e.autoVacuum==null||e.autoVacuum===!0?B:e.autoVacuum;this._options={...W,...e,autoVacuum:t,searchOptions:{...ie,...e.searchOptions||{}},autoSuggestOptions:{...Le,...e.autoSuggestOptions||{}}},this._index=new F,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=J,this.addFields(this._options.fields)}add(e){let{extractField:t,tokenize:s,processTerm:i,fields:o,idField:r}=this._options,c=t(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);if(this._idToShortId.has(c))throw new Error(`MiniSearch: duplicate ID ${c}`);let a=this.addDocumentId(c);this.saveStoredFields(a,e);for(let u of o){let l=t(e,u);if(l==null)continue;let h=s(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.addFieldLength(a,d,this._documentCount-1,p);for(let _ of h){let f=i(_,u);if(Array.isArray(f))for(let m of f)this.addTerm(d,a,m);else f&&this.addTerm(d,a,f)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:s=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:r}=e.reduce(({chunk:c,promise:a},u,l)=>(c.push(u),(l+1)%s===0?{chunk:[],promise:a.then(()=>new Promise(h=>setTimeout(h,0))).then(()=>this.addAll(c))}:{chunk:c,promise:a}),i);return r.then(()=>this.addAll(o))}remove(e){let{tokenize:t,processTerm:s,extractField:i,fields:o,idField:r}=this._options,c=i(e,r);if(c==null)throw new Error(`MiniSearch: document does not have ID field "${r}"`);let a=this._idToShortId.get(c);if(a==null)throw new Error(`MiniSearch: cannot remove document with ID ${c}: it is not in the index`);for(let u of o){let l=i(e,u);if(l==null)continue;let h=t(l.toString(),u),d=this._fieldIds[u],p=new Set(h).size;this.removeFieldLength(a,d,this._documentCount,p);for(let _ of h){let f=s(_,u);if(Array.isArray(f))for(let m of f)this.removeTerm(d,a,m);else f&&this.removeTerm(d,a,f)}}this._storedFields.delete(a),this._documentIds.delete(a),this._idToShortId.delete(c),this._fieldLength.delete(a),this._documentCount-=1}removeAll(e){if(e)for(let t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new F,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){let t=this._idToShortId.get(e);if(t==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((s,i)=>{this.removeFieldLength(t,i,this._documentCount,s)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:s,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:s,batchWait:i},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let s of e)this.discard(s)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:s}=this._options,i=s(e,t);this.discard(i),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{let s=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=J,this.performVacuuming(e,s)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let s=this._dirtCount;if(this.vacuumConditionsMet(t)){let i=e.batchSize||$.batchSize,o=e.batchWait||$.batchWait,r=1;for(let[c,a]of this._index){for(let[u,l]of a)for(let[h]of l)this._documentIds.has(h)||(l.size<=1?a.delete(u):l.delete(h));this._index.get(c).size===0&&this._index.delete(c),r%i===0&&await new Promise(u=>setTimeout(u,o)),r+=1}this._dirtCount-=s}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:s}=e;return t=t||B.minDirtCount,s=s||B.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=s}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){let{searchOptions:s}=this._options,i={...s,...t},o=this.executeQuery(e,t),r=[];for(let[c,{score:a,terms:u,match:l}]of o){let h=u.length||1,d={id:this._documentIds.get(c),score:a*h,terms:Object.keys(l),queryTerms:u,match:l};Object.assign(d,this._storedFields.get(c)),(i.filter==null||i.filter(d))&&r.push(d)}return e===n.wildcard&&i.boostDocument==null||r.sort(oe),r}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let s=new Map;for(let{score:o,terms:r}of this.search(e,t)){let c=r.join(" "),a=s.get(c);a!=null?(a.score+=o,a.count+=1):s.set(c,{score:o,terms:r,count:1})}let i=[];for(let[o,{score:r,terms:c,count:a}]of s)i.push({suggestion:o,terms:c,score:r/a});return i.sort(oe),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(W.hasOwnProperty(e))return P(W,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=k(i),a._fieldLength=k(o),a._storedFields=k(r);for(let[u,l]of a._documentIds)a._idToShortId.set(l,u);for(let[u,l]of s){let h=new Map;for(let d of Object.keys(l)){let p=l[d];c===1&&(p=p.ds),h.set(parseInt(d,10),k(p))}a._index.set(u,h)}return a}static async loadJSAsync(e,t){let{index:s,documentIds:i,fieldLength:o,storedFields:r,serializationVersion:c}=e,a=this.instantiateMiniSearch(e,t);a._documentIds=await A(i),a._fieldLength=await A(o),a._storedFields=await A(r);for(let[l,h]of a._documentIds)a._idToShortId.set(h,l);let u=0;for(let[l,h]of s){let d=new Map;for(let p of Object.keys(h)){let _=h[p];c===1&&(_=_.ds),d.set(parseInt(p,10),await A(_))}++u%1e3===0&&await fe(0),a._index.set(l,d)}return a}static instantiateMiniSearch(e,t){let{documentCount:s,nextId:i,fieldIds:o,averageFieldLength:r,dirtCount:c,serializationVersion:a}=e;if(a!==1&&a!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");let u=new n(t);return u._documentCount=s,u._nextId=i,u._idToShortId=new Map,u._fieldIds=o,u._avgFieldLength=r,u._dirtCount=c||0,u._index=new F,u}executeQuery(e,t={}){if(e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){let d={...t,...e,queries:void 0},p=e.queries.map(_=>this.executeQuery(_,d));return this.combineResults(p,d.combineWith)}let{tokenize:s,processTerm:i,searchOptions:o}=this._options,r={tokenize:s,processTerm:i,...o,...t},{tokenize:c,processTerm:a}=r,h=c(e).flatMap(d=>a(d)).filter(d=>!!d).map(Ce(r)).map(d=>this.executeQuerySpec(d,r));return this.combineResults(h,r.combineWith)}executeQuerySpec(e,t){let s={...this._options.searchOptions,...t},i=(s.fields||this._options.fields).reduce((f,m)=>({...f,[m]:P(s.boost,m)||1}),{}),{boostDocument:o,weights:r,maxFuzzy:c,bm25:a}=s,{fuzzy:u,prefix:l}={...ie.weights,...r},h=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,h,i,o,a),p,_;if(e.prefix&&(p=this._index.atPrefix(e.term)),e.fuzzy){let f=e.fuzzy===!0?.2:e.fuzzy,m=f<1?Math.min(c,Math.round(e.term.length*f)):f;m&&(_=this._index.fuzzyGet(e.term,m))}if(p)for(let[f,m]of p){let w=f.length-e.term.length;if(!w)continue;_?.delete(f);let S=l*f.length/(f.length+.3*w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}if(_)for(let f of _.keys()){let[m,w]=_.get(f);if(!w)continue;let S=u*f.length/(f.length+w);this.termResults(e.term,f,S,e.termBoost,m,i,o,a,d)}return d}executeWildcardQuery(e){let t=new Map,s={...this._options.searchOptions,...e};for(let[i,o]of this._documentIds){let r=s.boostDocument?s.boostDocument(o,"",this._storedFields.get(i)):1;t.set(i,{score:r,terms:[],match:{}})}return t}combineResults(e,t=Q){if(e.length===0)return new Map;let s=t.toLowerCase(),i=ve[s];if(!i)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(i)||new Map}toJSON(){let e=[];for(let[t,s]of this._index){let i={};for(let[o,r]of s)i[o]=Object.fromEntries(r);e.push([t,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,s,i,o,r,c,a,u=new Map){if(o==null)return u;for(let l of Object.keys(r)){let h=r[l],d=this._fieldIds[l],p=o.get(d);if(p==null)continue;let _=p.size,f=this._avgFieldLength[d];for(let m of p.keys()){if(!this._documentIds.has(m)){this.removeTerm(d,m,t),_-=1;continue}let w=c?c(this._documentIds.get(m),t,this._storedFields.get(m)):1;if(!w)continue;let S=p.get(m),V=this._fieldLength.get(m)[d],R=Me(S,_,this._documentCount,V,f,a),C=s*i*h*w*R,b=u.get(m);if(b){b.score+=C,Oe(b.terms,e);let z=P(b.match,t);z?z.push(l):b.match[t]=[l]}else u.set(m,{score:C,terms:[e],match:{[t]:[l]}})}}return u}addTerm(e,t,s){let i=this._index.fetch(s,re),o=i.get(e);if(o==null)o=new Map,o.set(t,1),i.set(e,o);else{let r=o.get(t);o.set(t,(r||0)+1)}}removeTerm(e,t,s){if(!this._index.has(s)){this.warnDocumentChanged(t,e,s);return}let i=this._index.fetch(s,re),o=i.get(e);o==null||o.get(t)==null?this.warnDocumentChanged(t,e,s):o.get(t)<=1?o.size<=1?i.delete(e):o.delete(t):o.set(t,o.get(t)-1),this._index.get(s).size===0&&this._index.delete(s)}warnDocumentChanged(e,t,s){for(let i of Object.keys(this._fieldIds))if(this._fieldIds[i]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${s}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,s,i){let o=this._fieldLength.get(e);o==null&&this._fieldLength.set(e,o=[]),o[t]=i;let c=(this._avgFieldLength[t]||0)*s+i;this._avgFieldLength[t]=c/(s+1)}removeFieldLength(e,t,s,i){if(s===1){this._avgFieldLength[t]=0;return}let o=this._avgFieldLength[t]*s-i;this._avgFieldLength[t]=o/(s-1)}saveStoredFields(e,t){let{storeFields:s,extractField:i}=this._options;if(s==null||s.length===0)return;let o=this._storedFields.get(e);o==null&&this._storedFields.set(e,o={});for(let r of s){let c=i(t,r);c!==void 0&&(o[r]=c)}}};x.wildcard=Symbol("*");var P=(n,e)=>Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,ve={[Q]:(n,e)=>{for(let t of e.keys()){let s=n.get(t);if(s==null)n.set(t,e.get(t));else{let{score:i,terms:o,match:r}=e.get(t);s.score=s.score+i,s.match=Object.assign(s.match,r),ne(s.terms,o)}}return n},[he]:(n,e)=>{let t=new Map;for(let s of e.keys()){let i=n.get(s);if(i==null)continue;let{score:o,terms:r,match:c}=e.get(s);ne(i.terms,r),t.set(s,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,c)})}return t},[ze]:(n,e)=>{for(let t of e.keys())n.delete(t);return n}},Fe={k:1.2,b:.7,d:.5},Me=(n,e,t,s,i,o)=>{let{k:r,b:c,d:a}=o;return Math.log(1+(t-e+.5)/(e+.5))*(a+n*(r+1)/(n+r*(1-c+c*s/i)))},Ce=n=>(e,t,s)=>{let i=typeof n.fuzzy=="function"?n.fuzzy(e,t,s):n.fuzzy||!1,o=typeof n.prefix=="function"?n.prefix(e,t,s):n.prefix===!0,r=typeof n.boostTerm=="function"?n.boostTerm(e,t,s):1;return{term:e,fuzzy:i,prefix:o,termBoost:r}},W={idField:"id",extractField:(n,e)=>n[e],tokenize:n=>n.split(ke),processTerm:n=>n.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(n,e)=>{typeof console?.[n]=="function"&&console[n](e)},autoVacuum:!0},ie={combineWith:Q,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Fe},Le={combineWith:he,prefix:(n,e,t)=>e===t.length-1},$={batchSize:1e3,batchWait:10},J={minDirtFactor:.1,minDirtCount:20},B={...$,...J},Oe=(n,e)=>{n.includes(e)||n.push(e)},ne=(n,e)=>{for(let t of e)n.includes(t)||n.push(t)},oe=({score:n},{score:e})=>e-n,re=()=>new Map,k=n=>{let e=new Map;for(let t of Object.keys(n))e.set(parseInt(t,10),n[t]);return e},A=async n=>{let e=new Map,t=0;for(let s of Object.keys(n))e.set(parseInt(s,10),n[s]),++t%1e3===0&&await fe(0);return e},fe=n=>new Promise(e=>setTimeout(e,n)),ke=/[\n\r\p{Z}\p{P}]+/u;var ge=ye(Se(),1);var M,E,_e,pe=class{constructor(e){D(this,E);L(this,"mapData");L(this,"indexes");L(this,"ready");D(this,M);this.mapData=e,this.indexes=Ee(e),this.ready=this.populate(),K(this,M,Z(Y(this,E,_e).bind(this),2e3))}async populate(){let{places:e,enterpriseLocations:t,enterpriseCategories:s}=this.indexes,i=this.mapData,o=[];return e.removeAll(),o=o.concat([e.addAllAsync(i.getByType("space")),e.addAllAsync(i.getByType("point-of-interest")),e.addAllAsync(i.getByType("connection")),e.addAllAsync(i.getByType("floor")),e.addAllAsync(i.getByType("door")),e.addAllAsync(i.getByType("annotation")),e.addAllAsync(i.getByType("area"))]),t&&(t?.removeAll(),o.push(t.addAllAsync(i.getByType("enterprise-location")))),s&&(s?.removeAll(),o.push(s.addAllAsync(i.getByType("enterprise-category")))),Promise.all(o)}async search(e,t={}){await this.ready,Ve.parse(t);let s=(0,ge.default)({},t,Te),i=this.indexes.places.search(e,{fields:Object.keys(s.places.fields).filter(a=>s.places.fields[a])});s.places.limit&&(i=i.slice(0,s.places.limit));let o=this.indexes.enterpriseLocations?.search(e,{fields:Object.keys(s.enterpriseLocations.fields).filter(a=>s.enterpriseLocations.fields[a])});o&&s.enterpriseLocations.limit&&(o=o.slice(0,s.enterpriseLocations.limit));let r=this.indexes.enterpriseCategories?.search(e,{fields:Object.keys(s.enterpriseCategories.fields).filter(a=>s.enterpriseCategories.fields[a])});r&&s.enterpriseCategories.limit&&(r=r.slice(0,s.enterpriseCategories.limit));let c=Ae(this.mapData,{placesResult:i,locationsResult:o,categoriesResult:r});return G(this,M).call(this,e),c}async suggest(e,t={}){await this.ready,Re.parse(t);let s=[],{places:{enabled:i=!0}={},enterpriseLocations:{enabled:o=!0}={}}=t;return o&&this.indexes.enterpriseLocations&&this.indexes.enterpriseLocations.autoSuggest(e,{fields:["name","tags"],combineWith:"AND",prefix:!0,boost:{name:2,tags:1}}).forEach(r=>s.push(r)),i&&this.indexes.places.autoSuggest(e,{fields:["name"],combineWith:"AND",prefix:!0}).forEach(r=>s.push(r)),s.sort((r,c)=>c.score-r.score),this.mapData.Analytics.capture("$query-suggest",{query:e,suggestions:s.map(r=>r.suggestion)}),s}};M=new WeakMap,E=new WeakSet,_e=function(e){this.mapData.Analytics.capture("$query-search",{query:e})};function Ae(n,{placesResult:e,locationsResult:t,categoriesResult:s}){let i=e.reduce((c,{id:a,match:u,score:l,__type:h})=>{let d=n.getById(h,a);return d!=null&&!H.is(d)&&!X.is(d)&&!ee.is(d)&&!te.is(d)&&!se.is(d)&&c.push({type:d.__type,match:u,score:l,item:d}),c},[]),o;if(t){o=[];for(let{id:c,match:a,score:u}of t){let l=n.getById("enterprise-location",c);l&&o.push({type:l.__type,match:a,score:u,item:l})}}let r;if(s){r=[];for(let{id:c,match:a,score:u}of s){let l=n.getById("enterprise-category",c);l&&r.push({type:l.__type,match:a,score:u,item:l})}}return{places:i,enterpriseLocations:o,enterpriseCategories:r}}var Te={places:{fields:{name:!0,description:!0}},enterpriseCategories:{fields:{name:!0,description:!1,"locations.name":!0}},enterpriseLocations:{fields:{name:!0,tags:!0,description:!0}}};function U(n){return n.normalize("NFD").replace(/[\u0300-\u036f|\u2019|\u0027|\']/g,"").toLowerCase()}function Ee(n){let e=new x({fields:["name","description"],storeFields:["id","__type"],searchOptions:{fuzzy:.2,prefix:!0,boost:{name:2},combineWith:"AND"},extractField:(r,c)=>{let a=r[c];return typeof a=="string"?U(a):r[c]},processTerm:r=>De.has(r)?"":r.toLowerCase()}),t=n.getByType("enterprise-location"),s;t&&(s=new x({fields:["name","tags","description"],storeFields:["id","__type"],searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:3,tags:2,description:1}},extractField:(r,c)=>Array.isArray(r[c])?r[c].join(" "):typeof r[c]=="string"?U(r[c]):r[c]}));let i=n.getByType("enterprise-category"),o;return i&&(o=new x({fields:["name","description","locations.name"],storeFields:["id","__type"],extractField(r,c){return c==="locations.name"?r.locations.reduce((u,l)=>u+` ${me} `+l.name,"")+` ${me}`:typeof r[c]=="string"?U(r[c]):r[c]},searchOptions:{combineWith:"OR",prefix:!0,fuzzy:.2,boost:{name:2,"locations.name":2}}})),{enterpriseCategories:o,enterpriseLocations:s,places:e}}var Ve=g.object({places:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseCategories:g.object({fields:g.object({name:g.boolean().optional(),description:g.boolean().optional(),"locations.name":g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional(),enterpriseLocations:g.object({fields:g.object({name:g.boolean().optional(),tags:g.boolean().optional(),description:g.boolean().optional()}).optional(),limit:g.number().positive().optional()}).optional()}),Re=g.object({places:g.object({enabled:g.boolean().optional()}).optional(),enterpriseLocations:g.object({enabled:g.boolean().optional()}).optional()}),De=new Set(["the","an","and","or","of","in","on","at","to","from","with","by","for"]),me="";export{pe as InternalSearch,U as removeAccents};
|
|
2
|
+
//# sourceMappingURL=internal-CE37LADZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as Y,A as x,B as y,C as z,D as A,E as B,F as C,G as D,H as E,I as F,J as G,K as H,L as I,M as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,U as R,V as S,W as T,X as U,Y as V,Z as W,_ as X,aa as Z,ba as _,c as a,ca as $,d as b,da as aa,e as c,ea as ba,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,x as u,y as v,z as w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=outdoor-context-v4-
|
|
1
|
+
import{$ as Y,A as x,B as y,C as z,D as A,E as B,F as C,G as D,H as E,I as F,J as G,K as H,L as I,M as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,U as R,V as S,W as T,X as U,Y as V,Z as W,_ as X,aa as Z,ba as _,c as a,ca as $,d as b,da as aa,e as c,ea as ba,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,x as u,y as v,z as w}from"./chunk-I5GOIM6Y.js";import"./chunk-JEQGUEFF.js";import"./chunk-AHC6OWNT.js";var export_Point=T.default;export{d as AJAXError,J as AttributionControl,y as BoxZoomHandler,q as CanvasSource,I as CooperativeGesturesHandler,E as DoubleClickZoomHandler,F as DragPanHandler,G as DragRotateHandler,t as EdgeInsets,e as Evented,Q as FullscreenControl,n as GeoJSONSource,O as GeolocateControl,u as Hash,o as ImageSource,C as KeyboardHandler,h as LngLat,i as LngLatBounds,K as LogoControl,L as Map,v as MapMouseEvent,w as MapTouchEvent,x as MapWheelEvent,N as Marker,j as MercatorCoordinate,M as NavigationControl,export_Point as Point,S as Popup,m as RasterDEMTileSource,l as RasterTileSource,P as ScaleControl,D as ScrollZoomHandler,s as Style,R as TerrainControl,B as TwoFingersTouchPitchHandler,A as TwoFingersTouchRotateHandler,z as TwoFingersTouchZoomHandler,H as TwoFingersTouchZoomRotateHandler,k as VectorTileSource,p as VideoSource,b as addProtocol,r as addSourceType,g as clearPrewarmedResources,a as config,Z as getMaxParallelImageRequests,V as getRTLTextPluginStatus,W as getVersion,X as getWorkerCount,$ as getWorkerUrl,ba as importScriptInWorkers,f as prewarm,c as removeProtocol,_ as setMaxParallelImageRequests,U as setRTLTextPlugin,Y as setWorkerCount,aa as setWorkerUrl};
|
|
2
|
+
//# sourceMappingURL=outdoor-context-v4-OHJPVR4U.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ha as Fn,ya as Me}from"./chunk-
|
|
1
|
+
import{ha as Fn,ya as Me}from"./chunk-DSSOZXRM.js";import"./chunk-I5GOIM6Y.js";import{$ as At,Ea as Yt,F as pn,H as _r,I as ot,J as gn,Ka as _n,La as Un,M as mn,N as Ur,Q as Xe,R as Sr,S as yn,T as Ft,W as Mt,Y as bn,_a as Sn,ba as xn,e as Tr,fb as wn,la as Tn,m as kr,na as kn,q as hn,r as dn,x as vn}from"./chunk-SPVBFPOK.js";import{a as Ie,b as Ke}from"./chunk-JEQGUEFF.js";import{a as cn}from"./chunk-AHC6OWNT.js";Ie();Ie();Ie();function ga(){var c=Object.create(null);function r(t,e){var n=t.id,o=t.name,a=t.dependencies;a===void 0&&(a=[]);var i=t.init;i===void 0&&(i=function(){});var s=t.getTransferables;if(s===void 0&&(s=null),!c[n])try{a=a.map(function(u){return u&&u.isWorkerModule&&(r(u,function(d){if(d instanceof Error)throw d}),u=c[u.id].value),u}),i=f("<"+o+">.init",i),s&&(s=f("<"+o+">.getTransferables",s));var l=null;typeof i=="function"?l=i.apply(void 0,a):console.error("worker module init function failed to rehydrate"),c[n]={id:n,value:l,getTransferables:s},e(l)}catch(u){u&&u.noLog||console.error(u),e(u)}}function h(t,e){var n,o=t.id,a=t.args;(!c[o]||typeof c[o].value!="function")&&e(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var i=(n=c[o]).value.apply(n,a);i&&typeof i.then=="function"?i.then(s,function(l){return e(l instanceof Error?l:new Error(""+l))}):s(i)}catch(l){e(l)}function s(l){try{var u=c[o].getTransferables&&c[o].getTransferables(l);(!u||!Array.isArray(u)||!u.length)&&(u=void 0),e(l,u)}catch(d){console.error(d),e(d)}}}function f(t,e){var n=void 0;self.troikaDefine=function(a){return n=a};var o=URL.createObjectURL(new Blob(["/** "+t.replace(/\*/g,"")+` **/
|
|
2
2
|
|
|
3
3
|
troikaDefine(
|
|
4
4
|
`+e+`
|
|
@@ -250,4 +250,4 @@ vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;
|
|
|
250
250
|
}
|
|
251
251
|
`}),f.setMatrixTexture=t=>{f.uniforms[r].value=t,f.uniforms[h].value.set(t.image.width,t.image.height)},f}function lo({vertexShader:c,fragmentShader:r},h,f=h){let t=new RegExp(`uniform\\s+(bool|float|vec[234]|mat[34])\\s+${h}\\b`),e,n=!1;r=r.replace(t,(a,i)=>(n=!0,`varying ${e=i} ${f}`));let o=!1;return c=c.replace(t,(a,i)=>(o=!0,`${n?"varying":""} ${e=i} ${f}`)),o||(c=`${n?"varying":""} ${e} ${f};
|
|
252
252
|
${c}`),{vertexShader:c,fragmentShader:r}}Ie();var ia=cn({"../../fonts/roboto-regular.ttf":()=>import("./roboto-regular-25PMWR2T.js")});var oa="abcdefghijklmnopqrstuvwxyz",sa="roboto-regular.ttf";function la(c){return new Promise((r,h)=>{c?typeof c=="string"?Pr({font:c,characters:oa},()=>{r(c)}):h(new Error(`bad fontUrl ${c}`)):ia(`../../fonts/${sa}`).then(f=>{Pr({font:f.default,characters:oa},()=>{r(f.default)})})})}var zr=.1,fo=new Xe;function fa(c,r,h,f){return r<=0||h<=0?Promise.reject(`incoorect dimension [${r}, ${h}]`):new Promise((t,e)=>{c.sync(n);function n(){if(!c.geometry.boundingBox)return;let{x:o,y:a}=c.geometry.boundingBox.getSize(fo);if(a>h||o>r){if(c.fontSize===zr)return e(`cannot find suitable font size for ${c.text}. MaxSize: [${r}, ${h}], Current size: [${o}, ${a}]. min font size${zr}.`);c.fontSize=Math.max(zr,c.fontSize-f),c.sync(n)}else return t({size:[o,a]})}})}function uo(c){return new Promise(r=>{c.sync(()=>{r()})})}async function Wr(){return(await ia(`../../fonts/${sa}`)).default}function jo({useWorker:c=!0}){Kn({useWorker:c})}var er=new Ft,He=new Xe,co=new Xe(0,0,1);async function Xo(c,r,h,f){let t=r.feature.properties,e=new Ze;r.textMesh=e,e.text=t.text,e.anchorX="center",e.anchorY="middle",e.textAlign=t.align??"center",e.color=t.color??"black",e.fontSize=t.fontSize||20;let n=h.font??Me.font;n?e.font=n:gt?e.font=await gt:e.font=await Wr(),e.outlineOpacity=h.outlineOpacity??Me.outlineOpacity,e.outlineColor=h.outlineColor??Me.outlineColor,e.outlineOffsetY=h.outlineOffsetY??Me.outlineOffsetY,e.outlineOffsetX=h.outlineOffsetX??Me.outlineOffsetX,e.outlineWidth=h.outlineWidth??Me.outlineWidth,e.outlineBlur=h.outlineBlur??Me.outlineBlur,e.strokeWidth=h.strokeWidth??Me.strokeWidth,e.strokeColor=h.strokeColor??Me.strokeColor,e.strokeOpacity=h.strokeOpacity??Me.strokeOpacity;let o=f(r.feature.geometry.coordinates);return e.position.copy(o),e.position.z=t.verticalOffset,e.rotation.z=_r.degToRad(-t.rotation),e.userData={entityId:c.toString(),rotationZ:-t.rotation},{text:e}}async function Ho(c,r,h,f){let t=r.feature.properties,{textArea:e}=t;if(!e)throw new Error("textArea is required");let n=h.margin??Me.margin,[o,a,i,s]=Array.isArray(n)?n:[n,n,n,n],l=new Ze;l.text=t.content;let u=e.maxHeight-o-i,d=e.maxWidth-s-a;l.fontSize=Math.min(u,h.fontSize??Me.fontSize),l.color=h.color??Me.color,l.maxWidth=h.maxWidth??d,l.anchorX="center",l.anchorY="middle",l.textAlign="center";let p=h.font??Me.font;p?l.font=p:gt?l.font=await gt:l.font=await Wr(),l.outlineOpacity=h.outlineOpacity??Me.outlineOpacity,l.outlineColor=h.outlineColor??Me.outlineColor,l.outlineOffsetY=h.outlineOffsetY??Me.outlineOffsetY,l.outlineOffsetX=h.outlineOffsetX??Me.outlineOffsetX,l.outlineWidth=h.outlineWidth??Me.outlineWidth,l.outlineBlur=h.outlineBlur??Me.outlineBlur,l.strokeWidth=h.strokeWidth??Me.strokeWidth,l.strokeColor=h.strokeColor??Me.strokeColor,l.strokeOpacity=h.strokeOpacity??Me.strokeOpacity;let g=f(e.position,He);l.position.copy(g);let m=Fn(Math.PI/2-_r.degToRad(e.rotation));l.rotation.z=m,l.userData={entityId:c.toString(),rotationZ:m};let B,U;try{U=(await fa(l,d,u,l.fontSize*.2)).size}catch(_){throw l.dispose?.(),new Error(`Cannot fit text to area: entityId: ${r.polygonEntityId} ${_}`)}if(U)return er.identity(),He.set(0,0,1),er.makeRotationAxis(co,m),He.set(e.align==="near"?s+U[0]/2:e.maxWidth/2,0,0),He.applyMatrix4(er),l.position.x-=He.x,l.position.y-=He.y,r.textMesh=l,B&&(He.set(e.maxWidth/2,0,0),He.applyMatrix4(er),B.position.x-=He.x,B.position.y-=He.y),{text:l}}var gt;function Yo(c){return gt=la(c),gt}export{Gr as BatchedText,Ze as Text,jo as configureTroikaTextBuilder,Ho as createTroikaTextArea,Xo as createTroikaTextPoint,gt as fontPreloadLoadPromise,Yo as preloadFont,uo as syncText};
|
|
253
|
-
//# sourceMappingURL=text3d-
|
|
253
|
+
//# sourceMappingURL=text3d-QUUOTI5N.js.map
|