@wikicasa-dev/utilities 1.0.21 → 1.0.23

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./types-D0iZP-MN.cjs"),r=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,n=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),o=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=(t={sm:e.f.SMALL,md:e.f.MEDIUM,lg:e.f.LARGE,xl:e.f.EXTRA_LARGE})=>{const i=t;return window.innerWidth<i.sm?"mobile":window.innerWidth<i.lg?"tablet":"desktop"};exports.getCurrentDeviceSize=s;exports.isMobile=n;exports.isSafari=o;exports.isiOSDevice=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./types-D0iZP-MN.cjs"),n=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window?.MSStream,r=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator?.userAgent),o=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),s=()=>navigator?.userAgent.includes("Windows"),a=(t={sm:i.f.SMALL,md:i.f.MEDIUM,lg:i.f.LARGE,xl:i.f.EXTRA_LARGE})=>{const e=t;return window?.innerWidth<e.sm?"mobile":window?.innerWidth<e.lg?"tablet":"desktop"};exports.getCurrentDeviceSize=a;exports.isMobile=r;exports.isSafari=o;exports.isWindows=s;exports.isiOSDevice=n;
@@ -1,18 +1,19 @@
1
1
  import { f as i } from "./types-B0dZ7OiV.js";
2
- const n = () => /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, o = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
3
- navigator.userAgent
4
- ), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = (t = {
2
+ const r = () => /iPad|iPhone|iPod/.test(navigator.userAgent) && !window?.MSStream, o = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
3
+ navigator?.userAgent
4
+ ), s = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent), a = () => navigator?.userAgent.includes("Windows"), d = (n = {
5
5
  sm: i.SMALL,
6
6
  md: i.MEDIUM,
7
7
  lg: i.LARGE,
8
8
  xl: i.EXTRA_LARGE
9
9
  }) => {
10
- const e = t;
11
- return window.innerWidth < e.sm ? "mobile" : window.innerWidth < e.lg ? "tablet" : "desktop";
10
+ const e = n;
11
+ return window?.innerWidth < e.sm ? "mobile" : window?.innerWidth < e.lg ? "tablet" : "desktop";
12
12
  };
