@neshan-maps-platform/react-openlayers 2.0.14 → 2.0.16

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,4 +1,4 @@
1
- import Ne, { createContext as pr, useReducer as vr, forwardRef as Le, useContext as mr, useRef as yr, useState as ce, useImperativeHandle as hr, useEffect as gr } from "react";
1
+ import Le, { createContext as pr, useReducer as vr, forwardRef as Ne, useContext as mr, useRef as yr, useState as ce, useImperativeHandle as hr, useEffect as gr } from "react";
2
2
  var le = {}, _r = {
3
3
  get exports() {
4
4
  return le;
@@ -6,7 +6,7 @@ var le = {}, _r = {
6
6
  set exports(s) {
7
7
  le = s;
8
8
  }
9
- }, L = {};
9
+ }, N = {};
10
10
  /**
11
11
  * @license React
12
12
  * react-jsx-runtime.production.min.js
@@ -19,20 +19,20 @@ var le = {}, _r = {
19
19
  var Fe;
20
20
  function Er() {
21
21
  if (Fe)
22
- return L;
22
+ return N;
23
23
  Fe = 1;
24
- var s = Ne, f = Symbol.for("react.element"), P = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, v = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, F = { key: !0, ref: !0, __self: !0, __source: !0 };
25
- function A(x, m, O) {
24
+ var s = Le, f = Symbol.for("react.element"), P = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, v = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, F = { key: !0, ref: !0, __self: !0, __source: !0 };
25
+ function A(O, m, x) {
26
26
  var _, T = {}, j = null, C = null;
27
- O !== void 0 && (j = "" + O), m.key !== void 0 && (j = "" + m.key), m.ref !== void 0 && (C = m.ref);
27
+ x !== void 0 && (j = "" + x), m.key !== void 0 && (j = "" + m.key), m.ref !== void 0 && (C = m.ref);
28
28
  for (_ in m)
29
29
  b.call(m, _) && !F.hasOwnProperty(_) && (T[_] = m[_]);
30
- if (x && x.defaultProps)
31
- for (_ in m = x.defaultProps, m)
30
+ if (O && O.defaultProps)
31
+ for (_ in m = O.defaultProps, m)
32
32
  T[_] === void 0 && (T[_] = m[_]);
33
- return { $$typeof: f, type: x, key: j, ref: C, props: T, _owner: v.current };
33
+ return { $$typeof: f, type: O, key: j, ref: C, props: T, _owner: v.current };
34
34
  }
35
- return L.Fragment = P, L.jsx = A, L.jsxs = A, L;
35
+ return N.Fragment = P, N.jsx = A, N.jsxs = A, N;
36
36
  }
37
37
  var W = {};
38
38
  /**
@@ -44,10 +44,10 @@ 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 Me;
47
+ var Ie;
48
48
  function br() {
49
- return Me || (Me = 1, process.env.NODE_ENV !== "production" && function() {
50
- var s = Ne, f = Symbol.for("react.element"), P = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), F = Symbol.for("react.profiler"), A = Symbol.for("react.provider"), x = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), S = Symbol.iterator, Y = "@@iterator";
49
+ return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
50
+ var s = Le, f = Symbol.for("react.element"), P = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), F = Symbol.for("react.profiler"), A = Symbol.for("react.provider"), O = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), S = Symbol.iterator, Y = "@@iterator";
51
51
  function H(e) {
52
52
  if (e === null || typeof e != "object")
53
53
  return null;
@@ -75,7 +75,7 @@ function br() {
75
75
  var X = !1, $ = !1, Z = !1, Q = !1, ee = !1, V;
76
76
  V = Symbol.for("react.module.reference");
77
77
  function B(e) {
78
- return !!(typeof e == "string" || typeof e == "function" || e === b || e === F || ee || e === v || e === O || e === _ || Q || e === C || X || $ || Z || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === T || e.$$typeof === A || e.$$typeof === x || e.$$typeof === m || // This needs to include all possible module reference object
78
+ return !!(typeof e == "string" || typeof e == "function" || e === b || e === F || ee || e === v || e === x || e === _ || Q || e === C || X || $ || Z || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === T || e.$$typeof === A || e.$$typeof === O || e.$$typeof === m || // 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.
@@ -107,14 +107,14 @@ function br() {
107
107
  return "Profiler";
108
108
  case v:
109
109
  return "StrictMode";
110
- case O:
110
+ case x:
111
111
  return "Suspense";
112
112
  case _:
113
113
  return "SuspenseList";
114
114
  }
115
115
  if (typeof e == "object")
116
116
  switch (e.$$typeof) {
117
- case x:
117
+ case O:
118
118
  var r = e;
119
119
  return g(r) + ".Consumer";
120
120
  case A:
@@ -285,7 +285,7 @@ function br() {
285
285
  } finally {
286
286
  ne = !1, re.current = c, Be(), Error.prepareStackTrace = i;
287
287
  }
288
- var I = e ? e.displayName || e.name : "", De = I ? U(I) : "";
288
+ var M = e ? e.displayName || e.name : "", De = M ? U(M) : "";
289
289
  return typeof e == "function" && q.set(e, De), De;
290
290
  }
291
291
  function qe(e, r, t) {
@@ -303,7 +303,7 @@ function br() {
303
303
  if (typeof e == "string")
304
304
  return U(e);
305
305
  switch (e) {
306
- case O:
306
+ case x:
307
307
  return U("Suspense");
308
308
  case _:
309
309
  return U("SuspenseList");
@@ -375,7 +375,7 @@ function br() {
375
375
  if (He(e))
376
376
  return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), Te(e);
377
377
  }
378
- var N = w.ReactCurrentOwner, Xe = {
378
+ var L = w.ReactCurrentOwner, Xe = {
379
379
  key: !0,
380
380
  ref: !0,
381
381
  __self: !0,
@@ -399,9 +399,9 @@ function br() {
399
399
  return e.key !== void 0;
400
400
  }
401
401
  function er(e, r) {
402
- if (typeof e.ref == "string" && N.current && r && N.current.stateNode !== r) {
403
- var t = l(N.current.type);
404
- oe[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', l(N.current.type), e.ref), oe[t] = !0);
402
+ if (typeof e.ref == "string" && L.current && r && L.current.stateNode !== r) {
403
+ var t = l(L.current.type);
404
+ oe[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', l(L.current.type), e.ref), oe[t] = !0);
405
405
  }
406
406
  }
407
407
  function rr(e, r) {
@@ -470,11 +470,11 @@ function br() {
470
470
  var p = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
471
471
  a && rr(o, p), E && tr(o, p);
472
472
  }
473
- return nr(e, a, E, i, n, N.current, o);
473
+ return nr(e, a, E, i, n, L.current, o);
474
474
  }
475
475
  }
476
476
  var ie = w.ReactCurrentOwner, we = w.ReactDebugCurrentFrame;
477
- function M(e) {
477
+ function I(e) {
478
478
  if (e) {
479
479
  var r = e._owner, t = z(e.type, e._source, r ? r.type : null);
480
480
  we.setExtraStackFrame(t);
@@ -486,7 +486,7 @@ function br() {
486
486
  function ue(e) {
487
487
  return typeof e == "object" && e !== null && e.$$typeof === f;
488
488
  }
489
- function xe() {
489
+ function Oe() {
490
490
  {
491
491
  if (ie.current) {
492
492
  var e = l(ie.current.type);
@@ -509,10 +509,10 @@ Check your code at ` + r + ":" + t + ".";
509
509
  return "";
510
510
  }
511
511
  }
512
- var Oe = {};
512
+ var xe = {};
513
513
  function ir(e) {
514
514
  {
515
- var r = xe();
515
+ var r = Oe();
516
516
  if (!r) {
517
517
  var t = typeof e == "string" ? e : e.displayName || e.name;
518
518
  t && (r = `
@@ -528,11 +528,11 @@ Check the top-level render call using <` + t + ">.");
528
528
  return;
529
529
  e._store.validated = !0;
530
530
  var t = ir(r);
531
- if (Oe[t])
531
+ if (xe[t])
532
532
  return;
533
- Oe[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 " + l(e._owner.type) + "."), M(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), M(null);
535
+ e && e._owner && e._owner !== ie.current && (n = " It was passed a child from " + l(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);
536
536
  }
537
537
  }
538
538
  function ke(e, r) {
@@ -584,11 +584,11 @@ Check the top-level render call using <` + t + ">.");
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
- M(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), M(null);
587
+ I(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), I(null);
588
588
  break;
589
589
  }
590
590
  }
591
- e.ref !== null && (M(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), M(null));
591
+ e.ref !== null && (I(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
592
592
  }
593
593
  }
594
594
  function Ae(e, r, t, n, i, c) {
@@ -598,7 +598,7 @@ Check the top-level render call using <` + t + ">.");
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
600
  var E = or(i);
601
- E ? a += E : a += xe();
601
+ E ? a += E : a += Oe();
602
602
  var d;
603
603
  e === null ? d = "null" : ae(e) ? d = "array" : e !== void 0 && e.$$typeof === f ? (d = "<" + (l(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = 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", d, a);
604
604
  }
@@ -610,8 +610,8 @@ Check the top-level render call using <` + t + ">.");
610
610
  if (R !== void 0)
611
611
  if (n)
612
612
  if (ae(R)) {
613
- for (var I = 0; I < R.length; I++)
614
- ke(R[I], e);
613
+ for (var M = 0; M < R.length; M++)
614
+ ke(R[M], e);
615
615
  Object.freeze && Object.freeze(R);
616
616
  } else
617
617
  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.");
@@ -654,16 +654,16 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
654
654
  );
655
655
  }
656
656
  );
657
- return f && We(f.coords) || Object.values(Ie());
657
+ return f && We(f.coords) || Object.values(Me());
658
658
  } catch (s) {
659
659
  console.error(s);
660
- const f = Ie();
660
+ const f = Me();
661
661
  return [f.longitude, f.latitude];
662
662
  }
663
- }, Ie = () => ({
663
+ }, Me = () => ({
664
664
  longitude: 51.36281969540723,
665
665
  latitude: 35.69672648316882
666
- }), xr = {
666
+ }), Or = {
667
667
  reverse: "https://api.neshan.org/v4/reverse",
668
668
  search: "https://api.neshan.org/v1/search",
669
669
  map: "https://static.neshan.org/sdk/openlayers/5.3.0/ol.js"
@@ -681,7 +681,7 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
681
681
  map: null,
682
682
  mapType: "neshan",
683
683
  mapContainer: null
684
- }, Or = (s, f) => {
684
+ }, xr = (s, f) => {
685
685
  switch (f.type) {
686
686
  case "SET_MAP":
687
687
  return {
@@ -697,7 +697,7 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
697
697
  return $e;
698
698
  }
699
699
  }, jr = (s) => {
700
- const [f, P] = vr(Or, $e), b = {
700
+ const [f, P] = vr(xr, $e), b = {
701
701
  ...f,
702
702
  setMap: (v) => {
703
703
  P({
@@ -719,7 +719,7 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
719
719
  }
720
720
  };
721
721
  return /* @__PURE__ */ K(Ye.Provider, { value: b, children: s.children });
722
- }, kr = Le(
722
+ }, kr = Ne(
723
723
  ({
724
724
  options: s,
725
725
  mapKey: f,
@@ -728,9 +728,9 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
728
728
  defaultType: v = "neshan",
729
729
  scale: F,
730
730
  center: A,
731
- poi: x = !0,
731
+ poi: O = !0,
732
732
  traffic: m = !0,
733
- onInit: O,
733
+ onInit: x,
734
734
  className: _,
735
735
  style: T
736
736
  }, j) => {
@@ -785,19 +785,20 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
785
785
  key: f || "",
786
786
  mapType: v,
787
787
  // poi: store.state.poiLayer,
788
- poi: x,
788
+ poi: O,
789
789
  // traffic: store.state.trafficLayer,
790
790
  traffic: m,
791
791
  view: new ol.View({
792
792
  center: ol.proj.fromLonLat(g),
793
- zoom: b,
794
- smoothExtentConstraint: !0
793
+ zoom: b
794
+ // Not in ol@5
795
+ // smoothExtentConstraint: true,
795
796
  // projection: 'EPSG:4326' //Default was EPSG:3857
796
797
  }),
797
798
  controls: [],
798
799
  ...s
799
800
  });
