@salla.sa/ui-address-autocomplete-widget 1.0.6 → 1.1.1

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.
Files changed (2) hide show
  1. package/dist/index.js +511 -434
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- const U = globalThis, q = U.ShadowRoot && (U.ShadyCSS === void 0 || U.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, H = /* @__PURE__ */ Symbol(), Z = /* @__PURE__ */ new WeakMap();
2
- let le = class {
3
- constructor(e, t, s) {
4
- if (this._$cssResult$ = !0, s !== H) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
- this.cssText = e, this.t = t;
1
+ const O = globalThis, H = O.ShadowRoot && (O.ShadyCSS === void 0 || O.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, j = /* @__PURE__ */ Symbol(), Z = /* @__PURE__ */ new WeakMap();
2
+ let de = class {
3
+ constructor(e, i, r) {
4
+ if (this._$cssResult$ = !0, r !== j) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
+ this.cssText = e, this.t = i;
6
6
  }
7
7
  get styleSheet() {
8
8
  let e = this.o;
9
- const t = this.t;
10
- if (q && e === void 0) {
11
- const s = t !== void 0 && t.length === 1;
12
- s && (e = Z.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && Z.set(t, e));
9
+ const i = this.t;
10
+ if (H && e === void 0) {
11
+ const r = i !== void 0 && i.length === 1;
12
+ r && (e = Z.get(i)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && Z.set(i, e));
13
13
  }
14
14
  return e;
15
15
  }
@@ -17,115 +17,115 @@ let le = class {
17
17
  return this.cssText;
18
18
  }
19
19
  };
20
- const ue = (i) => new le(typeof i == "string" ? i : i + "", void 0, H), me = (i, ...e) => {
21
- const t = i.length === 1 ? i[0] : e.reduce((s, r, o) => s + ((a) => {
20
+ const ge = (t) => new de(typeof t == "string" ? t : t + "", void 0, j), ve = (t, ...e) => {
21
+ const i = t.length === 1 ? t[0] : e.reduce((r, s, o) => r + ((a) => {
22
22
  if (a._$cssResult$ === !0) return a.cssText;
23
23
  if (typeof a == "number") return a;
24
24
  throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
25
- })(r) + i[o + 1], i[0]);
26
- return new le(t, i, H);
27
- }, fe = (i, e) => {
28
- if (q) i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
29
- else for (const t of e) {
30
- const s = document.createElement("style"), r = U.litNonce;
31
- r !== void 0 && s.setAttribute("nonce", r), s.textContent = t.cssText, i.appendChild(s);
32
- }
33
- }, Y = q ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
34
- let t = "";
35
- for (const s of e.cssRules) t += s.cssText;
36
- return ue(t);
37
- })(i) : i;
38
- const { is: ge, defineProperty: ve, getOwnPropertyDescriptor: be, getOwnPropertyNames: ye, getOwnPropertySymbols: $e, getPrototypeOf: Ae } = Object, D = globalThis, J = D.trustedTypes, we = J ? J.emptyScript : "", _e = D.reactiveElementPolyfillSupport, P = (i, e) => i, V = { toAttribute(i, e) {
25
+ })(s) + t[o + 1], t[0]);
26
+ return new de(i, t, j);
27
+ }, be = (t, e) => {
28
+ if (H) t.adoptedStyleSheets = e.map((i) => i instanceof CSSStyleSheet ? i : i.styleSheet);
29
+ else for (const i of e) {
30
+ const r = document.createElement("style"), s = O.litNonce;
31
+ s !== void 0 && r.setAttribute("nonce", s), r.textContent = i.cssText, t.appendChild(r);
32
+ }
33
+ }, J = H ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
34
+ let i = "";
35
+ for (const r of e.cssRules) i += r.cssText;
36
+ return ge(i);
37
+ })(t) : t;
38
+ const { is: ye, defineProperty: $e, getOwnPropertyDescriptor: Ae, getOwnPropertyNames: we, getOwnPropertySymbols: _e, getPrototypeOf: xe } = Object, M = globalThis, X = M.trustedTypes, Se = X ? X.emptyScript : "", Ee = M.reactiveElementPolyfillSupport, T = (t, e) => t, V = { toAttribute(t, e) {
39
39
  switch (e) {
40
40
  case Boolean:
41
- i = i ? we : null;
41
+ t = t ? Se : null;
42
42
  break;
43
43
  case Object:
44
44
  case Array:
45
- i = i == null ? i : JSON.stringify(i);
45
+ t = t == null ? t : JSON.stringify(t);
46
46
  }
47
- return i;
48
- }, fromAttribute(i, e) {
49
- let t = i;
47
+ return t;
48
+ }, fromAttribute(t, e) {
49
+ let i = t;
50
50
  switch (e) {
51
51
  case Boolean:
52
- t = i !== null;
52
+ i = t !== null;
53
53
  break;
54
54
  case Number:
55
- t = i === null ? null : Number(i);
55
+ i = t === null ? null : Number(t);
56
56
  break;
57
57
  case Object:
58
58
  case Array:
59
59
  try {
60
- t = JSON.parse(i);
60
+ i = JSON.parse(t);
61
61
  } catch {
62
- t = null;
62
+ i = null;
63
63
  }
64
64
  }
65
- return t;
66
- } }, j = (i, e) => !ge(i, e), X = { attribute: !0, type: String, converter: V, reflect: !1, useDefault: !1, hasChanged: j };
67
- Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), D.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
- let S = class extends HTMLElement {
65
+ return i;
66
+ } }, W = (t, e) => !ye(t, e), Q = { attribute: !0, type: String, converter: V, reflect: !1, useDefault: !1, hasChanged: W };
67
+ Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), M.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
68
+ let E = class extends HTMLElement {
69
69
  static addInitializer(e) {
70
70
  this._$Ei(), (this.l ??= []).push(e);
71
71
  }
72
72
  static get observedAttributes() {
73
73
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
74
74
  }
75
- static createProperty(e, t = X) {
76
- if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
77
- const s = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(e, s, t);
78
- r !== void 0 && ve(this.prototype, e, r);
75
+ static createProperty(e, i = Q) {
76
+ if (i.state && (i.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((i = Object.create(i)).wrapped = !0), this.elementProperties.set(e, i), !i.noAccessor) {
77
+ const r = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(e, r, i);
78
+ s !== void 0 && $e(this.prototype, e, s);
79
79
  }
80
80
  }
81
- static getPropertyDescriptor(e, t, s) {
82
- const { get: r, set: o } = be(this.prototype, e) ?? { get() {
83
- return this[t];
81
+ static getPropertyDescriptor(e, i, r) {
82
+ const { get: s, set: o } = Ae(this.prototype, e) ?? { get() {
83
+ return this[i];
84
84
  }, set(a) {
85
- this[t] = a;
85
+ this[i] = a;
86
86
  } };
87
- return { get: r, set(a) {
88
- const n = r?.call(this);
89
- o?.call(this, a), this.requestUpdate(e, n, s);
87
+ return { get: s, set(a) {
88
+ const n = s?.call(this);
89
+ o?.call(this, a), this.requestUpdate(e, n, r);
90
90
  }, configurable: !0, enumerable: !0 };
91
91
  }
92
92
  static getPropertyOptions(e) {
93
- return this.elementProperties.get(e) ?? X;
93
+ return this.elementProperties.get(e) ?? Q;
94
94
  }
95
95
  static _$Ei() {
96
- if (this.hasOwnProperty(P("elementProperties"))) return;
97
- const e = Ae(this);
96
+ if (this.hasOwnProperty(T("elementProperties"))) return;
97
+ const e = xe(this);
98
98
  e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
99
99
  }
100
100
  static finalize() {
101
- if (this.hasOwnProperty(P("finalized"))) return;
102
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
103
- const t = this.properties, s = [...ye(t), ...$e(t)];
104
- for (const r of s) this.createProperty(r, t[r]);
101
+ if (this.hasOwnProperty(T("finalized"))) return;
102
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
103
+ const i = this.properties, r = [...we(i), ..._e(i)];
104
+ for (const s of r) this.createProperty(s, i[s]);
105
105
  }
106
106
  const e = this[Symbol.metadata];
107
107
  if (e !== null) {
108
- const t = litPropertyMetadata.get(e);
109
- if (t !== void 0) for (const [s, r] of t) this.elementProperties.set(s, r);
108
+ const i = litPropertyMetadata.get(e);
109
+ if (i !== void 0) for (const [r, s] of i) this.elementProperties.set(r, s);
110
110
  }
111
111
  this._$Eh = /* @__PURE__ */ new Map();
112
- for (const [t, s] of this.elementProperties) {
113
- const r = this._$Eu(t, s);
114
- r !== void 0 && this._$Eh.set(r, t);
112
+ for (const [i, r] of this.elementProperties) {
113
+ const s = this._$Eu(i, r);
114
+ s !== void 0 && this._$Eh.set(s, i);
115
115
  }
116
116
  this.elementStyles = this.finalizeStyles(this.styles);
117
117
  }
118
118
  static finalizeStyles(e) {
119
- const t = [];
119
+ const i = [];
120
120
  if (Array.isArray(e)) {
121
- const s = new Set(e.flat(1 / 0).reverse());
122
- for (const r of s) t.unshift(Y(r));
123
- } else e !== void 0 && t.push(Y(e));
124
- return t;
121
+ const r = new Set(e.flat(1 / 0).reverse());
122
+ for (const s of r) i.unshift(J(s));
123
+ } else e !== void 0 && i.push(J(e));
124
+ return i;
125
125
  }
126
- static _$Eu(e, t) {
127
- const s = t.attribute;
128
- return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
126
+ static _$Eu(e, i) {
127
+ const r = i.attribute;
128
+ return r === !1 ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
129
129
  }
130
130
  constructor() {
131
131
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
@@ -140,13 +140,13 @@ let S = class extends HTMLElement {
140
140
  this._$EO?.delete(e);
141
141
  }
142
142
  _$E_() {
143
- const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
144
- for (const s of t.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
143
+ const e = /* @__PURE__ */ new Map(), i = this.constructor.elementProperties;
144
+ for (const r of i.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
145
145
  e.size > 0 && (this._$Ep = e);
146
146
  }
147
147
  createRenderRoot() {
148
148
  const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
149
- return fe(e, this.constructor.elementStyles), e;
149
+ return be(e, this.constructor.elementStyles), e;
150
150
  }
151
151
  connectedCallback() {
152
152
  this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
@@ -156,42 +156,42 @@ let S = class extends HTMLElement {
156
156
  disconnectedCallback() {
157
157
  this._$EO?.forEach((e) => e.hostDisconnected?.());
158
158
  }
159
- attributeChangedCallback(e, t, s) {
160
- this._$AK(e, s);
159
+ attributeChangedCallback(e, i, r) {
160
+ this._$AK(e, r);
161
161
  }
162
- _$ET(e, t) {
163
- const s = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, s);
164
- if (r !== void 0 && s.reflect === !0) {
165
- const o = (s.converter?.toAttribute !== void 0 ? s.converter : V).toAttribute(t, s.type);
166
- this._$Em = e, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
162
+ _$ET(e, i) {
163
+ const r = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, r);
164
+ if (s !== void 0 && r.reflect === !0) {
165
+ const o = (r.converter?.toAttribute !== void 0 ? r.converter : V).toAttribute(i, r.type);
166
+ this._$Em = e, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
167
167
  }
168
168
  }
169
- _$AK(e, t) {
170
- const s = this.constructor, r = s._$Eh.get(e);
171
- if (r !== void 0 && this._$Em !== r) {
172
- const o = s.getPropertyOptions(r), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : V;
173
- this._$Em = r;
174
- const n = a.fromAttribute(t, o.type);
175
- this[r] = n ?? this._$Ej?.get(r) ?? n, this._$Em = null;
169
+ _$AK(e, i) {
170
+ const r = this.constructor, s = r._$Eh.get(e);
171
+ if (s !== void 0 && this._$Em !== s) {
172
+ const o = r.getPropertyOptions(s), a = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : V;
173
+ this._$Em = s;
174
+ const n = a.fromAttribute(i, o.type);
175
+ this[s] = n ?? this._$Ej?.get(s) ?? n, this._$Em = null;
176
176
  }
177
177
  }
178
- requestUpdate(e, t, s, r = !1, o) {
178
+ requestUpdate(e, i, r, s = !1, o) {
179
179
  if (e !== void 0) {
180
180
  const a = this.constructor;
181
- if (r === !1 && (o = this[e]), s ??= a.getPropertyOptions(e), !((s.hasChanged ?? j)(o, t) || s.useDefault && s.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, s)))) return;
182
- this.C(e, t, s);
181
+ if (s === !1 && (o = this[e]), r ??= a.getPropertyOptions(e), !((r.hasChanged ?? W)(o, i) || r.useDefault && r.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, r)))) return;
182
+ this.C(e, i, r);
183
183
  }
184
184
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
185
185
  }
186
- C(e, t, { useDefault: s, reflect: r, wrapped: o }, a) {
187
- s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, a ?? t ?? this[e]), o !== !0 || a !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), r === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
186
+ C(e, i, { useDefault: r, reflect: s, wrapped: o }, a) {
187
+ r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, a ?? i ?? this[e]), o !== !0 || a !== void 0) || (this._$AL.has(e) || (this.hasUpdated || r || (i = void 0), this._$AL.set(e, i)), s === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
188
188
  }
189
189
  async _$EP() {
190
190
  this.isUpdatePending = !0;
191
191
  try {
192
192
  await this._$ES;
193
- } catch (t) {
194
- Promise.reject(t);
193
+ } catch (i) {
194
+ Promise.reject(i);
195
195
  }
196
196
  const e = this.scheduleUpdate();
197
197
  return e != null && await e, !this.isUpdatePending;
@@ -203,28 +203,28 @@ let S = class extends HTMLElement {
203
203
  if (!this.isUpdatePending) return;
204
204
  if (!this.hasUpdated) {
205
205
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
206
- for (const [r, o] of this._$Ep) this[r] = o;
206
+ for (const [s, o] of this._$Ep) this[s] = o;
207
207
  this._$Ep = void 0;
208
208
  }
209
- const s = this.constructor.elementProperties;
210
- if (s.size > 0) for (const [r, o] of s) {
211
- const { wrapped: a } = o, n = this[r];
212
- a !== !0 || this._$AL.has(r) || n === void 0 || this.C(r, void 0, o, n);
209
+ const r = this.constructor.elementProperties;
210
+ if (r.size > 0) for (const [s, o] of r) {
211
+ const { wrapped: a } = o, n = this[s];
212
+ a !== !0 || this._$AL.has(s) || n === void 0 || this.C(s, void 0, o, n);
213
213
  }
214
214
  }
215
215
  let e = !1;
216
- const t = this._$AL;
216
+ const i = this._$AL;
217
217
  try {
218
- e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(t)) : this._$EM();
219
- } catch (s) {
220
- throw e = !1, this._$EM(), s;
218
+ e = this.shouldUpdate(i), e ? (this.willUpdate(i), this._$EO?.forEach((r) => r.hostUpdate?.()), this.update(i)) : this._$EM();
219
+ } catch (r) {
220
+ throw e = !1, this._$EM(), r;
221
221
  }
222
- e && this._$AE(t);
222
+ e && this._$AE(i);
223
223
  }
224
224
  willUpdate(e) {
225
225
  }
226
226
  _$AE(e) {
227
- this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
227
+ this._$EO?.forEach((i) => i.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
228
228
  }
229
229
  _$EM() {
230
230
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
@@ -239,79 +239,79 @@ let S = class extends HTMLElement {
239
239
  return !0;
240
240
  }
241
241
  update(e) {
242
- this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM();
242
+ this._$Eq &&= this._$Eq.forEach((i) => this._$ET(i, this[i])), this._$EM();
243
243
  }
244
244
  updated(e) {
245
245
  }
246
246
  firstUpdated(e) {
247
247
  }
248
248
  };
249
- S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[P("elementProperties")] = /* @__PURE__ */ new Map(), S[P("finalized")] = /* @__PURE__ */ new Map(), _e?.({ ReactiveElement: S }), (D.reactiveElementVersions ??= []).push("2.1.2");
250
- const W = globalThis, Q = (i) => i, O = W.trustedTypes, ee = O ? O.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, de = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, he = "?" + $, xe = `<${he}>`, _ = document, C = () => _.createComment(""), R = (i) => i === null || typeof i != "object" && typeof i != "function", K = Array.isArray, Se = (i) => K(i) || typeof i?.[Symbol.iterator] == "function", L = `[
251
- \f\r]`, k = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, te = /-->/g, ie = />/g, A = RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
252
- \f\r"'\`<>=]|("|')|))|$)`, "g"), se = /'/g, re = /"/g, ce = /^(?:script|style|textarea|title)$/i, Ee = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), g = Ee(1), x = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), oe = /* @__PURE__ */ new WeakMap(), w = _.createTreeWalker(_, 129);
253
- function pe(i, e) {
254
- if (!K(i) || !i.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
- return ee !== void 0 ? ee.createHTML(e) : e;
249
+ E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[T("elementProperties")] = /* @__PURE__ */ new Map(), E[T("finalized")] = /* @__PURE__ */ new Map(), Ee?.({ ReactiveElement: E }), (M.reactiveElementVersions ??= []).push("2.1.2");
250
+ const K = globalThis, ee = (t) => t, D = K.trustedTypes, te = D ? D.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, he = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, ce = "?" + A, ke = `<${ce}>`, S = document, R = () => S.createComment(""), I = (t) => t === null || typeof t != "object" && typeof t != "function", Y = Array.isArray, Pe = (t) => Y(t) || typeof t?.[Symbol.iterator] == "function", L = `[
251
+ \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ie = /-->/g, re = />/g, w = RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^
252
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), se = /'/g, oe = /"/g, pe = /^(?:script|style|textarea|title)$/i, Te = (t) => (e, ...i) => ({ _$litType$: t, strings: e, values: i }), g = Te(1), v = /* @__PURE__ */ Symbol.for("lit-noChange"), f = /* @__PURE__ */ Symbol.for("lit-nothing"), ae = /* @__PURE__ */ new WeakMap(), x = S.createTreeWalker(S, 129);
253
+ function ue(t, e) {
254
+ if (!Y(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
255
+ return te !== void 0 ? te.createHTML(e) : e;
256
256
  }
257
- const ke = (i, e) => {
258
- const t = i.length - 1, s = [];
259
- let r, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", a = k;
260
- for (let n = 0; n < t; n++) {
261
- const l = i[n];
262
- let m, c, u = -1, b = 0;
263
- for (; b < l.length && (a.lastIndex = b, c = a.exec(l), c !== null); ) b = a.lastIndex, a === k ? c[1] === "!--" ? a = te : c[1] !== void 0 ? a = ie : c[2] !== void 0 ? (ce.test(c[2]) && (r = RegExp("</" + c[2], "g")), a = A) : c[3] !== void 0 && (a = A) : a === A ? c[0] === ">" ? (a = r ?? k, u = -1) : c[1] === void 0 ? u = -2 : (u = a.lastIndex - c[2].length, m = c[1], a = c[3] === void 0 ? A : c[3] === '"' ? re : se) : a === re || a === se ? a = A : a === te || a === ie ? a = k : (a = A, r = void 0);
264
- const y = a === A && i[n + 1].startsWith("/>") ? " " : "";
265
- o += a === k ? l + xe : u >= 0 ? (s.push(m), l.slice(0, u) + de + l.slice(u) + $ + y) : l + $ + (u === -2 ? n : y);
266
- }
267
- return [pe(i, o + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
257
+ const Ce = (t, e) => {
258
+ const i = t.length - 1, r = [];
259
+ let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", a = P;
260
+ for (let n = 0; n < i; n++) {
261
+ const l = t[n];
262
+ let m, c, u = -1, y = 0;
263
+ for (; y < l.length && (a.lastIndex = y, c = a.exec(l), c !== null); ) y = a.lastIndex, a === P ? c[1] === "!--" ? a = ie : c[1] !== void 0 ? a = re : c[2] !== void 0 ? (pe.test(c[2]) && (s = RegExp("</" + c[2], "g")), a = w) : c[3] !== void 0 && (a = w) : a === w ? c[0] === ">" ? (a = s ?? P, u = -1) : c[1] === void 0 ? u = -2 : (u = a.lastIndex - c[2].length, m = c[1], a = c[3] === void 0 ? w : c[3] === '"' ? oe : se) : a === oe || a === se ? a = w : a === ie || a === re ? a = P : (a = w, s = void 0);
264
+ const $ = a === w && t[n + 1].startsWith("/>") ? " " : "";
265
+ o += a === P ? l + ke : u >= 0 ? (r.push(m), l.slice(0, u) + he + l.slice(u) + A + $) : l + A + (u === -2 ? n : $);
266
+ }
267
+ return [ue(t, o + (t[i] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
268
268
  };
269
- class I {
270
- constructor({ strings: e, _$litType$: t }, s) {
271
- let r;
269
+ class N {
270
+ constructor({ strings: e, _$litType$: i }, r) {
271
+ let s;
272
272
  this.parts = [];
273
273
  let o = 0, a = 0;
274
- const n = e.length - 1, l = this.parts, [m, c] = ke(e, t);
275
- if (this.el = I.createElement(m, s), w.currentNode = this.el.content, t === 2 || t === 3) {
274
+ const n = e.length - 1, l = this.parts, [m, c] = Ce(e, i);
275
+ if (this.el = N.createElement(m, r), x.currentNode = this.el.content, i === 2 || i === 3) {
276
276
  const u = this.el.content.firstChild;
277
277
  u.replaceWith(...u.childNodes);
278
278
  }
279
- for (; (r = w.nextNode()) !== null && l.length < n; ) {
280
- if (r.nodeType === 1) {
281
- if (r.hasAttributes()) for (const u of r.getAttributeNames()) if (u.endsWith(de)) {
282
- const b = c[a++], y = r.getAttribute(u).split($), z = /([.?@])?(.*)/.exec(b);
283
- l.push({ type: 1, index: o, name: z[2], strings: y, ctor: z[1] === "." ? Te : z[1] === "?" ? Ce : z[1] === "@" ? Re : M }), r.removeAttribute(u);
284
- } else u.startsWith($) && (l.push({ type: 6, index: o }), r.removeAttribute(u));
285
- if (ce.test(r.tagName)) {
286
- const u = r.textContent.split($), b = u.length - 1;
287
- if (b > 0) {
288
- r.textContent = O ? O.emptyScript : "";
289
- for (let y = 0; y < b; y++) r.append(u[y], C()), w.nextNode(), l.push({ type: 2, index: ++o });
290
- r.append(u[b], C());
279
+ for (; (s = x.nextNode()) !== null && l.length < n; ) {
280
+ if (s.nodeType === 1) {
281
+ if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(he)) {
282
+ const y = c[a++], $ = s.getAttribute(u).split(A), F = /([.?@])?(.*)/.exec(y);
283
+ l.push({ type: 1, index: o, name: F[2], strings: $, ctor: F[1] === "." ? Ie : F[1] === "?" ? Ne : F[1] === "@" ? ze : B }), s.removeAttribute(u);
284
+ } else u.startsWith(A) && (l.push({ type: 6, index: o }), s.removeAttribute(u));
285
+ if (pe.test(s.tagName)) {
286
+ const u = s.textContent.split(A), y = u.length - 1;
287
+ if (y > 0) {
288
+ s.textContent = D ? D.emptyScript : "";
289
+ for (let $ = 0; $ < y; $++) s.append(u[$], R()), x.nextNode(), l.push({ type: 2, index: ++o });
290
+ s.append(u[y], R());
291
291
  }
292
292
  }
293
- } else if (r.nodeType === 8) if (r.data === he) l.push({ type: 2, index: o });
293
+ } else if (s.nodeType === 8) if (s.data === ce) l.push({ type: 2, index: o });
294
294
  else {
295
295
  let u = -1;
296
- for (; (u = r.data.indexOf($, u + 1)) !== -1; ) l.push({ type: 7, index: o }), u += $.length - 1;
296
+ for (; (u = s.data.indexOf(A, u + 1)) !== -1; ) l.push({ type: 7, index: o }), u += A.length - 1;
297
297
  }
298
298
  o++;
299
299
  }
300
300
  }
301
- static createElement(e, t) {
302
- const s = _.createElement("template");
303
- return s.innerHTML = e, s;
301
+ static createElement(e, i) {
302
+ const r = S.createElement("template");
303
+ return r.innerHTML = e, r;
304
304
  }
305
305
  }
306
- function E(i, e, t = i, s) {
307
- if (e === x) return e;
308
- let r = s !== void 0 ? t._$Co?.[s] : t._$Cl;
309
- const o = R(e) ? void 0 : e._$litDirective$;
310
- return r?.constructor !== o && (r?._$AO?.(!1), o === void 0 ? r = void 0 : (r = new o(i), r._$AT(i, t, s)), s !== void 0 ? (t._$Co ??= [])[s] = r : t._$Cl = r), r !== void 0 && (e = E(i, r._$AS(i, e.values), r, s)), e;
306
+ function k(t, e, i = t, r) {
307
+ if (e === v) return e;
308
+ let s = r !== void 0 ? i._$Co?.[r] : i._$Cl;
309
+ const o = I(e) ? void 0 : e._$litDirective$;
310
+ return s?.constructor !== o && (s?._$AO?.(!1), o === void 0 ? s = void 0 : (s = new o(t), s._$AT(t, i, r)), r !== void 0 ? (i._$Co ??= [])[r] = s : i._$Cl = s), s !== void 0 && (e = k(t, s._$AS(t, e.values), s, r)), e;
311
311
  }
312
- class Pe {
313
- constructor(e, t) {
314
- this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
312
+ class Re {
313
+ constructor(e, i) {
314
+ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = i;
315
315
  }
316
316
  get parentNode() {
317
317
  return this._$AM.parentNode;
@@ -320,34 +320,34 @@ class Pe {
320
320
  return this._$AM._$AU;
321
321
  }
322
322
  u(e) {
323
- const { el: { content: t }, parts: s } = this._$AD, r = (e?.creationScope ?? _).importNode(t, !0);
324
- w.currentNode = r;
325
- let o = w.nextNode(), a = 0, n = 0, l = s[0];
323
+ const { el: { content: i }, parts: r } = this._$AD, s = (e?.creationScope ?? S).importNode(i, !0);
324
+ x.currentNode = s;
325
+ let o = x.nextNode(), a = 0, n = 0, l = r[0];
326
326
  for (; l !== void 0; ) {
327
327
  if (a === l.index) {
328
328
  let m;
329
- l.type === 2 ? m = new N(o, o.nextSibling, this, e) : l.type === 1 ? m = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (m = new Ie(o, this, e)), this._$AV.push(m), l = s[++n];
329
+ l.type === 2 ? m = new z(o, o.nextSibling, this, e) : l.type === 1 ? m = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (m = new Fe(o, this, e)), this._$AV.push(m), l = r[++n];
330
330
  }
331
- a !== l?.index && (o = w.nextNode(), a++);
331
+ a !== l?.index && (o = x.nextNode(), a++);
332
332
  }
333
- return w.currentNode = _, r;
333
+ return x.currentNode = S, s;
334
334
  }
335
335
  p(e) {
336
- let t = 0;
337
- for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
336
+ let i = 0;
337
+ for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, i), i += r.strings.length - 2) : r._$AI(e[i])), i++;
338
338
  }
339
339
  }
340
- class N {
340
+ class z {
341
341
  get _$AU() {
342
342
  return this._$AM?._$AU ?? this._$Cv;
343
343
  }
344
- constructor(e, t, s, r) {
345
- this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = r, this._$Cv = r?.isConnected ?? !0;
344
+ constructor(e, i, r, s) {
345
+ this.type = 2, this._$AH = f, this._$AN = void 0, this._$AA = e, this._$AB = i, this._$AM = r, this.options = s, this._$Cv = s?.isConnected ?? !0;
346
346
  }
347
347
  get parentNode() {
348
348
  let e = this._$AA.parentNode;
349
- const t = this._$AM;
350
- return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
349
+ const i = this._$AM;
350
+ return i !== void 0 && e?.nodeType === 11 && (e = i.parentNode), e;
351
351
  }
352
352
  get startNode() {
353
353
  return this._$AA;
@@ -355,8 +355,8 @@ class N {
355
355
  get endNode() {
356
356
  return this._$AB;
357
357
  }
358
- _$AI(e, t = this) {
359
- e = E(this, e, t), R(e) ? e === f || e == null || e === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : e !== this._$AH && e !== x && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Se(e) ? this.k(e) : this._(e);
358
+ _$AI(e, i = this) {
359
+ e = k(this, e, i), I(e) ? e === f || e == null || e === "" ? (this._$AH !== f && this._$AR(), this._$AH = f) : e !== this._$AH && e !== v && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Pe(e) ? this.k(e) : this._(e);
360
360
  }
361
361
  O(e) {
362
362
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -365,63 +365,63 @@ class N {
365
365
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
366
366
  }
367
367
  _(e) {
368
- this._$AH !== f && R(this._$AH) ? this._$AA.nextSibling.data = e : this.T(_.createTextNode(e)), this._$AH = e;
368
+ this._$AH !== f && I(this._$AH) ? this._$AA.nextSibling.data = e : this.T(S.createTextNode(e)), this._$AH = e;
369
369
  }
370
370
  $(e) {
371
- const { values: t, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = I.createElement(pe(s.h, s.h[0]), this.options)), s);
372
- if (this._$AH?._$AD === r) this._$AH.p(t);
371
+ const { values: i, _$litType$: r } = e, s = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = N.createElement(ue(r.h, r.h[0]), this.options)), r);
372
+ if (this._$AH?._$AD === s) this._$AH.p(i);
373
373
  else {
374
- const o = new Pe(r, this), a = o.u(this.options);
375
- o.p(t), this.T(a), this._$AH = o;
374
+ const o = new Re(s, this), a = o.u(this.options);
375
+ o.p(i), this.T(a), this._$AH = o;
376
376
  }
377
377
  }
378
378
  _$AC(e) {
379
- let t = oe.get(e.strings);
380
- return t === void 0 && oe.set(e.strings, t = new I(e)), t;
379
+ let i = ae.get(e.strings);
380
+ return i === void 0 && ae.set(e.strings, i = new N(e)), i;
381
381
  }
382
382
  k(e) {
383
- K(this._$AH) || (this._$AH = [], this._$AR());
384
- const t = this._$AH;
385
- let s, r = 0;
386
- for (const o of e) r === t.length ? t.push(s = new N(this.O(C()), this.O(C()), this, this.options)) : s = t[r], s._$AI(o), r++;
387
- r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
383
+ Y(this._$AH) || (this._$AH = [], this._$AR());
384
+ const i = this._$AH;
385
+ let r, s = 0;
386
+ for (const o of e) s === i.length ? i.push(r = new z(this.O(R()), this.O(R()), this, this.options)) : r = i[s], r._$AI(o), s++;
387
+ s < i.length && (this._$AR(r && r._$AB.nextSibling, s), i.length = s);
388
388
  }
389
- _$AR(e = this._$AA.nextSibling, t) {
390
- for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
391
- const s = Q(e).nextSibling;
392
- Q(e).remove(), e = s;
389
+ _$AR(e = this._$AA.nextSibling, i) {
390
+ for (this._$AP?.(!1, !0, i); e !== this._$AB; ) {
391
+ const r = ee(e).nextSibling;
392
+ ee(e).remove(), e = r;
393
393
  }
394
394
  }
395
395
  setConnected(e) {
396
396
  this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
397
397
  }
398
398
  }
399
- class M {
399
+ class B {
400
400
  get tagName() {
401
401
  return this.element.tagName;
402
402
  }
403
403
  get _$AU() {
404
404
  return this._$AM._$AU;
405
405
  }
406
- constructor(e, t, s, r, o) {
407
- this.type = 1, this._$AH = f, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = f;
406
+ constructor(e, i, r, s, o) {
407
+ this.type = 1, this._$AH = f, this._$AN = void 0, this.element = e, this.name = i, this._$AM = s, this.options = o, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = f;
408
408
  }
409
- _$AI(e, t = this, s, r) {
409
+ _$AI(e, i = this, r, s) {
410
410
  const o = this.strings;
411
411
  let a = !1;
412
- if (o === void 0) e = E(this, e, t, 0), a = !R(e) || e !== this._$AH && e !== x, a && (this._$AH = e);
412
+ if (o === void 0) e = k(this, e, i, 0), a = !I(e) || e !== this._$AH && e !== v, a && (this._$AH = e);
413
413
  else {
414
414
  const n = e;
415
415
  let l, m;
416
- for (e = o[0], l = 0; l < o.length - 1; l++) m = E(this, n[s + l], t, l), m === x && (m = this._$AH[l]), a ||= !R(m) || m !== this._$AH[l], m === f ? e = f : e !== f && (e += (m ?? "") + o[l + 1]), this._$AH[l] = m;
416
+ for (e = o[0], l = 0; l < o.length - 1; l++) m = k(this, n[r + l], i, l), m === v && (m = this._$AH[l]), a ||= !I(m) || m !== this._$AH[l], m === f ? e = f : e !== f && (e += (m ?? "") + o[l + 1]), this._$AH[l] = m;
417
417
  }
418
- a && !r && this.j(e);
418
+ a && !s && this.j(e);
419
419
  }
420
420
  j(e) {
421
421
  e === f ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
422
422
  }
423
423
  }
424
- class Te extends M {
424
+ class Ie extends B {
425
425
  constructor() {
426
426
  super(...arguments), this.type = 3;
427
427
  }
@@ -429,7 +429,7 @@ class Te extends M {
429
429
  this.element[this.name] = e === f ? void 0 : e;
430
430
  }
431
431
  }
432
- class Ce extends M {
432
+ class Ne extends B {
433
433
  constructor() {
434
434
  super(...arguments), this.type = 4;
435
435
  }
@@ -437,43 +437,43 @@ class Ce extends M {
437
437
  this.element.toggleAttribute(this.name, !!e && e !== f);
438
438
  }
439
439
  }
440
- class Re extends M {
441
- constructor(e, t, s, r, o) {
442
- super(e, t, s, r, o), this.type = 5;
440
+ class ze extends B {
441
+ constructor(e, i, r, s, o) {
442
+ super(e, i, r, s, o), this.type = 5;
443
443
  }
444
- _$AI(e, t = this) {
445
- if ((e = E(this, e, t, 0) ?? f) === x) return;
446
- const s = this._$AH, r = e === f && s !== f || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, o = e !== f && (s === f || r);
447
- r && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
444
+ _$AI(e, i = this) {
445
+ if ((e = k(this, e, i, 0) ?? f) === v) return;
446
+ const r = this._$AH, s = e === f && r !== f || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, o = e !== f && (r === f || s);
447
+ s && this.element.removeEventListener(this.name, this, r), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
448
448
  }
449
449
  handleEvent(e) {
450
450
  typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
451
451
  }
452
452
  }
453
- class Ie {
454
- constructor(e, t, s) {
455
- this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
453
+ class Fe {
454
+ constructor(e, i, r) {
455
+ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = r;
456
456
  }
457
457
  get _$AU() {
458
458
  return this._$AM._$AU;
459
459
  }
460
460
  _$AI(e) {
461
- E(this, e);
461
+ k(this, e);
462
462
  }
463
463
  }
464
- const Ne = W.litHtmlPolyfillSupport;
465
- Ne?.(I, N), (W.litHtmlVersions ??= []).push("3.3.2");
466
- const ze = (i, e, t) => {
467
- const s = t?.renderBefore ?? e;
468
- let r = s._$litPart$;
469
- if (r === void 0) {
470
- const o = t?.renderBefore ?? null;
471
- s._$litPart$ = r = new N(e.insertBefore(C(), o), o, void 0, t ?? {});
472
- }
473
- return r._$AI(i), r;
464
+ const Ue = K.litHtmlPolyfillSupport;
465
+ Ue?.(N, z), (K.litHtmlVersions ??= []).push("3.3.2");
466
+ const Oe = (t, e, i) => {
467
+ const r = i?.renderBefore ?? e;
468
+ let s = r._$litPart$;
469
+ if (s === void 0) {
470
+ const o = i?.renderBefore ?? null;
471
+ r._$litPart$ = s = new z(e.insertBefore(R(), o), o, void 0, i ?? {});
472
+ }
473
+ return s._$AI(t), s;
474
474
  };
475
475
  const G = globalThis;
476
- let T = class extends S {
476
+ let C = class extends E {
477
477
  constructor() {
478
478
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
479
479
  }
@@ -482,8 +482,8 @@ let T = class extends S {
482
482
  return this.renderOptions.renderBefore ??= e.firstChild, e;
483
483
  }
484
484
  update(e) {
485
- const t = this.render();
486
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = ze(t, this.renderRoot, this.renderOptions);
485
+ const i = this.render();
486
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Oe(i, this.renderRoot, this.renderOptions);
487
487
  }
488
488
  connectedCallback() {
489
489
  super.connectedCallback(), this._$Do?.setConnected(!0);
@@ -492,96 +492,116 @@ let T = class extends S {
492
492
  super.disconnectedCallback(), this._$Do?.setConnected(!1);
493
493
  }
494
494
  render() {
495
- return x;
495
+ return v;
496
496
  }
497
497
  };
498
- T._$litElement$ = !0, T.finalized = !0, G.litElementHydrateSupport?.({ LitElement: T });
499
- const Fe = G.litElementPolyfillSupport;
500
- Fe?.({ LitElement: T });
498
+ C._$litElement$ = !0, C.finalized = !0, G.litElementHydrateSupport?.({ LitElement: C });
499
+ const Ve = G.litElementPolyfillSupport;
500
+ Ve?.({ LitElement: C });
501
501
  (G.litElementVersions ??= []).push("4.2.2");
502
- const Ue = (i) => (e, t) => {
503
- t !== void 0 ? t.addInitializer(() => {
504
- customElements.define(i, e);
505
- }) : customElements.define(i, e);
502
+ const De = (t) => (e, i) => {
503
+ i !== void 0 ? i.addInitializer(() => {
504
+ customElements.define(t, e);
505
+ }) : customElements.define(t, e);
506
506
  };
507
- const Ve = { attribute: !0, type: String, converter: V, reflect: !1, hasChanged: j }, Oe = (i = Ve, e, t) => {
508
- const { kind: s, metadata: r } = t;
509
- let o = globalThis.litPropertyMetadata.get(r);
510
- if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), o.set(t.name, i), s === "accessor") {
511
- const { name: a } = t;
507
+ const Me = { attribute: !0, type: String, converter: V, reflect: !1, hasChanged: W }, Be = (t = Me, e, i) => {
508
+ const { kind: r, metadata: s } = i;
509
+ let o = globalThis.litPropertyMetadata.get(s);
510
+ if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), r === "setter" && ((t = Object.create(t)).wrapped = !0), o.set(i.name, t), r === "accessor") {
511
+ const { name: a } = i;
512
512
  return { set(n) {
513
513
  const l = e.get.call(this);
514
- e.set.call(this, n), this.requestUpdate(a, l, i, !0, n);
514
+ e.set.call(this, n), this.requestUpdate(a, l, t, !0, n);
515
515
  }, init(n) {
516
- return n !== void 0 && this.C(a, void 0, i, n), n;
516
+ return n !== void 0 && this.C(a, void 0, t, n), n;
517
517
  } };
518
518
  }
519
- if (s === "setter") {
520
- const { name: a } = t;
519
+ if (r === "setter") {
520
+ const { name: a } = i;
521
521
  return function(n) {
522
522
  const l = this[a];
523
- e.call(this, n), this.requestUpdate(a, l, i, !0, n);
523
+ e.call(this, n), this.requestUpdate(a, l, t, !0, n);
524
524
  };
525
525
  }
526
- throw Error("Unsupported decorator location: " + s);
526
+ throw Error("Unsupported decorator location: " + r);
527
527
  };
528
- function p(i) {
529
- return (e, t) => typeof t == "object" ? Oe(i, e, t) : ((s, r, o) => {
530
- const a = r.hasOwnProperty(o);
531
- return r.constructor.createProperty(o, s), a ? Object.getOwnPropertyDescriptor(r, o) : void 0;
532
- })(i, e, t);
528
+ function p(t) {
529
+ return (e, i) => typeof i == "object" ? Be(t, e, i) : ((r, s, o) => {
530
+ const a = s.hasOwnProperty(o);
531
+ return s.constructor.createProperty(o, r), a ? Object.getOwnPropertyDescriptor(s, o) : void 0;
532
+ })(t, e, i);
533
533
  }
534
- function v(i) {
535
- return p({ ...i, state: !0, attribute: !1 });
534
+ function b(t) {
535
+ return p({ ...t, state: !0, attribute: !1 });
536
536
  }
537
- const De = (i, e, t) => (t.configurable = !0, t.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(i, e, t), t);
538
- function Me(i, e) {
539
- return (t, s, r) => {
540
- const o = (a) => a.renderRoot?.querySelector(i) ?? null;
541
- return De(t, s, { get() {
537
+ const Le = (t, e, i) => (i.configurable = !0, i.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, i), i);
538
+ function qe(t, e) {
539
+ return (i, r, s) => {
540
+ const o = (a) => a.renderRoot?.querySelector(t) ?? null;
541
+ return Le(i, r, { get() {
542
542
  return o(this);
543
543
  } });
544
544
  };
545
545
  }
546
- const Le = { ATTRIBUTE: 1 }, Be = (i) => (...e) => ({ _$litDirective$: i, values: e });
547
- class qe {
546
+ const _ = { ATTRIBUTE: 1, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4 }, me = (t) => (...e) => ({ _$litDirective$: t, values: e });
547
+ class fe {
548
548
  constructor(e) {
549
549
  }
550
550
  get _$AU() {
551
551
  return this._$AM._$AU;
552
552
  }
553
- _$AT(e, t, s) {
554
- this._$Ct = e, this._$AM = t, this._$Ci = s;
553
+ _$AT(e, i, r) {
554
+ this._$Ct = e, this._$AM = i, this._$Ci = r;
555
555
  }
556
- _$AS(e, t) {
557
- return this.update(e, t);
556
+ _$AS(e, i) {
557
+ return this.update(e, i);
558
558
  }
559
- update(e, t) {
560
- return this.render(...t);
559
+ update(e, i) {
560
+ return this.render(...i);
561
561
  }
562
562
  }
563
- const F = Be(class extends qe {
564
- constructor(i) {
565
- if (super(i), i.type !== Le.ATTRIBUTE || i.name !== "class" || i.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
563
+ const U = me(class extends fe {
564
+ constructor(t) {
565
+ if (super(t), t.type !== _.ATTRIBUTE || t.name !== "class" || t.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
566
566
  }
567
- render(i) {
568
- return " " + Object.keys(i).filter((e) => i[e]).join(" ") + " ";
567
+ render(t) {
568
+ return " " + Object.keys(t).filter((e) => t[e]).join(" ") + " ";
569
569
  }
570
- update(i, [e]) {
570
+ update(t, [e]) {
571
571
  if (this.st === void 0) {
572
- this.st = /* @__PURE__ */ new Set(), i.strings !== void 0 && (this.nt = new Set(i.strings.join(" ").split(/\s/).filter((s) => s !== "")));
573
- for (const s in e) e[s] && !this.nt?.has(s) && this.st.add(s);
572
+ this.st = /* @__PURE__ */ new Set(), t.strings !== void 0 && (this.nt = new Set(t.strings.join(" ").split(/\s/).filter((r) => r !== "")));
573
+ for (const r in e) e[r] && !this.nt?.has(r) && this.st.add(r);
574
574
  return this.render(e);
575
575
  }
576
- const t = i.element.classList;
577
- for (const s of this.st) s in e || (t.remove(s), this.st.delete(s));
578
- for (const s in e) {
579
- const r = !!e[s];
580
- r === this.st.has(s) || this.nt?.has(s) || (r ? (t.add(s), this.st.add(s)) : (t.remove(s), this.st.delete(s)));
576
+ const i = t.element.classList;
577
+ for (const r of this.st) r in e || (i.remove(r), this.st.delete(r));
578
+ for (const r in e) {
579
+ const s = !!e[r];
580
+ s === this.st.has(r) || this.nt?.has(r) || (s ? (i.add(r), this.st.add(r)) : (i.remove(r), this.st.delete(r)));
581
581
  }
582
- return x;
582
+ return v;
583
+ }
584
+ });
585
+ const He = (t) => t.strings === void 0, je = {}, We = (t, e = je) => t._$AH = e;
586
+ const Ke = me(class extends fe {
587
+ constructor(t) {
588
+ if (super(t), t.type !== _.PROPERTY && t.type !== _.ATTRIBUTE && t.type !== _.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
589
+ if (!He(t)) throw Error("`live` bindings can only contain a single expression");
590
+ }
591
+ render(t) {
592
+ return t;
583
593
  }
584
- }), He = [
594
+ update(t, [e]) {
595
+ if (e === v || e === f) return e;
596
+ const i = t.element, r = t.name;
597
+ if (t.type === _.PROPERTY) {
598
+ if (e === i[r]) return v;
599
+ } else if (t.type === _.BOOLEAN_ATTRIBUTE) {
600
+ if (!!e === i.hasAttribute(r)) return v;
601
+ } else if (t.type === _.ATTRIBUTE && i.getAttribute(r) === e + "") return v;
602
+ return We(t), e;
603
+ }
604
+ }), Ye = [
585
605
  "AE",
586
606
  "AR",
587
607
  "AT",
@@ -636,63 +656,63 @@ const F = Be(class extends qe {
636
656
  "VN",
637
657
  "ZA"
638
658
  ];
639
- function et(i, e) {
640
- let t = null, s = 0;
641
- return function(...r) {
642
- const o = Date.now(), a = e - (o - s);
643
- a <= 0 || a > e ? (t && (clearTimeout(t), t = null), s = o, i.apply(this, r)) : t || (t = setTimeout(() => {
644
- s = Date.now(), t = null, i.apply(this, r);
659
+ function st(t, e) {
660
+ let i = null, r = 0;
661
+ return function(...s) {
662
+ const o = Date.now(), a = e - (o - r);
663
+ a <= 0 || a > e ? (i && (clearTimeout(i), i = null), r = o, t.apply(this, s)) : i || (i = setTimeout(() => {
664
+ r = Date.now(), i = null, t.apply(this, s);
645
665
  }, a));
646
666
  };
647
667
  }
648
- function je(i, e) {
649
- let t = null;
650
- return function(...s) {
651
- t && clearTimeout(t), t = setTimeout(() => {
652
- i.apply(this, s);
668
+ function Ge(t, e) {
669
+ let i = null;
670
+ return function(...r) {
671
+ i && clearTimeout(i), i = setTimeout(() => {
672
+ t.apply(this, r);
653
673
  }, e);
654
674
  };
655
675
  }
656
- function We() {
657
- return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(i) {
676
+ function Ze() {
677
+ return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
658
678
  const e = Math.random() * 16 | 0;
659
- return (i === "x" ? e : e & 3 | 8).toString(16);
679
+ return (t === "x" ? e : e & 3 | 8).toString(16);
660
680
  });
661
681
  }
662
- function Ke(i) {
663
- if (!i) return null;
664
- const e = i.find(
665
- (t) => t.types?.includes("country")
682
+ function Je(t) {
683
+ if (!t) return null;
684
+ const e = t.find(
685
+ (i) => i.types?.includes("country")
666
686
  );
667
687
  return e ? e.short_name : null;
668
688
  }
669
- function ae(i, e) {
670
- let t = null;
671
- return i.address_components ? t = Ke(i.address_components) : e && e.length === 1 && (t = e[0].toUpperCase()), t ? {
672
- isSupported: He.includes(t),
673
- countryCode: t
689
+ function ne(t, e) {
690
+ let i = null;
691
+ return t.address_components ? i = Je(t.address_components) : e && e.length === 1 && (i = e[0].toUpperCase()), i ? {
692
+ isSupported: Ye.includes(i),
693
+ countryCode: i
674
694
  } : {
675
695
  isSupported: null,
676
696
  countryCode: null
677
697
  };
678
698
  }
679
- function tt(i, e) {
680
- const t = [];
681
- let s = 0;
699
+ function ot(t, e) {
700
+ const i = [];
701
+ let r = 0;
682
702
  return [...e].sort((o, a) => o.offset - a.offset).forEach((o) => {
683
- o.offset > s && t.push({
684
- text: i.substring(s, o.offset),
703
+ o.offset > r && i.push({
704
+ text: t.substring(r, o.offset),
685
705
  highlight: !1
686
- }), t.push({
687
- text: i.substring(o.offset, o.offset + o.length),
706
+ }), i.push({
707
+ text: t.substring(o.offset, o.offset + o.length),
688
708
  highlight: !0
689
- }), s = o.offset + o.length;
690
- }), s < i.length && t.push({
691
- text: i.substring(s),
709
+ }), r = o.offset + o.length;
710
+ }), r < t.length && i.push({
711
+ text: t.substring(r),
692
712
  highlight: !1
693
- }), t;
713
+ }), i;
694
714
  }
695
- const ne = {
715
+ const le = {
696
716
  en: {
697
717
  placeholder: "Search for an address...",
698
718
  noResults: "No address found for this search. Try different keywords.",
@@ -824,42 +844,42 @@ const ne = {
824
844
  validationSaudiFormat: "Lütfen geçerli bir Suudi ulusal adresi girin (format: AAAA1234)"
825
845
  }
826
846
  };
827
- function B(i = "en") {
828
- return ne[i] || ne.en;
847
+ function q(t = "en") {
848
+ return le[t] || le.en;
829
849
  }
830
- function Ge(i) {
831
- return ["ar"].includes(i);
850
+ function Xe(t) {
851
+ return ["ar"].includes(t);
832
852
  }
833
- var Ze = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, h = (i, e, t, s) => {
834
- for (var r = s > 1 ? void 0 : s ? Ye(e, t) : e, o = i.length - 1, a; o >= 0; o--)
835
- (a = i[o]) && (r = (s ? a(e, t, r) : a(r)) || r);
836
- return s && r && Ze(e, t, r), r;
853
+ var Qe = Object.defineProperty, et = Object.getOwnPropertyDescriptor, h = (t, e, i, r) => {
854
+ for (var s = r > 1 ? void 0 : r ? et(e, i) : e, o = t.length - 1, a; o >= 0; o--)
855
+ (a = t[o]) && (s = (r ? a(e, i, s) : a(s)) || s);
856
+ return r && s && Qe(e, i, s), s;
837
857
  };
838
- let d = class extends T {
858
+ let d = class extends C {
839
859
  constructor() {
840
860
  super(), this.proxyUrl = "https://api.salla.dev", this.authToken = null, this.placeholder = "", this.defaultPlace = "", this.label = null, this.className = "", this.language = "en", this.dir = "auto", this.mode = "search", this.name = "", this.required = !1, this.pattern = null, this.tooltip = null, this.selectedId = null, this.errors = [], this.disabled = !1, this._value = "", this._country = null, this.locationBias = null, this.locationRestriction = null, this.types = null, this._fields = ["formatted_address", "geometry"], this.strictBounds = !1, this.useSessionToken = !0, this.resolve = !1, this.onValidateAddress = null, this.debounceDelay = 300, this.minChars = 3, this.predictions = [], this.isOpen = !1, this.isLoading = !1, this.error = null, this.activeIndex = -1, this.inputValue = "", this.sessionToken = null, this.validationError = null, this.touched = !1, this.showNationalAddressIcon = !1, this.abortController = null, this._internals = this.attachInternals();
841
861
  }
842
- set value(i) {
862
+ set value(t) {
843
863
  const e = this._value;
844
- this._value = i || "", this.requestUpdate("value", e);
864
+ this._value = t || "", this.requestUpdate("value", e);
845
865
  }
846
866
  get value() {
847
867
  return this._value;
848
868
  }
849
- set country(i) {
850
- i == null ? this._country = null : Array.isArray(i) ? this._country = i.filter((e) => e && e.trim()).map((e) => e.trim()) : this._country = i.split(",").map((e) => e.trim()).filter((e) => e);
869
+ set country(t) {
870
+ t == null ? this._country = null : Array.isArray(t) ? this._country = t.filter((e) => e && e.trim()).map((e) => e.trim()) : this._country = t.split(",").map((e) => e.trim()).filter((e) => e);
851
871
  }
852
872
  get country() {
853
873
  return this._country;
854
874
  }
855
- set fieldsStr(i) {
856
- this._fields = i ? i.split(",").map((e) => e.trim()).filter((e) => e) : ["formatted_address", "geometry"];
875
+ set fieldsStr(t) {
876
+ this._fields = t ? t.split(",").map((e) => e.trim()).filter((e) => e) : ["formatted_address", "geometry"];
857
877
  }
858
878
  get fieldsStr() {
859
879
  return this._fields.join(",");
860
880
  }
861
- set fields(i) {
862
- this._fields = i && i.length > 0 ? i : ["formatted_address", "geometry"];
881
+ set fields(t) {
882
+ this._fields = t && t.length > 0 ? t : ["formatted_address", "geometry"];
863
883
  }
864
884
  get fields() {
865
885
  return this._fields;
@@ -871,27 +891,27 @@ let d = class extends T {
871
891
  super.disconnectedCallback(), this.terminateSession(), this.cancelPendingRequest();
872
892
  }
873
893
  initializeDebounce() {
874
- this.debouncedFetch = je(this.fetchPredictions.bind(this), this.debounceDelay);
894
+ this.debouncedFetch = Ge(this.fetchPredictions.bind(this), this.debounceDelay);
875
895
  }
876
896
  firstUpdated() {
877
- const i = this.value || this.defaultPlace || "";
878
- i && (this.inputValue = i, this.isSaudiFormMode() && this.isShortAddressFormat(i) && (this.showNationalAddressIcon = !0));
897
+ const t = this.value || this.defaultPlace || "";
898
+ t && (this.inputValue = t, this.isSaudiFormMode() && this.isShortAddressFormat(t) && (this.showNationalAddressIcon = !0));
879
899
  }
880
- $nextTick(i) {
881
- Promise.resolve().then(i);
900
+ $nextTick(t) {
901
+ Promise.resolve().then(t);
882
902
  }
883
- isShortAddressFormat(i) {
884
- return /^[a-zA-Z]{4}\d{4}$/.test(i?.trim());
903
+ isShortAddressFormat(t) {
904
+ return /^[a-zA-Z]{4}\d{4}$/.test(t?.trim());
885
905
  }
886
- updated(i) {
887
- if (i.has("value")) {
906
+ updated(t) {
907
+ if (t.has("value")) {
888
908
  const e = this.value || "";
889
909
  e !== this.inputValue && (this.inputValue = e, this.isSaudiFormMode() && e && this.isShortAddressFormat(e) ? this.showNationalAddressIcon = !0 : this.showNationalAddressIcon = !1);
890
910
  }
891
- i.has("defaultPlace") && !this.value && this.defaultPlace !== this.inputValue && (this.inputValue = this.defaultPlace || "", this.isSaudiFormMode() && this.defaultPlace && this.isShortAddressFormat(this.defaultPlace) ? this.showNationalAddressIcon = !0 : this.showNationalAddressIcon = !1), i.has("selectedId") && this.selectedId && this.selectedId !== this.inputValue && this.isSaudiFormMode() && this.isShortAddressFormat(this.selectedId) && (this.inputValue = this.selectedId || "", this.showNationalAddressIcon = !0, this._internals.setFormValue(this.selectedId || "")), i.has("debounceDelay") && this.initializeDebounce();
911
+ t.has("defaultPlace") && !this.value && this.defaultPlace !== this.inputValue && (this.inputValue = this.defaultPlace || "", this.isSaudiFormMode() && this.defaultPlace && this.isShortAddressFormat(this.defaultPlace) ? this.showNationalAddressIcon = !0 : this.showNationalAddressIcon = !1), t.has("selectedId") && this.selectedId && this.selectedId !== this.inputValue && this.isSaudiFormMode() && this.isShortAddressFormat(this.selectedId) && (this.inputValue = this.selectedId || "", this.showNationalAddressIcon = !0, this._internals.setFormValue(this.selectedId || "")), t.has("debounceDelay") && this.initializeDebounce();
892
912
  }
893
913
  createNewSession() {
894
- this.useSessionToken && (this.sessionToken = We());
914
+ this.useSessionToken && (this.sessionToken = Ze());
895
915
  }
896
916
  terminateSession() {
897
917
  this.sessionToken = null;
@@ -899,12 +919,12 @@ let d = class extends T {
899
919
  cancelPendingRequest() {
900
920
  this.abortController && (this.abortController.abort(), this.abortController = null);
901
921
  }
902
- async fetchPredictions(i) {
903
- if (!i.trim()) {
922
+ async fetchPredictions(t) {
923
+ if (!t.trim()) {
904
924
  this.predictions = [], this.isOpen = !1, this.isLoading = !1;
905
925
  return;
906
926
  }
907
- if (i.trim().length < this.minChars) {
927
+ if (t.trim().length < this.minChars) {
908
928
  this.predictions = [], this.isOpen = !1, this.isLoading = !1;
909
929
  return;
910
930
  }
@@ -912,9 +932,9 @@ let d = class extends T {
912
932
  const e = this.abortController.signal;
913
933
  this.isLoading = !0, this.error = null;
914
934
  try {
915
- const t = { input: i };
916
- this.sessionToken && (t.sessiontoken = this.sessionToken), this.country && this.country.length > 0 && (t.country = this.country.join(",")), this.types && this.types.length > 0 && (t.types = this.types.join("|")), this.locationBias && this.locationBias.radius && this.locationBias.center && (t.location = `${this.locationBias.center.lat},${this.locationBias.center.lng}`, t.radius = this.locationBias.radius.toString()), this.strictBounds && (t.strictbounds = "true");
917
- const s = new URLSearchParams(t), o = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/query?${s.toString()}`, a = {};
935
+ const i = { input: t };
936
+ this.sessionToken && (i.sessiontoken = this.sessionToken), this.country && this.country.length > 0 && (i.country = this.country.join(",")), this.types && this.types.length > 0 && (i.types = this.types.join("|")), this.locationBias && this.locationBias.radius && this.locationBias.center && (i.location = `${this.locationBias.center.lat},${this.locationBias.center.lng}`, i.radius = this.locationBias.radius.toString()), this.strictBounds && (i.strictbounds = "true");
937
+ const r = new URLSearchParams(i), o = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/query?${r.toString()}`, a = {};
918
938
  this.authToken && (a.Authorization = `Bearer ${this.authToken}`);
919
939
  const n = await fetch(o, { signal: e, headers: a });
920
940
  if (!n.ok)
@@ -934,22 +954,22 @@ let d = class extends T {
934
954
  geometry: c.geometry,
935
955
  address_components: c.address_components
936
956
  })), this.isOpen = !0, this.activeIndex = -1) : (this.predictions = [], this.isOpen = !0)) : (this.predictions = [], this.isOpen = !0);
937
- } catch (t) {
938
- if (t instanceof Error && t.name === "AbortError")
957
+ } catch (i) {
958
+ if (i instanceof Error && i.name === "AbortError")
939
959
  return;
940
960
  this.predictions = [], this.isOpen = !0;
941
961
  } finally {
942
962
  this.isLoading = !1, this.abortController = null;
943
963
  }
944
964
  }
945
- async fetchPlaceDetails(i) {
965
+ async fetchPlaceDetails(t) {
946
966
  this.isLoading = !0, this.error = null;
947
967
  try {
948
- const e = { place_id: i };
968
+ const e = { place_id: t };
949
969
  this.fields && this.fields.length > 0 && (e.fields = this.fields.join(",")), this.sessionToken && (e.sessiontoken = this.sessionToken), this.country && this.country.length > 0 && (e.country = this.country.join(",")), this.resolve && (e.resolve = "true");
950
- const t = new URLSearchParams(e), r = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/details?${t.toString()}`, o = {};
970
+ const i = new URLSearchParams(e), s = `${this.proxyUrl || ""}/store/v1/checkout/address/autocomplete/details?${i.toString()}`, o = {};
951
971
  this.authToken && (o.Authorization = `Bearer ${this.authToken}`);
952
- const a = await fetch(r, { headers: o });
972
+ const a = await fetch(s, { headers: o });
953
973
  if (!a.ok)
954
974
  throw new Error(`HTTP ${a.status}: ${a.statusText}`);
955
975
  const n = await a.json();
@@ -965,37 +985,37 @@ let d = class extends T {
965
985
  } : null;
966
986
  } catch (e) {
967
987
  console.error("Error fetching place details:", e);
968
- const t = B(this.language);
969
- return this.error = e instanceof Error ? e.message : t.errorFetchDetails, null;
988
+ const i = q(this.language);
989
+ return this.error = e instanceof Error ? e.message : i.errorFetchDetails, null;
970
990
  } finally {
971
991
  this.isLoading = !1;
972
992
  }
973
993
  }
974
- async validateAddress(i) {
994
+ async validateAddress(t) {
975
995
  try {
976
- if (!i || !i.formatted_address)
996
+ if (!t || !t.formatted_address)
977
997
  return console.error("Cannot validate address - place or formatted_address is missing"), null;
978
998
  if (!this.onValidateAddress || typeof this.onValidateAddress != "function")
979
999
  return console.error("onValidateAddress callback is required for address validation"), null;
980
- const e = ae(i, this.country), t = await this.onValidateAddress({
981
- place: i,
1000
+ const e = ne(t, this.country), i = await this.onValidateAddress({
1001
+ place: t,
982
1002
  sessionToken: this.sessionToken,
983
1003
  validationSupport: e
984
1004
  });
985
- return this.terminateSession(), t;
1005
+ return this.terminateSession(), i;
986
1006
  } catch (e) {
987
1007
  return console.error("Error validating address:", e), this.terminateSession(), null;
988
1008
  }
989
1009
  }
990
- getValidationSupport(i) {
991
- return ae(i, this.country);
1010
+ getValidationSupport(t) {
1011
+ return ne(t, this.country);
992
1012
  }
993
1013
  isSaudiFormMode() {
994
1014
  return this.mode === "form" && this.country !== null && this.country.length === 1 && this.country[0].toLowerCase() === "sa";
995
1015
  }
996
1016
  getWhatsAppLink() {
997
- const i = "966112898888", e = encodeURIComponent("العنوان الوطني");
998
- return `https://wa.me/${i}?text=${e}`;
1017
+ const t = "966112898888", e = encodeURIComponent("العنوان الوطني");
1018
+ return `https://wa.me/${t}?text=${e}`;
999
1019
  }
1000
1020
  renderWhatsAppIcon() {
1001
1021
  return g`
@@ -1011,10 +1031,10 @@ let d = class extends T {
1011
1031
  };
1012
1032
  }
1013
1033
  renderSaudiFriendlyError() {
1014
- const i = this.inputValue && this.inputValue.trim().length > 0;
1015
- let e, t;
1016
- i ? (e = "العنوان الوطني المختصر غير صحيح (الصيغة: AAAA1234). يمكنك الحصول عليه بسهولة", t = "The short national address format is incorrect (format: AAAA1234). You can easily get it") : (e = "العنوان الوطني المختصر مطلوب. يمكنك الحصول عليه بسهولة", t = "The short national address is required. You can easily get it");
1017
- const s = "عبر الواتساب (اضغط هنا)", r = "via WhatsApp (click here)", o = "أو ابحث أعلاه", a = "or search above", n = this.language === "ar" ? e : t, l = this.language === "ar" ? s : r, m = this.language === "ar" ? o : a;
1034
+ const t = this.inputValue && this.inputValue.trim().length > 0;
1035
+ let e, i;
1036
+ t ? (e = "العنوان الوطني المختصر غير صحيح (الصيغة: AAAA1234). يمكنك الحصول عليه بسهولة", i = "The short national address format is incorrect (format: AAAA1234). You can easily get it") : (e = "العنوان الوطني المختصر مطلوب. يمكنك الحصول عليه بسهولة", i = "The short national address is required. You can easily get it");
1037
+ const r = "عبر الواتساب (اضغط هنا)", s = "via WhatsApp (click here)", o = "أو ابحث أعلاه", a = "or search above", n = this.language === "ar" ? e : i, l = this.language === "ar" ? r : s, m = this.language === "ar" ? o : a;
1018
1038
  return g`
1019
1039
  <span>
1020
1040
  ${n}
@@ -1035,7 +1055,7 @@ let d = class extends T {
1035
1055
  renderSaudiHelpText() {
1036
1056
  if (!this.isSaudiFormMode() || this.validationError || this.errors && this.errors.length > 0)
1037
1057
  return "";
1038
- const i = "لا تعرف العنوان الوطني؟ احصل عليه بسهولة", e = "Don't know your national address? Get it easily", t = "عبر الواتساب (اضغط هنا)", s = "via WhatsApp (click here)", r = "أو ابحث أعلاه", o = "or search above", a = this.language === "ar" ? i : e, n = this.language === "ar" ? t : s, l = this.language === "ar" ? r : o;
1058
+ const t = "لا تعرف العنوان الوطني؟ احصل عليه بسهولة", e = "Don't know your national address? Get it easily", i = "عبر الواتساب (اضغط هنا)", r = "via WhatsApp (click here)", s = "أو ابحث أعلاه", o = "or search above", a = this.language === "ar" ? t : e, n = this.language === "ar" ? i : r, l = this.language === "ar" ? s : o;
1039
1059
  return g`
1040
1060
  <div class="help-text" part="help-text">
1041
1061
  <span>
@@ -1060,12 +1080,12 @@ let d = class extends T {
1060
1080
  }
1061
1081
  reportValidity() {
1062
1082
  this.touched = !0;
1063
- const i = this.validate();
1064
- return i || this.dispatchEvent(new CustomEvent("invalid", {
1083
+ const t = this.validate();
1084
+ return t || this.dispatchEvent(new CustomEvent("invalid", {
1065
1085
  detail: { error: this.validationError },
1066
1086
  bubbles: !0,
1067
1087
  composed: !0
1068
- })), i;
1088
+ })), t;
1069
1089
  }
1070
1090
  reset() {
1071
1091
  this.inputValue = "", this.selectedId = null, this.validationError = null, this.errors = [], this.touched = !1, this.predictions = [], this.isOpen = !1, this.error = null, this.showNationalAddressIcon = !1, this.mode === "form" && (this._internals.setFormValue(null), this._internals.setValidity({}));
@@ -1074,31 +1094,88 @@ let d = class extends T {
1074
1094
  formResetCallback() {
1075
1095
  this.reset();
1076
1096
  }
1077
- formStateRestoreCallback(i) {
1078
- i && this.mode === "form" && (this.selectedId = i);
1097
+ formStateRestoreCallback(t) {
1098
+ t && this.mode === "form" && (this.selectedId = t);
1079
1099
  }
1080
1100
  validate() {
1081
1101
  if (this.mode !== "form")
1082
1102
  return !0;
1083
- const i = B(this.language), e = this.inputValue || "";
1084
- return this.required && !e.trim() ? (this.validationError = i.validationRequired, this._internals.setValidity(
1103
+ const t = q(this.language), e = this.inputValue || "";
1104
+ return this.required && !e.trim() ? (this.validationError = t.validationRequired, this._internals.setValidity(
1085
1105
  { valueMissing: !0 },
1086
1106
  this.validationError,
1087
1107
  this.inputElement
1088
- ), !1) : this.isSaudiFormMode() && e.trim() && !this.isShortAddressFormat(e) ? (this.validationError = i.validationSaudiFormat, this._internals.setValidity(
1108
+ ), !1) : this.isSaudiFormMode() && e.trim() && !this.isShortAddressFormat(e) ? (this.validationError = t.validationSaudiFormat, this._internals.setValidity(
1089
1109
  { patternMismatch: !0 },
1090
1110
  this.validationError,
1091
1111
  this.inputElement
1092
- ), !1) : this.pattern && e.trim() && !new RegExp(this.pattern).test(e) ? (this.validationError = i.validationPattern, this._internals.setValidity(
1112
+ ), !1) : this.pattern && e.trim() && !new RegExp(this.pattern).test(e) ? (this.validationError = t.validationPattern, this._internals.setValidity(
1093
1113
  { patternMismatch: !0 },
1094
1114
  this.validationError,
1095
1115
  this.inputElement
1096
1116
  ), !1) : (this.validationError = null, this._internals.setValidity({}), !0);
1097
1117
  }
1098
- handleInput(i) {
1118
+ /**
1119
+ * Normalize numerals from various scripts to Arabic numerals (0-9).
1120
+ * Handles Arabic-Indic, Devanagari (Hindi), Persian, and Bengali numerals.
1121
+ * Works consistently across all browsers and operating systems.
1122
+ */
1123
+ normalizeNumerals(t) {
1124
+ if (!t) return t;
1125
+ const e = {
1126
+ // Arabic-Indic numerals (used in Arab countries): ٠١٢٣٤٥٦٧٨٩
1127
+ "٠": "0",
1128
+ "١": "1",
1129
+ "٢": "2",
1130
+ "٣": "3",
1131
+ "٤": "4",
1132
+ "٥": "5",
1133
+ "٦": "6",
1134
+ "٧": "7",
1135
+ "٨": "8",
1136
+ "٩": "9",
1137
+ // Devanagari (Hindi) numerals (used in India, Nepal): ०१२३४५६७८९
1138
+ "०": "0",
1139
+ "१": "1",
1140
+ "२": "2",
1141
+ "३": "3",
1142
+ "४": "4",
1143
+ "५": "5",
1144
+ "६": "6",
1145
+ "७": "7",
1146
+ "८": "8",
1147
+ "९": "9",
1148
+ // Persian/Dari numerals (used in Iran, Afghanistan): ۰۱۲۳۴۵۶۷۸۹
1149
+ "۰": "0",
1150
+ "۱": "1",
1151
+ "۲": "2",
1152
+ "۳": "3",
1153
+ "۴": "4",
1154
+ "۵": "5",
1155
+ "۶": "6",
1156
+ "۷": "7",
1157
+ "۸": "8",
1158
+ "۹": "9",
1159
+ // Bengali numerals (used in Bangladesh, India): ০১২৩৪৫৬৭৮৯
1160
+ "০": "0",
1161
+ "১": "1",
1162
+ "২": "2",
1163
+ "৩": "3",
1164
+ "৪": "4",
1165
+ "৫": "5",
1166
+ "৬": "6",
1167
+ "৭": "7",
1168
+ "৮": "8",
1169
+ "৯": "9"
1170
+ };
1171
+ return t.split("").map((i) => e[i] ?? i).join("");
1172
+ }
1173
+ handleInput(t) {
1099
1174
  if (this.disabled) return;
1100
- const e = i.target, t = this.inputValue;
1101
- this.inputValue = e.value, this.touched = !0, this.showNationalAddressIcon && (this.showNationalAddressIcon = !1), this.mode === "form" && (this.validationError && (this.validationError = null), this.selectedId = null, this._internals.setFormValue(this.inputValue || null), this.validate()), this.errors && this.errors.length > 0 && (this.errors = []), this.inputValue.trim().length >= this.minChars && (this.isLoading = !0), this.debouncedFetch(this.inputValue), this._value = this.inputValue, this.requestUpdate("value", t), this.dispatchEvent(new CustomEvent("input", {
1175
+ const e = t.target, i = e.selectionStart ?? 0, r = this.inputValue, s = e.value, o = this.normalizeNumerals(s);
1176
+ o !== s && (e.value = o, requestAnimationFrame(() => {
1177
+ e.setSelectionRange(i, i);
1178
+ })), this.inputValue = o, this.touched = !0, this.showNationalAddressIcon && (this.showNationalAddressIcon = !1), this.mode === "form" && (this.validationError && (this.validationError = null), this.selectedId = null, this._internals.setFormValue(this.inputValue || null), this.validate()), this.errors && this.errors.length > 0 && (this.errors = []), this.inputValue.trim().length >= this.minChars && (this.isLoading = !0), this.debouncedFetch(this.inputValue), this._value = this.inputValue, this.requestUpdate("value", r), this.dispatchEvent(new CustomEvent("input", {
1102
1179
  detail: { value: this.inputValue },
1103
1180
  bubbles: !0,
1104
1181
  composed: !0
@@ -1111,17 +1188,17 @@ let d = class extends T {
1111
1188
  composed: !0
1112
1189
  }));
1113
1190
  }
1114
- async handleSelect(i) {
1191
+ async handleSelect(t) {
1115
1192
  if (this.disabled) return;
1116
- this.isSaudiFormMode() && i.place_id && this.isShortAddressFormat(i.place_id) ? (this.inputValue = i.place_id, this.showNationalAddressIcon = !0) : (this.inputValue = i.formatted_address, this.showNationalAddressIcon = !1), this.isOpen = !1, this.predictions = [], this.touched = !0;
1193
+ this.isSaudiFormMode() && t.place_id && this.isShortAddressFormat(t.place_id) ? (this.inputValue = t.place_id, this.showNationalAddressIcon = !0) : (this.inputValue = t.formatted_address, this.showNationalAddressIcon = !1), this.isOpen = !1, this.predictions = [], this.touched = !0;
1117
1194
  let e = null;
1118
- if (this.mode === "form" ? e = await this.fetchPlaceDetails(i.place_id) : i.geometry?.location ? e = {
1119
- place_id: i.place_id,
1120
- formatted_address: i.formatted_address || i.description,
1121
- geometry: i.geometry,
1122
- types: i.types,
1123
- address_components: i.address_components
1124
- } : e = await this.fetchPlaceDetails(i.place_id), e) {
1195
+ if (this.mode === "form" ? e = await this.fetchPlaceDetails(t.place_id) : t.geometry?.location ? e = {
1196
+ place_id: t.place_id,
1197
+ formatted_address: t.formatted_address || t.description,
1198
+ geometry: t.geometry,
1199
+ types: t.types,
1200
+ address_components: t.address_components
1201
+ } : e = await this.fetchPlaceDetails(t.place_id), e) {
1125
1202
  this.isSaudiFormMode() && e.place_id && this.isShortAddressFormat(e.place_id) ? (this.inputValue = e.place_id, this.showNationalAddressIcon = !0) : (e.formatted_address && (this.inputValue = e.formatted_address), this.showNationalAddressIcon = !1), this.mode === "form" && (this.selectedId = e.place_id, this._internals.setFormValue(this.inputValue), this.validate()), this._value = this.inputValue, this.dispatchEvent(new CustomEvent("input", {
1126
1203
  detail: { value: this.inputValue },
1127
1204
  bubbles: !0,
@@ -1130,32 +1207,32 @@ let d = class extends T {
1130
1207
  bubbles: !0,
1131
1208
  composed: !0
1132
1209
  }));
1133
- const t = this.getValidationSupport(e);
1210
+ const i = this.getValidationSupport(e);
1134
1211
  this.dispatchEvent(new CustomEvent("place-select", {
1135
- detail: { place: e, validationSupport: t },
1212
+ detail: { place: e, validationSupport: i },
1136
1213
  bubbles: !0,
1137
1214
  composed: !0
1138
1215
  })), this.dispatchEvent(new CustomEvent("place-changed", {
1139
- detail: { place: e, validationSupport: t },
1216
+ detail: { place: e, validationSupport: i },
1140
1217
  bubbles: !0,
1141
1218
  composed: !0
1142
1219
  }));
1143
1220
  }
1144
1221
  }
1145
- handleKeyDown(i) {
1222
+ handleKeyDown(t) {
1146
1223
  if (!this.disabled && !(!this.isOpen || this.predictions.length === 0))
1147
- switch (i.key) {
1224
+ switch (t.key) {
1148
1225
  case "ArrowDown":
1149
- i.preventDefault(), this.activeIndex = Math.min(this.activeIndex + 1, this.predictions.length - 1);
1226
+ t.preventDefault(), this.activeIndex = Math.min(this.activeIndex + 1, this.predictions.length - 1);
1150
1227
  break;
1151
1228
  case "ArrowUp":
1152
- i.preventDefault(), this.activeIndex = Math.max(this.activeIndex - 1, -1);
1229
+ t.preventDefault(), this.activeIndex = Math.max(this.activeIndex - 1, -1);
1153
1230
  break;
1154
1231
  case "Enter":
1155
- i.preventDefault(), this.activeIndex >= 0 && this.activeIndex < this.predictions.length && this.handleSelect(this.predictions[this.activeIndex]);
1232
+ t.preventDefault(), this.activeIndex >= 0 && this.activeIndex < this.predictions.length && this.handleSelect(this.predictions[this.activeIndex]);
1156
1233
  break;
1157
1234
  case "Escape":
1158
- i.preventDefault(), this.isOpen = !1, this.activeIndex = -1;
1235
+ t.preventDefault(), this.isOpen = !1, this.activeIndex = -1;
1159
1236
  break;
1160
1237
  }
1161
1238
  }
@@ -1187,39 +1264,39 @@ let d = class extends T {
1187
1264
  </span>
1188
1265
  ` : "";
1189
1266
  }
1190
- renderPrediction(i, e) {
1191
- const t = {
1267
+ renderPrediction(t, e) {
1268
+ const i = {
1192
1269
  "dropdown-item": !0,
1193
1270
  active: e === this.activeIndex
1194
1271
  };
1195
- let s = i.structured_formatting.main_text;
1196
- return i.short_address && s.includes(i.short_address) && (s = s.replace(i.short_address, "").trim(), s = s.replace(/\s*,\s*,\s*/g, ", ").replace(/^\s*,\s*|\s*,\s*$/g, "").trim()), g`
1272
+ let r = t.structured_formatting.main_text;
1273
+ return t.short_address && r.includes(t.short_address) && (r = r.replace(t.short_address, "").trim(), r = r.replace(/\s*,\s*,\s*/g, ", ").replace(/^\s*,\s*|\s*,\s*$/g, "").trim()), g`
1197
1274
  <div
1198
- class=${F(t)}
1275
+ class=${U(i)}
1199
1276
  part="dropdown-item ${e === this.activeIndex ? "dropdown-item-active" : ""}"
1200
- @click=${() => this.handleSelect(i)}
1277
+ @click=${() => this.handleSelect(t)}
1201
1278
  role="option"
1202
1279
  aria-selected=${e === this.activeIndex}
1203
1280
  >
1204
1281
  ${this.renderLocationIcon()}
1205
1282
  <div class="place-info" part="place-info">
1206
1283
  <div class="main-text" part="main-text">
1207
- ${i.short_address ? g`
1284
+ ${t.short_address ? g`
1208
1285
  <span class="national-address-badge" part="national-address-badge">
1209
1286
  <img
1210
1287
  src="https://cdn.salla.network/images/shipping/png/national-address-icon-small-min.png"
1211
1288
  alt="national address icon"
1212
1289
  class="national-address-icon"
1213
1290
  />
1214
- <span class="national-address-text">${i.short_address}</span>
1291
+ <span class="national-address-text">${t.short_address}</span>
1215
1292
  <span class="national-address-separator">-</span>
1216
1293
  </span>
1217
1294
  ` : ""}
1218
- ${s}
1295
+ ${r}
1219
1296
  </div>
1220
- ${i.structured_formatting.secondary_text ? g`
1297
+ ${t.structured_formatting.secondary_text ? g`
1221
1298
  <div class="secondary-text" part="secondary-text">
1222
- ${i.structured_formatting.secondary_text}
1299
+ ${t.structured_formatting.secondary_text}
1223
1300
  </div>
1224
1301
  ` : ""}
1225
1302
  </div>
@@ -1227,20 +1304,20 @@ let d = class extends T {
1227
1304
  `;
1228
1305
  }
1229
1306
  render() {
1230
- const i = {
1307
+ const t = {
1231
1308
  dropdown: !0,
1232
1309
  open: this.isOpen
1233
1310
  }, e = {
1234
1311
  "is-invalid": !!(this.mode === "form" && this.validationError) || this.errors && this.errors.length > 0,
1235
1312
  "with-national-icon": this.showNationalAddressIcon
1236
- }, t = {
1313
+ }, i = {
1237
1314
  required: this.mode === "form" && this.required
1238
- }, s = B(this.language), r = this.dir === "auto" ? Ge(this.language) ? "rtl" : "ltr" : this.dir, o = this.placeholder || s.placeholder, a = this.name || "salla-address-search";
1315
+ }, r = q(this.language), s = this.dir === "auto" ? Xe(this.language) ? "rtl" : "ltr" : this.dir, o = this.placeholder || r.placeholder, a = this.name || "salla-address-search";
1239
1316
  return g`
1240
- <div class="wrapper ${this.className}" part="wrapper" dir="${r}">
1317
+ <div class="wrapper ${this.className}" part="wrapper" dir="${s}">
1241
1318
  <div class="input-container" part="input-container">
1242
1319
  ${this.label ? g`
1243
- <label part="label" class=${F(t)}>
1320
+ <label part="label" class=${U(i)}>
1244
1321
  <span class="label-content">
1245
1322
  <span>${this.label}</span>
1246
1323
  ${this.renderTooltip()}
@@ -1250,10 +1327,10 @@ let d = class extends T {
1250
1327
  <div class="input-wrapper">
1251
1328
  <input
1252
1329
  part="input"
1253
- class=${F(e)}
1330
+ class=${U(e)}
1254
1331
  type="text"
1255
1332
  name="${a}"
1256
- .value=${this.inputValue}
1333
+ .value=${Ke(this.inputValue)}
1257
1334
  placeholder=${o}
1258
1335
  ?disabled=${this.disabled}
1259
1336
  @input=${this.handleInput}
@@ -1275,11 +1352,11 @@ let d = class extends T {
1275
1352
 
1276
1353
  <div
1277
1354
  id="predictions-list"
1278
- class=${F(i)}
1355
+ class=${U(t)}
1279
1356
  part="dropdown"
1280
1357
  role="listbox"
1281
1358
  >
1282
- ${this.predictions.length > 0 ? this.predictions.map((n, l) => this.renderPrediction(n, l)) : this.inputValue && !this.isLoading ? g`<div class="no-results" part="no-results">${s.noResults}</div>` : ""}
1359
+ ${this.predictions.length > 0 ? this.predictions.map((n, l) => this.renderPrediction(n, l)) : this.inputValue && !this.isLoading ? g`<div class="no-results" part="no-results">${r.noResults}</div>` : ""}
1283
1360
  </div>
1284
1361
  </div>
1285
1362
  ${this.mode === "form" && this.validationError ? g`
@@ -1298,7 +1375,7 @@ let d = class extends T {
1298
1375
  }
1299
1376
  };
1300
1377
  d.formAssociated = !0;
1301
- d.styles = me`
1378
+ d.styles = ve`
1302
1379
  :host {
1303
1380
  display: block;
1304
1381
  position: relative;
@@ -1863,50 +1940,50 @@ h([
1863
1940
  p({ type: Number })
1864
1941
  ], d.prototype, "minChars", 2);
1865
1942
  h([
1866
- v()
1943
+ b()
1867
1944
  ], d.prototype, "predictions", 2);
1868
1945
  h([
1869
- v()
1946
+ b()
1870
1947
  ], d.prototype, "isOpen", 2);
1871
1948
  h([
1872
- v()
1949
+ b()
1873
1950
  ], d.prototype, "isLoading", 2);
1874
1951
  h([
1875
- v()
1952
+ b()
1876
1953
  ], d.prototype, "error", 2);
1877
1954
  h([
1878
- v()
1955
+ b()
1879
1956
  ], d.prototype, "activeIndex", 2);
1880
1957
  h([
1881
- v()
1958
+ b()
1882
1959
  ], d.prototype, "inputValue", 2);
1883
1960
  h([
1884
- v()
1961
+ b()
1885
1962
  ], d.prototype, "sessionToken", 2);
1886
1963
  h([
1887
- v()
1964
+ b()
1888
1965
  ], d.prototype, "validationError", 2);
1889
1966
  h([
1890
- v()
1967
+ b()
1891
1968
  ], d.prototype, "touched", 2);
1892
1969
  h([
1893
- v()
1970
+ b()
1894
1971
  ], d.prototype, "showNationalAddressIcon", 2);
1895
1972
  h([
1896
- Me("input")
1973
+ qe("input")
1897
1974
  ], d.prototype, "inputElement", 2);
1898
1975
  d = h([
1899
- Ue("salla-address-autocomplete")
1976
+ De("salla-address-autocomplete")
1900
1977
  ], d);
1901
1978
  export {
1902
- He as ADDRESS_VALIDATION_SUPPORTED_COUNTRIES,
1979
+ Ye as ADDRESS_VALIDATION_SUPPORTED_COUNTRIES,
1903
1980
  d as SallaAddressAutocomplete,
1904
- ae as checkValidationSupport,
1905
- je as debounce,
1906
- We as generateSessionToken,
1907
- Ke as getCountryCode,
1908
- B as getTranslations,
1909
- Ge as isRTL,
1910
- tt as parseHighlight,
1911
- et as throttle
1981
+ ne as checkValidationSupport,
1982
+ Ge as debounce,
1983
+ Ze as generateSessionToken,
1984
+ Je as getCountryCode,
1985
+ q as getTranslations,
1986
+ Xe as isRTL,
1987
+ ot as parseHighlight,
1988
+ st as throttle
1912
1989
  };