13
13
  export {
14
- a as getCurrentDeviceSize,
14
+ d as getCurrentDeviceSize,
15
15
  o as isMobile,
16
16
  s as isSafari,
17
- n as isiOSDevice
17
+ a as isWindows,
18
+ r as isiOSDevice
18
19
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("google-polyline");function i(t){if(!t)return;const n=t.match(/[-]?[\d]*[.]?[\d]+/g);if(!n)return;const e=[];for(let l=0;l<n.length;l++)e.push({lat:parseFloat(n[l+1]),lng:parseFloat(n[l])}),l++;return e}function c(t,n=!0){const e=[];t.forEach(o=>{e.push([o.lat,o.lng])});const l=r.encode(e);return n?encodeURIComponent(l):l}function g(t){const n={minY:t[0].lat,maxY:t[0].lat,minX:t[0].lng,maxX:t[0].lng};return t.forEach(e=>{n.minY=Math.min(n.minY,e.lat),n.maxY=Math.max(n.maxY,e.lat),n.minX=Math.min(n.minX,e.lng),n.maxX=Math.max(n.maxX,e.lng)}),n}function u(t){if(t.length<=0)return[];const n=new Set;return t.filter(l=>{const o=n.has(l.lat+l.lng),a=l.lat+l.lng;return n.add(a),!o})}function m(t){let n=0,e=0;for(let l=0;l<t.length;l++){const o=t[l];n+=o.lat,e+=o.lng}return{lat:n/t.length,lng:e/t.length}}function s(t){let n="POLYGON((";return t.forEach(e=>{n+=`${e.lng} ${e.lat}, `}),n+=`${t[0].lng} ${t[0].lat}))`,n}exports.calcPolygonCenter=m;exports.encodePolygon=c;exports.getMinMaxLatLng=g;exports.getPolygonString=s;exports.parsePoints=i;exports.removeDuplicatePoints=u;
@@ -0,0 +1,65 @@
1
+ import { encode as o } from "google-polyline";
2
+ function c(t) {
3
+ if (!t)
4
+ return;
5
+ const n = t.match(/[-]?[\d]*[.]?[\d]+/g);
6
+ if (!n)
7
+ return;
8
+ const e = [];
9
+ for (let l = 0; l < n.length; l++)
10
+ e.push({
11
+ lat: parseFloat(n[l + 1]),
12
+ lng: parseFloat(n[l])
13
+ }), l++;
14
+ return e;
15
+ }
16
+ function u(t, n = !0) {
17
+ const e = [];
18
+ t.forEach((a) => {
19
+ e.push([a.lat, a.lng]);
20
+ });
21
+ const l = o(e);
22
+ return n ? encodeURIComponent(l) : l;
23
+ }
24
+ function g(t) {
25
+ const n = {
26
+ minY: t[0].lat,
27
+ maxY: t[0].lat,
28
+ minX: t[0].lng,
29
+ maxX: t[0].lng
30
+ };
31
+ return t.forEach((e) => {
32
+ n.minY = Math.min(n.minY, e.lat), n.maxY = Math.max(n.maxY, e.lat), n.minX = Math.min(n.minX, e.lng), n.maxX = Math.max(n.maxX, e.lng);
33
+ }), n;
34
+ }
35
+ function m(t) {
36
+ if (t.length <= 0)
37
+ return [];
38
+ const n = /* @__PURE__ */ new Set();
39
+ return t.filter((l) => {
40
+ const a = n.has(l.lat + l.lng), r = l.lat + l.lng;
41
+ return n.add(r), !a;
42
+ });
43
+ }
44
+ function f(t) {
45
+ let n = 0, e = 0;
46
+ for (let l = 0; l < t.length; l++) {
47
+ const a = t[l];
48
+ n += a.lat, e += a.lng;
49
+ }
50
+ return { lat: n / t.length, lng: e / t.length };
51
+ }
52
+ function h(t) {
53
+ let n = "POLYGON((";
54
+ return t.forEach((e) => {
55
+ n += `${e.lng} ${e.lat}, `;
56
+ }), n += `${t[0].lng} ${t[0].lat}))`, n;
57
+ }
58
+ export {
59
+ f as calcPolygonCenter,
60
+ u as encodePolygon,
61
+ g as getMinMaxLatLng,
62
+ h as getPolygonString,
63
+ c as parsePoints,
64
+ m as removeDuplicatePoints
65
+ };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./ArrayUtils.cjs"),p=require("./ColorUtils.cjs"),i=require("./CookieUtils.cjs"),g=require("./CurrencyUtils.cjs"),l=require("./DateUtils.cjs"),s=require("./DeviceDetectionUtils.cjs"),a=require("./DOMUtils.cjs"),c=require("./EmailUtils.cjs"),E=require("./FunctionUtils.cjs"),u=require("./GenericUtils.cjs"),t=require("./NumberUtils.cjs"),r=require("./ObjectUtils.cjs"),A=require("./ObserverUtils.cjs"),m=require("./PermissionUtils.cjs"),n=require("./RESB_UrlBuilder.cjs"),o=require("./StringUtils.cjs"),C=require("./URLBuilderUtils.cjs"),e=require("./RegexUtils.cjs"),d=require("./GeolocationUtils.cjs"),b=require("./AdressUtils.cjs"),R=require("./GAutocompleteUtils.cjs"),S=require("./DownloadUtils.cjs");exports.isArrNullOrEmpty=O.isArrNullOrEmpty;exports.rgba=p.rgba;exports.decodeCookie=i.decodeCookie;exports.encodeCookie=i.encodeCookie;exports.getCookie=i.getCookie;exports.removeCookie=i.removeCookie;exports.formatCurrency=g.formatCurrency;exports.formatDate=l.formatDate;exports.formatDateToddMMYYYY=l.formatDateToddMMYYYY;exports.subtractDaysFromDate=l.subtractDaysFromDate;exports.getCurrentDeviceSize=s.getCurrentDeviceSize;exports.isMobile=s.isMobile;exports.isSafari=s.isSafari;exports.isiOSDevice=s.isiOSDevice;exports.emptyElem=a.emptyElem;exports.getSingleElement=a.getSingleElement;exports.hideElem=a.hideElem;exports.showElem=a.showElem;exports.hash256=c.hash256;exports.hashEmail=c.hashEmail;exports.debounce=E.debounce;exports.isPromise=E.isPromise;exports.awaitableSetTimeout=u.awaitableSetTimeout;exports.createCustomEvent=u.createCustomEvent;exports.formatFloat=t.formatFloat;exports.formatInteger=t.formatInteger;exports.formatLocaleNumber=t.formatLocaleNumber;exports.formatLocaleNumberAuto=t.formatLocaleNumberAuto;exports.formatNumber=t.formatNumber;exports.formatterNumberObj=t.formatterNumberObj;exports.parseLocaleNumber=t.parseLocaleNumber;exports.parseLocaleNumberAuto=t.parseLocaleNumberAuto;exports.deepCopy=r.deepCopy;exports.getOrNull=r.getOrNull;exports.invertFlatObject=r.invertFlatObject;exports.invertKeyToValue=r.invertKeyToValue;exports.isEmptyObject=r.isEmptyObject;exports.shallowCopyObjectTo=r.shallowCopyObjectTo;exports.observeOnce=A.observeOnce;exports.addPermissionStateListener=m.addPermissionStateListener;exports.onNotificationsPermissionChange=m.onNotificationsPermissionChange;exports.buildParams=n.buildParams;exports.buildParamsForAgency=n.buildParamsForAgency;exports.buildURL=n.buildURL;exports.capitalizeFirstLetter=o.capitalizeFirstLetter;exports.cleanASCII=o.cleanASCII;exports.decodeTextWithEntities=o.decodeTextWithEntities;exports.replaceAll=o.replaceAll;exports.replaceAllTokens=o.replaceAllTokens;exports.stringToHyphened=o.stringToHyphened;exports.appendQueryString=C.appendQueryString;exports.COMPETITOR_REGEX=e.COMPETITOR_REGEX;exports.DATE_REGEX=e.DATE_REGEX;exports.EMAIL_REGEX=e.EMAIL_REGEX;exports.EMAIL_REGEX_INTO_TEXT=e.EMAIL_REGEX_INTO_TEXT;exports.EXCLUDED_REGEX=e.EXCLUDED_REGEX;exports.GLOBAL_PHONE_REGEX=e.GLOBAL_PHONE_REGEX;exports.PASSWORD_REGEX=e.PASSWORD_REGEX;exports.PHONE_REGEX=e.PHONE_REGEX;exports.ROOMS_REGEX=e.ROOMS_REGEX;exports.SQM_REGEX=e.SQM_REGEX;exports.browserSupportGeolocation=d.browserSupportGeolocation;exports.getUserPosition=d.getUserPosition;exports.formatAddress=b.formatAddress;exports.formattedAddress=b.formattedAddress;exports.googlePlaceConverter=R.googlePlaceConverter;exports.downloadFile=S.downloadFile;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./ArrayUtils.cjs"),O=require("./ColorUtils.cjs"),a=require("./CookieUtils.cjs"),P=require("./CurrencyUtils.cjs"),n=require("./DateUtils.cjs"),s=require("./DeviceDetectionUtils.cjs"),l=require("./DOMUtils.cjs"),u=require("./EmailUtils.cjs"),E=require("./FunctionUtils.cjs"),m=require("./GenericUtils.cjs"),t=require("./NumberUtils.cjs"),r=require("./ObjectUtils.cjs"),C=require("./ObserverUtils.cjs"),d=require("./PermissionUtils.cjs"),c=require("./RESB_UrlBuilder.cjs"),o=require("./StringUtils.cjs"),y=require("./URLBuilderUtils.cjs"),e=require("./RegexUtils.cjs"),g=require("./GeolocationUtils.cjs"),b=require("./AdressUtils.cjs"),S=require("./GAutocompleteUtils.cjs"),A=require("./DownloadUtils.cjs"),i=require("./MapUtils.cjs");exports.isArrNullOrEmpty=p.isArrNullOrEmpty;exports.rgba=O.rgba;exports.decodeCookie=a.decodeCookie;exports.encodeCookie=a.encodeCookie;exports.getCookie=a.getCookie;exports.removeCookie=a.removeCookie;exports.formatCurrency=P.formatCurrency;exports.formatDate=n.formatDate;exports.formatDateToddMMYYYY=n.formatDateToddMMYYYY;exports.subtractDaysFromDate=n.subtractDaysFromDate;exports.getCurrentDeviceSize=s.getCurrentDeviceSize;exports.isMobile=s.isMobile;exports.isSafari=s.isSafari;exports.isWindows=s.isWindows;exports.isiOSDevice=s.isiOSDevice;exports.emptyElem=l.emptyElem;exports.getSingleElement=l.getSingleElement;exports.hideElem=l.hideElem;exports.showElem=l.showElem;exports.hash256=u.hash256;exports.hashEmail=u.hashEmail;exports.debounce=E.debounce;exports.isPromise=E.isPromise;exports.awaitableSetTimeout=m.awaitableSetTimeout;exports.createCustomEvent=m.createCustomEvent;exports.formatFloat=t.formatFloat;exports.formatInteger=t.formatInteger;exports.formatLocaleNumber=t.formatLocaleNumber;exports.formatLocaleNumberAuto=t.formatLocaleNumberAuto;exports.formatNumber=t.formatNumber;exports.formatterNumberObj=t.formatterNumberObj;exports.parseLocaleNumber=t.parseLocaleNumber;exports.parseLocaleNumberAuto=t.parseLocaleNumberAuto;exports.deepCopy=r.deepCopy;exports.getOrNull=r.getOrNull;exports.invertFlatObject=r.invertFlatObject;exports.invertKeyToValue=r.invertKeyToValue;exports.isEmptyObject=r.isEmptyObject;exports.shallowCopyObjectTo=r.shallowCopyObjectTo;exports.observeOnce=C.observeOnce;exports.addPermissionStateListener=d.addPermissionStateListener;exports.onNotificationsPermissionChange=d.onNotificationsPermissionChange;exports.buildParams=c.buildParams;exports.buildParamsForAgency=c.buildParamsForAgency;exports.buildURL=c.buildURL;exports.capitalizeFirstLetter=o.capitalizeFirstLetter;exports.cleanASCII=o.cleanASCII;exports.decodeTextWithEntities=o.decodeTextWithEntities;exports.replaceAll=o.replaceAll;exports.replaceAllTokens=o.replaceAllTokens;exports.stringToHyphened=o.stringToHyphened;exports.appendQueryString=y.appendQueryString;exports.COMPETITOR_REGEX=e.COMPETITOR_REGEX;exports.DATE_REGEX=e.DATE_REGEX;exports.EMAIL_REGEX=e.EMAIL_REGEX;exports.EMAIL_REGEX_INTO_TEXT=e.EMAIL_REGEX_INTO_TEXT;exports.EXCLUDED_REGEX=e.EXCLUDED_REGEX;exports.GLOBAL_PHONE_REGEX=e.GLOBAL_PHONE_REGEX;exports.PASSWORD_REGEX=e.PASSWORD_REGEX;exports.PHONE_REGEX=e.PHONE_REGEX;exports.ROOMS_REGEX=e.ROOMS_REGEX;exports.SQM_REGEX=e.SQM_REGEX;exports.browserSupportGeolocation=g.browserSupportGeolocation;exports.getUserPosition=g.getUserPosition;exports.formatAddress=b.formatAddress;exports.formattedAddress=b.formattedAddress;exports.googlePlaceConverter=S.googlePlaceConverter;exports.downloadFile=A.downloadFile;exports.calcPolygonCenter=i.calcPolygonCenter;exports.encodePolygon=i.encodePolygon;exports.getMinMaxLatLng=i.getMinMaxLatLng;exports.getPolygonString=i.getPolygonString;exports.parsePoints=i.parsePoints;exports.removeDuplicatePoints=i.removeDuplicatePoints;
package/dist/index.d.ts CHANGED
@@ -20,4 +20,5 @@ export * from './utils/GeolocationUtils';
20
20
  export * from './utils/AdressUtils';