800
- l.setMapType(v), C.setMap(l), (h = C.map) == null || h.setMapType(v), C.setMapType(v), H(!0), O && O(ol, l);
801
+ l.setMapType(v), C.setMap(l), (h = C.map) == null || h.setMapType(v), C.setMapType(v), H(!0), x && x(ol, l);
801
802
  }, B = () => {
802
803
  let u, g, l;
803
804
  return u = new Promise((h, D) => {
@@ -813,7 +814,7 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
813
814
  const u = B();
814
815
  return () => u.cancelPromise();
815
816
  } else {
816
- const u = ee(xr.map), g = () => {
817
+ const u = ee(Or.map), g = () => {
817
818
  B();
818
819
  };
819
820
  return u.addEventListener("load", g), () => u.removeEventListener("load", g);
@@ -827,9 +828,9 @@ const Rr = "_map_1yxt5_2", Tr = "_touch_1yxt5_26", Cr = "_floaten_1yxt5_45", Pr
827
828
  }
828
829
  );
829
830
  }
830
- ), Dr = Le(
831
+ ), Dr = Ne(
831
832
  (s, f) => /* @__PURE__ */ K(jr, { children: /* @__PURE__ */ K(kr, { ref: f, ...s }) })
832
833
  );
833
834
  export {
834
- Dr as NeshanMap
835
+ Dr as default
835
836
  };
