@feltmaps/js-sdk 1.5.0-next.21 → 1.5.0-next.22

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/handler.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z, ZodError } from 'zod';
2
- import { O as zInfer, E as Element, G as GeoJsonGeometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, j as LayerGroup, n as LegendItem, q as LayerFilters, s as LayerFeature, t as GeoJsonFeature, v as GetLayerCategoriesGroup, x as GetLayerHistogramBin, A as AggregationMethod, z as LayerSchema, i as LayerChangeCallbackParams, l as LayerGroupChangeCallbackParams, p as LegendItemChangeCallbackParams, aI as FilterTernary, B as MapDetails, D as EntityNode, T as ToolType, K as ToolSettingsMap, N as ToolSettingsChangeEvent, V as ViewportState, R as ViewportConstraints, bd as UnionToIntersection, be as PromiseOrNot } from './types-f_Zc32jS.js';
2
+ import { O as zInfer, E as Element, G as GeoJsonGeometry, b as ElementGroup, d as ElementChangeCallbackParams, e as ElementGroupChangeCallbackParams, M as MapInteractionEvent, L as Layer, j as LayerGroup, n as LegendItem, q as LayerFilters, s as LayerFeature, t as GeoJsonFeature, v as GetLayerCategoriesGroup, x as GetLayerHistogramBin, A as AggregationMethod, z as LayerSchema, i as LayerChangeCallbackParams, l as LayerGroupChangeCallbackParams, p as LegendItemChangeCallbackParams, aJ as FilterTernary, B as MapDetails, D as EntityNode, T as ToolType, K as ToolSettingsMap, N as ToolSettingsChangeEvent, V as ViewportState, R as ViewportConstraints, be as UnionToIntersection, bf as PromiseOrNot } from './types-CnYUajGG.js';
3
3
 
4
4
  type Method<TRequest extends {
5
5
  type: string;
@@ -1960,25 +1960,24 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
1960
1960
  source: z.ZodUnion<[z.ZodObject<{
1961
1961
  type: z.ZodLiteral<"geoJsonUrl">;
1962
1962
  url: z.ZodString;
1963
+ refreshInterval: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1963
1964
  }, "strip", z.ZodTypeAny, {
1964
1965
  type: "geoJsonUrl";
1965
1966
  url: string;
1967
+ refreshInterval?: number | null | undefined;
1966
1968
  }, {
1967
1969
  type: "geoJsonUrl";
1968
1970
  url: string;
1971
+ refreshInterval?: number | null | undefined;
1969
1972
  }>, z.ZodObject<{
1970
1973
  type: z.ZodLiteral<"geoJsonData">;
1971
- data: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
1974
+ data: z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>]>;
1972
1975
  }, "strip", z.ZodTypeAny, {
1973
1976
  type: "geoJsonData";
1974
- data: {} & {
1975
- [k: string]: unknown;
1976
- };
1977
+ data: ArrayBuffer | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
1977
1978
  }, {
1978
1979
  type: "geoJsonData";
1979
- data: {} & {
1980
- [k: string]: unknown;
1981
- };
1980
+ data: ArrayBuffer | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
1982
1981
  }>, z.ZodObject<{
1983
1982
  type: z.ZodLiteral<"geoJsonFile">;
1984
1983
  file: z.ZodType<File, z.ZodTypeDef, File>;
@@ -1990,6 +1989,9 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
1990
1989
  file: File;
1991
1990
  }>]>;
1992
1991
  name: z.ZodString;
