@partbot/stockist-map 0.1.7 → 0.1.9

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,87 +1,120 @@
1
- var ce = Object.defineProperty;
2
- var ue = (e, t, s) => t in e ? ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var P = (e, t, s) => ue(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { jsxs as g, jsx as l } from "react/jsx-runtime";
1
+ var ue = Object.defineProperty;
2
+ var de = (e, t, r) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var H = (e, t, r) => de(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { jsxs as f, jsx as i } from "react/jsx-runtime";
5
5
  import { createRoot as J } from "react-dom/client";
6
- import * as n from "react";
7
- import { createContext as de } from "react";
8
- const pe = de({
6
+ import * as s from "react";
7
+ import { createContext as pe } from "react";
8
+ const be = pe({
9
9
  color: "currentColor",
10
10
  size: "1em",
11
11
  weight: "regular",
12
12
  mirrored: !1
13
- }), X = n.forwardRef(
13
+ }), q = s.forwardRef(
14
14
  (e, t) => {
15
15
  const {
16
- alt: s,
17
- color: r,
18
- size: i,
19
- weight: d,
20
- mirrored: O,
16
+ alt: r,
17
+ color: n,
18
+ size: l,
19
+ weight: p,
20
+ mirrored: Z,
21
21
  children: c,
22
22
  weights: N,
23
23
  ...v
24
24
  } = e, {
25
- color: A = "currentColor",
26
- size: C,
25
+ color: L = "currentColor",
26
+ size: A,
27
27
  weight: x = "regular",
28
- mirrored: R = !1,
29
- ...k
30
- } = n.useContext(pe);
31
- return /* @__PURE__ */ n.createElement(
28
+ mirrored: T = !1,
29
+ ...E
30
+ } = s.useContext(be);
31
+ return /* @__PURE__ */ s.createElement(
32
32
  "svg",
33
33
  {
34
34
  ref: t,
35
35
  xmlns: "http://www.w3.org/2000/svg",
36
- width: i ?? C,
37
- height: i ?? C,
38
- fill: r ?? A,
36
+ width: l ?? A,
37
+ height: l ?? A,
38
+ fill: n ?? L,
39
39
  viewBox: "0 0 256 256",
40
- transform: O || R ? "scale(-1, 1)" : void 0,
41
- ...k,
40
+ transform: Z || T ? "scale(-1, 1)" : void 0,
41
+ ...E,
42
42
  ...v
43
43
  },
44
- !!s && /* @__PURE__ */ n.createElement("title", null, s),
44
+ !!r && /* @__PURE__ */ s.createElement("title", null, r),
45
45
  c,
46
- N.get(d ?? x)
46
+ N.get(p ?? x)
47
47
  );
48
48
  }
49
49
  );
50
- X.displayName = "IconBase";
51
- const be = /* @__PURE__ */ new Map([
50
+ q.displayName = "IconBase";
51
+ const fe = /* @__PURE__ */ new Map([
52
52
  [
53
53
  "bold",
54
- /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M238.7,102.46,62.81,37.21l-.25-.09A20,20,0,0,0,37.12,62.56l.09.25L102.46,238.7A20,20,0,0,0,121.3,252h.35a20,20,0,0,0,18.77-14.12l.09-.29,21.23-75.85,75.85-21.23.29-.09a20,20,0,0,0,.82-38Zm-89.93,38a12,12,0,0,0-8.32,8.32l-19.68,70.29L62.8,62.8l156.26,58Z" }))
54
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M238.7,102.46,62.81,37.21l-.25-.09A20,20,0,0,0,37.12,62.56l.09.25L102.46,238.7A20,20,0,0,0,121.3,252h.35a20,20,0,0,0,18.77-14.12l.09-.29,21.23-75.85,75.85-21.23.29-.09a20,20,0,0,0,.82-38Zm-89.93,38a12,12,0,0,0-8.32,8.32l-19.68,70.29L62.8,62.8l156.26,58Z" }))
55
55
  ],
56
56
  [
57
57
  "duotone",
58
- /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
58
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
59
59
  "path",
60
60
  {
61
61
  d: "M234.35,129,152,152,129,234.35a8,8,0,0,1-15.21.27l-65.28-176A8,8,0,0,1,58.63,48.46l176,65.28A8,8,0,0,1,234.35,129Z",
62
62
  opacity: "0.2"
63
63
  }
64
- ), /* @__PURE__ */ n.createElement("path", { d: "M237.33,106.21,61.41,41l-.16-.05A16,16,0,0,0,40.9,61.25a1,1,0,0,0,.05.16l65.26,175.92A15.77,15.77,0,0,0,121.28,248h.3a15.77,15.77,0,0,0,15-11.29l.06-.2,21.84-78,78-21.84.2-.06a16,16,0,0,0,.62-30.38ZM149.84,144.3a8,8,0,0,0-5.54,5.54L121.3,232l-.06-.17L56,56l175.82,65.22.16.06Z" }))
64
+ ), /* @__PURE__ */ s.createElement("path", { d: "M237.33,106.21,61.41,41l-.16-.05A16,16,0,0,0,40.9,61.25a1,1,0,0,0,.05.16l65.26,175.92A15.77,15.77,0,0,0,121.28,248h.3a15.77,15.77,0,0,0,15-11.29l.06-.2,21.84-78,78-21.84.2-.06a16,16,0,0,0,.62-30.38ZM149.84,144.3a8,8,0,0,0-5.54,5.54L121.3,232l-.06-.17L56,56l175.82,65.22.16.06Z" }))
65
65
  ],
66
66
  [
67
67
  "fill",
68
- /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M248,121.58a15.76,15.76,0,0,1-11.29,15l-.2.06-78,21.84-21.84,78-.06.2a15.77,15.77,0,0,1-15,11.29h-.3a15.77,15.77,0,0,1-15.07-10.67L41,61.41a1,1,0,0,1-.05-.16A16,16,0,0,1,61.25,40.9l.16.05,175.92,65.26A15.78,15.78,0,0,1,248,121.58Z" }))
68
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M248,121.58a15.76,15.76,0,0,1-11.29,15l-.2.06-78,21.84-21.84,78-.06.2a15.77,15.77,0,0,1-15,11.29h-.3a15.77,15.77,0,0,1-15.07-10.67L41,61.41a1,1,0,0,1-.05-.16A16,16,0,0,1,61.25,40.9l.16.05,175.92,65.26A15.78,15.78,0,0,1,248,121.58Z" }))
69
69
  ],
70
70
  [
71
71
  "light",
72
- /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M236.65,108.1,60.72,42.83l-.13,0A14,14,0,0,0,42.78,60.59s0,.09,0,.13L108.1,236.65A13.77,13.77,0,0,0,121.28,246h.26a13.8,13.8,0,0,0,13.14-9.88l0-.15,22.14-79.1L236,134.73l.15,0a14,14,0,0,0,.53-26.58Zm-4,15.1-82.26,23a6,6,0,0,0-4.16,4.16l-23,82.26a1.85,1.85,0,0,1-1.86,1.36,1.82,1.82,0,0,1-1.92-1.35.61.61,0,0,0,0-.12L54.11,56.62a2,2,0,0,1,2.51-2.51l175.91,65.26.12,0a2,2,0,0,1,0,3.79Z" }))
72
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M236.65,108.1,60.72,42.83l-.13,0A14,14,0,0,0,42.78,60.59s0,.09,0,.13L108.1,236.65A13.77,13.77,0,0,0,121.28,246h.26a13.8,13.8,0,0,0,13.14-9.88l0-.15,22.14-79.1L236,134.73l.15,0a14,14,0,0,0,.53-26.58Zm-4,15.1-82.26,23a6,6,0,0,0-4.16,4.16l-23,82.26a1.85,1.85,0,0,1-1.86,1.36,1.82,1.82,0,0,1-1.92-1.35.61.61,0,0,0,0-.12L54.11,56.62a2,2,0,0,1,2.51-2.51l175.91,65.26.12,0a2,2,0,0,1,0,3.79Z" }))
73
73
  ],
74
74
  [
75
75
  "regular",
76
- /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M237.33,106.21,61.41,41l-.16-.05A16,16,0,0,0,40.9,61.25a1,1,0,0,0,.05.16l65.26,175.92A15.77,15.77,0,0,0,121.28,248h.3a15.77,15.77,0,0,0,15-11.29l.06-.2,21.84-78,78-21.84.2-.06a16,16,0,0,0,.62-30.38ZM149.84,144.3a8,8,0,0,0-5.54,5.54L121.3,232l-.06-.17L56,56l175.82,65.22.16.06Z" }))
76
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M237.33,106.21,61.41,41l-.16-.05A16,16,0,0,0,40.9,61.25a1,1,0,0,0,.05.16l65.26,175.92A15.77,15.77,0,0,0,121.28,248h.3a15.77,15.77,0,0,0,15-11.29l.06-.2,21.84-78,78-21.84.2-.06a16,16,0,0,0,.62-30.38ZM149.84,144.3a8,8,0,0,0-5.54,5.54L121.3,232l-.06-.17L56,56l175.82,65.22.16.06Z" }))
77
77
  ],
78
78
  [
79
79
  "thin",
80
- /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("path", { d: "M236,110,59.93,44.67A12,12,0,0,0,44.69,60L110,235.93A11.83,11.83,0,0,0,121.28,244h.22a11.82,11.82,0,0,0,11.26-8.47l0-.1,22.45-80.19,80.19-22.44.1,0A12,12,0,0,0,236,110Zm-2.79,15.12-82.3,23a4,4,0,0,0-2.78,2.77l-23,82.3a3.88,3.88,0,0,1-3.74,2.78,4,4,0,0,1-3.88-2.77L52.22,57.32a3.93,3.93,0,0,1,1-4.14A4,4,0,0,1,56,52a3.86,3.86,0,0,1,1.25.21l176.08,65.32a4,4,0,0,1-.09,7.59Z" }))
80
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M236,110,59.93,44.67A12,12,0,0,0,44.69,60L110,235.93A11.83,11.83,0,0,0,121.28,244h.22a11.82,11.82,0,0,0,11.26-8.47l0-.1,22.45-80.19,80.19-22.44.1,0A12,12,0,0,0,236,110Zm-2.79,15.12-82.3,23a4,4,0,0,0-2.78,2.77l-23,82.3a3.88,3.88,0,0,1-3.74,2.78,4,4,0,0,1-3.88-2.77L52.22,57.32a3.93,3.93,0,0,1,1-4.14A4,4,0,0,1,56,52a3.86,3.86,0,0,1,1.25.21l176.08,65.32a4,4,0,0,1-.09,7.59Z" }))
81
81
  ]
82
- ]), ee = n.forwardRef((e, t) => /* @__PURE__ */ n.createElement(X, { ref: t, ...e, weights: be }));
82
+ ]), ee = s.forwardRef((e, t) => /* @__PURE__ */ s.createElement(q, { ref: t, ...e, weights: fe }));
83
83
  ee.displayName = "NavigationArrowIcon";
