tanya-chatbot 0.0.5 → 0.0.6

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,16 +1,15 @@
1
- import { jsx as c, jsxs as p, Fragment as Ge } from "react/jsx-runtime";
2
- import { forwardRef as Tt, useState as j, useEffect as fe, createElement as We, useRef as Se } from "react";
1
+ import { jsx as c, jsxs as f, Fragment as Ge } from "react/jsx-runtime";
2
+ import { forwardRef as Tt, useState as D, useEffect as fe, createElement as We, useRef as Ce } from "react";
3
3
  import * as _t from "@radix-ui/react-popover";
4
4
  import "clsx";
5
5
  import "tailwind-merge";
6
- import D from "axios";
6
+ import M from "axios";
7
7
  import "crypto-js";
8
- import { useSearchParams as tn } from "react-router-dom";
9
- import { useDispatch as Pt, useSelector as Oe } from "react-redux";
10
- import { createSlice as nn } from "@reduxjs/toolkit";
8
+ import { useDispatch as Pt, useSelector as je } from "react-redux";
9
+ import { createSlice as en } from "@reduxjs/toolkit";
11
10
  import { Icon as at } from "@iconify/react";
12
- import { toast as G } from "react-toastify";
13
- const be = (e) => {
11
+ import { toast as Q } from "react-toastify";
12
+ const ve = (e) => {
14
13
  const t = new CustomEvent("reactCartUpdated", {
15
14
  detail: {
16
15
  cartUpdated: !0,
@@ -20,12 +19,12 @@ const be = (e) => {
20
19
  });
21
20
  window.dispatchEvent(t);
22
21
  };
23
- function on({
22
+ function tn({
24
23
  ...e
25
24
  }) {
26
25
  return /* @__PURE__ */ c(_t.Root, { "data-slot": "popover", ...e });
27
26
  }
28
- function rn({
27
+ function nn({
29
28
  ...e
30
29
  }) {
31
30
  return /* @__PURE__ */ c(_t.Trigger, { "data-slot": "popover-trigger", ...e });
@@ -33,18 +32,18 @@ function rn({
33
32
  const pe = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }), Et = async () => {
34
33
  const e = "https://tanya-sfcc-server.vercel.app/";
35
34
  try {
36
- const t = await D.post(
37
- `${e}api/auth/token-bm-grant?baseUrl=${ie()}&siteId=${X()}`
35
+ const t = await M.post(
36
+ `${e}api/auth/token-bm-grant?baseUrl=${se()}&siteId=${ee()}`
38
37
  );
39
38
  return t.status === 200 && t.data.access_token ? t.data.access_token : (console.error("Failed to fetch token:", t.data), null);
40
39
  } catch (t) {
41
- return D.isAxiosError(t) ? console.error("Error fetching token:", t.response || t.message) : console.error("Unexpected error:", t), null;
40
+ return M.isAxiosError(t) ? console.error("Error fetching token:", t.response || t.message) : console.error("Unexpected error:", t), null;
42
41
  }
43
42
  }, $t = async (e) => {
44
43
  const t = "https://tanya-sfcc-server.vercel.app/";
45
44
  try {
46
- const n = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, r = await D.post(
47
- `${t}api/auth/token-existing-guest-customer?dwsid=${n}&baseUrl=${ie()}&siteId=${X()}&pubCfg=${ae()}&envRef=${ce()}&orgRef=${le()}`,
45
+ const n = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, r = await M.post(
46
+ `${t}api/auth/token-existing-guest-customer?dwsid=${n}&baseUrl=${se()}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
48
47
  {},
49
48
  {
50
49
  headers: {
@@ -55,10 +54,10 @@ const pe = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
55
54
  );
56
55
  return r.status === 200 && r.data ? r.data : null;
57
56
  } catch (n) {
58
- return D.isAxiosError(n) ? console.error("Error creating basket:", n.response || n.message) : console.error("Unexpected error:", n), null;
57
+ return M.isAxiosError(n) ? console.error("Error creating basket:", n.response || n.message) : console.error("Unexpected error:", n), null;
59
58
  }
60
59
  };
61
- async function Be() {
60
+ async function Me() {
62
61
  const e = localStorage.getItem("expires_in"), t = localStorage.getItem("access_token"), n = JSON.parse(
63
62
  sessionStorage.getItem("customerData") || "{}"
64
63
  ).isGuest;
@@ -70,8 +69,8 @@ async function Be() {
70
69
  sessionStorage.getItem("customerData") || "{}"
71
70
  ).usrRef;
72
71
  try {
73
- const i = n ? "unregister-auth" : "register-auth", l = await D.get(
74
- `${r}sc-api/${i}?dwsid=${o}&email=${s}&pubCfg=${ae()}&envRef=${ce()}&orgRef=${le()}&siteId=${X()}`
72
+ const i = n ? "unregister-auth" : "register-auth", l = await M.get(
73
+ `${r}sc-api/${i}?dwsid=${o}&email=${s}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}&siteId=${ee()}`
75
74
  );
76
75
  return localStorage.setItem("access_token", l.data.access_token), localStorage.setItem(
77
76
  "expires_in",
@@ -81,12 +80,12 @@ async function Be() {
81
80
  console.log(i);
82
81
  }
83
82
  }
84
- const ie = () => sessionStorage.getItem("Host"), X = () => sessionStorage.getItem("SiteId"), ae = () => sessionStorage.getItem("pubCfg"), ce = () => sessionStorage.getItem("envRef"), le = () => sessionStorage.getItem("orgRef"), ct = async (e, t) => {
83
+ const se = () => sessionStorage.getItem("Host"), ee = () => sessionStorage.getItem("SiteId"), ie = () => sessionStorage.getItem("pubCfg"), ae = () => sessionStorage.getItem("envRef"), ce = () => sessionStorage.getItem("orgRef"), ct = async (e, t) => {
85
84
  const { serverUrl: n, basePath: r } = pe();
86
85
  try {
87
- const o = ie();
88
- return (await D.get(
89
- `${n}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${X()}&pubCfg=${ae()}&envRef=${ce()}&orgRef=${le()}`,
86
+ const o = se();
87
+ return (await M.get(
88
+ `${n}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
90
89
  {
91
90
  headers: {
92
91
  "Content-Type": "application/json",
@@ -99,11 +98,11 @@ const ie = () => sessionStorage.getItem("Host"), X = () => sessionStorage.getIte
99
98
  }
100
99
  }, At = async (e) => {
101
100
  if (!e) throw new Error("Product ID is required");
102
- const { serverUrl: t, basePath: n } = pe(), r = ie();
101
+ const { serverUrl: t, basePath: n } = pe(), r = se();
103
102
  console.log("calling access");
104
- const { access_token: o } = await Be();
105
- return console.log(o), (await D.get(
106
- `${t}${n}/product-sfcc/${e}?baseUrl=${r}&siteId=${X()}&pubCfg=${ae()}&envRef=${ce()}&orgRef=${le()}`,
103
+ const { access_token: o } = await Me();
104
+ return console.log(o), (await M.get(
105
+ `${t}${n}/product-sfcc/${e}?baseUrl=${r}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
107
106
  {
108
107
  headers: {
109
108
  "Content-Type": "application/json",
@@ -111,13 +110,13 @@ const ie = () => sessionStorage.getItem("Host"), X = () => sessionStorage.getIte
111
110
  }
112
111
  }
113
112
  )).data;
114
- }, sn = async (e) => {
113
+ }, on = async (e) => {
115
114
  if (!e) throw new Error("customerId is required");
116
115
  const t = await Et(), { customer_token: n } = await $t(
117
116
  t
118
- ), { serverUrl: r, basePath: o } = pe(), i = (await Be()).access_token;
119
- return (await D.get(
120
- `${r}${o}/get-interest?baseUrl=${ie()}&customerId=${e}&siteId=${X()}&pubCfg=${ae()}&envRef=${ce()}&orgRef=${le()}`,
117
+ ), { serverUrl: r, basePath: o } = pe(), i = (await Me()).access_token;
118
+ return (await M.get(
119
+ `${r}${o}/get-interest?baseUrl=${se()}&customerId=${e}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
121
120
  {
122
121
  headers: {
123
122
  "Content-Type": "application/json",
@@ -125,10 +124,10 @@ const ie = () => sessionStorage.getItem("Host"), X = () => sessionStorage.getIte
125
124
  }
126
125
  }
127
126
  )).data;
128
- }, lt = (e) => String(typeof e == "string" ? e : e["en-US"] || e), ut = (e) => e != null && e.image ? [e.image] : "variants" in e ? e.variants[0].images : e.masterVariant.images.map((t) => t.url), an = (e, t) => e.toLocaleString("en-US", {
127
+ }, lt = (e) => String(typeof e == "string" ? e : e["en-US"] || e), dt = (e) => e != null && e.image ? [e.image] : "variants" in e ? e.variants[0].images : e.masterVariant.images.map((t) => t.url), rn = (e, t) => e.toLocaleString("en-US", {
129
128
  style: "currency",
130
129
  currency: t || "USD"
131
- }), dt = (e) => {
130
+ }), ut = (e) => {
132
131
  var t, n, r;
133
132
  return "variants" in e ? {
134
133
  centAmount: (t = e.variants[0]) == null ? void 0 : t.prices.EUR.max,
@@ -137,11 +136,11 @@ const ie = () => sessionStorage.getItem("Host"), X = () => sessionStorage.getIte
137
136
  centAmount: (n = e.masterVariant) == null ? void 0 : n.prices[0].value.centAmount,
138
137
  currencyCode: (r = e.masterVariant) == null ? void 0 : r.prices[0].value.currencyCode
139
138
  };
140
- }, cn = (e) => e.charAt(0).toUpperCase() + e.slice(1), ft = (e, t) => e.length < t ? e : e.slice(0, t) + "...", Ve = (e) => e.split("\\n").map((t, n) => {
139
+ }, sn = (e) => e.charAt(0).toUpperCase() + e.slice(1), ft = (e, t) => e.length < t ? e : e.slice(0, t) + "...", Ve = (e) => e.split("\\n").map((t, n) => {
141
140
  const r = t.match(/^(\d+)\.\s(.+)/);
142
141
  return r ? `<p key=${n} class="mb-2"><strong>${r[1]}.</strong> ${r[2]}</p>` : t.trim() ? `<p key=${n} class="mb-2">${t}</p>` : "<br/>";
143
142
  }).join("");
144
- function ln(e, t) {
143
+ function an(e, t) {
145
144
  const n = e.icons, r = e.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
146
145
  function s(i) {
147
146
  if (n[i]) return o[i] = [];
@@ -159,30 +158,30 @@ const Lt = Object.freeze({
159
158
  top: 0,
160
159
  width: 16,
161
160
  height: 16
162
- }), De = Object.freeze({
161
+ }), Oe = Object.freeze({
163
162
  rotate: 0,
164
163
  vFlip: !1,
165
164
  hFlip: !1
166
165
  }), tt = Object.freeze({
167
166
  ...Lt,
168
- ...De
167
+ ...Oe
169
168
  }), Qe = Object.freeze({
170
169
  ...tt,
171
170
  body: "",
172
171
  hidden: !1
173
172
  });
174
- function un(e, t) {
173
+ function cn(e, t) {
175
174
  const n = {};
176
175
  !e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
177
176
  const r = ((e.rotate || 0) + (t.rotate || 0)) % 4;
178
177
  return r && (n.rotate = r), n;
179
178
  }
180
179
  function pt(e, t) {
181
- const n = un(e, t);
182
- for (const r in Qe) r in De ? r in e && !(r in n) && (n[r] = De[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
180
+ const n = cn(e, t);
181
+ for (const r in Qe) r in Oe ? r in e && !(r in n) && (n[r] = Oe[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
183
182
  return n;
184
183
  }
185
- function dn(e, t, n) {
184
+ function ln(e, t, n) {
186
185
  const r = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null);
187
186
  let s = {};
188
187
  function i(l) {
@@ -196,14 +195,14 @@ function jt(e, t) {
196
195
  e.not_found instanceof Array && e.not_found.forEach((o) => {
197
196
  t(o, null), n.push(o);
198
197
  });
199
- const r = ln(e);
198
+ const r = an(e);
200
199
  for (const o in r) {
201
200
  const s = r[o];
202
- s && (t(o, dn(e, o, s)), n.push(o));
201
+ s && (t(o, ln(e, o, s)), n.push(o));
203
202
  }
204
203
  return n;
205
204
  }
206
- const fn = {
205
+ const dn = {
207
206
  provider: "",
208
207
  aliases: {},
209
208
  not_found: {},
@@ -216,7 +215,7 @@ function Je(e, t) {
216
215
  function Ot(e) {
217
216
  if (typeof e != "object" || e === null) return null;
218
217
  const t = e;
219
- if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Je(e, fn)) return null;
218
+ if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Je(e, dn)) return null;
220
219
  const n = t.icons;
221
220
  for (const o in n) {
222
221
  const s = n[o];
@@ -230,7 +229,7 @@ function Ot(e) {
230
229
  return t;
231
230
  }
232
231
  const ht = /* @__PURE__ */ Object.create(null);
233
- function pn(e, t) {
232
+ function un(e, t) {
234
233
  return {
235
234
  provider: e,
236
235
  prefix: t,
@@ -238,16 +237,16 @@ function pn(e, t) {
238
237
  missing: /* @__PURE__ */ new Set()
239
238
  };
240
239
  }
241
- function ke(e, t) {
240
+ function Ie(e, t) {
242
241
  const n = ht[e] || (ht[e] = /* @__PURE__ */ Object.create(null));
243
- return n[t] || (n[t] = pn(e, t));
242
+ return n[t] || (n[t] = un(e, t));
244
243
  }
245
244
  function Dt(e, t) {
246
245
  return Ot(t) ? jt(t, (n, r) => {
247
246
  r ? e.icons[n] = r : e.missing.add(n);
248
247
  }) : [];
249
248
  }
250
- function hn(e, t, n) {
249
+ function fn(e, t, n) {
251
250
  try {
252
251
  if (typeof n.body == "string")
253
252
  return e.icons[t] = { ...n }, !0;
@@ -255,7 +254,7 @@ function hn(e, t, n) {
255
254
  }
256
255
  return !1;
257
256
  }
258
- const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, He = (e, t, n, r = "") => {
257
+ const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, Be = (e, t, n, r = "") => {
259
258
  const o = e.split(":");
260
259
  if (e.slice(0, 1) === "@") {
261
260
  if (o.length < 2 || o.length > 3) return null;
@@ -263,12 +262,12 @@ const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, He = (e, t, n, r = "") => {
263
262
  }
264
263
  if (o.length > 3 || !o.length) return null;
265
264
  if (o.length > 1) {
266
- const l = o.pop(), a = o.pop(), d = {
265
+ const l = o.pop(), a = o.pop(), u = {
267
266
  provider: o.length > 0 ? o[0] : r,
268
267
  prefix: a,
269
268
  name: l
270
269
  };
271
- return t && !Le(d) ? null : d;
270
+ return t && !Ae(u) ? null : u;
272
271
  }
273
272
  const s = o[0], i = s.split("-");
274
273
  if (i.length > 1) {
@@ -277,7 +276,7 @@ const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, He = (e, t, n, r = "") => {
277
276
  prefix: i.shift(),
278
277
  name: i.join("-")
279
278
  };
280
- return t && !Le(l) ? null : l;
279
+ return t && !Ae(l) ? null : l;
281
280
  }
282
281
  if (n && r === "") {
283
282
  const l = {
@@ -285,41 +284,41 @@ const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, He = (e, t, n, r = "") => {
285
284
  prefix: "",
286
285
  name: s
287
286
  };
288
- return t && !Le(l, n) ? null : l;
287
+ return t && !Ae(l, n) ? null : l;
289
288
  }
290
289
  return null;
291
- }, Le = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
292
- let _e = !1;
290
+ }, Ae = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
291
+ let Pe = !1;
293
292
  function Mt(e) {
294
- return typeof e == "boolean" && (_e = e), _e;
293
+ return typeof e == "boolean" && (Pe = e), Pe;
295
294
  }
296
295
  function mt(e) {
297
- const t = typeof e == "string" ? He(e, !0, _e) : e;
296
+ const t = typeof e == "string" ? Be(e, !0, Pe) : e;
298
297
  if (t) {
299
- const n = ke(t.provider, t.prefix), r = t.name;
298
+ const n = Ie(t.provider, t.prefix), r = t.name;
300
299
  return n.icons[r] || (n.missing.has(r) ? null : void 0);
301
300
  }
302
301
  }
303
- function mn(e, t) {
304
- const n = He(e, !0, _e);
302
+ function pn(e, t) {
303
+ const n = Be(e, !0, Pe);
305
304
  if (!n) return !1;
306
- const r = ke(n.provider, n.prefix);
307
- return t ? hn(r, n.name, t) : (r.missing.add(n.name), !0);
305
+ const r = Ie(n.provider, n.prefix);
306
+ return t ? fn(r, n.name, t) : (r.missing.add(n.name), !0);
308
307
  }
309
- function gn(e, t) {
308
+ function hn(e, t) {
310
309
  if (typeof e != "object") return !1;
311
- if (typeof t != "string" && (t = e.provider || ""), _e && !t && !e.prefix) {
310
+ if (typeof t != "string" && (t = e.provider || ""), Pe && !t && !e.prefix) {
312
311
  let o = !1;
313
312
  return Ot(e) && (e.prefix = "", jt(e, (s, i) => {
314
- mn(s, i) && (o = !0);
313
+ pn(s, i) && (o = !0);
315
314
  })), o;
316
315
  }
317
316
  const n = e.prefix;
318
- if (!Le({
317
+ if (!Ae({
319
318
  prefix: n,
320
319
  name: "a"
321
320
  })) return !1;
322
- const r = ke(t, n);
321
+ const r = Ie(t, n);
323
322
  return !!Dt(r, e);
324
323
  }
325
324
  const Bt = Object.freeze({
@@ -327,16 +326,16 @@ const Bt = Object.freeze({
327
326
  height: null
328
327
  }), Ht = Object.freeze({
329
328
  ...Bt,
330
- ...De
331
- }), yn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, xn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
329
+ ...Oe
330
+ }), mn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, gn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
332
331
  function gt(e, t, n) {
333
332
  if (t === 1) return e;
334
333
  if (n = n || 100, typeof e == "number") return Math.ceil(e * t * n) / n;
335
334
  if (typeof e != "string") return e;
336
- const r = e.split(yn);
335
+ const r = e.split(mn);
337
336
  if (r === null || !r.length) return e;
338
337
  const o = [];
339
- let s = r.shift(), i = xn.test(s);
338
+ let s = r.shift(), i = gn.test(s);
340
339
  for (; ; ) {
341
340
  if (i) {
342
341
  const l = parseFloat(s);
@@ -346,7 +345,7 @@ function gt(e, t, n) {
346
345
  i = !i;
347
346
  }
348
347
  }
349
- function wn(e, t = "defs") {
348
+ function yn(e, t = "defs") {
350
349
  let n = "";
351
350
  const r = e.indexOf("<" + t);
352
351
  for (; r >= 0; ) {
@@ -361,15 +360,15 @@ function wn(e, t = "defs") {
361
360
  content: e
362
361
  };
363
362
  }
364
- function bn(e, t) {
363
+ function xn(e, t) {
365
364
  return e ? "<defs>" + e + "</defs>" + t : t;
366
365
  }
367
- function vn(e, t, n) {
368
- const r = wn(e);
369
- return bn(r.defs, t + r.content + n);
366
+ function wn(e, t, n) {
367
+ const r = yn(e);
368
+ return xn(r.defs, t + r.content + n);
370
369
  }
371
- const kn = (e) => e === "unset" || e === "undefined" || e === "none";
372
- function In(e, t) {
370
+ const bn = (e) => e === "unset" || e === "undefined" || e === "none";
371
+ function vn(e, t) {
373
372
  const n = {
374
373
  ...tt,
375
374
  ...e
@@ -383,58 +382,58 @@ function In(e, t) {
383
382
  height: n.height
384
383
  };
385
384
  let s = n.body;
386
- [n, r].forEach((_) => {
387
- const h = [], v = _.hFlip, O = _.vFlip;
388
- let $ = _.rotate;
389
- v ? O ? $ += 2 : (h.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), h.push("scale(-1 1)"), o.top = o.left = 0) : O && (h.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), h.push("scale(1 -1)"), o.top = o.left = 0);
390
- let E;
391
- switch ($ < 0 && ($ -= Math.floor($ / 4) * 4), $ = $ % 4, $) {
385
+ [n, r].forEach((F) => {
386
+ const m = [], v = F.hFlip, U = F.vFlip;
387
+ let E = F.rotate;
388
+ v ? U ? E += 2 : (m.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), m.push("scale(-1 1)"), o.top = o.left = 0) : U && (m.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), m.push("scale(1 -1)"), o.top = o.left = 0);
389
+ let L;
390
+ switch (E < 0 && (E -= Math.floor(E / 4) * 4), E = E % 4, E) {
392
391
  case 1:
393
- E = o.height / 2 + o.top, h.unshift("rotate(90 " + E.toString() + " " + E.toString() + ")");
392
+ L = o.height / 2 + o.top, m.unshift("rotate(90 " + L.toString() + " " + L.toString() + ")");
394
393
  break;
395
394
  case 2:
396
- h.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
395
+ m.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
397
396
  break;
398
397
  case 3:
399
- E = o.width / 2 + o.left, h.unshift("rotate(-90 " + E.toString() + " " + E.toString() + ")");
398
+ L = o.width / 2 + o.left, m.unshift("rotate(-90 " + L.toString() + " " + L.toString() + ")");
400
399
  break;
401
400
  }
402
- $ % 2 === 1 && (o.left !== o.top && (E = o.left, o.left = o.top, o.top = E), o.width !== o.height && (E = o.width, o.width = o.height, o.height = E)), h.length && (s = vn(s, '<g transform="' + h.join(" ") + '">', "</g>"));
401
+ E % 2 === 1 && (o.left !== o.top && (L = o.left, o.left = o.top, o.top = L), o.width !== o.height && (L = o.width, o.width = o.height, o.height = L)), m.length && (s = wn(s, '<g transform="' + m.join(" ") + '">', "</g>"));
403
402
  });
404
- const i = r.width, l = r.height, a = o.width, d = o.height;
405
- let f, y;
406
- i === null ? (y = l === null ? "1em" : l === "auto" ? d : l, f = gt(y, a / d)) : (f = i === "auto" ? a : i, y = l === null ? gt(f, d / a) : l === "auto" ? d : l);
407
- const b = {}, m = (_, h) => {
408
- kn(h) || (b[_] = h.toString());
403
+ const i = r.width, l = r.height, a = o.width, u = o.height;
404
+ let p, g;
405
+ i === null ? (g = l === null ? "1em" : l === "auto" ? u : l, p = gt(g, a / u)) : (p = i === "auto" ? a : i, g = l === null ? gt(p, u / a) : l === "auto" ? u : l);
406
+ const b = {}, h = (F, m) => {
407
+ bn(m) || (b[F] = m.toString());
409
408
  };
410
- m("width", f), m("height", y);
411
- const I = [
409
+ h("width", p), h("height", g);
410
+ const k = [
412
411
  o.left,
413
412
  o.top,
414
413
  a,
415
- d
414
+ u
416
415
  ];
417
- return b.viewBox = I.join(" "), {
416
+ return b.viewBox = k.join(" "), {
418
417
  attributes: b,
419
- viewBox: I,
418
+ viewBox: k,
420
419
  body: s
421
420
  };
422
421
  }
423
- const Sn = /\sid="(\S+)"/g, Cn = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
424
- let Fn = 0;
425
- function Nn(e, t = Cn) {
422
+ const kn = /\sid="(\S+)"/g, In = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
423
+ let Sn = 0;
424
+ function Cn(e, t = In) {
426
425
  const n = [];
427
426
  let r;
428
- for (; r = Sn.exec(e); ) n.push(r[1]);
427
+ for (; r = kn.exec(e); ) n.push(r[1]);
429
428
  if (!n.length) return e;
430
429
  const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
431
430
  return n.forEach((s) => {
432
- const i = typeof t == "function" ? t(s) : t + (Fn++).toString(), l = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
431
+ const i = typeof t == "function" ? t(s) : t + (Sn++).toString(), l = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
433
432
  e = e.replace(new RegExp('([#;"])(' + l + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
434
433
  }), e = e.replace(new RegExp(o, "g"), ""), e;
435
434
  }
436
435
  const Ye = /* @__PURE__ */ Object.create(null);
437
- function Tn(e, t) {
436
+ function Fn(e, t) {
438
437
  Ye[e] = t;
439
438
  }
440
439
  function Ze(e) {
@@ -455,25 +454,25 @@ function nt(e) {
455
454
  dataAfterTimeout: e.dataAfterTimeout !== !1
456
455
  };
457
456
  }
458
- const ot = /* @__PURE__ */ Object.create(null), Ce = ["https://api.simplesvg.com", "https://api.unisvg.com"], je = [];
459
- for (; Ce.length > 0; ) Ce.length === 1 || Math.random() > 0.5 ? je.push(Ce.shift()) : je.push(Ce.pop());
460
- ot[""] = nt({ resources: ["https://api.iconify.design"].concat(je) });
461
- function _n(e, t) {
457
+ const ot = /* @__PURE__ */ Object.create(null), Fe = ["https://api.simplesvg.com", "https://api.unisvg.com"], Le = [];
458
+ for (; Fe.length > 0; ) Fe.length === 1 || Math.random() > 0.5 ? Le.push(Fe.shift()) : Le.push(Fe.pop());
459
+ ot[""] = nt({ resources: ["https://api.iconify.design"].concat(Le) });
460
+ function Nn(e, t) {
462
461
  const n = nt(t);
463
462
  return n === null ? !1 : (ot[e] = n, !0);
464
463
  }
465
464
  function rt(e) {
466
465
  return ot[e];
467
466
  }
468
- const Pn = () => {
467
+ const Tn = () => {
469
468
  let e;
470
469
  try {
471
470
  if (e = fetch, typeof e == "function") return e;
472
471
  } catch {
473
472
  }
474
473
  };
475
- let yt = Pn();
476
- function En(e, t) {
474
+ let yt = Tn();
475
+ function _n(e, t) {
477
476
  const n = rt(e);
478
477
  if (!n) return 0;
479
478
  let r;
@@ -488,19 +487,19 @@ function En(e, t) {
488
487
  }
489
488
  return r;
490
489
  }
491
- function $n(e) {
490
+ function Pn(e) {
492
491
  return e === 404;
493
492
  }
494
- const An = (e, t, n) => {
495
- const r = [], o = En(e, t), s = "icons";
493
+ const En = (e, t, n) => {
494
+ const r = [], o = _n(e, t), s = "icons";
496
495
  let i = {
497
496
  type: s,
498
497
  provider: e,
499
498
  prefix: t,
500
499
  icons: []
501
500
  }, l = 0;
502
- return n.forEach((a, d) => {
503
- l += a.length + 1, l >= o && d > 0 && (r.push(i), i = {
501
+ return n.forEach((a, u) => {
502
+ l += a.length + 1, l >= o && u > 0 && (r.push(i), i = {
504
503
  type: s,
505
504
  provider: e,
506
505
  prefix: t,
@@ -508,19 +507,19 @@ const An = (e, t, n) => {
508
507
  }, l = a.length), i.icons.push(a);
509
508
  }), r.push(i), r;
510
509
  };
511
- function Ln(e) {
510
+ function $n(e) {
512
511
  if (typeof e == "string") {
513
512
  const t = rt(e);
514
513
  if (t) return t.path;
515
514
  }
516
515
  return "/";
517
516
  }
518
- const jn = (e, t, n) => {
517
+ const An = (e, t, n) => {
519
518
  if (!yt) {
520
519
  n("abort", 424);
521
520
  return;
522
521
  }
523
- let r = Ln(t.provider);
522
+ let r = $n(t.provider);
524
523
  switch (t.type) {
525
524
  case "icons": {
526
525
  const s = t.prefix, l = t.icons.join(","), a = new URLSearchParams({ icons: l });
@@ -541,7 +540,7 @@ const jn = (e, t, n) => {
541
540
  const i = s.status;
542
541
  if (i !== 200) {
543
542
  setTimeout(() => {
544
- n($n(i) ? "abort" : "next", i);
543
+ n(Pn(i) ? "abort" : "next", i);
545
544
  });
546
545
  return;
547
546
  }
@@ -559,9 +558,9 @@ const jn = (e, t, n) => {
559
558
  }).catch(() => {
560
559
  n("next", o);
561
560
  });
562
- }, On = {
563
- prepare: An,
564
- send: jn
561
+ }, Ln = {
562
+ prepare: En,
563
+ send: An
565
564
  };
566
565
  function qt(e, t) {
567
566
  e.forEach((n) => {
@@ -569,7 +568,7 @@ function qt(e, t) {
569
568
  r && (n.loaderCallbacks = r.filter((o) => o.id !== t));
570
569
  });
571
570
  }
572
- function Dn(e) {
571
+ function jn(e) {
573
572
  e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
574
573
  e.pendingCallbacksFlag = !1;
575
574
  const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
@@ -580,16 +579,16 @@ function Dn(e) {
580
579
  const i = s.icons, l = i.pending.length;
581
580
  i.pending = i.pending.filter((a) => {
582
581
  if (a.prefix !== o) return !0;
583
- const d = a.name;
584
- if (e.icons[d]) i.loaded.push({
582
+ const u = a.name;
583
+ if (e.icons[u]) i.loaded.push({
585
584
  provider: r,
586
585
  prefix: o,
587
- name: d
586
+ name: u
588
587
  });
589
- else if (e.missing.has(d)) i.missing.push({
588
+ else if (e.missing.has(u)) i.missing.push({
590
589
  provider: r,
591
590
  prefix: o,
592
- name: d
591
+ name: u
593
592
  });
594
593
  else
595
594
  return n = !0, !0;
@@ -598,9 +597,9 @@ function Dn(e) {
598
597
  });
599
598
  }));
600
599
  }
601
- let Un = 0;
602
- function Mn(e, t, n) {
603
- const r = Un++, o = qt.bind(null, n, r);
600
+ let On = 0;
601
+ function Dn(e, t, n) {
602
+ const r = On++, o = qt.bind(null, n, r);
604
603
  if (!t.pending.length) return o;
605
604
  const s = {
606
605
  id: r,
@@ -612,7 +611,7 @@ function Mn(e, t, n) {
612
611
  (i.loaderCallbacks || (i.loaderCallbacks = [])).push(s);
613
612
  }), o;
614
613
  }
615
- function Bn(e) {
614
+ function Un(e) {
616
615
  const t = {
617
616
  loaded: [],
618
617
  missing: [],
@@ -627,25 +626,25 @@ function Bn(e) {
627
626
  return e.forEach((o) => {
628
627
  if (r.name === o.name && r.prefix === o.prefix && r.provider === o.provider) return;
629
628
  r = o;
630
- const s = o.provider, i = o.prefix, l = o.name, a = n[s] || (n[s] = /* @__PURE__ */ Object.create(null)), d = a[i] || (a[i] = ke(s, i));
631
- let f;
632
- l in d.icons ? f = t.loaded : i === "" || d.missing.has(l) ? f = t.missing : f = t.pending;
633
- const y = {
629
+ const s = o.provider, i = o.prefix, l = o.name, a = n[s] || (n[s] = /* @__PURE__ */ Object.create(null)), u = a[i] || (a[i] = Ie(s, i));
630
+ let p;
631
+ l in u.icons ? p = t.loaded : i === "" || u.missing.has(l) ? p = t.missing : p = t.pending;
632
+ const g = {
634
633
  provider: s,
635
634
  prefix: i,
636
635
  name: l
637
636
  };
638
- f.push(y);
637
+ p.push(g);
639
638
  }), t;
640
639
  }
641
- function Hn(e, t = !0, n = !1) {
640
+ function Mn(e, t = !0, n = !1) {
642
641
  const r = [];
643
642
  return e.forEach((o) => {
644
- const s = typeof o == "string" ? He(o, t, n) : o;
643
+ const s = typeof o == "string" ? Be(o, t, n) : o;
645
644
  s && r.push(s);
646
645
  }), r;
647
646
  }
648
- const qn = {
647
+ const Bn = {
649
648
  resources: [],
650
649
  index: 0,
651
650
  timeout: 2e3,
@@ -653,118 +652,118 @@ const qn = {
653
652
  random: !1,
654
653
  dataAfterTimeout: !1
655
654
  };
656
- function zn(e, t, n, r) {
655
+ function Hn(e, t, n, r) {
657
656
  const o = e.resources.length, s = e.random ? Math.floor(Math.random() * o) : e.index;
658
657
  let i;
659
658
  if (e.random) {
660
- let C = e.resources.slice(0);
661
- for (i = []; C.length > 1; ) {
662
- const A = Math.floor(Math.random() * C.length);
663
- i.push(C[A]), C = C.slice(0, A).concat(C.slice(A + 1));
659
+ let I = e.resources.slice(0);
660
+ for (i = []; I.length > 1; ) {
661
+ const O = Math.floor(Math.random() * I.length);
662
+ i.push(I[O]), I = I.slice(0, O).concat(I.slice(O + 1));
664
663
  }
665
- i = i.concat(C);
664
+ i = i.concat(I);
666
665
  } else i = e.resources.slice(s).concat(e.resources.slice(0, s));
667
666
  const l = Date.now();
668
- let a = "pending", d = 0, f, y = null, b = [], m = [];
669
- typeof r == "function" && m.push(r);
670
- function I() {
671
- y && (clearTimeout(y), y = null);
667
+ let a = "pending", u = 0, p, g = null, b = [], h = [];
668
+ typeof r == "function" && h.push(r);
669
+ function k() {
670
+ g && (clearTimeout(g), g = null);
672
671
  }
673
- function _() {
674
- a === "pending" && (a = "aborted"), I(), b.forEach((C) => {
675
- C.status === "pending" && (C.status = "aborted");
672
+ function F() {
673
+ a === "pending" && (a = "aborted"), k(), b.forEach((I) => {
674
+ I.status === "pending" && (I.status = "aborted");
676
675
  }), b = [];
677
676
  }
678
- function h(C, A) {
679
- A && (m = []), typeof C == "function" && m.push(C);
677
+ function m(I, O) {
678
+ O && (h = []), typeof I == "function" && h.push(I);
680
679
  }
681
680
  function v() {
682
681
  return {
683
682
  startTime: l,
684
683
  payload: t,
685
684
  status: a,
686
- queriesSent: d,
685
+ queriesSent: u,
687
686
  queriesPending: b.length,
688
- subscribe: h,
689
- abort: _
687
+ subscribe: m,
688
+ abort: F
690
689
  };
691
690
  }
692
- function O() {
693
- a = "failed", m.forEach((C) => {
694
- C(void 0, f);
691
+ function U() {
692
+ a = "failed", h.forEach((I) => {
693
+ I(void 0, p);
695
694
  });
696
695
  }
697
- function $() {
698
- b.forEach((C) => {
699
- C.status === "pending" && (C.status = "aborted");
696
+ function E() {
697
+ b.forEach((I) => {
698
+ I.status === "pending" && (I.status = "aborted");
700
699
  }), b = [];
701
700
  }
702
- function E(C, A, z) {
703
- const Q = A !== "success";
704
- switch (b = b.filter((U) => U !== C), a) {
701
+ function L(I, O, q) {
702
+ const z = O !== "success";
703
+ switch (b = b.filter(($) => $ !== I), a) {
705
704
  case "pending":
706
705
  break;
707
706
  case "failed":
708
- if (Q || !e.dataAfterTimeout) return;
707
+ if (z || !e.dataAfterTimeout) return;
709
708
  break;
710
709
  default:
711
710
  return;
712
711
  }
713
- if (A === "abort") {
714
- f = z, O();
712
+ if (O === "abort") {
713
+ p = q, U();
715
714
  return;
716
715
  }
717
- if (Q) {
718
- f = z, b.length || (i.length ? W() : O());
716
+ if (z) {
717
+ p = q, b.length || (i.length ? Y() : U());
719
718
  return;
720
719
  }
721
- if (I(), $(), !e.random) {
722
- const U = e.resources.indexOf(C.resource);
723
- U !== -1 && U !== e.index && (e.index = U);
720
+ if (k(), E(), !e.random) {
721
+ const $ = e.resources.indexOf(I.resource);
722
+ $ !== -1 && $ !== e.index && (e.index = $);
724
723
  }
725
- a = "completed", m.forEach((U) => {
726
- U(z);
724
+ a = "completed", h.forEach(($) => {
725
+ $(q);
727
726
  });
728
727
  }
729
- function W() {
728
+ function Y() {
730
729
  if (a !== "pending") return;
731
- I();
732
- const C = i.shift();
733
- if (C === void 0) {
730
+ k();
731
+ const I = i.shift();
732
+ if (I === void 0) {
734
733
  if (b.length) {
735
- y = setTimeout(() => {
736
- I(), a === "pending" && ($(), O());
734
+ g = setTimeout(() => {
735
+ k(), a === "pending" && (E(), U());
737
736
  }, e.timeout);
738
737
  return;
739
738
  }
740
- O();
739
+ U();
741
740
  return;
742
741
  }
743
- const A = {
742
+ const O = {
744
743
  status: "pending",
745
- resource: C,
746
- callback: (z, Q) => {
747
- E(A, z, Q);
744
+ resource: I,
745
+ callback: (q, z) => {
746
+ L(O, q, z);
748
747
  }
749
748
  };
750
- b.push(A), d++, y = setTimeout(W, e.rotate), n(C, t, A.callback);
749
+ b.push(O), u++, g = setTimeout(Y, e.rotate), n(I, t, O.callback);
751
750
  }
752
- return setTimeout(W), v;
751
+ return setTimeout(Y), v;
753
752
  }
754
753
  function zt(e) {
755
754
  const t = {
756
- ...qn,
755
+ ...Bn,
757
756
  ...e
758
757
  };
759
758
  let n = [];
760
759
  function r() {
761
760
  n = n.filter((l) => l().status === "pending");
762
761
  }
763
- function o(l, a, d) {
764
- const f = zn(t, l, a, (y, b) => {
765
- r(), d && d(y, b);
762
+ function o(l, a, u) {
763
+ const p = Hn(t, l, a, (g, b) => {
764
+ r(), u && u(g, b);
766
765
  });
767
- return n.push(f), f;
766
+ return n.push(p), p;
768
767
  }
769
768
  function s(l) {
770
769
  return n.find((a) => l(a)) || null;
@@ -782,7 +781,7 @@ function zt(e) {
782
781
  function xt() {
783
782
  }
784
783
  const Ke = /* @__PURE__ */ Object.create(null);
785
- function Rn(e) {
784
+ function qn(e) {
786
785
  if (!Ke[e]) {
787
786
  const t = rt(e);
788
787
  if (!t) return;
@@ -794,14 +793,14 @@ function Rn(e) {
794
793
  }
795
794
  return Ke[e];
796
795
  }
797
- function Vn(e, t, n) {
796
+ function zn(e, t, n) {
798
797
  let r, o;
799
798
  if (typeof e == "string") {
800
799
  const s = Ze(e);
801
800
  if (!s)
802
801
  return n(void 0, 424), xt;
803
802
  o = s.send;
804
- const i = Rn(e);
803
+ const i = qn(e);
805
804
  i && (r = i.redundancy);
806
805
  } else {
807
806
  const s = nt(e);
@@ -815,12 +814,12 @@ function Vn(e, t, n) {
815
814
  }
816
815
  function wt() {
817
816
  }
818
- function Jn(e) {
817
+ function Rn(e) {
819
818
  e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
820
- e.iconsLoaderFlag = !1, Dn(e);
819
+ e.iconsLoaderFlag = !1, jn(e);
821
820
  }));
822
821
  }
823
- function Kn(e) {
822
+ function Vn(e) {
824
823
  const t = [], n = [];
825
824
  return e.forEach((r) => {
826
825
  (r.match(Ut) ? t : n).push(r);
@@ -829,7 +828,7 @@ function Kn(e) {
829
828
  invalid: n
830
829
  };
831
830
  }
832
- function Fe(e, t, n) {
831
+ function Ne(e, t, n) {
833
832
  function r() {
834
833
  const o = e.pendingIcons;
835
834
  t.forEach((s) => {
@@ -844,7 +843,7 @@ function Fe(e, t, n) {
844
843
  } catch (o) {
845
844
  console.error(o);
846
845
  }
847
- r(), Jn(e);
846
+ r(), Rn(e);
848
847
  }
849
848
  function bt(e, t) {
850
849
  e instanceof Promise ? e.then((n) => {
@@ -853,47 +852,47 @@ function bt(e, t) {
853
852
  t(null);
854
853
  }) : t(e);
855
854
  }
856
- function Gn(e, t) {
855
+ function Jn(e, t) {
857
856
  e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(t).sort() : e.iconsToLoad = t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
858
857
  e.iconsQueueFlag = !1;
859
858
  const { provider: n, prefix: r } = e, o = e.iconsToLoad;
860
859
  if (delete e.iconsToLoad, !o || !o.length) return;
861
860
  const s = e.loadIcon;
862
861
  if (e.loadIcons && (o.length > 1 || !s)) {
863
- bt(e.loadIcons(o, r, n), (f) => {
864
- Fe(e, o, f);
862
+ bt(e.loadIcons(o, r, n), (p) => {
863
+ Ne(e, o, p);
865
864
  });
866
865
  return;
867
866
  }
868
867
  if (s) {
869
- o.forEach((f) => {
870
- const y = s(f, r, n);
871
- bt(y, (b) => {
872
- const m = b ? {
868
+ o.forEach((p) => {
869
+ const g = s(p, r, n);
870
+ bt(g, (b) => {
871
+ const h = b ? {
873
872
  prefix: r,
874
- icons: { [f]: b }
873
+ icons: { [p]: b }
875
874
  } : null;
876
- Fe(e, [f], m);
875
+ Ne(e, [p], h);
877
876
  });
878
877
  });
879
878
  return;
880
879
  }
881
- const { valid: i, invalid: l } = Kn(o);
882
- if (l.length && Fe(e, l, null), !i.length) return;
880
+ const { valid: i, invalid: l } = Vn(o);
881
+ if (l.length && Ne(e, l, null), !i.length) return;
883
882
  const a = r.match(Ut) ? Ze(n) : null;
884
883
  if (!a) {
885
- Fe(e, i, null);
884
+ Ne(e, i, null);
886
885
  return;
887
886
  }
888
- a.prepare(n, r, i).forEach((f) => {
889
- Vn(n, f, (y) => {
890
- Fe(e, f.icons, y);
887
+ a.prepare(n, r, i).forEach((p) => {
888
+ zn(n, p, (g) => {
889
+ Ne(e, p.icons, g);
891
890
  });
892
891
  });
893
892
  }));
894
893
  }
895
- const Wn = (e, t) => {
896
- const n = Hn(e, !0, Mt()), r = Bn(n);
894
+ const Kn = (e, t) => {
895
+ const n = Mn(e, !0, Mt()), r = Un(n);
897
896
  if (!r.pending.length) {
898
897
  let a = !0;
899
898
  return t && setTimeout(() => {
@@ -905,20 +904,20 @@ const Wn = (e, t) => {
905
904
  const o = /* @__PURE__ */ Object.create(null), s = [];
906
905
  let i, l;
907
906
  return r.pending.forEach((a) => {
908
- const { provider: d, prefix: f } = a;
909
- if (f === l && d === i) return;
910
- i = d, l = f, s.push(ke(d, f));
911
- const y = o[d] || (o[d] = /* @__PURE__ */ Object.create(null));
912
- y[f] || (y[f] = []);
907
+ const { provider: u, prefix: p } = a;
908
+ if (p === l && u === i) return;
909
+ i = u, l = p, s.push(Ie(u, p));
910
+ const g = o[u] || (o[u] = /* @__PURE__ */ Object.create(null));
911
+ g[p] || (g[p] = []);
913
912
  }), r.pending.forEach((a) => {
914
- const { provider: d, prefix: f, name: y } = a, b = ke(d, f), m = b.pendingIcons || (b.pendingIcons = /* @__PURE__ */ new Set());
915
- m.has(y) || (m.add(y), o[d][f].push(y));
913
+ const { provider: u, prefix: p, name: g } = a, b = Ie(u, p), h = b.pendingIcons || (b.pendingIcons = /* @__PURE__ */ new Set());
914
+ h.has(g) || (h.add(g), o[u][p].push(g));
916
915
  }), s.forEach((a) => {
917
- const d = o[a.provider][a.prefix];
918
- d.length && Gn(a, d);
919
- }), t ? Mn(t, r, s) : wt;
916
+ const u = o[a.provider][a.prefix];
917
+ u.length && Jn(a, u);
918
+ }), t ? Dn(t, r, s) : wt;
920
919
  };
921
- function Qn(e, t) {
920
+ function Gn(e, t) {
922
921
  const n = { ...e };
923
922
  for (const r in t) {
924
923
  const o = t[r], s = typeof o;
@@ -926,9 +925,9 @@ function Qn(e, t) {
926
925
  }
927
926
  return n;
928
927
  }
929
- const Yn = /[\s,]+/;
930
- function Zn(e, t) {
931
- t.split(Yn).forEach((n) => {
928
+ const Wn = /[\s,]+/;
929
+ function Qn(e, t) {
930
+ t.split(Wn).forEach((n) => {
932
931
  switch (n.trim()) {
933
932
  case "horizontal":
934
933
  e.hFlip = !0;
@@ -939,7 +938,7 @@ function Zn(e, t) {
939
938
  }
940
939
  });
941
940
  }
942
- function Xn(e, t = 0) {
941
+ function Yn(e, t = 0) {
943
942
  const n = e.replace(/^-?[0-9.]*/, "");
944
943
  function r(o) {
945
944
  for (; o < 0; ) o += 4;
@@ -964,40 +963,40 @@ function Xn(e, t = 0) {
964
963
  }
965
964
  return t;
966
965
  }
967
- function eo(e, t) {
966
+ function Zn(e, t) {
968
967
  let n = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
969
968
  for (const r in t) n += " " + r + '="' + t[r] + '"';
970
969
  return '<svg xmlns="http://www.w3.org/2000/svg"' + n + ">" + e + "</svg>";
971
970
  }
972
- function to(e) {
971
+ function Xn(e) {
973
972
  return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
974
973
  }
975
- function no(e) {
976
- return "data:image/svg+xml," + to(e);
974
+ function eo(e) {
975
+ return "data:image/svg+xml," + Xn(e);
977
976
  }
978
- function oo(e) {
979
- return 'url("' + no(e) + '")';
977
+ function to(e) {
978
+ return 'url("' + eo(e) + '")';
980
979
  }
981
- let Te;
982
- function ro() {
980
+ let _e;
981
+ function no() {
983
982
  try {
984
- Te = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
983
+ _e = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
985
984
  } catch {
986
- Te = null;
985
+ _e = null;
987
986
  }
988
987
  }
989
- function so(e) {
990
- return Te === void 0 && ro(), Te ? Te.createHTML(e) : e;
988
+ function oo(e) {
989
+ return _e === void 0 && no(), _e ? _e.createHTML(e) : e;
991
990
  }
992
991
  const Rt = {
993
992
  ...Ht,
994
993
  inline: !1
995
- }, io = {
994
+ }, ro = {
996
995
  xmlns: "http://www.w3.org/2000/svg",
997
996
  xmlnsXlink: "http://www.w3.org/1999/xlink",
998
997
  "aria-hidden": !0,
999
998
  role: "img"
1000
- }, ao = {
999
+ }, so = {
1001
1000
  display: "inline-block"
1002
1001
  }, Xe = {
1003
1002
  backgroundColor: "currentColor"
@@ -1017,33 +1016,33 @@ for (const e in kt) {
1017
1016
  for (const n in vt)
1018
1017
  t[e + n] = vt[n];
1019
1018
  }
1020
- const co = {
1019
+ const io = {
1021
1020
  ...Rt,
1022
1021
  inline: !0
1023
1022
  };
1024
1023
  function It(e) {
1025
1024
  return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
1026
1025
  }
1027
- const lo = (e, t, n) => {
1028
- const r = t.inline ? co : Rt, o = Qn(r, t), s = t.mode || "svg", i = {}, l = t.style || {}, a = {
1029
- ...s === "svg" ? io : {}
1026
+ const ao = (e, t, n) => {
1027
+ const r = t.inline ? io : Rt, o = Gn(r, t), s = t.mode || "svg", i = {}, l = t.style || {}, a = {
1028
+ ...s === "svg" ? ro : {}
1030
1029
  };
1031
1030
  if (n) {
1032
- const h = He(n, !1, !0);
1033
- if (h) {
1034
- const v = ["iconify"], O = [
1031
+ const m = Be(n, !1, !0);
1032
+ if (m) {
1033
+ const v = ["iconify"], U = [
1035
1034
  "provider",
1036
1035
  "prefix"
1037
1036
  ];
1038
- for (const $ of O)
1039
- h[$] && v.push("iconify--" + h[$]);
1037
+ for (const E of U)
1038
+ m[E] && v.push("iconify--" + m[E]);
1040
1039
  a.className = v.join(" ");
1041
1040
  }
1042
1041
  }
1043
- for (let h in t) {
1044
- const v = t[h];
1042
+ for (let m in t) {
1043
+ const v = t[m];
1045
1044
  if (v !== void 0)
1046
- switch (h) {
1045
+ switch (m) {
1047
1046
  // Properties to ignore
1048
1047
  case "icon":
1049
1048
  case "style":
@@ -1059,17 +1058,17 @@ const lo = (e, t, n) => {
1059
1058
  break;
1060
1059
  // Merge class names
1061
1060
  case "className":
1062
- a[h] = (a[h] ? a[h] + " " : "") + v;
1061
+ a[m] = (a[m] ? a[m] + " " : "") + v;
1063
1062
  break;
1064
1063
  // Boolean attributes
1065
1064
  case "inline":
1066
1065
  case "hFlip":
1067
1066
  case "vFlip":
1068
- o[h] = v === !0 || v === "true" || v === 1;
1067
+ o[m] = v === !0 || v === "true" || v === 1;
1069
1068
  break;
1070
1069
  // Flip as string: 'horizontal,vertical'
1071
1070
  case "flip":
1072
- typeof v == "string" && Zn(o, v);
1071
+ typeof v == "string" && Qn(o, v);
1073
1072
  break;
1074
1073
  // Color: copy to style
1075
1074
  case "color":
@@ -1077,7 +1076,7 @@ const lo = (e, t, n) => {
1077
1076
  break;
1078
1077
  // Rotation as string
1079
1078
  case "rotate":
1080
- typeof v == "string" ? o[h] = Xn(v) : typeof v == "number" && (o[h] = v);
1079
+ typeof v == "string" ? o[m] = Yn(v) : typeof v == "number" && (o[m] = v);
1081
1080
  break;
1082
1081
  // Remove aria-hidden
1083
1082
  case "ariaHidden":
@@ -1086,37 +1085,37 @@ const lo = (e, t, n) => {
1086
1085
  break;
1087
1086
  // Copy missing property if it does not exist in customisations
1088
1087
  default:
1089
- r[h] === void 0 && (a[h] = v);
1088
+ r[m] === void 0 && (a[m] = v);
1090
1089
  }
1091
1090
  }
1092
- const d = In(e, o), f = d.attributes;
1091
+ const u = vn(e, o), p = u.attributes;
1093
1092
  if (o.inline && (i.verticalAlign = "-0.125em"), s === "svg") {
1094
1093
  a.style = {
1095
1094
  ...i,
1096
1095
  ...l
1097
- }, Object.assign(a, f);
1098
- let h = 0, v = t.id;
1096
+ }, Object.assign(a, p);
1097
+ let m = 0, v = t.id;
1099
1098
  return typeof v == "string" && (v = v.replace(/-/g, "_")), a.dangerouslySetInnerHTML = {
1100
- __html: so(Nn(d.body, v ? () => v + "ID" + h++ : "iconifyReact"))
1099
+ __html: oo(Cn(u.body, v ? () => v + "ID" + m++ : "iconifyReact"))
1101
1100
  }, We("svg", a);
1102
1101
  }
1103
- const { body: y, width: b, height: m } = e, I = s === "mask" || (s === "bg" ? !1 : y.indexOf("currentColor") !== -1), _ = eo(y, {
1104
- ...f,
1102
+ const { body: g, width: b, height: h } = e, k = s === "mask" || (s === "bg" ? !1 : g.indexOf("currentColor") !== -1), F = Zn(g, {
1103
+ ...p,
1105
1104
  width: b + "",
1106
- height: m + ""
1105
+ height: h + ""
1107
1106
  });
1108
1107
  return a.style = {
1109
1108
  ...i,
1110
- "--svg": oo(_),
1111
- width: It(f.width),
1112
- height: It(f.height),
1113
- ...ao,
1114
- ...I ? Xe : Vt,
1109
+ "--svg": to(F),
1110
+ width: It(p.width),
1111
+ height: It(p.height),
1112
+ ...so,
1113
+ ...k ? Xe : Vt,
1115
1114
  ...l
1116
1115
  }, We("span", a);
1117
1116
  };
1118
1117
  Mt(!0);
1119
- Tn("", On);
1118
+ Fn("", Ln);
1120
1119
  if (typeof document < "u" && typeof window < "u") {
1121
1120
  const e = window;
1122
1121
  if (e.IconifyPreload !== void 0) {
@@ -1126,7 +1125,7 @@ if (typeof document < "u" && typeof window < "u") {
1126
1125
  // Check if item is an object and not null/array
1127
1126
  (typeof r != "object" || r === null || r instanceof Array || // Check for 'icons' and 'prefix'
1128
1127
  typeof r.icons != "object" || typeof r.prefix != "string" || // Add icon set
1129
- !gn(r)) && console.error(n);
1128
+ !hn(r)) && console.error(n);
1130
1129
  } catch {
1131
1130
  console.error(n);
1132
1131
  }
@@ -1141,7 +1140,7 @@ if (typeof document < "u" && typeof window < "u") {
1141
1140
  const o = t[n];
1142
1141
  if (typeof o != "object" || !o || o.resources === void 0)
1143
1142
  continue;
1144
- _n(n, o) || console.error(r);
1143
+ Nn(n, o) || console.error(r);
1145
1144
  } catch {
1146
1145
  console.error(r);
1147
1146
  }
@@ -1149,65 +1148,65 @@ if (typeof document < "u" && typeof window < "u") {
1149
1148
  }
1150
1149
  }
1151
1150
  function Jt(e) {
1152
- const [t, n] = j(!!e.ssr), [r, o] = j({});
1153
- function s(m) {
1154
- if (m) {
1155
- const I = e.icon;
1156
- if (typeof I == "object")
1151
+ const [t, n] = D(!!e.ssr), [r, o] = D({});
1152
+ function s(h) {
1153
+ if (h) {
1154
+ const k = e.icon;
1155
+ if (typeof k == "object")
1157
1156
  return {
1158
1157
  name: "",
1159
- data: I
1158
+ data: k
1160
1159
  };
1161
- const _ = mt(I);
1162
- if (_)
1160
+ const F = mt(k);
1161
+ if (F)
1163
1162
  return {
1164
- name: I,
1165
- data: _
1163
+ name: k,
1164
+ data: F
1166
1165
  };
1167
1166
  }
1168
1167
  return {
1169
1168
  name: ""
1170
1169
  };
1171
1170
  }
1172
- const [i, l] = j(s(!!e.ssr));
1171
+ const [i, l] = D(s(!!e.ssr));
1173
1172
  function a() {
1174
- const m = r.callback;
1175
- m && (m(), o({}));
1173
+ const h = r.callback;
1174
+ h && (h(), o({}));
1176
1175
  }
1177
- function d(m) {
1178
- if (JSON.stringify(i) !== JSON.stringify(m))
1179
- return a(), l(m), !0;
1176
+ function u(h) {
1177
+ if (JSON.stringify(i) !== JSON.stringify(h))
1178
+ return a(), l(h), !0;
1180
1179
  }
1181
- function f() {
1182
- var m;
1183
- const I = e.icon;
1184
- if (typeof I == "object") {
1185
- d({
1180
+ function p() {
1181
+ var h;
1182
+ const k = e.icon;
1183
+ if (typeof k == "object") {
1184
+ u({
1186
1185
  name: "",
1187
- data: I
1186
+ data: k
1188
1187
  });
1189
1188
  return;
1190
1189
  }
1191
- const _ = mt(I);
1192
- if (d({
1193
- name: I,
1194
- data: _
1190
+ const F = mt(k);
1191
+ if (u({
1192
+ name: k,
1193
+ data: F
1195
1194
  }))
1196
- if (_ === void 0) {
1197
- const h = Wn([I], f);
1195
+ if (F === void 0) {
1196
+ const m = Kn([k], p);
1198
1197
  o({
1199
- callback: h
1198
+ callback: m
1200
1199
  });
1201
- } else _ && ((m = e.onLoad) === null || m === void 0 || m.call(e, I));
1200
+ } else F && ((h = e.onLoad) === null || h === void 0 || h.call(e, k));
1202
1201
  }
1203
1202
  fe(() => (n(!0), a), []), fe(() => {
1204
- t && f();
1203
+ t && p();
1205
1204
  }, [e.icon, t]);
1206
- const { name: y, data: b } = i;
1207
- return b ? lo({
1205
+ const { name: g, data: b } = i;
1206
+ return b ? ao({
1208
1207
  ...tt,
1209
1208
  ...b
1210
- }, e, y) : e.children ? e.children : e.fallback ? e.fallback : We("span", {});
1209
+ }, e, g) : e.children ? e.children : e.fallback ? e.fallback : We("span", {});
1211
1210
  }
1212
1211
  const St = Tt((e, t) => Jt({
1213
1212
  ...e,
@@ -1218,11 +1217,11 @@ Tt((e, t) => Jt({
1218
1217
  ...e,
1219
1218
  _ref: t
1220
1219
  }));
1221
- const uo = {
1220
+ const co = {
1222
1221
  product: null
1223
- }, Kt = nn({
1222
+ }, Kt = en({
1224
1223
  name: "product",
1225
- initialState: uo,
1224
+ initialState: co,
1226
1225
  reducers: {
1227
1226
  setProduct: (e, t) => {
1228
1227
  e.product = t.payload;
@@ -1230,17 +1229,17 @@ const uo = {
1230
1229
  }
1231
1230
  }), { setProduct: et } = Kt.actions;
1232
1231
  Kt.reducer;
1233
- function fo() {
1234
- const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, n] = j(e);
1232
+ function lo() {
1233
+ const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, n] = D(e);
1235
1234
  return fe(() => {
1236
1235
  const r = () => n(e());
1237
1236
  return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
1238
1237
  }, []), t;
1239
1238
  }
1240
- const po = ({
1239
+ const uo = ({
1241
1240
  product: e
1242
1241
  }) => {
1243
- const t = Pt(), n = fo(), [r, o] = j(0), s = () => {
1242
+ const t = Pt(), n = lo(), [r, o] = D(0), s = () => {
1244
1243
  o(
1245
1244
  (a) => a + n >= e.length ? 0 : a + n
1246
1245
  );
@@ -1249,10 +1248,10 @@ const po = ({
1249
1248
  (a) => a - n < 0 ? e.length - (e.length % n || n) : a - n
1250
1249
  );
1251
1250
  }, l = async (a) => {
1252
- const d = await At(a);
1253
- t(et(d));
1251
+ const u = await At(a);
1252
+ t(et(u));
1254
1253
  };
1255
- return /* @__PURE__ */ c("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ p("div", { className: "flex items-center justify-center gap-4 relative", children: [
1254
+ return /* @__PURE__ */ c("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ f("div", { className: "flex items-center justify-center gap-4 relative", children: [
1256
1255
  (e == null ? void 0 : e.length) > n && /* @__PURE__ */ c(
1257
1256
  "button",
1258
1257
  {
@@ -1262,8 +1261,8 @@ const po = ({
1262
1261
  }
1263
1262
  ),
1264
1263
  /* @__PURE__ */ c("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: e.slice(r, r + n).map((a) => {
1265
- var d, f, y, b;
1266
- return /* @__PURE__ */ p(
1264
+ var u, p, g, b;
1265
+ return /* @__PURE__ */ f(
1267
1266
  "div",
1268
1267
  {
1269
1268
  className: "flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",
@@ -1274,20 +1273,20 @@ const po = ({
1274
1273
  /* @__PURE__ */ c("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ c(
1275
1274
  "img",
1276
1275
  {
1277
- src: ((d = ut(a)[0]) == null ? void 0 : d.link) || ut(a)[0] || // fallback if it's a string
1276
+ src: ((u = dt(a)[0]) == null ? void 0 : u.link) || dt(a)[0] || // fallback if it's a string
1278
1277
  "https://via.placeholder.com/120",
1279
1278
  alt: a != null && a.productName ? a.productName : "Product",
1280
1279
  className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
1281
1280
  }
1282
1281
  ) }),
1283
- /* @__PURE__ */ p(
1282
+ /* @__PURE__ */ f(
1284
1283
  "div",
1285
1284
  {
1286
1285
  className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
1287
1286
  children: [
1288
- /* @__PURE__ */ p("div", { className: "relative inline-block group", children: [
1287
+ /* @__PURE__ */ f("div", { className: "relative inline-block group", children: [
1289
1288
  /* @__PURE__ */ c("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: a != null && a.productName ? a.productName : a != null && a.product_name ? a.product_name : ft(
1290
- lt((f = a == null ? void 0 : a.name) == null ? void 0 : f["en-US"]),
1289
+ lt((p = a == null ? void 0 : a.name) == null ? void 0 : p["en-US"]),
1291
1290
  60
1292
1291
  ) || "Product" }),
1293
1292
  /* @__PURE__ */ c(
@@ -1302,18 +1301,18 @@ const po = ({
1302
1301
  zIndex: 50
1303
1302
  },
1304
1303
  children: a != null && a.productName ? a.productName : a != null && a.product_name ? a.product_name : ft(
1305
- lt((y = a == null ? void 0 : a.name) == null ? void 0 : y["en-US"]),
1304
+ lt((g = a == null ? void 0 : a.name) == null ? void 0 : g["en-US"]),
1306
1305
  60
1307
1306
  ) || "Product"
1308
1307
  }
1309
1308
  )
1310
1309
  ] }),
1311
- /* @__PURE__ */ p("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
1312
- /* @__PURE__ */ c("p", { children: an(
1313
- a != null && a.price ? Number(a == null ? void 0 : a.price) : dt(a).centAmount || 0,
1314
- (b = dt(a)) == null ? void 0 : b.currencyCode
1310
+ /* @__PURE__ */ f("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
1311
+ /* @__PURE__ */ c("p", { children: rn(
1312
+ a != null && a.price ? Number(a == null ? void 0 : a.price) : ut(a).centAmount || 0,
1313
+ (b = ut(a)) == null ? void 0 : b.currencyCode
1315
1314
  ) }),
1316
- /* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
1315
+ /* @__PURE__ */ f("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
1317
1316
  "$",
1318
1317
  Number(a == null ? void 0 : a.price).toFixed(2) ?? 5
1319
1318
  ] })
@@ -1335,7 +1334,7 @@ const po = ({
1335
1334
  }
1336
1335
  )
1337
1336
  ] }) });
1338
- }, ho = ({ chat: e, storeDetails: t }) => /* @__PURE__ */ c("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: e.map((n, r) => /* @__PURE__ */ p(
1337
+ }, fo = ({ chat: e, storeDetails: t }) => /* @__PURE__ */ c("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: e.map((n, r) => /* @__PURE__ */ f(
1339
1338
  "div",
1340
1339
  {
1341
1340
  className: "mb-4 p-3 rounded-xl",
@@ -1348,11 +1347,11 @@ const po = ({
1348
1347
  "div",
1349
1348
  {
1350
1349
  className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
1351
- children: cn(n.keyword) || "No keyword"
1350
+ children: sn(n.keyword) || "No keyword"
1352
1351
  }
1353
1352
  ),
1354
1353
  /* @__PURE__ */ c(
1355
- po,
1354
+ uo,
1356
1355
  {
1357
1356
  product: n.items,
1358
1357
  storeDetails: t
@@ -1366,8 +1365,8 @@ const po = ({
1366
1365
  console.log(`customer_token
1367
1366
  `, e);
1368
1367
  try {
1369
- return (await D.post(
1370
- `${o}${r}/basket/create?baseUrl=${ie()}&siteId=${X()}&pubCfg=${ae()}&envRef=${ce()}&orgRef=${le()}`,
1368
+ return (await M.post(
1369
+ `${o}${r}/basket/create?baseUrl=${se()}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
1371
1370
  t,
1372
1371
  {
1373
1372
  headers: {
@@ -1377,13 +1376,13 @@ const po = ({
1377
1376
  }
1378
1377
  )).data;
1379
1378
  } catch (s) {
1380
- return D.isAxiosError(s) ? console.error("Error creating basket:", s.response || s.message) : console.error("Unexpected error:", s), null;
1379
+ return M.isAxiosError(s) ? console.error("Error creating basket:", s.response || s.message) : console.error("Unexpected error:", s), null;
1381
1380
  }
1382
- }, Ue = async (e, t, n) => {
1381
+ }, De = async (e, t, n) => {
1383
1382
  const { serverUrl: r, basePath: o } = pe(), s = `${r}`;
1384
1383
  try {
1385
- const i = await D.post(
1386
- `${s}${o}/basket/add-product/${e}?baseUrl=${ie()}&siteId=${X()}&pubCfg=${ae()}&envRef=${ce()}&orgRef=${le()}`,
1384
+ const i = await M.post(
1385
+ `${s}${o}/basket/add-product/${e}?baseUrl=${se()}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
1387
1386
  t,
1388
1387
  {
1389
1388
  headers: {
@@ -1394,7 +1393,7 @@ const po = ({
1394
1393
  );
1395
1394
  return i.status === 200 && i.data ? i.data : null;
1396
1395
  } catch (i) {
1397
- return D.isAxiosError(i) ? console.error(
1396
+ return M.isAxiosError(i) ? console.error(
1398
1397
  "Error adding products to basket:",
1399
1398
  i.response || i.message
1400
1399
  ) : console.error("Unexpected error:", i), null;
@@ -1406,8 +1405,8 @@ const po = ({
1406
1405
  var s;
1407
1406
  const { serverUrl: n, basePath: r } = pe(), o = `${n}`;
1408
1407
  try {
1409
- const i = await D.get(
1410
- `${o}${r}/basket/${e}?baseUrl=${ie()}&siteId=${X()}&pubCfg=${ae()}&envRef=${ce()}&orgRef=${le()}`,
1408
+ const i = await M.get(
1409
+ `${o}${r}/basket/${e}?baseUrl=${se()}&siteId=${ee()}&pubCfg=${ie()}&envRef=${ae()}&orgRef=${ce()}`,
1411
1410
  {
1412
1411
  headers: {
1413
1412
  "Content-Type": "application/json",
@@ -1417,141 +1416,141 @@ const po = ({
1417
1416
  );
1418
1417
  return { status: i.status, data: i.data };
1419
1418
  } catch (i) {
1420
- return D.isAxiosError(i) ? { status: (s = i.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
1419
+ return M.isAxiosError(i) ? { status: (s = i.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
1421
1420
  }
1422
- }, Ct = "sfcc_basket_id", Ft = "sfcc_customer_token", Pe = "sfcc_token_expiry", mo = 300 * 1e3, Ne = "1.0.0";
1423
- const ve = (e) => {
1421
+ }, Ct = "sfcc_basket_id", Ft = "sfcc_customer_token", Ee = "sfcc_token_expiry", po = 300 * 1e3, Te = "1.0.0";
1422
+ const ke = (e) => {
1424
1423
  try {
1425
1424
  e ? localStorage.setItem(Ct, e) : localStorage.removeItem(Ct);
1426
1425
  } catch (t) {
1427
1426
  console.error("Error saving basket ID to storage:", t);
1428
1427
  }
1429
- }, Me = (e) => {
1428
+ }, Ue = (e) => {
1430
1429
  try {
1431
1430
  if (e) {
1432
1431
  localStorage.setItem(Ft, e);
1433
- const t = Date.now() + mo;
1434
- localStorage.setItem(Pe, t.toString());
1432
+ const t = Date.now() + po;
1433
+ localStorage.setItem(Ee, t.toString());
1435
1434
  } else
1436
1435
  localStorage.removeItem(Ft);
1437
1436
  } catch (t) {
1438
1437
  console.error("Error storing token:", t);
1439
1438
  }
1440
- }, Nt = 300, go = () => {
1441
- var l, a, d, f, y, b;
1442
- const e = Pt(), t = Oe((m) => m.product.product), n = Oe((m) => m.store.store), [r, o] = j(!!t);
1439
+ }, Nt = 300, ho = () => {
1440
+ var l, a, u, p, g, b;
1441
+ const e = Pt(), t = je((h) => h.product.product), n = je((h) => h.store.store), [r, o] = D(!!t);
1443
1442
  if (fe(() => {
1444
1443
  o(!!t);
1445
1444
  }, [t]), !t) return null;
1446
1445
  const s = async () => {
1447
- var m, I, _, h, v, O, $, E, W, C, A, z, Q, U, M, he;
1446
+ var h, k, F, m, v, U, E, L, Y, I, O, q, z, $, he, P;
1448
1447
  console.log(t, "the prod");
1449
1448
  try {
1450
- if (!((I = (m = t == null ? void 0 : t.variants) == null ? void 0 : m[0]) != null && I.product_id) && !(t.type.item || t.type.bundle) && !((h = (_ = t == null ? void 0 : t.variants) == null ? void 0 : _[0]) != null && h.productId)) {
1451
- G.error("Variants not available", {
1449
+ if (!((k = (h = t == null ? void 0 : t.variants) == null ? void 0 : h[0]) != null && k.product_id) && !(t.type.item || t.type.bundle) && !((m = (F = t == null ? void 0 : t.variants) == null ? void 0 : F[0]) != null && m.productId)) {
1450
+ Q.error("Variants not available", {
1452
1451
  position: "bottom-right",
1453
1452
  autoClose: 1e3
1454
1453
  }), console.error("No product variant found");
1455
1454
  return;
1456
1455
  }
1457
- const g = [
1456
+ const A = [
1458
1457
  {
1459
- product_id: ((v = t.variants) == null ? void 0 : v[0].product_id) || ((O = t.variants) == null ? void 0 : O[0].productId) || (t == null ? void 0 : t.id),
1458
+ product_id: ((v = t.variants) == null ? void 0 : v[0].product_id) || ((U = t.variants) == null ? void 0 : U[0].productId) || (t == null ? void 0 : t.id),
1460
1459
  quantity: 1
1461
1460
  }
1462
1461
  ];
1463
- console.log(g, "the product data");
1464
- const Ie = JSON.parse(
1462
+ console.log(A, "the product data");
1463
+ const Se = JSON.parse(
1465
1464
  sessionStorage.getItem("customerData") || "{}"
1466
- ), ue = Ie == null ? void 0 : Ie.basketId, qe = !1, Ee = localStorage.getItem(Pe), ee = Date.now();
1467
- if (!qe || !Ee || ee >= parseInt(Ee)) {
1468
- let H = "";
1465
+ ), le = Se == null ? void 0 : Se.basketId, He = !1, te = localStorage.getItem(Ee), de = Date.now();
1466
+ if (!He || !te || de >= parseInt(te)) {
1467
+ let R = "";
1469
1468
  {
1470
- const ne = await Be();
1471
- console.log("token from auth data"), H = "Bearer " + ne.access_token;
1469
+ const me = await Me();
1470
+ console.log("token from auth data"), R = "Bearer " + me.access_token;
1472
1471
  }
1473
- if (!H) {
1472
+ if (!R) {
1474
1473
  console.error("Failed to get customer_token");
1475
1474
  return;
1476
1475
  }
1477
- const $e = ee + 300 * 1e3;
1478
- if (Me(H), localStorage.setItem(Pe, $e.toString()), ue) {
1479
- const ne = await Wt({
1480
- basketId: ue,
1481
- customer_token: H
1476
+ const qe = de + 300 * 1e3;
1477
+ if (Ue(R), localStorage.setItem(Ee, qe.toString()), le) {
1478
+ const me = await Wt({
1479
+ basketId: le,
1480
+ customer_token: R
1482
1481
  });
1483
- if (console.log(ue, "basket id from customer"), ne.status === 200 && ne) {
1484
- const oe = await Ue(
1485
- ue,
1486
- g,
1487
- H
1482
+ if (console.log(le, "basket id from customer"), me.status === 200 && me) {
1483
+ const ne = await De(
1484
+ le,
1485
+ A,
1486
+ R
1488
1487
  );
1489
- ((($ = oe == null ? void 0 : oe.product_items) == null ? void 0 : $.length) > 0 || ((E = oe == null ? void 0 : oe.productItems) == null ? void 0 : E.length) > 0) && (G.success("Added to cart", {
1488
+ (((E = ne == null ? void 0 : ne.product_items) == null ? void 0 : E.length) > 0 || ((L = ne == null ? void 0 : ne.productItems) == null ? void 0 : L.length) > 0) && (Q.success("Added to cart", {
1490
1489
  position: "bottom-right",
1491
1490
  autoClose: 3e3,
1492
1491
  hideProgressBar: !1,
1493
1492
  closeOnClick: !0,
1494
1493
  pauseOnHover: !0,
1495
1494
  draggable: !0
1496
- }), be(ue));
1495
+ }), ve(le));
1497
1496
  return;
1498
1497
  }
1499
1498
  }
1500
1499
  const ze = {
1501
1500
  productItems: [
1502
1501
  {
1503
- productId: ((W = t.variants) == null ? void 0 : W[0].product_id) || ((C = t.variants) == null ? void 0 : C[0].productId) || (t == null ? void 0 : t.id),
1502
+ productId: ((Y = t.variants) == null ? void 0 : Y[0].product_id) || ((I = t.variants) == null ? void 0 : I[0].productId) || (t == null ? void 0 : t.id),
1504
1503
  quantity: 1
1505
1504
  }
1506
1505
  ]
1507
1506
  };
1508
1507
  console.log("before create basket");
1509
- const w = await Gt(H, ze);
1508
+ const x = await Gt(R, ze);
1510
1509
  if (console.log(
1511
- w,
1512
- w == null ? void 0 : w.basket_id,
1513
- w == null ? void 0 : w.basketId,
1510
+ x,
1511
+ x == null ? void 0 : x.basket_id,
1512
+ x == null ? void 0 : x.basketId,
1514
1513
  "the basket response"
1515
- ), !(w != null && w.basket_id) && !(w != null && w.basketId)) {
1514
+ ), !(x != null && x.basket_id) && !(x != null && x.basketId)) {
1516
1515
  console.error("Failed to create basket");
1517
1516
  return;
1518
1517
  }
1519
1518
  console.log(
1520
1519
  "setting stored id",
1521
- (w == null ? void 0 : w.basket_id) || (w == null ? void 0 : w.basketId)
1522
- ), ve(
1523
- (w == null ? void 0 : w.basket_id) || (w == null ? void 0 : w.basketId)
1520
+ (x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId)
1521
+ ), ke(
1522
+ (x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId)
1524
1523
  ), console.log("adding product to basket");
1525
- const te = await Ue(
1526
- (w == null ? void 0 : w.basket_id) || (w == null ? void 0 : w.basketId),
1527
- g,
1528
- H
1524
+ const V = await De(
1525
+ (x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId),
1526
+ A,
1527
+ R
1529
1528
  );
1530
- console.log("object added to basket"), (((A = te == null ? void 0 : te.product_items) == null ? void 0 : A.length) > 0 || ((z = te == null ? void 0 : te.productItems) == null ? void 0 : z.length) > 0) && G.success("Added to cart", {
1529
+ console.log("object added to basket"), (((O = V == null ? void 0 : V.product_items) == null ? void 0 : O.length) > 0 || ((q = V == null ? void 0 : V.productItems) == null ? void 0 : q.length) > 0) && Q.success("Added to cart", {
1531
1530
  position: "bottom-right",
1532
1531
  autoClose: 3e3,
1533
1532
  hideProgressBar: !1,
1534
1533
  closeOnClick: !0,
1535
1534
  pauseOnHover: !0,
1536
1535
  draggable: !0
1537
- }), be(w.basket_id || (w == null ? void 0 : w.basketId));
1536
+ }), ve(x.basket_id || (x == null ? void 0 : x.basketId));
1538
1537
  }
1539
- } catch (g) {
1540
- console.error("Error adding to cart:", g), G.error("Failed to add product to cart", {
1538
+ } catch (A) {
1539
+ console.error("Error adding to cart:", A), Q.error("Failed to add product to cart", {
1541
1540
  position: "bottom-right",
1542
1541
  autoClose: 3e3
1543
- }), ((Q = g == null ? void 0 : g.response) == null ? void 0 : Q.status) === 404 || // Basket not found
1544
- ((U = g == null ? void 0 : g.response) == null ? void 0 : U.status) === 401 ? (((M = g == null ? void 0 : g.response) == null ? void 0 : M.status) === 404 && ve(null), ((he = g == null ? void 0 : g.response) == null ? void 0 : he.status) === 401 && (ve(null), Me(null))) : (console.error("Failed to add product to basket:", g.message), G.error("Failed to add product to cart", {
1542
+ }), ((z = A == null ? void 0 : A.response) == null ? void 0 : z.status) === 404 || // Basket not found
1543
+ (($ = A == null ? void 0 : A.response) == null ? void 0 : $.status) === 401 ? (((he = A == null ? void 0 : A.response) == null ? void 0 : he.status) === 404 && ke(null), ((P = A == null ? void 0 : A.response) == null ? void 0 : P.status) === 401 && (ke(null), Ue(null))) : (console.error("Failed to add product to basket:", A.message), Q.error("Failed to add product to cart", {
1545
1544
  position: "bottom-right",
1546
1545
  autoClose: 3e3
1547
1546
  }));
1548
1547
  } finally {
1549
- be();
1548
+ ve();
1550
1549
  }
1551
1550
  }, i = () => {
1552
1551
  t && (window.location.href = t.c_pdpUrl);
1553
1552
  };
1554
- return console.log(t, "the prod"), /* @__PURE__ */ p(Ge, { children: [
1553
+ return console.log(t, "the prod"), /* @__PURE__ */ f(Ge, { children: [
1555
1554
  /* @__PURE__ */ c(
1556
1555
  "div",
1557
1556
  {
@@ -1561,7 +1560,7 @@ const ve = (e) => {
1561
1560
  }
1562
1561
  }
1563
1562
  ),
1564
- /* @__PURE__ */ p(
1563
+ /* @__PURE__ */ f(
1565
1564
  "div",
1566
1565
  {
1567
1566
  className: `
@@ -1570,9 +1569,9 @@ const ve = (e) => {
1570
1569
  ${r ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
1571
1570
  `,
1572
1571
  style: { willChange: "transform, opacity" },
1573
- onClick: (m) => m.stopPropagation(),
1572
+ onClick: (h) => h.stopPropagation(),
1574
1573
  children: [
1575
- /* @__PURE__ */ p("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
1574
+ /* @__PURE__ */ f("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
1576
1575
  /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", { className: "text-[#000000] font-bold font-nunitoSans", children: t.name }) }),
1577
1576
  /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
1578
1577
  at,
@@ -1588,36 +1587,36 @@ const ve = (e) => {
1588
1587
  }
1589
1588
  ) })
1590
1589
  ] }),
1591
- /* @__PURE__ */ p("div", { className: "flex flex-row gap-2 items-center flex-wrap", children: [
1590
+ /* @__PURE__ */ f("div", { className: "flex flex-row gap-2 items-center flex-wrap", children: [
1592
1591
  /* @__PURE__ */ c("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ c(
1593
1592
  "img",
1594
1593
  {
1595
- src: (f = (d = (a = (l = t.imageGroups) == null ? void 0 : l[0]) == null ? void 0 : a.images) == null ? void 0 : d[0]) == null ? void 0 : f.link,
1594
+ src: (p = (u = (a = (l = t.imageGroups) == null ? void 0 : l[0]) == null ? void 0 : a.images) == null ? void 0 : u[0]) == null ? void 0 : p.link,
1596
1595
  alt: t.name,
1597
1596
  className: "rounded-[10px]"
1598
1597
  }
1599
1598
  ) }),
1600
1599
  /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2", children: t.imageGroups.slice(1, 2).map(
1601
- (m) => m.images.slice(1, 2).map((I) => /* @__PURE__ */ c(
1600
+ (h) => h.images.slice(1, 2).map((k) => /* @__PURE__ */ c(
1602
1601
  "img",
1603
1602
  {
1604
- src: I.link,
1603
+ src: k.link,
1605
1604
  alt: t.name,
1606
1605
  className: "rounded-[10px] w-[60px] h-[60px]"
1607
1606
  },
1608
- I.link
1607
+ k.link
1609
1608
  ))
1610
1609
  ) })
1611
1610
  ] }),
1612
- /* @__PURE__ */ p("div", { className: "flex flex-row items-center justify-between w-full", children: [
1613
- /* @__PURE__ */ p("div", { className: "flex flex-row items-center gap-2", children: [
1614
- /* @__PURE__ */ p("p", { className: "text-[#14121F] font-bold font-nunitoSans", children: [
1611
+ /* @__PURE__ */ f("div", { className: "flex flex-row items-center justify-between w-full", children: [
1612
+ /* @__PURE__ */ f("div", { className: "flex flex-row items-center gap-2", children: [
1613
+ /* @__PURE__ */ f("p", { className: "text-[#14121F] font-bold font-nunitoSans", children: [
1615
1614
  " ",
1616
1615
  "$",
1617
1616
  t.price.toFixed(2)
1618
1617
  ] }),
1619
1618
  " ",
1620
- /* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans", children: [
1619
+ /* @__PURE__ */ f("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans", children: [
1621
1620
  " ",
1622
1621
  "$",
1623
1622
  (t.price + 5).toFixed(2)
@@ -1626,7 +1625,7 @@ const ve = (e) => {
1626
1625
  /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: t.discount }) })
1627
1626
  ] }),
1628
1627
  /* @__PURE__ */ c("div", { className: "mt-2 w-full border-t-2 border-gray-200" }),
1629
- /* @__PURE__ */ p("div", { className: "w-full text-left", children: [
1628
+ /* @__PURE__ */ f("div", { className: "w-full text-left", children: [
1630
1629
  /* @__PURE__ */ c("div", { className: "text-[#323135] font-bold font-nunitoSans mt-3 text-[14px]", children: "Product Details" }),
1631
1630
  /* @__PURE__ */ c(
1632
1631
  "div",
@@ -1636,22 +1635,22 @@ const ve = (e) => {
1636
1635
  }
1637
1636
  )
1638
1637
  ] }),
1639
- /* @__PURE__ */ p("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
1640
- /* @__PURE__ */ c("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ p("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
1641
- /* @__PURE__ */ p("div", { className: "text-[#323135] font-bold", children: [
1642
- ((y = t == null ? void 0 : t.rating) == null ? void 0 : y.rate) || 0,
1638
+ /* @__PURE__ */ f("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
1639
+ /* @__PURE__ */ c("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
1640
+ /* @__PURE__ */ f("div", { className: "text-[#323135] font-bold", children: [
1641
+ ((g = t == null ? void 0 : t.rating) == null ? void 0 : g.rate) || 0,
1643
1642
  " /",
1644
1643
  " ",
1645
1644
  /* @__PURE__ */ c("span", { className: "text-[#68656E]", children: "5" })
1646
1645
  ] }),
1647
1646
  /* @__PURE__ */ c("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
1648
- /* @__PURE__ */ p("div", { className: "text-[#68656E] font-semibold text-sm", children: [
1647
+ /* @__PURE__ */ f("div", { className: "text-[#68656E] font-semibold text-sm", children: [
1649
1648
  ((b = t == null ? void 0 : t.rating) == null ? void 0 : b.count) || 0,
1650
1649
  " ratings"
1651
1650
  ] })
1652
1651
  ] }) }),
1653
- /* @__PURE__ */ c("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((m, I) => {
1654
- var _;
1652
+ /* @__PURE__ */ c("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((h, k) => {
1653
+ var F;
1655
1654
  return /* @__PURE__ */ c(
1656
1655
  at,
1657
1656
  {
@@ -1659,14 +1658,14 @@ const ve = (e) => {
1659
1658
  width: "20",
1660
1659
  height: "20",
1661
1660
  className: `text-yellow-500
1662
- ${((_ = t == null ? void 0 : t.rating) == null ? void 0 : _.rate) > I ? "text-yellow-500" : "text-gray-300"}
1661
+ ${((F = t == null ? void 0 : t.rating) == null ? void 0 : F.rate) > k ? "text-yellow-500" : "text-gray-300"}
1663
1662
  `
1664
1663
  },
1665
- I
1664
+ k
1666
1665
  );
1667
1666
  }) })
1668
1667
  ] }),
1669
- /* @__PURE__ */ p(
1668
+ /* @__PURE__ */ f(
1670
1669
  "div",
1671
1670
  {
1672
1671
  className: "flex flex-col items-center justify-between font-nunitoSans font-semibold w-5/6 text-black gap-2",
@@ -1697,7 +1696,7 @@ const ve = (e) => {
1697
1696
  }
1698
1697
  )
1699
1698
  ] });
1700
- }, To = () => {
1699
+ }, Co = () => {
1701
1700
  const e = [
1702
1701
  "Myself",
1703
1702
  "My Child",
@@ -1712,143 +1711,143 @@ const ve = (e) => {
1712
1711
  "Niece/Nephew": "his/her niece/nephew",
1713
1712
  "My Friends": "his/her friends",
1714
1713
  Others: "others"
1715
- }, n = Se(null), r = Se(null), o = Se(null), s = Se(null), [i, l] = j(null), [a] = tn(), [d, f] = j(
1716
- a.get("shoppingassist") === "true"
1717
- ), [y, b] = j(!1), [m, I] = j(!1), [_, h] = j(!1), [v, O] = j(!1), [$, E] = j(!1), [W, C] = j(""), [A, z] = j(""), Q = (u) => ({
1718
- id: u.id,
1719
- title: u.name,
1720
- image: u.image ?? "",
1721
- price: u.price ?? 0
1722
- }), [U, M] = j([]), he = Se(null), g = Oe((u) => u.store.store), Ie = Oe((u) => u.product.product), ue = () => {
1723
- I(!0), setTimeout(() => b(!0), 10);
1724
- }, qe = () => {
1725
- b(!1), setTimeout(() => I(!1), 300);
1714
+ }, n = Ce(null), r = Ce(null), o = Ce(null), s = Ce(null), [i, l] = D(null), [a, u] = D(
1715
+ !1
1716
+ ), [p, g] = D(!1), [b, h] = D(!1), [k, F] = D(!1), [m, v] = D(!1), [U, E] = D(!1), [L, Y] = D(""), [I, O] = D(""), q = (d) => ({
1717
+ id: d.id,
1718
+ title: d.name,
1719
+ image: d.image ?? "",
1720
+ price: d.price ?? 0
1721
+ }), [z, $] = D([]), he = Ce(null), P = je((d) => d.store.store), A = je((d) => d.product.product), Se = () => {
1722
+ h(!0), setTimeout(() => g(!0), 10);
1723
+ }, le = () => {
1724
+ g(!1), setTimeout(() => h(!1), 300);
1726
1725
  };
1727
1726
  fe(() => {
1728
- d ? ue() : qe();
1729
- }, [d]);
1730
- const Ee = (u) => {
1731
- z(t[u]);
1727
+ a ? Se() : le();
1728
+ }, [a]);
1729
+ const He = (d) => {
1730
+ O(t[d]);
1732
1731
  };
1733
1732
  fe(() => {
1734
1733
  he.current && (he.current.scrollTop += 150);
1735
- }, [U]);
1736
- let ee = null, H = null;
1737
- const $e = async () => {
1738
- if (ee && H && Date.now() < H)
1739
- return ee;
1734
+ }, [z]);
1735
+ let te = null, de = null;
1736
+ const R = async () => {
1737
+ if (te && de && Date.now() < de)
1738
+ return te;
1740
1739
  try {
1741
- const u = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", P = new URLSearchParams({
1740
+ const d = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", _ = new URLSearchParams({
1742
1741
  grant_type: "client_credentials",
1743
1742
  client_id: "4i8rd70sgt961tc4dhskgf08c",
1744
1743
  client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
1745
1744
  scope: "default-m2m-resource-server-8xzfzo/read"
1746
- }), F = await fetch(u, {
1745
+ }), C = await fetch(d, {
1747
1746
  method: "POST",
1748
1747
  headers: {
1749
1748
  "Content-Type": "application/x-www-form-urlencoded"
1750
1749
  },
1751
- body: P
1750
+ body: _
1752
1751
  });
1753
- if (!F.ok)
1752
+ if (!C.ok)
1754
1753
  throw new Error(
1755
- `Token request failed! status: ${F.status}`
1754
+ `Token request failed! status: ${C.status}`
1756
1755
  );
1757
- const T = await F.json();
1758
- ee = T.access_token;
1759
- const k = T.expires_in || 3600;
1760
- return H = Date.now() + (k - 60) * 1e3, ee;
1761
- } catch (u) {
1762
- return console.error("Error obtaining JWT token:", u), ee = null, H = null, null;
1756
+ const T = await C.json();
1757
+ te = T.access_token;
1758
+ const w = T.expires_in || 3600;
1759
+ return de = Date.now() + (w - 60) * 1e3, te;
1760
+ } catch (d) {
1761
+ return console.error("Error obtaining JWT token:", d), te = null, de = null, null;
1763
1762
  }
1764
- }, ze = async () => {
1765
- const u = await Be();
1766
- u != null && l(u);
1763
+ }, qe = async () => {
1764
+ const d = await Me();
1765
+ d != null && l(d);
1767
1766
  };
1768
1767
  fe(() => {
1769
- ze(), console.log("scapi environment v1");
1768
+ qe(), console.log("scapi environment v1");
1770
1769
  }, []);
1771
- const w = async () => {
1772
- const u = JSON.parse(
1770
+ const ze = async () => {
1771
+ const d = JSON.parse(
1773
1772
  sessionStorage.getItem("customerData") || "{}"
1774
1773
  ).customerId;
1775
- return (await sn(u || "")).c_interests;
1776
- }, te = async (u, P) => {
1777
- console.log("in secondary flow", Ne);
1778
- const F = await w();
1779
- if (console.log(F, "interests of customer", Ne), !!F)
1774
+ return (await on(d || "")).c_interests;
1775
+ }, x = async (d, _) => {
1776
+ console.log("in secondary flow", Te);
1777
+ const C = await ze();
1778
+ if (console.log(C, "interests of customer", Te), !!C)
1780
1779
  try {
1781
- M(
1782
- (J) => J.map(
1783
- (Y, Z) => Z === J.length - 1 ? { ...Y, secondaryLoading: !0 } : Y
1780
+ $(
1781
+ (G) => G.map(
1782
+ (Z, X) => X === G.length - 1 ? { ...Z, secondaryLoading: !0 } : Z
1784
1783
  )
1785
1784
  );
1786
- const T = await $e();
1785
+ const T = await R();
1787
1786
  if (!T) throw new Error("Failed to fetch token");
1788
- const k = localStorage.getItem("customerNumber"), S = localStorage.getItem("isLoggedIn"), me = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
1787
+ const w = localStorage.getItem("customerNumber"), S = localStorage.getItem("isLoggedIn"), ge = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
1789
1788
  registered: String(S || !1),
1790
- userId: String(k || (/* @__PURE__ */ new Date()).getTime())
1791
- }).toString()}`, ge = JSON.stringify({
1789
+ userId: String(w || (/* @__PURE__ */ new Date()).getTime())
1790
+ }).toString()}`, ye = JSON.stringify({
1792
1791
  flowId: "Q166PR519W",
1793
1792
  flowAliasId: "HKFUVLWVH2",
1794
1793
  input: {
1795
1794
  loyaltyPoints: "",
1796
- productName: u,
1797
- productPoints: String(P || 0),
1798
- interests: F
1795
+ productName: d,
1796
+ productPoints: String(_ || 0),
1797
+ interests: C
1799
1798
  }
1800
- }), R = await fetch(me, {
1799
+ }), J = await fetch(ge, {
1801
1800
  signal: AbortSignal.timeout(3e4),
1802
1801
  method: "POST",
1803
1802
  headers: {
1804
1803
  "Content-Type": "application/json",
1805
1804
  Authorization: `Bearer ${T}`
1806
1805
  },
1807
- body: ge
1806
+ body: ye
1808
1807
  });
1809
- if (!R.body) throw new Error("Readable stream not supported");
1810
- const ye = R.body.getReader(), xe = new TextDecoder();
1811
- let V = "";
1808
+ if (!J.body) throw new Error("Readable stream not supported");
1809
+ const xe = J.body.getReader(), we = new TextDecoder();
1810
+ let K = "";
1812
1811
  for (; ; ) {
1813
- const { done: J, value: Y } = await ye.read();
1814
- if (J) break;
1815
- V += xe.decode(Y, { stream: !0 });
1816
- const Z = V.split(`
1812
+ const { done: G, value: Z } = await xe.read();
1813
+ if (G) break;
1814
+ K += we.decode(Z, { stream: !0 });
1815
+ const X = K.split(`
1817
1816
  `);
1818
- V = Z.pop() || "";
1819
- for (const re of Z)
1820
- if (re.startsWith("data:")) {
1821
- const x = re.slice(5).trim();
1817
+ K = X.pop() || "";
1818
+ for (const oe of X)
1819
+ if (oe.startsWith("data:")) {
1820
+ const y = oe.slice(5).trim();
1822
1821
  try {
1823
- const K = JSON.parse(x);
1824
- K.index === 0 && M(
1825
- (L) => L.map(
1826
- (B, se) => se === L.length - 1 ? {
1822
+ const W = JSON.parse(y);
1823
+ W.index === 0 && $(
1824
+ (j) => j.map(
1825
+ (B, re) => re === j.length - 1 ? {
1827
1826
  ...B,
1828
- secondaryResponse: K.data,
1827
+ secondaryResponse: W.data,
1829
1828
  secondaryLoading: !1
1830
1829
  } : B
1831
1830
  )
1832
1831
  );
1833
- } catch (K) {
1834
- M(
1835
- (L) => L.map(
1836
- (B, se) => se === L.length - 1 ? { ...B, secondaryLoading: !1 } : B
1832
+ } catch (W) {
1833
+ $(
1834
+ (j) => j.map(
1835
+ (B, re) => re === j.length - 1 ? { ...B, secondaryLoading: !1 } : B
1837
1836
  )
1838
- ), console.error("Secondary flow JSON parse error:", K);
1837
+ ), console.error("Secondary flow JSON parse error:", W);
1839
1838
  }
1840
1839
  }
1841
1840
  }
1842
1841
  } catch (T) {
1843
1842
  console.error("Secondary flow error:", T);
1844
1843
  }
1845
- }, ne = async (u) => {
1846
- const P = u || W.trim();
1847
- if (P) {
1848
- O(!0), C(""), n.current = null, r.current = null, o.current = null, s.current = null, M((F) => [
1849
- ...F,
1844
+ }, V = async (d) => {
1845
+ const _ = d || L.trim();
1846
+ if (_) {
1847
+ v(!0), Y(""), n.current = null, r.current = null, o.current = null, s.current = null, $((C) => [
1848
+ ...C,
1850
1849
  {
1851
- query: P,
1850
+ query: _,
1852
1851
  response: "Thinking for what suits you best...",
1853
1852
  potentialQuestions: "",
1854
1853
  products: [],
@@ -1856,119 +1855,119 @@ const ve = (e) => {
1856
1855
  }
1857
1856
  ]);
1858
1857
  try {
1859
- const F = A, T = localStorage.getItem("customerNumber"), k = localStorage.getItem("isLoggedIn"), S = await $e();
1858
+ const C = I, T = localStorage.getItem("customerNumber"), w = localStorage.getItem("isLoggedIn"), S = await R();
1860
1859
  if (!S)
1861
1860
  throw new Error("Failed to obtain access token");
1862
- const me = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
1863
- registered: String(k || !1),
1861
+ const ge = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
1862
+ registered: String(w || !1),
1864
1863
  userId: String(T || (/* @__PURE__ */ new Date()).getTime())
1865
- }).toString()}`, ge = JSON.stringify({
1864
+ }).toString()}`, ye = JSON.stringify({
1866
1865
  flowId: "MMHQKYI1NE",
1867
1866
  flowAliasId: "SZF9ZK1ATE",
1868
1867
  input: {
1869
- userPrompt: P,
1870
- whom: F
1868
+ userPrompt: _,
1869
+ whom: C
1871
1870
  }
1872
- }), R = await fetch(me, {
1871
+ }), J = await fetch(ge, {
1873
1872
  signal: AbortSignal.timeout(3e4),
1874
1873
  method: "POST",
1875
1874
  headers: {
1876
1875
  "Content-Type": "application/json",
1877
1876
  Authorization: `Bearer ${S}`
1878
1877
  },
1879
- body: ge
1878
+ body: ye
1880
1879
  });
1881
- if (!R.ok)
1882
- throw new Error(`HTTP error! status: ${R.status}`);
1883
- if (!R.body) throw new Error("Readable stream not supported");
1884
- const ye = R.body.getReader(), xe = new TextDecoder();
1885
- let V = "", J = "";
1880
+ if (!J.ok)
1881
+ throw new Error(`HTTP error! status: ${J.status}`);
1882
+ if (!J.body) throw new Error("Readable stream not supported");
1883
+ const xe = J.body.getReader(), we = new TextDecoder();
1884
+ let K = "", G = "";
1886
1885
  for (; ; ) {
1887
1886
  E(!0);
1888
- const { done: Y, value: Z } = await ye.read();
1889
- if (Y) break;
1890
- V += xe.decode(Z, { stream: !0 });
1891
- const re = V.split(`
1887
+ const { done: Z, value: X } = await xe.read();
1888
+ if (Z) break;
1889
+ K += we.decode(X, { stream: !0 });
1890
+ const oe = K.split(`
1892
1891
  `);
1893
- V = re.pop() || "";
1894
- for (const x of re)
1895
- if (x.startsWith("data:")) {
1896
- const K = x.slice(5).trim();
1892
+ K = oe.pop() || "";
1893
+ for (const y of oe)
1894
+ if (y.startsWith("data:")) {
1895
+ const W = y.slice(5).trim();
1897
1896
  try {
1898
- const L = JSON.parse(K);
1899
- L.index == 1 && (J = L.data), M(
1897
+ const j = JSON.parse(W);
1898
+ j.index == 1 && (G = j.data), $(
1900
1899
  (B) => B.map(
1901
- (se, Ae) => Ae === B.length - 1 ? {
1902
- ...se,
1903
- [L.index == 0 ? "response" : L.index == 1 ? "keywords" : L.index == 2 ? "potentialQuestions" : "end"]: L.data
1904
- } : se
1900
+ (re, $e) => $e === B.length - 1 ? {
1901
+ ...re,
1902
+ [j.index == 0 ? "response" : j.index == 1 ? "keywords" : j.index == 2 ? "potentialQuestions" : "end"]: j.data
1903
+ } : re
1905
1904
  )
1906
1905
  );
1907
- } catch (L) {
1908
- console.error("Error parsing JSON:", L);
1906
+ } catch (j) {
1907
+ console.error("Error parsing JSON:", j);
1909
1908
  }
1910
1909
  }
1911
1910
  }
1912
- Qt(oe(J));
1913
- } catch (F) {
1914
- console.error("Error sending message to Tanya:", F);
1911
+ ne(me(G));
1912
+ } catch (C) {
1913
+ console.error("Error sending message to Tanya:", C);
1915
1914
  } finally {
1916
- O(!1);
1915
+ v(!1);
1917
1916
  }
1918
1917
  }
1919
- }, oe = (u) => {
1920
- const P = u.match(
1918
+ }, me = (d) => {
1919
+ const _ = d.match(
1921
1920
  /top five relevant product or category names are: (.*)/i
1922
- ), k = (P ? P[1] : u).split(", ").map((q) => q.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
1923
- return [...new Set(k)].filter(Boolean).join(",");
1924
- }, Qt = async (u) => {
1925
- if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof u == "string") {
1926
- console.log(u, "keywords");
1927
- const P = u.split(",");
1928
- for (const F of P) {
1921
+ ), w = (_ ? _[1] : d).split(", ").map((H) => H.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
1922
+ return [...new Set(w)].filter(Boolean).join(",");
1923
+ }, ne = async (d) => {
1924
+ if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof d == "string") {
1925
+ console.log(d, "keywords");
1926
+ const _ = d.split(",");
1927
+ for (const C of _) {
1929
1928
  const T = await ct(
1930
- F,
1929
+ C,
1931
1930
  i == null ? void 0 : i.access_token
1932
1931
  );
1933
- if (E(!1), (T == null ? void 0 : T.length) > 0 && (M(
1934
- (k) => k.map(
1935
- (S, q) => q === k.length - 1 ? {
1932
+ if (E(!1), (T == null ? void 0 : T.length) > 0 && ($(
1933
+ (w) => w.map(
1934
+ (S, H) => H === w.length - 1 ? {
1936
1935
  ...S,
1937
1936
  products: [
1938
1937
  ...S.products || [],
1939
- { keyword: F, items: T, loading: !1 }
1938
+ { keyword: C, items: T, loading: !1 }
1940
1939
  ]
1941
1940
  } : S
1942
1941
  )
1943
1942
  ), !n.current || r.current == null)) {
1944
- const k = T[0];
1945
- n.current = String((k == null ? void 0 : k.product_name) ?? ""), o.current = k.image.link, r.current = k.product_id;
1946
- const S = typeof (k == null ? void 0 : k.price) == "number" ? k.price : void 0;
1943
+ const w = T[0];
1944
+ n.current = String((w == null ? void 0 : w.product_name) ?? ""), o.current = w.image.link, r.current = w.product_id;
1945
+ const S = typeof (w == null ? void 0 : w.price) == "number" ? w.price : void 0;
1947
1946
  s.current = typeof S == "number" && Number.isFinite(S) ? S : null;
1948
1947
  }
1949
1948
  }
1950
1949
  } else
1951
- for (const P of u) {
1952
- const F = await ct(
1953
- P,
1950
+ for (const _ of d) {
1951
+ const C = await ct(
1952
+ _,
1954
1953
  i == null ? void 0 : i.access_token
1955
1954
  );
1956
- E(!1), (F == null ? void 0 : F.length) > 0 && M(
1955
+ E(!1), (C == null ? void 0 : C.length) > 0 && $(
1957
1956
  (T) => T.map(
1958
- (k, S) => S === T.length - 1 ? {
1959
- ...k,
1957
+ (w, S) => S === T.length - 1 ? {
1958
+ ...w,
1960
1959
  products: [
1961
- ...k.products || [],
1962
- { keyword: P, items: F, loading: !1 }
1960
+ ...w.products || [],
1961
+ { keyword: _, items: C, loading: !1 }
1963
1962
  ]
1964
- } : k
1963
+ } : w
1965
1964
  )
1966
1965
  );
1967
1966
  }
1968
1967
  if (n.current) {
1969
- M(
1970
- (F) => F.map(
1971
- (T, k) => k === F.length - 1 ? {
1968
+ $(
1969
+ (C) => C.map(
1970
+ (T, w) => w === C.length - 1 ? {
1972
1971
  ...T,
1973
1972
  productSnapshot: {
1974
1973
  id: r.current,
@@ -1981,124 +1980,124 @@ const ve = (e) => {
1981
1980
  } : T
1982
1981
  )
1983
1982
  );
1984
- const P = JSON.parse(
1983
+ const _ = JSON.parse(
1985
1984
  sessionStorage.getItem("customerData") || "{}"
1986
1985
  );
1987
- (P == null ? void 0 : P.isGuest) == !1 ? (console.log("running secondary flow", Ne), te(n.current, 0)) : console.log("not running secondary flow", Ne);
1986
+ (_ == null ? void 0 : _.isGuest) == !1 ? (console.log("running secondary flow", Te), x(n.current, 0)) : console.log("not running secondary flow", Te);
1988
1987
  }
1989
1988
  E(!1);
1990
- }, Yt = async (u, P) => {
1991
- var F, T, k, S, q, me, ge, R, ye, xe, V, J, Y, Z, re;
1992
- h(!0);
1989
+ }, Qt = async (d, _) => {
1990
+ var C, T, w, S, H, ge, ye, J, xe, we, K, G, Z, X, oe;
1991
+ F(!0);
1993
1992
  try {
1994
- const x = await At(u.id);
1995
- if (!((T = (F = x == null ? void 0 : x.variants) == null ? void 0 : F[0]) != null && T.product_id || (S = (k = x == null ? void 0 : x.variants) == null ? void 0 : k[0]) != null && S.productId) && !(x.type.item || x.type.bundle)) {
1996
- h(!1), G.error("Variants not found", {
1993
+ const y = await At(d.id);
1994
+ if (!((T = (C = y == null ? void 0 : y.variants) == null ? void 0 : C[0]) != null && T.product_id || (S = (w = y == null ? void 0 : y.variants) == null ? void 0 : w[0]) != null && S.productId) && !(y.type.item || y.type.bundle)) {
1995
+ F(!1), Q.error("Variants not found", {
1997
1996
  position: "bottom-right",
1998
1997
  autoClose: 1e3
1999
1998
  }), console.error("No product variant found");
2000
1999
  return;
2001
2000
  }
2002
- const K = [
2001
+ const W = [
2003
2002
  {
2004
- product_id: ((q = x.variants) == null ? void 0 : q[0].product_id) || ((me = x.variants) == null ? void 0 : me[0].productId) || (x == null ? void 0 : x.id),
2005
- quantity: P
2003
+ product_id: ((H = y.variants) == null ? void 0 : H[0].product_id) || ((ge = y.variants) == null ? void 0 : ge[0].productId) || (y == null ? void 0 : y.id),
2004
+ quantity: _
2006
2005
  }
2007
2006
  ];
2008
- console.log(K, "product data", "app version", Ne);
2009
- const L = JSON.parse(
2007
+ console.log(W, "product data", "app version", Te);
2008
+ const j = JSON.parse(
2010
2009
  sessionStorage.getItem("customerData") || "{}"
2011
- ), B = L == null ? void 0 : L.basketId, se = !1, Ae = localStorage.getItem(Pe), st = Date.now();
2012
- if (!se || !Ae || st >= parseInt(Ae)) {
2013
- const Zt = await Et();
2014
- let { customer_token: de } = await $t(
2015
- Zt
2010
+ ), B = j == null ? void 0 : j.basketId, re = !1, $e = localStorage.getItem(Ee), st = Date.now();
2011
+ if (!re || !$e || st >= parseInt($e)) {
2012
+ const Yt = await Et();
2013
+ let { customer_token: ue } = await $t(
2014
+ Yt
2016
2015
  );
2017
- if (de = "Bearer " + i.access_token, !de) {
2016
+ if (ue = "Bearer " + i.access_token, !ue) {
2018
2017
  console.error("Failed to get customer_token");
2019
2018
  return;
2020
2019
  }
2021
- const Xt = st + 300 * 1e3;
2022
- if (Me(de), localStorage.setItem(Pe, Xt.toString()), B) {
2020
+ const Zt = st + 300 * 1e3;
2021
+ if (Ue(ue), localStorage.setItem(Ee, Zt.toString()), B) {
2023
2022
  const it = await Wt({
2024
2023
  basketId: B,
2025
- customer_token: de
2024
+ customer_token: ue
2026
2025
  });
2027
2026
  if (it.status === 200 && it) {
2028
- const Re = await Ue(
2027
+ const Re = await De(
2029
2028
  B,
2030
- K,
2031
- de
2029
+ W,
2030
+ ue
2032
2031
  );
2033
- ((ge = Re == null ? void 0 : Re.product_items) == null ? void 0 : ge.length) > 0 && (G.success("Added to cart", {
2032
+ ((ye = Re == null ? void 0 : Re.product_items) == null ? void 0 : ye.length) > 0 && (Q.success("Added to cart", {
2034
2033
  position: "bottom-right",
2035
2034
  autoClose: 3e3,
2036
2035
  hideProgressBar: !1,
2037
2036
  closeOnClick: !0,
2038
2037
  pauseOnHover: !0,
2039
2038
  draggable: !0
2040
- }), be(B), h(!1));
2039
+ }), ve(B), F(!1));
2041
2040
  return;
2042
2041
  }
2043
2042
  }
2044
- const en = {
2043
+ const Xt = {
2045
2044
  productItems: [
2046
2045
  {
2047
- productId: ((R = x.variants) == null ? void 0 : R[0].product_id) || ((ye = x.variants) == null ? void 0 : ye[0].productId) || (x == null ? void 0 : x.id),
2046
+ productId: ((J = y.variants) == null ? void 0 : J[0].product_id) || ((xe = y.variants) == null ? void 0 : xe[0].productId) || (y == null ? void 0 : y.id),
2048
2047
  quantity: 1
2049
2048
  }
2050
2049
  ]
2051
- }, N = await Gt(de, en);
2050
+ }, N = await Gt(ue, Xt);
2052
2051
  if (console.log(
2053
2052
  N,
2054
2053
  N == null ? void 0 : N.basket_id,
2055
2054
  N == null ? void 0 : N.basketId,
2056
2055
  "the basket response"
2057
2056
  ), !(N != null && N.basket_id || !(N != null && N.basketId))) {
2058
- h(!1), console.error("Failed to create basket");
2057
+ F(!1), console.error("Failed to create basket");
2059
2058
  return;
2060
2059
  }
2061
- ve(
2060
+ ke(
2062
2061
  (N == null ? void 0 : N.basket_id) || (N == null ? void 0 : N.basketId)
2063
2062
  );
2064
- const we = await Ue(
2063
+ const be = await De(
2065
2064
  (N == null ? void 0 : N.basket_id) || (N == null ? void 0 : N.basketId),
2066
- K,
2067
- de
2065
+ W,
2066
+ ue
2068
2067
  );
2069
- (((xe = we == null ? void 0 : we.product_items) == null ? void 0 : xe.length) > 0 || ((V = we == null ? void 0 : we.productItems) == null ? void 0 : V.length) > 0) && G.success("Added to cart", {
2068
+ (((we = be == null ? void 0 : be.product_items) == null ? void 0 : we.length) > 0 || ((K = be == null ? void 0 : be.productItems) == null ? void 0 : K.length) > 0) && Q.success("Added to cart", {
2070
2069
  position: "bottom-right",
2071
2070
  autoClose: 3e3,
2072
2071
  hideProgressBar: !1,
2073
2072
  closeOnClick: !0,
2074
2073
  pauseOnHover: !0,
2075
2074
  draggable: !0
2076
- }), be(N.basket_id || (N == null ? void 0 : N.basketId));
2075
+ }), ve(N.basket_id || (N == null ? void 0 : N.basketId));
2077
2076
  }
2078
- } catch (x) {
2079
- h(!1), console.error("Error adding to cart:", x), G.error("Failed to add product to cart", {
2077
+ } catch (y) {
2078
+ F(!1), console.error("Error adding to cart:", y), Q.error("Failed to add product to cart", {
2080
2079
  position: "bottom-right",
2081
2080
  autoClose: 3e3
2082
- }), ((J = x == null ? void 0 : x.response) == null ? void 0 : J.status) === 404 || // Basket not found
2083
- ((Y = x == null ? void 0 : x.response) == null ? void 0 : Y.status) === 401 ? (((Z = x == null ? void 0 : x.response) == null ? void 0 : Z.status) === 404 && ve(null), ((re = x == null ? void 0 : x.response) == null ? void 0 : re.status) === 401 && (ve(null), Me(null))) : (console.error("Failed to add product to basket:", x.message), G.error("Failed to add product to cart", {
2081
+ }), ((G = y == null ? void 0 : y.response) == null ? void 0 : G.status) === 404 || // Basket not found
2082
+ ((Z = y == null ? void 0 : y.response) == null ? void 0 : Z.status) === 401 ? (((X = y == null ? void 0 : y.response) == null ? void 0 : X.status) === 404 && ke(null), ((oe = y == null ? void 0 : y.response) == null ? void 0 : oe.status) === 401 && (ke(null), Ue(null))) : (console.error("Failed to add product to basket:", y.message), Q.error("Failed to add product to cart", {
2084
2083
  position: "bottom-right",
2085
2084
  autoClose: 3e3
2086
2085
  }));
2087
2086
  } finally {
2088
- be();
2087
+ ve();
2089
2088
  }
2090
- h(!1);
2089
+ F(!1);
2091
2090
  };
2092
- return /* @__PURE__ */ c("div", { className: "relative flex justify-center", children: /* @__PURE__ */ p(on, { open: d, onOpenChange: f, children: [
2091
+ return /* @__PURE__ */ c("div", { className: "relative flex justify-center", children: /* @__PURE__ */ f(tn, { open: a, onOpenChange: u, children: [
2093
2092
  /* @__PURE__ */ c(
2094
- rn,
2093
+ nn,
2095
2094
  {
2096
- onClick: () => f(!0),
2095
+ onClick: () => u(!0),
2097
2096
  style: {
2098
2097
  // background: storeDetails.tanyaThemeColor,
2099
2098
  },
2100
2099
  className: "flex items-center rounded-lg cursor-pointer hover:opacity-90 transition-opacity",
2101
- children: /* @__PURE__ */ c("div", { className: "flex flex-col p-[5px]", children: /* @__PURE__ */ p(
2100
+ children: /* @__PURE__ */ c("div", { className: "flex flex-col p-[5px]", children: /* @__PURE__ */ f(
2102
2101
  "svg",
2103
2102
  {
2104
2103
  width: "40",
@@ -2107,7 +2106,7 @@ const ve = (e) => {
2107
2106
  fill: "none",
2108
2107
  xmlns: "http://www.w3.org/2000/svg",
2109
2108
  children: [
2110
- /* @__PURE__ */ p("g", { clipPath: "url(#clip0_958_585)", children: [
2109
+ /* @__PURE__ */ f("g", { clipPath: "url(#clip0_958_585)", children: [
2111
2110
  /* @__PURE__ */ c(
2112
2111
  "path",
2113
2112
  {
@@ -2130,8 +2129,8 @@ const ve = (e) => {
2130
2129
  }
2131
2130
  )
2132
2131
  ] }),
2133
- /* @__PURE__ */ p("defs", { children: [
2134
- /* @__PURE__ */ p(
2132
+ /* @__PURE__ */ f("defs", { children: [
2133
+ /* @__PURE__ */ f(
2135
2134
  "linearGradient",
2136
2135
  {
2137
2136
  id: "paint0_linear_958_585",
@@ -2153,15 +2152,15 @@ const ve = (e) => {
2153
2152
  ) })
2154
2153
  }
2155
2154
  ),
2156
- m && /* @__PURE__ */ p(Ge, { children: [
2155
+ b && /* @__PURE__ */ f(Ge, { children: [
2157
2156
  /* @__PURE__ */ c(
2158
2157
  "div",
2159
2158
  {
2160
2159
  className: "fixed inset-0 z-40 bg-black/30",
2161
- onClick: () => f(!1)
2160
+ onClick: () => u(!1)
2162
2161
  }
2163
2162
  ),
2164
- /* @__PURE__ */ p(
2163
+ /* @__PURE__ */ f(
2165
2164
  "div",
2166
2165
  {
2167
2166
  className: `
@@ -2169,16 +2168,16 @@ const ve = (e) => {
2169
2168
  top-0 right-0
2170
2169
  transition-transform duration-300 ease-in-out
2171
2170
  lg:transform
2172
- ${y ? "lg:translate-x-0" : "lg:translate-x-full"}
2171
+ ${p ? "lg:translate-x-0" : "lg:translate-x-full"}
2173
2172
  // For mobile: animate from bottom
2174
- ${y ? "translate-y-0" : "translate-y-full"}
2173
+ ${p ? "translate-y-0" : "translate-y-full"}
2175
2174
  lg:translate-y-0
2176
2175
  `,
2177
2176
  style: {
2178
2177
  background: "linear-gradient(170.1deg, #FFFFFF 60.03%, #E3DEEF 99.59%)"
2179
2178
  },
2180
2179
  children: [
2181
- /* @__PURE__ */ p(
2180
+ /* @__PURE__ */ f(
2182
2181
  "div",
2183
2182
  {
2184
2183
  className: "flex justify-between p-3 bg-[#FFFFFF] border border-b-1 border-[#E5E5E5] ",
@@ -2188,12 +2187,12 @@ const ve = (e) => {
2188
2187
  {
2189
2188
  style: {
2190
2189
  display: "flex",
2191
- color: g.tanyaThemeContrastColor,
2190
+ color: P.tanyaThemeContrastColor,
2192
2191
  alignItems: "center",
2193
2192
  gap: "0.5rem"
2194
2193
  },
2195
- children: /* @__PURE__ */ p("div", { className: "flex flex-col gap-1", children: [
2196
- /* @__PURE__ */ p(
2194
+ children: /* @__PURE__ */ f("div", { className: "flex flex-col gap-1", children: [
2195
+ /* @__PURE__ */ f(
2197
2196
  "div",
2198
2197
  {
2199
2198
  className: "flex gap-2 w-28 h-12 text-center items-center p-2 border rounded-l-[20px] rounded-tr-[20px]",
@@ -2201,7 +2200,7 @@ const ve = (e) => {
2201
2200
  background: "linear-gradient(265.62deg, #6851C6 5.24%, #8668FF 98.49%)"
2202
2201
  },
2203
2202
  children: [
2204
- /* @__PURE__ */ p(
2203
+ /* @__PURE__ */ f(
2205
2204
  "svg",
2206
2205
  {
2207
2206
  width: "20",
@@ -2225,7 +2224,7 @@ const ve = (e) => {
2225
2224
  ]
2226
2225
  }
2227
2226
  ),
2228
- /* @__PURE__ */ p(
2227
+ /* @__PURE__ */ f(
2229
2228
  "p",
2230
2229
  {
2231
2230
  className: "text-[#5B5B5B] font-nunitoSans font-semibold",
@@ -2249,7 +2248,7 @@ const ve = (e) => {
2249
2248
  gap: "1.25rem",
2250
2249
  margin: "0.75rem"
2251
2250
  },
2252
- children: /* @__PURE__ */ c("button", { onClick: () => f(!1), children: /* @__PURE__ */ p(
2251
+ children: /* @__PURE__ */ c("button", { onClick: () => u(!1), children: /* @__PURE__ */ f(
2253
2252
  "svg",
2254
2253
  {
2255
2254
  width: "24",
@@ -2258,7 +2257,7 @@ const ve = (e) => {
2258
2257
  fill: "none",
2259
2258
  xmlns: "http://www.w3.org/2000/svg",
2260
2259
  children: [
2261
- /* @__PURE__ */ p("g", { clipPath: "url(#clip0_501_6036)", children: [
2260
+ /* @__PURE__ */ f("g", { clipPath: "url(#clip0_501_6036)", children: [
2262
2261
  /* @__PURE__ */ c(
2263
2262
  "path",
2264
2263
  {
@@ -2297,50 +2296,50 @@ const ve = (e) => {
2297
2296
  ]
2298
2297
  }
2299
2298
  ),
2300
- /* @__PURE__ */ p("div", { className: "flex h-full md:flex-row lg:flex-row", children: [
2301
- /* @__PURE__ */ p(
2299
+ /* @__PURE__ */ f("div", { className: "flex h-full md:flex-row lg:flex-row", children: [
2300
+ /* @__PURE__ */ f(
2302
2301
  "div",
2303
2302
  {
2304
- className: `flex flex-col h-full ${Ie ? "lg:w-2/3 w-full" : "w-full"}`,
2303
+ className: `flex flex-col h-full ${A ? "lg:w-2/3 w-full" : "w-full"}`,
2305
2304
  children: [
2306
- /* @__PURE__ */ p(
2305
+ /* @__PURE__ */ f(
2307
2306
  "div",
2308
2307
  {
2309
2308
  ref: he,
2310
2309
  className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
2311
2310
  children: [
2312
- (g == null ? void 0 : g.whomRequired) && /* @__PURE__ */ p(
2311
+ (P == null ? void 0 : P.whomRequired) && /* @__PURE__ */ f(
2313
2312
  "div",
2314
2313
  {
2315
2314
  className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
2316
2315
  children: [
2317
2316
  /* @__PURE__ */ c("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ c("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
2318
- /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-2 mt-2", children: e.map((u) => /* @__PURE__ */ c(
2317
+ /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-2 mt-2", children: e.map((d) => /* @__PURE__ */ c(
2319
2318
  "button",
2320
2319
  {
2321
- onClick: () => Ee(u),
2320
+ onClick: () => He(d),
2322
2321
  className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
2323
2322
  style: {
2324
- backgroundColor: A === t[u] ? "#FFFFFF" : "#F3F3F3",
2325
- borderColor: A === t[u] ? "#BBB3DD" : ""
2323
+ backgroundColor: I === t[d] ? "#FFFFFF" : "#F3F3F3",
2324
+ borderColor: I === t[d] ? "#BBB3DD" : ""
2326
2325
  },
2327
- children: u
2326
+ children: d
2328
2327
  },
2329
- u
2328
+ d
2330
2329
  )) })
2331
2330
  ]
2332
2331
  }
2333
2332
  ),
2334
- U.map((u, P) => {
2335
- var F, T;
2336
- return /* @__PURE__ */ p("div", { children: [
2337
- /* @__PURE__ */ c("div", { className: "flex justify-end", children: /* @__PURE__ */ c("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: u.query }) }),
2338
- u.response && u.response.includes("Thinking") ? /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
2333
+ z.map((d, _) => {
2334
+ var C, T;
2335
+ return /* @__PURE__ */ f("div", { children: [
2336
+ /* @__PURE__ */ c("div", { className: "flex justify-end", children: /* @__PURE__ */ c("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: d.query }) }),
2337
+ d.response && d.response.includes("Thinking") ? /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
2339
2338
  "div",
2340
2339
  {
2341
2340
  className: "font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
2342
2341
  dangerouslySetInnerHTML: {
2343
- __html: Ve(u.response)
2342
+ __html: Ve(d.response)
2344
2343
  }
2345
2344
  }
2346
2345
  ) }) : /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
@@ -2348,41 +2347,41 @@ const ve = (e) => {
2348
2347
  {
2349
2348
  className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
2350
2349
  dangerouslySetInnerHTML: {
2351
- __html: Ve(u.response)
2350
+ __html: Ve(d.response)
2352
2351
  }
2353
2352
  }
2354
2353
  ) }),
2355
- $ && !u.response.includes("Thinking") && ((F = u.products) == null ? void 0 : F.length) == 0 && /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", { className: "text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: "Finding best products for you" }) }),
2356
- (u == null ? void 0 : u.products) && ((T = u == null ? void 0 : u.products) == null ? void 0 : T.length) > 0 && /* @__PURE__ */ c(
2357
- ho,
2354
+ U && !d.response.includes("Thinking") && ((C = d.products) == null ? void 0 : C.length) == 0 && /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c("p", { className: "text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: "Finding best products for you" }) }),
2355
+ (d == null ? void 0 : d.products) && ((T = d == null ? void 0 : d.products) == null ? void 0 : T.length) > 0 && /* @__PURE__ */ c(
2356
+ fo,
2358
2357
  {
2359
- chat: u.products,
2360
- storeDetails: g
2358
+ chat: d.products,
2359
+ storeDetails: P
2361
2360
  }
2362
2361
  ),
2363
- u.potentialQuestions.length > 0 && /* @__PURE__ */ p("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
2362
+ d.potentialQuestions.length > 0 && /* @__PURE__ */ f("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
2364
2363
  /* @__PURE__ */ c(
2365
2364
  "p",
2366
2365
  {
2367
2366
  className: "font-nunitoSans font-bold text-sm text-[#494949]",
2368
- style: { color: g.themeDarkColor },
2367
+ style: { color: P.themeDarkColor },
2369
2368
  children: "Why not explore these inquiries..."
2370
2369
  }
2371
2370
  ),
2372
- u.potentialQuestions.split(",").map((k, S) => /* @__PURE__ */ c(
2371
+ d.potentialQuestions.split(",").map((w, S) => /* @__PURE__ */ c(
2373
2372
  "button",
2374
2373
  {
2375
- className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${g.themeDarkColor} m-1 rounded-xl px-2 py-1`,
2376
- onClick: () => ne(k),
2374
+ className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${P.themeDarkColor} m-1 rounded-xl px-2 py-1`,
2375
+ onClick: () => V(w),
2377
2376
  style: {
2378
- backgroundColor: g.tanyaThemeColorLight
2377
+ backgroundColor: P.tanyaThemeColorLight
2379
2378
  },
2380
- children: k
2379
+ children: w
2381
2380
  },
2382
2381
  S
2383
2382
  ))
2384
2383
  ] }),
2385
- u.secondaryLoading && /* @__PURE__ */ c("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ p(
2384
+ d.secondaryLoading && /* @__PURE__ */ c("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ f(
2386
2385
  "div",
2387
2386
  {
2388
2387
  className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
@@ -2390,7 +2389,7 @@ const ve = (e) => {
2390
2389
  margin: "0.75rem"
2391
2390
  },
2392
2391
  children: [
2393
- /* @__PURE__ */ p("div", { className: "flex gap-1", children: [
2392
+ /* @__PURE__ */ f("div", { className: "flex gap-1", children: [
2394
2393
  /* @__PURE__ */ c("div", { className: "tanya-sparkle tanya-sparkle-1", children: "✨" }),
2395
2394
  /* @__PURE__ */ c("div", { className: "tanya-sparkle tanya-sparkle-2", children: "✨" }),
2396
2395
  /* @__PURE__ */ c("div", { className: "tanya-sparkle tanya-sparkle-3", children: "✨" })
@@ -2400,7 +2399,7 @@ const ve = (e) => {
2400
2399
  "p",
2401
2400
  {
2402
2401
  className: "font-semibold tanya-pulse",
2403
- style: { color: g.themeDarkColor },
2402
+ style: { color: P.themeDarkColor },
2404
2403
  children: "I’ve found a special surprise crafted just for you… hang on a sec!"
2405
2404
  }
2406
2405
  ),
@@ -2408,35 +2407,35 @@ const ve = (e) => {
2408
2407
  "p",
2409
2408
  {
2410
2409
  className: "tanya-dots mt-1",
2411
- style: { color: g.themeDarkColor },
2410
+ style: { color: P.themeDarkColor },
2412
2411
  children: "• • •"
2413
2412
  }
2414
2413
  )
2415
2414
  ]
2416
2415
  }
2417
2416
  ) }),
2418
- u.secondaryResponse && /* @__PURE__ */ c(Ge, { children: /* @__PURE__ */ p("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
2417
+ d.secondaryResponse && /* @__PURE__ */ c(Ge, { children: /* @__PURE__ */ f("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
2419
2418
  /* @__PURE__ */ c(
2420
2419
  "div",
2421
2420
  {
2422
2421
  className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
2423
2422
  style: {
2424
- backgroundColor: g.tanyaThemeColorLight
2423
+ backgroundColor: P.tanyaThemeColorLight
2425
2424
  },
2426
2425
  dangerouslySetInnerHTML: {
2427
2426
  __html: Ve(
2428
- u.secondaryResponse
2427
+ d.secondaryResponse
2429
2428
  )
2430
2429
  }
2431
2430
  }
2432
2431
  ),
2433
- u.productSnapshot && // chat.productSnapshot.points > 0 &&
2434
- /* @__PURE__ */ c("div", { className: "mt-4 w-full", children: /* @__PURE__ */ p(
2432
+ d.productSnapshot && // chat.productSnapshot.points > 0 &&
2433
+ /* @__PURE__ */ c("div", { className: "mt-4 w-full", children: /* @__PURE__ */ f(
2435
2434
  "div",
2436
2435
  {
2437
2436
  className: "flex gap-4 items-stretch rounded-2xl p-4",
2438
2437
  style: {
2439
- backgroundColor: g.tanyaThemeColorLight
2438
+ backgroundColor: P.tanyaThemeColorLight
2440
2439
  },
2441
2440
  children: [
2442
2441
  /* @__PURE__ */ c(
@@ -2448,44 +2447,44 @@ const ve = (e) => {
2448
2447
  height: 112,
2449
2448
  borderColor: "#eee"
2450
2449
  },
2451
- children: u.productSnapshot.image ? /* @__PURE__ */ c(
2450
+ children: d.productSnapshot.image ? /* @__PURE__ */ c(
2452
2451
  "img",
2453
2452
  {
2454
- src: u.productSnapshot.image,
2455
- alt: u.productSnapshot.name,
2453
+ src: d.productSnapshot.image,
2454
+ alt: d.productSnapshot.name,
2456
2455
  className: "w-full h-full object-cover"
2457
2456
  }
2458
2457
  ) : /* @__PURE__ */ c("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
2459
2458
  }
2460
2459
  ),
2461
- /* @__PURE__ */ p("div", { className: "flex flex-col flex-1 justify-between", children: [
2462
- /* @__PURE__ */ p("div", { children: [
2463
- /* @__PURE__ */ c("p", { className: "font-semibold text-[15px] leading-snug", children: u.productSnapshot.name }),
2464
- /* @__PURE__ */ c("p", { className: "mt-1 text-[14px] font-medium", children: u.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
2460
+ /* @__PURE__ */ f("div", { className: "flex flex-col flex-1 justify-between", children: [
2461
+ /* @__PURE__ */ f("div", { children: [
2462
+ /* @__PURE__ */ c("p", { className: "font-semibold text-[15px] leading-snug", children: d.productSnapshot.name }),
2463
+ /* @__PURE__ */ c("p", { className: "mt-1 text-[14px] font-medium", children: d.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
2465
2464
  style: "currency",
2466
- currency: (g == null ? void 0 : g.currency) || "USD"
2465
+ currency: (P == null ? void 0 : P.currency) || "USD"
2467
2466
  }).format(
2468
- u.productSnapshot.price
2467
+ d.productSnapshot.price
2469
2468
  ) : "" }),
2470
- u.productSnapshot.points > 0 && /* @__PURE__ */ p("p", { className: "mt-1 text-xs opacity-80", children: [
2469
+ d.productSnapshot.points > 0 && /* @__PURE__ */ f("p", { className: "mt-1 text-xs opacity-80", children: [
2471
2470
  "You will earn",
2472
2471
  " ",
2473
- /* @__PURE__ */ p("strong", { children: [
2474
- u.productSnapshot.points,
2472
+ /* @__PURE__ */ f("strong", { children: [
2473
+ d.productSnapshot.points,
2475
2474
  " ",
2476
2475
  "points"
2477
2476
  ] })
2478
2477
  ] })
2479
2478
  ] }),
2480
- /* @__PURE__ */ p("div", { className: "mt-3 flex items-center gap-3", children: [
2481
- /* @__PURE__ */ p("div", { className: "flex items-center border rounded-full overflow-hidden", children: [
2479
+ /* @__PURE__ */ f("div", { className: "mt-3 flex items-center gap-3", children: [
2480
+ /* @__PURE__ */ f("div", { className: "flex items-center border rounded-full overflow-hidden", children: [
2482
2481
  /* @__PURE__ */ c(
2483
2482
  "button",
2484
2483
  {
2485
2484
  className: "px-3 py-1 text-sm",
2486
- onClick: () => M(
2487
- (k) => k.map(
2488
- (S, q) => q === P && S.productSnapshot ? {
2485
+ onClick: () => $(
2486
+ (w) => w.map(
2487
+ (S, H) => H === _ && S.productSnapshot ? {
2489
2488
  ...S,
2490
2489
  productSnapshot: {
2491
2490
  ...S.productSnapshot,
@@ -2499,19 +2498,19 @@ const ve = (e) => {
2499
2498
  ),
2500
2499
  style: {
2501
2500
  background: "transparent",
2502
- color: g.themeDarkColor
2501
+ color: P.themeDarkColor
2503
2502
  },
2504
2503
  children: "−"
2505
2504
  }
2506
2505
  ),
2507
- /* @__PURE__ */ c("div", { className: "px-3 py-1 text-sm select-none", children: u.productSnapshot.quantity }),
2506
+ /* @__PURE__ */ c("div", { className: "px-3 py-1 text-sm select-none", children: d.productSnapshot.quantity }),
2508
2507
  /* @__PURE__ */ c(
2509
2508
  "button",
2510
2509
  {
2511
2510
  className: "px-3 py-1 text-sm",
2512
- onClick: () => M(
2513
- (k) => k.map(
2514
- (S, q) => q === P && S.productSnapshot ? {
2511
+ onClick: () => $(
2512
+ (w) => w.map(
2513
+ (S, H) => H === _ && S.productSnapshot ? {
2515
2514
  ...S,
2516
2515
  productSnapshot: {
2517
2516
  ...S.productSnapshot,
@@ -2522,7 +2521,7 @@ const ve = (e) => {
2522
2521
  ),
2523
2522
  style: {
2524
2523
  background: "transparent",
2525
- color: g.themeDarkColor
2524
+ color: P.themeDarkColor
2526
2525
  },
2527
2526
  children: "+"
2528
2527
  }
@@ -2532,21 +2531,21 @@ const ve = (e) => {
2532
2531
  "button",
2533
2532
  {
2534
2533
  onClick: () => {
2535
- Yt(
2536
- Q(
2537
- u.productSnapshot
2534
+ Qt(
2535
+ q(
2536
+ d.productSnapshot
2538
2537
  ),
2539
- u.productSnapshot.quantity
2538
+ d.productSnapshot.quantity
2540
2539
  );
2541
2540
  },
2542
- disabled: _,
2541
+ disabled: k,
2543
2542
  className: "px-4 py-2 rounded-full font-medium",
2544
2543
  style: {
2545
- background: g.tanyaThemeColor,
2546
- color: (g == null ? void 0 : g.tanyaThemeContrastColor) || "#fff",
2547
- opacity: _ ? 0.8 : 1
2544
+ background: P.tanyaThemeColor,
2545
+ color: (P == null ? void 0 : P.tanyaThemeContrastColor) || "#fff",
2546
+ opacity: k ? 0.8 : 1
2548
2547
  },
2549
- children: _ ? "Adding..." : "Add to cart"
2548
+ children: k ? "Adding..." : "Add to cart"
2550
2549
  }
2551
2550
  )
2552
2551
  ] })
@@ -2556,7 +2555,7 @@ const ve = (e) => {
2556
2555
  ) })
2557
2556
  ] }) }),
2558
2557
  /* @__PURE__ */ c("div", { className: "mb-20" })
2559
- ] }, P);
2558
+ ] }, _);
2560
2559
  })
2561
2560
  ]
2562
2561
  }
@@ -2568,17 +2567,17 @@ const ve = (e) => {
2568
2567
  style: {
2569
2568
  background: "linear-gradient(180deg, #B09FFF 0%, #8D79F6 100%)"
2570
2569
  },
2571
- children: /* @__PURE__ */ p("div", { className: "flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1", children: [
2570
+ children: /* @__PURE__ */ f("div", { className: "flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1", children: [
2572
2571
  /* @__PURE__ */ c(
2573
2572
  "input",
2574
2573
  {
2575
2574
  className: "flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",
2576
2575
  placeholder: "How can I help you...",
2577
- value: W,
2576
+ value: L,
2578
2577
  autoFocus: !0,
2579
- onChange: (u) => C(u.target.value),
2580
- onKeyDown: (u) => {
2581
- u.key === "Enter" && !v && ne();
2578
+ onChange: (d) => Y(d.target.value),
2579
+ onKeyDown: (d) => {
2580
+ d.key === "Enter" && !m && V();
2582
2581
  }
2583
2582
  }
2584
2583
  ),
@@ -2586,16 +2585,16 @@ const ve = (e) => {
2586
2585
  "button",
2587
2586
  {
2588
2587
  type: "submit",
2589
- disabled: v,
2588
+ disabled: m,
2590
2589
  className: "p-3",
2591
- onClick: () => ne(),
2592
- children: v ? /* @__PURE__ */ c(
2590
+ onClick: () => V(),
2591
+ children: m ? /* @__PURE__ */ c(
2593
2592
  "div",
2594
2593
  {
2595
2594
  className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
2596
2595
  style: {
2597
2596
  borderBottom: "2px solid",
2598
- color: g.tanyaThemeColor
2597
+ color: P.tanyaThemeColor
2599
2598
  }
2600
2599
  }
2601
2600
  ) : /* @__PURE__ */ c(
@@ -2623,7 +2622,7 @@ const ve = (e) => {
2623
2622
  ]
2624
2623
  }
2625
2624
  ),
2626
- /* @__PURE__ */ c(go, {})
2625
+ /* @__PURE__ */ c(ho, {})
2627
2626
  ] })
2628
2627
  ]
2629
2628
  }
@@ -2632,6 +2631,6 @@ const ve = (e) => {
2632
2631
  ] }) });
2633
2632
  };
2634
2633
  export {
2635
- To as TanyaChatbot
2634
+ Co as TanyaChatbot
2636
2635
  };
2637
2636
  //# sourceMappingURL=tanya-chatbot.es.js.map