@neshan-maps-platform/react-openlayers 2.0.1 → 2.0.2

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.
@@ -1,12 +1,12 @@
1
- import Ie, { createContext as ur, forwardRef as cr, useContext as lr, useRef as fr, useState as ce, useImperativeHandle as dr, useEffect as vr } from "react";
2
- var le = {}, pr = {
1
+ import Me, { createContext as fr, useReducer as dr, forwardRef as pr, useContext as vr, useRef as mr, useState as le, useImperativeHandle as yr, useEffect as gr } from "react";
2
+ var ce = {}, hr = {
3
3
  get exports() {
4
- return le;
4
+ return ce;
5
5
  },
6
- set exports(c) {
7
- le = c;
6
+ set exports(s) {
7
+ ce = s;
8
8
  }
9
- }, N = {};
9
+ }, $ = {};
10
10
  /**
11
11
  * @license React
12
12
  * react-jsx-runtime.production.min.js
@@ -17,24 +17,24 @@ var le = {}, pr = {
17
17
  * LICENSE file in the root directory of this source tree.
18
18
  */
19
19
  var Fe;
20
- function mr() {
20
+ function _r() {
21
21
  if (Fe)
22
- return N;
22
+ return $;
23
23
  Fe = 1;
24
- var c = Ie, C = Symbol.for("react.element"), D = Symbol.for("react.fragment"), w = Object.prototype.hasOwnProperty, g = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, F = { key: !0, ref: !0, __self: !0, __source: !0 };
25
- function k(O, v, S) {
26
- var m, E = {}, x = null, R = null;
27
- S !== void 0 && (x = "" + S), v.key !== void 0 && (x = "" + v.key), v.ref !== void 0 && (R = v.ref);
28
- for (m in v)
29
- w.call(v, m) && !F.hasOwnProperty(m) && (E[m] = v[m]);
24
+ var s = Me, y = Symbol.for("react.element"), S = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, d = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, D = { key: !0, ref: !0, __self: !0, __source: !0 };
25
+ function A(O, v, x) {
26
+ var g, T = {}, j = null, C = null;
27
+ x !== void 0 && (j = "" + x), v.key !== void 0 && (j = "" + v.key), v.ref !== void 0 && (C = v.ref);
28
+ for (g in v)
29
+ E.call(v, g) && !D.hasOwnProperty(g) && (T[g] = v[g]);
30
30
  if (O && O.defaultProps)
31
- for (m in v = O.defaultProps, v)
32
- E[m] === void 0 && (E[m] = v[m]);
33
- return { $$typeof: C, type: O, key: x, ref: R, props: E, _owner: g.current };
31
+ for (g in v = O.defaultProps, v)
32
+ T[g] === void 0 && (T[g] = v[g]);
33
+ return { $$typeof: y, type: O, key: j, ref: C, props: T, _owner: d.current };
34
34
  }
35
- return N.Fragment = D, N.jsx = k, N.jsxs = k, N;
35
+ return $.Fragment = S, $.jsx = A, $.jsxs = A, $;
36
36
  }
37
- var W = {};
37
+ var L = {};
38
38
  /**
39
39
  * @license React
40
40
  * react-jsx-runtime.development.js
@@ -44,18 +44,18 @@ var W = {};
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
- var Ae;
48
- function yr() {
49
- return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
50
- var c = Ie, C = Symbol.for("react.element"), D = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), F = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), O = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), T = Symbol.iterator, Y = "@@iterator";
47
+ var Ie;
48
+ function Er() {
49
+ return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
50
+ var s = Me, y = Symbol.for("react.element"), S = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), A = Symbol.for("react.provider"), O = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), P = Symbol.iterator, W = "@@iterator";
51
51
  function H(e) {
52
52
  if (e === null || typeof e != "object")
53
53
  return null;
54
- var r = T && e[T] || e[Y];
54
+ var r = P && e[P] || e[W];
55
55
  return typeof r == "function" ? r : null;
56
56
  }
57
- var P = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
- function p(e) {
57
+ var w = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
+ function m(e) {
59
59
  {
60
60
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
61
61
  t[n - 1] = arguments[n];
@@ -64,71 +64,71 @@ function yr() {
64
64
  }
65
65
  function M(e, r, t) {
66
66
  {
67
- var n = P.ReactDebugCurrentFrame, i = n.getStackAddendum();
67
+ var n = w.ReactDebugCurrentFrame, i = n.getStackAddendum();
68
68
  i !== "" && (r += "%s", t = t.concat([i]));
69
- var s = t.map(function(o) {
69
+ var u = t.map(function(o) {
70
70
  return String(o);
71
71
  });
72
- s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
72
+ u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
73
73
  }
74
74
  }
75
75
  var X = !1, V = !1, Z = !1, Q = !1, ee = !1, B;
76
76
  B = Symbol.for("react.module.reference");
77
77
  function U(e) {
78
- return !!(typeof e == "string" || typeof e == "function" || e === w || e === F || ee || e === g || e === S || e === m || Q || e === R || X || V || Z || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === E || e.$$typeof === k || e.$$typeof === O || e.$$typeof === v || // This needs to include all possible module reference object
78
+ return !!(typeof e == "string" || typeof e == "function" || e === E || e === D || ee || e === d || e === x || e === g || Q || e === C || X || V || Z || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === T || e.$$typeof === A || e.$$typeof === O || e.$$typeof === v || // This needs to include all possible module reference object
79
79
  // types supported by any Flight configuration anywhere since
80
80
  // we don't know which Flight build this will end up being used
81
81
  // with.
82
82
  e.$$typeof === B || e.getModuleId !== void 0));
83
83
  }
84
- function u(e, r, t) {
84
+ function l(e, r, t) {
85
85
  var n = e.displayName;
86
86
  if (n)
87
87
  return n;
88
88
  var i = r.displayName || r.name || "";
89
89
  return i !== "" ? t + "(" + i + ")" : t;
90
90
  }
91
- function h(e) {
91
+ function _(e) {
92
92
  return e.displayName || "Context";
93
93
  }
94
- function d(e) {
94
+ function p(e) {
95
95
  if (e == null)
96
96
  return null;
97
- if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
97
+ if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
98
98
  return e.displayName || e.name || null;
99
99
  if (typeof e == "string")
100
100
  return e;
101
101
  switch (e) {
102
- case w:
102
+ case E:
103
103
  return "Fragment";
104
- case D:
104
+ case S:
105
105
  return "Portal";
106
- case F:
106
+ case D:
107
107
  return "Profiler";
108
- case g:
108
+ case d:
109
109
  return "StrictMode";
110
- case S:
110
+ case x:
111
111
  return "Suspense";
112
- case m:
112
+ case g:
113
113
  return "SuspenseList";
114
114
  }
115
115
  if (typeof e == "object")
116
116
  switch (e.$$typeof) {
117
117
  case O:
118
118
  var r = e;
119
- return h(r) + ".Consumer";
120
- case k:
119
+ return _(r) + ".Consumer";
120
+ case A:
121
121
  var t = e;
122
- return h(t._context) + ".Provider";
122
+ return _(t._context) + ".Provider";
123
123
  case v:
124
- return u(e, e.render, "ForwardRef");
125
- case E:
124
+ return l(e, e.render, "ForwardRef");
125
+ case T:
126
126
  var n = e.displayName || null;
127
- return n !== null ? n : d(e.type) || "Memo";
128
- case x: {
129
- var i = e, s = i._payload, o = i._init;
127
+ return n !== null ? n : p(e.type) || "Memo";
128
+ case j: {
129
+ var i = e, u = i._payload, o = i._init;
130
130
  try {
131
- return d(o(s));
131
+ return p(o(u));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -136,18 +136,18 @@ function yr() {
136
136
  }
137
137
  return null;
138
138
  }
139
- var _ = Object.assign, $ = 0, fe, de, ve, pe, me, ye, ge;
140
- function he() {
139
+ var b = Object.assign, N = 0, de, pe, ve, me, ye, ge, he;
140
+ function _e() {
141
141
  }
142
- he.__reactDisabledLog = !0;
143
- function $e() {
142
+ _e.__reactDisabledLog = !0;
143
+ function Le() {
144
144
  {
145
- if ($ === 0) {
146
- fe = console.log, de = console.info, ve = console.warn, pe = console.error, me = console.group, ye = console.groupCollapsed, ge = console.groupEnd;
145
+ if (N === 0) {
146
+ de = console.log, pe = console.info, ve = console.warn, me = console.error, ye = console.group, ge = console.groupCollapsed, he = console.groupEnd;
147
147
  var e = {
148
148
  configurable: !0,
149
149
  enumerable: !0,
150
- value: he,
150
+ value: _e,
151
151
  writable: !0
152
152
  };
153
153
  Object.defineProperties(console, {
@@ -160,45 +160,45 @@ function yr() {
160
160
  groupEnd: e
161
161
  });
162
162
  }
163
- $++;
163
+ N++;
164
164
  }
165
165
  }
166
- function Le() {
166
+ function We() {
167
167
  {
168
- if ($--, $ === 0) {
168
+ if (N--, N === 0) {
169
169
  var e = {
170
170
  configurable: !0,
171
171
  enumerable: !0,
172
172
  writable: !0
173
173
  };
174
174
  Object.defineProperties(console, {
175
- log: _({}, e, {
176
- value: fe
177
- }),
178
- info: _({}, e, {
175
+ log: b({}, e, {
179
176
  value: de
180
177
  }),
181
- warn: _({}, e, {
182
- value: ve
183
- }),
184
- error: _({}, e, {
178
+ info: b({}, e, {
185
179
  value: pe
186
180
  }),
187
- group: _({}, e, {
181
+ warn: b({}, e, {
182
+ value: ve
183
+ }),
184
+ error: b({}, e, {
188
185
  value: me
189
186
  }),
190
- groupCollapsed: _({}, e, {
187
+ group: b({}, e, {
191
188
  value: ye
192
189
  }),
193
- groupEnd: _({}, e, {
190
+ groupCollapsed: b({}, e, {
194
191
  value: ge
192
+ }),
193
+ groupEnd: b({}, e, {
194
+ value: he
195
195
  })
196
196
  });
197
197
  }
198
- $ < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
198
+ N < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
199
199
  }
200
200
  }
201
- var re = P.ReactCurrentDispatcher, te;
201
+ var re = w.ReactCurrentDispatcher, te;
202
202
  function q(e, r, t) {
203
203
  {
204
204
  if (te === void 0)
@@ -214,10 +214,10 @@ function yr() {
214
214
  }
215
215
  var ne = !1, z;
216
216
  {
217
- var Ne = typeof WeakMap == "function" ? WeakMap : Map;
218
- z = new Ne();
217
+ var Ve = typeof WeakMap == "function" ? WeakMap : Map;
218
+ z = new Ve();
219
219
  }
220
- function _e(e, r) {
220
+ function Ee(e, r) {
221
221
  if (!e || ne)
222
222
  return "";
223
223
  {
@@ -229,8 +229,8 @@ function yr() {
229
229
  ne = !0;
230
230
  var i = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
232
- var s;
233
- s = re.current, re.current = null, $e();
232
+ var u;
233
+ u = re.current, re.current = null, Le();
234
234
  try {
235
235
  if (r) {
236
236
  var o = function() {
@@ -243,55 +243,55 @@ function yr() {
243
243
  }), typeof Reflect == "object" && Reflect.construct) {
244
244
  try {
245
245
  Reflect.construct(o, []);
246
- } catch (j) {
247
- n = j;
246
+ } catch (k) {
247
+ n = k;
248
248
  }
249
249
  Reflect.construct(e, [], o);
250
250
  } else {
251
251
  try {
252
252
  o.call();
253
- } catch (j) {
254
- n = j;
253
+ } catch (k) {
254
+ n = k;
255
255
  }
256
256
  e.call(o.prototype);
257
257
  }
258
258
  } else {
259
259
  try {
260
260
  throw Error();
261
- } catch (j) {
262
- n = j;
261
+ } catch (k) {
262
+ n = k;
263
263
  }
264
264
  e();
265
265
  }
266
- } catch (j) {
267
- if (j && n && typeof j.stack == "string") {
268
- for (var a = j.stack.split(`
269
- `), y = n.stack.split(`
270
- `), l = a.length - 1, f = y.length - 1; l >= 1 && f >= 0 && a[l] !== y[f]; )
266
+ } catch (k) {
267
+ if (k && n && typeof k.stack == "string") {
268
+ for (var a = k.stack.split(`
269
+ `), h = n.stack.split(`
270
+ `), c = a.length - 1, f = h.length - 1; c >= 1 && f >= 0 && a[c] !== h[f]; )
271
271
  f--;
272
- for (; l >= 1 && f >= 0; l--, f--)
273
- if (a[l] !== y[f]) {
274
- if (l !== 1 || f !== 1)
272
+ for (; c >= 1 && f >= 0; c--, f--)
273
+ if (a[c] !== h[f]) {
274
+ if (c !== 1 || f !== 1)
275
275
  do
276
- if (l--, f--, f < 0 || a[l] !== y[f]) {
277
- var b = `
278
- ` + a[l].replace(" at new ", " at ");
279
- return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, b), b;
276
+ if (c--, f--, f < 0 || a[c] !== h[f]) {
277
+ var R = `
278
+ ` + a[c].replace(" at new ", " at ");
279
+ return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, R), R;
280
280
  }
281
- while (l >= 1 && f >= 0);
281
+ while (c >= 1 && f >= 0);
282
282
  break;
283
283
  }
284
284
  }
285
285
  } finally {
286
- ne = !1, re.current = s, Le(), Error.prepareStackTrace = i;
286
+ ne = !1, re.current = u, We(), Error.prepareStackTrace = i;
287
287
  }
288
288
  var I = e ? e.displayName || e.name : "", De = I ? q(I) : "";
289
289
  return typeof e == "function" && z.set(e, De), De;
290
290
  }
291
- function We(e, r, t) {
292
- return _e(e, !1);
291
+ function Be(e, r, t) {
292
+ return Ee(e, !1);
293
293
  }
294
- function Ye(e) {
294
+ function Ue(e) {
295
295
  var r = e.prototype;
296
296
  return !!(r && r.isReactComponent);
297
297
  }
@@ -299,90 +299,90 @@ function yr() {
299
299
  if (e == null)
300
300
  return "";
301
301
  if (typeof e == "function")
302
- return _e(e, Ye(e));
302
+ return Ee(e, Ue(e));
303
303
  if (typeof e == "string")
304
304
  return q(e);
305
305
  switch (e) {
306
- case S:
306
+ case x:
307
307
  return q("Suspense");
308
- case m:
308
+ case g:
309
309
  return q("SuspenseList");
310
310
  }
311
311
  if (typeof e == "object")
312
312
  switch (e.$$typeof) {
313
313
  case v:
314
- return We(e.render);
315
- case E:
314
+ return Be(e.render);
315
+ case T:
316
316
  return J(e.type, r, t);
317
- case x: {
318
- var n = e, i = n._payload, s = n._init;
317
+ case j: {
318
+ var n = e, i = n._payload, u = n._init;
319
319
  try {
320
- return J(s(i), r, t);
320
+ return J(u(i), r, t);
321
321
  } catch {
322
322
  }
323
323
  }
324
324
  }
325
325
  return "";
326
326
  }
327
- var G = Object.prototype.hasOwnProperty, be = {}, Ee = P.ReactDebugCurrentFrame;
327
+ var G = Object.prototype.hasOwnProperty, be = {}, Re = w.ReactDebugCurrentFrame;
328
328
  function K(e) {
329
329
  if (e) {
330
330
  var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
331
- Ee.setExtraStackFrame(t);
331
+ Re.setExtraStackFrame(t);
332
332
  } else
333
- Ee.setExtraStackFrame(null);
333
+ Re.setExtraStackFrame(null);
334
334
  }
335
- function Ve(e, r, t, n, i) {
335
+ function qe(e, r, t, n, i) {
336
336
  {
337
- var s = Function.call.bind(G);
337
+ var u = Function.call.bind(G);
338
338
  for (var o in e)
339
- if (s(e, o)) {
339
+ if (u(e, o)) {
340
340
  var a = void 0;
341
341
  try {
342
342
  if (typeof e[o] != "function") {
343
- var y = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
- throw y.name = "Invariant Violation", y;
343
+ var h = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
+ throw h.name = "Invariant Violation", h;
345
345
  }
346
346
  a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
- } catch (l) {
348
- a = l;
347
+ } catch (c) {
348
+ a = c;
349
349
  }
350
- a && !(a instanceof Error) && (K(i), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), K(null)), a instanceof Error && !(a.message in be) && (be[a.message] = !0, K(i), p("Failed %s type: %s", t, a.message), K(null));
350
+ a && !(a instanceof Error) && (K(i), m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), K(null)), a instanceof Error && !(a.message in be) && (be[a.message] = !0, K(i), m("Failed %s type: %s", t, a.message), K(null));
351
351
  }
352
352
  }
353
353
  }
354
- var Be = Array.isArray;
354
+ var ze = Array.isArray;
355
355
  function ae(e) {
356
- return Be(e);
356
+ return ze(e);
357
357
  }
358
- function Ue(e) {
358
+ function Je(e) {
359
359
  {
360
360
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
361
361
  return t;
362
362
  }
363
363
  }
364
- function qe(e) {
364
+ function Ge(e) {
365
365
  try {
366
- return Re(e), !1;
366
+ return Te(e), !1;
367
367
  } catch {
368
368
  return !0;
369
369
  }
370
370
  }
371
- function Re(e) {
371
+ function Te(e) {
372
372
  return "" + e;
373
373
  }
374
- function Te(e) {
375
- if (qe(e))
376
- return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ue(e)), Re(e);
374
+ function Ce(e) {
375
+ if (Ge(e))
376
+ return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), Te(e);
377
377
  }
378
- var L = P.ReactCurrentOwner, ze = {
378
+ var Y = w.ReactCurrentOwner, Ke = {
379
379
  key: !0,
380
380
  ref: !0,
381
381
  __self: !0,
382
382
  __source: !0
383
- }, Ce, we, oe;
383
+ }, Pe, Se, oe;
384
384
  oe = {};
385
- function Je(e) {
385
+ function He(e) {
386
386
  if (G.call(e, "ref")) {
387
387
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
388
388
  if (r && r.isReactWarning)
@@ -390,7 +390,7 @@ function yr() {
390
390
  }
391
391
  return e.ref !== void 0;
392
392
  }
393
- function Ge(e) {
393
+ function Xe(e) {
394
394
  if (G.call(e, "key")) {
395
395
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
396
396
  if (r && r.isReactWarning)
@@ -398,16 +398,16 @@ function yr() {
398
398
  }
399
399
  return e.key !== void 0;
400
400
  }
401
- function Ke(e, r) {
402
- if (typeof e.ref == "string" && L.current && r && L.current.stateNode !== r) {
403
- var t = d(L.current.type);
404
- oe[t] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', d(L.current.type), e.ref), oe[t] = !0);
401
+ function Ze(e, r) {
402
+ if (typeof e.ref == "string" && Y.current && r && Y.current.stateNode !== r) {
403
+ var t = p(Y.current.type);
404
+ oe[t] || (m('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', p(Y.current.type), e.ref), oe[t] = !0);
405
405
  }
406
406
  }
407
- function He(e, r) {
407
+ function Qe(e, r) {
408
408
  {
409
409
  var t = function() {
410
- Ce || (Ce = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
410
+ Pe || (Pe = !0, m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
411
411
  };
412
412
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
413
413
  get: t,
@@ -415,10 +415,10 @@ function yr() {
415
415
  });
416
416
  }
417
417
  }
418
- function Xe(e, r) {
418
+ function er(e, r) {
419
419
  {
420
420
  var t = function() {
421
- we || (we = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
421
+ Se || (Se = !0, m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
422
422
  };
423
423
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
424
424
  get: t,
@@ -426,17 +426,17 @@ function yr() {
426
426
  });
427
427
  }
428
428
  }
429
- var Ze = function(e, r, t, n, i, s, o) {
429
+ var rr = function(e, r, t, n, i, u, o) {
430
430
  var a = {
431
431
  // This tag allows us to uniquely identify this as a React Element
432
- $$typeof: C,
432
+ $$typeof: y,
433
433
  // Built-in properties that belong on the element
434
434
  type: e,
435
435
  key: r,
436
436
  ref: t,
437
437
  props: o,
438
438
  // Record the component responsible for creating this element.
439
- _owner: s
439
+ _owner: u
440
440
  };
441
441
  return a._store = {}, Object.defineProperty(a._store, "validated", {
442
442
  configurable: !1,
@@ -455,41 +455,41 @@ function yr() {
455
455
  value: i
456
456
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
457
457
  };
458
- function Qe(e, r, t, n, i) {
458
+ function tr(e, r, t, n, i) {
459
459
  {
460
- var s, o = {}, a = null, y = null;
461
- t !== void 0 && (Te(t), a = "" + t), Ge(r) && (Te(r.key), a = "" + r.key), Je(r) && (y = r.ref, Ke(r, i));
462
- for (s in r)
463
- G.call(r, s) && !ze.hasOwnProperty(s) && (o[s] = r[s]);
460
+ var u, o = {}, a = null, h = null;
461
+ t !== void 0 && (Ce(t), a = "" + t), Xe(r) && (Ce(r.key), a = "" + r.key), He(r) && (h = r.ref, Ze(r, i));
462
+ for (u in r)
463
+ G.call(r, u) && !Ke.hasOwnProperty(u) && (o[u] = r[u]);
464
464
  if (e && e.defaultProps) {
465
- var l = e.defaultProps;
466
- for (s in l)
467
- o[s] === void 0 && (o[s] = l[s]);
465
+ var c = e.defaultProps;
466
+ for (u in c)
467
+ o[u] === void 0 && (o[u] = c[u]);
468
468
  }
469
- if (a || y) {
469
+ if (a || h) {
470
470
  var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
471
- a && He(o, f), y && Xe(o, f);
471
+ a && Qe(o, f), h && er(o, f);
472
472
  }
473
- return Ze(e, a, y, i, n, L.current, o);
473
+ return rr(e, a, h, i, n, Y.current, o);
474
474
  }
475
475
  }
476
- var ie = P.ReactCurrentOwner, Pe = P.ReactDebugCurrentFrame;
477
- function A(e) {
476
+ var ie = w.ReactCurrentOwner, we = w.ReactDebugCurrentFrame;
477
+ function F(e) {
478
478
  if (e) {
479
479
  var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
480
- Pe.setExtraStackFrame(t);
480
+ we.setExtraStackFrame(t);
481
481
  } else
482
- Pe.setExtraStackFrame(null);
482
+ we.setExtraStackFrame(null);
483
483
  }
484
484
  var se;
485
485
  se = !1;
486
486
  function ue(e) {
487
- return typeof e == "object" && e !== null && e.$$typeof === C;
487
+ return typeof e == "object" && e !== null && e.$$typeof === y;
488
488
  }
489
489
  function Oe() {
490
490
  {
491
491
  if (ie.current) {
492
- var e = d(ie.current.type);
492
+ var e = p(ie.current.type);
493
493
  if (e)
494
494
  return `
495
495
 
@@ -498,7 +498,7 @@ Check the render method of \`` + e + "`.";
498
498
  return "";
499
499
  }
500
500
  }
501
- function er(e) {
501
+ function nr(e) {
502
502
  {
503
503
  if (e !== void 0) {
504
504
  var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
@@ -509,8 +509,8 @@ Check your code at ` + r + ":" + t + ".";
509
509
  return "";
510
510
  }
511
511
  }
512
- var Se = {};
513
- function rr(e) {
512
+ var xe = {};
513
+ function ar(e) {
514
514
  {
515
515
  var r = Oe();
516
516
  if (!r) {
@@ -522,39 +522,39 @@ Check the top-level render call using <` + t + ">.");
522
522
  return r;
523
523
  }
524
524
  }
525
- function xe(e, r) {
525
+ function je(e, r) {
526
526
  {
527
527
  if (!e._store || e._store.validated || e.key != null)
528
528
  return;
529
529
  e._store.validated = !0;
530
- var t = rr(r);
531
- if (Se[t])
530
+ var t = ar(r);
531
+ if (xe[t])
532
532
  return;
533
- Se[t] = !0;
533
+ xe[t] = !0;
534
534
  var n = "";
535
- e && e._owner && e._owner !== ie.current && (n = " It was passed a child from " + d(e._owner.type) + "."), A(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), A(null);
535
+ e && e._owner && e._owner !== ie.current && (n = " It was passed a child from " + p(e._owner.type) + "."), F(e), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null);
536
536
  }
537
537
  }
538
- function je(e, r) {
538
+ function ke(e, r) {
539
539
  {
540
540
  if (typeof e != "object")
541
541
  return;
542
542
  if (ae(e))
543
543
  for (var t = 0; t < e.length; t++) {
544
544
  var n = e[t];
545
- ue(n) && xe(n, r);
545
+ ue(n) && je(n, r);
546
546
  }
547
547
  else if (ue(e))
548
548
  e._store && (e._store.validated = !0);
549
549
  else if (e) {
550
550
  var i = H(e);
551
551
  if (typeof i == "function" && i !== e.entries)
552
- for (var s = i.call(e), o; !(o = s.next()).done; )
553
- ue(o.value) && xe(o.value, r);
552
+ for (var u = i.call(e), o; !(o = u.next()).done; )
553
+ ue(o.value) && je(o.value, r);
554
554
  }
555
555
  }
556
556
  }
557
- function tr(e) {
557
+ function or(e) {
558
558
  {
559
559
  var r = e.type;
560
560
  if (r == null || typeof r == "string")
@@ -564,217 +564,262 @@ Check the top-level render call using <` + t + ">.");
564
564
  t = r.propTypes;
565
565
  else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
566
566
  // Inner props are checked in the reconciler.
567
- r.$$typeof === E))
567
+ r.$$typeof === T))
568
568
  t = r.propTypes;
569
569
  else
570
570
  return;
571
571
  if (t) {
572
- var n = d(r);
573
- Ve(t, e.props, "prop", n, e);
572
+ var n = p(r);
573
+ qe(t, e.props, "prop", n, e);
574
574
  } else if (r.PropTypes !== void 0 && !se) {
575
575
  se = !0;
576
- var i = d(r);
577
- p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
576
+ var i = p(r);
577
+ m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
578
578
  }
579
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
579
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
580
580
  }
581
581
  }
582
- function nr(e) {
582
+ function ir(e) {
583
583
  {
584
584
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
585
585
  var n = r[t];
586
586
  if (n !== "children" && n !== "key") {
587
- A(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), A(null);
587
+ F(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
588
588
  break;
589
589
  }
590
590
  }
591
- e.ref !== null && (A(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
591
+ e.ref !== null && (F(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
592
592
  }
593
593
  }
594
- function ke(e, r, t, n, i, s) {
594
+ function Ae(e, r, t, n, i, u) {
595
595
  {
596
596
  var o = U(e);
597
597
  if (!o) {
598
598
  var a = "";
599
599
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
600
- var y = er(i);
601
- y ? a += y : a += Oe();
602
- var l;
603
- e === null ? l = "null" : ae(e) ? l = "array" : e !== void 0 && e.$$typeof === C ? (l = "<" + (d(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
600
+ var h = nr(i);
601
+ h ? a += h : a += Oe();
602
+ var c;
603
+ e === null ? c = "null" : ae(e) ? c = "array" : e !== void 0 && e.$$typeof === y ? (c = "<" + (p(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, a);
604
604
  }
605
- var f = Qe(e, r, t, i, s);
605
+ var f = tr(e, r, t, i, u);
606
606
  if (f == null)
607
607
  return f;
608
608
  if (o) {
609
- var b = r.children;
610
- if (b !== void 0)
609
+ var R = r.children;
610
+ if (R !== void 0)
611
611
  if (n)
612
- if (ae(b)) {
613
- for (var I = 0; I < b.length; I++)
614
- je(b[I], e);
615
- Object.freeze && Object.freeze(b);
612
+ if (ae(R)) {
613
+ for (var I = 0; I < R.length; I++)
614
+ ke(R[I], e);
615
+ Object.freeze && Object.freeze(R);
616
616
  } else
617
- p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
617
+ m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
618
618
  else
619
- je(b, e);
619
+ ke(R, e);
620
620
  }
621
- return e === w ? nr(f) : tr(f), f;
621
+ return e === E ? ir(f) : or(f), f;
622
622
  }
623
623
  }
624
- function ar(e, r, t) {
625
- return ke(e, r, t, !0);
624
+ function sr(e, r, t) {
625
+ return Ae(e, r, t, !0);
626
626
  }
627
- function or(e, r, t) {
628
- return ke(e, r, t, !1);
627
+ function ur(e, r, t) {
628
+ return Ae(e, r, t, !1);
629
629
  }
630
- var ir = or, sr = ar;
631
- W.Fragment = w, W.jsx = ir, W.jsxs = sr;
632
- }()), W;
630
+ var lr = ur, cr = sr;
631
+ L.Fragment = E, L.jsx = lr, L.jsxs = cr;
632
+ }()), L;
633
633
  }
634
- (function(c) {
635
- process.env.NODE_ENV === "production" ? c.exports = mr() : c.exports = yr();
636
- })(pr);
637
- const gr = le.jsx;
638
- const hr = "_map_an20y_2", _r = "_touch_an20y_26", br = "_floaten_an20y_45", Er = "_float_an20y_45", Rr = {
639
- map: hr,
634
+ (function(s) {
635
+ process.env.NODE_ENV === "production" ? s.exports = _r() : s.exports = Er();
636
+ })(hr);
637
+ const fe = ce.jsx;
638
+ const br = "_map_an20y_2", Rr = "_touch_an20y_26", Tr = "_floaten_an20y_45", Cr = "_float_an20y_45", Pr = {
639
+ map: br,
640
640
  "map-popup-container": "_map-popup-container_an20y_7",
641
- touch: _r,
641
+ touch: Rr,
642
642
  "mobile-layers-button": "_mobile-layers-button_an20y_30",
643
- floaten: br,
644
- float: Er
645
- }, Me = (c) => c ? c instanceof Object ? [c.longitude, c.latitude] : c : void 0, Tr = async () => {
643
+ floaten: Tr,
644
+ float: Cr
645
+ }, Ne = (s) => s ? s instanceof Object ? [s.longitude, s.latitude] : s : void 0, Sr = async () => {
646
646
  try {
647
- const C = await new Promise(
648
- (D, w) => {
647
+ const y = await new Promise(
648
+ (S, E) => {
649
649
  navigator.geolocation.getCurrentPosition(
650
- (g) => {
651
- D(g);
650
+ (d) => {
651
+ S(d);
652
652
  },
653
- (g) => w(g)
653
+ (d) => E(d)
654
654
  );
655
655
  }
656
656
  );
657
- return C && Me(C.coords) || Object.values(Cr());
658
- } catch (c) {
659
- return console.error(c), {};
657
+ return y && Ne(y.coords) || Object.values(wr());
658
+ } catch (s) {
659
+ return console.error(s), {};
660
660
  }
661
- }, Cr = () => ({
661
+ }, wr = () => ({
662
662
  longitude: 59.5870851,
663
663
  latitude: 36.311559
664
- }), wr = {
664
+ }), Or = {
665
665
  reverse: "https://api.neshan.org/v4/reverse",
666
666
  search: "https://api.neshan.org/v1/search",
667
667
  map: "https://static.neshan.org/sdk/openlayers/7.1.0/ol.js"
668
- }, Pr = ur({
668
+ }, Ye = fr({
669
669
  map: null,
670
670
  mapType: "neshan",
671
671
  mapContainer: null,
672
- setMap: (c) => {
672
+ setMap: (s) => {
673
673
  },
674
- setMapType: (c) => {
674
+ setMapType: (s) => {
675
675
  },
676
- setMapContainer: (c) => {
676
+ setMapContainer: (s) => {
677
677
  }
678
- }), Sr = cr(
678
+ }), $e = {
679
+ map: null,
680
+ mapType: "neshan",
681
+ mapContainer: null
682
+ }, xr = (s, y) => {
683
+ switch (y.type) {
684
+ case "SET_MAP":
685
+ return {
686
+ ...s,
687
+ map: y.payload
688
+ };
689
+ case "SET_MAP_TYPE":
690
+ return {
691
+ ...s,
692
+ title: y.payload
693
+ };
694
+ default:
695
+ return $e;
696
+ }
697
+ }, jr = (s) => {
698
+ const [y, S] = dr(xr, $e), E = {
699
+ ...y,
700
+ setMap: (d) => {
701
+ S({
702
+ type: "SET_MAP",
703
+ payload: d
704
+ });
705
+ },
706
+ setMapType: (d) => {
707
+ S({
708
+ type: "SET_MAP_TYPE",
709
+ payload: d
710
+ });
711
+ },
712
+ setMapContainer: (d) => {
713
+ S({
714
+ type: "SET_MAP_CONTAINER",
715
+ payload: d
716
+ });
717
+ }
718
+ };
719
+ return /* @__PURE__ */ fe(Ye.Provider, { value: E, children: s.children });
720
+ }, Ar = pr(
679
721
  ({
680
- options: c,
681
- mapKey: C,
682
- serviceKey: D = "",
683
- zoom: w = 12,
684
- defaultType: g = "neshan",
685
- scale: F,
686
- center: k,
722
+ options: s,
723
+ mapKey: y,
724
+ serviceKey: S = "",
725
+ zoom: E = 12,
726
+ defaultType: d = "neshan",
727
+ scale: D,
728
+ center: A,
687
729
  poi: O = !0,
688
730
  traffic: v = !0,
689
- onInit: S,
690
- className: m,
691
- style: E
692
- }, x) => {
693
- const R = lr(Pr), T = fr(null), [Y, H] = ce(!1), [P, p] = ce(null), [M, X] = ce();
694
- dr(
695
- x,
731
+ onInit: x,
732
+ className: g,
733
+ style: T
734
+ }, j) => {
735
+ const C = vr(Ye), P = mr(null), [W, H] = le(!1), [w, m] = le(null), [M, X] = le();
736
+ yr(
737
+ j,
696
738
  () => ({
697
739
  get mapContainer() {
698
- return T;
740
+ return P;
699
741
  },
700
742
  get ol() {
701
743
  return typeof ol < "u" ? ol : void 0;
702
744
  },
703
745
  get map() {
704
- return R.map;
746
+ return C.map;
705
747
  },
706
748
  get isInitiated() {
707
- return Y;
749
+ return W;
708
750
  }
709
751
  }),
710
- [T, R.map, Y]
752
+ [P, C.map, W]
711
753
  );
712
754
  const V = () => {
713
- var h, d;
714
- if (P)
715
- return P;
716
- const u = (d = (h = T.current) == null ? void 0 : h.querySelector(".ol-viewport")) == null ? void 0 : d.querySelectorAll("div:last-child");
717
- if (u)
718
- return p(
719
- Array.from(u)[u.length - 1]
720
- ), P;
755
+ var _, p;
756
+ if (w)
757
+ return w;
758
+ const l = (p = (_ = P.current) == null ? void 0 : _.querySelector(".ol-viewport")) == null ? void 0 : p.querySelectorAll("div:last-child");
759
+ if (l)
760
+ return m(
761
+ Array.from(l)[l.length - 1]
762
+ ), w;
721
763
  }, Z = () => {
722
- const u = V();
723
- u == null || u.style.setProperty("scale", "" + F);
764
+ const l = V();
765
+ l == null || l.style.setProperty("scale", "" + D);
724
766
  }, Q = () => {
725
- const u = V();
726
- u == null || u.style.setProperty("bottom", "0.2em"), u == null || u.style.setProperty("left", "0.4em");
727
- }, ee = (u, h = "my-openlayer") => {
728
- const d = document.getElementById(h);
729
- if (d)
730
- return d;
731
- const _ = document.createElement("script");
732
- return _.src = u, _.id = h, document.getElementsByTagName("head")[0].appendChild(_), _;
767
+ const l = V();
768
+ l == null || l.style.setProperty("bottom", "0.2em"), l == null || l.style.setProperty("left", "0.4em");
769
+ }, ee = (l, _ = "my-openlayer") => {
770
+ const p = document.getElementById(_);
771
+ if (p)
772
+ return p;
773
+ const b = document.createElement("script");
774
+ return b.src = l, b.id = _, document.getElementsByTagName("head")[0].appendChild(b), b;
733
775
  }, B = async () => {
734
- var d;
735
- if (!T.current)
776
+ var p;
777
+ if (console.log(1), !P.current)
736
778
  return;
737
- const u = M || await Tr(), h = new ol.Map({
738
- target: T.current,
739
- key: C || "",
740
- mapType: g,
779
+ console.log(2);
780
+ const l = M || await Sr();
781
+ console.log(3);
782
+ const _ = new ol.Map({
783
+ target: P.current,
784
+ key: y || "",
785
+ mapType: d,
741
786
  // poi: store.state.poiLayer,
742
787
  poi: O,
743
788
  // traffic: store.state.trafficLayer,
744
789
  traffic: v,
745
790
  view: new ol.View({
746
791
  // @ts-ignore
747
- center: ol.proj.fromLonLat(u),
748
- zoom: w,
792
+ center: ol.proj.fromLonLat(l),
793
+ zoom: E,
749
794
  smoothExtentConstraint: !0
750
795
  // projection: 'EPSG:4326' //Default was EPSG:3857
751
796
  }),
752
797
  controls: [],
753
- ...c
798
+ ...s
754
799
  });
755
- h.setMapType(g), R.setMap(h), (d = R.map) == null || d.setMapType(g), R.setMapType(g), H(!0), S && S(ol, h);
800
+ console.log(4), _.setMapType(d), C.setMap(_), (p = C.map) == null || p.setMapType(d), C.setMapType(d), H(!0), console.log(5), x && x(ol, _), console.log(6);
756
801
  }, U = async () => {
757
802
  await B();
758
803
  };
759
- return vr(() => {
760
- if (T.current && R.setMapContainer(T.current), M)
761
- typeof ol < "u" ? U() : ee(wr.map).addEventListener("load", () => {
804
+ return gr(() => {
805
+ if (P.current && C.setMapContainer(P.current), M)
806
+ typeof ol < "u" ? U() : ee(Or.map).addEventListener("load", () => {
762
807
  U();
763
808
  }), Z(), Q();
764
809
  else {
765
- const u = Me(k);
766
- X((h) => u);
810
+ const l = Ne(A);
811
+ X((_) => l);
767
812
  }
768
- }, [M]), /* @__PURE__ */ gr(
813
+ }, [M]), /* @__PURE__ */ fe(jr, { children: /* @__PURE__ */ fe(
769
814
  "div",
770
815
  {
771
- ref: T,
772
- className: m || Rr.map,
773
- style: E
816
+ ref: P,
817
+ className: g || Pr.map,
818
+ style: T
774
819
  }
775
- );
820
+ ) });
776
821
  }
777
822
  );
778
823
  export {
779
- Sr as NeshanMap
824
+ Ar as NeshanMap
780
825
  };
@@ -0,0 +1,27 @@
1
+ (function(D,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(D=typeof globalThis<"u"?globalThis:D||self,m(D.ReactOpenlayers={},D.React))})(this,function(D,m){"use strict";var Q={},We={get exports(){return Q},set exports(s){Q=s}},Y={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var pe;function Ve(){if(pe)return Y;pe=1;var s=m,g=Symbol.for("react.element"),w=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,M={key:!0,ref:!0,__self:!0,__source:!0};function F(x,v,j){var h,C={},k=null,P=null;j!==void 0&&(k=""+j),v.key!==void 0&&(k=""+v.key),v.ref!==void 0&&(P=v.ref);for(h in v)b.call(v,h)&&!M.hasOwnProperty(h)&&(C[h]=v[h]);if(x&&x.defaultProps)for(h in v=x.defaultProps,v)C[h]===void 0&&(C[h]=v[h]);return{$$typeof:g,type:x,key:k,ref:P,props:C,_owner:d.current}}return Y.Fragment=w,Y.jsx=F,Y.jsxs=F,Y}var L={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ve;function Be(){return ve||(ve=1,process.env.NODE_ENV!=="production"&&function(){var s=m,g=Symbol.for("react.element"),w=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),x=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),S=Symbol.iterator,U="@@iterator";function ee(e){if(e===null||typeof e!="object")return null;var r=S&&e[S]||e[U];return typeof r=="function"?r:null}var O=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];W("error",e,t)}}function W(e,r,t){{var n=O.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var re=!1,z=!1,te=!1,ne=!1,ae=!1,J;J=Symbol.for("react.module.reference");function G(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===M||ae||e===d||e===j||e===h||ne||e===P||re||z||te||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===C||e.$$typeof===F||e.$$typeof===x||e.$$typeof===v||e.$$typeof===J||e.getModuleId!==void 0))}function c(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function E(e){return e.displayName||"Context"}function p(e){if(e==null)return null;if(typeof e.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case b:return"Fragment";case w:return"Portal";case M:return"Profiler";case d:return"StrictMode";case j:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var r=e;return E(r)+".Consumer";case F:var t=e;return E(t._context)+".Provider";case v:return c(e,e.render,"ForwardRef");case C:var n=e.displayName||null;return n!==null?n:p(e.type)||"Memo";case k:{var i=e,u=i._payload,o=i._init;try{return p(o(u))}catch{return null}}}return null}var R=Object.assign,V=0,he,_e,Ee,be,Re,Te,Ce;function Pe(){}Pe.__reactDisabledLog=!0;function Ze(){{if(V===0){he=console.log,_e=console.info,Ee=console.warn,be=console.error,Re=console.group,Te=console.groupCollapsed,Ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function $e(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},e,{value:he}),info:R({},e,{value:_e}),warn:R({},e,{value:Ee}),error:R({},e,{value:be}),group:R({},e,{value:Re}),groupCollapsed:R({},e,{value:Te}),groupEnd:R({},e,{value:Ce})})}V<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var oe=O.ReactCurrentDispatcher,ie;function K(e,r,t){{if(ie===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);ie=n&&n[1]||""}return`
18
+ `+ie+e}}var se=!1,H;{var Qe=typeof WeakMap=="function"?WeakMap:Map;H=new Qe}function Se(e,r){if(!e||se)return"";{var t=H.get(e);if(t!==void 0)return t}var n;se=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=oe.current,oe.current=null,Ze();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(A){n=A}Reflect.construct(e,[],o)}else{try{o.call()}catch(A){n=A}e.call(o.prototype)}}else{try{throw Error()}catch(A){n=A}e()}}catch(A){if(A&&n&&typeof A.stack=="string"){for(var a=A.stack.split(`
19
+ `),_=n.stack.split(`
20
+ `),l=a.length-1,f=_.length-1;l>=1&&f>=0&&a[l]!==_[f];)f--;for(;l>=1&&f>=0;l--,f--)if(a[l]!==_[f]){if(l!==1||f!==1)do if(l--,f--,f<0||a[l]!==_[f]){var T=`
21
+ `+a[l].replace(" at new "," at ");return e.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,T),T}while(l>=1&&f>=0);break}}}finally{se=!1,oe.current=u,$e(),Error.prepareStackTrace=i}var N=e?e.displayName||e.name:"",Le=N?K(N):"";return typeof e=="function"&&H.set(e,Le),Le}function qe(e,r,t){return Se(e,!1)}function er(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function X(e,r,t){if(e==null)return"";if(typeof e=="function")return Se(e,er(e));if(typeof e=="string")return K(e);switch(e){case j:return K("Suspense");case h:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return qe(e.render);case C:return X(e.type,r,t);case k:{var n=e,i=n._payload,u=n._init;try{return X(u(i),r,t)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,we={},Oe=O.ReactDebugCurrentFrame;function $(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(t)}else Oe.setExtraStackFrame(null)}function rr(e,r,t,n,i){{var u=Function.call.bind(Z);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var _=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw _.name="Invariant Violation",_}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&($(i),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),$(null)),a instanceof Error&&!(a.message in we)&&(we[a.message]=!0,$(i),y("Failed %s type: %s",t,a.message),$(null))}}}var tr=Array.isArray;function ue(e){return tr(e)}function nr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ar(e){try{return xe(e),!1}catch{return!0}}function xe(e){return""+e}function je(e){if(ar(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nr(e)),xe(e)}var B=O.ReactCurrentOwner,or={key:!0,ref:!0,__self:!0,__source:!0},ke,Ae,ce;ce={};function ir(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function sr(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ur(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var t=p(B.current.type);ce[t]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',p(B.current.type),e.ref),ce[t]=!0)}}function cr(e,r){{var t=function(){ke||(ke=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function lr(e,r){{var t=function(){Ae||(Ae=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var fr=function(e,r,t,n,i,u,o){var a={$$typeof:g,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function dr(e,r,t,n,i){{var u,o={},a=null,_=null;t!==void 0&&(je(t),a=""+t),sr(r)&&(je(r.key),a=""+r.key),ir(r)&&(_=r.ref,ur(r,i));for(u in r)Z.call(r,u)&&!or.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var l=e.defaultProps;for(u in l)o[u]===void 0&&(o[u]=l[u])}if(a||_){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&cr(o,f),_&&lr(o,f)}return fr(e,a,_,i,n,B.current,o)}}var le=O.ReactCurrentOwner,De=O.ReactDebugCurrentFrame;function I(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);De.setExtraStackFrame(t)}else De.setExtraStackFrame(null)}var fe;fe=!1;function de(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}function Fe(){{if(le.current){var e=p(le.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function pr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
+
25
+ Check your code at `+r+":"+t+"."}return""}}var Me={};function vr(e){{var r=Fe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
+
27
+ Check the top-level render call using <`+t+">.")}return r}}function Ie(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=vr(r);if(Me[t])return;Me[t]=!0;var n="";e&&e._owner&&e._owner!==le.current&&(n=" It was passed a child from "+p(e._owner.type)+"."),I(e),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),I(null)}}function Ne(e,r){{if(typeof e!="object")return;if(ue(e))for(var t=0;t<e.length;t++){var n=e[t];de(n)&&Ie(n,r)}else if(de(e))e._store&&(e._store.validated=!0);else if(e){var i=ee(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)de(o.value)&&Ie(o.value,r)}}}function yr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===v||r.$$typeof===C))t=r.propTypes;else return;if(t){var n=p(r);rr(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!fe){fe=!0;var i=p(r);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){I(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),I(null);break}}e.ref!==null&&(I(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}function Ye(e,r,t,n,i,u){{var o=G(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var _=pr(i);_?a+=_:a+=Fe();var l;e===null?l="null":ue(e)?l="array":e!==void 0&&e.$$typeof===g?(l="<"+(p(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var f=dr(e,r,t,i,u);if(f==null)return f;if(o){var T=r.children;if(T!==void 0)if(n)if(ue(T)){for(var N=0;N<T.length;N++)Ne(T[N],e);Object.freeze&&Object.freeze(T)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ne(T,e)}return e===b?mr(f):yr(f),f}}function gr(e,r,t){return Ye(e,r,t,!0)}function hr(e,r,t){return Ye(e,r,t,!1)}var _r=hr,Er=gr;L.Fragment=b,L.jsx=_r,L.jsxs=Er}()),L}(function(s){process.env.NODE_ENV==="production"?s.exports=Ve():s.exports=Be()})(We);const q=Q.jsx,br="",Ue={map:"_map_an20y_2","map-popup-container":"_map-popup-container_an20y_7",touch:"_touch_an20y_26","mobile-layers-button":"_mobile-layers-button_an20y_30",floaten:"_floaten_an20y_45",float:"_float_an20y_45"},ye=s=>s?s instanceof Object?[s.longitude,s.latitude]:s:void 0,ze=async()=>{try{const g=await new Promise((w,b)=>{navigator.geolocation.getCurrentPosition(d=>{w(d)},d=>b(d))});return g&&ye(g.coords)||Object.values(Je())}catch(s){return console.error(s),{}}},Je=()=>({longitude:59.5870851,latitude:36.311559}),Ge={reverse:"https://api.neshan.org/v4/reverse",search:"https://api.neshan.org/v1/search",map:"https://static.neshan.org/sdk/openlayers/7.1.0/ol.js"},me=m.createContext({map:null,mapType:"neshan",mapContainer:null,setMap:s=>{},setMapType:s=>{},setMapContainer:s=>{}}),ge={map:null,mapType:"neshan",mapContainer:null},Ke=(s,g)=>{switch(g.type){case"SET_MAP":return{...s,map:g.payload};case"SET_MAP_TYPE":return{...s,title:g.payload};default:return ge}},He=s=>{const[g,w]=m.useReducer(Ke,ge),b={...g,setMap:d=>{w({type:"SET_MAP",payload:d})},setMapType:d=>{w({type:"SET_MAP_TYPE",payload:d})},setMapContainer:d=>{w({type:"SET_MAP_CONTAINER",payload:d})}};return q(me.Provider,{value:b,children:s.children})},Xe=m.forwardRef(({options:s,mapKey:g,serviceKey:w="",zoom:b=12,defaultType:d="neshan",scale:M,center:F,poi:x=!0,traffic:v=!0,onInit:j,className:h,style:C},k)=>{const P=m.useContext(me),S=m.useRef(null),[U,ee]=m.useState(!1),[O,y]=m.useState(null),[W,re]=m.useState();m.useImperativeHandle(k,()=>({get mapContainer(){return S},get ol(){return typeof ol<"u"?ol:void 0},get map(){return P.map},get isInitiated(){return U}}),[S,P.map,U]);const z=()=>{var E,p;if(O)return O;const c=(p=(E=S.current)==null?void 0:E.querySelector(".ol-viewport"))==null?void 0:p.querySelectorAll("div:last-child");if(c)return y(Array.from(c)[c.length-1]),O},te=()=>{const c=z();c==null||c.style.setProperty("scale",""+M)},ne=()=>{const c=z();c==null||c.style.setProperty("bottom","0.2em"),c==null||c.style.setProperty("left","0.4em")},ae=(c,E="my-openlayer")=>{const p=document.getElementById(E);if(p)return p;const R=document.createElement("script");return R.src=c,R.id=E,document.getElementsByTagName("head")[0].appendChild(R),R},J=async()=>{var p;if(console.log(1),!S.current)return;console.log(2);const c=W||await ze();console.log(3);const E=new ol.Map({target:S.current,key:g||"",mapType:d,poi:x,traffic:v,view:new ol.View({center:ol.proj.fromLonLat(c),zoom:b,smoothExtentConstraint:!0}),controls:[],...s});console.log(4),E.setMapType(d),P.setMap(E),(p=P.map)==null||p.setMapType(d),P.setMapType(d),ee(!0),console.log(5),j&&j(ol,E),console.log(6)},G=async()=>{await J()};return m.useEffect(()=>{if(S.current&&P.setMapContainer(S.current),W)typeof ol<"u"?G():ae(Ge.map).addEventListener("load",()=>{G()}),te(),ne();else{const c=ye(F);re(E=>c)}},[W]),q(He,{children:q("div",{ref:S,className:h||Ue.map,style:C})})});D.NeshanMap=Xe,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import "../assets/main.scss";
3
3
  import { MapProps, NeshanMapRef } from "./Map.model";
4
+ export type { NeshanMapRef };
4
5
  export declare const NeshanMap: import("react").ForwardRefExoticComponent<MapProps & import("react").RefAttributes<NeshanMapRef>>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neshan-maps-platform/react-openlayers",
3
3
  "private": false,
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "type": "module",
6
6
  "types": "./dist/types/components/index.ts",
7
7
  "files": [
@@ -1,27 +0,0 @@
1
- (function(D,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(D=typeof globalThis<"u"?globalThis:D||self,m(D.ReactNeshanMapOpenlayers={},D.React))})(this,function(D,m){"use strict";var q={},Ne={get exports(){return q},set exports(c){q=c}},L={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var de;function Le(){if(de)return L;de=1;var c=m,w=Symbol.for("react.element"),A=Symbol.for("react.fragment"),S=Object.prototype.hasOwnProperty,g=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,I={key:!0,ref:!0,__self:!0,__source:!0};function F(P,p,x){var y,R={},j=null,T=null;x!==void 0&&(j=""+x),p.key!==void 0&&(j=""+p.key),p.ref!==void 0&&(T=p.ref);for(y in p)S.call(p,y)&&!I.hasOwnProperty(y)&&(R[y]=p[y]);if(P&&P.defaultProps)for(y in p=P.defaultProps,p)R[y]===void 0&&(R[y]=p[y]);return{$$typeof:w,type:P,key:j,ref:T,props:R,_owner:g.current}}return L.Fragment=A,L.jsx=F,L.jsxs=F,L}var W={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var pe;function We(){return pe||(pe=1,process.env.NODE_ENV!=="production"&&function(){var c=m,w=Symbol.for("react.element"),A=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),P=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),C=Symbol.iterator,U="@@iterator";function Q(e){if(e===null||typeof e!="object")return null;var r=C&&e[C]||e[U];return typeof r=="function"?r:null}var O=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Y("error",e,t)}}function Y(e,r,t){{var n=O.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var s=t.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var ee=!1,z=!1,re=!1,te=!1,ne=!1,J;J=Symbol.for("react.module.reference");function G(e){return!!(typeof e=="string"||typeof e=="function"||e===S||e===I||ne||e===g||e===x||e===y||te||e===T||ee||z||re||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===R||e.$$typeof===F||e.$$typeof===P||e.$$typeof===p||e.$$typeof===J||e.getModuleId!==void 0))}function u(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function _(e){return e.displayName||"Context"}function d(e){if(e==null)return null;if(typeof e.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case A:return"Portal";case I:return"Profiler";case g:return"StrictMode";case x:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case P:var r=e;return _(r)+".Consumer";case F:var t=e;return _(t._context)+".Provider";case p:return u(e,e.render,"ForwardRef");case R:var n=e.displayName||null;return n!==null?n:d(e.type)||"Memo";case j:{var i=e,s=i._payload,o=i._init;try{return d(o(s))}catch{return null}}}return null}var b=Object.assign,V=0,me,ye,he,ge,_e,be,Ee;function Re(){}Re.__reactDisabledLog=!0;function Ke(){{if(V===0){me=console.log,ye=console.info,he=console.warn,ge=console.error,_e=console.group,be=console.groupCollapsed,Ee=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Re,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function He(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:b({},e,{value:me}),info:b({},e,{value:ye}),warn:b({},e,{value:he}),error:b({},e,{value:ge}),group:b({},e,{value:_e}),groupCollapsed:b({},e,{value:be}),groupEnd:b({},e,{value:Ee})})}V<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=O.ReactCurrentDispatcher,oe;function K(e,r,t){{if(oe===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);oe=n&&n[1]||""}return`
18
- `+oe+e}}var ie=!1,H;{var Xe=typeof WeakMap=="function"?WeakMap:Map;H=new Xe}function Te(e,r){if(!e||ie)return"";{var t=H.get(e);if(t!==void 0)return t}var n;ie=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=ae.current,ae.current=null,Ke();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(k){n=k}Reflect.construct(e,[],o)}else{try{o.call()}catch(k){n=k}e.call(o.prototype)}}else{try{throw Error()}catch(k){n=k}e()}}catch(k){if(k&&n&&typeof k.stack=="string"){for(var a=k.stack.split(`
19
- `),h=n.stack.split(`
20
- `),l=a.length-1,f=h.length-1;l>=1&&f>=0&&a[l]!==h[f];)f--;for(;l>=1&&f>=0;l--,f--)if(a[l]!==h[f]){if(l!==1||f!==1)do if(l--,f--,f<0||a[l]!==h[f]){var E=`
21
- `+a[l].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,E),E}while(l>=1&&f>=0);break}}}finally{ie=!1,ae.current=s,He(),Error.prepareStackTrace=i}var N=e?e.displayName||e.name:"",Me=N?K(N):"";return typeof e=="function"&&H.set(e,Me),Me}function $e(e,r,t){return Te(e,!1)}function Ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function X(e,r,t){if(e==null)return"";if(typeof e=="function")return Te(e,Ze(e));if(typeof e=="string")return K(e);switch(e){case x:return K("Suspense");case y:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return $e(e.render);case R:return X(e.type,r,t);case j:{var n=e,i=n._payload,s=n._init;try{return X(s(i),r,t)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,Ce={},we=O.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function qe(e,r,t,n,i){{var s=Function.call.bind($);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var h=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(Z(i),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),Z(null)),a instanceof Error&&!(a.message in Ce)&&(Ce[a.message]=!0,Z(i),v("Failed %s type: %s",t,a.message),Z(null))}}}var Qe=Array.isArray;function se(e){return Qe(e)}function er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function rr(e){try{return Se(e),!1}catch{return!0}}function Se(e){return""+e}function Oe(e){if(rr(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",er(e)),Se(e)}var B=O.ReactCurrentOwner,tr={key:!0,ref:!0,__self:!0,__source:!0},Pe,xe,ue;ue={};function nr(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ar(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function or(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var t=d(B.current.type);ue[t]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',d(B.current.type),e.ref),ue[t]=!0)}}function ir(e,r){{var t=function(){Pe||(Pe=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function sr(e,r){{var t=function(){xe||(xe=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ur=function(e,r,t,n,i,s,o){var a={$$typeof:w,type:e,key:r,ref:t,props:o,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function cr(e,r,t,n,i){{var s,o={},a=null,h=null;t!==void 0&&(Oe(t),a=""+t),ar(r)&&(Oe(r.key),a=""+r.key),nr(r)&&(h=r.ref,or(r,i));for(s in r)$.call(r,s)&&!tr.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var l=e.defaultProps;for(s in l)o[s]===void 0&&(o[s]=l[s])}if(a||h){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ir(o,f),h&&sr(o,f)}return ur(e,a,h,i,n,B.current,o)}}var ce=O.ReactCurrentOwner,je=O.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);je.setExtraStackFrame(t)}else je.setExtraStackFrame(null)}var le;le=!1;function fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===w}function ke(){{if(ce.current){var e=d(ce.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function lr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
-
25
- Check your code at `+r+":"+t+"."}return""}}var De={};function fr(e){{var r=ke();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
-
27
- Check the top-level render call using <`+t+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=fr(r);if(De[t])return;De[t]=!0;var n="";e&&e._owner&&e._owner!==ce.current&&(n=" It was passed a child from "+d(e._owner.type)+"."),M(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),M(null)}}function Ae(e,r){{if(typeof e!="object")return;if(se(e))for(var t=0;t<e.length;t++){var n=e[t];fe(n)&&Fe(n,r)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var i=Q(e);if(typeof i=="function"&&i!==e.entries)for(var s=i.call(e),o;!(o=s.next()).done;)fe(o.value)&&Fe(o.value,r)}}}function dr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===p||r.$$typeof===R))t=r.propTypes;else return;if(t){var n=d(r);qe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!le){le=!0;var i=d(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){M(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),M(null);break}}e.ref!==null&&(M(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Ie(e,r,t,n,i,s){{var o=G(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var h=lr(i);h?a+=h:a+=ke();var l;e===null?l="null":se(e)?l="array":e!==void 0&&e.$$typeof===w?(l="<"+(d(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var f=cr(e,r,t,i,s);if(f==null)return f;if(o){var E=r.children;if(E!==void 0)if(n)if(se(E)){for(var N=0;N<E.length;N++)Ae(E[N],e);Object.freeze&&Object.freeze(E)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ae(E,e)}return e===S?pr(f):dr(f),f}}function vr(e,r,t){return Ie(e,r,t,!0)}function mr(e,r,t){return Ie(e,r,t,!1)}var yr=mr,hr=vr;W.Fragment=S,W.jsx=yr,W.jsxs=hr}()),W}(function(c){process.env.NODE_ENV==="production"?c.exports=Le():c.exports=We()})(Ne);const Ye=q.jsx,gr="",Ve={map:"_map_an20y_2","map-popup-container":"_map-popup-container_an20y_7",touch:"_touch_an20y_26","mobile-layers-button":"_mobile-layers-button_an20y_30",floaten:"_floaten_an20y_45",float:"_float_an20y_45"},ve=c=>c?c instanceof Object?[c.longitude,c.latitude]:c:void 0,Be=async()=>{try{const w=await new Promise((A,S)=>{navigator.geolocation.getCurrentPosition(g=>{A(g)},g=>S(g))});return w&&ve(w.coords)||Object.values(Ue())}catch(c){return console.error(c),{}}},Ue=()=>({longitude:59.5870851,latitude:36.311559}),ze={reverse:"https://api.neshan.org/v4/reverse",search:"https://api.neshan.org/v1/search",map:"https://static.neshan.org/sdk/openlayers/7.1.0/ol.js"},Je=m.createContext({map:null,mapType:"neshan",mapContainer:null,setMap:c=>{},setMapType:c=>{},setMapContainer:c=>{}}),Ge=m.forwardRef(({options:c,mapKey:w,serviceKey:A="",zoom:S=12,defaultType:g="neshan",scale:I,center:F,poi:P=!0,traffic:p=!0,onInit:x,className:y,style:R},j)=>{const T=m.useContext(Je),C=m.useRef(null),[U,Q]=m.useState(!1),[O,v]=m.useState(null),[Y,ee]=m.useState();m.useImperativeHandle(j,()=>({get mapContainer(){return C},get ol(){return typeof ol<"u"?ol:void 0},get map(){return T.map},get isInitiated(){return U}}),[C,T.map,U]);const z=()=>{var _,d;if(O)return O;const u=(d=(_=C.current)==null?void 0:_.querySelector(".ol-viewport"))==null?void 0:d.querySelectorAll("div:last-child");if(u)return v(Array.from(u)[u.length-1]),O},re=()=>{const u=z();u==null||u.style.setProperty("scale",""+I)},te=()=>{const u=z();u==null||u.style.setProperty("bottom","0.2em"),u==null||u.style.setProperty("left","0.4em")},ne=(u,_="my-openlayer")=>{const d=document.getElementById(_);if(d)return d;const b=document.createElement("script");return b.src=u,b.id=_,document.getElementsByTagName("head")[0].appendChild(b),b},J=async()=>{var d;if(!C.current)return;const u=Y||await Be(),_=new ol.Map({target:C.current,key:w||"",mapType:g,poi:P,traffic:p,view:new ol.View({center:ol.proj.fromLonLat(u),zoom:S,smoothExtentConstraint:!0}),controls:[],...c});_.setMapType(g),T.setMap(_),(d=T.map)==null||d.setMapType(g),T.setMapType(g),Q(!0),x&&x(ol,_)},G=async()=>{await J()};return m.useEffect(()=>{if(C.current&&T.setMapContainer(C.current),Y)typeof ol<"u"?G():ne(ze.map).addEventListener("load",()=>{G()}),re(),te();else{const u=ve(F);ee(_=>u)}},[Y]),Ye("div",{ref:C,className:y||Ve.map,style:R})});D.NeshanMap=Ge,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});