@@ -1,4 +1,4 @@
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 $={},Ve={get exports(){return $},set exports(s){$=s}},W={};/**
1
+ (function(m,D){typeof exports=="object"&&typeof module<"u"?module.exports=D(require("react")):typeof define=="function"&&define.amd?define(["react"],D):(m=typeof globalThis<"u"?globalThis:m||self,m.ReactOpenlayers=D(m.React))})(this,function(m){"use strict";var D={},Ye={get exports(){return D},set exports(s){D=s}},W={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var de;function Be(){if(de)return W;de=1;var s=m,f=Symbol.for("react.element"),S=Symbol.for("react.fragment"),R=Object.prototype.hasOwnProperty,v=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,I={key:!0,ref:!0,__self:!0,__source:!0};function F(x,y,j){var E,C={},k=null,P=null;j!==void 0&&(k=""+j),y.key!==void 0&&(k=""+y.key),y.ref!==void 0&&(P=y.ref);for(E in y)R.call(y,E)&&!I.hasOwnProperty(E)&&(C[E]=y[E]);if(x&&x.defaultProps)for(E in y=x.defaultProps,y)C[E]===void 0&&(C[E]=y[E]);return{$$typeof:f,type:x,key:k,ref:P,props:C,_owner:v.current}}return W.Fragment=S,W.jsx=F,W.jsxs=F,W}var Y={};/**
9
+ */var fe;function Ve(){if(fe)return W;fe=1;var s=m,f=Symbol.for("react.element"),S=Symbol.for("react.fragment"),R=Object.prototype.hasOwnProperty,v=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,M={key:!0,ref:!0,__self:!0,__source:!0};function F(O,y,j){var E,C={},k=null,P=null;j!==void 0&&(k=""+j),y.key!==void 0&&(k=""+y.key),y.ref!==void 0&&(P=y.ref);for(E in y)R.call(y,E)&&!M.hasOwnProperty(E)&&(C[E]=y[E]);if(O&&O.defaultProps)for(E in y=O.defaultProps,y)C[E]===void 0&&(C[E]=y[E]);return{$$typeof:f,type:O,key:k,ref:P,props:C,_owner:v.current}}return W.Fragment=S,W.jsx=F,W.jsxs=F,W}var Y={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,14 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var pe;function Ue(){return pe||(pe=1,process.env.NODE_ENV!=="production"&&function(){var s=m,f=Symbol.for("react.element"),S=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),x=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),w=Symbol.iterator,U="@@iterator";function q(e){if(e===null||typeof e!="object")return null;var r=w&&e[w]||e[U];return typeof r=="function"?r:null}var O=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ge("error",e,t)}}function ge(e,r,t){{var n=O.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var c=t.map(function(o){return String(o)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}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===R||e===I||ne||e===v||e===j||e===E||te||e===P||ee||z||re||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===C||e.$$typeof===F||e.$$typeof===x||e.$$typeof===y||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 l(e){if(e==null)return null;if(typeof e.tag=="number"&&h("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 R:return"Fragment";case S:return"Portal";case I:return"Profiler";case v:return"StrictMode";case j:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var r=e;return _(r)+".Consumer";case F:var t=e;return _(t._context)+".Provider";case y:return u(e,e.render,"ForwardRef");case C:var n=e.displayName||null;return n!==null?n:l(e.type)||"Memo";case k:{var i=e,c=i._payload,o=i._init;try{return l(o(c))}catch{return null}}}return null}var g=Object.assign,M=0,_e,Ee,be,Re,Te,Ce,Pe;function Se(){}Se.__reactDisabledLog=!0;function Qe(){{if(M===0){_e=console.log,Ee=console.info,be=console.warn,Re=console.error,Te=console.group,Ce=console.groupCollapsed,Pe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function $e(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:g({},e,{value:_e}),info:g({},e,{value:Ee}),warn:g({},e,{value:be}),error:g({},e,{value:Re}),group:g({},e,{value:Te}),groupCollapsed:g({},e,{value:Ce}),groupEnd:g({},e,{value:Pe})})}M<0&&h("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 qe=typeof WeakMap=="function"?WeakMap:Map;H=new qe}function we(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 c;c=ae.current,ae.current=null,Qe();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(`
17
+ */var de;function Be(){return de||(de=1,process.env.NODE_ENV!=="production"&&function(){var s=m,f=Symbol.for("react.element"),S=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),O=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),w=Symbol.iterator,U="@@iterator";function $(e){if(e===null||typeof e!="object")return null;var r=w&&e[w]||e[U];return typeof r=="function"?r:null}var x=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];he("error",e,t)}}function he(e,r,t){{var n=x.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var c=t.map(function(o){return String(o)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var q=!1,z=!1,ee=!1,re=!1,te=!1,J;J=Symbol.for("react.module.reference");function G(e){return!!(typeof e=="string"||typeof e=="function"||e===R||e===M||te||e===v||e===j||e===E||re||e===P||q||z||ee||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===C||e.$$typeof===F||e.$$typeof===O||e.$$typeof===y||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 g(e){return e.displayName||"Context"}function l(e){if(e==null)return null;if(typeof e.tag=="number"&&h("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 R:return"Fragment";case S:return"Portal";case M:return"Profiler";case v:return"StrictMode";case j:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O:var r=e;return g(r)+".Consumer";case F:var t=e;return g(t._context)+".Provider";case y:return u(e,e.render,"ForwardRef");case C:var n=e.displayName||null;return n!==null?n:l(e.type)||"Memo";case k:{var i=e,c=i._payload,o=i._init;try{return l(o(c))}catch{return null}}}return null}var _=Object.assign,I=0,_e,ge,Ee,be,Re,Te,Ce;function Pe(){}Pe.__reactDisabledLog=!0;function Xe(){{if(I===0){_e=console.log,ge=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})}I++}}function Ze(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:_({},e,{value:_e}),info:_({},e,{value:ge}),warn:_({},e,{value:Ee}),error:_({},e,{value:be}),group:_({},e,{value:Re}),groupCollapsed:_({},e,{value:Te}),groupEnd:_({},e,{value:Ce})})}I<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=x.ReactCurrentDispatcher,ae;function K(e,r,t){{if(ae===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);ae=n&&n[1]||""}return`
18
+ `+ae+e}}var oe=!1,H;{var Qe=typeof WeakMap=="function"?WeakMap:Map;H=new Qe}function Se(e,r){if(!e||oe)return"";{var t=H.get(e);if(t!==void 0)return t}var n;oe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=ne.current,ne.current=null,Xe();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
19
  `),b=n.stack.split(`
20
20
  `),d=a.length-1,p=b.length-1;d>=1&&p>=0&&a[d]!==b[p];)p--;for(;d>=1&&p>=0;d--,p--)if(a[d]!==b[p]){if(d!==1||p!==1)do if(d--,p--,p<0||a[d]!==b[p]){var T=`
21
- `+a[d].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(d>=1&&p>=0);break}}}finally{ie=!1,ae.current=c,$e(),Error.prepareStackTrace=i}var L=e?e.displayName||e.name:"",Ye=L?K(L):"";return typeof e=="function"&&H.set(e,Ye),Ye}function er(e,r,t){return we(e,!1)}function rr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function X(e,r,t){if(e==null)return"";if(typeof e=="function")return we(e,rr(e));if(typeof e=="string")return K(e);switch(e){case j:return K("Suspense");case E:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return er(e.render);case C:return X(e.type,r,t);case k:{var n=e,i=n._payload,c=n._init;try{return X(c(i),r,t)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,Oe={},xe=O.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function tr(e,r,t,n,i){{var c=Function.call.bind(Z);for(var o in e)if(c(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var b=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 b.name="Invariant Violation",b}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){a=d}a&&!(a instanceof Error)&&(Q(i),h("%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),Q(null)),a instanceof Error&&!(a.message in Oe)&&(Oe[a.message]=!0,Q(i),h("Failed %s type: %s",t,a.message),Q(null))}}}var nr=Array.isArray;function se(e){return nr(e)}function ar(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function or(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function ke(e){if(or(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(e)),je(e)}var V=O.ReactCurrentOwner,ir={key:!0,ref:!0,__self:!0,__source:!0},Ae,De,ue;ue={};function sr(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 ur(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 cr(e,r){if(typeof e.ref=="string"&&V.current&&r&&V.current.stateNode!==r){var t=l(V.current.type);ue[t]||(h('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',l(V.current.type),e.ref),ue[t]=!0)}}function lr(e,r){{var t=function(){Ae||(Ae=!0,h("%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 fr(e,r){{var t=function(){De||(De=!0,h("%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 dr=function(e,r,t,n,i,c,o){var a={$$typeof:f,type:e,key:r,ref:t,props:o,_owner:c};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 pr(e,r,t,n,i){{var c,o={},a=null,b=null;t!==void 0&&(ke(t),a=""+t),ur(r)&&(ke(r.key),a=""+r.key),sr(r)&&(b=r.ref,cr(r,i));for(c in r)Z.call(r,c)&&!ir.hasOwnProperty(c)&&(o[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)o[c]===void 0&&(o[c]=d[c])}if(a||b){var p=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&lr(o,p),b&&fr(o,p)}return dr(e,a,b,i,n,V.current,o)}}var ce=O.ReactCurrentOwner,Fe=O.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);Fe.setExtraStackFrame(t)}else Fe.setExtraStackFrame(null)}var le;le=!1;function fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function Me(){{if(ce.current){var e=l(ce.current.type);if(e)return`
21
+ `+a[d].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(d>=1&&p>=0);break}}}finally{oe=!1,ne.current=c,Ze(),Error.prepareStackTrace=i}var L=e?e.displayName||e.name:"",We=L?K(L):"";return typeof e=="function"&&H.set(e,We),We}function $e(e,r,t){return Se(e,!1)}function qe(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,qe(e));if(typeof e=="string")return K(e);switch(e){case j:return K("Suspense");case E:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return $e(e.render);case C:return X(e.type,r,t);case k:{var n=e,i=n._payload,c=n._init;try{return X(c(i),r,t)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,we={},xe=x.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function er(e,r,t,n,i){{var c=Function.call.bind(Z);for(var o in e)if(c(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var b=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 b.name="Invariant Violation",b}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){a=d}a&&!(a instanceof Error)&&(Q(i),h("%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),Q(null)),a instanceof Error&&!(a.message in we)&&(we[a.message]=!0,Q(i),h("Failed %s type: %s",t,a.message),Q(null))}}}var rr=Array.isArray;function ie(e){return rr(e)}function tr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function nr(e){try{return Oe(e),!1}catch{return!0}}function Oe(e){return""+e}function je(e){if(nr(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",tr(e)),Oe(e)}var V=x.ReactCurrentOwner,ar={key:!0,ref:!0,__self:!0,__source:!0},ke,Ae,se;se={};function or(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 ir(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 sr(e,r){if(typeof e.ref=="string"&&V.current&&r&&V.current.stateNode!==r){var t=l(V.current.type);se[t]||(h('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',l(V.current.type),e.ref),se[t]=!0)}}function ur(e,r){{var t=function(){ke||(ke=!0,h("%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 cr(e,r){{var t=function(){Ae||(Ae=!0,h("%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 lr=function(e,r,t,n,i,c,o){var a={$$typeof:f,type:e,key:r,ref:t,props:o,_owner:c};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 fr(e,r,t,n,i){{var c,o={},a=null,b=null;t!==void 0&&(je(t),a=""+t),ir(r)&&(je(r.key),a=""+r.key),or(r)&&(b=r.ref,sr(r,i));for(c in r)Z.call(r,c)&&!ar.hasOwnProperty(c)&&(o[c]=r[c]);if(e&&e.defaultProps){var d=e.defaultProps;for(c in d)o[c]===void 0&&(o[c]=d[c])}if(a||b){var p=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ur(o,p),b&&cr(o,p)}return lr(e,a,b,i,n,V.current,o)}}var ue=x.ReactCurrentOwner,De=x.ReactDebugCurrentFrame;function N(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 ce;ce=!1;function le(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function Fe(){{if(ue.current){var e=l(ue.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function vr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
23
+ Check the render method of \``+e+"`."}return""}}function dr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
24
 
25
- Check your code at `+r+":"+t+"."}return""}}var Ie={};function mr(e){{var r=Me();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
25
+ Check your code at `+r+":"+t+"."}return""}}var Ie={};function pr(e){{var r=Fe();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
26
 
27
- Check the top-level render call using <`+t+">.")}return r}}function Ne(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=mr(r);if(Ie[t])return;Ie[t]=!0;var n="";e&&e._owner&&e._owner!==ce.current&&(n=" It was passed a child from "+l(e._owner.type)+"."),N(e),h('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),N(null)}}function Le(e,r){{if(typeof e!="object")return;if(se(e))for(var t=0;t<e.length;t++){var n=e[t];fe(n)&&Ne(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 c=i.call(e),o;!(o=c.next()).done;)fe(o.value)&&Ne(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===y||r.$$typeof===C))t=r.propTypes;else return;if(t){var n=l(r);tr(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!le){le=!0;var i=l(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function hr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){N(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),N(null);break}}e.ref!==null&&(N(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function We(e,r,t,n,i,c){{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 b=vr(i);b?a+=b:a+=Me();var d;e===null?d="null":se(e)?d="array":e!==void 0&&e.$$typeof===f?(d="<"+(l(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,a)}var p=pr(e,r,t,i,c);if(p==null)return p;if(o){var T=r.children;if(T!==void 0)if(n)if(se(T)){for(var L=0;L<T.length;L++)Le(T[L],e);Object.freeze&&Object.freeze(T)}else h("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 Le(T,e)}return e===R?hr(p):yr(p),p}}function gr(e,r,t){return We(e,r,t,!0)}function _r(e,r,t){return We(e,r,t,!1)}var Er=_r,br=gr;Y.Fragment=R,Y.jsx=Er,Y.jsxs=br}()),Y}(function(s){process.env.NODE_ENV==="production"?s.exports=Be():s.exports=Ue()})(Ve);const B=$.jsx,Rr="",ze={map:"_map_1yxt5_2","map-popup-container":"_map-popup-container_1yxt5_7",touch:"_touch_1yxt5_26","mobile-layers-button":"_mobile-layers-button_1yxt5_30",floaten:"_floaten_1yxt5_45",float:"_float_1yxt5_45"},ve=s=>s?s instanceof Object?[s.longitude,s.latitude]:s:void 0,Je=async()=>{try{const f=await new Promise((S,R)=>{navigator.geolocation.getCurrentPosition(v=>{S(v)},v=>R(v))});return f&&ve(f.coords)||Object.values(me())}catch(s){console.error(s);const f=me();return[f.longitude,f.latitude]}},me=()=>({longitude:51.36281969540723,latitude:35.69672648316882}),Ge={reverse:"https://api.neshan.org/v4/reverse",search:"https://api.neshan.org/v1/search",map:"https://static.neshan.org/sdk/openlayers/5.3.0/ol.js"},ye=m.createContext({map:null,mapType:"neshan",mapContainer:null,setMap:s=>{},setMapType:s=>{},setMapContainer:s=>{}}),he={map:null,mapType:"neshan",mapContainer:null},Ke=(s,f)=>{switch(f.type){case"SET_MAP":return{...s,map:f.payload};case"SET_MAP_TYPE":return{...s,title:f.payload};default:return he}},He=s=>{const[f,S]=m.useReducer(Ke,he),R={...f,setMap:v=>{S({type:"SET_MAP",payload:v})},setMapType:v=>{S({type:"SET_MAP_TYPE",payload:v})},setMapContainer:v=>{S({type:"SET_MAP_CONTAINER",payload:v})}};return B(ye.Provider,{value:R,children:s.children})},Xe=m.forwardRef(({options:s,mapKey:f,serviceKey:S="",zoom:R=12,defaultType:v="neshan",scale:I,center:F,poi:x=!0,traffic:y=!0,onInit:j,className:E,style:C},k)=>{const P=m.useContext(ye),w=m.useRef(null),[U,q]=m.useState(!1),[O,h]=m.useState(null),[ge,ee]=m.useState();m.useImperativeHandle(k,()=>({get mapContainer(){return w},get ol(){return typeof ol<"u"?ol:void 0},get map(){return P.map},get isInitiated(){return U}}),[U,P.map]);const z=()=>{var _,l;if(O)return O;const u=(l=(_=w.current)==null?void 0:_.querySelector(".ol-viewport"))==null?void 0:l.querySelectorAll("div:last-child");if(u)return h(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 l=document.getElementById(_);if(l)return l;const g=document.createElement("script");return g.src=u,g.id=_,document.getElementsByTagName("head")[0].appendChild(g),g},J=async()=>{var g;if(!w.current)return;const u=ve(F);ee(u);const _=u||await Je(),l=new ol.Map({target:w.current,key:f||"",mapType:v,poi:x,traffic:y,view:new ol.View({center:ol.proj.fromLonLat(_),zoom:R,smoothExtentConstraint:!0}),controls:[],...s});l.setMapType(v),P.setMap(l),(g=P.map)==null||g.setMapType(v),P.setMapType(v),q(!0),j&&j(ol,l)},G=()=>{let u,_,l;return u=new Promise((g,M)=>{l=M,_=g,J().then(()=>{re(),te(),_()}).catch(()=>{l()})}),{promise:u,cancelPromise:()=>l()}};return m.useEffect(()=>{if(w.current&&P.setMapContainer(w.current),typeof ol<"u"){const u=G();return()=>u.cancelPromise()}else{const u=ne(Ge.map),_=()=>{G()};return u.addEventListener("load",_),()=>u.removeEventListener("load",_)}},[]),B("div",{ref:w,className:E||ze.map,style:C})}),Ze=m.forwardRef((s,f)=>B(He,{children:B(Xe,{ref:f,...s})}));D.NeshanMap=Ze,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+t+">.")}return r}}function Me(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=pr(r);if(Ie[t])return;Ie[t]=!0;var n="";e&&e._owner&&e._owner!==ue.current&&(n=" It was passed a child from "+l(e._owner.type)+"."),N(e),h('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),N(null)}}function Ne(e,r){{if(typeof e!="object")return;if(ie(e))for(var t=0;t<e.length;t++){var n=e[t];le(n)&&Me(n,r)}else if(le(e))e._store&&(e._store.validated=!0);else if(e){var i=$(e);if(typeof i=="function"&&i!==e.entries)for(var c=i.call(e),o;!(o=c.next()).done;)le(o.value)&&Me(o.value,r)}}}function vr(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===y||r.$$typeof===C))t=r.propTypes;else return;if(t){var n=l(r);er(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var i=l(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("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"){N(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),N(null);break}}e.ref!==null&&(N(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function Le(e,r,t,n,i,c){{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 b=dr(i);b?a+=b:a+=Fe();var d;e===null?d="null":ie(e)?d="array":e!==void 0&&e.$$typeof===f?(d="<"+(l(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,a)}var p=fr(e,r,t,i,c);if(p==null)return p;if(o){var T=r.children;if(T!==void 0)if(n)if(ie(T)){for(var L=0;L<T.length;L++)Ne(T[L],e);Object.freeze&&Object.freeze(T)}else h("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===R?mr(p):vr(p),p}}function yr(e,r,t){return Le(e,r,t,!0)}function hr(e,r,t){return Le(e,r,t,!1)}var _r=hr,gr=yr;Y.Fragment=R,Y.jsx=_r,Y.jsxs=gr}()),Y}(function(s){process.env.NODE_ENV==="production"?s.exports=Ve():s.exports=Be()})(Ye);const B=D.jsx,Er="",Ue={map:"_map_1yxt5_2","map-popup-container":"_map-popup-container_1yxt5_7",touch:"_touch_1yxt5_26","mobile-layers-button":"_mobile-layers-button_1yxt5_30",floaten:"_floaten_1yxt5_45",float:"_float_1yxt5_45"},pe=s=>s?s instanceof Object?[s.longitude,s.latitude]:s:void 0,ze=async()=>{try{const f=await new Promise((S,R)=>{navigator.geolocation.getCurrentPosition(v=>{S(v)},v=>R(v))});return f&&pe(f.coords)||Object.values(ve())}catch(s){console.error(s);const f=ve();return[f.longitude,f.latitude]}},ve=()=>({longitude:51.36281969540723,latitude:35.69672648316882}),Je={reverse:"https://api.neshan.org/v4/reverse",search:"https://api.neshan.org/v1/search",map:"https://static.neshan.org/sdk/openlayers/5.3.0/ol.js"},me=m.createContext({map:null,mapType:"neshan",mapContainer:null,setMap:s=>{},setMapType:s=>{},setMapContainer:s=>{}}),ye={map:null,mapType:"neshan",mapContainer:null},Ge=(s,f)=>{switch(f.type){case"SET_MAP":return{...s,map:f.payload};case"SET_MAP_TYPE":return{...s,title:f.payload};default:return ye}},Ke=s=>{const[f,S]=m.useReducer(Ge,ye),R={...f,setMap:v=>{S({type:"SET_MAP",payload:v})},setMapType:v=>{S({type:"SET_MAP_TYPE",payload:v})},setMapContainer:v=>{S({type:"SET_MAP_CONTAINER",payload:v})}};return B(me.Provider,{value:R,children:s.children})},He=m.forwardRef(({options:s,mapKey:f,serviceKey:S="",zoom:R=12,defaultType:v="neshan",scale:M,center:F,poi:O=!0,traffic:y=!0,onInit:j,className:E,style:C},k)=>{const P=m.useContext(me),w=m.useRef(null),[U,$]=m.useState(!1),[x,h]=m.useState(null),[he,q]=m.useState();m.useImperativeHandle(k,()=>({get mapContainer(){return w},get ol(){return typeof ol<"u"?ol:void 0},get map(){return P.map},get isInitiated(){return U}}),[U,P.map]);const z=()=>{var g,l;if(x)return x;const u=(l=(g=w.current)==null?void 0:g.querySelector(".ol-viewport"))==null?void 0:l.querySelectorAll("div:last-child");if(u)return h(Array.from(u)[u.length-1]),x},ee=()=>{const u=z();u==null||u.style.setProperty("scale",""+M)},re=()=>{const u=z();u==null||u.style.setProperty("bottom","0.2em"),u==null||u.style.setProperty("left","0.4em")},te=(u,g="my-openlayer")=>{const l=document.getElementById(g);if(l)return l;const _=document.createElement("script");return _.src=u,_.id=g,document.getElementsByTagName("head")[0].appendChild(_),_},J=async()=>{var _;if(!w.current)return;const u=pe(F);q(u);const g=u||await ze(),l=new ol.Map({target:w.current,key:f||"",mapType:v,poi:O,traffic:y,view:new ol.View({center:ol.proj.fromLonLat(g),zoom:R}),controls:[],...s});l.setMapType(v),P.setMap(l),(_=P.map)==null||_.setMapType(v),P.setMapType(v),$(!0),j&&j(ol,l)},G=()=>{let u,g,l;return u=new Promise((_,I)=>{l=I,g=_,J().then(()=>{ee(),re(),g()}).catch(()=>{l()})}),{promise:u,cancelPromise:()=>l()}};return m.useEffect(()=>{if(w.current&&P.setMapContainer(w.current),typeof ol<"u"){const u=G();return()=>u.cancelPromise()}else{const u=te(Je.map),g=()=>{G()};return u.addEventListener("load",g),()=>u.removeEventListener("load",g)}},[]),B("div",{ref:w,className:E||Ue.map,style:C})});return m.forwardRef((s,f)=>B(Ke,{children:B(He,{ref:f,...s})}))});
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
- declare function App(): JSX.Element;
3
- export default App;
1
+ /// <reference types="react" />
2
+ declare function App(): JSX.Element;
3
+ export default App;
@@ -1,3 +1,3 @@
1
- export declare interface Props {
2
- children: any;
3
- }
1
+ export declare interface Props {
2
+ children: any;
3
+ }