1992
+ bounds: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
1993
+ caption: z.ZodOptional<z.ZodString>;
1994
+ description: z.ZodOptional<z.ZodString>;
1993
1995
  geometryStyles: z.ZodOptional<z.ZodObject<{
1994
1996
  Point: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
1995
1997
  Line: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
@@ -2008,15 +2010,17 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2008
2010
  source: {
2009
2011
  type: "geoJsonUrl";
2010
2012
  url: string;
2011
- } | {
2012
- type: "geoJsonData";
2013
- data: {} & {
2014
- [k: string]: unknown;
2015
- };
2013
+ refreshInterval?: number | null | undefined;
2016
2014
  } | {
2017
2015
  type: "geoJsonFile";
2018
2016
  file: File;
2017
+ } | {
2018
+ type: "geoJsonData";
2019
+ data: ArrayBuffer | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
2019
2020
  };
2021
+ description?: string | undefined;
2022
+ bounds?: [number, number, number, number] | undefined;
2023
+ caption?: string | undefined;
2020
2024
  geometryStyles?: {
2021
2025
  Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2022
2026
  Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -2027,15 +2031,17 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2027
2031
  source: {
2028
2032
  type: "geoJsonUrl";
2029
2033
  url: string;
2030
- } | {
2031
- type: "geoJsonData";
2032
- data: {} & {
2033
- [k: string]: unknown;
2034
- };
2034
+ refreshInterval?: number | null | undefined;
2035
2035
  } | {
2036
2036
  type: "geoJsonFile";
2037
2037
  file: File;
2038
+ } | {
2039
+ type: "geoJsonData";
2040
+ data: ArrayBuffer | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
2038
2041
  };
2042
+ description?: string | undefined;
2043
+ bounds?: [number, number, number, number] | undefined;
2044
+ caption?: string | undefined;
2039
2045
  geometryStyles?: {
2040
2046
  Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2041
2047
  Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -2048,15 +2054,17 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2048
2054
  source: {
2049
2055
  type: "geoJsonUrl";
2050
2056
  url: string;
2051
- } | {
2052
- type: "geoJsonData";
2053
- data: {} & {
2054
- [k: string]: unknown;
2055
- };
2057
+ refreshInterval?: number | null | undefined;
2056
2058
  } | {
2057
2059
  type: "geoJsonFile";
2058
2060
  file: File;
2061
+ } | {
2062
+ type: "geoJsonData";
2063
+ data: ArrayBuffer | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
2059
2064
  };
2065
+ description?: string | undefined;
2066
+ bounds?: [number, number, number, number] | undefined;
2067
+ caption?: string | undefined;
2060
2068
  geometryStyles?: {
2061
2069
  Point?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2062
2070
  Polygon?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -2070,15 +2078,17 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2070
2078
  source: {
2071
2079
  type: "geoJsonUrl";
2072
2080
  url: string;
2073
- } | {
2074
- type: "geoJsonData";
2075
- data: {} & {
2076
- [k: string]: unknown;
2077
- };
2081
+ refreshInterval?: number | null | undefined;
2078
2082
  } | {
2079
2083
  type: "geoJsonFile";
2080
2084
  file: File;
2085
+ } | {
2086
+ type: "geoJsonData";
2087
+ data: ArrayBuffer | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
2081
2088
  };
2089
+ description?: string | undefined;
2090
+ bounds?: [number, number, number, number] | undefined;
2091
+ caption?: string | undefined;
2082
2092
  geometryStyles?: {
2083
2093
  Point?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2084
2094
  Polygon?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -2087,6 +2097,131 @@ declare const CreateLayersFromGeoJsonMessage: z.ZodObject<{
2087
2097
  };
2088
2098
  type: "createLayersFromGeoJson";
2089
2099
  }>;
2100
+ declare const UpdateLayerMessage: z.ZodObject<{
2101
+ type: z.ZodLiteral<"updateLayer">;
2102
+ params: z.ZodObject<{
2103
+ id: z.ZodString;
2104
+ style: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
2105
+ shownInLegend: z.ZodOptional<z.ZodBoolean>;
2106
+ name: z.ZodOptional<z.ZodString>;
2107
+ caption: z.ZodOptional<z.ZodString>;
2108
+ description: z.ZodOptional<z.ZodString>;
2109
+ bounds: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
2110
+ source: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
2111
+ type: z.ZodLiteral<"geoJsonUrl">;
2112
+ url: z.ZodString;
2113
+ refreshInterval: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2114
+ }, "strip", z.ZodTypeAny, {
2115
+ type: "geoJsonUrl";
2116
+ url: string;
2117
+ refreshInterval?: number | null | undefined;
2118
+ }, {
2119
+ type: "geoJsonUrl";
2120
+ url: string;
2121
+ refreshInterval?: number | null | undefined;
2122
+ }>, z.ZodObject<{
2123
+ type: z.ZodLiteral<"geoJsonData">;
2124
+ data: z.ZodUnion<[z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, z.ZodType<ArrayBuffer, z.ZodTypeDef, ArrayBuffer>]>;
2125
+ }, "strip", z.ZodTypeAny, {
2126
+ type: "geoJsonData";
2127
+ data: ArrayBuffer | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
2128
+ }, {
2129
+ type: "geoJsonData";
2130
+ data: ArrayBuffer | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
2131
+ }>, z.ZodObject<{
2132
+ type: z.ZodLiteral<"geoJsonFile">;
2133
+ file: z.ZodType<File, z.ZodTypeDef, File>;
2134
+ }, "strip", z.ZodTypeAny, {
2135
+ type: "geoJsonFile";
2136
+ file: File;
2137
+ }, {
2138
+ type: "geoJsonFile";
2139
+ file: File;
2140
+ }>]>>;
2141
+ }, "strip", z.ZodTypeAny, {
2142
+ id: string;
2143
+ name?: string | undefined;
2144
+ description?: string | undefined;
2145
+ style?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2146
+ source?: {
2147
+ type: "geoJsonUrl";
2148
+ url: string;
2149
+ refreshInterval?: number | null | undefined;
2150
+ } | {
2151
+ type: "geoJsonFile";
2152
+ file: File;
2153
+ } | {
2154
+ type: "geoJsonData";
2155
+ data: ArrayBuffer | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
2156
+ } | undefined;
2157
+ bounds?: [number, number, number, number] | undefined;
2158
+ caption?: string | undefined;
2159
+ shownInLegend?: boolean | undefined;
2160
+ }, {
2161
+ id: string;
2162
+ name?: string | undefined;
2163
+ description?: string | undefined;
2164
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2165
+ source?: {
2166
+ type: "geoJsonUrl";
2167
+ url: string;
2168
+ refreshInterval?: number | null | undefined;
2169
+ } | {
2170
+ type: "geoJsonFile";
2171
+ file: File;
2172
+ } | {
2173
+ type: "geoJsonData";
2174
+ data: ArrayBuffer | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
2175
+ } | undefined;
2176
+ bounds?: [number, number, number, number] | undefined;
2177
+ caption?: string | undefined;
2178
+ shownInLegend?: boolean | undefined;
2179
+ }>;
2180
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
2181
+ params: {
2182
+ id: string;
2183
+ name?: string | undefined;
2184
+ description?: string | undefined;
2185
+ style?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2186
+ source?: {
2187
+ type: "geoJsonUrl";
2188
+ url: string;
2189
+ refreshInterval?: number | null | undefined;
2190
+ } | {
2191
+ type: "geoJsonFile";
2192
+ file: File;
2193
+ } | {
2194
+ type: "geoJsonData";
2195
+ data: ArrayBuffer | z.objectOutputType<{}, z.ZodTypeAny, "passthrough">;
2196
+ } | undefined;
2197
+ bounds?: [number, number, number, number] | undefined;
2198
+ caption?: string | undefined;
2199
+ shownInLegend?: boolean | undefined;
2200
+ };
2201
+ type: "updateLayer";
2202
+ }, {
2203
+ params: {
2204
+ id: string;
2205
+ name?: string | undefined;
2206
+ description?: string | undefined;
2207
+ style?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
2208
+ source?: {
2209
+ type: "geoJsonUrl";
2210
+ url: string;
2211
+ refreshInterval?: number | null | undefined;
2212
+ } | {
2213
+ type: "geoJsonFile";
2214
+ file: File;
2215
+ } | {
2216
+ type: "geoJsonData";
2217
+ data: ArrayBuffer | z.objectInputType<{}, z.ZodTypeAny, "passthrough">;
2218
+ } | undefined;
2219
+ bounds?: [number, number, number, number] | undefined;
2220
+ caption?: string | undefined;
2221
+ shownInLegend?: boolean | undefined;
2222
+ };
2223
+ type: "updateLayer";
2224
+ }>;
2090
2225
  declare const DeleteLayerMessage: z.ZodObject<{
2091
2226
  type: z.ZodLiteral<"deleteLayer">;
2092
2227
  params: z.ZodString;
@@ -3112,6 +3247,7 @@ type LayersSchema = {
3112
3247
  layerGroup: LayerGroup;
3113
3248
  layers: Array<Layer>;
3114
3249
  } | null>;
3250
+ updateLayer: Method<zInfer<typeof UpdateLayerMessage>, Layer>;
3115
3251
  deleteLayer: Method<zInfer<typeof DeleteLayerMessage>, void>;
3116
3252
  getLayerGroup: Method<zInfer<typeof GetGroupMessage>, LayerGroup | null>;
3117
3253
  getLayerGroups: Method<zInfer<typeof GetGroupsMessage>, Array<LayerGroup | null>>;
package/handler.js CHANGED
@@ -1 +1 @@
1
- "use strict";var te=Object.defineProperty;var nt=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var it=Object.prototype.hasOwnProperty;var st=(o,l)=>{for(var G in l)te(o,G,{get:l[G],enumerable:!0})},lt=(o,l,G,z)=>{if(l&&typeof l=="object"||typeof l=="function")for(let M of at(l))!it.call(o,M)&&M!==G&&te(o,M,{get:()=>l[M],enumerable:!(z=nt(l,M))||z.enumerable});return o};var pt=o=>lt(te({},"__esModule",{value:!0}),o);var cr={};st(cr,{createMessageHandler:()=>nr});module.exports=pt(cr);var y=require("zod");var d=require("zod");var f=require("zod");function t(o,l){return f.z.strictObject({type:f.z.literal(o),params:l})}function S(o,l){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string(),options:l})}function p(o){return f.z.strictObject({eventName:f.z.literal(o),id:f.z.string()})}var i=require("zod"),H=i.z.number(),J=i.z.number(),B=i.z.object({latitude:J,longitude:H}),C=i.z.tuple([H,J]),V=i.z.object({type:i.z.literal("Polygon"),coordinates:i.z.array(i.z.array(C).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"))}),Z=i.z.object({type:i.z.literal("MultiPolygon"),coordinates:i.z.array(V.shape.coordinates)}),mt=i.z.object({type:i.z.literal("LineString"),coordinates:i.z.array(C).min(2)}),v=i.z.object({type:i.z.literal("MultiLineString"),coordinates:i.z.array(mt.shape.coordinates)}),he=i.z.number().min(1).max(23),I=i.z.tuple([H,J,H,J]),T=i.z.object({show:i.z.array(i.z.string()).optional(),hide:i.z.array(i.z.string()).optional()}),ct=i.z.enum(["asc","desc"]),fe=i.z.object({attribute:i.z.string(),direction:ct});var e=require("zod");var h=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),_=e.z.object({imageUrl:e.z.string().nullable()}),ne=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),yt=e.z.enum(["meter","kilometer","foot","mile"]),q=h.extend(_.shape).extend({type:e.z.literal("Place"),coordinates:C,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),w=h.extend(_.shape).extend(ne.shape).extend({type:e.z.literal("Path"),coordinates:v.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),O=h.extend(_.shape).extend(ne.shape).extend({type:e.z.literal("Polygon"),coordinates:V.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),W=h.extend(_.shape).extend(ne.shape).extend({type:e.z.literal("Circle"),center:C,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:yt.nullable(),fillOpacity:e.z.number().min(0).max(1)}),U=h.extend({type:e.z.literal("Marker"),coordinates:v.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),R=h.extend({type:e.z.literal("Highlighter"),coordinates:Z.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),Se=e.z.object({position:C,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),oe=h.extend(Se.shape).extend({type:e.z.literal("Text")}),re=h.extend(Se.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),j=h.extend({type:e.z.literal("Image"),coordinates:v.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),gt=h.extend({type:e.z.literal("Link"),coordinates:v.shape.coordinates,url:e.z.string()}),P={type:!0,coordinates:!0},x={id:!0},ae=q.partial().extend(q.pick(P).shape).omit(x),Q=w.partial().extend(w.pick(P).shape).omit(x),ie=O.partial().extend(O.pick(P).shape).omit(x),se=W.partial().extend(W.pick({type:!0,center:!0,radius:!0}).shape).omit(x),le=U.partial().extend(U.pick(P).shape).omit(x),pe=R.partial().extend(R.pick(P).shape).omit(x),me=oe.partial().omit({...x,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ce=re.partial().omit({...x,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),dt=j.partial().extend(j.pick({...P,imageUrl:!0}).shape).omit(x),xe=e.z.discriminatedUnion("type",[ae,Q,ie,se,le,pe,dt,me,ce]);var fr=w.omit({coordinates:!0}),Sr=O.omit({coordinates:!0});var xr=U.omit({coordinates:!0}),Lr=R.omit({coordinates:!0});var br=j.omit({coordinates:!0}),Mr=gt.omit({coordinates:!0}),L={type:!0,id:!0},ut=q.partial().extend(q.pick(L).shape),ht=w.partial().extend(w.pick(L).shape),ft=O.partial().extend(O.pick(L).shape),St=W.partial().extend(W.pick(L).shape),xt=U.partial().extend(U.pick(L).shape),Lt=R.partial().extend(R.pick(L).shape),bt=oe.partial().extend(oe.pick(L).shape).omit({name:!0}),Mt=re.partial().extend(re.pick(L).shape).omit({name:!0}),Ct=j.partial().extend(j.pick(L).shape),Le=e.z.discriminatedUnion("type",[ut,ht,ft,St,xt,Lt,bt,Mt,Ct]),be=e.z.object({ids:e.z.array(e.z.string()).optional()}),Me=e.z.object({ids:e.z.array(e.z.string()).optional()});var Gt=t("getElement",d.z.string()),It=t("getElementGeometry",d.z.string()),Tt=t("getElements",be.optional()),Et=t("getElementGroup",d.z.string()),zt=t("getElementGroups",Me.optional()),Pt=t("setElementGroupVisibility",T),Ft=S("onElementChange",d.z.object({id:d.z.string()})),kt=p("onElementCreate"),Vt=p("onElementCreateEnd"),vt=S("onElementDelete",d.z.object({id:d.z.string()})),wt=S("onElementGroupChange",d.z.object({id:d.z.string()})),Ot=t("createElement",xe),Ut=t("updateElement",Le),Rt=t("deleteElement",d.z.string()),Ce={methods:[Gt,It,Tt,Et,zt,Pt,Ot,Ut,Rt],listeners:[Ft,kt,Vt,vt,wt]};var jt=p("onPointerClick"),Nt=p("onPointerMove"),Ge={methods:null,listeners:[jt,Nt]};var s=require("zod");var a=require("zod"),At=a.z.enum(["in","ni"]),Dt=a.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Fr=a.z.enum(["and","or"]),Ie=a.z.union([a.z.number(),a.z.string(),a.z.boolean(),a.z.null()]),Te=a.z.string().or(a.z.null()),Ht=a.z.tuple([Te,At,a.z.array(Ie).or(a.z.null())]),Jt=a.z.tuple([Te,Dt,Ie]),ye=a.z.union([Ht,Jt]),ge=a.z.tuple([a.z.lazy(()=>a.z.union([ge,ye,a.z.null(),a.z.boolean()])),a.z.enum(["and","or"]),a.z.lazy(()=>a.z.union([ge,ye,a.z.null(),a.z.boolean()]))]),E=a.z.union([ge,ye,a.z.null(),a.z.boolean()]);var r=require("zod");var Ee=r.z.enum(["avg","max","min","sum","median"]),Bt=r.z.object({method:Ee,attribute:r.z.string()}),Zt=r.z.object({methods:r.z.array(r.z.union([Ee,r.z.literal("count")])),attribute:r.z.string().optional()}),$=r.z.union([I,V,Z,r.z.array(C)]),ze=r.z.object({boundary:$.optional(),filters:E.optional(),aggregation:Bt.optional()}),Pe=r.z.object({layerId:r.z.string(),attribute:r.z.string(),limit:r.z.number().optional(),boundary:$.optional(),filters:E.optional(),values:ze.optional()}),wr=r.z.object({key:r.z.union([r.z.number(),r.z.string(),r.z.boolean()]),value:r.z.number().nullable()}),qt=r.z.object({type:r.z.literal("equal-intervals"),count:r.z.number()}),Wt=r.z.object({type:r.z.literal("time-interval"),interval:r.z.enum(["hour","day","week","month","year"])}),Fe=r.z.object({layerId:r.z.string(),attribute:r.z.string(),steps:r.z.union([qt,Wt,r.z.array(r.z.number())]),boundary:$.optional(),filters:E.optional(),values:ze.optional()}),Or=r.z.object({min:r.z.number(),max:r.z.number(),value:r.z.number()}),ke=r.z.object({layerId:r.z.string(),boundary:$.optional(),filters:E.optional(),aggregation:Zt});var n=require("zod");var jr=n.z.enum(["processing","completed","failed","incomplete"]),_t=n.z.object({type:n.z.literal("geoJsonUrl"),url:n.z.string().url()}),Qt=n.z.object({type:n.z.literal("geoJsonData"),data:n.z.object({}).passthrough()}),$t=n.z.object({type:n.z.literal("geoJsonFile"),file:n.z.instanceof(File)}),Ve=n.z.object({ids:n.z.array(n.z.string()).optional()}),ve=n.z.object({ids:n.z.array(n.z.string()).optional()}),F=n.z.object({id:n.z.string(),layerId:n.z.string()}),we=n.z.object({ids:F.array().optional(),layerIds:n.z.string().array().optional()}),Oe=n.z.object({layerIds:n.z.array(n.z.string()).optional(),areaQuery:n.z.union([n.z.object({coordinates:B}),n.z.object({boundary:I})]).optional()}),Kt=n.z.object({Point:n.z.object({}).passthrough().optional(),Line:n.z.object({}).passthrough().optional(),Polygon:n.z.object({}).passthrough().optional()}),Ue=n.z.object({source:n.z.union([_t,Qt,$t]),name:n.z.string(),geometryStyles:Kt.optional()});var Xt=t("getLayer",s.z.string()),Yt=t("getLayers",Ve.optional()),eo=t("setLayerVisibility",T),to=S("onLayerChange",s.z.object({id:s.z.string()})),oo=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),ro=t("setLayerLegendVisibility",T),no=t("createLayersFromGeoJson",Ue),ao=t("deleteLayer",s.z.string()),io=t("getLayerGroup",s.z.string()),so=t("getLayerGroups",ve.optional()),lo=t("setLayerGroupVisibility",T),po=t("setLayerGroupLegendVisibility",T),mo=S("onLayerGroupChange",s.z.object({id:s.z.string()})),co=t("getLegendItem",F),yo=t("getLegendItems",we.optional()),go=S("onLegendItemChange",F),uo=t("setLegendItemVisibility",s.z.object({show:F.array().optional(),hide:F.array().optional()})),ho=t("getLayerFilters",s.z.string()),fo=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:E,note:s.z.string().optional()})),So=S("onLayerFiltersChange",s.z.object({layerId:s.z.string()})),xo=t("getRenderedFeatures",Oe.optional()),Lo=t("getFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),bo=t("getGeoJsonFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Mo=t("getCategoryData",Pe),Co=t("getHistogramData",Fe),Go=t("getAggregates",ke),Io=t("getLayerSchema",s.z.string()),Re={methods:[Xt,Yt,eo,oo,ro,no,ao,io,so,lo,po,co,yo,uo,ho,fo,xo,Lo,bo,Mo,Co,Go,Io],listeners:[to,mo,go,So]};var je=require("zod");var To=t("getMapDetails",je.z.undefined()),Ne={methods:[To],listeners:[]};var N=require("zod");var b=require("zod"),Ae=b.z.object({id:b.z.string().or(b.z.number()),layerId:b.z.string(),showPopup:b.z.boolean().optional(),fitViewport:b.z.boolean().or(b.z.object({maxZoom:b.z.number()})).optional()});var Eo=t("getSelection",N.z.undefined()),zo=p("onSelectionChange"),Po=t("selectFeature",Ae),Fo=t("clearSelection",N.z.object({features:N.z.boolean().optional(),elements:N.z.boolean().optional()}).optional()),De={methods:[Eo,Po,Fo],listeners:[zo]};var qe=require("zod");var m=require("zod");var He=["pin","line","route","polygon","circle","marker","highlighter","text","note"],Je=m.z.enum([...He,"link"]),Be=m.z.enum(He),ko=ae.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),Vo=Q.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),vo=Q.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),wo=ie.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Oo=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),Uo=le.pick({color:!0,opacity:!0,size:!0}).required(),Ro=pe.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),jo=me.pick({color:!0,align:!0,style:!0}).required(),No=ce.pick({color:!0,align:!0,style:!0}).required(),Ze=m.z.discriminatedUnion("tool",[ko.partial().extend({tool:m.z.literal("pin")}),Vo.partial().extend({tool:m.z.literal("line")}),vo.partial().extend({tool:m.z.literal("route")}),wo.partial().extend({tool:m.z.literal("polygon")}),Oo.partial().extend({tool:m.z.literal("circle")}),Uo.partial().extend({tool:m.z.literal("marker")}),Ro.partial().extend({tool:m.z.literal("highlighter")}),jo.partial().extend({tool:m.z.literal("text")}),No.partial().extend({tool:m.z.literal("note")})]);var Ao=t("setTool",Je.nullable()),Do=t("getTool",qe.z.undefined()),Ho=p("onToolChange"),Jo=t("setToolSettings",Ze),Bo=t("getToolSettings",Be),Zo=p("onToolSettingsChange"),We={methods:[Ao,Do,Jo,Bo],listeners:[Ho,Zo]};var K=require("zod");var c=require("zod"),_e=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),Qe=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var qo=t("updateUiControls",_e),Wo=t("setOnMapInteractionsUi",Qe),_o=t("showLayerDataTable",K.z.object({layerId:K.z.string(),sorting:fe.optional()}).optional()),Qo=t("hideLayerDataTable",K.z.undefined()),$e={methods:[qo,Wo,_o,Qo],listeners:null};var de=require("zod");var A=require("zod");var X=A.z.object({center:B,zoom:he}),Ke=A.z.object({center:X.shape.center.optional(),zoom:X.shape.zoom.optional()}),Xe=A.z.object({minZoom:X.shape.zoom.nullish(),maxZoom:X.shape.zoom.nullish(),bounds:I.nullish()}).nullable(),Ye=A.z.object({bounds:I});var $o=t("getViewport",de.z.undefined()),Ko=t("setViewport",Ke),Xo=t("getViewportConstraints",de.z.undefined()),Yo=t("setViewportConstraints",Xe),er=t("fitViewportToBounds",Ye),tr=p("onViewportMove"),or=p("onViewportMoveEnd"),rr=p("onMapIdle"),et={methods:[Ko,$o,Xo,Yo,er],listeners:[tr,or,rr]};var ue=[$e,et,Re,Ce,De,Ge,We,Ne];function nr(o,l,G){let z=new Map;async function M(u){if(!pr.safeParse(u.data).success){G?.onUnknownMessage?.(u.data);return}let D=rt.safeParse(u.data);if(!D.success){G?.onInvalidMessage?.(u.data,D.error),u.ports[0]?.postMessage(tt(D.error.message));return}let{data:g}=D;if(g.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(g.type==="felt.addListener"){if(g.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let k="options"in g.event?{options:"options"in g.event?g.event.options:void 0,handler:ee=>{u.ports[0]?.postMessage(ee)}}:{handler:ee=>{u.ports[0]?.postMessage(ee)}},Y=l.listeners[g.event.eventName](k);z.set(g.event.id,Y)}else if(g.type==="felt.removeListener")z.get(g.id)?.(),z.delete(g.id);else try{let k=l.methods[g.type],Y=await k(g.params);u.ports[0]?.postMessage(Y)}catch(k){u.ports[0]?.postMessage(tt(k))}}return o.addEventListener("message",M),()=>{o.removeEventListener("message",M)}}var ot={methods:ue.map(o=>o.methods??[]).flat(),listeners:ue.map(o=>o.listeners??[]).flat()},ar=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...ot.listeners]),ir=y.z.strictObject({type:y.z.literal("felt.addListener"),event:ar}),sr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),lr=y.z.strictObject({type:y.z.literal("felt.ready")}),rt=y.z.discriminatedUnion("type",[lr,ir,sr,...ot.methods]),pr=y.z.object({type:y.z.enum(rt.options.map(o=>o.shape.type.value))});function tt(o){return{__error__:mr(o)}}function mr(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 te=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var ct=(r,l)=>{for(var I in l)te(r,I,{get:l[I],enumerable:!0})},yt=(r,l,I,z)=>{if(l&&typeof l=="object"||typeof l=="function")for(let C of pt(l))!mt.call(r,C)&&C!==I&&te(r,C,{get:()=>l[C],enumerable:!(z=lt(l,C))||z.enumerable});return r};var gt=r=>yt(te({},"__esModule",{value:!0}),r);var gr={};ct(gr,{createMessageHandler:()=>ir});module.exports=gt(gr);var y=require("zod");var d=require("zod");var f=require("zod");function t(r,l){return f.z.strictObject({type:f.z.literal(r),params:l})}function S(r,l){return f.z.strictObject({eventName:f.z.literal(r),id:f.z.string(),options:l})}function p(r){return f.z.strictObject({eventName:f.z.literal(r),id:f.z.string()})}var i=require("zod"),H=i.z.number(),J=i.z.number(),B=i.z.object({latitude:J,longitude:H}),G=i.z.tuple([H,J]),V=i.z.object({type:i.z.literal("Polygon"),coordinates:i.z.array(i.z.array(G).min(4).refine(r=>r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1],"The last point of each ring must be identical to the first"))}),Z=i.z.object({type:i.z.literal("MultiPolygon"),coordinates:i.z.array(V.shape.coordinates)}),dt=i.z.object({type:i.z.literal("LineString"),coordinates:i.z.array(G).min(2)}),v=i.z.object({type:i.z.literal("MultiLineString"),coordinates:i.z.array(dt.shape.coordinates)}),he=i.z.number().min(1).max(23),x=i.z.tuple([H,J,H,J]),T=i.z.object({show:i.z.array(i.z.string()).optional(),hide:i.z.array(i.z.string()).optional()}),ut=i.z.enum(["asc","desc"]),fe=i.z.object({attribute:i.z.string(),direction:ut});var e=require("zod");var h=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),_=e.z.object({imageUrl:e.z.string().nullable()}),ne=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),ht=e.z.enum(["meter","kilometer","foot","mile"]),q=h.extend(_.shape).extend({type:e.z.literal("Place"),coordinates:G,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),w=h.extend(_.shape).extend(ne.shape).extend({type:e.z.literal("Path"),coordinates:v.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),U=h.extend(_.shape).extend(ne.shape).extend({type:e.z.literal("Polygon"),coordinates:V.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),W=h.extend(_.shape).extend(ne.shape).extend({type:e.z.literal("Circle"),center:G,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:ht.nullable(),fillOpacity:e.z.number().min(0).max(1)}),O=h.extend({type:e.z.literal("Marker"),coordinates:v.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),j=h.extend({type:e.z.literal("Highlighter"),coordinates:Z.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),Se=e.z.object({position:G,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),oe=h.extend(Se.shape).extend({type:e.z.literal("Text")}),re=h.extend(Se.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),R=h.extend({type:e.z.literal("Image"),coordinates:v.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),ft=h.extend({type:e.z.literal("Link"),coordinates:v.shape.coordinates,url:e.z.string()}),P={type:!0,coordinates:!0},L={id:!0},ae=q.partial().extend(q.pick(P).shape).omit(L),Q=w.partial().extend(w.pick(P).shape).omit(L),ie=U.partial().extend(U.pick(P).shape).omit(L),se=W.partial().extend(W.pick({type:!0,center:!0,radius:!0}).shape).omit(L),le=O.partial().extend(O.pick(P).shape).omit(L),pe=j.partial().extend(j.pick(P).shape).omit(L),me=oe.partial().omit({...L,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ce=re.partial().omit({...L,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),St=R.partial().extend(R.pick({...P,imageUrl:!0}).shape).omit(L),xe=e.z.discriminatedUnion("type",[ae,Q,ie,se,le,pe,St,me,ce]);var xr=w.omit({coordinates:!0}),Lr=U.omit({coordinates:!0});var br=O.omit({coordinates:!0}),Mr=j.omit({coordinates:!0});var Cr=R.omit({coordinates:!0}),Gr=ft.omit({coordinates:!0}),b={type:!0,id:!0},xt=q.partial().extend(q.pick(b).shape),Lt=w.partial().extend(w.pick(b).shape),bt=U.partial().extend(U.pick(b).shape),Mt=W.partial().extend(W.pick(b).shape),Ct=O.partial().extend(O.pick(b).shape),Gt=j.partial().extend(j.pick(b).shape),It=oe.partial().extend(oe.pick(b).shape).omit({name:!0}),Tt=re.partial().extend(re.pick(b).shape).omit({name:!0}),Et=R.partial().extend(R.pick(b).shape),Le=e.z.discriminatedUnion("type",[xt,Lt,bt,Mt,Ct,Gt,It,Tt,Et]),be=e.z.object({ids:e.z.array(e.z.string()).optional()}),Me=e.z.object({ids:e.z.array(e.z.string()).optional()});var zt=t("getElement",d.z.string()),Pt=t("getElementGeometry",d.z.string()),Ft=t("getElements",be.optional()),kt=t("getElementGroup",d.z.string()),Vt=t("getElementGroups",Me.optional()),vt=t("setElementGroupVisibility",T),wt=S("onElementChange",d.z.object({id:d.z.string()})),Ut=p("onElementCreate"),Ot=p("onElementCreateEnd"),jt=S("onElementDelete",d.z.object({id:d.z.string()})),Rt=S("onElementGroupChange",d.z.object({id:d.z.string()})),Nt=t("createElement",xe),At=t("updateElement",Le),Dt=t("deleteElement",d.z.string()),Ce={methods:[zt,Pt,Ft,kt,Vt,vt,Nt,At,Dt],listeners:[wt,Ut,Ot,jt,Rt]};var Ht=p("onPointerClick"),Jt=p("onPointerMove"),Ge={methods:null,listeners:[Ht,Jt]};var s=require("zod");var a=require("zod"),Bt=a.z.enum(["in","ni"]),Zt=a.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Vr=a.z.enum(["and","or"]),Ie=a.z.union([a.z.number(),a.z.string(),a.z.boolean(),a.z.null()]),Te=a.z.string().or(a.z.null()),qt=a.z.tuple([Te,Bt,a.z.array(Ie).or(a.z.null())]),Wt=a.z.tuple([Te,Zt,Ie]),ye=a.z.union([qt,Wt]),ge=a.z.tuple([a.z.lazy(()=>a.z.union([ge,ye,a.z.null(),a.z.boolean()])),a.z.enum(["and","or"]),a.z.lazy(()=>a.z.union([ge,ye,a.z.null(),a.z.boolean()]))]),E=a.z.union([ge,ye,a.z.null(),a.z.boolean()]);var n=require("zod");var Ee=n.z.enum(["avg","max","min","sum","median"]),_t=n.z.object({method:Ee,attribute:n.z.string()}),Qt=n.z.object({methods:n.z.array(n.z.union([Ee,n.z.literal("count")])),attribute:n.z.string().optional()}),$=n.z.union([x,V,Z,n.z.array(G)]),ze=n.z.object({boundary:$.optional(),filters:E.optional(),aggregation:_t.optional()}),Pe=n.z.object({layerId:n.z.string(),attribute:n.z.string(),limit:n.z.number().optional(),boundary:$.optional(),filters:E.optional(),values:ze.optional()}),Or=n.z.object({key:n.z.union([n.z.number(),n.z.string(),n.z.boolean()]),value:n.z.number().nullable()}),$t=n.z.object({type:n.z.literal("equal-intervals"),count:n.z.number()}),Kt=n.z.object({type:n.z.literal("time-interval"),interval:n.z.enum(["hour","day","week","month","year"])}),Fe=n.z.object({layerId:n.z.string(),attribute:n.z.string(),steps:n.z.union([$t,Kt,n.z.array(n.z.number())]),boundary:$.optional(),filters:E.optional(),values:ze.optional()}),jr=n.z.object({min:n.z.number(),max:n.z.number(),value:n.z.number()}),ke=n.z.object({layerId:n.z.string(),boundary:$.optional(),filters:E.optional(),aggregation:Qt});var o=require("zod");var Ar=o.z.enum(["processing","completed","failed","incomplete"]),Ve=o.z.object({type:o.z.literal("geoJsonUrl"),url:o.z.string().url(),refreshInterval:o.z.number().min(250).max(5*60*1e3).nullable().optional()}),ve=o.z.object({type:o.z.literal("geoJsonData"),data:o.z.object({}).passthrough().or(o.z.instanceof(ArrayBuffer))}),we=o.z.object({type:o.z.literal("geoJsonFile"),file:o.z.instanceof(File)}),Ue=o.z.object({id:o.z.string(),style:o.z.object({}).passthrough().optional(),shownInLegend:o.z.boolean().optional(),name:o.z.string().optional(),caption:o.z.string().optional(),description:o.z.string().optional(),bounds:x.optional(),source:o.z.union([Ve,ve,we]).optional()}),Oe=o.z.object({ids:o.z.array(o.z.string()).optional()}),je=o.z.object({ids:o.z.array(o.z.string()).optional()}),F=o.z.object({id:o.z.string(),layerId:o.z.string()}),Re=o.z.object({ids:F.array().optional(),layerIds:o.z.string().array().optional()}),Ne=o.z.object({layerIds:o.z.array(o.z.string()).optional(),areaQuery:o.z.union([o.z.object({coordinates:B}),o.z.object({boundary:x})]).optional()}),Xt=o.z.object({Point:o.z.object({}).passthrough().optional(),Line:o.z.object({}).passthrough().optional(),Polygon:o.z.object({}).passthrough().optional()}),Ae=o.z.object({source:o.z.union([Ve,ve,we]),name:o.z.string(),bounds:x.optional(),caption:o.z.string().optional(),description:o.z.string().optional(),geometryStyles:Xt.optional()});var Yt=t("getLayer",s.z.string()),eo=t("getLayers",Oe.optional()),to=t("setLayerVisibility",T),oo=S("onLayerChange",s.z.object({id:s.z.string()})),ro=t("setLayerStyle",s.z.object({id:s.z.string(),style:s.z.object({}).passthrough()})),no=t("setLayerLegendVisibility",T),ao=t("createLayersFromGeoJson",Ae),io=t("updateLayer",Ue),so=t("deleteLayer",s.z.string()),lo=t("getLayerGroup",s.z.string()),po=t("getLayerGroups",je.optional()),mo=t("setLayerGroupVisibility",T),co=t("setLayerGroupLegendVisibility",T),yo=S("onLayerGroupChange",s.z.object({id:s.z.string()})),go=t("getLegendItem",F),uo=t("getLegendItems",Re.optional()),ho=S("onLegendItemChange",F),fo=t("setLegendItemVisibility",s.z.object({show:F.array().optional(),hide:F.array().optional()})),So=t("getLayerFilters",s.z.string()),xo=t("setLayerFilters",s.z.object({layerId:s.z.string(),filters:E,note:s.z.string().optional()})),Lo=S("onLayerFiltersChange",s.z.object({layerId:s.z.string()})),bo=t("getRenderedFeatures",Ne.optional()),Mo=t("getFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Co=t("getGeoJsonFeature",s.z.object({id:s.z.string().or(s.z.number()),layerId:s.z.string()})),Go=t("getCategoryData",Pe),Io=t("getHistogramData",Fe),To=t("getAggregates",ke),Eo=t("getLayerSchema",s.z.string()),De={methods:[Yt,eo,to,ro,no,ao,so,io,lo,po,mo,co,go,uo,fo,So,xo,bo,Mo,Co,Go,Io,To,Eo],listeners:[oo,yo,ho,Lo]};var He=require("zod");var zo=t("getMapDetails",He.z.undefined()),Je={methods:[zo],listeners:[]};var N=require("zod");var M=require("zod"),Be=M.z.object({id:M.z.string().or(M.z.number()),layerId:M.z.string(),showPopup:M.z.boolean().optional(),fitViewport:M.z.boolean().or(M.z.object({maxZoom:M.z.number()})).optional()});var Po=t("getSelection",N.z.undefined()),Fo=p("onSelectionChange"),ko=t("selectFeature",Be),Vo=t("clearSelection",N.z.object({features:N.z.boolean().optional(),elements:N.z.boolean().optional()}).optional()),Ze={methods:[Po,ko,Vo],listeners:[Fo]};var $e=require("zod");var m=require("zod");var qe=["pin","line","route","polygon","circle","marker","highlighter","text","note"],We=m.z.enum([...qe,"link"]),_e=m.z.enum(qe),vo=ae.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),wo=Q.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Uo=Q.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Oo=ie.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),jo=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),Ro=le.pick({color:!0,opacity:!0,size:!0}).required(),No=pe.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),Ao=me.pick({color:!0,align:!0,style:!0}).required(),Do=ce.pick({color:!0,align:!0,style:!0}).required(),Qe=m.z.discriminatedUnion("tool",[vo.partial().extend({tool:m.z.literal("pin")}),wo.partial().extend({tool:m.z.literal("line")}),Uo.partial().extend({tool:m.z.literal("route")}),Oo.partial().extend({tool:m.z.literal("polygon")}),jo.partial().extend({tool:m.z.literal("circle")}),Ro.partial().extend({tool:m.z.literal("marker")}),No.partial().extend({tool:m.z.literal("highlighter")}),Ao.partial().extend({tool:m.z.literal("text")}),Do.partial().extend({tool:m.z.literal("note")})]);var Ho=t("setTool",We.nullable()),Jo=t("getTool",$e.z.undefined()),Bo=p("onToolChange"),Zo=t("setToolSettings",Qe),qo=t("getToolSettings",_e),Wo=p("onToolSettingsChange"),Ke={methods:[Ho,Jo,Zo,qo],listeners:[Bo,Wo]};var K=require("zod");var c=require("zod"),Xe=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),Ye=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var _o=t("updateUiControls",Xe),Qo=t("setOnMapInteractionsUi",Ye),$o=t("showLayerDataTable",K.z.object({layerId:K.z.string(),sorting:fe.optional()}).optional()),Ko=t("hideLayerDataTable",K.z.undefined()),et={methods:[_o,Qo,$o,Ko],listeners:null};var de=require("zod");var A=require("zod");var X=A.z.object({center:B,zoom:he}),tt=A.z.object({center:X.shape.center.optional(),zoom:X.shape.zoom.optional()}),ot=A.z.object({minZoom:X.shape.zoom.nullish(),maxZoom:X.shape.zoom.nullish(),bounds:x.nullish()}).nullable(),rt=A.z.object({bounds:x});var Xo=t("getViewport",de.z.undefined()),Yo=t("setViewport",tt),er=t("getViewportConstraints",de.z.undefined()),tr=t("setViewportConstraints",ot),or=t("fitViewportToBounds",rt),rr=p("onViewportMove"),nr=p("onViewportMoveEnd"),ar=p("onMapIdle"),nt={methods:[Yo,Xo,er,tr,or],listeners:[rr,nr,ar]};var ue=[et,nt,De,Ce,Ze,Ge,Ke,Je];function ir(r,l,I){let z=new Map;async function C(u){if(!cr.safeParse(u.data).success){I?.onUnknownMessage?.(u.data);return}let D=st.safeParse(u.data);if(!D.success){I?.onInvalidMessage?.(u.data,D.error),u.ports[0]?.postMessage(at(D.error.message));return}let{data:g}=D;if(g.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(g.type==="felt.addListener"){if(g.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let k="options"in g.event?{options:"options"in g.event?g.event.options:void 0,handler:ee=>{u.ports[0]?.postMessage(ee)}}:{handler:ee=>{u.ports[0]?.postMessage(ee)}},Y=l.listeners[g.event.eventName](k);z.set(g.event.id,Y)}else if(g.type==="felt.removeListener")z.get(g.id)?.(),z.delete(g.id);else try{let k=l.methods[g.type],Y=await k(g.params);u.ports[0]?.postMessage(Y)}catch(k){u.ports[0]?.postMessage(at(k))}}return r.addEventListener("message",C),()=>{r.removeEventListener("message",C)}}var it={methods:ue.map(r=>r.methods??[]).flat(),listeners:ue.map(r=>r.listeners??[]).flat()},sr=y.z.discriminatedUnion("eventName",[y.z.strictObject({eventName:y.z.literal("")}),...it.listeners]),lr=y.z.strictObject({type:y.z.literal("felt.addListener"),event:sr}),pr=y.z.strictObject({type:y.z.literal("felt.removeListener"),id:y.z.string()}),mr=y.z.strictObject({type:y.z.literal("felt.ready")}),st=y.z.discriminatedUnion("type",[mr,lr,pr,...it.methods]),cr=y.z.object({type:y.z.enum(st.options.map(r=>r.shape.type.value))});function at(r){return{__error__:yr(r)}}function yr(r){return r instanceof Error?r.message:typeof r=="object"&&r!==null&&"message"in r?String(r.message):typeof r=="string"?r:"Unknown error"}0&&(module.exports={createMessageHandler});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feltmaps/js-sdk",
3
- "version": "1.5.0-next.21",
3
+ "version": "1.5.0-next.22",
4
4
  "description": "An SDK for Felt maps",
5
5
  "keywords": [
6
6
  "felt",