@feltmaps/js-sdk 1.11.1 → 1.12.0-next.0

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.
@@ -1575,6 +1575,40 @@ declare const SortConfigSchema: ZodObject<{
1575
1575
  direction: "asc" | "desc";
1576
1576
  }>;
1577
1577
 
1578
+ declare const IsochroneSchema: ZodObject<{
1579
+ origin: ZodTuple<[ZodNumber, ZodNumber], null>;
1580
+ /**
1581
+ * The mode of transport used to travel from the origin.
1582
+ */
1583
+ mode: ZodEnum<["driving", "cycling", "walking"]>;
1584
+ /**
1585
+ * The travel time in whole minutes, from 1 to 120.
1586
+ */
1587
+ minutes: ZodNumber;
1588
+ }, "strip", ZodTypeAny, {
1589
+ origin: [number, number];
1590
+ mode: "driving" | "cycling" | "walking";
1591
+ minutes: number;
1592
+ }, {
1593
+ origin: [number, number];
1594
+ mode: "driving" | "cycling" | "walking";
1595
+ minutes: number;
1596
+ }>;
1597
+ /**
1598
+ * The travel time that an isochrone Polygon covers.
1599
+ *
1600
+ * @remarks
1601
+ * Felt computes an isochrone's shape as the area reachable from `origin` within
1602
+ * `minutes` by `mode`, following roads and paths.
1603
+ *
1604
+ * @group Elements
1605
+ */
1606
+ interface IsochroneParams extends zInfer<typeof IsochroneSchema> {
1607
+ /**
1608
+ * The point that travel time is measured from.
1609
+ */
1610
+ origin: LngLatTuple;
1611
+ }
1578
1612
  declare const PlaceCreateSchema: ZodObject<Omit<objectUtil.extendShape<{
1579
1613
  id: ZodOptional<ZodString>;
1580
1614
  groupId: ZodOptional<ZodNullable<ZodString>>;
@@ -2029,6 +2063,82 @@ declare const PolygonCreateSchema: ZodObject<Omit<objectUtil.extendShape<{
2029
2063
  fillOpacity?: number | undefined;
2030
2064
  areaMarker?: boolean | undefined;
2031
2065
  }>;
2066
+ declare const IsochronePolygonCreateSchema: ZodObject<objectUtil.extendShape<Omit<{
2067
+ id: ZodOptional<ZodString>;
2068
+ groupId: ZodOptional<ZodNullable<ZodString>>;
2069
+ color: ZodOptional<ZodString>;
2070
+ name: ZodOptional<ZodNullable<ZodString>>;
2071
+ description: ZodOptional<ZodNullable<ZodString>>;
2072
+ attributes: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2073
+ interaction: ZodOptional<ZodOptional<ZodEnum<["default", "locked"]>>>;
2074
+ imageUrl: ZodOptional<ZodNullable<ZodString>>;
2075
+ strokeOpacity: ZodOptional<ZodNumber>;
2076
+ strokeWidth: ZodOptional<ZodNumber>;
2077
+ strokeStyle: ZodOptional<ZodEnum<["solid", "dashed", "dotted"]>>;
2078
+ type: ZodOptional<ZodLiteral<"Polygon">>;
2079
+ coordinates: ZodOptional<ZodArray<ZodEffects<ZodArray<ZodTuple<[ZodNumber, ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">>;
2080
+ fillOpacity: ZodOptional<ZodNumber>;
2081
+ areaMarker: ZodOptional<ZodBoolean>;
2082
+ }, "coordinates" | "id">, {
2083
+ type: ZodLiteral<"Polygon">;
2084
+ isochrone: ZodObject<{
2085
+ origin: ZodTuple<[ZodNumber, ZodNumber], null>;
2086
+ /**
2087
+ * The mode of transport used to travel from the origin.
2088
+ */
2089
+ mode: ZodEnum<["driving", "cycling", "walking"]>;
2090
+ /**
2091
+ * The travel time in whole minutes, from 1 to 120.
2092
+ */
2093
+ minutes: ZodNumber;
2094
+ }, "strip", ZodTypeAny, {
2095
+ origin: [number, number];
2096
+ mode: "driving" | "cycling" | "walking";
2097
+ minutes: number;
2098
+ }, {
2099
+ origin: [number, number];
2100
+ mode: "driving" | "cycling" | "walking";
2101
+ minutes: number;
2102
+ }>;
2103
+ }>, "strip", ZodTypeAny, {
2104
+ type: "Polygon";
2105
+ isochrone: {
2106
+ origin: [number, number];
2107
+ mode: "driving" | "cycling" | "walking";
2108
+ minutes: number;
2109
+ };
2110
+ groupId?: string | null | undefined;
2111
+ color?: string | undefined;
2112
+ name?: string | null | undefined;
2113
+ description?: string | null | undefined;
2114
+ attributes?: Record<string, unknown> | undefined;
2115
+ interaction?: "default" | "locked" | undefined;
2116
+ imageUrl?: string | null | undefined;
2117
+ strokeOpacity?: number | undefined;
2118
+ strokeWidth?: number | undefined;
2119
+ strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
2120
+ fillOpacity?: number | undefined;
2121
+ areaMarker?: boolean | undefined;
2122
+ }, {
2123
+ type: "Polygon";
2124
+ isochrone: {
2125
+ origin: [number, number];
2126
+ mode: "driving" | "cycling" | "walking";
2127
+ minutes: number;
2128
+ };
2129
+ groupId?: string | null | undefined;
2130
+ color?: string | undefined;
2131
+ name?: string | null | undefined;
2132
+ description?: string | null | undefined;
2133
+ attributes?: Record<string, unknown> | undefined;
2134
+ interaction?: "default" | "locked" | undefined;
2135
+ imageUrl?: string | null | undefined;
2136
+ strokeOpacity?: number | undefined;
2137
+ strokeWidth?: number | undefined;
2138
+ strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
2139
+ fillOpacity?: number | undefined;
2140
+ areaMarker?: boolean | undefined;
2141
+ }>;
2032
2142
  declare const CircleCreateSchema: ZodObject<Omit<objectUtil.extendShape<{
2033
2143
  id: ZodOptional<ZodString>;
2034
2144
  groupId: ZodOptional<ZodNullable<ZodString>>;
@@ -2941,7 +3051,7 @@ declare const PathReadSchema: ZodObject<Omit<objectUtil.extendShape<objectUtil.e
2941
3051
  endCaps: boolean;
2942
3052
  interaction?: "default" | "locked" | undefined;
2943
3053
  }>;
2944
- declare const PolygonReadSchema: ZodObject<Omit<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<{
3054
+ declare const PolygonReadSchema: ZodObject<objectUtil.extendShape<Omit<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<{
2945
3055
  /**
2946
3056
  * The unique identifier for the element.
2947
3057
  */
@@ -3044,7 +3154,27 @@ declare const PolygonReadSchema: ZodObject<Omit<objectUtil.extendShape<objectUti
3044
3154
  * @default false
3045
3155
  */
3046
3156
  areaMarker: ZodBoolean;
3047
- }>, "coordinates">, "strip", ZodTypeAny, {
3157
+ }>, "coordinates">, {
3158
+ isochrone: ZodNullable<ZodObject<{
3159
+ origin: ZodTuple<[ZodNumber, ZodNumber], null>;
3160
+ /**
3161
+ * The mode of transport used to travel from the origin.
3162
+ */
3163
+ mode: ZodEnum<["driving", "cycling", "walking"]>;
3164
+ /**
3165
+ * The travel time in whole minutes, from 1 to 120.
3166
+ */
3167
+ minutes: ZodNumber;
3168
+ }, "strip", ZodTypeAny, {
3169
+ origin: [number, number];
3170
+ mode: "driving" | "cycling" | "walking";
3171
+ minutes: number;
3172
+ }, {
3173
+ origin: [number, number];
3174
+ mode: "driving" | "cycling" | "walking";
3175
+ minutes: number;
3176
+ }>>;
3177
+ }>, "strip", ZodTypeAny, {
3048
3178
  type: "Polygon";
3049
3179
  id: string;
3050
3180
  groupId: string | null;
@@ -3058,6 +3188,11 @@ declare const PolygonReadSchema: ZodObject<Omit<objectUtil.extendShape<objectUti
3058
3188
  strokeStyle: "solid" | "dashed" | "dotted";
3059
3189
  fillOpacity: number;
3060
3190
  areaMarker: boolean;
3191
+ isochrone: {
3192
+ origin: [number, number];
3193
+ mode: "driving" | "cycling" | "walking";
3194
+ minutes: number;
3195
+ } | null;
3061
3196
  interaction?: "default" | "locked" | undefined;
3062
3197
  }, {
3063
3198
  type: "Polygon";
@@ -3073,6 +3208,11 @@ declare const PolygonReadSchema: ZodObject<Omit<objectUtil.extendShape<objectUti
3073
3208
  strokeStyle: "solid" | "dashed" | "dotted";
3074
3209
  fillOpacity: number;
3075
3210
  areaMarker: boolean;
3211
+ isochrone: {
3212
+ origin: [number, number];
3213
+ mode: "driving" | "cycling" | "walking";
3214
+ minutes: number;
3215
+ } | null;
3076
3216
  interaction?: "default" | "locked" | undefined;
3077
3217
  }>;
3078
3218
  declare const CircleReadSchema: ZodObject<objectUtil.extendShape<objectUtil.extendShape<objectUtil.extendShape<{
@@ -4259,7 +4399,7 @@ declare const PathUpdateSchema: ZodObject<objectUtil.extendShape<{
4259
4399
  routingMode?: "driving" | "cycling" | "walking" | "flying" | null | undefined;
4260
4400
  endCaps?: boolean | undefined;
4261
4401
  }>;
4262
- declare const PolygonUpdateSchema: ZodObject<objectUtil.extendShape<{
4402
+ declare const PolygonUpdateSchema: ZodObject<objectUtil.extendShape<objectUtil.extendShape<{
4263
4403
  id: ZodOptional<ZodString>;
4264
4404
  groupId: ZodOptional<ZodNullable<ZodString>>;
4265
4405
  color: ZodOptional<ZodString>;
@@ -4378,7 +4518,27 @@ declare const PolygonUpdateSchema: ZodObject<objectUtil.extendShape<{
4378
4518
  * @default false
4379
4519
  */
4380
4520
  areaMarker: ZodBoolean;
4381
- }>, "type" | "id">>, "strip", ZodTypeAny, {
4521
+ }>, "type" | "id">>, {
4522
+ isochrone: ZodOptional<ZodObject<{
4523
+ origin: ZodTuple<[ZodNumber, ZodNumber], null>;
4524
+ /**
4525
+ * The mode of transport used to travel from the origin.
4526
+ */
4527
+ mode: ZodEnum<["driving", "cycling", "walking"]>;
4528
+ /**
4529
+ * The travel time in whole minutes, from 1 to 120.
4530
+ */
4531
+ minutes: ZodNumber;
4532
+ }, "strip", ZodTypeAny, {
4533
+ origin: [number, number];
4534
+ mode: "driving" | "cycling" | "walking";
4535
+ minutes: number;
4536
+ }, {
4537
+ origin: [number, number];
4538
+ mode: "driving" | "cycling" | "walking";
4539
+ minutes: number;
4540
+ }>>;
4541
+ }>, "strip", ZodTypeAny, {
4382
4542
  type: "Polygon";
4383
4543
  id: string;
4384
4544
  coordinates?: [number, number][][] | undefined;
@@ -4394,6 +4554,11 @@ declare const PolygonUpdateSchema: ZodObject<objectUtil.extendShape<{
4394
4554
  strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
4395
4555
  fillOpacity?: number | undefined;
4396
4556
  areaMarker?: boolean | undefined;
4557
+ isochrone?: {
4558
+ origin: [number, number];
4559
+ mode: "driving" | "cycling" | "walking";
4560
+ minutes: number;
4561
+ } | undefined;
4397
4562
  }, {
4398
4563
  type: "Polygon";
4399
4564
  id: string;
@@ -4410,6 +4575,11 @@ declare const PolygonUpdateSchema: ZodObject<objectUtil.extendShape<{
4410
4575
  strokeStyle?: "solid" | "dashed" | "dotted" | undefined;
4411
4576
  fillOpacity?: number | undefined;
4412
4577
  areaMarker?: boolean | undefined;
4578
+ isochrone?: {
4579
+ origin: [number, number];
4580
+ mode: "driving" | "cycling" | "walking";
4581
+ minutes: number;
4582
+ } | undefined;
4413
4583
  }>;
4414
4584
  declare const CircleUpdateSchema: ZodObject<objectUtil.extendShape<{
4415
4585
  id: ZodOptional<ZodString>;
@@ -5294,6 +5464,21 @@ interface PathElementCreate extends zInfer<typeof PathCreateSchema> {
5294
5464
  interface PolygonElementCreate extends zInfer<typeof PolygonCreateSchema> {
5295
5465
  coordinates: LngLatTuple[][];
5296
5466
  }
5467
+ /**
5468
+ * A Polygon element whose shape Felt computes from a travel time.
5469
+ */
5470
+ interface IsochronePolygonElementCreate extends zInfer<typeof IsochronePolygonCreateSchema> {
5471
+ /**
5472
+ * The travel time to compute the polygon's shape from.
5473
+ *
5474
+ * @remarks
5475
+ * Felt computes the area reachable from `origin` within `minutes` by `mode` and
5476
+ * uses it as the polygon's shape. `createElement` rejects when travel time is not
5477
+ * available on the map, or when no area is reachable from the origin.
5478
+ */
5479
+ isochrone: IsochroneParams;
5480
+ coordinates?: never;
5481
+ }
5297
5482
  interface CircleElementCreate extends zInfer<typeof CircleCreateSchema> {
5298
5483
  center: LngLatTuple;
5299
5484
  }
@@ -5329,6 +5514,11 @@ interface PlaceElementRead extends zInfer<typeof PlaceReadSchema> {
5329
5514
  interface PathElementRead extends zInfer<typeof PathReadSchema> {
5330
5515
  }
5331
5516
  interface PolygonElementRead extends zInfer<typeof PolygonReadSchema> {
5517
+ /**
5518
+ * The travel time the polygon's shape was computed from, or `null` for a
5519
+ * polygon drawn from coordinates.
5520
+ */
5521
+ isochrone: IsochroneParams | null;
5332
5522
  }
5333
5523
  interface CircleElementRead extends zInfer<typeof CircleReadSchema> {
5334
5524
  center: LngLatTuple;
@@ -5360,7 +5550,30 @@ interface PathElementUpdate extends zInfer<typeof PathUpdateSchema> {
5360
5550
  coordinates?: LngLatTuple[][];
5361
5551
  }
5362
5552
  interface PolygonElementUpdate extends zInfer<typeof PolygonUpdateSchema> {
5553
+ /**
5554
+ * @remarks
5555
+ * Setting `coordinates` on an isochrone polygon replaces its computed shape and
5556
+ * clears its `isochrone`, which then reads back as `null`.
5557
+ */
5363
5558
  coordinates?: LngLatTuple[][];
5559
+ isochrone?: never;
5560
+ }
5561
+ /**
5562
+ * An update to a Polygon element that recomputes its shape from a travel time.
5563
+ */
5564
+ interface IsochronePolygonElementUpdate extends zInfer<typeof PolygonUpdateSchema> {
5565
+ coordinates?: never;
5566
+ /**
5567
+ * A new travel time to recompute the polygon's shape from.
5568
+ *
5569
+ * @remarks
5570
+ * Felt replaces the polygon's shape with the area reachable from `origin` within
5571
+ * `minutes` by `mode`. Cannot be combined with `coordinates`. `updateElement`
5572
+ * rejects when travel time is not available on the map, or when no area is
5573
+ * reachable from the origin, and the polygon keeps its previous travel time and
5574
+ * shape.
5575
+ */
5576
+ isochrone?: IsochroneParams;
5364
5577
  }
5365
5578
  interface CircleElementUpdate extends zInfer<typeof CircleUpdateSchema> {
5366
5579
  center?: LngLatTuple;
@@ -5385,8 +5598,8 @@ interface NoteElementUpdate extends zInfer<typeof NoteUpdateSchema> {
5385
5598
  }
5386
5599
  interface ImageElementUpdate extends zInfer<typeof ImageUpdateSchema> {
5387
5600
  }
5388
- type ElementCreate = PlaceElementCreate | PathElementCreate | PolygonElementCreate | CircleElementCreate | MarkerElementCreate | HighlighterElementCreate | ImageElementCreate | TextElementCreate | NoteElementCreate;
5389
- type ElementUpdate = PlaceElementUpdate | PathElementUpdate | PolygonElementUpdate | CircleElementUpdate | MarkerElementUpdate | HighlighterElementUpdate | TextElementUpdate | NoteElementUpdate | ImageElementUpdate;
5601
+ type ElementCreate = PlaceElementCreate | PathElementCreate | PolygonElementCreate | IsochronePolygonElementCreate | CircleElementCreate | MarkerElementCreate | HighlighterElementCreate | ImageElementCreate | TextElementCreate | NoteElementCreate;
5602
+ type ElementUpdate = PlaceElementUpdate | PathElementUpdate | PolygonElementUpdate | IsochronePolygonElementUpdate | CircleElementUpdate | MarkerElementUpdate | HighlighterElementUpdate | TextElementUpdate | NoteElementUpdate | ImageElementUpdate;
5390
5603
  /**
5391
5604
  * @group Elements
5392
5605
  */
@@ -5826,6 +6039,12 @@ interface ElementsController {
5826
6039
  * @example
5827
6040
  * ```typescript
5828
6041
  * const element = await felt.createElement({ type: "Place", coordinates: [10, 10] });
6042
+ *
6043
+ * // Create a polygon covering everywhere within a 15 minute drive
6044
+ * const isochrone = await felt.createElement({
6045
+ * type: "Polygon",
6046
+ * isochrone: { origin: [-122.27, 37.8], mode: "driving", minutes: 15 },
6047
+ * });
5829
6048
  * ```
5830
6049
  */
5831
6050
  createElement(element: ElementCreate): Promise<Element>;
@@ -10034,7 +10253,7 @@ interface SelectionController {
10034
10253
  }): Promise<void>;
10035
10254
  }
10036
10255
 
10037
- type ToolType = "circle" | "highlighter" | "line" | "link" | "marker" | "note" | "pin" | "polygon" | "route" | "text";
10256
+ type ToolType = "circle" | "highlighter" | "isochrone" | "line" | "link" | "marker" | "note" | "pin" | "polygon" | "route" | "text";
10038
10257
  type ConfigurableToolType = Exclude<ToolType, "link">;
10039
10258
  interface ShowToolInspectorSettings {
10040
10259
  /**
@@ -10145,6 +10364,33 @@ declare const PolygonToolSettingsSchema: ZodObject<{
10145
10364
  }>;
10146
10365
  interface PolygonToolSettings extends zInfer<typeof PolygonToolSettingsSchema>, ShowToolInspectorSettings {
10147
10366
  }
10367
+ declare const IsochroneToolSettingsSchema: ZodObject<{
10368
+ mode: ZodEnum<["driving", "cycling", "walking"]>;
10369
+ minutes: ZodNumber;
10370
+ color: ZodString;
10371
+ strokeOpacity: ZodNumber;
10372
+ strokeWidth: ZodNumber;
10373
+ strokeStyle: ZodEnum<["solid", "dashed", "dotted"]>;
10374
+ fillOpacity: ZodNumber;
10375
+ }, "strip", ZodTypeAny, {
10376
+ color: string;
10377
+ strokeOpacity: number;
10378
+ strokeWidth: number;
10379
+ strokeStyle: "solid" | "dashed" | "dotted";
10380
+ mode: "driving" | "cycling" | "walking";
10381
+ minutes: number;
10382
+ fillOpacity: number;
10383
+ }, {
10384
+ color: string;
10385
+ strokeOpacity: number;
10386
+ strokeWidth: number;
10387
+ strokeStyle: "solid" | "dashed" | "dotted";
10388
+ mode: "driving" | "cycling" | "walking";
10389
+ minutes: number;
10390
+ fillOpacity: number;
10391
+ }>;
10392
+ interface IsochroneToolSettings extends zInfer<typeof IsochroneToolSettingsSchema>, ShowToolInspectorSettings {
10393
+ }
10148
10394
  declare const CircleToolSettingsSchema: ZodObject<{
10149
10395
  color: ZodString;
10150
10396
  strokeOpacity: ZodNumber;
@@ -10244,6 +10490,8 @@ type InputToolSettings = ({
10244
10490
  } & Partial<RouteToolSettings>) | ({
10245
10491
  tool: "polygon";
10246
10492
  } & Partial<PolygonToolSettings>) | ({
10493
+ tool: "isochrone";
10494
+ } & Partial<IsochroneToolSettings>) | ({
10247
10495
  tool: "circle";
10248
10496
  } & Partial<CircleToolSettings>) | ({
10249
10497
  tool: "marker";
@@ -10266,6 +10514,8 @@ type ToolSettingsChangeEvent = ({
10266
10514
  } & RouteToolSettings) | ({
10267
10515
  tool: "polygon";
10268
10516
  } & PolygonToolSettings) | ({
10517
+ tool: "isochrone";
10518
+ } & IsochroneToolSettings) | ({
10269
10519
  tool: "circle";
10270
10520
  } & CircleToolSettings) | ({
10271
10521
  tool: "marker";
@@ -10281,6 +10531,7 @@ type ToolSettingsMap = {
10281
10531
  line: LineToolSettings;
10282
10532
  route: RouteToolSettings;
10283
10533
  polygon: PolygonToolSettings;
10534
+ isochrone: IsochroneToolSettings;
10284
10535
  circle: CircleToolSettings;
10285
10536
  marker: MarkerToolSettings;
10286
10537
  highlighter: HighlighterToolSettings;
@@ -16467,4 +16718,4 @@ interface FeltController extends ViewportController, UiController, LayersControl
16467
16718
  iframe: HTMLIFrameElement | null;
16468
16719
  }
16469
16720
 
16470
- export { type GeoJsonDataVectorSource as $, type PlaceElementRead as A, type BasemapsController as B, type ColorBasemap as C, type PlaceElementUpdate as D, type Element as E, type FeltController as F, type GetElementGroupsConstraint as G, type HighlighterElementCreate as H, type ImageElementCreate as I, type PolygonElementCreate as J, type PolygonElementRead as K, type LinkElementRead as L, type MarkerElementCreate as M, type NoteElementCreate as N, type PolygonElementUpdate as O, type PathElementCreate as P, type TextElementRead as Q, type TextElementUpdate as R, type ElementsController as S, type TextElementCreate as T, type UiControlsOptions as U, type ViewportCenterZoom as V, type MapInteractionEvent as W, type InteractionsController as X, type CreateLayersFromGeoJsonParams as Y, type DataOnlyLayer as Z, type FeltTiledVectorSource as _, type Basemap as a, type RasterHistogramBin as a$, type GeoJsonFileVectorSource as a0, type GeoJsonUrlVectorSource as a1, type GetLayerGroupsConstraint as a2, type GetLayersConstraint as a3, type GetRenderedFeaturesConstraint as a4, type Layer as a5, type LayerChangeCallbackParams as a6, type LayerCommon as a7, type LayerGroup as a8, type LayerGroupChangeCallbackParams as a9, type LayerBoundaries as aA, type LayerFilters as aB, type AggregatedGridConfig as aC, type AggregationConfig as aD, type AggregationMethod as aE, type CountGridConfig as aF, type GetLayerCalculationParams as aG, type GetLayerCategoriesGroup as aH, type GetLayerCategoriesParams as aI, type GetLayerHistogramBin as aJ, type GetLayerHistogramParams as aK, type GetLayerPrecomputedCalculationParams as aL, type GridConfig as aM, type GridType as aN, type MultiAggregationConfig as aO, type PrecomputedAggregationMethod as aP, type ValueConfiguration as aQ, type GetRasterAggregatesParams as aR, type GetRasterAggregatesResult as aS, type GetRasterCategoriesParams as aT, type GetRasterCategoriesResult as aU, type GetRasterHistogramParams as aV, type GetRasterHistogramResult as aW, type GetRasterProfileParams as aX, type GetRasterProfileResult as aY, type RasterAggregationMethod as aZ, type RasterCategory as a_, type LayerProcessingStatus as aa, type LegendDisplay as ab, type LegendItem as ac, type LegendItemChangeCallbackParams as ad, type LegendItemIdentifier as ae, type LegendItemsConstraint as af, type RasterBand as ag, type RasterLayer as ah, type RasterLayerSource as ai, type UpdateLayerParams as aj, type VectorLayer as ak, type LayerFeature as al, type RasterValue as am, type LayerSchema as an, type LayerSchemaAttribute as ao, type LayerSchemaBooleanAttribute as ap, type LayerSchemaCommonAttribute as aq, type LayerSchemaDateAttribute as ar, type LayerSchemaDateTimeAttribute as as, type LayerSchemaNumericAttribute as at, type LayerSchemaTextAttribute as au, type FilterExpression as av, type FilterLogicGate as aw, type FilterTernary as ax, type Filters as ay, type GeometryFilter as az, type ColorBasemapInput as b, type UITextElementUpdate as b$, type RasterPercentile as b0, type RasterProfileSample as b1, type LayersController as b2, type MapDetails as b3, type MiscController as b4, type ElementGroupNode as b5, type ElementNode as b6, type EntityNode as b7, type FeatureNode as b8, type FeatureSelection as b9, type PinToolSettings as bA, type PlaceFrame as bB, type PlaceSymbol as bC, type PolygonToolSettings as bD, type RouteToolSettings as bE, type TextToolSettings as bF, type ToolSettingsChangeEvent as bG, type ToolSettingsMap as bH, type ToolType as bI, type ToolsController as bJ, type CreateActionTriggerParams as bK, type CreateFeatureActionParams as bL, type CreateOrUpdatePanelParams as bM, type CreatePanelElementsParams as bN, type DeletePanelElementsParams as bO, type UiOnMapInteractionsOptions as bP, type UpdateActionTriggerParams as bQ, type UpdateFeatureActionParams as bR, type UpdatePanelElementsParams as bS, type PlacementForUIElement as bT, type UIPanel as bU, type UIPanelCreateOrUpdate as bV, type UIButtonElement as bW, type UIButtonElementCreate as bX, type UIButtonElementUpdate as bY, type UITextElement as bZ, type UITextElementCreate as b_, type LayerGroupNode as ba, type LayerNode as bb, type SelectionController as bc, type FeltBoundary as bd, type FeltZoom as be, type GeoJsonFeature as bf, type GeoJsonGeometry as bg, type GeoJsonProperties as bh, type LatLng as bi, type LineStringGeometry as bj, type LngLatTuple as bk, type MultiLineStringGeometry as bl, type MultiPointGeometry as bm, type MultiPolygonGeometry as bn, type PointGeometry as bo, type PolygonGeometry as bp, type SetVisibilityRequest as bq, type SortConfig as br, type SortDirection as bs, type CircleToolSettings as bt, type ConfigurableToolType as bu, type HighlighterToolSettings as bv, type InputToolSettings as bw, type LineToolSettings as bx, type MarkerToolSettings as by, type NoteToolSettings as bz, type CustomTileBasemap as c, type UIFlexibleSpaceElement as c0, type UIFlexibleSpaceElementCreate as c1, type UIFlexibleSpaceElementUpdate as c2, type UIDividerElement as c3, type UIDividerElementCreate as c4, type UIDividerElementUpdate as c5, type UITextInputElement as c6, type UITextInputElementCreate as c7, type UITextInputElementUpdate as c8, type UISelectElement as c9, type UIFeatureActionCreate as cA, type UiController as cB, type SetViewportCenterZoomParams as cC, type ViewportConstraints as cD, type ViewportFitBoundsParams as cE, type ViewportState as cF, type ViewportController as cG, type UnwrapPromise as cH, uiActionTriggerSchema as cI, uiFeatureActionSchema as cJ, type UIPanelElementCreateClonable as cK, uiPanelCreateSchema as cL, type UIButtonElementCreateClonable as cM, type MakeClonableSchema as cN, type UIButtonRowElementCreateClonable as cO, type PromiseOrNot as cP, type UnionToIntersection as cQ, type UISelectElementCreate as ca, type UISelectElementUpdate as cb, type UIPanelElement as cc, type UIPanelElementCreate as cd, type UIPanelElementUpdate as ce, type UIGridContainerElement as cf, type UIGridContainerElementCreate as cg, type UIGridContainerElementUpdate as ch, type UIButtonRowElement as ci, type UIButtonRowElementCreate as cj, type UIButtonRowElementUpdate as ck, type UICheckboxGroupElement as cl, type UICheckboxGroupElementCreate as cm, type UICheckboxGroupElementUpdate as cn, type UIRadioGroupElement as co, type UIRadioGroupElementCreate as cp, type UIRadioGroupElementUpdate as cq, type UIToggleGroupElement as cr, type UIToggleGroupElementCreate as cs, type UIToggleGroupElementUpdate as ct, type UIIframeElement as cu, type UIIframeElementCreate as cv, type UIIframeElementUpdate as cw, type UIControlElementOption as cx, type UIActionTriggerCreate as cy, type UIFeatureAction as cz, type CustomTileBasemapInput as d, type FeltBasemap as e, type CircleElementCreate as f, type CircleElementRead as g, type CircleElementUpdate as h, type ElementChangeCallbackParams as i, type ElementCreate as j, type ElementGroup as k, type ElementGroupChangeCallbackParams as l, type ElementUpdate as m, type GetElementsConstraint as n, type HighlighterElementRead as o, type HighlighterElementUpdate as p, type ImageElementRead as q, type ImageElementUpdate as r, type MarkerElementRead as s, type MarkerElementUpdate as t, type NoteElementRead as u, type NoteElementUpdate as v, type PathElementRead as w, type PathElementUpdate as x, type PlaceElementCreate as y, type zInfer as z };
16721
+ export { type CreateLayersFromGeoJsonParams as $, type PathElementRead as A, type BasemapsController as B, type ColorBasemap as C, type PathElementUpdate as D, type Element as E, type FeltController as F, type GetElementGroupsConstraint as G, type HighlighterElementCreate as H, type ImageElementCreate as I, type PlaceElementCreate as J, type PlaceElementRead as K, type LinkElementRead as L, type MarkerElementCreate as M, type NoteElementCreate as N, type PlaceElementUpdate as O, type PathElementCreate as P, type PolygonElementCreate as Q, type PolygonElementRead as R, type PolygonElementUpdate as S, type TextElementCreate as T, type UiControlsOptions as U, type ViewportCenterZoom as V, type TextElementRead as W, type TextElementUpdate as X, type ElementsController as Y, type MapInteractionEvent as Z, type InteractionsController as _, type Basemap as a, type GetRasterProfileResult as a$, type DataOnlyLayer as a0, type FeltTiledVectorSource as a1, type GeoJsonDataVectorSource as a2, type GeoJsonFileVectorSource as a3, type GeoJsonUrlVectorSource as a4, type GetLayerGroupsConstraint as a5, type GetLayersConstraint as a6, type GetRenderedFeaturesConstraint as a7, type Layer as a8, type LayerChangeCallbackParams as a9, type FilterTernary as aA, type Filters as aB, type GeometryFilter as aC, type LayerBoundaries as aD, type LayerFilters as aE, type AggregatedGridConfig as aF, type AggregationConfig as aG, type AggregationMethod as aH, type CountGridConfig as aI, type GetLayerCalculationParams as aJ, type GetLayerCategoriesGroup as aK, type GetLayerCategoriesParams as aL, type GetLayerHistogramBin as aM, type GetLayerHistogramParams as aN, type GetLayerPrecomputedCalculationParams as aO, type GridConfig as aP, type GridType as aQ, type MultiAggregationConfig as aR, type PrecomputedAggregationMethod as aS, type ValueConfiguration as aT, type GetRasterAggregatesParams as aU, type GetRasterAggregatesResult as aV, type GetRasterCategoriesParams as aW, type GetRasterCategoriesResult as aX, type GetRasterHistogramParams as aY, type GetRasterHistogramResult as aZ, type GetRasterProfileParams as a_, type LayerCommon as aa, type LayerGroup as ab, type LayerGroupChangeCallbackParams as ac, type LayerProcessingStatus as ad, type LegendDisplay as ae, type LegendItem as af, type LegendItemChangeCallbackParams as ag, type LegendItemIdentifier as ah, type LegendItemsConstraint as ai, type RasterBand as aj, type RasterLayer as ak, type RasterLayerSource as al, type UpdateLayerParams as am, type VectorLayer as an, type LayerFeature as ao, type RasterValue as ap, type LayerSchema as aq, type LayerSchemaAttribute as ar, type LayerSchemaBooleanAttribute as as, type LayerSchemaCommonAttribute as at, type LayerSchemaDateAttribute as au, type LayerSchemaDateTimeAttribute as av, type LayerSchemaNumericAttribute as aw, type LayerSchemaTextAttribute as ax, type FilterExpression as ay, type FilterLogicGate as az, type ColorBasemapInput as b, type UIButtonElementCreate as b$, type RasterAggregationMethod as b0, type RasterCategory as b1, type RasterHistogramBin as b2, type RasterPercentile as b3, type RasterProfileSample as b4, type LayersController as b5, type MapDetails as b6, type MiscController as b7, type ElementGroupNode as b8, type ElementNode as b9, type IsochroneToolSettings as bA, type LineToolSettings as bB, type MarkerToolSettings as bC, type NoteToolSettings as bD, type PinToolSettings as bE, type PlaceFrame as bF, type PlaceSymbol as bG, type PolygonToolSettings as bH, type RouteToolSettings as bI, type TextToolSettings as bJ, type ToolSettingsChangeEvent as bK, type ToolSettingsMap as bL, type ToolType as bM, type ToolsController as bN, type CreateActionTriggerParams as bO, type CreateFeatureActionParams as bP, type CreateOrUpdatePanelParams as bQ, type CreatePanelElementsParams as bR, type DeletePanelElementsParams as bS, type UiOnMapInteractionsOptions as bT, type UpdateActionTriggerParams as bU, type UpdateFeatureActionParams as bV, type UpdatePanelElementsParams as bW, type PlacementForUIElement as bX, type UIPanel as bY, type UIPanelCreateOrUpdate as bZ, type UIButtonElement as b_, type EntityNode as ba, type FeatureNode as bb, type FeatureSelection as bc, type LayerGroupNode as bd, type LayerNode as be, type SelectionController as bf, type FeltBoundary as bg, type FeltZoom as bh, type GeoJsonFeature as bi, type GeoJsonGeometry as bj, type GeoJsonProperties as bk, type LatLng as bl, type LineStringGeometry as bm, type LngLatTuple as bn, type MultiLineStringGeometry as bo, type MultiPointGeometry as bp, type MultiPolygonGeometry as bq, type PointGeometry as br, type PolygonGeometry as bs, type SetVisibilityRequest as bt, type SortConfig as bu, type SortDirection as bv, type CircleToolSettings as bw, type ConfigurableToolType as bx, type HighlighterToolSettings as by, type InputToolSettings as bz, type CustomTileBasemap as c, type UIButtonElementUpdate as c0, type UITextElement as c1, type UITextElementCreate as c2, type UITextElementUpdate as c3, type UIFlexibleSpaceElement as c4, type UIFlexibleSpaceElementCreate as c5, type UIFlexibleSpaceElementUpdate as c6, type UIDividerElement as c7, type UIDividerElementCreate as c8, type UIDividerElementUpdate as c9, type UIIframeElementUpdate as cA, type UIControlElementOption as cB, type UIActionTriggerCreate as cC, type UIFeatureAction as cD, type UIFeatureActionCreate as cE, type UiController as cF, type SetViewportCenterZoomParams as cG, type ViewportConstraints as cH, type ViewportFitBoundsParams as cI, type ViewportState as cJ, type ViewportController as cK, type UnwrapPromise as cL, uiActionTriggerSchema as cM, uiFeatureActionSchema as cN, type UIPanelElementCreateClonable as cO, uiPanelCreateSchema as cP, type UIButtonElementCreateClonable as cQ, type MakeClonableSchema as cR, type UIButtonRowElementCreateClonable as cS, type PromiseOrNot as cT, type UnionToIntersection as cU, type UITextInputElement as ca, type UITextInputElementCreate as cb, type UITextInputElementUpdate as cc, type UISelectElement as cd, type UISelectElementCreate as ce, type UISelectElementUpdate as cf, type UIPanelElement as cg, type UIPanelElementCreate as ch, type UIPanelElementUpdate as ci, type UIGridContainerElement as cj, type UIGridContainerElementCreate as ck, type UIGridContainerElementUpdate as cl, type UIButtonRowElement as cm, type UIButtonRowElementCreate as cn, type UIButtonRowElementUpdate as co, type UICheckboxGroupElement as cp, type UICheckboxGroupElementCreate as cq, type UICheckboxGroupElementUpdate as cr, type UIRadioGroupElement as cs, type UIRadioGroupElementCreate as ct, type UIRadioGroupElementUpdate as cu, type UIToggleGroupElement as cv, type UIToggleGroupElementCreate as cw, type UIToggleGroupElementUpdate as cx, type UIIframeElement as cy, type UIIframeElementCreate as cz, type CustomTileBasemapInput as d, type FeltBasemap as e, type CircleElementCreate as f, type CircleElementRead as g, type CircleElementUpdate as h, type ElementChangeCallbackParams as i, type ElementCreate as j, type ElementGroup as k, type ElementGroupChangeCallbackParams as l, type ElementUpdate as m, type GetElementsConstraint as n, type HighlighterElementRead as o, type HighlighterElementUpdate as p, type ImageElementRead as q, type ImageElementUpdate as r, type IsochroneParams as s, type IsochronePolygonElementCreate as t, type IsochronePolygonElementUpdate as u, type MarkerElementRead as v, type MarkerElementUpdate as w, type NoteElementRead as x, type NoteElementUpdate as y, type zInfer as z };
package/dist/handler.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var qe=Object.defineProperty;var go=Object.getOwnPropertyDescriptor;var uo=Object.getOwnPropertyNames;var yo=Object.prototype.hasOwnProperty;var ho=(o,x)=>{for(var Y in x)qe(o,Y,{get:x[Y],enumerable:!0})},fo=(o,x,Y,ae)=>{if(x&&typeof x=="object"||typeof x=="function")for(let q of uo(x))!yo.call(o,q)&&q!==Y&&qe(o,q,{get:()=>x[q],enumerable:!(ae=go(x,q))||ae.enumerable});return o};var So=o=>fo(qe({},"__esModule",{value:!0}),o);var li={};ho(li,{createMessageHandler:()=>ei});module.exports=So(li);var y=require("zod");var K=require("zod");var w=require("zod");function e(o,x){return w.z.strictObject({type:w.z.literal(o),params:x})}function B(o,x){return w.z.strictObject({eventName:w.z.literal(o),id:w.z.string(),options:x})}function f(o){return w.z.strictObject({eventName:w.z.literal(o),id:w.z.string()})}var v=require("zod"),Ot=v.z.object({id:v.z.string(),name:v.z.string(),uiColorScheme:v.z.enum(["light","dark"]),attribution:v.z.string().optional()}),wt=Ot.extend({type:v.z.literal("color"),color:v.z.string()}),jt=Ot.extend({type:v.z.literal("xyz_tile"),tileUrl:v.z.string()});var xo=e("getCurrentBasemap",K.z.void()),Co=e("getBasemaps",K.z.void()),bo=e("chooseBasemap",K.z.string()),Io=e("removeBasemap",K.z.string()),Eo=e("addCustomBasemap",K.z.object({basemap:K.z.discriminatedUnion("type",[wt.omit({id:!0,uiColorScheme:!0}),jt.omit({id:!0})]),select:K.z.boolean().optional()})),Uo=f("onBasemapChange"),Dt={methods:[xo,Co,bo,Eo,Io],listeners:[Uo]};var L=require("zod");var p=require("zod"),ke=p.z.number(),Re=p.z.number(),Be=p.z.object({latitude:Re,longitude:ke}),W=p.z.tuple([ke,Re]),se=p.z.object({type:p.z.literal("Polygon"),coordinates:p.z.array(p.z.array(W).min(4).refine(o=>o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1],"The last point of each ring must be identical to the first"))}),ve=p.z.object({type:p.z.literal("MultiPolygon"),coordinates:p.z.array(se.shape.coordinates)}),Ke=p.z.object({type:p.z.literal("LineString"),coordinates:p.z.array(W).min(2)}),ee=p.z.object({type:p.z.literal("MultiLineString"),coordinates:p.z.array(Ke.shape.coordinates)}),Vt=p.z.number().min(1).max(23),j=p.z.tuple([ke,Re,ke,Re]),te=p.z.object({show:p.z.array(p.z.string()).optional(),hide:p.z.array(p.z.string()).optional()}),Mo=p.z.enum(["asc","desc"]),Ae=p.z.object({attribute:p.z.string(),direction:Mo});var t=require("zod");var A=t.z.object({id:t.z.string(),groupId:t.z.string().nullable(),color:t.z.string(),name:t.z.string().nullable(),description:t.z.string().nullable(),attributes:t.z.record(t.z.string(),t.z.unknown()),interaction:t.z.enum(["default","locked"]).optional()}),je=t.z.object({imageUrl:t.z.string().nullable()}),Qe=t.z.object({strokeOpacity:t.z.number(),strokeWidth:t.z.number(),strokeStyle:t.z.enum(["solid","dashed","dotted"])}),Lo=t.z.enum(["meter","kilometer","foot","mile"]),Oe=A.extend(je.shape).extend({type:t.z.literal("Place"),coordinates:W,symbol:t.z.string(),frame:t.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:t.z.boolean()}),me=A.extend(je.shape).extend(Qe.shape).extend({type:t.z.literal("Path"),coordinates:ee.shape.coordinates,distanceMarker:t.z.boolean(),routingMode:t.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:t.z.boolean()}),pe=A.extend(je.shape).extend(Qe.shape).extend({type:t.z.literal("Polygon"),coordinates:se.shape.coordinates,fillOpacity:t.z.number().min(0).max(1),areaMarker:t.z.boolean()}),we=A.extend(je.shape).extend(Qe.shape).extend({type:t.z.literal("Circle"),center:W,radius:t.z.number(),radiusMarker:t.z.boolean(),radiusDisplayAngle:t.z.number(),radiusDisplayUnit:Lo.nullable(),fillOpacity:t.z.number().min(0).max(1)}),ce=A.extend({type:t.z.literal("Marker"),coordinates:ee.shape.coordinates,opacity:t.z.number().min(0).max(1),size:t.z.number().min(0).max(100),zoom:t.z.number().min(0).max(23)}),de=A.extend({type:t.z.literal("Highlighter"),coordinates:ve.shape.coordinates,renderHoles:t.z.boolean(),opacity:t.z.number().min(0).max(1)}),Nt=t.z.object({position:W,rotation:t.z.number(),scale:t.z.number(),zoom:t.z.number().min(0).max(23),text:t.z.string(),align:t.z.enum(["left","center","right"]),style:t.z.enum(["italic","light","regular","caps"]),name:t.z.string()}),We=A.extend(Nt.shape).extend({type:t.z.literal("Text")}),_e=A.extend(Nt.shape).extend({type:t.z.literal("Note"),widthScale:t.z.number().min(0)}),ge=A.extend({type:t.z.literal("Image"),coordinates:ee.shape.coordinates,imageUrl:t.z.string(),opacity:t.z.number().min(0).max(1)}).omit({color:!0}),Go=A.extend({type:t.z.literal("Link"),coordinates:ee.shape.coordinates,url:t.z.string()}),oe={type:!0,coordinates:!0},D={id:!0},$e=Oe.partial().extend(Oe.pick(oe).shape).omit(D),De=me.partial().extend(me.pick(oe).shape).omit(D),Xe=pe.partial().extend(pe.pick(oe).shape).omit(D),Ye=we.partial().extend(we.pick({type:!0,center:!0,radius:!0}).shape).omit(D),et=ce.partial().extend(ce.pick(oe).shape).omit(D),tt=de.partial().extend(de.pick(oe).shape).omit(D),at=We.partial().omit({...D,name:!0,type:!0}).extend({type:t.z.literal("Text"),text:t.z.string()}),ot=_e.partial().omit({...D,name:!0,type:!0}).extend({type:t.z.literal("Note"),text:t.z.string()}),Po=ge.partial().extend(ge.pick({...oe,imageUrl:!0}).shape).omit(D),Ht=t.z.discriminatedUnion("type",[$e,De,Xe,Ye,et,tt,Po,at,ot]);var fi=me.omit({coordinates:!0}),Si=pe.omit({coordinates:!0});var xi=ce.omit({coordinates:!0}),Ci=de.omit({coordinates:!0});var bi=ge.omit({coordinates:!0}),Ii=Go.omit({coordinates:!0}),V={type:!0,id:!0},To=Oe.partial().extend(Oe.pick(V).shape),zo=me.partial().extend(me.pick(V).shape),Fo=pe.partial().extend(pe.pick(V).shape),ko=we.partial().extend(we.pick(V).shape),Ro=ce.partial().extend(ce.pick(V).shape),Bo=de.partial().extend(de.pick(V).shape),vo=We.partial().extend(We.pick(V).shape).omit({name:!0}),Ao=_e.partial().extend(_e.pick(V).shape).omit({name:!0}),Oo=ge.partial().extend(ge.pick(V).shape),Zt=t.z.discriminatedUnion("type",[To,zo,Fo,ko,Ro,Bo,vo,Ao,Oo]),Jt=t.z.object({ids:t.z.array(t.z.string()).optional()}),qt=t.z.object({ids:t.z.array(t.z.string()).optional()});var wo=e("getElement",L.z.string()),jo=e("getElementGeometry",L.z.string()),Do=e("getElements",Jt.optional()),Vo=e("getElementGroup",L.z.string()),No=e("getElementGroups",qt.optional()),Ho=e("setElementGroupVisibility",te),Zo=B("onElementChange",L.z.object({id:L.z.string()})),Jo=f("onElementCreate"),qo=f("onElementCreateEnd"),Ko=B("onElementDelete",L.z.object({id:L.z.string()})),Wo=B("onElementGroupChange",L.z.object({id:L.z.string()})),_o=e("createElement",Ht),Qo=e("updateElement",Zt),$o=e("deleteElement",L.z.string()),Kt={methods:[wo,jo,Do,Vo,No,Ho,_o,Qo,$o],listeners:[Zo,Jo,qo,Ko,Wo]};var Xo=f("onPointerClick"),Yo=f("onPointerMove"),Wt={methods:null,listeners:[Xo,Yo]};var i=require("zod");var s=require("zod");var en=s.z.enum(["in","ni"]),tn=s.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Fi=s.z.enum(["and","or"]),_t=s.z.union([s.z.number(),s.z.string(),s.z.boolean(),s.z.null()]),Qt=s.z.string().or(s.z.null()),an=s.z.tuple([Qt,en,s.z.array(_t).or(s.z.null())]),on=s.z.tuple([Qt,tn,_t]),nt=s.z.union([an,on]),rt=s.z.tuple([s.z.lazy(()=>s.z.union([rt,nt,s.z.null(),s.z.boolean()])),s.z.enum(["and","or"]),s.z.lazy(()=>s.z.union([rt,nt,s.z.null(),s.z.boolean()]))]),G=s.z.union([rt,nt,s.z.null(),s.z.boolean()]),P=s.z.union([j,se,ve,s.z.array(W)]);var m=require("zod");var n=require("zod");var $t=n.z.enum(["avg","max","min","sum","median"]),Xt=n.z.enum(["avg","max","min","sum","count"]),nn=n.z.object({method:$t,attribute:n.z.string()}),rn=n.z.object({methods:n.z.array(n.z.union([$t,n.z.literal("count")])),attribute:n.z.string().optional()}),Yt=n.z.object({boundary:P.optional(),filters:G.optional(),aggregation:nn.optional()}),ea=n.z.object({layerId:n.z.string(),attribute:n.z.string(),limit:n.z.number().optional(),boundary:P.optional(),filters:G.optional(),values:Yt.optional()}),Bi=n.z.object({key:n.z.union([n.z.number(),n.z.string(),n.z.boolean()]),value:n.z.number().nullable()}),it=n.z.object({type:n.z.literal("equal-intervals"),count:n.z.number()}),ln=n.z.object({type:n.z.literal("time-interval"),interval:n.z.enum(["hour","day","week","month","year"])}),ta=n.z.object({layerId:n.z.string(),attribute:n.z.string(),steps:n.z.union([it,ln,n.z.array(n.z.number())]),boundary:P.optional(),filters:G.optional(),values:Yt.optional()}),vi=n.z.object({min:n.z.number(),max:n.z.number(),value:n.z.number()}),aa=n.z.object({layerId:n.z.string(),boundary:P.optional(),filters:G.optional(),aggregation:rn}),oa=n.z.enum(["h3"]),sn=n.z.object({type:oa,resolution:n.z.number(),method:Xt.extract(["count"])}),mn=n.z.object({type:oa,resolution:n.z.number(),method:Xt.exclude(["count"]),attribute:n.z.string()}),pn=n.z.union([sn,mn]),na=n.z.object({layerId:n.z.string(),boundary:P.optional(),filters:G.optional(),gridConfig:pn});var cn=m.z.enum(["avg","min","max","sum","median","stddev","majority","area"]),lt=m.z.object({layerId:m.z.string(),bandId:m.z.string(),boundary:P.optional(),filters:G.optional()}),dn=m.z.object({methods:m.z.array(cn),percentiles:m.z.array(m.z.number()).optional()}),ra=lt.extend({aggregation:dn}),Di=m.z.object({rank:m.z.number(),value:m.z.number().nullable()}),ia=lt.extend({steps:m.z.union([it,m.z.array(m.z.number())])}),Vi=m.z.object({min:m.z.number(),max:m.z.number(),value:m.z.number()}),la=lt.extend({limit:m.z.number().optional()}),Ni=m.z.object({key:m.z.number(),value:m.z.number(),areaM2:m.z.number().optional()}),sa=m.z.object({layerId:m.z.string(),bandId:m.z.string(),boundary:m.z.union([Ke,ee])}),Hi=m.z.object({distanceM:m.z.number(),value:m.z.number().nullable()});var r=require("zod");var qi=r.z.enum(["processing","completed","failed","incomplete"]),ma=r.z.object({type:r.z.literal("geoJsonUrl"),url:r.z.string().url(),refreshInterval:r.z.number().min(250).max(5*60*1e3).nullable().optional()}),pa=r.z.object({type:r.z.literal("geoJsonData"),data:r.z.object({}).passthrough().or(r.z.instanceof(ArrayBuffer))}),ca=r.z.object({type:r.z.literal("geoJsonFile"),file:r.z.instanceof(File)}),gn=r.z.enum(["default","nameOnly"]),da=r.z.object({id:r.z.string(),style:r.z.object({}).passthrough().optional(),shownInLegend:r.z.boolean().optional(),legendDisplay:gn.optional(),name:r.z.string().optional(),caption:r.z.string().optional(),description:r.z.string().optional(),bounds:j.optional(),source:r.z.union([ma,pa,ca]).optional()}),ga=r.z.object({ids:r.z.array(r.z.string()).optional()}),ua=r.z.object({ids:r.z.array(r.z.string()).optional()}),ne=r.z.object({id:r.z.string(),layerId:r.z.string()}),ya=r.z.object({ids:ne.array().optional(),layerIds:r.z.string().array().optional()}),ha=r.z.object({layerIds:r.z.array(r.z.string()).optional(),areaQuery:r.z.union([r.z.object({coordinates:Be}),r.z.object({boundary:j})]).optional()}),un=r.z.object({Point:r.z.object({}).passthrough().optional(),Line:r.z.object({}).passthrough().optional(),Polygon:r.z.object({}).passthrough().optional()}),fa=r.z.object({source:r.z.union([ma,pa,ca]),name:r.z.string(),bounds:j.optional(),caption:r.z.string().optional(),description:r.z.string().optional(),geometryStyles:un.optional()});var yn=e("getLayer",i.z.string()),hn=e("getLayers",ga.optional()),fn=e("setLayerVisibility",te),Sn=B("onLayerChange",i.z.object({id:i.z.string()})),xn=e("setLayerStyle",i.z.object({id:i.z.string(),style:i.z.object({}).passthrough()})),Cn=e("setLayerLegendVisibility",te),bn=e("createLayersFromGeoJson",fa),In=e("updateLayer",da),En=e("deleteLayer",i.z.string()),Un=e("duplicateLayer",i.z.string()),Mn=e("getLayerGroup",i.z.string()),Ln=e("getLayerGroups",ua.optional()),Gn=e("setLayerGroupVisibility",te),Pn=e("setLayerGroupLegendVisibility",te),Tn=B("onLayerGroupChange",i.z.object({id:i.z.string()})),zn=e("getLegendItem",ne),Fn=e("getLegendItems",ya.optional()),kn=B("onLegendItemChange",ne),Rn=e("setLegendItemVisibility",i.z.object({show:ne.array().optional(),hide:ne.array().optional()})),Bn=e("getLayerFilters",i.z.string()),vn=e("setLayerFilters",i.z.object({layerId:i.z.string(),filters:G,note:i.z.string().optional()})),An=B("onLayerFiltersChange",i.z.object({layerId:i.z.string()})),On=e("getLayerBoundaries",i.z.string()),wn=e("setLayerBoundary",i.z.object({layerIds:i.z.array(i.z.string()),boundary:P.nullable()})),jn=B("onLayerBoundariesChange",i.z.object({layerId:i.z.string()})),Dn=e("getRenderedFeatures",ha.optional()),Vn=e("getFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Nn=e("getFeatures",i.z.object({layerId:i.z.string(),filters:G.optional(),sorting:Ae.optional(),boundary:P.optional(),search:i.z.string().optional(),pagination:i.z.string().optional().nullish(),pageSize:i.z.number().optional(),select:i.z.array(i.z.string()).optional()})),Hn=e("getGeoJsonFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Zn=e("getCategoryData",ea),Jn=e("getHistogramData",ta),qn=e("getAggregates",aa),Kn=e("getPrecomputedAggregates",na),Wn=e("getRasterAggregates",ra),_n=e("getRasterHistogramData",ia),Qn=e("getRasterCategoryData",la),$n=e("getRasterProfile",sa),Xn=e("getLayerSchema",i.z.string()),Sa={methods:[yn,hn,fn,xn,Cn,bn,En,In,Un,Mn,Ln,Gn,Pn,zn,Fn,Rn,Bn,vn,On,wn,Dn,Vn,Nn,Hn,Zn,Jn,qn,Kn,Wn,_n,Qn,$n,Xn],listeners:[Sn,Tn,kn,An,jn]};var xa=require("zod");var Yn=e("getMapDetails",xa.z.undefined()),Ca={methods:[Yn],listeners:[]};var ue=require("zod");var N=require("zod"),ba=N.z.object({id:N.z.string().or(N.z.number()),layerId:N.z.string(),showPopup:N.z.boolean().optional(),fitViewport:N.z.boolean().or(N.z.object({maxZoom:N.z.number()})).optional()});var er=e("getSelection",ue.z.undefined()),tr=f("onSelectionChange"),ar=e("selectFeature",ba),or=e("clearSelection",ue.z.object({features:ue.z.boolean().optional(),elements:ue.z.boolean().optional()}).optional()),Ia={methods:[er,ar,or],listeners:[tr]};var Ga=require("zod");var C=require("zod");var Ea=["circle","highlighter","line","marker","note","pin","polygon","route","text"],nr=[...Ea,"link"],Ua=C.z.enum(nr),Ma=C.z.enum(Ea),H={showInspector:C.z.boolean().optional()},rr=$e.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:C.z.enum(["enter name","add another","select"])}).required(),ir=De.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),lr=De.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),sr=Xe.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),mr=Ye.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),pr=et.pick({color:!0,opacity:!0,size:!0}).required(),cr=tt.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:C.z.number().min(0).max(200)}).required(),dr=at.pick({color:!0,align:!0,style:!0}).required(),gr=ot.pick({color:!0,align:!0,style:!0}).required(),La=C.z.discriminatedUnion("tool",[rr.partial().extend({tool:C.z.literal("pin"),...H}),ir.partial().extend({tool:C.z.literal("line"),...H}),lr.partial().extend({tool:C.z.literal("route"),...H}),sr.partial().extend({tool:C.z.literal("polygon"),...H}),mr.partial().extend({tool:C.z.literal("circle"),...H}),pr.partial().extend({tool:C.z.literal("marker"),...H}),cr.partial().extend({tool:C.z.literal("highlighter"),...H}),dr.partial().extend({tool:C.z.literal("text"),...H}),gr.partial().extend({tool:C.z.literal("note"),...H})]);var ur=e("setTool",Ua.nullable()),yr=e("getTool",Ga.z.undefined()),hr=f("onToolChange"),fr=e("setToolSettings",La),Sr=e("getToolSettings",Ma),xr=f("onToolSettingsChange"),Pa={methods:[ur,yr,fr,Sr],listeners:[hr,xr]};var X=require("zod");var a=require("zod");var _=require("zod"),Z=_.z.union([_.z.object({after:_.z.string()}),_.z.object({before:_.z.string()}),_.z.object({at:_.z.enum(["start","end"])})]);var b=require("zod");var g=require("zod"),Cr=g.z.object({onCreate:g.z.function().args(g.z.object({id:g.z.string()})).returns(g.z.void()).optional(),onDestroy:g.z.function().args(g.z.object({id:g.z.string()})).returns(g.z.void()).optional()}),br=g.z.object({onCreate:g.z.string().optional(),onDestroy:g.z.string().optional()}),u=Cr.extend({id:g.z.string()}),Ta=u.partial({id:!0}),c={params:Ta,clonable:Ta.extend(br.shape)},I=u.extend({label:g.z.string().optional()}),h={params:I.extend(c.params.shape),clonable:I.extend(c.clonable.shape)};function l(o){return o.partial().extend({id:g.z.string(),type:o.shape.type})}var T=g.z.object({label:g.z.string(),value:g.z.string(),disabled:g.z.boolean().optional()});var st=b.z.object({type:b.z.literal("ActionTrigger"),label:b.z.string(),disabled:b.z.boolean().optional()}),ye={read:u.extend(st.shape).extend({onTrigger:b.z.function().args(b.z.object({id:b.z.string()})).returns(b.z.void())}),create:c.params.extend(st.shape).extend({type:b.z.undefined()}).extend({onTrigger:b.z.function().args(b.z.object({id:b.z.string()})).returns(b.z.void())}),clonable:c.clonable.extend(st.shape).extend({type:b.z.undefined()}).extend({onTrigger:b.z.string()})};var S=require("zod");var Ve=S.z.object({type:S.z.literal("FeatureAction"),label:S.z.string(),onTrigger:S.z.function().args(S.z.object({feature:S.z.custom()})).returns(S.z.void()),layerIds:S.z.array(S.z.string()).optional(),geometryTypes:S.z.array(S.z.enum(["Polygon","Line","Point","Raster"])).optional()}),Ne={read:u.extend(Ve.shape).extend({id:S.z.string()}),create:c.params.extend(Ve.shape).extend({type:S.z.undefined()}),clonable:c.clonable.extend(Ve.shape).extend({type:S.z.undefined()}).extend({onTrigger:S.z.string()}),update:l(c.params.extend(Ve.shape).extend({type:S.z.undefined()}))};var Fa=require("zod");var mt=u.extend({type:Fa.z.literal("FlexibleSpace")}),za=mt.partial({id:!0}),he={params:za,clonable:za.extend(c.clonable.shape)},pt={params:l(he.params),clonable:l(he.clonable)};var E=require("zod");var ie=require("zod");var z=require("zod");var fe=u.extend({type:z.z.literal("Button"),label:z.z.string(),variant:z.z.enum(["filled","transparent","outlined"]).optional(),tint:z.z.enum(["default","primary","accent","danger"]).optional(),disabled:z.z.boolean().optional(),onClick:z.z.function().args(z.z.object({id:z.z.string()})).returns(z.z.void())}),ka=fe.extend(c.params.shape),Q={params:ka,clonable:ka.extend(c.clonable.shape).extend({onClick:z.z.string()})},ct={params:l(Q.params),clonable:l(Q.clonable)};var re=require("zod");var dt=I.extend({type:re.z.literal("ButtonRow"),align:re.z.enum(["start","end"]).optional(),items:re.z.array(fe)}),Ra=dt.extend(h.params.shape).omit({items:!0}).extend({items:re.z.array(Q.params)}),Ir=Ra.extend(h.clonable.shape).extend({items:re.z.array(Q.clonable)}),Se={params:Ra,clonable:Ir},gt={params:l(Se.params),clonable:l(Se.clonable)};var J=require("zod");var Ba=J.z.array(T.shape.value),ut=I.extend({type:J.z.literal("CheckboxGroup"),options:J.z.array(T),value:Ba,onChange:J.z.function().args(J.z.object({value:Ba,id:J.z.string()})).returns(J.z.void())}),va=ut.extend(h.params.shape),xe={params:va,clonable:va.extend(h.clonable.shape).extend({onChange:J.z.string()})},yt={params:l(xe.params),clonable:l(xe.clonable)};var Oa=require("zod");var ht=u.extend({type:Oa.z.literal("Divider")}),Aa=ht.partial({id:!0}),Ce={params:Aa,clonable:Aa.extend(c.clonable.shape)},ft={params:l(Ce.params),clonable:l(Ce.clonable)};var F=require("zod");var Er=F.z.lazy(()=>F.z.array(Ie.refine(o=>o.type!=="Grid"))),Ur=F.z.lazy(()=>F.z.array(k.params.refine(o=>o.type!=="Grid"))),Mr=F.z.lazy(()=>F.z.array(k.clonable.refine(o=>o.type!=="Grid"))),St=u.extend({type:F.z.literal("Grid"),grid:F.z.string().optional(),verticalAlignment:F.z.enum(["top","center","bottom"]).optional(),horizontalDistribution:F.z.enum(["start","center","end","space-between","space-around","space-evenly"]).optional(),items:Er}),wa=St.extend(c.params.shape).omit({items:!0}).extend({items:Ur}),Lr=wa.extend(c.clonable.shape).extend({items:Mr}),be={params:wa,clonable:Lr},xt={params:l(be.params),clonable:l(be.clonable)};var Ee=require("zod");var Ct=u.extend({type:Ee.z.literal("Iframe"),height:Ee.z.number().or(Ee.z.string()).optional(),url:Ee.z.string()}),ja=Ct.extend(c.params.shape),Ue={params:ja,clonable:ja.extend(c.clonable.shape)},bt={params:l(Ue.params),clonable:l(Ue.clonable)};var $=require("zod");var Da=T.shape.value.optional(),It=I.extend({type:$.z.literal("RadioGroup"),options:$.z.array(T),value:Da,onChange:$.z.function().args($.z.object({value:Da,id:$.z.string()})).returns($.z.void())}),Va=It.extend(h.params.shape),Me={params:Va,clonable:Va.extend(h.clonable.shape).extend({onChange:$.z.string()})},Et={params:l(Me.params),clonable:l(Me.clonable)};var M=require("zod");var Ut=I.extend({type:M.z.literal("Select"),options:M.z.array(T),value:M.z.string().optional(),placeholder:M.z.string().optional(),search:M.z.boolean().optional(),onChange:M.z.function().args(M.z.object({value:M.z.string(),id:M.z.string()})).returns(M.z.void())}),Na=Ut.extend(h.params.shape),Le={params:Na,clonable:Na.extend(h.clonable.shape).extend({onChange:M.z.string()})},Mt={params:l(Le.params),clonable:l(Le.clonable)};var Lt=require("zod");var Gt=u.extend({type:Lt.z.literal("Text"),content:Lt.z.string()}),Ha=Gt.extend(c.params.shape),Ge={params:Ha,clonable:Ha.extend(c.clonable.shape)},Pt={params:l(Ge.params),clonable:l(Ge.clonable)};var d=require("zod");var Tt=I.extend({type:d.z.literal("TextInput"),value:d.z.string(),placeholder:d.z.string().optional(),onChange:d.z.function().args(d.z.object({value:d.z.string(),id:d.z.string()})).returns(d.z.void()).optional(),onBlur:d.z.function().args(d.z.object({value:d.z.string(),id:d.z.string()})).returns(d.z.void()).optional(),onFocus:d.z.function().args(d.z.object({value:d.z.string(),id:d.z.string()})).returns(d.z.void()).optional()}),Za=Tt.extend(h.params.shape),Pe={params:Za,clonable:Za.extend(h.clonable.shape).extend({onChange:d.z.string().optional(),onBlur:d.z.string().optional(),onFocus:d.z.string().optional()})},zt={params:l(Pe.params),clonable:l(Pe.clonable)};var O=require("zod");var Ja=O.z.array(T.shape.value),Ft=I.extend({type:O.z.literal("ToggleGroup"),alignment:O.z.enum(["start","end"]).optional(),options:O.z.array(T),value:Ja,onChange:O.z.function().args(O.z.object({value:Ja,id:O.z.string()})).returns(O.z.void())}),qa=Ft.extend(h.params.shape),Te={params:qa,clonable:qa.extend(h.clonable.shape).extend({onChange:O.z.string()})},kt={params:l(Te.params),clonable:l(Te.clonable)};var Ie=ie.z.discriminatedUnion("type",[fe,Gt,ht,Tt,Ut,mt,dt,ut,It,Ft,Ct,St]),Gr=ie.z.discriminatedUnion("type",[Q.params,Ge.params,Ce.params,Pe.params,Le.params,he.params,Se.params,xe.params,Me.params,Te.params,Ue.params,be.params]),Pr=ie.z.discriminatedUnion("type",[Q.clonable,Ge.clonable,Ce.clonable,Pe.clonable,Le.clonable,he.clonable,Se.clonable,xe.clonable,Me.clonable,Te.clonable,Ue.clonable,be.clonable]),k={params:Gr,clonable:Pr},Rt={params:ie.z.discriminatedUnion("type",[ct.params,Pt.params,zt.params,Mt.params,ft.params,pt.params,gt.params,yt.params,Et.params,kt.params,bt.params,xt.params]),clonable:ie.z.discriminatedUnion("type",[ct.clonable,Pt.clonable,zt.clonable,Mt.clonable,ft.clonable,pt.clonable,gt.clonable,yt.clonable,Et.clonable,kt.clonable,bt.clonable,xt.clonable])};var Tr=u.extend({type:E.z.literal("Panel"),title:E.z.string().optional(),body:E.z.array(Ie).optional(),footer:E.z.array(Ie).optional(),onClickClose:E.z.function().args(E.z.object({id:E.z.string()})).returns(E.z.void()).optional()}),Ka=Tr.extend(c.params.shape).required({id:!0}).partial({type:!0}).omit({body:!0,footer:!0}).extend({body:E.z.array(k.params).optional(),footer:E.z.array(k.params).optional()}),Bt={params:Ka,clonable:Ka.extend(c.clonable.shape).required({id:!0}).extend({onClickClose:E.z.string().optional(),body:E.z.array(k.clonable).optional(),footer:E.z.array(k.clonable).optional()})};var ds=a.z.object({actionTrigger:ye.create,placement:Z.optional()}),Wa=a.z.object({actionTrigger:ye.clonable,placement:Z.optional()}),gs=ye.create.partial().required({id:!0}),_a=ye.clonable.partial().required({id:!0}),us=a.z.object({action:Ne.create,placement:Z.optional()}),Qa=a.z.object({action:Ne.clonable,placement:Z.optional()}),$a=Ne.clonable.partial().required({id:!0}),ys=a.z.object({panel:Bt.params,placement:Z.optional()}),Xa=a.z.object({panel:Bt.clonable,initialPlacement:Z.optional()}),hs=a.z.object({panelId:a.z.string(),elements:a.z.array(a.z.object({element:k.params,container:a.z.union([a.z.literal("body"),a.z.literal("footer"),a.z.object({id:a.z.string()})]).optional(),placement:Z.optional()}))}),Ya=a.z.object({panelId:a.z.string(),elements:a.z.array(a.z.object({element:k.clonable,container:a.z.union([a.z.literal("body"),a.z.literal("footer"),a.z.object({id:a.z.string()})]).optional(),placement:Z.optional()}))}),fs=a.z.object({panelId:a.z.string(),elements:a.z.array(a.z.object({element:Rt.params}))}),eo=a.z.object({panelId:a.z.string(),elements:a.z.array(a.z.object({element:Rt.clonable}))}),to=a.z.object({panelId:a.z.string(),elements:a.z.array(a.z.string())}),ao=a.z.object({showLegend:a.z.boolean().optional(),cooperativeGestures:a.z.boolean().optional(),fullScreenButton:a.z.boolean().optional(),geolocation:a.z.boolean().optional(),zoomControls:a.z.boolean().optional(),scaleBar:a.z.boolean().optional(),rotation:a.z.boolean().optional(),contextMenu:a.z.boolean().optional()}),oo=a.z.object({featureSelectPanel:a.z.boolean().optional(),featureHoverPanel:a.z.boolean().optional(),elementSelectPanel:a.z.boolean().optional(),linkClickOpen:a.z.boolean().optional(),imageLightboxOpen:a.z.boolean().optional()});var zr=e("createActionTrigger",Wa),Fr=e("updateActionTrigger",_a),kr=e("deleteActionTrigger",X.z.string()),Rr=e("createFeatureAction",Qa),Br=e("updateFeatureAction",$a),vr=e("deleteFeatureAction",X.z.string()),Ar=e("createPanelId",X.z.void()),Or=e("createOrUpdatePanel",Xa),wr=e("deletePanel",X.z.string()),jr=e("createPanelElements",Ya),Dr=e("updatePanelElements",eo),Vr=e("deletePanelElements",to),Nr=e("updateUiControls",ao),Hr=e("setOnMapInteractionsUi",oo),Zr=e("showLayerDataTable",X.z.object({layerId:X.z.string(),sorting:Ae.optional()}).optional()),Jr=e("hideLayerDataTable",X.z.undefined()),no={methods:[zr,Fr,kr,Rr,Br,vr,Ar,Or,wr,jr,Dr,Vr,Nr,Hr,Zr,Jr],listeners:null};var vt=require("zod");var ze=require("zod");var He=ze.z.object({center:Be,zoom:Vt}),ro=ze.z.object({center:He.shape.center.optional(),zoom:He.shape.zoom.optional()}),io=ze.z.object({minZoom:He.shape.zoom.nullish(),maxZoom:He.shape.zoom.nullish(),bounds:j.nullish()}).nullable(),lo=ze.z.object({bounds:j});var qr=e("getViewport",vt.z.undefined()),Kr=e("setViewport",ro),Wr=e("getViewportConstraints",vt.z.undefined()),_r=e("setViewportConstraints",io),Qr=e("fitViewportToBounds",lo),$r=f("onViewportMove"),Xr=f("onViewportMoveEnd"),Yr=f("onMapIdle"),so={methods:[Kr,qr,Wr,_r,Qr],listeners:[$r,Xr,Yr]};var At=[no,so,Sa,Kt,Ia,Wt,Pa,Ca,Dt];function ei(o,x,Y){let ae=new Map;async function q(R){if(!ri.safeParse(R.data).success){Y?.onUnknownMessage?.(R.data);return}let Fe=co.safeParse(R.data);if(!Fe.success){Y?.onInvalidMessage?.(R.data,Fe.error),R.ports[0]?.postMessage(mo(Fe.error.message));return}let{data:U}=Fe;if(U.type==="felt.ready")R.ports[0]?.postMessage(!0);else if(U.type==="felt.addListener"){if(U.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let le="options"in U.event?{options:"options"in U.event?U.event.options:void 0,handler:Je=>{R.ports[0]?.postMessage(Je)}}:{handler:Je=>{R.ports[0]?.postMessage(Je)}},Ze=x.listeners[U.event.eventName](le);ae.set(U.event.id,Ze)}else if(U.type==="felt.removeListener")ae.get(U.id)?.(),ae.delete(U.id);else try{let le=x.methods[U.type],Ze=await le(U.params);R.ports[0]?.postMessage(Ze)}catch(le){R.ports[0]?.postMessage(mo(le))}}return o.addEventListener("message",q),()=>{o.removeEventListener("message",q)}}var po={methods:At.map(o=>o.methods??[]).flat(),listeners:At.map(o=>o.listeners??[]).flat()},ti=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),y.z.strictObject({eventName:y.z.literal("onGenericEvent"),id:y.z.string(),options:y.z.object({id:y.z.string()})}),...po.listeners]),ai=y.z.strictObject({type:y.z.literal("felt.addListener"),event:ti}),oi=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),ni=y.z.strictObject({type:y.z.literal("felt.ready")}),co=y.z.discriminatedUnion("type",[ni,ai,oi,...po.methods]),ri=y.z.object({type:y.z.enum(co.options.map(o=>o.shape.type.value))});function mo(o){return{__error__:ii(o)}}function ii(o){return o instanceof Error?o.message:typeof o=="object"&&o!==null&&"message"in o?String(o.message):typeof o=="string"?o:"Unknown error"}0&&(module.exports={createMessageHandler});
1
+ "use strict";var Ke=Object.defineProperty;var yo=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var fo=Object.prototype.hasOwnProperty;var So=(a,g)=>{for(var Y in g)Ke(a,Y,{get:g[Y],enumerable:!0})},xo=(a,g,Y,ae)=>{if(g&&typeof g=="object"||typeof g=="function")for(let K of ho(g))!fo.call(a,K)&&K!==Y&&Ke(a,K,{get:()=>g[K],enumerable:!(ae=yo(g,K))||ae.enumerable});return a};var Co=a=>xo(Ke({},"__esModule",{value:!0}),a);var pi={};So(pi,{createMessageHandler:()=>oi});module.exports=Co(pi);var h=require("zod");var W=require("zod");var D=require("zod");function e(a,g){return D.z.strictObject({type:D.z.literal(a),params:g})}function B(a,g){return D.z.strictObject({eventName:D.z.literal(a),id:D.z.string(),options:g})}function x(a){return D.z.strictObject({eventName:D.z.literal(a),id:D.z.string()})}var v=require("zod"),wt=v.z.object({id:v.z.string(),name:v.z.string(),uiColorScheme:v.z.enum(["light","dark"]),attribution:v.z.string().optional()}),jt=wt.extend({type:v.z.literal("color"),color:v.z.string()}),Dt=wt.extend({type:v.z.literal("xyz_tile"),tileUrl:v.z.string()});var bo=e("getCurrentBasemap",W.z.void()),Io=e("getBasemaps",W.z.void()),Eo=e("chooseBasemap",W.z.string()),Uo=e("removeBasemap",W.z.string()),Mo=e("addCustomBasemap",W.z.object({basemap:W.z.discriminatedUnion("type",[jt.omit({id:!0,uiColorScheme:!0}),Dt.omit({id:!0})]),select:W.z.boolean().optional()})),Lo=x("onBasemapChange"),Vt={methods:[bo,Io,Eo,Mo,Uo],listeners:[Lo]};var L=require("zod");var p=require("zod"),Re=p.z.number(),Be=p.z.number(),ve=p.z.object({latitude:Be,longitude:Re}),V=p.z.tuple([Re,Be]),pe=p.z.object({type:p.z.literal("Polygon"),coordinates:p.z.array(p.z.array(V).min(4).refine(a=>a[0][0]===a[a.length-1][0]&&a[0][1]===a[a.length-1][1],"The last point of each ring must be identical to the first"))}),Ae=p.z.object({type:p.z.literal("MultiPolygon"),coordinates:p.z.array(pe.shape.coordinates)}),We=p.z.object({type:p.z.literal("LineString"),coordinates:p.z.array(V).min(2)}),ee=p.z.object({type:p.z.literal("MultiLineString"),coordinates:p.z.array(We.shape.coordinates)}),Nt=p.z.number().min(1).max(23),N=p.z.tuple([Re,Be,Re,Be]),te=p.z.object({show:p.z.array(p.z.string()).optional(),hide:p.z.array(p.z.string()).optional()}),Po=p.z.enum(["asc","desc"]),Oe=p.z.object({attribute:p.z.string(),direction:Po});var t=require("zod");var A=t.z.object({id:t.z.string(),groupId:t.z.string().nullable(),color:t.z.string(),name:t.z.string().nullable(),description:t.z.string().nullable(),attributes:t.z.record(t.z.string(),t.z.unknown()),interaction:t.z.enum(["default","locked"]).optional()}),De=t.z.object({imageUrl:t.z.string().nullable()}),$e=t.z.object({strokeOpacity:t.z.number(),strokeWidth:t.z.number(),strokeStyle:t.z.enum(["solid","dashed","dotted"])}),Go=t.z.enum(["meter","kilometer","foot","mile"]),we=A.extend(De.shape).extend({type:t.z.literal("Place"),coordinates:V,symbol:t.z.string(),frame:t.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:t.z.boolean()}),ce=A.extend(De.shape).extend($e.shape).extend({type:t.z.literal("Path"),coordinates:ee.shape.coordinates,distanceMarker:t.z.boolean(),routingMode:t.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:t.z.boolean()}),ne=t.z.object({origin:V,mode:t.z.enum(["driving","cycling","walking"]),minutes:t.z.number().int().min(1).max(120)}),oe=A.extend(De.shape).extend($e.shape).extend({type:t.z.literal("Polygon"),coordinates:pe.shape.coordinates,fillOpacity:t.z.number().min(0).max(1),areaMarker:t.z.boolean()}),je=A.extend(De.shape).extend($e.shape).extend({type:t.z.literal("Circle"),center:V,radius:t.z.number(),radiusMarker:t.z.boolean(),radiusDisplayAngle:t.z.number(),radiusDisplayUnit:Go.nullable(),fillOpacity:t.z.number().min(0).max(1)}),de=A.extend({type:t.z.literal("Marker"),coordinates:ee.shape.coordinates,opacity:t.z.number().min(0).max(1),size:t.z.number().min(0).max(100),zoom:t.z.number().min(0).max(23)}),ge=A.extend({type:t.z.literal("Highlighter"),coordinates:Ae.shape.coordinates,renderHoles:t.z.boolean(),opacity:t.z.number().min(0).max(1)}),Ht=t.z.object({position:V,rotation:t.z.number(),scale:t.z.number(),zoom:t.z.number().min(0).max(23),text:t.z.string(),align:t.z.enum(["left","center","right"]),style:t.z.enum(["italic","light","regular","caps"]),name:t.z.string()}),_e=A.extend(Ht.shape).extend({type:t.z.literal("Text")}),Qe=A.extend(Ht.shape).extend({type:t.z.literal("Note"),widthScale:t.z.number().min(0)}),ue=A.extend({type:t.z.literal("Image"),coordinates:ee.shape.coordinates,imageUrl:t.z.string(),opacity:t.z.number().min(0).max(1)}).omit({color:!0}),To=A.extend({type:t.z.literal("Link"),coordinates:ee.shape.coordinates,url:t.z.string()}),re={type:!0,coordinates:!0},O={id:!0},Xe=we.partial().extend(we.pick(re).shape).omit(O),Ve=ce.partial().extend(ce.pick(re).shape).omit(O),Ye=oe.partial().extend(oe.pick(re).shape).omit(O),Ci=oe.partial().omit({...O,coordinates:!0}).extend({type:t.z.literal("Polygon"),isochrone:ne}),zo=Ye.partial({coordinates:!0}).extend({isochrone:ne.optional()}),et=je.partial().extend(je.pick({type:!0,center:!0,radius:!0}).shape).omit(O),tt=de.partial().extend(de.pick(re).shape).omit(O),at=ge.partial().extend(ge.pick(re).shape).omit(O),ot=_e.partial().omit({...O,name:!0,type:!0}).extend({type:t.z.literal("Text"),text:t.z.string()}),nt=Qe.partial().omit({...O,name:!0,type:!0}).extend({type:t.z.literal("Note"),text:t.z.string()}),Fo=ue.partial().extend(ue.pick({...re,imageUrl:!0}).shape).omit(O),Zt=t.z.discriminatedUnion("type",[Xe,Ve,zo,et,tt,at,Fo,ot,nt]).superRefine((a,g)=>{a.type==="Polygon"&&(a.coordinates===void 0&&a.isochrone===void 0&&g.addIssue({code:t.z.ZodIssueCode.custom,message:"A Polygon needs either coordinates or an isochrone"}),a.coordinates!==void 0&&a.isochrone!==void 0&&g.addIssue({code:t.z.ZodIssueCode.custom,message:"A Polygon needs either coordinates or an isochrone, not both"}))});var bi=ce.omit({coordinates:!0}),Ii=oe.omit({coordinates:!0}).extend({isochrone:ne.nullable()});var Ei=de.omit({coordinates:!0}),Ui=ge.omit({coordinates:!0});var Mi=ue.omit({coordinates:!0}),Li=To.omit({coordinates:!0}),H={type:!0,id:!0},ko=we.partial().extend(we.pick(H).shape),Ro=ce.partial().extend(ce.pick(H).shape),Bo=oe.partial().extend(oe.pick(H).shape).extend({isochrone:ne.optional()}),vo=je.partial().extend(je.pick(H).shape),Ao=de.partial().extend(de.pick(H).shape),Oo=ge.partial().extend(ge.pick(H).shape),wo=_e.partial().extend(_e.pick(H).shape).omit({name:!0}),jo=Qe.partial().extend(Qe.pick(H).shape).omit({name:!0}),Do=ue.partial().extend(ue.pick(H).shape),Jt=t.z.discriminatedUnion("type",[ko,Ro,Bo,vo,Ao,Oo,wo,jo,Do]).superRefine((a,g)=>{a.type==="Polygon"&&a.coordinates!==void 0&&a.isochrone!==void 0&&g.addIssue({code:t.z.ZodIssueCode.custom,message:"A Polygon update can set coordinates or an isochrone, not both"})}),qt=t.z.object({ids:t.z.array(t.z.string()).optional()}),Kt=t.z.object({ids:t.z.array(t.z.string()).optional()});var Vo=e("getElement",L.z.string()),No=e("getElementGeometry",L.z.string()),Ho=e("getElements",qt.optional()),Zo=e("getElementGroup",L.z.string()),Jo=e("getElementGroups",Kt.optional()),qo=e("setElementGroupVisibility",te),Ko=B("onElementChange",L.z.object({id:L.z.string()})),Wo=x("onElementCreate"),_o=x("onElementCreateEnd"),Qo=B("onElementDelete",L.z.object({id:L.z.string()})),$o=B("onElementGroupChange",L.z.object({id:L.z.string()})),Xo=e("createElement",Zt),Yo=e("updateElement",Jt),en=e("deleteElement",L.z.string()),Wt={methods:[Vo,No,Ho,Zo,Jo,qo,Xo,Yo,en],listeners:[Ko,Wo,_o,Qo,$o]};var tn=x("onPointerClick"),an=x("onPointerMove"),_t={methods:null,listeners:[tn,an]};var i=require("zod");var s=require("zod");var on=s.z.enum(["in","ni"]),nn=s.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),vi=s.z.enum(["and","or"]),Qt=s.z.union([s.z.number(),s.z.string(),s.z.boolean(),s.z.null()]),$t=s.z.string().or(s.z.null()),rn=s.z.tuple([$t,on,s.z.array(Qt).or(s.z.null())]),ln=s.z.tuple([$t,nn,Qt]),rt=s.z.union([rn,ln]),it=s.z.tuple([s.z.lazy(()=>s.z.union([it,rt,s.z.null(),s.z.boolean()])),s.z.enum(["and","or"]),s.z.lazy(()=>s.z.union([it,rt,s.z.null(),s.z.boolean()]))]),P=s.z.union([it,rt,s.z.null(),s.z.boolean()]),G=s.z.union([N,pe,Ae,s.z.array(V)]);var m=require("zod");var n=require("zod");var Xt=n.z.enum(["avg","max","min","sum","median"]),Yt=n.z.enum(["avg","max","min","sum","count"]),sn=n.z.object({method:Xt,attribute:n.z.string()}),mn=n.z.object({methods:n.z.array(n.z.union([Xt,n.z.literal("count")])),attribute:n.z.string().optional()}),ea=n.z.object({boundary:G.optional(),filters:P.optional(),aggregation:sn.optional()}),ta=n.z.object({layerId:n.z.string(),attribute:n.z.string(),limit:n.z.number().optional(),boundary:G.optional(),filters:P.optional(),values:ea.optional()}),wi=n.z.object({key:n.z.union([n.z.number(),n.z.string(),n.z.boolean()]),value:n.z.number().nullable()}),lt=n.z.object({type:n.z.literal("equal-intervals"),count:n.z.number()}),pn=n.z.object({type:n.z.literal("time-interval"),interval:n.z.enum(["hour","day","week","month","year"])}),aa=n.z.object({layerId:n.z.string(),attribute:n.z.string(),steps:n.z.union([lt,pn,n.z.array(n.z.number())]),boundary:G.optional(),filters:P.optional(),values:ea.optional()}),ji=n.z.object({min:n.z.number(),max:n.z.number(),value:n.z.number()}),oa=n.z.object({layerId:n.z.string(),boundary:G.optional(),filters:P.optional(),aggregation:mn}),na=n.z.enum(["h3"]),cn=n.z.object({type:na,resolution:n.z.number(),method:Yt.extract(["count"])}),dn=n.z.object({type:na,resolution:n.z.number(),method:Yt.exclude(["count"]),attribute:n.z.string()}),gn=n.z.union([cn,dn]),ra=n.z.object({layerId:n.z.string(),boundary:G.optional(),filters:P.optional(),gridConfig:gn});var un=m.z.enum(["avg","min","max","sum","median","stddev","majority","area"]),st=m.z.object({layerId:m.z.string(),bandId:m.z.string(),boundary:G.optional(),filters:P.optional()}),yn=m.z.object({methods:m.z.array(un),percentiles:m.z.array(m.z.number()).optional()}),ia=st.extend({aggregation:yn}),Zi=m.z.object({rank:m.z.number(),value:m.z.number().nullable()}),la=st.extend({steps:m.z.union([lt,m.z.array(m.z.number())])}),Ji=m.z.object({min:m.z.number(),max:m.z.number(),value:m.z.number()}),sa=st.extend({limit:m.z.number().optional()}),qi=m.z.object({key:m.z.number(),value:m.z.number(),areaM2:m.z.number().optional()}),ma=m.z.object({layerId:m.z.string(),bandId:m.z.string(),boundary:m.z.union([We,ee])}),Ki=m.z.object({distanceM:m.z.number(),value:m.z.number().nullable()});var r=require("zod");var Qi=r.z.enum(["processing","completed","failed","incomplete"]),pa=r.z.object({type:r.z.literal("geoJsonUrl"),url:r.z.string().url(),refreshInterval:r.z.number().min(250).max(5*60*1e3).nullable().optional()}),ca=r.z.object({type:r.z.literal("geoJsonData"),data:r.z.object({}).passthrough().or(r.z.instanceof(ArrayBuffer))}),da=r.z.object({type:r.z.literal("geoJsonFile"),file:r.z.instanceof(File)}),hn=r.z.enum(["default","nameOnly"]),ga=r.z.object({id:r.z.string(),style:r.z.object({}).passthrough().optional(),shownInLegend:r.z.boolean().optional(),legendDisplay:hn.optional(),name:r.z.string().optional(),caption:r.z.string().optional(),description:r.z.string().optional(),bounds:N.optional(),source:r.z.union([pa,ca,da]).optional()}),ua=r.z.object({ids:r.z.array(r.z.string()).optional()}),ya=r.z.object({ids:r.z.array(r.z.string()).optional()}),ie=r.z.object({id:r.z.string(),layerId:r.z.string()}),ha=r.z.object({ids:ie.array().optional(),layerIds:r.z.string().array().optional()}),fa=r.z.object({layerIds:r.z.array(r.z.string()).optional(),areaQuery:r.z.union([r.z.object({coordinates:ve}),r.z.object({boundary:N})]).optional()}),fn=r.z.object({Point:r.z.object({}).passthrough().optional(),Line:r.z.object({}).passthrough().optional(),Polygon:r.z.object({}).passthrough().optional()}),Sa=r.z.object({source:r.z.union([pa,ca,da]),name:r.z.string(),bounds:N.optional(),caption:r.z.string().optional(),description:r.z.string().optional(),geometryStyles:fn.optional()});var Sn=e("getLayer",i.z.string()),xn=e("getLayers",ua.optional()),Cn=e("setLayerVisibility",te),bn=B("onLayerChange",i.z.object({id:i.z.string()})),In=e("setLayerStyle",i.z.object({id:i.z.string(),style:i.z.object({}).passthrough()})),En=e("setLayerLegendVisibility",te),Un=e("createLayersFromGeoJson",Sa),Mn=e("updateLayer",ga),Ln=e("deleteLayer",i.z.string()),Pn=e("duplicateLayer",i.z.string()),Gn=e("getLayerGroup",i.z.string()),Tn=e("getLayerGroups",ya.optional()),zn=e("setLayerGroupVisibility",te),Fn=e("setLayerGroupLegendVisibility",te),kn=B("onLayerGroupChange",i.z.object({id:i.z.string()})),Rn=e("getLegendItem",ie),Bn=e("getLegendItems",ha.optional()),vn=B("onLegendItemChange",ie),An=e("setLegendItemVisibility",i.z.object({show:ie.array().optional(),hide:ie.array().optional()})),On=e("getLayerFilters",i.z.string()),wn=e("setLayerFilters",i.z.object({layerId:i.z.string(),filters:P,note:i.z.string().optional()})),jn=B("onLayerFiltersChange",i.z.object({layerId:i.z.string()})),Dn=e("getLayerBoundaries",i.z.string()),Vn=e("setLayerBoundary",i.z.object({layerIds:i.z.array(i.z.string()),boundary:G.nullable()})),Nn=B("onLayerBoundariesChange",i.z.object({layerId:i.z.string()})),Hn=e("getRenderedFeatures",fa.optional()),Zn=e("getFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Jn=e("getFeatures",i.z.object({layerId:i.z.string(),filters:P.optional(),sorting:Oe.optional(),boundary:G.optional(),search:i.z.string().optional(),pagination:i.z.string().optional().nullish(),pageSize:i.z.number().optional(),select:i.z.array(i.z.string()).optional()})),qn=e("getGeoJsonFeature",i.z.object({id:i.z.string().or(i.z.number()),layerId:i.z.string()})),Kn=e("getCategoryData",ta),Wn=e("getHistogramData",aa),_n=e("getAggregates",oa),Qn=e("getPrecomputedAggregates",ra),$n=e("getRasterAggregates",ia),Xn=e("getRasterHistogramData",la),Yn=e("getRasterCategoryData",sa),er=e("getRasterProfile",ma),tr=e("getLayerSchema",i.z.string()),xa={methods:[Sn,xn,Cn,In,En,Un,Ln,Mn,Pn,Gn,Tn,zn,Fn,Rn,Bn,An,On,wn,Dn,Vn,Hn,Zn,Jn,qn,Kn,Wn,_n,Qn,$n,Xn,Yn,er,tr],listeners:[bn,kn,vn,jn,Nn]};var Ca=require("zod");var ar=e("getMapDetails",Ca.z.undefined()),ba={methods:[ar],listeners:[]};var ye=require("zod");var Z=require("zod"),Ia=Z.z.object({id:Z.z.string().or(Z.z.number()),layerId:Z.z.string(),showPopup:Z.z.boolean().optional(),fitViewport:Z.z.boolean().or(Z.z.object({maxZoom:Z.z.number()})).optional()});var or=e("getSelection",ye.z.undefined()),nr=x("onSelectionChange"),rr=e("selectFeature",Ia),ir=e("clearSelection",ye.z.object({features:ye.z.boolean().optional(),elements:ye.z.boolean().optional()}).optional()),Ea={methods:[or,rr,ir],listeners:[nr]};var Ta=require("zod");var f=require("zod");var Ua=["circle","highlighter","isochrone","line","marker","note","pin","polygon","route","text"],lr=[...Ua,"link"],Ma=f.z.enum(lr),La=f.z.enum(Ua),w={showInspector:f.z.boolean().optional()},sr=Xe.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:f.z.enum(["enter name","add another","select"])}).required(),mr=Ve.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),pr=Ve.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Pa=Ye.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),cr=f.z.object({...Pa.omit({areaMarker:!0}).shape,...ne.pick({mode:!0,minutes:!0}).shape}),dr=et.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),gr=tt.pick({color:!0,opacity:!0,size:!0}).required(),ur=at.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:f.z.number().min(0).max(200)}).required(),yr=ot.pick({color:!0,align:!0,style:!0}).required(),hr=nt.pick({color:!0,align:!0,style:!0}).required(),Ga=f.z.discriminatedUnion("tool",[sr.partial().extend({tool:f.z.literal("pin"),...w}),mr.partial().extend({tool:f.z.literal("line"),...w}),pr.partial().extend({tool:f.z.literal("route"),...w}),Pa.partial().extend({tool:f.z.literal("polygon"),...w}),cr.partial().extend({tool:f.z.literal("isochrone"),...w}),dr.partial().extend({tool:f.z.literal("circle"),...w}),gr.partial().extend({tool:f.z.literal("marker"),...w}),ur.partial().extend({tool:f.z.literal("highlighter"),...w}),yr.partial().extend({tool:f.z.literal("text"),...w}),hr.partial().extend({tool:f.z.literal("note"),...w})]);var fr=e("setTool",Ma.nullable()),Sr=e("getTool",Ta.z.undefined()),xr=x("onToolChange"),Cr=e("setToolSettings",Ga),br=e("getToolSettings",La),Ir=x("onToolSettingsChange"),za={methods:[fr,Sr,Cr,br],listeners:[xr,Ir]};var X=require("zod");var o=require("zod");var _=require("zod"),J=_.z.union([_.z.object({after:_.z.string()}),_.z.object({before:_.z.string()}),_.z.object({at:_.z.enum(["start","end"])})]);var b=require("zod");var u=require("zod"),Er=u.z.object({onCreate:u.z.function().args(u.z.object({id:u.z.string()})).returns(u.z.void()).optional(),onDestroy:u.z.function().args(u.z.object({id:u.z.string()})).returns(u.z.void()).optional()}),Ur=u.z.object({onCreate:u.z.string().optional(),onDestroy:u.z.string().optional()}),y=Er.extend({id:u.z.string()}),Fa=y.partial({id:!0}),c={params:Fa,clonable:Fa.extend(Ur.shape)},I=y.extend({label:u.z.string().optional()}),S={params:I.extend(c.params.shape),clonable:I.extend(c.clonable.shape)};function l(a){return a.partial().extend({id:u.z.string(),type:a.shape.type})}var T=u.z.object({label:u.z.string(),value:u.z.string(),disabled:u.z.boolean().optional()});var mt=b.z.object({type:b.z.literal("ActionTrigger"),label:b.z.string(),disabled:b.z.boolean().optional()}),he={read:y.extend(mt.shape).extend({onTrigger:b.z.function().args(b.z.object({id:b.z.string()})).returns(b.z.void())}),create:c.params.extend(mt.shape).extend({type:b.z.undefined()}).extend({onTrigger:b.z.function().args(b.z.object({id:b.z.string()})).returns(b.z.void())}),clonable:c.clonable.extend(mt.shape).extend({type:b.z.undefined()}).extend({onTrigger:b.z.string()})};var C=require("zod");var Ne=C.z.object({type:C.z.literal("FeatureAction"),label:C.z.string(),onTrigger:C.z.function().args(C.z.object({feature:C.z.custom()})).returns(C.z.void()),layerIds:C.z.array(C.z.string()).optional(),geometryTypes:C.z.array(C.z.enum(["Polygon","Line","Point","Raster"])).optional()}),He={read:y.extend(Ne.shape).extend({id:C.z.string()}),create:c.params.extend(Ne.shape).extend({type:C.z.undefined()}),clonable:c.clonable.extend(Ne.shape).extend({type:C.z.undefined()}).extend({onTrigger:C.z.string()}),update:l(c.params.extend(Ne.shape).extend({type:C.z.undefined()}))};var Ra=require("zod");var pt=y.extend({type:Ra.z.literal("FlexibleSpace")}),ka=pt.partial({id:!0}),fe={params:ka,clonable:ka.extend(c.clonable.shape)},ct={params:l(fe.params),clonable:l(fe.clonable)};var E=require("zod");var se=require("zod");var z=require("zod");var Se=y.extend({type:z.z.literal("Button"),label:z.z.string(),variant:z.z.enum(["filled","transparent","outlined"]).optional(),tint:z.z.enum(["default","primary","accent","danger"]).optional(),disabled:z.z.boolean().optional(),onClick:z.z.function().args(z.z.object({id:z.z.string()})).returns(z.z.void())}),Ba=Se.extend(c.params.shape),Q={params:Ba,clonable:Ba.extend(c.clonable.shape).extend({onClick:z.z.string()})},dt={params:l(Q.params),clonable:l(Q.clonable)};var le=require("zod");var gt=I.extend({type:le.z.literal("ButtonRow"),align:le.z.enum(["start","end"]).optional(),items:le.z.array(Se)}),va=gt.extend(S.params.shape).omit({items:!0}).extend({items:le.z.array(Q.params)}),Mr=va.extend(S.clonable.shape).extend({items:le.z.array(Q.clonable)}),xe={params:va,clonable:Mr},ut={params:l(xe.params),clonable:l(xe.clonable)};var q=require("zod");var Aa=q.z.array(T.shape.value),yt=I.extend({type:q.z.literal("CheckboxGroup"),options:q.z.array(T),value:Aa,onChange:q.z.function().args(q.z.object({value:Aa,id:q.z.string()})).returns(q.z.void())}),Oa=yt.extend(S.params.shape),Ce={params:Oa,clonable:Oa.extend(S.clonable.shape).extend({onChange:q.z.string()})},ht={params:l(Ce.params),clonable:l(Ce.clonable)};var ja=require("zod");var ft=y.extend({type:ja.z.literal("Divider")}),wa=ft.partial({id:!0}),be={params:wa,clonable:wa.extend(c.clonable.shape)},St={params:l(be.params),clonable:l(be.clonable)};var F=require("zod");var Lr=F.z.lazy(()=>F.z.array(Ee.refine(a=>a.type!=="Grid"))),Pr=F.z.lazy(()=>F.z.array(k.params.refine(a=>a.type!=="Grid"))),Gr=F.z.lazy(()=>F.z.array(k.clonable.refine(a=>a.type!=="Grid"))),xt=y.extend({type:F.z.literal("Grid"),grid:F.z.string().optional(),verticalAlignment:F.z.enum(["top","center","bottom"]).optional(),horizontalDistribution:F.z.enum(["start","center","end","space-between","space-around","space-evenly"]).optional(),items:Lr}),Da=xt.extend(c.params.shape).omit({items:!0}).extend({items:Pr}),Tr=Da.extend(c.clonable.shape).extend({items:Gr}),Ie={params:Da,clonable:Tr},Ct={params:l(Ie.params),clonable:l(Ie.clonable)};var Ue=require("zod");var bt=y.extend({type:Ue.z.literal("Iframe"),height:Ue.z.number().or(Ue.z.string()).optional(),url:Ue.z.string()}),Va=bt.extend(c.params.shape),Me={params:Va,clonable:Va.extend(c.clonable.shape)},It={params:l(Me.params),clonable:l(Me.clonable)};var $=require("zod");var Na=T.shape.value.optional(),Et=I.extend({type:$.z.literal("RadioGroup"),options:$.z.array(T),value:Na,onChange:$.z.function().args($.z.object({value:Na,id:$.z.string()})).returns($.z.void())}),Ha=Et.extend(S.params.shape),Le={params:Ha,clonable:Ha.extend(S.clonable.shape).extend({onChange:$.z.string()})},Ut={params:l(Le.params),clonable:l(Le.clonable)};var M=require("zod");var Mt=I.extend({type:M.z.literal("Select"),options:M.z.array(T),value:M.z.string().optional(),placeholder:M.z.string().optional(),search:M.z.boolean().optional(),onChange:M.z.function().args(M.z.object({value:M.z.string(),id:M.z.string()})).returns(M.z.void())}),Za=Mt.extend(S.params.shape),Pe={params:Za,clonable:Za.extend(S.clonable.shape).extend({onChange:M.z.string()})},Lt={params:l(Pe.params),clonable:l(Pe.clonable)};var Pt=require("zod");var Gt=y.extend({type:Pt.z.literal("Text"),content:Pt.z.string()}),Ja=Gt.extend(c.params.shape),Ge={params:Ja,clonable:Ja.extend(c.clonable.shape)},Tt={params:l(Ge.params),clonable:l(Ge.clonable)};var d=require("zod");var zt=I.extend({type:d.z.literal("TextInput"),value:d.z.string(),placeholder:d.z.string().optional(),onChange:d.z.function().args(d.z.object({value:d.z.string(),id:d.z.string()})).returns(d.z.void()).optional(),onBlur:d.z.function().args(d.z.object({value:d.z.string(),id:d.z.string()})).returns(d.z.void()).optional(),onFocus:d.z.function().args(d.z.object({value:d.z.string(),id:d.z.string()})).returns(d.z.void()).optional()}),qa=zt.extend(S.params.shape),Te={params:qa,clonable:qa.extend(S.clonable.shape).extend({onChange:d.z.string().optional(),onBlur:d.z.string().optional(),onFocus:d.z.string().optional()})},Ft={params:l(Te.params),clonable:l(Te.clonable)};var j=require("zod");var Ka=j.z.array(T.shape.value),kt=I.extend({type:j.z.literal("ToggleGroup"),alignment:j.z.enum(["start","end"]).optional(),options:j.z.array(T),value:Ka,onChange:j.z.function().args(j.z.object({value:Ka,id:j.z.string()})).returns(j.z.void())}),Wa=kt.extend(S.params.shape),ze={params:Wa,clonable:Wa.extend(S.clonable.shape).extend({onChange:j.z.string()})},Rt={params:l(ze.params),clonable:l(ze.clonable)};var Ee=se.z.discriminatedUnion("type",[Se,Gt,ft,zt,Mt,pt,gt,yt,Et,kt,bt,xt]),zr=se.z.discriminatedUnion("type",[Q.params,Ge.params,be.params,Te.params,Pe.params,fe.params,xe.params,Ce.params,Le.params,ze.params,Me.params,Ie.params]),Fr=se.z.discriminatedUnion("type",[Q.clonable,Ge.clonable,be.clonable,Te.clonable,Pe.clonable,fe.clonable,xe.clonable,Ce.clonable,Le.clonable,ze.clonable,Me.clonable,Ie.clonable]),k={params:zr,clonable:Fr},Bt={params:se.z.discriminatedUnion("type",[dt.params,Tt.params,Ft.params,Lt.params,St.params,ct.params,ut.params,ht.params,Ut.params,Rt.params,It.params,Ct.params]),clonable:se.z.discriminatedUnion("type",[dt.clonable,Tt.clonable,Ft.clonable,Lt.clonable,St.clonable,ct.clonable,ut.clonable,ht.clonable,Ut.clonable,Rt.clonable,It.clonable,Ct.clonable])};var kr=y.extend({type:E.z.literal("Panel"),title:E.z.string().optional(),body:E.z.array(Ee).optional(),footer:E.z.array(Ee).optional(),onClickClose:E.z.function().args(E.z.object({id:E.z.string()})).returns(E.z.void()).optional()}),_a=kr.extend(c.params.shape).required({id:!0}).partial({type:!0}).omit({body:!0,footer:!0}).extend({body:E.z.array(k.params).optional(),footer:E.z.array(k.params).optional()}),vt={params:_a,clonable:_a.extend(c.clonable.shape).required({id:!0}).extend({onClickClose:E.z.string().optional(),body:E.z.array(k.clonable).optional(),footer:E.z.array(k.clonable).optional()})};var hs=o.z.object({actionTrigger:he.create,placement:J.optional()}),Qa=o.z.object({actionTrigger:he.clonable,placement:J.optional()}),fs=he.create.partial().required({id:!0}),$a=he.clonable.partial().required({id:!0}),Ss=o.z.object({action:He.create,placement:J.optional()}),Xa=o.z.object({action:He.clonable,placement:J.optional()}),Ya=He.clonable.partial().required({id:!0}),xs=o.z.object({panel:vt.params,placement:J.optional()}),eo=o.z.object({panel:vt.clonable,initialPlacement:J.optional()}),Cs=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:k.params,container:o.z.union([o.z.literal("body"),o.z.literal("footer"),o.z.object({id:o.z.string()})]).optional(),placement:J.optional()}))}),to=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:k.clonable,container:o.z.union([o.z.literal("body"),o.z.literal("footer"),o.z.object({id:o.z.string()})]).optional(),placement:J.optional()}))}),bs=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:Bt.params}))}),ao=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.object({element:Bt.clonable}))}),oo=o.z.object({panelId:o.z.string(),elements:o.z.array(o.z.string())}),no=o.z.object({showLegend:o.z.boolean().optional(),cooperativeGestures:o.z.boolean().optional(),fullScreenButton:o.z.boolean().optional(),geolocation:o.z.boolean().optional(),zoomControls:o.z.boolean().optional(),scaleBar:o.z.boolean().optional(),rotation:o.z.boolean().optional(),contextMenu:o.z.boolean().optional()}),ro=o.z.object({featureSelectPanel:o.z.boolean().optional(),featureHoverPanel:o.z.boolean().optional(),elementSelectPanel:o.z.boolean().optional(),linkClickOpen:o.z.boolean().optional(),imageLightboxOpen:o.z.boolean().optional()});var Rr=e("createActionTrigger",Qa),Br=e("updateActionTrigger",$a),vr=e("deleteActionTrigger",X.z.string()),Ar=e("createFeatureAction",Xa),Or=e("updateFeatureAction",Ya),wr=e("deleteFeatureAction",X.z.string()),jr=e("createPanelId",X.z.void()),Dr=e("createOrUpdatePanel",eo),Vr=e("deletePanel",X.z.string()),Nr=e("createPanelElements",to),Hr=e("updatePanelElements",ao),Zr=e("deletePanelElements",oo),Jr=e("updateUiControls",no),qr=e("setOnMapInteractionsUi",ro),Kr=e("showLayerDataTable",X.z.object({layerId:X.z.string(),sorting:Oe.optional()}).optional()),Wr=e("hideLayerDataTable",X.z.undefined()),io={methods:[Rr,Br,vr,Ar,Or,wr,jr,Dr,Vr,Nr,Hr,Zr,Jr,qr,Kr,Wr],listeners:null};var At=require("zod");var Fe=require("zod");var Ze=Fe.z.object({center:ve,zoom:Nt}),lo=Fe.z.object({center:Ze.shape.center.optional(),zoom:Ze.shape.zoom.optional()}),so=Fe.z.object({minZoom:Ze.shape.zoom.nullish(),maxZoom:Ze.shape.zoom.nullish(),bounds:N.nullish()}).nullable(),mo=Fe.z.object({bounds:N});var _r=e("getViewport",At.z.undefined()),Qr=e("setViewport",lo),$r=e("getViewportConstraints",At.z.undefined()),Xr=e("setViewportConstraints",so),Yr=e("fitViewportToBounds",mo),ei=x("onViewportMove"),ti=x("onViewportMoveEnd"),ai=x("onMapIdle"),po={methods:[Qr,_r,$r,Xr,Yr],listeners:[ei,ti,ai]};var Ot=[io,po,xa,Wt,Ea,_t,za,ba,Vt];function oi(a,g,Y){let ae=new Map;async function K(R){if(!si.safeParse(R.data).success){Y?.onUnknownMessage?.(R.data);return}let ke=uo.safeParse(R.data);if(!ke.success){Y?.onInvalidMessage?.(R.data,ke.error),R.ports[0]?.postMessage(co(ke.error.message));return}let{data:U}=ke;if(U.type==="felt.ready")R.ports[0]?.postMessage(!0);else if(U.type==="felt.addListener"){if(U.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let me="options"in U.event?{options:"options"in U.event?U.event.options:void 0,handler:qe=>{R.ports[0]?.postMessage(qe)}}:{handler:qe=>{R.ports[0]?.postMessage(qe)}},Je=g.listeners[U.event.eventName](me);ae.set(U.event.id,Je)}else if(U.type==="felt.removeListener")ae.get(U.id)?.(),ae.delete(U.id);else try{let me=g.methods[U.type],Je=await me(U.params);R.ports[0]?.postMessage(Je)}catch(me){R.ports[0]?.postMessage(co(me))}}return a.addEventListener("message",K),()=>{a.removeEventListener("message",K)}}var go={methods:Ot.map(a=>a.methods??[]).flat(),listeners:Ot.map(a=>a.listeners??[]).flat()},ni=h.z.discriminatedUnion("eventName",[h.z.strictObject({eventName:h.z.literal("")}),h.z.strictObject({eventName:h.z.literal("onGenericEvent"),id:h.z.string(),options:h.z.object({id:h.z.string()})}),...go.listeners]),ri=h.z.strictObject({type:h.z.literal("felt.addListener"),event:ni}),ii=h.z.strictObject({type:h.z.literal("felt.removeListener"),id:h.z.string()}),li=h.z.strictObject({type:h.z.literal("felt.ready")}),uo=h.z.discriminatedUnion("type",[li,ri,ii,...go.methods]),si=h.z.object({type:h.z.enum(uo.options.map(a=>a.shape.type.value))});function co(a){return{__error__:mi(a)}}function mi(a){return a instanceof Error?a.message:typeof a=="object"&&a!==null&&"message"in a?String(a.message):typeof a=="string"?a:"Unknown error"}0&&(module.exports={createMessageHandler});