21
21
  export * from './utils/GAutocompleteUtils';
22
22
  export * from './utils/DownloadUtils';
23
+ export * from './utils/MapUtils';
23
24
  export * from './types/ObjectUtilsTypes';
package/dist/index.js CHANGED
@@ -1,91 +1,99 @@
1
1
  import { isArrNullOrEmpty as r } from "./ArrayUtils.js";
2
- import { rgba as m } from "./ColorUtils.js";
3
- import { decodeCookie as i, encodeCookie as p, getCookie as E, removeCookie as l } from "./CookieUtils.js";
4
- import { formatCurrency as f } from "./CurrencyUtils.js";
2
+ import { rgba as a } from "./ColorUtils.js";
3
+ import { decodeCookie as i, encodeCookie as l, getCookie as p, removeCookie as s } from "./CookieUtils.js";
4
+ import { formatCurrency as E } from "./CurrencyUtils.js";
5
5
  import { formatDate as c, formatDateToddMMYYYY as d, subtractDaysFromDate as x } from "./DateUtils.js";
6
- import { getCurrentDeviceSize as b, isMobile as O, isSafari as g, isiOSDevice as A } from "./DeviceDetectionUtils.js";
7
- import { emptyElem as R, getSingleElement as S, hideElem as T, showElem as _ } from "./DOMUtils.js";
8
- import { hash256 as L, hashEmail as N } from "./EmailUtils.js";
9
- import { debounce as y, isPromise as P } from "./FunctionUtils.js";
10
- import { awaitableSetTimeout as D, createCustomEvent as v } from "./GenericUtils.js";
11
- import { formatFloat as I, formatInteger as F, formatLocaleNumber as k, formatLocaleNumberAuto as w, formatNumber as j, formatterNumberObj as Y, parseLocaleNumber as H, parseLocaleNumberAuto as U } from "./NumberUtils.js";
12
- import { deepCopy as Q, getOrNull as W, invertFlatObject as B, invertKeyToValue as K, isEmptyObject as V, shallowCopyObjectTo as q } from "./ObjectUtils.js";
13
- import { observeOnce as Z } from "./ObserverUtils.js";
14
- import { addPermissionStateListener as ee, onNotificationsPermissionChange as oe } from "./PermissionUtils.js";
15
- import { buildParams as te, buildParamsForAgency as me, buildURL as ae } from "./RESB_UrlBuilder.js";
16
- import { capitalizeFirstLetter as pe, cleanASCII as Ee, decodeTextWithEntities as le, replaceAll as se, replaceAllTokens as fe, stringToHyphened as ne } from "./StringUtils.js";
17
- import { appendQueryString as de } from "./URLBuilderUtils.js";
18
- import { COMPETITOR_REGEX as ue, DATE_REGEX as be, EMAIL_REGEX as Oe, EMAIL_REGEX_INTO_TEXT as ge, EXCLUDED_REGEX as Ae, GLOBAL_PHONE_REGEX as Ce, PASSWORD_REGEX as Re, PHONE_REGEX as Se, ROOMS_REGEX as Te, SQM_REGEX as _e } from "./RegexUtils.js";
19
- import { browserSupportGeolocation as Le, getUserPosition as Ne } from "./GeolocationUtils.js";
20
- import { formatAddress as ye, formattedAddress as Pe } from "./AdressUtils.js";
21
- import { googlePlaceConverter as De } from "./GAutocompleteUtils.js";
22
- import { downloadFile as Me } from "./DownloadUtils.js";
6
+ import { getCurrentDeviceSize as g, isMobile as b, isSafari as O, isWindows as P, isiOSDevice as C } from "./DeviceDetectionUtils.js";
7
+ import { emptyElem as A, getSingleElement as L, hideElem as R, showElem as S } from "./DOMUtils.js";
8
+ import { hash256 as _, hashEmail as G } from "./EmailUtils.js";
9
+ import { debounce as X, isPromise as D } from "./FunctionUtils.js";
10
+ import { awaitableSetTimeout as M, createCustomEvent as v } from "./GenericUtils.js";
11
+ import { formatFloat as w, formatInteger as F, formatLocaleNumber as k, formatLocaleNumberAuto as j, formatNumber as Y, formatterNumberObj as H, parseLocaleNumber as U, parseLocaleNumberAuto as W } from "./NumberUtils.js";
12
+ import { deepCopy as Q, getOrNull as B, invertFlatObject as K, invertKeyToValue as V, isEmptyObject as q, shallowCopyObjectTo as J } from "./ObjectUtils.js";
13
+ import { observeOnce as $ } from "./ObserverUtils.js";
14
+ import { addPermissionStateListener as oe, onNotificationsPermissionChange as re } from "./PermissionUtils.js";
15
+ import { buildParams as ae, buildParamsForAgency as me, buildURL as ie } from "./RESB_UrlBuilder.js";
16
+ import { capitalizeFirstLetter as pe, cleanASCII as se, decodeTextWithEntities as ne, replaceAll as Ee, replaceAllTokens as fe, stringToHyphened as ce } from "./StringUtils.js";
17
+ import { appendQueryString as xe } from "./URLBuilderUtils.js";
18
+ import { COMPETITOR_REGEX as ge, DATE_REGEX as be, EMAIL_REGEX as Oe, EMAIL_REGEX_INTO_TEXT as Pe, EXCLUDED_REGEX as Ce, GLOBAL_PHONE_REGEX as ye, PASSWORD_REGEX as Ae, PHONE_REGEX as Le, ROOMS_REGEX as Re, SQM_REGEX as Se } from "./RegexUtils.js";
19
+ import { browserSupportGeolocation as _e, getUserPosition as Ge } from "./GeolocationUtils.js";
20
+ import { formatAddress as Xe, formattedAddress as De } from "./AdressUtils.js";
21
+ import { googlePlaceConverter as Me } from "./GAutocompleteUtils.js";
22
+ import { downloadFile as Ie } from "./DownloadUtils.js";
23
+ import { calcPolygonCenter as Fe, encodePolygon as ke, getMinMaxLatLng as je, getPolygonString as Ye, parsePoints as He, removeDuplicatePoints as Ue } from "./MapUtils.js";
23
24
  export {
24
- ue as COMPETITOR_REGEX,
25
+ ge as COMPETITOR_REGEX,
25
26
  be as DATE_REGEX,
26
27
  Oe as EMAIL_REGEX,
27
- ge as EMAIL_REGEX_INTO_TEXT,
28
- Ae as EXCLUDED_REGEX,
29
- Ce as GLOBAL_PHONE_REGEX,
30
- Re as PASSWORD_REGEX,
31
- Se as PHONE_REGEX,
32
- Te as ROOMS_REGEX,
33
- _e as SQM_REGEX,
34
- ee as addPermissionStateListener,
35
- de as appendQueryString,
36
- D as awaitableSetTimeout,
37
- Le as browserSupportGeolocation,
38
- te as buildParams,
28
+ Pe as EMAIL_REGEX_INTO_TEXT,
29
+ Ce as EXCLUDED_REGEX,
30
+ ye as GLOBAL_PHONE_REGEX,
31
+ Ae as PASSWORD_REGEX,
32
+ Le as PHONE_REGEX,
33
+ Re as ROOMS_REGEX,
34
+ Se as SQM_REGEX,
35
+ oe as addPermissionStateListener,
36
+ xe as appendQueryString,
37
+ M as awaitableSetTimeout,
38
+ _e as browserSupportGeolocation,
39
+ ae as buildParams,
39
40
  me as buildParamsForAgency,
40
- ae as buildURL,
41
+ ie as buildURL,
42
+ Fe as calcPolygonCenter,
41
43
  pe as capitalizeFirstLetter,
42
- Ee as cleanASCII,
44
+ se as cleanASCII,
43
45
  v as createCustomEvent,
44
- y as debounce,
46
+ X as debounce,
45
47
  i as decodeCookie,
46
- le as decodeTextWithEntities,
48
+ ne as decodeTextWithEntities,
47
49
  Q as deepCopy,
48
- Me as downloadFile,
49
- R as emptyElem,
50
- p as encodeCookie,
51
- ye as formatAddress,
52
- f as formatCurrency,
50
+ Ie as downloadFile,
51
+ A as emptyElem,
52
+ l as encodeCookie,
53
+ ke as encodePolygon,
54
+ Xe as formatAddress,
55
+ E as formatCurrency,
53
56
  c as formatDate,
54
57
  d as formatDateToddMMYYYY,
55
- I as formatFloat,
58
+ w as formatFloat,
56
59
  F as formatInteger,
57
60
  k as formatLocaleNumber,
58
- w as formatLocaleNumberAuto,
59
- j as formatNumber,
60
- Pe as formattedAddress,
61
- Y as formatterNumberObj,
62
- E as getCookie,
63
- b as getCurrentDeviceSize,
64
- W as getOrNull,
65
- S as getSingleElement,
66
- Ne as getUserPosition,
67
- De as googlePlaceConverter,
68
- L as hash256,
69
- N as hashEmail,
70
- T as hideElem,
71
- B as invertFlatObject,
72
- K as invertKeyToValue,
61
+ j as formatLocaleNumberAuto,
62
+ Y as formatNumber,
63
+ De as formattedAddress,
64
+ H as formatterNumberObj,
65
+ p as getCookie,
66
+ g as getCurrentDeviceSize,
67
+ je as getMinMaxLatLng,
68
+ B as getOrNull,
69
+ Ye as getPolygonString,
70
+ L as getSingleElement,
71
+ Ge as getUserPosition,
72
+ Me as googlePlaceConverter,
73
+ _ as hash256,
74
+ G as hashEmail,
75
+ R as hideElem,
76
+ K as invertFlatObject,
77
+ V as invertKeyToValue,
73
78
  r as isArrNullOrEmpty,
74
- V as isEmptyObject,
75
- O as isMobile,
76
- P as isPromise,
77
- g as isSafari,
78
- A as isiOSDevice,
79
- Z as observeOnce,
80
- oe as onNotificationsPermissionChange,
81
- H as parseLocaleNumber,
82
- U as parseLocaleNumberAuto,
83
- l as removeCookie,
84
- se as replaceAll,
79
+ q as isEmptyObject,
80
+ b as isMobile,
81
+ D as isPromise,
82
+ O as isSafari,
83
+ P as isWindows,
84
+ C as isiOSDevice,
85
+ $ as observeOnce,
86
+ re as onNotificationsPermissionChange,
87
+ U as parseLocaleNumber,
88
+ W as parseLocaleNumberAuto,
89
+ He as parsePoints,
90
+ s as removeCookie,
91
+ Ue as removeDuplicatePoints,
92
+ Ee as replaceAll,
85
93
  fe as replaceAllTokens,
86
- m as rgba,
87
- q as shallowCopyObjectTo,
88
- _ as showElem,
89
- ne as stringToHyphened,
94
+ a as rgba,
95
+ J as shallowCopyObjectTo,
96
+ S as showElem,
97
+ ce as stringToHyphened,
90
98
  x as subtractDaysFromDate
91
99
  };