84
- const fe = "https://tile.openstreetmap.org/{z}/{x}/{y}.png", te = "https://basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}@2x.png", se = "OpenStreetMap contributors, CARTO", re = "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json", q = {
84
+ const he = /* @__PURE__ */ new Map([
85
+ [
86
+ "bold",
87
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z" }))
88
+ ],
89
+ [
90
+ "duotone",
91
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
92
+ "path",
93
+ {
94
+ d: "M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",
95
+ opacity: "0.2"
96
+ }
97
+ ), /* @__PURE__ */ s.createElement("path", { d: "M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))
98
+ ],
99
+ [
100
+ "fill",
101
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))
102
+ ],
103
+ [
104
+ "light",
105
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z" }))
106
+ ],
107
+ [
108
+ "regular",
109
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))
110
+ ],
111
+ [
112
+ "thin",
113
+ /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("path", { d: "M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z" }))
114
+ ]
115
+ ]), te = s.forwardRef((e, t) => /* @__PURE__ */ s.createElement(q, { ref: t, ...e, weights: he }));
116
+ te.displayName = "XIcon";
117
+ const me = "https://tile.openstreetmap.org/{z}/{x}/{y}.png", se = "https://basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}@2x.png", re = "OpenStreetMap contributors, CARTO", ne = "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json", D = {
85
118
  primaryColor: "#111111",
86
119
  markerColor: "#111111",
87
120
  borderRadius: 8,
@@ -89,95 +122,95 @@ const fe = "https://tile.openstreetmap.org/{z}/{x}/{y}.png", te = "https://basem
89
122
  defaultZoom: 5,
90
123
  defaultCenter: { lat: -25.2744, lng: 133.7751 },
91
124
  darkMode: !1,
92
- styleUrl: re,
125
+ styleUrl: ne,
93
126
  mapPalette: "monotone",
94
- tileUrl: te,
95
- tileAttribution: se
127
+ tileUrl: se,
128
+ tileAttribution: re
96
129
  };
