@vehiclehistory/property-lib 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.d.ts +2 -0
- package/dist/property-ui-lib.js +695 -623
- package/dist/scripts/index.d.ts +3 -0
- package/package.json +1 -1
package/dist/property-ui-lib.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as i, jsxs as g, Fragment as
|
|
2
|
-
import { memo as A, useState as x, useEffect as
|
|
1
|
+
import { jsx as i, jsxs as g, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { memo as A, useState as x, useEffect as S } from "react";
|
|
3
3
|
const Z = {
|
|
4
4
|
xxSmall: "w-4 h-4",
|
|
5
5
|
xSmall: "w-5 h-5",
|
|
@@ -469,23 +469,23 @@ const Z = {
|
|
|
469
469
|
chatBubble: {
|
|
470
470
|
path: '<path d="M12,3C17.5,3 22,6.58 22,11C22,15.42 17.5,19 12,19C10.76,19 9.57,18.82 8.47,18.5C5.55,21 2,21 2,21C4.33,18.67 4.7,17.1 4.75,16.5C3.05,15.07 2,13.13 2,11C2,6.58 6.5,3 12,3Z" />'
|
|
471
471
|
}
|
|
472
|
-
},
|
|
472
|
+
}, D = (d) => N[d], O = ({
|
|
473
473
|
color: d = "text-current",
|
|
474
|
-
className:
|
|
475
|
-
name:
|
|
474
|
+
className: e,
|
|
475
|
+
name: t,
|
|
476
476
|
size: a = "medium",
|
|
477
477
|
viewBox: r = "0 0 20 20"
|
|
478
478
|
}) => {
|
|
479
|
-
const n =
|
|
480
|
-
return
|
|
479
|
+
const n = D(t), [s, l] = x(d), [o, c] = x(n);
|
|
480
|
+
return S(() => {
|
|
481
481
|
c(n);
|
|
482
|
-
}, [n]),
|
|
482
|
+
}, [n]), S(() => {
|
|
483
483
|
l(d);
|
|
484
|
-
}, [d]), !n && console.error("Icon does not exist",
|
|
484
|
+
}, [d]), !n && console.error("Icon does not exist", t), /* @__PURE__ */ i(
|
|
485
485
|
"svg",
|
|
486
486
|
{
|
|
487
487
|
xmlns: "http://www.w3.org/2000/svg",
|
|
488
|
-
className: `${Z[a]} fill-current flex-shrink-0 ${s}${
|
|
488
|
+
className: `${Z[a]} fill-current flex-shrink-0 ${s}${e ? ` ${e}` : ""}`,
|
|
489
489
|
style: { maxWidth: "4em" },
|
|
490
490
|
role: "presentation",
|
|
491
491
|
viewBox: r,
|
|
@@ -494,11 +494,11 @@ const Z = {
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
);
|
|
497
|
-
}, y = A(
|
|
497
|
+
}, y = A(O);
|
|
498
498
|
function T(d) {
|
|
499
499
|
return d && d.__esModule && Object.prototype.hasOwnProperty.call(d, "default") ? d.default : d;
|
|
500
500
|
}
|
|
501
|
-
var
|
|
501
|
+
var z = { exports: {} };
|
|
502
502
|
/*!
|
|
503
503
|
Copyright (c) 2018 Jed Watson.
|
|
504
504
|
Licensed under the MIT License (MIT), see
|
|
@@ -506,8 +506,8 @@ var S = { exports: {} };
|
|
|
506
506
|
*/
|
|
507
507
|
(function(d) {
|
|
508
508
|
(function() {
|
|
509
|
-
var
|
|
510
|
-
function
|
|
509
|
+
var e = {}.hasOwnProperty;
|
|
510
|
+
function t() {
|
|
511
511
|
for (var n = "", s = 0; s < arguments.length; s++) {
|
|
512
512
|
var l = arguments[s];
|
|
513
513
|
l && (n = r(n, a(l)));
|
|
@@ -520,32 +520,32 @@ var S = { exports: {} };
|
|
|
520
520
|
if (typeof n != "object")
|
|
521
521
|
return "";
|
|
522
522
|
if (Array.isArray(n))
|
|
523
|
-
return
|
|
523
|
+
return t.apply(null, n);
|
|
524
524
|
if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
|
|
525
525
|
return n.toString();
|
|
526
526
|
var s = "";
|
|
527
527
|
for (var l in n)
|
|
528
|
-
|
|
528
|
+
e.call(n, l) && n[l] && (s = r(s, l));
|
|
529
529
|
return s;
|
|
530
530
|
}
|
|
531
531
|
function r(n, s) {
|
|
532
532
|
return s ? n ? n + " " + s : n + s : n;
|
|
533
533
|
}
|
|
534
|
-
d.exports ? (
|
|
534
|
+
d.exports ? (t.default = t, d.exports = t) : window.classNames = t;
|
|
535
535
|
})();
|
|
536
|
-
})(
|
|
537
|
-
var E =
|
|
538
|
-
const V = /* @__PURE__ */ T(E),
|
|
536
|
+
})(z);
|
|
537
|
+
var E = z.exports;
|
|
538
|
+
const V = /* @__PURE__ */ T(E), j = ({
|
|
539
539
|
children: d,
|
|
540
|
-
className:
|
|
541
|
-
clickHandler:
|
|
540
|
+
className: e,
|
|
541
|
+
clickHandler: t,
|
|
542
542
|
panelClass: a,
|
|
543
543
|
title: r,
|
|
544
544
|
unmount: n = !0,
|
|
545
545
|
isOpen: s = !1
|
|
546
546
|
}) => {
|
|
547
547
|
const [l, o] = x(s);
|
|
548
|
-
return /* @__PURE__ */ i("div", { className: V("shadow rounded-lg",
|
|
548
|
+
return /* @__PURE__ */ i("div", { className: V("shadow rounded-lg", e), children: /* @__PURE__ */ g(k, { children: [
|
|
549
549
|
/* @__PURE__ */ g(
|
|
550
550
|
"button",
|
|
551
551
|
{
|
|
@@ -559,7 +559,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
559
559
|
),
|
|
560
560
|
title: r,
|
|
561
561
|
onClick: () => {
|
|
562
|
-
o(!l),
|
|
562
|
+
o(!l), t && t(!l);
|
|
563
563
|
},
|
|
564
564
|
children: [
|
|
565
565
|
/* @__PURE__ */ i("div", { className: "font-medium text-slate-700 sm-max:!text-base text-lg flex items-center", children: r }),
|
|
@@ -596,10 +596,10 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
596
596
|
}
|
|
597
597
|
)
|
|
598
598
|
] }) });
|
|
599
|
-
}, a1 = A(
|
|
599
|
+
}, a1 = A(j), F = ({
|
|
600
600
|
children: d,
|
|
601
|
-
className:
|
|
602
|
-
messages:
|
|
601
|
+
className: e = "",
|
|
602
|
+
messages: t = [],
|
|
603
603
|
title: a = "",
|
|
604
604
|
titleClass: r = "",
|
|
605
605
|
props: n = {},
|
|
@@ -634,7 +634,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
634
634
|
className: V(
|
|
635
635
|
"rounded w-full py-2 px-4 mb-4 border",
|
|
636
636
|
h,
|
|
637
|
-
|
|
637
|
+
e
|
|
638
638
|
),
|
|
639
639
|
...n,
|
|
640
640
|
children: /* @__PURE__ */ g("div", { className: "flex", children: [
|
|
@@ -649,15 +649,15 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
649
649
|
) }),
|
|
650
650
|
/* @__PURE__ */ g("div", { className: "ml-3", children: [
|
|
651
651
|
/* @__PURE__ */ i("div", { className: V("font-medium text-sm", r), children: a }),
|
|
652
|
-
|
|
652
|
+
t.length > 0 ? /* @__PURE__ */ i("div", { className: "mt-2 text-xs", children: /* @__PURE__ */ i("ul", { role: "list", className: "list-disc space-y-1 pl-5", children: t.map((p, M) => /* @__PURE__ */ i("li", { children: p }, M)) }) }) : ""
|
|
653
653
|
] })
|
|
654
654
|
] })
|
|
655
655
|
}
|
|
656
656
|
);
|
|
657
|
-
}, n1 = A(
|
|
657
|
+
}, n1 = A(F), r1 = ({
|
|
658
658
|
autoFocus: d = !1,
|
|
659
|
-
required:
|
|
660
|
-
className:
|
|
659
|
+
required: e = !1,
|
|
660
|
+
className: t = "",
|
|
661
661
|
defaultValue: a = "",
|
|
662
662
|
id: r = "",
|
|
663
663
|
type: n,
|
|
@@ -679,7 +679,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
679
679
|
id: r,
|
|
680
680
|
"data-search": "container",
|
|
681
681
|
"data-search-type": n,
|
|
682
|
-
className: V("Autocomplete",
|
|
682
|
+
className: V("Autocomplete", t),
|
|
683
683
|
style: u ? { ...u } : null,
|
|
684
684
|
children: [
|
|
685
685
|
h && /* @__PURE__ */ g(
|
|
@@ -729,7 +729,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
729
729
|
},
|
|
730
730
|
l
|
|
731
731
|
),
|
|
732
|
-
required:
|
|
732
|
+
required: e,
|
|
733
733
|
autoComplete: "off",
|
|
734
734
|
value: a,
|
|
735
735
|
placeholder: !v && s ? " " : v,
|
|
@@ -822,8 +822,8 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
822
822
|
}
|
|
823
823
|
), l1 = ({
|
|
824
824
|
children: d,
|
|
825
|
-
className:
|
|
826
|
-
size:
|
|
825
|
+
className: e = "",
|
|
826
|
+
size: t = "sm",
|
|
827
827
|
tag: a = "span"
|
|
828
828
|
}) => /* @__PURE__ */ i(
|
|
829
829
|
a || "span",
|
|
@@ -831,18 +831,18 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
831
831
|
className: V(
|
|
832
832
|
" bg-gray-200 font-semibold py-1 px-2 rounded-md",
|
|
833
833
|
{
|
|
834
|
-
"text-sm":
|
|
835
|
-
"text-xs":
|
|
836
|
-
"text-xxs !py-0.5 !px-1.5":
|
|
834
|
+
"text-sm": t === "sm",
|
|
835
|
+
"text-xs": t === "xs",
|
|
836
|
+
"text-xxs !py-0.5 !px-1.5": t === "xxs"
|
|
837
837
|
},
|
|
838
|
-
|
|
838
|
+
e
|
|
839
839
|
),
|
|
840
840
|
children: d
|
|
841
841
|
}
|
|
842
|
-
),
|
|
842
|
+
), q = ({
|
|
843
843
|
children: d,
|
|
844
|
-
className:
|
|
845
|
-
disabled:
|
|
844
|
+
className: e = "",
|
|
845
|
+
disabled: t = !1,
|
|
846
846
|
href: a,
|
|
847
847
|
props: r = {},
|
|
848
848
|
rounded: n = !1,
|
|
@@ -863,22 +863,22 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
863
863
|
"Button--rounded": n,
|
|
864
864
|
"Button--icon": o === "icon",
|
|
865
865
|
"Button--link": o === "link",
|
|
866
|
-
"Button--disabled":
|
|
866
|
+
"Button--disabled": t,
|
|
867
867
|
"custom-link": a
|
|
868
868
|
},
|
|
869
869
|
l,
|
|
870
|
-
|
|
870
|
+
e
|
|
871
871
|
),
|
|
872
|
-
disabled:
|
|
872
|
+
disabled: t,
|
|
873
873
|
href: a,
|
|
874
874
|
...r,
|
|
875
875
|
children: d
|
|
876
876
|
}
|
|
877
877
|
);
|
|
878
|
-
}, s1 = A(
|
|
878
|
+
}, s1 = A(q), i1 = ({ children: d, className: e }) => /* @__PURE__ */ i("div", { className: V("flex md:max-w-min border border-gray-300 divide-x divide-gray-200 rounded-lg", e), children: d }), o1 = ({
|
|
879
879
|
block: d = !1,
|
|
880
|
-
borderless:
|
|
881
|
-
children:
|
|
880
|
+
borderless: e = !1,
|
|
881
|
+
children: t,
|
|
882
882
|
className: a = "",
|
|
883
883
|
divider: r = !0,
|
|
884
884
|
inset: n = !0,
|
|
@@ -890,7 +890,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
890
890
|
className: V(
|
|
891
891
|
"bg-white",
|
|
892
892
|
{
|
|
893
|
-
f1: !
|
|
893
|
+
f1: !e,
|
|
894
894
|
f2: d,
|
|
895
895
|
f3: r,
|
|
896
896
|
f4: n
|
|
@@ -899,12 +899,12 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
899
899
|
),
|
|
900
900
|
id: s,
|
|
901
901
|
role: l,
|
|
902
|
-
children:
|
|
902
|
+
children: t
|
|
903
903
|
}
|
|
904
|
-
),
|
|
904
|
+
), B = ({
|
|
905
905
|
checked: d = !1,
|
|
906
|
-
children:
|
|
907
|
-
className:
|
|
906
|
+
children: e,
|
|
907
|
+
className: t = "",
|
|
908
908
|
error: a = !1,
|
|
909
909
|
id: r = "",
|
|
910
910
|
label: n = "",
|
|
@@ -917,7 +917,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
917
917
|
return /* @__PURE__ */ g(
|
|
918
918
|
h,
|
|
919
919
|
{
|
|
920
|
-
className: V("checkbox flex items-center", o,
|
|
920
|
+
className: V("checkbox flex items-center", o, t),
|
|
921
921
|
...p,
|
|
922
922
|
children: [
|
|
923
923
|
/* @__PURE__ */ i(
|
|
@@ -934,18 +934,18 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
934
934
|
...l
|
|
935
935
|
}
|
|
936
936
|
),
|
|
937
|
-
|
|
937
|
+
e
|
|
938
938
|
]
|
|
939
939
|
}
|
|
940
940
|
);
|
|
941
|
-
}, c1 = A(
|
|
941
|
+
}, c1 = A(B), I = ({ children: d, aside: e, direction: t = "right" }) => /* @__PURE__ */ g("div", { className: "flex flex-col lg:flex-row lg:p-0 max-w-screen-lg", children: [
|
|
942
942
|
/* @__PURE__ */ i(
|
|
943
943
|
"main",
|
|
944
944
|
{
|
|
945
945
|
className: V(
|
|
946
946
|
"w-full md:mb-0 flex-1 md:block lg:max-w-container",
|
|
947
947
|
{
|
|
948
|
-
"lg:order-2":
|
|
948
|
+
"lg:order-2": t === "left"
|
|
949
949
|
}
|
|
950
950
|
),
|
|
951
951
|
children: d
|
|
@@ -957,17 +957,17 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
957
957
|
className: V(
|
|
958
958
|
"sm-max:hidden md:hidden lg:block flex-1 max-w-aside mb-6 md:mb-0 empty:!hidden",
|
|
959
959
|
{
|
|
960
|
-
"md:ml-8":
|
|
961
|
-
"md:mr-8":
|
|
960
|
+
"md:ml-8": t === "right",
|
|
961
|
+
"md:mr-8": t === "left"
|
|
962
962
|
}
|
|
963
963
|
),
|
|
964
|
-
children:
|
|
964
|
+
children: e
|
|
965
965
|
}
|
|
966
966
|
)
|
|
967
967
|
] }), d1 = A(I), $ = ({
|
|
968
968
|
activator: d,
|
|
969
|
-
id:
|
|
970
|
-
children:
|
|
969
|
+
id: e = "",
|
|
970
|
+
children: t,
|
|
971
971
|
className: a = "",
|
|
972
972
|
contentClass: r = "",
|
|
973
973
|
dark: n = !1,
|
|
@@ -980,13 +980,13 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
980
980
|
stickyHeader: M = !1,
|
|
981
981
|
title: v = "",
|
|
982
982
|
titleClass: b = ""
|
|
983
|
-
}) => /* @__PURE__ */ g(
|
|
984
|
-
d && /* @__PURE__ */ i("span", { id: `${
|
|
983
|
+
}) => /* @__PURE__ */ g(k, { children: [
|
|
984
|
+
d && /* @__PURE__ */ i("span", { id: `${e}-dialog-activator`, children: d }),
|
|
985
985
|
/* @__PURE__ */ i(
|
|
986
986
|
"dialog",
|
|
987
987
|
{
|
|
988
988
|
inert: "",
|
|
989
|
-
id: `${
|
|
989
|
+
id: `${e}-dialog`,
|
|
990
990
|
className: V(
|
|
991
991
|
"dialog",
|
|
992
992
|
{
|
|
@@ -1010,7 +1010,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1010
1010
|
o
|
|
1011
1011
|
),
|
|
1012
1012
|
children: [
|
|
1013
|
-
v && /* @__PURE__ */ i("h3", { id: `${
|
|
1013
|
+
v && /* @__PURE__ */ i("h3", { id: `${e}-dialog-title`, className: b, children: v }),
|
|
1014
1014
|
!c && /* @__PURE__ */ i(
|
|
1015
1015
|
"button",
|
|
1016
1016
|
{
|
|
@@ -1035,12 +1035,12 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1035
1035
|
/* @__PURE__ */ i(
|
|
1036
1036
|
"div",
|
|
1037
1037
|
{
|
|
1038
|
-
id: `${
|
|
1038
|
+
id: `${e}-dialog-content`,
|
|
1039
1039
|
className: V("dialog-content", r),
|
|
1040
|
-
children:
|
|
1040
|
+
children: t
|
|
1041
1041
|
}
|
|
1042
1042
|
),
|
|
1043
|
-
s && /* @__PURE__ */ i("footer", { id: `${
|
|
1043
|
+
s && /* @__PURE__ */ i("footer", { id: `${e}-dialog-footer`, className: "dialog-footer", children: s })
|
|
1044
1044
|
] })
|
|
1045
1045
|
}
|
|
1046
1046
|
)
|
|
@@ -1053,7 +1053,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1053
1053
|
/* @__PURE__ */ i("span", { style: { animationDelay: "0.6s" } }),
|
|
1054
1054
|
/* @__PURE__ */ i("span", { style: { animationDelay: "0.7s" } }),
|
|
1055
1055
|
/* @__PURE__ */ i("span", { style: { animationDelay: "0.8s" } })
|
|
1056
|
-
] }), P = ({ cb: d, className:
|
|
1056
|
+
] }), P = ({ cb: d, className: e = "", timeout: t = 1e4 }) => {
|
|
1057
1057
|
function a({ cb: r }) {
|
|
1058
1058
|
const n = document.querySelector(".bar");
|
|
1059
1059
|
if (!n) return;
|
|
@@ -1062,31 +1062,31 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1062
1062
|
s === void 0 && (s = h);
|
|
1063
1063
|
const p = h - s;
|
|
1064
1064
|
if (l !== h) {
|
|
1065
|
-
const M = p /
|
|
1065
|
+
const M = p / t * 101;
|
|
1066
1066
|
n.style.transition = `width ${M}ms ease-out`, n.style.width = `${M}%`, M >= 101 && (r && r(), o = !0, window.cancelAnimationFrame(h));
|
|
1067
1067
|
}
|
|
1068
|
-
p <
|
|
1068
|
+
p < t && (l = h, o || window.requestAnimationFrame(c));
|
|
1069
1069
|
}
|
|
1070
1070
|
window.requestAnimationFrame(c);
|
|
1071
1071
|
}
|
|
1072
|
-
return
|
|
1072
|
+
return S(() => {
|
|
1073
1073
|
a({ cb: d });
|
|
1074
|
-
}, []), /* @__PURE__ */ i("div", { className: V("progress-bar my-8",
|
|
1074
|
+
}, []), /* @__PURE__ */ i("div", { className: V("progress-bar my-8", e), children: /* @__PURE__ */ i("div", { className: "bar", "data-size": "100" }) });
|
|
1075
1075
|
}, p1 = A(P), R = {
|
|
1076
1076
|
name: "spinnerDark",
|
|
1077
1077
|
color: "text-teal-700",
|
|
1078
1078
|
viewBox: "0 0 24 24"
|
|
1079
|
-
},
|
|
1079
|
+
}, U = ({ className: d = "" }) => /* @__PURE__ */ i("div", { className: "rounded-r-md px-2 focus:outline-none", children: /* @__PURE__ */ i(
|
|
1080
1080
|
y,
|
|
1081
1081
|
{
|
|
1082
1082
|
size: "xSmall",
|
|
1083
1083
|
...R,
|
|
1084
1084
|
className: `animate-spin ${d}`
|
|
1085
1085
|
}
|
|
1086
|
-
) }), V1 = A(
|
|
1086
|
+
) }), V1 = A(U), m1 = ({
|
|
1087
1087
|
activator: d,
|
|
1088
|
-
activatorClass:
|
|
1089
|
-
attrs:
|
|
1088
|
+
activatorClass: e = "",
|
|
1089
|
+
attrs: t = {},
|
|
1090
1090
|
options: a = {},
|
|
1091
1091
|
children: r,
|
|
1092
1092
|
className: n = "",
|
|
@@ -1094,7 +1094,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1094
1094
|
disabled: l = !1,
|
|
1095
1095
|
id: o = "",
|
|
1096
1096
|
trigger: c = "click"
|
|
1097
|
-
}) => /* @__PURE__ */ g(
|
|
1097
|
+
}) => /* @__PURE__ */ g(k, { children: [
|
|
1098
1098
|
/* @__PURE__ */ i(
|
|
1099
1099
|
"div",
|
|
1100
1100
|
{
|
|
@@ -1127,17 +1127,17 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1127
1127
|
"popover-activator",
|
|
1128
1128
|
`trigger-${c}`,
|
|
1129
1129
|
l ? "is-disabled" : "",
|
|
1130
|
-
|
|
1130
|
+
e
|
|
1131
1131
|
),
|
|
1132
|
-
...
|
|
1132
|
+
...t,
|
|
1133
1133
|
"data-options": JSON.stringify(a),
|
|
1134
1134
|
children: d
|
|
1135
1135
|
}
|
|
1136
1136
|
)
|
|
1137
|
-
] }),
|
|
1137
|
+
] }), Q = ({
|
|
1138
1138
|
ariaValuemax: d = 100,
|
|
1139
|
-
ariaValuemin:
|
|
1140
|
-
bgColor:
|
|
1139
|
+
ariaValuemin: e = 0,
|
|
1140
|
+
bgColor: t = "bg-orange-500",
|
|
1141
1141
|
className: a,
|
|
1142
1142
|
completed: r = 0,
|
|
1143
1143
|
maxCompleted: n = 100,
|
|
@@ -1162,14 +1162,14 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1162
1162
|
role: "progressbar",
|
|
1163
1163
|
"aria-label": "Progress Bar",
|
|
1164
1164
|
"aria-valuenow": r,
|
|
1165
|
-
"aria-valuemin":
|
|
1165
|
+
"aria-valuemin": e,
|
|
1166
1166
|
"aria-valuemax": d,
|
|
1167
1167
|
children: /* @__PURE__ */ i(
|
|
1168
1168
|
"div",
|
|
1169
1169
|
{
|
|
1170
1170
|
className: V(
|
|
1171
1171
|
"h-full text-right flex items-center justify-end rounded-full",
|
|
1172
|
-
|
|
1172
|
+
t
|
|
1173
1173
|
),
|
|
1174
1174
|
style: { width: `${c}%` },
|
|
1175
1175
|
children: l && /* @__PURE__ */ i("span", { className: "font-bold text-white text-xs mr-2", children: Math.round(c) })
|
|
@@ -1177,10 +1177,10 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1177
1177
|
)
|
|
1178
1178
|
}
|
|
1179
1179
|
);
|
|
1180
|
-
}, H1 = A(
|
|
1180
|
+
}, H1 = A(Q), W = ({
|
|
1181
1181
|
checked: d = !1,
|
|
1182
|
-
children:
|
|
1183
|
-
className:
|
|
1182
|
+
children: e,
|
|
1183
|
+
className: t = "",
|
|
1184
1184
|
id: a = "",
|
|
1185
1185
|
label: r = "",
|
|
1186
1186
|
name: n = "",
|
|
@@ -1192,7 +1192,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1192
1192
|
return /* @__PURE__ */ g(
|
|
1193
1193
|
c,
|
|
1194
1194
|
{
|
|
1195
|
-
className: V("radio flex items-center",
|
|
1195
|
+
className: V("radio flex items-center", t),
|
|
1196
1196
|
...h,
|
|
1197
1197
|
children: [
|
|
1198
1198
|
/* @__PURE__ */ i(
|
|
@@ -1212,14 +1212,14 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1212
1212
|
...s
|
|
1213
1213
|
}
|
|
1214
1214
|
),
|
|
1215
|
-
|
|
1215
|
+
e
|
|
1216
1216
|
]
|
|
1217
1217
|
}
|
|
1218
1218
|
);
|
|
1219
|
-
},
|
|
1219
|
+
}, L1 = A(W), J = ({
|
|
1220
1220
|
children: d,
|
|
1221
|
-
className:
|
|
1222
|
-
error:
|
|
1221
|
+
className: e = "",
|
|
1222
|
+
error: t = !1,
|
|
1223
1223
|
errorMessage: a = "",
|
|
1224
1224
|
id: r = "",
|
|
1225
1225
|
label: n = "",
|
|
@@ -1236,7 +1236,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1236
1236
|
return /* @__PURE__ */ g(
|
|
1237
1237
|
"label",
|
|
1238
1238
|
{
|
|
1239
|
-
className: V("relative select",
|
|
1239
|
+
className: V("relative select", e, M),
|
|
1240
1240
|
style: p ? { ...p } : null,
|
|
1241
1241
|
children: [
|
|
1242
1242
|
n,
|
|
@@ -1245,7 +1245,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1245
1245
|
{
|
|
1246
1246
|
className: V(
|
|
1247
1247
|
"form-select relative bg-white pl-3 pr-10 text-left cursor-default",
|
|
1248
|
-
|
|
1248
|
+
t ? "!border-red-500 !bg-red-500/10 !text-red-700 focus:!ring-red-500 focus:!border-red-500" : "",
|
|
1249
1249
|
h
|
|
1250
1250
|
),
|
|
1251
1251
|
id: r,
|
|
@@ -1270,7 +1270,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1270
1270
|
]
|
|
1271
1271
|
}
|
|
1272
1272
|
);
|
|
1273
|
-
},
|
|
1273
|
+
}, C1 = A(J), G = ({ className: d = "" }) => /* @__PURE__ */ g(
|
|
1274
1274
|
"div",
|
|
1275
1275
|
{
|
|
1276
1276
|
className: V(
|
|
@@ -1282,17 +1282,17 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1282
1282
|
/* @__PURE__ */ i("span", { className: "sr-only", children: "Loading..." })
|
|
1283
1283
|
]
|
|
1284
1284
|
}
|
|
1285
|
-
), M1 = A(
|
|
1285
|
+
), M1 = A(G), K = ({
|
|
1286
1286
|
placeholderClass: d = "",
|
|
1287
|
-
children:
|
|
1288
|
-
className:
|
|
1287
|
+
children: e,
|
|
1288
|
+
className: t = "",
|
|
1289
1289
|
id: a = 1,
|
|
1290
1290
|
padding: r = !0,
|
|
1291
1291
|
sliderName: n = ""
|
|
1292
1292
|
}) => /* @__PURE__ */ g(
|
|
1293
1293
|
"div",
|
|
1294
1294
|
{
|
|
1295
|
-
className: `slider relative overflow-hidden ${
|
|
1295
|
+
className: `slider relative overflow-hidden ${t}`,
|
|
1296
1296
|
id: `slider-${a}`,
|
|
1297
1297
|
children: [
|
|
1298
1298
|
/* @__PURE__ */ i(
|
|
@@ -1314,7 +1314,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1314
1314
|
"div",
|
|
1315
1315
|
{
|
|
1316
1316
|
className: `card-ph slider-card bg-gray-200 animate-pulse ${d}`,
|
|
1317
|
-
children: /* @__PURE__ */ i("div", { className: `slider-card-action ${r ? "p-4" : ""}`, children:
|
|
1317
|
+
children: /* @__PURE__ */ i("div", { className: `slider-card-action ${r ? "p-4" : ""}`, children: e })
|
|
1318
1318
|
},
|
|
1319
1319
|
l
|
|
1320
1320
|
))
|
|
@@ -1335,10 +1335,10 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1335
1335
|
}
|
|
1336
1336
|
), f1 = A(K), g1 = ({
|
|
1337
1337
|
className: d = "",
|
|
1338
|
-
value:
|
|
1338
|
+
value: e
|
|
1339
1339
|
}) => {
|
|
1340
|
-
const
|
|
1341
|
-
"--value": `calc(${
|
|
1340
|
+
const t = {
|
|
1341
|
+
"--value": `calc(${e} / 5 * 100%)`
|
|
1342
1342
|
};
|
|
1343
1343
|
return /* @__PURE__ */ i(
|
|
1344
1344
|
"div",
|
|
@@ -1347,13 +1347,13 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1347
1347
|
'Stars inline-block leading-none font-sans text-base before:content-["★★★★★"]',
|
|
1348
1348
|
d
|
|
1349
1349
|
),
|
|
1350
|
-
style:
|
|
1350
|
+
style: t
|
|
1351
1351
|
}
|
|
1352
1352
|
);
|
|
1353
1353
|
}, Y = ({
|
|
1354
1354
|
className: d = "",
|
|
1355
|
-
clear:
|
|
1356
|
-
error:
|
|
1355
|
+
clear: e = !1,
|
|
1356
|
+
error: t = !1,
|
|
1357
1357
|
errorMessage: a = "",
|
|
1358
1358
|
id: r = "",
|
|
1359
1359
|
inputClass: n = "",
|
|
@@ -1372,14 +1372,14 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1372
1372
|
rows: c,
|
|
1373
1373
|
className: V(
|
|
1374
1374
|
"form-textarea min-h-[40px] pl-4",
|
|
1375
|
-
|
|
1376
|
-
|
|
1375
|
+
e ? "pr-10" : "pr-4",
|
|
1376
|
+
t ? "!border-red-500 !bg-red-500/10 placeholder:!text-red-700 focus:!ring-red-500 focus:!border-red-500" : "",
|
|
1377
1377
|
n
|
|
1378
1378
|
),
|
|
1379
1379
|
...o
|
|
1380
1380
|
}
|
|
1381
1381
|
),
|
|
1382
|
-
|
|
1382
|
+
e && /* @__PURE__ */ i(
|
|
1383
1383
|
"div",
|
|
1384
1384
|
{
|
|
1385
1385
|
id: `${r}-clear`,
|
|
@@ -1397,8 +1397,8 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1397
1397
|
a && /* @__PURE__ */ i("span", { className: "relative flex mt-0.5 text-red-700 text-xs text-left", children: a })
|
|
1398
1398
|
] }), v1 = A(Y), X = ({
|
|
1399
1399
|
className: d = "",
|
|
1400
|
-
clear:
|
|
1401
|
-
error:
|
|
1400
|
+
clear: e = !1,
|
|
1401
|
+
error: t = !1,
|
|
1402
1402
|
errorMessage: a = "",
|
|
1403
1403
|
iconLeft: r = "",
|
|
1404
1404
|
id: n = "",
|
|
@@ -1436,10 +1436,10 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1436
1436
|
autoComplete: "off",
|
|
1437
1437
|
className: V(
|
|
1438
1438
|
"form-input",
|
|
1439
|
-
|
|
1439
|
+
e ? "pr-10" : "pr-4",
|
|
1440
1440
|
r ? "pl-8" : "pl-4",
|
|
1441
1441
|
{
|
|
1442
|
-
"!border-red-500 !bg-red-500/10 placeholder:!text-red-700 focus:!ring-red-500 focus:!border-red-500":
|
|
1442
|
+
"!border-red-500 !bg-red-500/10 placeholder:!text-red-700 focus:!ring-red-500 focus:!border-red-500": t
|
|
1443
1443
|
},
|
|
1444
1444
|
c.inputClass ?? "",
|
|
1445
1445
|
s
|
|
@@ -1447,7 +1447,7 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1447
1447
|
...c
|
|
1448
1448
|
}
|
|
1449
1449
|
),
|
|
1450
|
-
|
|
1450
|
+
e && /* @__PURE__ */ i(
|
|
1451
1451
|
"div",
|
|
1452
1452
|
{
|
|
1453
1453
|
id: `${n}-clear`,
|
|
@@ -1467,167 +1467,40 @@ const V = /* @__PURE__ */ T(E), F = ({
|
|
|
1467
1467
|
}
|
|
1468
1468
|
), A1 = A(X);
|
|
1469
1469
|
class m {
|
|
1470
|
-
static
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
} = navigator || {}, n = (a == null ? void 0 : a.platform) ?? r, s = {
|
|
1476
|
-
tolken: null,
|
|
1477
|
-
ip: null,
|
|
1478
|
-
userAgent: e,
|
|
1479
|
-
platform: n
|
|
1480
|
-
};
|
|
1481
|
-
if (options && options.isBot || typeof window.localStorage > "u")
|
|
1482
|
-
return s;
|
|
1483
|
-
const l = localStorage.getItem("headerTolken");
|
|
1484
|
-
if (l) {
|
|
1485
|
-
const o = JSON.parse(l), c = (/* @__PURE__ */ new Date()).getTime();
|
|
1486
|
-
return o.expire - c < 0 && localStorage.removeItem("headerTolken"), {
|
|
1487
|
-
tolken: o.tolken,
|
|
1488
|
-
ip: o.ip,
|
|
1489
|
-
userAgent: e,
|
|
1490
|
-
platform: n
|
|
1491
|
-
};
|
|
1492
|
-
}
|
|
1493
|
-
try {
|
|
1494
|
-
const c = await (await fetch("/api/headers")).json(), h = (c == null ? void 0 : c.token) ?? null, p = (c == null ? void 0 : c.ip) ?? null;
|
|
1495
|
-
return localStorage.setItem(
|
|
1496
|
-
"headerTolken",
|
|
1497
|
-
JSON.stringify({
|
|
1498
|
-
tolken: h,
|
|
1499
|
-
ip: p,
|
|
1500
|
-
expire: (/* @__PURE__ */ new Date()).getTime() + t * 1e3
|
|
1501
|
-
})
|
|
1502
|
-
), { tolken: h, ip: p, userAgent: e, platform: n };
|
|
1503
|
-
} catch (o) {
|
|
1504
|
-
console.error("getHeaders", o);
|
|
1505
|
-
}
|
|
1506
|
-
return s;
|
|
1507
|
-
}
|
|
1508
|
-
static elementScrollTop() {
|
|
1509
|
-
setTimeout(() => {
|
|
1510
|
-
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
1511
|
-
}, 100);
|
|
1512
|
-
}
|
|
1513
|
-
static async getUserHistory(t = null) {
|
|
1514
|
-
const { uuid: e = null } = t ?? {};
|
|
1515
|
-
if (!e)
|
|
1516
|
-
return { data: null };
|
|
1517
|
-
const a = JSON.stringify({
|
|
1518
|
-
limit: 1,
|
|
1519
|
-
where: {
|
|
1520
|
-
uuid: e
|
|
1521
|
-
}
|
|
1522
|
-
});
|
|
1523
|
-
return await m.makeSearchFetchCall(
|
|
1524
|
-
`/api/client?query=user-get-history&filter=${a}`
|
|
1525
|
-
);
|
|
1526
|
-
}
|
|
1527
|
-
static async performSearch(t = null, e = {}) {
|
|
1528
|
-
if (!t)
|
|
1529
|
-
return [];
|
|
1530
|
-
if (1 > t.trim().length)
|
|
1531
|
-
return [];
|
|
1532
|
-
const {
|
|
1533
|
-
addressesOnly: a = !1,
|
|
1534
|
-
useCitySearch: r = !1,
|
|
1535
|
-
useCityStateSearch: n = !1,
|
|
1536
|
-
useSearch: s = !1,
|
|
1537
|
-
useLocation: l = !0,
|
|
1538
|
-
state: o = ""
|
|
1539
|
-
} = e ?? {}, { tolken: c = null, ip: h = null } = await m.getHeaders(), M = [
|
|
1540
|
-
"query=" + encodeURIComponent(this.cleanupAddress(t)),
|
|
1541
|
-
"addressesOnly=" + a,
|
|
1542
|
-
"useSearch=" + s,
|
|
1543
|
-
"useCitySearch=" + r,
|
|
1544
|
-
"useCityStateSearch=" + n,
|
|
1545
|
-
"useLocation=" + l
|
|
1546
|
-
];
|
|
1547
|
-
o && o !== "" && !n && M.push("state=" + o), c && c !== "" && M.push("tolken=" + c), h && h !== "" && M.push("ip=" + h);
|
|
1548
|
-
const v = M.join("&"), H = (r || n ? "/api/autocomplete-city" : "/api/autocomplete") + "?" + v;
|
|
1549
|
-
return await m.makeSearchFetchCall(H);
|
|
1470
|
+
static calcCrow(e, t, a, r) {
|
|
1471
|
+
const s = m.toRad(a - e), l = m.toRad(r - t);
|
|
1472
|
+
e = m.toRad(e), a = m.toRad(a);
|
|
1473
|
+
const o = Math.sin(s / 2) * Math.sin(s / 2) + Math.sin(l / 2) * Math.sin(l / 2) * Math.cos(e) * Math.cos(a);
|
|
1474
|
+
return 6371 * (2 * Math.atan2(Math.sqrt(o), Math.sqrt(1 - o)));
|
|
1550
1475
|
}
|
|
1551
|
-
static cleanupAddress(
|
|
1552
|
-
return
|
|
1476
|
+
static cleanupAddress(e) {
|
|
1477
|
+
return e.split(" ").map((a) => a.split("-")[0]).join(" ").trim();
|
|
1553
1478
|
}
|
|
1554
|
-
static
|
|
1555
|
-
|
|
1556
|
-
return (await fetch(t, {
|
|
1557
|
-
method: "GET",
|
|
1558
|
-
headers: { "Content-Type": "application/json" }
|
|
1559
|
-
})).json();
|
|
1560
|
-
} catch (e) {
|
|
1561
|
-
console.error("performSearch", e, { url: t });
|
|
1562
|
-
}
|
|
1563
|
-
return [];
|
|
1479
|
+
static clearBounds(e = "bounds") {
|
|
1480
|
+
localStorage.setItem(e, JSON.stringify([]));
|
|
1564
1481
|
}
|
|
1565
|
-
static
|
|
1566
|
-
if (!
|
|
1482
|
+
static clickTrack(e = !0) {
|
|
1483
|
+
if (e !== !0)
|
|
1567
1484
|
return;
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1485
|
+
window.dataLayer = window.dataLayer || [];
|
|
1486
|
+
const t = document.querySelectorAll("[data-div-track]");
|
|
1487
|
+
typeof m == "function" && t.forEach((a) => {
|
|
1488
|
+
a.addEventListener("click", () => {
|
|
1489
|
+
m.clickTrackEvent(a.dataset.divTrack);
|
|
1490
|
+
});
|
|
1491
|
+
});
|
|
1572
1492
|
}
|
|
1573
|
-
static
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
r || (r = !0, t(e));
|
|
1578
|
-
}), a.addEventListener("touchmove", () => {
|
|
1579
|
-
r || (r = !0, t(e));
|
|
1493
|
+
static clickTrackEvent(e) {
|
|
1494
|
+
window.dataLayer.push({
|
|
1495
|
+
event: "click_tracking",
|
|
1496
|
+
click_value: e
|
|
1580
1497
|
});
|
|
1581
1498
|
}
|
|
1582
|
-
|
|
1583
|
-
|
|
1499
|
+
/* TODO: Not sure if this or PRECS is more correct */
|
|
1500
|
+
static async createData(e, t = null, a = !0) {
|
|
1501
|
+
if (options.isBot || !t)
|
|
1584
1502
|
return null;
|
|
1585
|
-
const { tolken: r = null, ip: n = null } = await m.getHeaders(),
|
|
1586
|
-
try {
|
|
1587
|
-
const o = await fetch(l, { method: "GET" });
|
|
1588
|
-
if (e === !0) {
|
|
1589
|
-
const h = await o.text();
|
|
1590
|
-
return h ? h.replace("__next", "") : null;
|
|
1591
|
-
}
|
|
1592
|
-
const c = o.headers.get("content-type");
|
|
1593
|
-
return c && c.indexOf("application/json") !== -1 ? o.json() : null;
|
|
1594
|
-
} catch (o) {
|
|
1595
|
-
console.error("fetchData", o, t);
|
|
1596
|
-
}
|
|
1597
|
-
return null;
|
|
1598
|
-
}
|
|
1599
|
-
static async getUser() {
|
|
1600
|
-
if (typeof window < "u") {
|
|
1601
|
-
const { user: t = null } = (window == null ? void 0 : window.options) ?? {};
|
|
1602
|
-
if (t)
|
|
1603
|
-
return t;
|
|
1604
|
-
}
|
|
1605
|
-
try {
|
|
1606
|
-
return await m.createData("/api/cookie/fetch?name=odrUser");
|
|
1607
|
-
} catch (t) {
|
|
1608
|
-
console.error("getUser", t.message);
|
|
1609
|
-
}
|
|
1610
|
-
return null;
|
|
1611
|
-
}
|
|
1612
|
-
static async setSearchValueClient(t) {
|
|
1613
|
-
localStorage.setItem("odrSearchValue", JSON.stringify(t)), await m.createData("/api/cookie/create?name=odrSearchValue", t);
|
|
1614
|
-
}
|
|
1615
|
-
static getWebsiteHeaderName() {
|
|
1616
|
-
const t = "onlinedatareports.com", e = "propertyrecs.com", a = typeof window < "u" ? window.location.host : t;
|
|
1617
|
-
return a && a.includes(e) ? e : t;
|
|
1618
|
-
}
|
|
1619
|
-
static async logRequest(t = null, e = null, a = null, r = null, n = null) {
|
|
1620
|
-
const s = {
|
|
1621
|
-
name: t,
|
|
1622
|
-
uuid: e,
|
|
1623
|
-
ip: a,
|
|
1624
|
-
url: r,
|
|
1625
|
-
data: n
|
|
1626
|
-
};
|
|
1627
|
-
return await m.createData("/api/client?query=log/save&method=POST", s), null;
|
|
1628
|
-
}
|
|
1629
|
-
static async createData(t, e = null, a = !0) {
|
|
1630
|
-
const { tolken: r = null, ip: n = null } = await m.getHeaders(), s = a === !1 ? "" : "&tolken=" + r + "&ip=" + n, l = t + s, o = typeof e == "string" ? e : JSON.stringify(e);
|
|
1503
|
+
const { tolken: r = null, ip: n = null } = await m.getHeaders(), s = a === !1 ? "" : "&tolken=" + r + "&ip=" + n, l = e + s, o = typeof t == "string" ? t : JSON.stringify(t);
|
|
1631
1504
|
try {
|
|
1632
1505
|
const c = await fetch(l, {
|
|
1633
1506
|
method: "POST",
|
|
@@ -1645,359 +1518,198 @@ class m {
|
|
|
1645
1518
|
}
|
|
1646
1519
|
return null;
|
|
1647
1520
|
}
|
|
1648
|
-
static
|
|
1649
|
-
|
|
1650
|
-
style: "currency",
|
|
1651
|
-
currency: "USD",
|
|
1652
|
-
minimumFractionDigits: a,
|
|
1653
|
-
maximumFractionDigits: a
|
|
1654
|
-
}).format(t) : t;
|
|
1655
|
-
}
|
|
1656
|
-
static number(t, e = "", a = 0) {
|
|
1657
|
-
return t === null ? e : Intl ? new Intl.NumberFormat("en-US", {
|
|
1658
|
-
minimumFractionDigits: a,
|
|
1659
|
-
maximumFractionDigits: a
|
|
1660
|
-
}).format(t) : t;
|
|
1661
|
-
}
|
|
1662
|
-
static ucWords(t) {
|
|
1663
|
-
return t ? t.toString().split(" ").map((e) => m.ucFirst(e)).join(" ") : null;
|
|
1664
|
-
}
|
|
1665
|
-
static ucFirst(t = null) {
|
|
1666
|
-
if (!t)
|
|
1667
|
-
return null;
|
|
1668
|
-
const e = t.toLowerCase();
|
|
1669
|
-
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1670
|
-
}
|
|
1671
|
-
static s(t) {
|
|
1672
|
-
return Math.round(t) > 1 ? "s" : "";
|
|
1521
|
+
static dataLayer({ type: e = null, data: t = null }) {
|
|
1522
|
+
typeof dataLayer.push > "u" || typeof dataLayer.push > "u" || (e === "custom" && t && this.dlvCustom(t), e === "login" && t && this.dlvUserLogin(t), e === "userData" && t && this.dlvUserData(t));
|
|
1673
1523
|
}
|
|
1674
|
-
static
|
|
1675
|
-
|
|
1524
|
+
static async deleteSearchValue(e = "recsSearchValue") {
|
|
1525
|
+
try {
|
|
1526
|
+
return await m.createData(`/api/cookie/remove?name=${e}`);
|
|
1527
|
+
} catch (t) {
|
|
1528
|
+
console.error("deleteSearchValue", t.message);
|
|
1529
|
+
}
|
|
1530
|
+
return null;
|
|
1676
1531
|
}
|
|
1677
|
-
static
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1532
|
+
static detectMouseMovement(e, t = null) {
|
|
1533
|
+
const a = document.querySelector("body");
|
|
1534
|
+
let r = !1;
|
|
1535
|
+
a.addEventListener("mousemove", () => {
|
|
1536
|
+
r || (r = !0, e(t));
|
|
1537
|
+
}), a.addEventListener("touchmove", () => {
|
|
1538
|
+
r || (r = !0, e(t));
|
|
1539
|
+
});
|
|
1683
1540
|
}
|
|
1684
|
-
static
|
|
1685
|
-
|
|
1686
|
-
t = m.toRad(t), a = m.toRad(a);
|
|
1687
|
-
const o = Math.sin(s / 2) * Math.sin(s / 2) + Math.sin(l / 2) * Math.sin(l / 2) * Math.cos(t) * Math.cos(a);
|
|
1688
|
-
return 6371 * (2 * Math.atan2(Math.sqrt(o), Math.sqrt(1 - o)));
|
|
1541
|
+
static dlvCustom(e) {
|
|
1542
|
+
console.info("dlvCustom", JSON.stringify(e)), dataLayer.push(e);
|
|
1689
1543
|
}
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1544
|
+
static dlvUserLogin(e) {
|
|
1545
|
+
dataLayer.push({
|
|
1546
|
+
event: "login",
|
|
1547
|
+
userId: e == null ? void 0 : e.uuid
|
|
1548
|
+
});
|
|
1693
1549
|
}
|
|
1694
|
-
static
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1550
|
+
static dlvUserData(e) {
|
|
1551
|
+
dataLayer.push({
|
|
1552
|
+
event: "userData",
|
|
1553
|
+
userId: e == null ? void 0 : e.uuid,
|
|
1554
|
+
uuid: e == null ? void 0 : e.uuid,
|
|
1555
|
+
email: e == null ? void 0 : e.email,
|
|
1556
|
+
name: e == null ? void 0 : e.name
|
|
1557
|
+
});
|
|
1699
1558
|
}
|
|
1700
|
-
static
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
window.dataLayer = window.dataLayer || [];
|
|
1704
|
-
const e = document.querySelectorAll("[data-div-track]");
|
|
1705
|
-
typeof m == "function" && e.forEach((a) => {
|
|
1706
|
-
a.addEventListener("click", () => {
|
|
1707
|
-
m.clickTrackEvent(a.dataset.divTrack);
|
|
1708
|
-
});
|
|
1559
|
+
static documentLoaded(e, t = 0) {
|
|
1560
|
+
document.addEventListener("DOMContentLoaded", async function() {
|
|
1561
|
+
t ? setTimeout(() => e(), t) : e();
|
|
1709
1562
|
});
|
|
1710
1563
|
}
|
|
1711
|
-
static
|
|
1712
|
-
|
|
1564
|
+
static elementScrollTop() {
|
|
1565
|
+
setTimeout(() => {
|
|
1566
|
+
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
1567
|
+
}, 100);
|
|
1568
|
+
}
|
|
1569
|
+
static eventListenerOnce(e, t, a) {
|
|
1570
|
+
e == null || e.addEventListener(t, a, {
|
|
1713
1571
|
once: !0
|
|
1714
1572
|
});
|
|
1715
1573
|
}
|
|
1716
|
-
static
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1574
|
+
static async fetchData(e, t = !1, a = !0) {
|
|
1575
|
+
if (options.isBot)
|
|
1576
|
+
return null;
|
|
1577
|
+
const { tolken: r = null, ip: n = null } = await m.getHeaders(), l = e.replace("#", "").replace("%23", "") + "&tolken=" + r + "&ip=" + n;
|
|
1578
|
+
try {
|
|
1579
|
+
const o = await fetch(l, { method: "GET" });
|
|
1580
|
+
if (t === !0) {
|
|
1581
|
+
const h = await o.text();
|
|
1582
|
+
return h ? h.replace("__next", "") : null;
|
|
1583
|
+
}
|
|
1584
|
+
const c = o.headers.get("content-type");
|
|
1585
|
+
return c && c.indexOf("application/json") !== -1 ? o.json() : null;
|
|
1586
|
+
} catch (o) {
|
|
1587
|
+
console.error("fetchData", o, e);
|
|
1588
|
+
}
|
|
1589
|
+
return null;
|
|
1721
1590
|
}
|
|
1722
|
-
static
|
|
1723
|
-
|
|
1591
|
+
static findAncestor(e, t) {
|
|
1592
|
+
let a = e.parentElement;
|
|
1593
|
+
return a.tagName.toLowerCase() === t || (a = e.parentElement.parentElement, a.tagName.toLowerCase() === t) || (a = e.parentElement.parentElement.parentElement, a.tagName.toLowerCase() === t) ? a : null;
|
|
1724
1594
|
}
|
|
1725
|
-
static
|
|
1726
|
-
|
|
1727
|
-
|
|
1595
|
+
static formatDate(e = null) {
|
|
1596
|
+
return e ? (e = new Date(e), [
|
|
1597
|
+
m.padTo2Digits(e.getMonth() + 1),
|
|
1598
|
+
m.padTo2Digits(e.getDate()),
|
|
1599
|
+
e.getFullYear()
|
|
1600
|
+
].join("-")) : null;
|
|
1728
1601
|
}
|
|
1729
|
-
static
|
|
1730
|
-
|
|
1731
|
-
|
|
1602
|
+
static getBoundsEntries(e = "bounds") {
|
|
1603
|
+
const t = localStorage.getItem(e);
|
|
1604
|
+
return t ? JSON.parse(t) : [];
|
|
1605
|
+
}
|
|
1606
|
+
static getBounds(e, t = null, a = null) {
|
|
1607
|
+
if (!e)
|
|
1608
|
+
return console.error("no map", e), {
|
|
1732
1609
|
swLat: 0,
|
|
1733
1610
|
neLng: 0,
|
|
1734
1611
|
neLat: 0,
|
|
1735
1612
|
swLng: 0
|
|
1736
1613
|
};
|
|
1737
|
-
const r =
|
|
1614
|
+
const r = e.getBounds();
|
|
1738
1615
|
let n = r.getSouth(), s = r.getEast(), l = r.getNorth(), o = r.getWest();
|
|
1739
|
-
return a && (n = n - a, s = s + a, l = l + a, o = o - a),
|
|
1616
|
+
return a && (n = n - a, s = s + a, l = l + a, o = o - a), t && (n = n.toFixed(t), s = s.toFixed(t), l = l.toFixed(t), o = o.toFixed(t)), {
|
|
1740
1617
|
swLat: n,
|
|
1741
1618
|
neLng: s,
|
|
1742
1619
|
neLat: l,
|
|
1743
1620
|
swLng: o
|
|
1744
1621
|
};
|
|
1745
1622
|
}
|
|
1746
|
-
static
|
|
1747
|
-
|
|
1748
|
-
L.GridLayer.GridDebug = L.GridLayer.extend({
|
|
1749
|
-
createTile: function(n, s) {
|
|
1750
|
-
const l = document.createElement("div");
|
|
1751
|
-
return setTimeout(() => {
|
|
1752
|
-
s(null, l);
|
|
1753
|
-
const { se: o, nw: c } = r.getGridBounds({
|
|
1754
|
-
map: t,
|
|
1755
|
-
tileSize: this.getTileSize(),
|
|
1756
|
-
coords: n
|
|
1757
|
-
});
|
|
1758
|
-
e({
|
|
1759
|
-
swLat: o.lat,
|
|
1760
|
-
neLng: o.lng,
|
|
1761
|
-
neLat: c.lat,
|
|
1762
|
-
swLng: c.lng,
|
|
1763
|
-
coords: n,
|
|
1764
|
-
key: n.z + "-" + n.x + "-" + n.y
|
|
1765
|
-
});
|
|
1766
|
-
}, a), l;
|
|
1767
|
-
}
|
|
1768
|
-
}), L.gridLayer.gridDebug = function(n) {
|
|
1769
|
-
return new L.GridLayer.GridDebug(n);
|
|
1770
|
-
}, t.addLayer(L.gridLayer.gridDebug());
|
|
1771
|
-
}
|
|
1772
|
-
static getGridBounds({ map: t, tileSize: e, coords: a }) {
|
|
1773
|
-
const r = a.scaleBy(e), n = r.add(e);
|
|
1774
|
-
return {
|
|
1775
|
-
nw: t.unproject(r, a.z),
|
|
1776
|
-
se: t.unproject(n, a.z)
|
|
1777
|
-
};
|
|
1778
|
-
}
|
|
1779
|
-
static scrollWheelZoom(t) {
|
|
1780
|
-
t.scrollWheelZoom.disable(), t.on("focus", () => {
|
|
1781
|
-
t.scrollWheelZoom.enable();
|
|
1782
|
-
}), t.on("blur", () => {
|
|
1783
|
-
t.scrollWheelZoom.disable();
|
|
1784
|
-
});
|
|
1785
|
-
}
|
|
1786
|
-
static useLayerTitle(t, e) {
|
|
1787
|
-
const a = m.getLayerTitle(t);
|
|
1788
|
-
L.tileLayer(a, {
|
|
1789
|
-
maxNativeZoom: 19,
|
|
1790
|
-
maxZoom: 25,
|
|
1791
|
-
subdomains: ["mt0", "mt1", "mt2", "mt3"],
|
|
1792
|
-
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
|
1793
|
-
}).addTo(e);
|
|
1794
|
-
}
|
|
1795
|
-
static getLayerTitle(t) {
|
|
1796
|
-
return {
|
|
1797
|
-
hybrid: "https://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
|
1798
|
-
roadmap: "https://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}"
|
|
1799
|
-
}[t];
|
|
1800
|
-
}
|
|
1801
|
-
static removeElements(t) {
|
|
1802
|
-
document.querySelectorAll(t).forEach((e) => e == null ? void 0 : e.remove());
|
|
1803
|
-
}
|
|
1804
|
-
static removeNullFromObject(t) {
|
|
1805
|
-
return Object.keys(t).filter((e) => t[e]).reduce((e, a) => (e[a] = t[a], e), {});
|
|
1623
|
+
static getFirstN(e, t = 5) {
|
|
1624
|
+
return e === null ? null : e.length === 0 ? [] : e.filter((a, r) => r < t);
|
|
1806
1625
|
}
|
|
1807
|
-
static
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1626
|
+
static getFormUrl(e = null) {
|
|
1627
|
+
const { name: t = null, isOptOut: a = !1 } = e ?? {};
|
|
1628
|
+
if (!t || t === "address")
|
|
1629
|
+
return a === !0 ? "/opt-out/address" : "/";
|
|
1630
|
+
if (t === "background-check")
|
|
1631
|
+
return "/report/background-check";
|
|
1632
|
+
if (t === "background-check-search")
|
|
1633
|
+
return a === !0 ? "/opt-out/records" : "/report/background-check/search";
|
|
1634
|
+
if (t === "dmv-records")
|
|
1635
|
+
return "/report/dmv-records";
|
|
1636
|
+
if (t === "dmv-records-search")
|
|
1637
|
+
return a === !0 ? "/opt-out/records" : "/report/dmv-records/search";
|
|
1638
|
+
if (t === "phone")
|
|
1639
|
+
return "/report/phone";
|
|
1640
|
+
if (t === "phone-search")
|
|
1641
|
+
return a === !0 ? "/opt-out/records" : "/report/phone/search";
|
|
1642
|
+
if (t === "vin")
|
|
1643
|
+
return "/report/vin";
|
|
1644
|
+
if (t === "license" || t === "license-plate")
|
|
1645
|
+
return "/report/license-plate";
|
|
1814
1646
|
}
|
|
1815
|
-
static
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1647
|
+
static async getHeaders(e = 300) {
|
|
1648
|
+
const {
|
|
1649
|
+
userAgent: t = null,
|
|
1650
|
+
userAgentData: a = null,
|
|
1651
|
+
platform: r = null
|
|
1652
|
+
} = navigator || {}, n = (a == null ? void 0 : a.platform) ?? r, s = {
|
|
1653
|
+
tolken: null,
|
|
1654
|
+
ip: null,
|
|
1655
|
+
userAgent: t,
|
|
1656
|
+
platform: n
|
|
1657
|
+
};
|
|
1658
|
+
if (options && options.isBot || typeof window.localStorage > "u")
|
|
1659
|
+
return s;
|
|
1660
|
+
const l = localStorage.getItem("headerTolken");
|
|
1661
|
+
if (l) {
|
|
1662
|
+
const o = JSON.parse(l), c = (/* @__PURE__ */ new Date()).getTime();
|
|
1663
|
+
return o.expire - c < 0 && localStorage.removeItem("headerTolken"), {
|
|
1664
|
+
tolken: o.tolken,
|
|
1665
|
+
ip: o.ip,
|
|
1666
|
+
userAgent: t,
|
|
1667
|
+
platform: n
|
|
1668
|
+
};
|
|
1669
|
+
}
|
|
1670
|
+
try {
|
|
1671
|
+
const c = await (await fetch("/api/headers")).json(), h = (c == null ? void 0 : c.token) ?? null, p = (c == null ? void 0 : c.ip) ?? null;
|
|
1672
|
+
return localStorage.setItem(
|
|
1673
|
+
"headerTolken",
|
|
1674
|
+
JSON.stringify({
|
|
1675
|
+
tolken: h,
|
|
1676
|
+
ip: p,
|
|
1677
|
+
expire: (/* @__PURE__ */ new Date()).getTime() + e * 1e3
|
|
1678
|
+
})
|
|
1679
|
+
), { tolken: h, ip: p, userAgent: t, platform: n };
|
|
1680
|
+
} catch (o) {
|
|
1681
|
+
console.error("getHeaders", o);
|
|
1682
|
+
}
|
|
1683
|
+
return s;
|
|
1820
1684
|
}
|
|
1821
|
-
static
|
|
1822
|
-
return
|
|
1685
|
+
static getLayerTitle(e) {
|
|
1686
|
+
return {
|
|
1687
|
+
hybrid: "https://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
|
1688
|
+
roadmap: "https://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}"
|
|
1689
|
+
}[e];
|
|
1823
1690
|
}
|
|
1824
|
-
static
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
m.padTo2Digits(t.getDate()),
|
|
1828
|
-
t.getFullYear()
|
|
1829
|
-
].join("-")) : null;
|
|
1691
|
+
static async getLocationData(e) {
|
|
1692
|
+
const { swLat: t, neLng: a, neLat: r, swLng: n } = m.getBounds(e, 3, 0.05), s = "zip-location&swLat=" + t + "&neLng=" + a + "&neLat=" + r + "&swLng=" + n;
|
|
1693
|
+
return await m.fetchData("/api/client?query=" + s);
|
|
1830
1694
|
}
|
|
1831
|
-
static
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1695
|
+
static getReportUrl(e, t = null) {
|
|
1696
|
+
var o, c, h;
|
|
1697
|
+
const a = ((o = e == null ? void 0 : e.state) == null ? void 0 : o.slug) ?? null, r = ((c = e == null ? void 0 : e.city) == null ? void 0 : c.slug) ?? null, n = ((h = e == null ? void 0 : e.name) == null ? void 0 : h.slug) ?? null, s = (e == null ? void 0 : e.zip) ?? null;
|
|
1698
|
+
t = t || ((e == null ? void 0 : e.id) ?? null);
|
|
1699
|
+
const l = [s, "-piq", t].filter((p) => p).join("");
|
|
1700
|
+
return "/" + [a, r, n].filter((p) => p).map((p) => m.toSlug(p)).join("/") + "/" + l;
|
|
1835
1701
|
}
|
|
1836
|
-
static async
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
src: r,
|
|
1842
|
-
id: e || t,
|
|
1843
|
-
async: !1,
|
|
1844
|
-
module: a
|
|
1845
|
-
});
|
|
1846
|
-
} catch (n) {
|
|
1847
|
-
console.error("loadCustomScript", n);
|
|
1848
|
-
}
|
|
1702
|
+
static async getSearchValue(e = "recsSearchValue") {
|
|
1703
|
+
try {
|
|
1704
|
+
return await m.createData(`/api/cookie/fetch?name=${e}`);
|
|
1705
|
+
} catch (t) {
|
|
1706
|
+
console.error("getSearchValue", t.message);
|
|
1849
1707
|
}
|
|
1850
1708
|
return null;
|
|
1851
1709
|
}
|
|
1852
|
-
static
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
if (e && l && l.dataset.loaded === "true")
|
|
1856
|
-
return n({ alreadyLoaded: !0, id: e });
|
|
1857
|
-
l || (l = document.createElement("script"), l.src = t, l.dataset.loaded = "false", e && (l.id = e), l.type = r ? "module" : "text/javascript", l.async = a, document.body.appendChild(l), l.onload = () => (l.dataset.loaded = "true", n({ alreadyLoaded: !1, id: e })), l.onerror = () => s(!1));
|
|
1858
|
-
});
|
|
1859
|
-
}
|
|
1860
|
-
static injectLink({ href: t, id: e }) {
|
|
1861
|
-
const a = document.createElement("link");
|
|
1862
|
-
a.href = t, a.type = "text/css", a.rel = "stylesheet", e && (a.id = e), document.getElementsByTagName("head")[0].appendChild(a);
|
|
1863
|
-
}
|
|
1864
|
-
static async loadGoogleMapApi() {
|
|
1865
|
-
if (window.options.googleMapsLoaded === !0)
|
|
1866
|
-
return;
|
|
1867
|
-
const t = "https://maps.googleapis.com/maps/api/js", e = window.options.googleApiKey, a = t + "?key=" + e + "&libraries=marker&v=beta&callback=mapCb";
|
|
1868
|
-
await m.injectScript({ src: a, id: "googleapis", async: !1 });
|
|
1869
|
-
}
|
|
1870
|
-
static async loadLeafletApi() {
|
|
1871
|
-
const t = "https://unpkg.com/leaflet@1.9.3/dist", e = t + "/leaflet.js", a = t + "/leaflet.css", r = "//unpkg.com/leaflet-gesture-handling", n = "//unpkg.com/leaflet-gesture-handling/dist/leaflet-gesture-handling.min.css";
|
|
1872
|
-
await m.injectLink({ href: a, id: "leafletCss" }), await m.injectLink({ href: n, id: "gestureCss" }), await m.injectScript({ src: e, id: "leafletJs", async: !1 }), await m.injectScript({
|
|
1873
|
-
src: r,
|
|
1874
|
-
id: "gestureJs",
|
|
1875
|
-
async: !1
|
|
1876
|
-
});
|
|
1877
|
-
}
|
|
1878
|
-
static stickyHeader(t = ".nav") {
|
|
1879
|
-
const e = document.querySelector(t);
|
|
1880
|
-
if (!e)
|
|
1881
|
-
return;
|
|
1882
|
-
new IntersectionObserver(
|
|
1883
|
-
([r]) => {
|
|
1884
|
-
r && (r.intersectionRatio < 1 ? e.classList.add("intersecting") : e.classList.remove("intersecting"));
|
|
1885
|
-
},
|
|
1886
|
-
{ threshold: 1 }
|
|
1887
|
-
).observe(e);
|
|
1888
|
-
}
|
|
1889
|
-
static isMobile({ selector: t = null, width: e = 640 } = {}) {
|
|
1890
|
-
var r;
|
|
1891
|
-
const a = document.querySelector(t);
|
|
1892
|
-
return ((r = a == null ? void 0 : a.getBoundingClientRect()) == null ? void 0 : r.width) ?? 0 < e;
|
|
1893
|
-
}
|
|
1894
|
-
static isMobileAndTablet() {
|
|
1895
|
-
return window.mobileAndTabletCheck = function() {
|
|
1896
|
-
let t = !1;
|
|
1897
|
-
return function(e) {
|
|
1898
|
-
(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(
|
|
1899
|
-
e
|
|
1900
|
-
) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
|
|
1901
|
-
e.substr(0, 4)
|
|
1902
|
-
)) && (t = !0);
|
|
1903
|
-
}(navigator.userAgent || navigator.vendor || window.opera), t;
|
|
1904
|
-
}, window.mobileAndTabletCheck();
|
|
1905
|
-
}
|
|
1906
|
-
/**
|
|
1907
|
-
* Handle Native Dialogs
|
|
1908
|
-
* @type {function} handleDialog
|
|
1909
|
-
* @param {string|null} target - Selector that open the dialog
|
|
1910
|
-
* @param {string} id - Unique dialog id
|
|
1911
|
-
* @param {function|null} onOpen - Callback function called when dialog is opened
|
|
1912
|
-
* @param {function|null} onClose - Callback function called when dialog is closed
|
|
1913
|
-
* @param {boolean} disableOutsideClick - Disable dialog closing when clicking outside the dialog
|
|
1914
|
-
* @returns {{activators: NodeListOf<Element>, handleOpen: {function}, handleClose: {function}, ref: HTMLDialogElement}}
|
|
1915
|
-
*/
|
|
1916
|
-
static handleDialog({
|
|
1917
|
-
target: t = null,
|
|
1918
|
-
id: e = "",
|
|
1919
|
-
onOpen: a = null,
|
|
1920
|
-
onClose: r = null,
|
|
1921
|
-
disableOutsideClick: n = !1
|
|
1922
|
-
}) {
|
|
1923
|
-
const s = t ? document.querySelectorAll(t) : [], l = document.getElementById(e + "-dialog"), o = document.querySelectorAll("[data-dialog-close]"), c = ["closing", "closed", "opening", "opened", "removed"].reduce(
|
|
1924
|
-
(u, C) => ({
|
|
1925
|
-
...u,
|
|
1926
|
-
[C]: new Event(C)
|
|
1927
|
-
}),
|
|
1928
|
-
{}
|
|
1929
|
-
), h = new MutationObserver((u, C) => {
|
|
1930
|
-
u.forEach(async (w) => {
|
|
1931
|
-
if (w.attributeName === "open") {
|
|
1932
|
-
const f = w.target;
|
|
1933
|
-
if (!(f == null ? void 0 : f.hasAttribute("open"))) return;
|
|
1934
|
-
f == null || f.removeAttribute("inert"), f == null || f.dispatchEvent(c.opening), f && await H(f), f == null || f.dispatchEvent(c.opened);
|
|
1935
|
-
}
|
|
1936
|
-
});
|
|
1937
|
-
}), p = new MutationObserver((u, C) => {
|
|
1938
|
-
u.forEach((w) => {
|
|
1939
|
-
w.removedNodes.forEach((f) => {
|
|
1940
|
-
f.nodeName === "DIALOG" && (f.removeEventListener("click", b), f.removeEventListener("close", v), f.dispatchEvent(c.removed), p == null || p.disconnect(), h == null || h.disconnect());
|
|
1941
|
-
});
|
|
1942
|
-
});
|
|
1943
|
-
});
|
|
1944
|
-
l && (h.observe(l, {
|
|
1945
|
-
attributes: !0
|
|
1946
|
-
}), p.observe(document.body, {
|
|
1947
|
-
attributes: !1,
|
|
1948
|
-
subtree: !1,
|
|
1949
|
-
childList: !0
|
|
1950
|
-
}));
|
|
1951
|
-
const M = () => {
|
|
1952
|
-
l == null || l.showModal();
|
|
1953
|
-
}, v = async ({ target: u }) => {
|
|
1954
|
-
u == null || u.classList.add("closing"), u == null || u.setAttribute("inert", ""), u == null || u.dispatchEvent(c.closing), u && await H(u), u == null || u.classList.remove("closing"), u == null || u.dispatchEvent(c.closed);
|
|
1955
|
-
}, b = async ({ target: u }) => {
|
|
1956
|
-
(u == null ? void 0 : u.nodeName) === "DIALOG" && (l == null || l.close("outside"));
|
|
1957
|
-
}, H = (u) => Promise.allSettled(
|
|
1958
|
-
u == null ? void 0 : u.getAnimations().map((C) => C == null ? void 0 : C.finished)
|
|
1959
|
-
);
|
|
1960
|
-
return !n && (l == null || l.addEventListener("click", b)), l == null || l.addEventListener("close", v), s == null || s.forEach((u) => {
|
|
1961
|
-
u.addEventListener("click", (C) => {
|
|
1962
|
-
M(), a && a(C, l);
|
|
1963
|
-
});
|
|
1964
|
-
}), o == null || o.forEach((u) => {
|
|
1965
|
-
u.addEventListener("click", async (C) => {
|
|
1966
|
-
l == null || l.close("close"), r && r(C, l);
|
|
1967
|
-
});
|
|
1968
|
-
}), {
|
|
1969
|
-
activators: s,
|
|
1970
|
-
ref: l,
|
|
1971
|
-
handleOpen: M,
|
|
1972
|
-
handleClose: v
|
|
1973
|
-
};
|
|
1974
|
-
}
|
|
1975
|
-
static isNameCompany(t = null) {
|
|
1976
|
-
if (!t)
|
|
1977
|
-
return !1;
|
|
1978
|
-
const e = t.trim().toLowerCase();
|
|
1979
|
-
return e.includes("unknown") || e.includes("institute") || e.includes("bldg") || e.includes("llc") || e.includes("l l c") || e.includes(" inc") || e.includes(" co") || e.includes("univ") || e.includes("unvi") || e.includes(" fund") || e.includes(" union") || e.includes(" assoc") || e.includes(" corp") || e.includes("service") || e.includes("members") || e.includes("properties") || e.includes("management") || e.includes("investment") || e.includes("enterprise") || e.includes(" group") || e.includes(" group") || e.includes(" rent") || e.includes(" home") || e.includes(" cu") || e.includes(" inc") || e.includes("laborator") || e.includes("pharma") || e.includes("holding") || e.includes("worship") || e.includes("bank") || e.includes("agent") || e.includes("title") || e.includes("city ") || e.includes("technolo") || e.includes("estate") || e.includes("capital") || e.includes(" of ") || e.includes("trust");
|
|
1980
|
-
}
|
|
1981
|
-
static objToQp(t) {
|
|
1982
|
-
const {
|
|
1983
|
-
name: e = null,
|
|
1984
|
-
first: a = null,
|
|
1985
|
-
middle: r = null,
|
|
1986
|
-
last: n = null,
|
|
1987
|
-
min: s = null,
|
|
1988
|
-
max: l = null,
|
|
1989
|
-
city: o = null,
|
|
1990
|
-
state: c = null,
|
|
1991
|
-
vin: h = null,
|
|
1992
|
-
license: p = null,
|
|
1993
|
-
token: M = null,
|
|
1994
|
-
phone: v = null
|
|
1995
|
-
} = t || {}, b = e && e !== "", H = s && s !== "" && s !== "18", u = l && l !== "" && s !== "99";
|
|
1996
|
-
let C = [];
|
|
1997
|
-
return e && e !== "" && C.push("name=" + e), b || (a && a !== "" && C.push("first=" + a), r && r !== "" && C.push("middle=" + r), n && n !== "" && C.push("last=" + n)), H && u ? parseInt(s) > parseInt(l) ? (C.push("min=" + l), C.push("max=" + s)) : (C.push("min=" + s), C.push("max=" + l)) : (H && C.push("min=" + s), u && C.push("max=" + l)), v && v !== "" && C.push("phone=" + v), o && o !== "" && C.push("city=" + o), p && p !== "" && C.push("license=" + p), h && h !== "" && C.push("vin=" + h), c && c !== "" && C.push("state=" + c), M && M !== "" && C.push("token=" + M), C.join("&");
|
|
1998
|
-
}
|
|
1999
|
-
static getFirstN(t, e = 5) {
|
|
2000
|
-
return t === null ? null : t.length === 0 ? [] : t.filter((a, r) => r < e);
|
|
1710
|
+
static getSearchValueClient(e = "recsSearchValue") {
|
|
1711
|
+
const t = localStorage.getItem(e);
|
|
1712
|
+
return t ? JSON.parse(t) : null;
|
|
2001
1713
|
}
|
|
2002
1714
|
static getStates() {
|
|
2003
1715
|
return [
|
|
@@ -2094,12 +1806,363 @@ class m {
|
|
|
2094
1806
|
{ name: "Wyoming", id: "wy", slug: "wyoming", short: "WY" }
|
|
2095
1807
|
];
|
|
2096
1808
|
}
|
|
2097
|
-
static
|
|
2098
|
-
|
|
1809
|
+
static getTrackingData(e) {
|
|
1810
|
+
const [t, ...a] = e.split("|"), r = a.join("|").trim(), n = [
|
|
1811
|
+
"[pageType::" + t.trim() + "]",
|
|
1812
|
+
"[name::" + r + "]"
|
|
1813
|
+
].join(" ");
|
|
1814
|
+
return {
|
|
1815
|
+
value: n,
|
|
1816
|
+
dataLayer: {
|
|
1817
|
+
event: "clickTrack",
|
|
1818
|
+
value: n
|
|
1819
|
+
}
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
static async getUser() {
|
|
1823
|
+
if (typeof window < "u") {
|
|
1824
|
+
const { user: e = null } = (window == null ? void 0 : window.options) ?? {};
|
|
1825
|
+
if (e)
|
|
1826
|
+
return e;
|
|
1827
|
+
}
|
|
1828
|
+
try {
|
|
1829
|
+
return await m.createData("/api/cookie/fetch?name=odrUser");
|
|
1830
|
+
} catch (e) {
|
|
1831
|
+
console.error("getUser", e.message);
|
|
1832
|
+
}
|
|
1833
|
+
return null;
|
|
1834
|
+
}
|
|
1835
|
+
static async getUserHistory(e = null) {
|
|
1836
|
+
const { uuid: t = null } = e ?? {};
|
|
1837
|
+
if (!t)
|
|
1838
|
+
return { data: null };
|
|
1839
|
+
const a = JSON.stringify({
|
|
1840
|
+
limit: 1,
|
|
1841
|
+
where: {
|
|
1842
|
+
uuid: t
|
|
1843
|
+
}
|
|
1844
|
+
});
|
|
1845
|
+
return await m.makeSearchFetchCall(
|
|
1846
|
+
`/api/client?query=user-get-history&filter=${a}`
|
|
1847
|
+
);
|
|
1848
|
+
}
|
|
1849
|
+
static getWebsiteHeaderName() {
|
|
1850
|
+
const e = "onlinedatareports.com", t = "propertyrecs.com", a = typeof window < "u" ? window.location.host : e;
|
|
1851
|
+
return a && a.includes(t) ? t : e;
|
|
1852
|
+
}
|
|
1853
|
+
static getGridBounds({ map: e, tileSize: t, coords: a }) {
|
|
1854
|
+
const r = a.scaleBy(t), n = r.add(t);
|
|
1855
|
+
return {
|
|
1856
|
+
nw: e.unproject(r, a.z),
|
|
1857
|
+
se: e.unproject(n, a.z)
|
|
1858
|
+
};
|
|
1859
|
+
}
|
|
1860
|
+
static gridTest(e, t, a = 1500) {
|
|
1861
|
+
const r = this;
|
|
1862
|
+
L.GridLayer.GridDebug = L.GridLayer.extend({
|
|
1863
|
+
createTile: function(n, s) {
|
|
1864
|
+
const l = document.createElement("div");
|
|
1865
|
+
return setTimeout(() => {
|
|
1866
|
+
s(null, l);
|
|
1867
|
+
const { se: o, nw: c } = r.getGridBounds({
|
|
1868
|
+
map: e,
|
|
1869
|
+
tileSize: this.getTileSize(),
|
|
1870
|
+
coords: n
|
|
1871
|
+
});
|
|
1872
|
+
t({
|
|
1873
|
+
swLat: o.lat,
|
|
1874
|
+
neLng: o.lng,
|
|
1875
|
+
neLat: c.lat,
|
|
1876
|
+
swLng: c.lng,
|
|
1877
|
+
coords: n,
|
|
1878
|
+
key: n.z + "-" + n.x + "-" + n.y
|
|
1879
|
+
});
|
|
1880
|
+
}, a), l;
|
|
1881
|
+
}
|
|
1882
|
+
}), L.gridLayer.gridDebug = function(n) {
|
|
1883
|
+
return new L.GridLayer.GridDebug(n);
|
|
1884
|
+
}, e.addLayer(L.gridLayer.gridDebug());
|
|
1885
|
+
}
|
|
1886
|
+
/**
|
|
1887
|
+
* Handle Native Dialogs
|
|
1888
|
+
* @type {function} handleDialog
|
|
1889
|
+
* @param {string|null} target - Selector that open the dialog
|
|
1890
|
+
* @param {string} id - Unique dialog id
|
|
1891
|
+
* @param {function|null} onOpen - Callback function called when dialog is opened
|
|
1892
|
+
* @param {function|null} onClose - Callback function called when dialog is closed
|
|
1893
|
+
* @param {boolean} disableOutsideClick - Disable dialog closing when clicking outside the dialog
|
|
1894
|
+
* @returns {{activators: NodeListOf<Element>, handleOpen: {function}, handleClose: {function}, ref: HTMLDialogElement}}
|
|
1895
|
+
*/
|
|
1896
|
+
static handleDialog({
|
|
1897
|
+
target: e = null,
|
|
1898
|
+
id: t = "",
|
|
1899
|
+
onOpen: a = null,
|
|
1900
|
+
onClose: r = null,
|
|
1901
|
+
disableOutsideClick: n = !1
|
|
1902
|
+
}) {
|
|
1903
|
+
const s = e ? document.querySelectorAll(e) : [], l = document.getElementById(t + "-dialog"), o = document.querySelectorAll("[data-dialog-close]"), c = ["closing", "closed", "opening", "opened", "removed"].reduce(
|
|
1904
|
+
(u, C) => ({
|
|
1905
|
+
...u,
|
|
1906
|
+
[C]: new Event(C)
|
|
1907
|
+
}),
|
|
1908
|
+
{}
|
|
1909
|
+
), h = new MutationObserver((u, C) => {
|
|
1910
|
+
u.forEach(async (w) => {
|
|
1911
|
+
if (w.attributeName === "open") {
|
|
1912
|
+
const f = w.target;
|
|
1913
|
+
if (!(f == null ? void 0 : f.hasAttribute("open"))) return;
|
|
1914
|
+
f == null || f.removeAttribute("inert"), f == null || f.dispatchEvent(c.opening), f && await H(f), f == null || f.dispatchEvent(c.opened);
|
|
1915
|
+
}
|
|
1916
|
+
});
|
|
1917
|
+
}), p = new MutationObserver((u, C) => {
|
|
1918
|
+
u.forEach((w) => {
|
|
1919
|
+
w.removedNodes.forEach((f) => {
|
|
1920
|
+
f.nodeName === "DIALOG" && (f.removeEventListener("click", b), f.removeEventListener("close", v), f.dispatchEvent(c.removed), p == null || p.disconnect(), h == null || h.disconnect());
|
|
1921
|
+
});
|
|
1922
|
+
});
|
|
1923
|
+
});
|
|
1924
|
+
l && (h.observe(l, {
|
|
1925
|
+
attributes: !0
|
|
1926
|
+
}), p.observe(document.body, {
|
|
1927
|
+
attributes: !1,
|
|
1928
|
+
subtree: !1,
|
|
1929
|
+
childList: !0
|
|
1930
|
+
}));
|
|
1931
|
+
const M = () => {
|
|
1932
|
+
l == null || l.showModal();
|
|
1933
|
+
}, v = async ({ target: u }) => {
|
|
1934
|
+
u == null || u.classList.add("closing"), u == null || u.setAttribute("inert", ""), u == null || u.dispatchEvent(c.closing), u && await H(u), u == null || u.classList.remove("closing"), u == null || u.dispatchEvent(c.closed);
|
|
1935
|
+
}, b = async ({ target: u }) => {
|
|
1936
|
+
(u == null ? void 0 : u.nodeName) === "DIALOG" && (l == null || l.close("outside"));
|
|
1937
|
+
}, H = (u) => Promise.allSettled(
|
|
1938
|
+
u == null ? void 0 : u.getAnimations().map((C) => C == null ? void 0 : C.finished)
|
|
1939
|
+
);
|
|
1940
|
+
return !n && (l == null || l.addEventListener("click", b)), l == null || l.addEventListener("close", v), s == null || s.forEach((u) => {
|
|
1941
|
+
u.addEventListener("click", (C) => {
|
|
1942
|
+
M(), a && a(C, l);
|
|
1943
|
+
});
|
|
1944
|
+
}), o == null || o.forEach((u) => {
|
|
1945
|
+
u.addEventListener("click", async (C) => {
|
|
1946
|
+
l == null || l.close("close"), r && r(C, l);
|
|
1947
|
+
});
|
|
1948
|
+
}), {
|
|
1949
|
+
activators: s,
|
|
1950
|
+
ref: l,
|
|
1951
|
+
handleOpen: M,
|
|
1952
|
+
handleClose: v
|
|
1953
|
+
};
|
|
1954
|
+
}
|
|
1955
|
+
static hasBoundsEntry(e, t = "bounds") {
|
|
1956
|
+
return m.getBoundsEntries(t).includes(e);
|
|
1957
|
+
}
|
|
1958
|
+
static initObserver(e, t, a = null) {
|
|
1959
|
+
if (!e)
|
|
1960
|
+
return;
|
|
1961
|
+
const r = (a == null ? void 0 : a.useBounding) ?? !1;
|
|
1962
|
+
new IntersectionObserver(async (s, l) => {
|
|
1963
|
+
r ? (s[0].isIntersecting || s[0].boundingClientRect.y < 0) && t({ obs: l, entry: s[0], entries: s }) : s[0].isIntersecting && t({ obs: l, entry: s[0], entries: s });
|
|
1964
|
+
}, a).observe(e);
|
|
1965
|
+
}
|
|
1966
|
+
static injectLink({ href: e, id: t }) {
|
|
1967
|
+
const a = document.createElement("link");
|
|
1968
|
+
a.href = e, a.type = "text/css", a.rel = "stylesheet", t && (a.id = t), document.getElementsByTagName("head")[0].appendChild(a);
|
|
1969
|
+
}
|
|
1970
|
+
static injectScript({ src: e, id: t = null, async: a = !0, module: r = !1 }) {
|
|
1971
|
+
return new Promise(function(n, s) {
|
|
1972
|
+
let l = document.getElementById(t);
|
|
1973
|
+
if (t && l && l.dataset.loaded === "true")
|
|
1974
|
+
return n({ alreadyLoaded: !0, id: t });
|
|
1975
|
+
l || (l = document.createElement("script"), l.src = e, l.dataset.loaded = "false", t && (l.id = t), l.type = r ? "module" : "text/javascript", l.async = a, document.body.appendChild(l), l.onload = () => (l.dataset.loaded = "true", n({ alreadyLoaded: !1, id: t })), l.onerror = () => s(!1));
|
|
1976
|
+
});
|
|
1977
|
+
}
|
|
1978
|
+
static isMobile({ selector: e = null, width: t = 640 } = {}) {
|
|
1979
|
+
var r;
|
|
1980
|
+
const a = document.querySelector(e);
|
|
1981
|
+
return ((r = a == null ? void 0 : a.getBoundingClientRect()) == null ? void 0 : r.width) ?? 0 < t;
|
|
1982
|
+
}
|
|
1983
|
+
static isMobileAndTablet() {
|
|
1984
|
+
return window.mobileAndTabletCheck = function() {
|
|
1985
|
+
let e = !1;
|
|
1986
|
+
return function(t) {
|
|
1987
|
+
(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(
|
|
1988
|
+
t
|
|
1989
|
+
) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
|
|
1990
|
+
t.substr(0, 4)
|
|
1991
|
+
)) && (e = !0);
|
|
1992
|
+
}(navigator.userAgent || navigator.vendor || window.opera), e;
|
|
1993
|
+
}, window.mobileAndTabletCheck();
|
|
1994
|
+
}
|
|
1995
|
+
static isNameCompany(e = null) {
|
|
1996
|
+
if (!e)
|
|
1997
|
+
return !1;
|
|
1998
|
+
const t = e.trim().toLowerCase();
|
|
1999
|
+
return t.includes("unknown") || t.includes("institute") || t.includes("bldg") || t.includes("llc") || t.includes("l l c") || t.includes(" inc") || t.includes(" co") || t.includes("univ") || t.includes("unvi") || t.includes(" fund") || t.includes(" union") || t.includes(" assoc") || t.includes(" corp") || t.includes("service") || t.includes("members") || t.includes("properties") || t.includes("management") || t.includes("investment") || t.includes("enterprise") || t.includes(" group") || t.includes(" group") || t.includes(" rent") || t.includes(" home") || t.includes(" cu") || t.includes(" inc") || t.includes("laborator") || t.includes("pharma") || t.includes("holding") || t.includes("worship") || t.includes("bank") || t.includes("agent") || t.includes("title") || t.includes("city ") || t.includes("technolo") || t.includes("estate") || t.includes("capital") || t.includes(" of ") || t.includes("trust");
|
|
2000
|
+
}
|
|
2001
|
+
static kFormat(e, t = 0) {
|
|
2002
|
+
if (!e)
|
|
2003
|
+
return null;
|
|
2004
|
+
const a = Math.abs(e), r = Math.sign(e);
|
|
2005
|
+
return a > 999999 ? r * (a / 1e6).toFixed(1) + "m" : a > 999 ? r * (a / 1e3).toFixed(t) + "k" : r * a;
|
|
2006
|
+
}
|
|
2007
|
+
static async logRequest(e = null, t = null, a = null, r = null, n = null) {
|
|
2008
|
+
const s = {
|
|
2009
|
+
name: e,
|
|
2010
|
+
uuid: t,
|
|
2011
|
+
ip: a,
|
|
2012
|
+
url: r,
|
|
2013
|
+
data: n
|
|
2014
|
+
};
|
|
2015
|
+
return await m.createData("/api/client?query=log/save&method=POST", s), null;
|
|
2016
|
+
}
|
|
2017
|
+
static loadAds() {
|
|
2018
|
+
window.dataLayer = window.dataLayer || [];
|
|
2019
|
+
const e = document.querySelectorAll(".adsbygoogle");
|
|
2020
|
+
window.ezstandalone = window.ezstandalone || {}, ezstandalone.cmd = ezstandalone.cmd || [];
|
|
2021
|
+
const t = [];
|
|
2022
|
+
for (let a = 0; a < e.length; a++)
|
|
2023
|
+
t.push(parseInt(e[a].dataset.adSlot));
|
|
2024
|
+
console.info("loadAds", t), t.length && ezstandalone.cmd.push(function() {
|
|
2025
|
+
ezstandalone.define(...t), ezstandalone.enable(), ezstandalone.display();
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
static async loadCustomScript({ name: e = null, id: t = "", module: a = !1 } = {}) {
|
|
2029
|
+
if (e) {
|
|
2030
|
+
const r = "/scripts/" + e + ".js?v=100.0.5";
|
|
2031
|
+
try {
|
|
2032
|
+
return await m.injectScript({
|
|
2033
|
+
src: r,
|
|
2034
|
+
id: t || e,
|
|
2035
|
+
async: !1,
|
|
2036
|
+
module: a
|
|
2037
|
+
});
|
|
2038
|
+
} catch (n) {
|
|
2039
|
+
console.error("loadCustomScript", n);
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
return null;
|
|
2043
|
+
}
|
|
2044
|
+
static async loadGoogleMapApi() {
|
|
2045
|
+
if (window.options.googleMapsLoaded === !0)
|
|
2046
|
+
return;
|
|
2047
|
+
const e = "https://maps.googleapis.com/maps/api/js", t = window.options.googleApiKey, a = e + "?key=" + t + "&libraries=marker&v=beta&callback=mapCb";
|
|
2048
|
+
await m.injectScript({ src: a, id: "googleapis", async: !1 });
|
|
2049
|
+
}
|
|
2050
|
+
static async loadLeafletApi() {
|
|
2051
|
+
const e = "https://unpkg.com/leaflet@1.9.3/dist", t = e + "/leaflet.js", a = e + "/leaflet.css", r = "//unpkg.com/leaflet-gesture-handling", n = "//unpkg.com/leaflet-gesture-handling/dist/leaflet-gesture-handling.min.css";
|
|
2052
|
+
await m.injectLink({ href: a, id: "leafletCss" }), await m.injectLink({ href: n, id: "gestureCss" }), await m.injectScript({ src: t, id: "leafletJs", async: !1 }), await m.injectScript({
|
|
2053
|
+
src: r,
|
|
2054
|
+
id: "gestureJs",
|
|
2055
|
+
async: !1
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2058
|
+
static async loadSwiper() {
|
|
2059
|
+
const e = "https://cdn.jsdelivr.net/npm", t = `${e}/swiper@9/swiper-bundle.min.js`, a = `${e}/swiper@9/swiper-bundle.min.css`;
|
|
2060
|
+
await m.injectLink({ href: a, id: "swiperCss" }), await m.injectScript({ src: t, id: "swiperJs", async: !1 });
|
|
2061
|
+
}
|
|
2062
|
+
static async makeSearchFetchCall(e) {
|
|
2063
|
+
try {
|
|
2064
|
+
return (await fetch(e, {
|
|
2065
|
+
method: "GET",
|
|
2066
|
+
headers: { "Content-Type": "application/json" }
|
|
2067
|
+
})).json();
|
|
2068
|
+
} catch (t) {
|
|
2069
|
+
console.error("performSearch", t, { url: e });
|
|
2070
|
+
}
|
|
2071
|
+
return [];
|
|
2072
|
+
}
|
|
2073
|
+
static money(e, t = "", a = 0) {
|
|
2074
|
+
return e === null ? t : Intl ? new Intl.NumberFormat("en-US", {
|
|
2075
|
+
style: "currency",
|
|
2076
|
+
currency: "USD",
|
|
2077
|
+
minimumFractionDigits: a,
|
|
2078
|
+
maximumFractionDigits: a
|
|
2079
|
+
}).format(e) : e;
|
|
2080
|
+
}
|
|
2081
|
+
static number(e, t = "", a = 0) {
|
|
2082
|
+
return e === null ? t : Intl ? new Intl.NumberFormat("en-US", {
|
|
2083
|
+
minimumFractionDigits: a,
|
|
2084
|
+
maximumFractionDigits: a
|
|
2085
|
+
}).format(e) : e;
|
|
2086
|
+
}
|
|
2087
|
+
static objToQp(e) {
|
|
2088
|
+
const {
|
|
2089
|
+
name: t = null,
|
|
2090
|
+
first: a = null,
|
|
2091
|
+
middle: r = null,
|
|
2092
|
+
last: n = null,
|
|
2093
|
+
min: s = null,
|
|
2094
|
+
max: l = null,
|
|
2095
|
+
city: o = null,
|
|
2096
|
+
state: c = null,
|
|
2097
|
+
vin: h = null,
|
|
2098
|
+
license: p = null,
|
|
2099
|
+
token: M = null,
|
|
2100
|
+
phone: v = null
|
|
2101
|
+
} = e || {}, b = t && t !== "", H = s && s !== "" && s !== "18", u = l && l !== "" && s !== "99";
|
|
2102
|
+
let C = [];
|
|
2103
|
+
return t && t !== "" && C.push("name=" + t), b || (a && a !== "" && C.push("first=" + a), r && r !== "" && C.push("middle=" + r), n && n !== "" && C.push("last=" + n)), H && u ? parseInt(s) > parseInt(l) ? (C.push("min=" + l), C.push("max=" + s)) : (C.push("min=" + s), C.push("max=" + l)) : (H && C.push("min=" + s), u && C.push("max=" + l)), v && v !== "" && C.push("phone=" + v), o && o !== "" && C.push("city=" + o), p && p !== "" && C.push("license=" + p), h && h !== "" && C.push("vin=" + h), c && c !== "" && C.push("state=" + c), M && M !== "" && C.push("token=" + M), C.join("&");
|
|
2104
|
+
}
|
|
2105
|
+
static padTo2Digits(e) {
|
|
2106
|
+
return e.toString().padStart(2, "0");
|
|
2107
|
+
}
|
|
2108
|
+
static async performSearch(e = null, t = {}) {
|
|
2099
2109
|
if (!e)
|
|
2100
|
-
return
|
|
2101
|
-
|
|
2102
|
-
|
|
2110
|
+
return [];
|
|
2111
|
+
if (1 > e.trim().length)
|
|
2112
|
+
return [];
|
|
2113
|
+
const {
|
|
2114
|
+
addressesOnly: a = !1,
|
|
2115
|
+
useCitySearch: r = !1,
|
|
2116
|
+
useCityStateSearch: n = !1,
|
|
2117
|
+
useSearch: s = !1,
|
|
2118
|
+
useLocation: l = !0,
|
|
2119
|
+
state: o = ""
|
|
2120
|
+
} = t ?? {}, { tolken: c = null, ip: h = null } = await m.getHeaders(), M = [
|
|
2121
|
+
"query=" + encodeURIComponent(this.cleanupAddress(e)),
|
|
2122
|
+
"addressesOnly=" + a,
|
|
2123
|
+
"useSearch=" + s,
|
|
2124
|
+
"useCitySearch=" + r,
|
|
2125
|
+
"useCityStateSearch=" + n,
|
|
2126
|
+
"useLocation=" + l
|
|
2127
|
+
];
|
|
2128
|
+
o && o !== "" && !n && M.push("state=" + o), c && c !== "" && M.push("tolken=" + c), h && h !== "" && M.push("ip=" + h);
|
|
2129
|
+
const v = M.join("&"), H = (r || n ? "/api/autocomplete-city" : "/api/autocomplete") + "?" + v;
|
|
2130
|
+
return await m.makeSearchFetchCall(H);
|
|
2131
|
+
}
|
|
2132
|
+
static removeElements(e) {
|
|
2133
|
+
document.querySelectorAll(e).forEach((t) => t == null ? void 0 : t.remove());
|
|
2134
|
+
}
|
|
2135
|
+
static removeNullFromObject(e) {
|
|
2136
|
+
return Object.keys(e).filter((t) => e[t]).reduce((t, a) => (t[a] = e[a], t), {});
|
|
2137
|
+
}
|
|
2138
|
+
static s(e) {
|
|
2139
|
+
return Math.round(e) > 1 ? "s" : "";
|
|
2140
|
+
}
|
|
2141
|
+
static scrollWheelZoom(e) {
|
|
2142
|
+
e.scrollWheelZoom.disable(), e.on("focus", () => {
|
|
2143
|
+
e.scrollWheelZoom.enable();
|
|
2144
|
+
}), e.on("blur", () => {
|
|
2145
|
+
e.scrollWheelZoom.disable();
|
|
2146
|
+
});
|
|
2147
|
+
}
|
|
2148
|
+
static searchInStates(e) {
|
|
2149
|
+
const t = m.getStates(), a = e.toLowerCase();
|
|
2150
|
+
let r = t.find((n) => n.short.toLowerCase() === a) ?? null;
|
|
2151
|
+
return r || (r = t.find((n) => n.name.toLowerCase() === a) ?? null), r;
|
|
2152
|
+
}
|
|
2153
|
+
static sendWoopraEvent(e, t) {
|
|
2154
|
+
typeof woopra == "object" && woopra.track(e, t);
|
|
2155
|
+
}
|
|
2156
|
+
static setBoundsEntries(e, t = "bounds") {
|
|
2157
|
+
const a = m.getBoundsEntries(t);
|
|
2158
|
+
a.push(e), localStorage.setItem(t, JSON.stringify(a));
|
|
2159
|
+
}
|
|
2160
|
+
static async setCityState(e = null) {
|
|
2161
|
+
let { cityState: t = null } = e ?? {};
|
|
2162
|
+
if (!t)
|
|
2163
|
+
return e;
|
|
2164
|
+
t = t.toLowerCase().replace(" usa", "").replace("city or state", "").replace(" state", "").trim();
|
|
2165
|
+
let [a = null, r = null] = t.split(",").map((n) => n.trim());
|
|
2103
2166
|
if (m.getStates(), a && !r) {
|
|
2104
2167
|
const n = this.searchInStates(a);
|
|
2105
2168
|
n && (a = null, r = n.short);
|
|
@@ -2115,37 +2178,46 @@ class m {
|
|
|
2115
2178
|
l && (r = l.short, a = n.slice(0, -1).join(" "));
|
|
2116
2179
|
}
|
|
2117
2180
|
}
|
|
2118
|
-
return a && r && a.toLowerCase() === r.toLowerCase() && (a = null),
|
|
2181
|
+
return a && r && a.toLowerCase() === r.toLowerCase() && (a = null), e.city = a, e.state = r ? r.toUpperCase() : null, e;
|
|
2119
2182
|
}
|
|
2120
|
-
static
|
|
2121
|
-
|
|
2122
|
-
let r = e.find((n) => n.short.toLowerCase() === a) ?? null;
|
|
2123
|
-
return r || (r = e.find((n) => n.name.toLowerCase() === a) ?? null), r;
|
|
2183
|
+
static async setSearchValueClient(e, t = "recsSearchValue") {
|
|
2184
|
+
localStorage.setItem(t, JSON.stringify(e)), await m.createData(`/api/cookie/create?name=${t}`, e);
|
|
2124
2185
|
}
|
|
2125
|
-
static
|
|
2126
|
-
|
|
2127
|
-
|
|
2186
|
+
static stickyHeader(e = ".nav") {
|
|
2187
|
+
const t = document.querySelector(e);
|
|
2188
|
+
if (!t)
|
|
2189
|
+
return;
|
|
2190
|
+
new IntersectionObserver(
|
|
2191
|
+
([r]) => {
|
|
2192
|
+
r && (r.intersectionRatio < 1 ? t.classList.add("intersecting") : t.classList.remove("intersecting"));
|
|
2193
|
+
},
|
|
2194
|
+
{ threshold: 1 }
|
|
2195
|
+
).observe(t);
|
|
2128
2196
|
}
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
if (e
|
|
2138
|
-
return
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2197
|
+
// Converts numeric degrees to radians
|
|
2198
|
+
static toRad(e) {
|
|
2199
|
+
return e * Math.PI / 180;
|
|
2200
|
+
}
|
|
2201
|
+
static toSlug(e) {
|
|
2202
|
+
return e.toString().trim().toLowerCase().split(":").join("-").split("'").join("").replace("‘", "");
|
|
2203
|
+
}
|
|
2204
|
+
static ucFirst(e = null) {
|
|
2205
|
+
if (!e)
|
|
2206
|
+
return null;
|
|
2207
|
+
const t = e.toLowerCase();
|
|
2208
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
2209
|
+
}
|
|
2210
|
+
static useLayerTitle(e, t) {
|
|
2211
|
+
const a = m.getLayerTitle(e);
|
|
2212
|
+
L.tileLayer(a, {
|
|
2213
|
+
maxNativeZoom: 19,
|
|
2214
|
+
maxZoom: 25,
|
|
2215
|
+
subdomains: ["mt0", "mt1", "mt2", "mt3"],
|
|
2216
|
+
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
|
2217
|
+
}).addTo(t);
|
|
2218
|
+
}
|
|
2219
|
+
static ucWords(e) {
|
|
2220
|
+
return e ? e.toString().split(" ").map((t) => m.ucFirst(t)).join(" ") : null;
|
|
2149
2221
|
}
|
|
2150
2222
|
}
|
|
2151
2223
|
export {
|
|
@@ -2165,8 +2237,8 @@ export {
|
|
|
2165
2237
|
p1 as LoadingBar,
|
|
2166
2238
|
m1 as Popover,
|
|
2167
2239
|
H1 as ProgressBar,
|
|
2168
|
-
|
|
2169
|
-
|
|
2240
|
+
L1 as Radio,
|
|
2241
|
+
C1 as Select,
|
|
2170
2242
|
M1 as Skeleton,
|
|
2171
2243
|
f1 as Slider,
|
|
2172
2244
|
V1 as Spinner,
|