@@ -1 +1 @@
1
- export declare const isArrNullOrEmpty: (arrToCheck?: any[]) => boolean;
1
+ export declare const isArrNullOrEmpty: <T>(arrToCheck?: T[]) => boolean;
@@ -16,6 +16,7 @@ export declare const isMobile: () => boolean;
16
16
  * @returns {boolean} Returns true if the browser is Safari, false otherwise.
17
17
  */
18
18
  export declare const isSafari: () => boolean;
19
+ export declare const isWindows: () => boolean;
19
20
  type BreakpointType = {
20
21
  sm: number;
21
22
  md: number;
@@ -0,0 +1,17 @@
1
+ import { LatLng } from 'leaflet';
2
+
3
+ export declare function parsePoints(polygonFromMap: string): Array<LatLng> | undefined;
4
+ /**
5
+ * @param polygon An array of latitude and polygon that will be used to design an area in a map
6
+ * @param forUrl If true, the output string will be encoded as a URI so respecting the UTF-8 encoding
7
+ * */
8
+ export declare function encodePolygon(polygon: Array<LatLng>, forUrl?: boolean): string;
9
+ export declare function getMinMaxLatLng(polygon: Array<LatLng>): {
10
+ minY: number;
11
+ maxY: number;
12
+ minX: number;
13
+ maxX: number;
14
+ };
15
+ export declare function removeDuplicatePoints(latLngs: Array<LatLng>): Array<LatLng>;
16
+ export declare function calcPolygonCenter(points: Array<LatLng>): LatLng;
17
+ export declare function getPolygonString(shapePoints: Array<LatLng>): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/utilities",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Wikicasa frontend utilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",