97
- function F(e) {
98
- const t = e.trim().replace(/^#/, ""), s = t.length === 3 ? t.split("").map((r) => `${r}${r}`).join("") : t;
99
- return /^[0-9a-f]{6}$/i.test(s) ? {
100
- r: Number.parseInt(s.slice(0, 2), 16),
101
- g: Number.parseInt(s.slice(2, 4), 16),
102
- b: Number.parseInt(s.slice(4, 6), 16)
130
+ function B(e) {
131
+ const t = e.trim().replace(/^#/, ""), r = t.length === 3 ? t.split("").map((n) => `${n}${n}`).join("") : t;
132
+ return /^[0-9a-f]{6}$/i.test(r) ? {
133
+ r: Number.parseInt(r.slice(0, 2), 16),
134
+ g: Number.parseInt(r.slice(2, 4), 16),
135
+ b: Number.parseInt(r.slice(4, 6), 16)
103
136
  } : null;
104
137
  }
105
- function $({ r: e, g: t, b: s }) {
106
- const r = [e, t, s].map((i) => {
107
- const d = i / 255;
108
- return d <= 0.03928 ? d / 12.92 : ((d + 0.055) / 1.055) ** 2.4;
138
+ function P({ r: e, g: t, b: r }) {
139
+ const n = [e, t, r].map((l) => {
140
+ const p = l / 255;
141
+ return p <= 0.03928 ? p / 12.92 : ((p + 0.055) / 1.055) ** 2.4;
109
142
  });
110
- return 0.2126 * r[0] + 0.7152 * r[1] + 0.0722 * r[2];
143
+ return 0.2126 * n[0] + 0.7152 * n[1] + 0.0722 * n[2];
111
144
  }
112
- function j(e, t) {
113
- const s = Math.max($(e), $(t)), r = Math.min($(e), $(t));
114
- return (s + 0.05) / (r + 0.05);
145
+ function V(e, t) {
146
+ const r = Math.max(P(e), P(t)), n = Math.min(P(e), P(t));
147
+ return (r + 0.05) / (n + 0.05);
115
148
  }
116
- function he(e, t = "#111111", s = "#ffffff") {
117
- const r = F(e), i = F(t), d = F(s);
118
- return !r || !i || !d ? s : j(r, i) >= j(r, d) ? t : s;
149
+ function ge(e, t = "#111111", r = "#ffffff") {
150
+ const n = B(e), l = B(t), p = B(r);
151
+ return !n || !l || !p ? r : V(n, l) >= V(n, p) ? t : r;
119
152
  }
120
- function me(e = {}) {
153
+ function xe(e = {}) {
121
154
  return {
122
- ...q,
155
+ ...D,
123
156
  ...e,
124
157
  defaultCenter: {
125
- ...q.defaultCenter,
158
+ ...D.defaultCenter,
126
159
  ...e.defaultCenter || {}
127
160
  },
128
- styleUrl: e.styleUrl || re,
161
+ styleUrl: e.styleUrl || ne,
129
162
  mapPalette: e.mapPalette || "monotone",
130
- borderRadius: Number.isFinite(Number(e.borderRadius)) ? Number(e.borderRadius) : q.borderRadius,
131
- tileUrl: !e.tileUrl || e.tileUrl === fe ? te : e.tileUrl,
132
- tileAttribution: e.tileAttribution || se,
163
+ borderRadius: Number.isFinite(Number(e.borderRadius)) ? Number(e.borderRadius) : D.borderRadius,
164
+ tileUrl: !e.tileUrl || e.tileUrl === me ? se : e.tileUrl,
165
+ tileAttribution: e.tileAttribution || re,
133
166
  radiusUnit: "km"
134
167
  };
135
168
  }
136
- function ge(e, t) {
169
+ function ye(e, t) {
137
170
  return `/v1/stockist_maps/${encodeURIComponent(e)}/config`;
138
171
  }
139
- function xe(e, t = {}) {
140
- const s = typeof window > "u" ? "http://localhost" : window.location.href, r = new URL(e, s);
141
- return t.query && r.searchParams.set("q", t.query), t.limit && r.searchParams.set("limit", String(t.limit)), t.center && (r.searchParams.set("lat", String(t.center.lat)), r.searchParams.set("lng", String(t.center.lng))), t.radiusKm && r.searchParams.set("radius_km", String(t.radiusKm)), t.category && r.searchParams.set("category", t.category), t.locationSearch && r.searchParams.set("location_search", "true"), r.toString();
172
+ function we(e, t = {}) {
173
+ const r = typeof window > "u" ? "http://localhost" : window.location.href, n = new URL(e, r);
174
+ return t.query && n.searchParams.set("q", t.query), t.limit && n.searchParams.set("limit", String(t.limit)), t.center && (n.searchParams.set("lat", String(t.center.lat)), n.searchParams.set("lng", String(t.center.lng))), t.radiusKm && n.searchParams.set("radius_km", String(t.radiusKm)), t.category && n.searchParams.set("category", t.category), t.locationSearch && n.searchParams.set("location_search", "true"), n.toString();
142
175
  }
143
- async function ye(e) {
176
+ async function ve(e) {
144
177
  const t = await fetch(e, { headers: { Accept: "application/json" } });
145
178
  if (!t.ok) throw new Error(`Could not load stockist map config (${t.status})`);
146
179
  return t.json();
147
180
  }
148
- async function we(e, t = {}) {
149
- const s = await fetch(xe(e, t), { headers: { Accept: "application/json" } });
150
- if (!s.ok) throw new Error(`Could not search stockists (${s.status})`);
151
- const r = await s.json();
181
+ async function Ee(e, t = {}) {
182
+ const r = await fetch(we(e, t), { headers: { Accept: "application/json" } });
183
+ if (!r.ok) throw new Error(`Could not search stockists (${r.status})`);
184
+ const n = await r.json();
152
185
  return {
153
- hits: Array.isArray(r.hits) ? r.hits : [],
154
- estimatedTotalHits: Number(r.estimatedTotalHits || 0),
155
- center: r.center || null,
156
- resolvedQuery: r.resolvedQuery || null
186
+ hits: Array.isArray(n.hits) ? n.hits : [],
187
+ estimatedTotalHits: Number(n.estimatedTotalHits || 0),
188
+ center: n.center || null,
189
+ resolvedQuery: n.resolvedQuery || null
157
190
  };
158
191
  }
159
- const ve = 6371;
160
- function H(e) {
192
+ const ke = 6371;
193
+ function $(e) {
161
194
  return e * Math.PI / 180;
162
195
  }
163
- function ke(e, t) {
164
- const s = H(t.lat - e.lat), r = H(t.lng - e.lng), i = Math.sin(s / 2) ** 2 + Math.cos(H(e.lat)) * Math.cos(H(t.lat)) * Math.sin(r / 2) ** 2;
165
- return 2 * ve * Math.atan2(Math.sqrt(i), Math.sqrt(1 - i));
196
+ function Se(e, t) {
197
+ const r = $(t.lat - e.lat), n = $(t.lng - e.lng), l = Math.sin(r / 2) ** 2 + Math.cos($(e.lat)) * Math.cos($(t.lat)) * Math.sin(n / 2) ** 2;
198
+ return 2 * ke * Math.atan2(Math.sqrt(l), Math.sqrt(1 - l));
166
199
  }
167
- function Ee(e) {
200
+ function Le(e) {
168
201
  return `${e.toFixed(1)} km`;
169
202
  }
170
- function Se(e) {
203
+ function Ae(e) {
171
204
  const t = ["localhost", "127.0.0.1", "::1"].includes(window.location.hostname);
172
205
  return window.location.protocol !== "https:" && !t ? "Browser location is blocked on this local Partbot domain. Chrome and Brave only allow location access on HTTPS, localhost, or origins manually trusted in browser flags." : e.code === e.PERMISSION_DENIED ? "Location permission is blocked for this site. Allow location access in your browser settings, then try again." : e.code === e.POSITION_UNAVAILABLE ? "Your browser could not determine your location. Try again, or search by suburb or postcode." : e.code === e.TIMEOUT ? "Finding your location timed out. Try again, or search by suburb or postcode." : `Browser location failed with error code ${e.code}. Try again, or search by suburb or postcode.`;
173
206
  }
174
- function Ae(e) {
207
+ function Me(e) {
175
208
  const t = e == null ? void 0 : e.trim();
176
209
  if (!t || t.startsWith("/") && !t.startsWith("//")) return null;
177
- const s = t.startsWith("//") ? `https:${t}` : /^[a-z][a-z\d+.-]*:/i.test(t) ? t : `https://${t}`;
210
+ const r = t.startsWith("//") ? `https:${t}` : /^[a-z][a-z\d+.-]*:/i.test(t) ? t : `https://${t}`;
178
211
  try {
179
- const r = new URL(s);
180
- return r.protocol === "http:" || r.protocol === "https:" ? r.toString() : null;
212
+ const n = new URL(r);
213
+ return n.protocol === "http:" || n.protocol === "https:" ? n.toString() : null;
181
214
  } catch {
182
215
  return null;
183
216
  }
@@ -185,158 +218,158 @@ function Ae(e) {
185
218
  function Ce(e) {
186
219
  return `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(`${e.lat},${e.lng}`)}`;
187
220
  }
188
- function Te(e) {
221
+ function Ne(e) {
189
222
  return e.stockist_id ?? e.id;
190
223
  }
191
- function Me(e) {
224
+ function Te(e) {
192
225
  const t = /* @__PURE__ */ new Set();
193
- return e.filter((s) => {
194
- const r = Te(s);
195
- return t.has(r) ? !1 : (t.add(r), !0);
226
+ return e.filter((r) => {
227
+ const n = Ne(r);
228
+ return t.has(n) ? !1 : (t.add(n), !0);
196
229
  });
197
230
  }
198
- const Ne = 3, Re = 100, W = 50, Ie = 350;
231
+ const Re = 3, Ie = 100, W = 50, _e = 350;
199
232
  function G(e) {
200
233
  return e.display_address || e.address;
201
234
  }
202
- function Le(e) {
235
+ function Ue(e) {
203
236
  var t;
204
237
  return (t = e.categories) != null && t.length ? e.categories : e.category ? [e.category] : [];
205
238
  }
206
- function _e(e, t) {
207
- const s = t == null ? void 0 : t[e];
208
- return s ? {
209
- "--pbss-category-color": s,
210
- "--pbss-category-contrast": he(s)
239
+ function ze(e, t) {
240
+ const r = t == null ? void 0 : t[e];
241
+ return r ? {
242
+ "--pbss-category-color": r,
243
+ "--pbss-category-contrast": ge(r)
211
244
  } : void 0;
212
245
  }
213
- function Ue(e, t) {
214
- const s = t ? e.map((r) => ({ ...r, distanceKm: ke(t, r._geo) })).sort((r, i) => (r.distanceKm || 0) - (i.distanceKm || 0)) : e;
215
- return Me(s).slice(0, Ne);
246
+ function He(e, t) {
247
+ const r = t ? e.map((n) => ({ ...n, distanceKm: Se(t, n._geo) })).sort((n, l) => (n.distanceKm || 0) - (l.distanceKm || 0)) : e;
248
+ return Te(r).slice(0, Re);
216
249
  }
217
- function ne({
250
+ function ae({
218
251
  token: e,
219
252
  configUrl: t,
220
- config: s,
221
- theme: r,
222
- initialQuery: i = "",
223
- viewAllUrl: d = "/pages/stockists",
224
- className: O = ""
253
+ config: r,
254
+ theme: n,
255
+ initialQuery: l = "",
256
+ viewAllUrl: p = "/pages/stockists",
257
+ className: Z = ""
225
258
  }) {
226
- const [c, N] = n.useState(s || null), [v, A] = n.useState(i), [C, x] = n.useState(
227
- i.trim() ? "typed" : null
228
- ), [R, k] = n.useState([]), [I, L] = n.useState(!1), [E, S] = n.useState(!1), [ae, p] = n.useState(!1), [K, y] = n.useState(!1), [_, f] = n.useState(null), T = n.useRef(null), h = n.useRef(0), w = n.useRef(0), M = n.useRef(null), Z = n.useId(), D = n.useMemo(
229
- () => me({ ...(c == null ? void 0 : c.theme) || {}, ...r || {} }),
230
- [c == null ? void 0 : c.theme, r]
231
- ), b = n.useCallback(() => {
232
- M.current && (clearTimeout(M.current), M.current = null);
233
- }, []), U = n.useCallback(() => {
234
- h.current += 1, b(), k([]), L(!1), y(!1), f(null), p(!1);
235
- }, [b]), z = n.useCallback(
236
- async ({ activeQuery: o, center: a }) => {
259
+ const [c, N] = s.useState(r || null), [v, L] = s.useState(l), [A, x] = s.useState(
260
+ l.trim() ? "typed" : null
261
+ ), [T, E] = s.useState([]), [R, I] = s.useState(!1), [k, S] = s.useState(!1), [ie, d] = s.useState(!1), [K, y] = s.useState(!1), [_, h] = s.useState(null), M = s.useRef(null), m = s.useRef(0), w = s.useRef(0), C = s.useRef(null), j = s.useId(), F = s.useMemo(
262
+ () => xe({ ...(c == null ? void 0 : c.theme) || {}, ...n || {} }),
263
+ [c == null ? void 0 : c.theme, n]
264
+ ), b = s.useCallback(() => {
265
+ C.current && (clearTimeout(C.current), C.current = null);
266
+ }, []), U = s.useCallback(() => {
267
+ m.current += 1, b(), E([]), I(!1), y(!1), h(null), d(!1);
268
+ }, [b]), z = s.useCallback(
269
+ async ({ activeQuery: a, center: o }) => {
237
270
  if (!c) return;
238
- const u = h.current + 1;
239
- h.current = u, b(), L(!0), y(!0), f(null), p(!0);
271
+ const u = m.current + 1;
272
+ m.current = u, b(), I(!0), y(!0), h(null), d(!0);
240
273
  try {
241
- const m = await we(c.search.url, {
242
- query: o,
243
- center: a,
274
+ const g = await Ee(c.search.url, {
275
+ query: a,
276
+ center: o,
244
277
  radiusKm: W,
245
- limit: Re,
246
- locationSearch: !a && !!o
278
+ limit: Ie,
279
+ locationSearch: !o && !!a
247
280
  });
248
- if (u !== h.current) return;
249
- k(Ue(m.hits, m.center || a));
250
- } catch (m) {
251
- if (u !== h.current) return;
252
- k([]), f(m instanceof Error ? m.message : "Could not search stockists");
281
+ if (u !== m.current) return;
282
+ E(He(g.hits, g.center || o));
283
+ } catch (g) {
284
+ if (u !== m.current) return;
285
+ E([]), h(g instanceof Error ? g.message : "Could not search stockists");
253
286
  } finally {
254
- u === h.current && L(!1);
287
+ u === m.current && I(!1);
255
288
  }
256
289
  },
257
290
  [b, c]
258
291
  );
259
- n.useEffect(() => {
260
- if (w.current += 1, h.current += 1, b(), N(s || null), A(i), x(i.trim() ? "typed" : null), k([]), L(!1), S(!1), y(!1), p(!1), f(null), s) return;
261
- const o = t || (e ? ge(e) : null);
262
- if (!o) return;
263
- let a = !1;
264
- return ye(o).then((u) => {
265
- a || N(u);
292
+ s.useEffect(() => {
293
+ if (w.current += 1, m.current += 1, b(), N(r || null), L(l), x(l.trim() ? "typed" : null), E([]), I(!1), S(!1), y(!1), d(!1), h(null), r) return;
294
+ const a = t || (e ? ye(e) : null);
295
+ if (!a) return;
296
+ let o = !1;
297
+ return ve(a).then((u) => {
298
+ o || N(u);
266
299
  }).catch((u) => {
267
- a || (f(u instanceof Error ? u.message : "Could not load stockist search"), y(!0), p(!0));
300
+ o || (h(u instanceof Error ? u.message : "Could not load stockist search"), y(!0), d(!0));
268
301
  }), () => {
269
- a = !0;
302
+ o = !0;
270
303
  };
271
- }, [b, t, i, s, e]), n.useEffect(() => {
272
- if (!c || C !== "typed") return;
273
- const o = v.trim();
274
- if (!o) {
304
+ }, [b, t, l, r, e]), s.useEffect(() => {
305
+ if (!c || A !== "typed") return;
306
+ const a = v.trim();
307
+ if (!a) {
275
308
  U();
276
309
  return;
277
310
  }
278
- return b(), M.current = setTimeout(() => {
279
- M.current = null, z({ activeQuery: o, center: null });
280
- }, Ie), b;
281
- }, [b, c, v, U, z, C]), n.useEffect(() => {
282
- const o = (a) => {
283
- const u = typeof a.composedPath == "function" ? a.composedPath() : [], m = a.target instanceof Node ? a.target : null;
284
- T.current && u.includes(T.current) || T.current && m && T.current.contains(m) || p(!1);
311
+ return b(), C.current = setTimeout(() => {
312
+ C.current = null, z({ activeQuery: a, center: null });
313
+ }, _e), b;
314
+ }, [b, c, v, U, z, A]), s.useEffect(() => {
315
+ const a = (o) => {
316
+ const u = typeof o.composedPath == "function" ? o.composedPath() : [], g = o.target instanceof Node ? o.target : null;
317
+ M.current && u.includes(M.current) || M.current && g && M.current.contains(g) || d(!1);
285
318
  };
286
- return document.addEventListener("pointerdown", o), () => document.removeEventListener("pointerdown", o);
287
- }, []), n.useEffect(
319
+ return document.addEventListener("pointerdown", a), () => document.removeEventListener("pointerdown", a);
320
+ }, []), s.useEffect(
288
321
  () => () => {
289
- w.current += 1, h.current += 1, b();
322
+ w.current += 1, m.current += 1, b();
290
323
  },
291
324
  [b]
292
325
  );
293
- const ie = () => {
326
+ const le = () => {
294
327
  if (w.current += 1, U(), x(null), S(!1), typeof window < "u" && window.isSecureContext === !1) {
295
- f("Browser location is blocked on this site. Search by suburb or postcode instead."), y(!0), p(!0);
328
+ h("Browser location is blocked on this site. Search by suburb or postcode instead."), y(!0), d(!0);
296
329
  return;
297
330
  }
298
331
  if (!navigator.geolocation) {
299
- f(
332
+ h(
300
333
  "This browser does not support location search. Search by suburb or postcode instead."
301
- ), y(!0), p(!0);
334
+ ), y(!0), d(!0);
302
335
  return;
303
336
  }
304
- x("location"), S(!0), f(null), p(!0);
305
- const o = w.current;
337
+ x("location"), S(!0), h(null), d(!0);
338
+ const a = w.current;
306
339
  navigator.geolocation.getCurrentPosition(
307
- (a) => {
308
- if (o !== w.current) return;
309
- const u = { lat: a.coords.latitude, lng: a.coords.longitude };
310
- A(""), S(!1), z({ activeQuery: "", center: u });
340
+ (o) => {
341
+ if (a !== w.current) return;
342
+ const u = { lat: o.coords.latitude, lng: o.coords.longitude };
343
+ L(""), S(!1), z({ activeQuery: "", center: u });
311
344
  },
312
- (a) => {
313
- o === w.current && (S(!1), y(!0), f(Se(a)), p(!0));
345
+ (o) => {
346
+ a === w.current && (S(!1), y(!0), h(Ae(o)), d(!0));
314
347
  },
315
348
  { enableHighAccuracy: !1, timeout: 8e3 }
316
349
  );
317
- }, le = () => {
318
- const o = v.trim();
319
- o && (x("typed"), z({ activeQuery: o, center: null }));
320
- }, B = ae && (I || E || K || !!_);
321
- return /* @__PURE__ */ g(
350
+ }, ce = () => {
351
+ const a = v.trim();
352
+ a && (x("typed"), z({ activeQuery: a, center: null }));
353
+ }, O = ie && (R || k || K || !!_);
354
+ return /* @__PURE__ */ f(
322
355
  "div",
323
356
  {
324
- ref: T,
325
- className: `pbss-root ${D.darkMode ? "is-dark" : ""} ${O}`.trim(),
357
+ ref: M,
358
+ className: `pbss-root ${F.darkMode ? "is-dark" : ""} ${Z}`.trim(),
326
359
  style: {
327
- "--pbss-primary": D.primaryColor,
328
- "--pbss-radius": `${Math.max(0, D.borderRadius)}px`
360
+ "--pbss-primary": F.primaryColor,
361
+ "--pbss-radius": `${Math.max(0, F.borderRadius)}px`
329
362
  },
330
- onKeyDown: (o) => {
331
- o.key === "Escape" && p(!1);
363
+ onKeyDown: (a) => {
364
+ a.key === "Escape" && d(!1);
332
365
  },
333
366
  children: [
334
- /* @__PURE__ */ g("div", { className: "pbss-search-control", children: [
335
- /* @__PURE__ */ l(
367
+ /* @__PURE__ */ f("div", { className: "pbss-search-control", children: [
368
+ /* @__PURE__ */ i(
336
369
  "input",
337
370
  {
338
- "aria-controls": B ? Z : void 0,
339
- "aria-expanded": B,
371
+ "aria-controls": O ? j : void 0,
372
+ "aria-expanded": O,
340
373
  "aria-label": "Search stockists",
341
374
  autoComplete: "postal-code",
342
375
  className: "pbss-input",
@@ -344,79 +377,95 @@ function ne({
344
377
  placeholder: "Search suburb or postcode",
345
378
  type: "search",
346
379
  value: v,
347
- onChange: (o) => {
348
- const a = o.target.value;
349
- w.current += 1, U(), S(!1), A(a), x(a.trim() ? "typed" : null);
380
+ onChange: (a) => {
381
+ const o = a.target.value;
382
+ w.current += 1, U(), S(!1), L(o), x(o.trim() ? "typed" : null);
350
383
  },
351
384
  onFocus: () => {
352
- (I || E || K || _) && p(!0);
385
+ (R || k || K || _) && d(!0);
353
386
  },
354
- onKeyDown: (o) => {
355
- o.key === "Enter" && (o.preventDefault(), le());
387
+ onKeyDown: (a) => {
388
+ a.key === "Enter" && (a.preventDefault(), ce());
356
389
  }
357
390
  }
358
391
  ),
359
- /* @__PURE__ */ g(
392
+ /* @__PURE__ */ f(
360
393
  "button",
361
394
  {
362
- "aria-label": E ? "Finding your location" : "Use my location",
395
+ "aria-label": k ? "Finding your location" : "Use my location",
363
396
  className: "pbss-location-button",
364
- disabled: E || I || !c,
397
+ disabled: k || R || !c,
365
398
  type: "button",
366
- onClick: ie,
399
+ onClick: le,
367
400
  children: [
368
- E ? /* @__PURE__ */ l("span", { "aria-hidden": "true", className: "pbss-spinner" }) : /* @__PURE__ */ l(ee, { "aria-hidden": "true", "data-slot": "icon", weight: "bold" }),
369
- /* @__PURE__ */ l("span", { "aria-hidden": "true", className: "pbss-touch-target" })
401
+ k ? /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "pbss-spinner" }) : /* @__PURE__ */ i(ee, { "aria-hidden": "true", "data-slot": "icon", weight: "bold" }),
402
+ /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "pbss-touch-target" })
370
403
  ]
371
404
  }
372
405
  )
373
406
  ] }),
374
- B && /* @__PURE__ */ g(
407
+ O && /* @__PURE__ */ f(
375
408
  "div",
376
409
  {
377
410
  "aria-label": "Nearest stockists",
378
411
  className: "pbss-results-panel",
379
- id: Z,
412
+ id: j,
380
413
  role: "region",
381
414
  children: [
382
- /* @__PURE__ */ l("div", { "aria-live": "polite", className: "pbss-results-status", children: I || E ? /* @__PURE__ */ l("div", { className: "pbss-loading", children: "Finding nearby stockists." }) : _ ? /* @__PURE__ */ l("div", { className: "pbss-error", children: _ }) : R.length > 0 ? /* @__PURE__ */ l("ul", { className: "pbss-results", role: "list", children: R.map((o) => {
383
- const a = Ae(o.website);
384
- return /* @__PURE__ */ g("li", { className: "pbss-result", children: [
385
- /* @__PURE__ */ g("div", { className: "pbss-result-heading", children: [
386
- /* @__PURE__ */ l("div", { className: "pbss-result-name", children: o.name }),
387
- /* @__PURE__ */ l("div", { className: "pbss-result-categories", children: Le(o).map((u) => /* @__PURE__ */ l(
415
+ /* @__PURE__ */ f("div", { className: "pbss-mobile-results-header", children: [
416
+ /* @__PURE__ */ i("span", { children: "Nearest stockists" }),
417
+ /* @__PURE__ */ f(
418
+ "button",
419
+ {
420
+ "aria-label": "Close stockist results",
421
+ className: "pbss-results-close",
422
+ type: "button",
423
+ onClick: () => d(!1),
424
+ children: [
425
+ /* @__PURE__ */ i(te, { "aria-hidden": "true", "data-slot": "icon", weight: "bold" }),
426
+ /* @__PURE__ */ i("span", { children: "Close" })
427
+ ]
428
+ }
429
+ )
430
+ ] }),
431
+ /* @__PURE__ */ i("div", { "aria-live": "polite", className: "pbss-results-status", children: R || k ? /* @__PURE__ */ i("div", { className: "pbss-loading", children: "Finding nearby stockists." }) : _ ? /* @__PURE__ */ i("div", { className: "pbss-error", children: _ }) : T.length > 0 ? /* @__PURE__ */ i("ul", { className: "pbss-results", role: "list", children: T.map((a) => {
432
+ const o = Me(a.website);
433
+ return /* @__PURE__ */ f("li", { className: "pbss-result", children: [
434
+ /* @__PURE__ */ f("div", { className: "pbss-result-heading", children: [
435
+ /* @__PURE__ */ i("div", { className: "pbss-result-name", children: a.name }),
436
+ /* @__PURE__ */ i("div", { className: "pbss-result-categories", children: Ue(a).map((u) => /* @__PURE__ */ i(
388
437
  "span",
389
438
  {
390
439
  className: "pbss-result-category",
391
- style: _e(u, c == null ? void 0 : c.search.categoryColors),
440
+ style: ze(u, c == null ? void 0 : c.search.categoryColors),
392
441
  children: u
393
442
  },
394
443
  u
395
444
  )) })
396
445
  ] }),
397
- G(o) && /* @__PURE__ */ l("div", { className: "pbss-result-address", children: G(o) }),
398
- /* @__PURE__ */ g("div", { className: "pbss-result-actions", children: [
399
- o.phone && /* @__PURE__ */ l("a", { href: `tel:${o.phone}`, children: "Call now" }),
400
- a && /* @__PURE__ */ l("a", { href: a, rel: "noreferrer", target: "_blank", children: "Website" }),
401
- o.email && /* @__PURE__ */ l("a", { href: `mailto:${o.email}`, children: "Email" }),
402
- o.directions_available !== !1 && /* @__PURE__ */ l(
446
+ G(a) && /* @__PURE__ */ i("div", { className: "pbss-result-address", children: G(a) }),
447
+ /* @__PURE__ */ f("div", { className: "pbss-result-actions", children: [
448
+ a.phone && /* @__PURE__ */ i("a", { href: `tel:${a.phone}`, children: "Call now" }),
449
+ o && /* @__PURE__ */ i("a", { href: o, rel: "noreferrer", target: "_blank", children: "Website" }),
450
+ a.email && /* @__PURE__ */ i("a", { href: `mailto:${a.email}`, children: "Email" }),
451
+ a.directions_available !== !1 && /* @__PURE__ */ i(
403
452
  "a",
404
453
  {
405
- href: Ce(o._geo),
454
+ href: Ce(a._geo),
406
455
  rel: "noreferrer",
407
456
  target: "_blank",
408
457
  children: "Get directions"
409
458
  }
410
459
  ),
411
- typeof o.distanceKm == "number" && /* @__PURE__ */ l("span", { className: "pbss-result-distance", children: Ee(o.distanceKm) })
460
+ typeof a.distanceKm == "number" && /* @__PURE__ */ i("span", { className: "pbss-result-distance", children: Le(a.distanceKm) })
412
461
  ] })
413
- ] }, o.id);
414
- }) }) : /* @__PURE__ */ g("div", { className: "pbss-empty", children: [
462
+ ] }, a.id);
463
+ }) }) : /* @__PURE__ */ f("div", { className: "pbss-empty", children: [
415
464
  "No stockists found within ",
416
465
  W,
417
466
  " km. Try another location."
418
467
  ] }) }),
419
- /* @__PURE__ */ l("a", { className: "pbss-view-all", href: d || "/pages/stockists", children: "View All Stockists" })
468
+ /* @__PURE__ */ i("a", { className: "pbss-view-all", href: p || "/pages/stockists", children: "View All Stockists" })
420
469
  ]
421
470
  }
422
471
  )
@@ -424,49 +473,49 @@ function ne({
424
473
  }
425
474
  );
426
475
  }
427
- const ze = ":host{display:block;position:relative;z-index:11}partbot-stockist-search{display:block}.pbss-root{--pbss-primary: #111111;--pbss-action-color: var(--pbss-primary);--pbss-radius: 8px;--pbss-surface: #ffffff;--pbss-control-surface: #ffffff;--pbss-border: rgb(28 25 23 / .14);--pbss-divider: rgb(28 25 23 / .09);--pbss-text: #1c1917;--pbss-muted-text: #78716c;--pbss-placeholder-text: #57534e;--pbss-danger-surface: #fff1f2;--pbss-danger-text: #9f1239;color:var(--pbss-text);container-type:inline-size;font-family:inherit;isolation:isolate;position:relative;width:100%;-webkit-font-smoothing:antialiased}.pbss-search-control{align-items:center;display:flex;min-width:0;position:relative}.pbss-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pbss-control-surface);border:0;border-radius:var(--pbss-radius);box-shadow:inset 0 0 0 1px var(--pbss-border);color:var(--pbss-text);font:inherit;font-size:16px;line-height:1.5;min-height:48px;min-width:0;padding:10px 56px 10px 14px;width:100%}.pbss-input::-webkit-search-cancel-button{margin-right:4px}.pbss-input::placeholder{color:var(--pbss-placeholder-text);opacity:1}.pbss-input:focus{box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--pbss-action-color) 70%,transparent),0 0 0 3px color-mix(in srgb,var(--pbss-action-color) 14%,transparent);outline:none}.pbss-location-button{align-items:center;background:transparent;border:0;border-radius:max(4px,calc(var(--pbss-radius) - 4px));color:var(--pbss-action-color);cursor:pointer;display:inline-flex;height:40px;justify-content:center;padding:0;position:absolute;right:4px;width:40px}.pbss-location-button [data-slot=icon]{flex:0 0 auto;height:16px;width:16px}.pbss-location-button:hover{background:color-mix(in srgb,var(--pbss-action-color) 8%,transparent)}.pbss-location-button:focus-visible{outline:2px solid var(--pbss-action-color);outline-offset:-2px}.pbss-location-button:disabled{cursor:not-allowed;opacity:.5}.pbss-touch-target{height:max(100%,48px);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:max(100%,48px)}.pbss-spinner{animation:pbss-spin .7s linear infinite;border:2px solid color-mix(in srgb,var(--pbss-action-color) 22%,transparent);border-radius:999px;border-top-color:var(--pbss-action-color);height:16px;width:16px}.pbss-results-panel{background:var(--pbss-surface);border-radius:var(--pbss-radius);box-shadow:0 16px 36px #1c191729,0 2px 8px #1c191714,0 0 0 1px #1c19170f;display:grid;left:0;margin-top:6px;overflow:hidden;position:absolute;right:0;z-index:20}.pbss-results-status{min-width:0}.pbss-results{list-style:none;margin:0;padding:0}.pbss-result{display:grid;gap:8px;padding:14px}.pbss-result+.pbss-result{border-top:1px solid var(--pbss-divider)}.pbss-result-heading{align-items:center;display:flex;gap:8px;justify-content:space-between;min-width:0}.pbss-result-name{font-size:16px;font-weight:600;line-height:1.35;min-width:0}.pbss-result-categories{display:flex;flex:0 1 auto;flex-wrap:wrap;gap:5px;justify-content:flex-end}.pbss-result-category{background:var( --pbss-category-color, color-mix(in srgb, var(--pbss-action-color) 10%, var(--pbss-control-surface)) );border-radius:999px;color:var(--pbss-category-contrast, var(--pbss-action-color));font-size:11px;font-weight:700;line-height:1.2;padding:3px 7px;width:fit-content}.pbss-loading,.pbss-empty,.pbss-error{font-size:16px;line-height:1.45}.pbss-result-address{color:var(--pbss-muted-text);font-size:14px;line-height:1.4}.pbss-result-actions{align-items:center;display:flex;flex-wrap:wrap;gap:8px 14px}.pbss-result-actions a{color:var(--pbss-action-color);font-size:14px;font-weight:600;line-height:1.35;text-decoration:none}.pbss-result-actions a:hover{text-decoration:underline;text-underline-offset:3px}.pbss-result-actions a:focus-visible{outline:2px solid var(--pbss-action-color);outline-offset:2px}.pbss-result-distance{background:color-mix(in srgb,var(--pbss-text) 14%,transparent);border-radius:999px;color:var(--pbss-text);flex:0 0 auto;font-size:12px;font-variant-numeric:tabular-nums;font-weight:600;line-height:1.2;padding:4px 8px}.pbss-loading,.pbss-empty,.pbss-error{padding:16px 14px}.pbss-loading,.pbss-empty{color:var(--pbss-muted-text)}.pbss-error{background:var(--pbss-danger-surface);color:var(--pbss-danger-text)}.pbss-view-all{border-top:1px solid var(--pbss-divider);color:var(--pbss-action-color);font-size:16px;font-weight:600;line-height:1.4;padding:13px 14px;text-align:center;text-decoration:none}.pbss-view-all:hover{background:color-mix(in srgb,var(--pbss-action-color) 6%,var(--pbss-surface));text-decoration:underline;text-underline-offset:3px}.pbss-view-all:focus-visible{outline:2px solid var(--pbss-action-color);outline-offset:-3px}@container (min-width: 480px){.pbss-result-name,.pbss-loading,.pbss-empty,.pbss-error,.pbss-view-all{font-size:14px}.pbss-result-address,.pbss-result-actions a{font-size:12px}}.pbss-root.is-dark{--pbss-action-color: #f5f3f0;--pbss-surface: #1c1917;--pbss-control-surface: #292524;--pbss-border: rgb(255 255 255 / .16);--pbss-divider: rgb(255 255 255 / .1);--pbss-text: #f5f3f0;--pbss-muted-text: #d6d3d1;--pbss-placeholder-text: #d6d3d1;--pbss-danger-surface: #4c0519;--pbss-danger-text: #fecdd3}.pbss-root.is-dark .pbss-results-panel{box-shadow:0 18px 38px #0000006b,0 0 0 1px #ffffff1a}@media(prefers-reduced-motion:reduce){.pbss-spinner{animation-duration:1.4s}}@keyframes pbss-spin{to{transform:rotate(360deg)}}";
428
- function Pe(e, t) {
429
- const s = J(e);
430
- return s.render(/* @__PURE__ */ l(ne, { ...t })), s;
476
+ const Pe = ":host{display:block;position:relative;z-index:11}partbot-stockist-search{display:block}.pbss-root{--pbss-primary: #111111;--pbss-action-color: var(--pbss-primary);--pbss-radius: 8px;--pbss-surface: #ffffff;--pbss-control-surface: #ffffff;--pbss-border: rgb(28 25 23 / .14);--pbss-divider: rgb(28 25 23 / .09);--pbss-text: #1c1917;--pbss-muted-text: #78716c;--pbss-placeholder-text: #57534e;--pbss-danger-surface: #fff1f2;--pbss-danger-text: #9f1239;color:var(--pbss-text);container-type:inline-size;font-family:inherit;isolation:isolate;position:relative;width:100%;-webkit-font-smoothing:antialiased}.pbss-search-control{align-items:center;display:flex;min-width:0;position:relative}.pbss-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--pbss-control-surface);border:0;border-radius:var(--pbss-radius);box-shadow:inset 0 0 0 1px var(--pbss-border);color:var(--pbss-text);font:inherit;font-size:16px;line-height:1.5;min-height:48px;min-width:0;padding:10px 56px 10px 14px;width:100%}.pbss-input::-webkit-search-cancel-button{margin-right:4px}.pbss-input::placeholder{color:var(--pbss-placeholder-text);opacity:1}.pbss-input:focus{box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--pbss-action-color) 70%,transparent),0 0 0 3px color-mix(in srgb,var(--pbss-action-color) 14%,transparent);outline:none}.pbss-location-button{align-items:center;background:transparent;border:0;border-radius:max(4px,calc(var(--pbss-radius) - 4px));color:var(--pbss-action-color);cursor:pointer;display:inline-flex;height:40px;justify-content:center;padding:0;position:absolute;right:4px;width:40px}.pbss-location-button [data-slot=icon]{flex:0 0 auto;height:16px;width:16px}.pbss-location-button:hover{background:color-mix(in srgb,var(--pbss-action-color) 8%,transparent)}.pbss-location-button:focus-visible{outline:2px solid var(--pbss-action-color);outline-offset:-2px}.pbss-location-button:disabled{cursor:not-allowed;opacity:.5}.pbss-touch-target{height:max(100%,48px);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:max(100%,48px)}.pbss-spinner{animation:pbss-spin .7s linear infinite;border:2px solid color-mix(in srgb,var(--pbss-action-color) 22%,transparent);border-radius:999px;border-top-color:var(--pbss-action-color);height:16px;width:16px}.pbss-results-panel{background:var(--pbss-surface);border-radius:var(--pbss-radius);box-shadow:0 16px 36px #1c191729,0 2px 8px #1c191714,0 0 0 1px #1c19170f;display:grid;left:0;margin-top:6px;overflow:hidden;position:absolute;right:0;z-index:20}.pbss-results-status{min-width:0}.pbss-mobile-results-header{display:none}.pbss-results{list-style:none;margin:0;padding:0}.pbss-result{display:grid;gap:8px;padding:14px}.pbss-result+.pbss-result{border-top:1px solid var(--pbss-divider)}.pbss-result-heading{align-items:center;display:flex;gap:8px;justify-content:space-between;min-width:0}.pbss-result-name{font-size:16px;font-weight:600;line-height:1.35;min-width:0}.pbss-result-categories{display:flex;flex:0 1 auto;flex-wrap:wrap;gap:5px;justify-content:flex-end}.pbss-result-category{background:var( --pbss-category-color, color-mix(in srgb, var(--pbss-action-color) 10%, var(--pbss-control-surface)) );border-radius:999px;color:var(--pbss-category-contrast, var(--pbss-action-color));font-size:11px;font-weight:700;line-height:1.2;padding:3px 7px;width:fit-content}.pbss-loading,.pbss-empty,.pbss-error{font-size:16px;line-height:1.45}.pbss-result-address{color:var(--pbss-muted-text);font-size:14px;line-height:1.4}.pbss-result-actions{align-items:center;display:flex;flex-wrap:wrap;gap:8px 14px}.pbss-result-actions a{color:var(--pbss-action-color);font-size:14px;font-weight:600;line-height:1.35;text-decoration:none}.pbss-result-actions a:hover{text-decoration:underline;text-underline-offset:3px}.pbss-result-actions a:focus-visible{outline:2px solid var(--pbss-action-color);outline-offset:2px}.pbss-result-distance{background:color-mix(in srgb,var(--pbss-text) 14%,transparent);border-radius:999px;color:var(--pbss-text);flex:0 0 auto;font-size:12px;font-variant-numeric:tabular-nums;font-weight:600;line-height:1.2;padding:4px 8px}.pbss-loading,.pbss-empty,.pbss-error{padding:16px 14px}.pbss-loading,.pbss-empty{color:var(--pbss-muted-text)}.pbss-error{background:var(--pbss-danger-surface);color:var(--pbss-danger-text)}.pbss-view-all{border-top:1px solid var(--pbss-divider);color:var(--pbss-action-color);font-size:16px;font-weight:600;line-height:1.4;padding:13px 14px;text-align:center;text-decoration:none}.pbss-view-all:hover{background:color-mix(in srgb,var(--pbss-action-color) 6%,var(--pbss-surface));text-decoration:underline;text-underline-offset:3px}.pbss-view-all:focus-visible{outline:2px solid var(--pbss-action-color);outline-offset:-3px}@container (min-width: 480px){.pbss-result-name,.pbss-loading,.pbss-empty,.pbss-error,.pbss-view-all{font-size:14px}.pbss-result-address,.pbss-result-actions a{font-size:12px}}@container (max-width: 479px){.pbss-mobile-results-header{align-items:center;border-bottom:1px solid var(--pbss-divider);display:flex;font-size:14px;font-weight:600;justify-content:space-between;line-height:1.35;min-height:48px;padding:4px 4px 4px 14px}.pbss-results-close{align-items:center;background:transparent;border:0;border-radius:max(4px,calc(var(--pbss-radius) - 4px));color:var(--pbss-action-color);cursor:pointer;display:inline-flex;font:inherit;gap:6px;min-height:40px;padding:8px 10px}.pbss-results-close [data-slot=icon]{height:16px;width:16px}.pbss-results-close:hover{background:color-mix(in srgb,var(--pbss-action-color) 8%,transparent)}.pbss-results-close:focus-visible{outline:2px solid var(--pbss-action-color);outline-offset:-2px}}.pbss-root.is-dark{--pbss-action-color: #f5f3f0;--pbss-surface: #1c1917;--pbss-control-surface: #292524;--pbss-border: rgb(255 255 255 / .16);--pbss-divider: rgb(255 255 255 / .1);--pbss-text: #f5f3f0;--pbss-muted-text: #d6d3d1;--pbss-placeholder-text: #d6d3d1;--pbss-danger-surface: #4c0519;--pbss-danger-text: #fecdd3}.pbss-root.is-dark .pbss-results-panel{box-shadow:0 18px 38px #0000006b,0 0 0 1px #ffffff1a}@media(prefers-reduced-motion:reduce){.pbss-spinner{animation-duration:1.4s}}@keyframes pbss-spin{to{transform:rotate(360deg)}}";
477
+ function $e(e, t) {
478
+ const r = J(e);
479
+ return r.render(/* @__PURE__ */ i(ae, { ...t })), r;
431
480
  }
432
- const V = "data-partbot-stockist-search-styles", Y = "data-partbot-stockist-search-root";
433
- function $e(e) {
481
+ const Y = "data-partbot-stockist-search-styles", Q = "data-partbot-stockist-search-root";
482
+ function Ze(e) {
434
483
  return e.shadowRoot || e.attachShadow({ mode: "open" });
435
484
  }
436
- function He(e) {
437
- if (e.querySelector(`style[${V}]`)) return;
485
+ function Fe(e) {
486
+ if (e.querySelector(`style[${Y}]`)) return;
438
487
  const t = document.createElement("style");
439
- t.setAttribute(V, ""), t.textContent = ze, e.prepend(t);
488
+ t.setAttribute(Y, ""), t.textContent = Pe, e.prepend(t);
440
489
  }
441
490
  function Oe(e) {
442
491
  const t = e.querySelector(
443
- `div[${Y}]`
492
+ `div[${Q}]`
444
493
  );
445
494
  if (t) return t;
446
- const s = document.createElement("div");
447
- return s.setAttribute(Y, ""), e.appendChild(s), s;
495
+ const r = document.createElement("div");
496
+ return r.setAttribute(Q, ""), e.appendChild(r), r;
448
497
  }
449
498
  const De = typeof HTMLElement > "u" ? class {
450
499
  } : HTMLElement;
451
500
  class oe extends De {
452
501
  constructor() {
453
502
  super(...arguments);
454
- P(this, "root");
455
- P(this, "mountElement");
503
+ H(this, "root");
504
+ H(this, "mountElement");
456
505
  }
457
506
  connectedCallback() {
458
507
  this.renderStockistSearch();
459
508
  }
460
509
  disconnectedCallback() {
461
- var s;
462
- (s = this.root) == null || s.unmount(), this.root = void 0;
510
+ var r;
511
+ (r = this.root) == null || r.unmount(), this.root = void 0;
463
512
  }
464
513
  attributeChangedCallback() {
465
514
  this.isConnected && this.renderStockistSearch();
466
515
  }
467
516
  renderStockistSearch() {
468
- const s = $e(this);
469
- He(s), this.mountElement || (this.mountElement = Oe(s)), this.root || (this.root = J(this.mountElement)), this.root.render(/* @__PURE__ */ l(ne, { ...this.stockistSearchProps() }));
517
+ const r = Ze(this);
518
+ Fe(r), this.mountElement || (this.mountElement = Oe(r)), this.root || (this.root = J(this.mountElement)), this.root.render(/* @__PURE__ */ i(ae, { ...this.stockistSearchProps() }));
470
519
  }
471
520
  stockistSearchProps() {
472
521
  return {
@@ -477,17 +526,17 @@ class oe extends De {
477
526
  };
478
527
  }
479
528
  }
480
- P(oe, "observedAttributes", ["token", "config-url", "initial-query", "view-all-url"]);
481
- function Q() {
529
+ H(oe, "observedAttributes", ["token", "config-url", "initial-query", "view-all-url"]);
530
+ function X() {
482
531
  typeof window > "u" || !window.customElements || window.customElements.get("partbot-stockist-search") || window.customElements.define("partbot-stockist-search", oe);
483
532
  }
484
- typeof window < "u" && (Q(), window.PartbotStockistSearch = {
485
- defineCustomElement: Q,
486
- mount: Pe
533
+ typeof window < "u" && (X(), window.PartbotStockistSearch = {
534
+ defineCustomElement: X,
535
+ mount: $e
487
536
  });
488
537
  export {
489
538
  oe as PartbotStockistSearchElement,
490
- ne as StockistSearch,
491
- Q as defineStockistSearchElement,
492
- Pe as mountStockistSearch
539
+ ae as StockistSearch,
540
+ X as defineStockistSearchElement,
541
+ $e as mountStockistSearch
493
542
  };