tanya-chatbot 0.9.9 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import { useEffect as xe, useState as b, useRef as Ve, forwardRef as $n, createElement as pr, useMemo as en } from "react";
1
+ import { useEffect as xe, useState as b, useRef as Ve, forwardRef as $n, createElement as mr, useMemo as Zr } from "react";
2
2
  import { jsx as a, jsxs as d, Fragment as ke } from "react/jsx-runtime";
3
3
  import { createHttpLink as Uo, ApolloClient as qo, InMemoryCache as Ro, ApolloProvider as Ho } from "@apollo/client";
4
- import { Provider as Vo, useDispatch as Ln, useSelector as er } from "react-redux";
4
+ import { Provider as Vo, useDispatch as Ln, useSelector as Xt } from "react-redux";
5
5
  import { createSlice as zn, configureStore as Yo } from "@reduxjs/toolkit";
6
6
  import * as Dn from "@radix-ui/react-popover";
7
7
  import "clsx";
@@ -74,12 +74,12 @@ const Qo = {
74
74
  e.product = t.payload;
75
75
  }
76
76
  }
77
- }), { setProduct: gr } = Bn.actions, Zo = Bn.reducer, ea = Yo({
77
+ }), { setProduct: hr } = Bn.actions, Zo = Bn.reducer, ea = Yo({
78
78
  reducer: {
79
79
  store: Go,
80
80
  product: Zo
81
81
  }
82
- }), ta = ({ children: e }) => /* @__PURE__ */ a(Vo, { store: ea, children: e }), tr = (e) => {
82
+ }), ta = ({ children: e }) => /* @__PURE__ */ a(Vo, { store: ea, children: e }), Zt = (e) => {
83
83
  const t = new CustomEvent("reactCartUpdated", {
84
84
  detail: {
85
85
  cartUpdated: !0,
@@ -98,7 +98,7 @@ function na({
98
98
  }) {
99
99
  return /* @__PURE__ */ a(Dn.Trigger, { "data-slot": "popover-trigger", ...e });
100
100
  }
101
- const Ze = () => ({ 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" }), Un = async () => {
101
+ const Xe = () => ({ 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" }), Un = async () => {
102
102
  const e = "https://tanya-sfcc-server.vercel.app/";
103
103
  try {
104
104
  const t = await ue.post(
@@ -112,7 +112,7 @@ const Ze = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
112
112
  const t = "https://tanya-sfcc-server.vercel.app/";
113
113
  try {
114
114
  const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, n = await ue.post(
115
- `${t}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
115
+ `${t}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
116
116
  {},
117
117
  {
118
118
  headers: {
@@ -126,12 +126,12 @@ const Ze = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
126
126
  return ue.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
127
127
  }
128
128
  };
129
- async function Xe() {
129
+ async function Ge() {
130
130
  var s;
131
131
  const e = Ue(), t = "access_token_" + e, r = "expires_in_" + e, n = localStorage.getItem(r), o = localStorage.getItem(t);
132
132
  return console.log(o), (s = JSON.parse(sessionStorage.getItem("customerData") || "{}")) != null && s.isGuest, console.log("access token found in local storage"), { access_token: o, expires_in: n };
133
133
  }
134
- const wr = async (e, t) => {
134
+ const pr = async (e, t) => {
135
135
  if (e && t && Date.now() < t)
136
136
  return e;
137
137
  try {
@@ -156,18 +156,18 @@ const wr = async (e, t) => {
156
156
  } catch (r) {
157
157
  return console.error("Error obtaining JWT token:", r), e = null, t = null, null;
158
158
  }
159
- }, Ye = () => sessionStorage.getItem("Host"), Ue = () => sessionStorage.getItem("SiteId"), et = () => sessionStorage.getItem("pubCfg"), tt = () => sessionStorage.getItem("envRef"), rt = () => sessionStorage.getItem("orgRef"), oa = async (e) => {
159
+ }, Ye = () => sessionStorage.getItem("Host"), Ue = () => sessionStorage.getItem("SiteId"), Ze = () => sessionStorage.getItem("pubCfg"), et = () => sessionStorage.getItem("envRef"), tt = () => sessionStorage.getItem("orgRef"), oa = async (e) => {
160
160
  console.log("fetching results");
161
- const { serverUrl: t, basePath: r } = Ze();
161
+ const { serverUrl: t, basePath: r } = Xe();
162
162
  let n = "";
163
163
  {
164
- const o = await Xe();
164
+ const o = await Ge();
165
165
  console.log("the token from getSearchResults", o), n = o.access_token;
166
166
  }
167
167
  try {
168
168
  const o = Ye();
169
169
  return (await ue.get(
170
- `${t}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
170
+ `${t}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
171
171
  {
172
172
  headers: {
173
173
  "Content-Type": "application/json",
@@ -180,11 +180,11 @@ const wr = async (e, t) => {
180
180
  }
181
181
  }, Rn = async (e) => {
182
182
  if (!e) throw new Error("Product ID is required");
183
- const { serverUrl: t, basePath: r } = Ze(), n = Ye();
183
+ const { serverUrl: t, basePath: r } = Xe(), n = Ye();
184
184
  console.log("calling access");
185
- const { access_token: o } = await Xe();
185
+ const { access_token: o } = await Ge();
186
186
  return (await ue.get(
187
- `${t}${r}/product-sfcc/${e}?baseUrl=${n}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
187
+ `${t}${r}/product-sfcc/${e}?baseUrl=${n}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
188
188
  {
189
189
  headers: {
190
190
  "Content-Type": "application/json",
@@ -196,9 +196,9 @@ const wr = async (e, t) => {
196
196
  if (!e) throw new Error("customerId is required");
197
197
  const t = await Un(), { customer_token: r } = await qn(
198
198
  t
199
- ), { serverUrl: n, basePath: o } = Ze(), i = (await Xe()).access_token;
199
+ ), { serverUrl: n, basePath: o } = Xe(), i = (await Ge()).access_token;
200
200
  return (await ue.get(
201
- `${n}${o}/get-interest?baseUrl=${Ye()}&customerId=${e}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
201
+ `${n}${o}/get-interest?baseUrl=${Ye()}&customerId=${e}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
202
202
  {
203
203
  headers: {
204
204
  "Content-Type": "application/json",
@@ -206,10 +206,10 @@ const wr = async (e, t) => {
206
206
  }
207
207
  }
208
208
  )).data;
209
- }, tn = (e) => String(typeof e == "string" ? e : e["en-US"] || e), rn = (e) => e != null && e.image ? [e.image] : "variants" in e ? e.variants[0].images : e.masterVariant.images.map((t) => t.url), sa = (e, t) => e.toLocaleString("en-US", {
209
+ }, en = (e) => String(typeof e == "string" ? e : e["en-US"] || e), tn = (e) => e != null && e.image ? [e.image] : "variants" in e ? e.variants[0].images : e.masterVariant.images.map((t) => t.url), sa = (e, t) => e.toLocaleString("en-US", {
210
210
  style: "currency",
211
211
  currency: t || "USD"
212
- }), nn = (e) => {
212
+ }), rn = (e) => {
213
213
  var t, r, n;
214
214
  return "variants" in e ? {
215
215
  centAmount: (t = e.variants[0]) == null ? void 0 : t.prices.EUR.max,
@@ -218,7 +218,7 @@ const wr = async (e, t) => {
218
218
  centAmount: (r = e.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
219
219
  currencyCode: (n = e.masterVariant) == null ? void 0 : n.prices[0].value.currencyCode
220
220
  };
221
- }, ia = (e) => e.charAt(0).toUpperCase() + e.slice(1), on = (e, t) => e.length < t ? e : e.slice(0, t) + "...", lr = (e) => e.split("\\n").map((t, r) => {
221
+ }, ia = (e) => e.charAt(0).toUpperCase() + e.slice(1), nn = (e, t) => e.length < t ? e : e.slice(0, t) + "...", sr = (e) => e.split("\\n").map((t, r) => {
222
222
  const n = t.match(/^(\d+)\.\s(.+)/);
223
223
  return n ? `<p key=${r} class="mb-2"><strong>${n[1]}.</strong> ${n[2]}</p>` : t.trim() ? `<p key=${r} class="mb-2">${t}</p>` : "<br/>";
224
224
  }).join("");
@@ -242,7 +242,7 @@ const ca = ({
242
242
  );
243
243
  }, c = async (l) => {
244
244
  const p = await Rn(l);
245
- t(gr(p));
245
+ t(hr(p));
246
246
  };
247
247
  return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-4 relative", children: [
248
248
  (e == null ? void 0 : e.length) > r && /* @__PURE__ */ a(
@@ -271,7 +271,7 @@ const ca = ({
271
271
  /* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
272
272
  "img",
273
273
  {
274
- src: ((p = rn(l)[0]) == null ? void 0 : p.link) || rn(l)[0] || // fallback if it's a string
274
+ src: ((p = tn(l)[0]) == null ? void 0 : p.link) || tn(l)[0] || // fallback if it's a string
275
275
  "https://via.placeholder.com/120",
276
276
  alt: l != null && l.productName ? l.productName : "Product",
277
277
  className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
@@ -283,8 +283,8 @@ const ca = ({
283
283
  className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
284
284
  children: [
285
285
  /* @__PURE__ */ d("div", { className: "relative inline-block group", children: [
286
- /* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name : on(
287
- tn((g = l == null ? void 0 : l.name) == null ? void 0 : g["en-US"]),
286
+ /* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name : nn(
287
+ en((g = l == null ? void 0 : l.name) == null ? void 0 : g["en-US"]),
288
288
  60
289
289
  ) || "Product" }),
290
290
  /* @__PURE__ */ a(
@@ -298,8 +298,8 @@ const ca = ({
298
298
  marginBottom: "5px",
299
299
  zIndex: 50
300
300
  },
301
- children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name : on(
302
- tn((y = l == null ? void 0 : l.name) == null ? void 0 : y["en-US"]),
301
+ children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name : nn(
302
+ en((y = l == null ? void 0 : l.name) == null ? void 0 : y["en-US"]),
303
303
  60
304
304
  ) || "Product"
305
305
  }
@@ -307,8 +307,8 @@ const ca = ({
307
307
  ] }),
308
308
  /* @__PURE__ */ d("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
309
309
  /* @__PURE__ */ a("p", { children: sa(
310
- l != null && l.price ? Number(l == null ? void 0 : l.price) : nn(l).centAmount || 0,
311
- (x = nn(l)) == null ? void 0 : x.currencyCode
310
+ l != null && l.price ? Number(l == null ? void 0 : l.price) : rn(l).centAmount || 0,
311
+ (x = rn(l)) == null ? void 0 : x.currencyCode
312
312
  ) }),
313
313
  /* @__PURE__ */ d("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
314
314
  "$",
@@ -363,12 +363,12 @@ const ca = ({
363
363
  ]
364
364
  },
365
365
  n
366
- )) }), Ir = async (e, t) => {
366
+ )) }), Cr = async (e, t) => {
367
367
  var s, i;
368
- const { serverUrl: r, basePath: n } = Ze(), o = `${r}`;
368
+ const { serverUrl: r, basePath: n } = Xe(), o = `${r}`;
369
369
  try {
370
370
  const c = await ue.post(
371
- `${o}${n}/basket/create?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
371
+ `${o}${n}/basket/create?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
372
372
  t,
373
373
  {
374
374
  headers: {
@@ -387,11 +387,11 @@ const ca = ({
387
387
  } catch (c) {
388
388
  return ue.isAxiosError(c) ? console.error("Error creating basket:", c.response || c.message) : console.error("Unexpected error:", c), null;
389
389
  }
390
- }, yr = async (e, t, r) => {
391
- const { serverUrl: n, basePath: o } = Ze(), s = `${n}`;
390
+ }, gr = async (e, t, r) => {
391
+ const { serverUrl: n, basePath: o } = Xe(), s = `${n}`;
392
392
  try {
393
393
  const i = await ue.post(
394
- `${s}${o}/basket/add-product/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
394
+ `${s}${o}/basket/add-product/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
395
395
  t,
396
396
  {
397
397
  headers: {
@@ -412,10 +412,10 @@ const ca = ({
412
412
  customer_token: t
413
413
  }) => {
414
414
  var s;
415
- const { serverUrl: r, basePath: n } = Ze(), o = `${r}`;
415
+ const { serverUrl: r, basePath: n } = Xe(), o = `${r}`;
416
416
  try {
417
417
  const i = await ue.get(
418
- `${o}${n}/basket/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
418
+ `${o}${n}/basket/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
419
419
  {
420
420
  headers: {
421
421
  "Content-Type": "application/json",
@@ -428,51 +428,53 @@ const ca = ({
428
428
  return ue.isAxiosError(i) ? { status: (s = i.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
429
429
  }
430
430
  }, ua = async (e) => {
431
- const { serverUrl: t, basePath: r } = Ze(), n = `${t}`, o = await Xe(), s = "Bearer " + (o == null ? void 0 : o.access_token);
431
+ var i;
432
+ const { serverUrl: t, basePath: r } = Xe(), n = `${t}`, o = await Ge(), s = "Bearer " + (o == null ? void 0 : o.access_token);
432
433
  try {
433
- return (await ue.get(
434
- `${n}${r}/basket/shipping-methods/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
434
+ const c = await ue.get(
435
+ `${n}${r}/basket/shipping-methods/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
435
436
  {
436
437
  headers: {
437
438
  "Content-Type": "application/json",
438
439
  Authorization: s
439
440
  }
440
441
  }
441
- )).data;
442
- } catch (i) {
443
- return ue.isAxiosError(i) ? console.error(
442
+ );
443
+ return ((i = c == null ? void 0 : c.data) == null ? void 0 : i.applicableShippingMethods) || [];
444
+ } catch (c) {
445
+ return ue.isAxiosError(c) ? console.error(
444
446
  "Error fetching shipping methods:",
445
- i.response || i.message
446
- ) : console.error("Unexpected error:", i), [];
447
+ c.response || c.message
448
+ ) : console.error("Unexpected error:", c), [];
447
449
  }
448
- }, Lt = "sfcc_basket_id", an = "sfcc_customer_token", zt = "sfcc_token_expiry", fa = 300 * 1e3, Vt = "1.0.0";
449
- const lt = (e) => {
450
+ }, $t = "sfcc_basket_id", on = "sfcc_customer_token", Lt = "sfcc_token_expiry", fa = 300 * 1e3, Rt = "1.0.0";
451
+ const it = (e) => {
450
452
  try {
451
- e ? localStorage.setItem(Lt, e) : localStorage.removeItem(Lt);
453
+ e ? localStorage.setItem($t, e) : localStorage.removeItem($t);
452
454
  } catch (t) {
453
455
  console.error("Error saving basket ID to storage:", t);
454
456
  }
455
- }, rr = (e) => {
457
+ }, er = (e) => {
456
458
  try {
457
459
  if (e) {
458
- localStorage.setItem(an, e);
460
+ localStorage.setItem(on, e);
459
461
  const t = Date.now() + fa;
460
- localStorage.setItem(zt, t.toString());
462
+ localStorage.setItem(Lt, t.toString());
461
463
  } else
462
- localStorage.removeItem(an);
464
+ localStorage.removeItem(on);
463
465
  } catch (t) {
464
466
  console.error("Error storing token:", t);
465
467
  }
466
- }, sn = 300, ma = ({ addToCartPwa: e }) => {
468
+ }, an = 300, ma = ({ addToCartPwa: e }) => {
467
469
  var l, p, g, y, x, I;
468
- const t = Ln(), r = er((S) => S.product.product), n = er((S) => S.store.store), [o, s] = b(!!r);
470
+ const t = Ln(), r = Xt((S) => S.product.product), n = Xt((S) => S.store.store), [o, s] = b(!!r);
469
471
  if (xe(() => {
470
472
  s(!!r);
471
473
  }, [r]), !r) return null;
472
474
  const i = async () => {
473
- var S, A, k, P, J, q, Y, _e, C, K, re, ye, be, dt, N, ve;
475
+ var S, T, k, P, J, q, Y, _e, C, K, re, ye, be, lt, N, ve;
474
476
  try {
475
- if (!((A = (S = r == null ? void 0 : r.variants) == null ? void 0 : S[0]) != null && A.product_id) && !(r.type.item || r.type.bundle) && !((P = (k = r == null ? void 0 : r.variants) == null ? void 0 : k[0]) != null && P.productId)) {
477
+ if (!((T = (S = r == null ? void 0 : r.variants) == null ? void 0 : S[0]) != null && T.product_id) && !(r.type.item || r.type.bundle) && !((P = (k = r == null ? void 0 : r.variants) == null ? void 0 : k[0]) != null && P.productId)) {
476
478
  Be.error("Variants not available", {
477
479
  position: "bottom-right",
478
480
  autoClose: 1e3
@@ -486,21 +488,21 @@ const lt = (e) => {
486
488
  }
487
489
  ], $ = JSON.parse(
488
490
  sessionStorage.getItem("customerData") || "{}"
489
- ), Je = ($ == null ? void 0 : $.basketId) || localStorage.getItem(Lt), ut = !1, qe = localStorage.getItem(zt), nt = Date.now();
490
- if (!ut || !qe || nt >= parseInt(qe)) {
491
+ ), Je = ($ == null ? void 0 : $.basketId) || localStorage.getItem($t), ct = !1, qe = localStorage.getItem(Lt), rt = Date.now();
492
+ if (!ct || !qe || rt >= parseInt(qe)) {
491
493
  let fe = "";
492
- if (fe = "Bearer " + (await Xe()).access_token, !fe) {
494
+ if (fe = "Bearer " + (await Ge()).access_token, !fe) {
493
495
  console.error("Failed to get customer_token");
494
496
  return;
495
497
  }
496
- const Ie = nt + 300 * 1e3;
497
- if (rr(fe), localStorage.setItem(zt, Ie.toString()), Je) {
498
+ const Ie = rt + 300 * 1e3;
499
+ if (er(fe), localStorage.setItem(Lt, Ie.toString()), Je) {
498
500
  const Se = await Hn({
499
501
  basketId: Je,
500
502
  customer_token: fe
501
503
  });
502
504
  if (Se.status === 200 && Se) {
503
- const ne = await yr(
505
+ const ne = await gr(
504
506
  Je,
505
507
  V,
506
508
  fe
@@ -512,7 +514,7 @@ const lt = (e) => {
512
514
  closeOnClick: !0,
513
515
  pauseOnHover: !0,
514
516
  draggable: !0
515
- }), tr(Je));
517
+ }), Zt(Je));
516
518
  return;
517
519
  }
518
520
  }
@@ -523,15 +525,15 @@ const lt = (e) => {
523
525
  quantity: 1
524
526
  }
525
527
  ]
526
- }, z = await Ir(fe, je);
528
+ }, z = await Cr(fe, je);
527
529
  if (!(z != null && z.basket_id) && !(z != null && z.basketId)) {
528
530
  console.error("Failed to create basket");
529
531
  return;
530
532
  }
531
- lt(
533
+ it(
532
534
  (z == null ? void 0 : z.basket_id) || (z == null ? void 0 : z.basketId)
533
535
  ), console.log("adding product to basket");
534
- const Te = await yr(
536
+ const Te = await gr(
535
537
  (z == null ? void 0 : z.basket_id) || (z == null ? void 0 : z.basketId),
536
538
  V,
537
539
  fe
@@ -543,14 +545,14 @@ const lt = (e) => {
543
545
  closeOnClick: !0,
544
546
  pauseOnHover: !0,
545
547
  draggable: !0
546
- }), tr(z.basket_id || (z == null ? void 0 : z.basketId));
548
+ }), Zt(z.basket_id || (z == null ? void 0 : z.basketId));
547
549
  }
548
550
  } catch (V) {
549
551
  console.error("Error adding to cart:", V), Be.error("Failed to add product to cart", {
550
552
  position: "bottom-right",
551
553
  autoClose: 3e3
552
554
  }), ((be = V == null ? void 0 : V.response) == null ? void 0 : be.status) === 404 || // Basket not found
553
- ((dt = V == null ? void 0 : V.response) == null ? void 0 : dt.status) === 401 ? (((N = V == null ? void 0 : V.response) == null ? void 0 : N.status) === 404 && lt(null), ((ve = V == null ? void 0 : V.response) == null ? void 0 : ve.status) === 401 && (lt(null), rr(null))) : (console.error("Failed to add product to basket:", V.message), Be.error("Failed to add product to cart", {
555
+ ((lt = V == null ? void 0 : V.response) == null ? void 0 : lt.status) === 401 ? (((N = V == null ? void 0 : V.response) == null ? void 0 : N.status) === 404 && it(null), ((ve = V == null ? void 0 : V.response) == null ? void 0 : ve.status) === 401 && (it(null), er(null))) : (console.error("Failed to add product to basket:", V.message), Be.error("Failed to add product to cart", {
554
556
  position: "bottom-right",
555
557
  autoClose: 3e3
556
558
  }));
@@ -566,7 +568,7 @@ const lt = (e) => {
566
568
  {
567
569
  className: "fixed inset-0 z-40 bg-black/30",
568
570
  onClick: () => {
569
- s(!1), setTimeout(() => t(gr(null)), sn);
571
+ s(!1), setTimeout(() => t(hr(null)), an);
570
572
  }
571
573
  }
572
574
  ),
@@ -589,8 +591,8 @@ const lt = (e) => {
589
591
  className: "text-[#555555] w-6 h-6 cursor-pointer",
590
592
  onClick: () => {
591
593
  s(!1), setTimeout(
592
- () => t(gr(null)),
593
- sn
594
+ () => t(hr(null)),
595
+ an
594
596
  );
595
597
  },
596
598
  children: "✕"
@@ -607,14 +609,14 @@ const lt = (e) => {
607
609
  }
608
610
  ) }),
609
611
  /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: r.imageGroups.slice(1, 2).map(
610
- (S) => S.images.slice(1, 2).map((A) => /* @__PURE__ */ a(
612
+ (S) => S.images.slice(1, 2).map((T) => /* @__PURE__ */ a(
611
613
  "img",
612
614
  {
613
- src: A.link,
615
+ src: T.link,
614
616
  alt: r.name,
615
617
  className: "rounded-[10px] w-[60px] h-[60px]"
616
618
  },
617
- A.link
619
+ T.link
618
620
  ))
619
621
  ) })
620
622
  ] }),
@@ -661,7 +663,7 @@ const lt = (e) => {
661
663
  " ratings"
662
664
  ] })
663
665
  ] }) }),
664
- /* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((S, A) => {
666
+ /* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((S, T) => {
665
667
  var k;
666
668
  return /* @__PURE__ */ a(
667
669
  Jo,
@@ -670,10 +672,10 @@ const lt = (e) => {
670
672
  width: "20",
671
673
  height: "20",
672
674
  className: `text-yellow-500
673
- ${((k = r == null ? void 0 : r.rating) == null ? void 0 : k.rate) > A ? "text-yellow-500" : "text-gray-300"}
675
+ ${((k = r == null ? void 0 : r.rating) == null ? void 0 : k.rate) > T ? "text-yellow-500" : "text-gray-300"}
674
676
  `
675
677
  },
676
- A
678
+ T
677
679
  );
678
680
  }) })
679
681
  ] }),
@@ -729,12 +731,12 @@ const lt = (e) => {
729
731
  Others: "others"
730
732
  }, s = Ve(null), i = Ve(null), c = Ve(null), l = Ve(null), [p, g] = b(null);
731
733
  Ve(null);
732
- const [y, x] = b(!1), [I, S] = b(!1), [A, k] = b(!1), [P, J] = b(!1), [q, Y] = b(!1), [_e, C] = b(!1), [K, re] = b(""), [ye, be] = b(""), dt = (h) => ({
734
+ const [y, x] = b(!1), [I, S] = b(!1), [T, k] = b(!1), [P, J] = b(!1), [q, Y] = b(!1), [_e, C] = b(!1), [K, re] = b(""), [ye, be] = b(""), lt = (h) => ({
733
735
  id: h.id,
734
736
  title: h.name,
735
737
  image: h.image ?? "",
736
738
  price: h.price ?? 0
737
- }), [N, ve] = b([]), V = Ve(null), $ = er((h) => h.store.store), Je = er((h) => h.product.product);
739
+ }), [N, ve] = b([]), V = Ve(null), $ = Xt((h) => h.store.store), Je = Xt((h) => h.product.product);
738
740
  xe(() => {
739
741
  const h = localStorage.getItem(
740
742
  `access_token_${e.siteId}`
@@ -756,25 +758,25 @@ const lt = (e) => {
756
758
  );
757
759
  h && localStorage.setItem(`chat-token-${e.siteId}`, h);
758
760
  }, [N]);
759
- const ut = () => {
761
+ const ct = () => {
760
762
  k(!0), setTimeout(() => S(!0), 10);
761
763
  }, qe = () => {
762
764
  S(!1), setTimeout(() => k(!1), 300);
763
765
  };
764
766
  xe(() => {
765
- y ? ut() : qe();
767
+ y ? ct() : qe();
766
768
  }, [y]);
767
- const nt = (h) => {
769
+ const rt = (h) => {
768
770
  be(o[h]);
769
771
  };
770
772
  xe(() => {
771
- A && V.current && V.current.scrollTo({
773
+ T && V.current && V.current.scrollTo({
772
774
  top: V.current.scrollHeight,
773
775
  behavior: "smooth"
774
776
  });
775
- }, [N, A]);
777
+ }, [N, T]);
776
778
  const fe = null, Ie = null, je = async () => {
777
- const h = await Xe();
779
+ const h = await Ge();
778
780
  h != null && g(h);
779
781
  };
780
782
  xe(() => {
@@ -784,7 +786,7 @@ const lt = (e) => {
784
786
  }
785
787
  je(), console.log("scapi environment v1");
786
788
  }, []), xe(() => {
787
- t && (console.log("setting the basket id", t), lt(t));
789
+ t && (console.log("setting the basket id", t), it(t));
788
790
  }, [t]);
789
791
  const z = async () => {
790
792
  const h = JSON.parse(
@@ -792,16 +794,16 @@ const lt = (e) => {
792
794
  ).customerId;
793
795
  return (await aa(h || "")).c_interests;
794
796
  }, Te = async (h, O) => {
795
- console.log("in secondary flow", Vt);
797
+ console.log("in secondary flow", Rt);
796
798
  const B = await z();
797
- if (console.log(B, "interests of customer", Vt), !!B)
799
+ if (console.log(B, "interests of customer", Rt), !!B)
798
800
  try {
799
801
  ve(
800
- (me) => me.map(
801
- (Ne, he) => he === me.length - 1 ? { ...Ne, secondaryLoading: !0 } : Ne
802
+ (he) => he.map(
803
+ (Ne, pe) => pe === he.length - 1 ? { ...Ne, secondaryLoading: !0 } : Ne
802
804
  )
803
805
  );
804
- const Q = await wr(fe, Ie);
806
+ const Q = await pr(fe, Ie);
805
807
  if (!Q) throw new Error("Failed to fetch token");
806
808
  const U = localStorage.getItem("customerNumber"), L = localStorage.getItem("isLoggedIn"), Z = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
807
809
  registered: String(L || !1),
@@ -828,15 +830,15 @@ const lt = (e) => {
828
830
  const $e = oe.body.getReader(), Re = new TextDecoder();
829
831
  let G = "";
830
832
  for (; ; ) {
831
- const { done: me, value: Ne } = await $e.read();
832
- if (me) break;
833
+ const { done: he, value: Ne } = await $e.read();
834
+ if (he) break;
833
835
  G += Re.decode(Ne, { stream: !0 });
834
- const he = G.split(`
836
+ const pe = G.split(`
835
837
  `);
836
- G = he.pop() || "";
837
- for (const pe of he)
838
- if (pe.startsWith("data:")) {
839
- const _ = pe.slice(5).trim();
838
+ G = pe.pop() || "";
839
+ for (const X of pe)
840
+ if (X.startsWith("data:")) {
841
+ const _ = X.slice(5).trim();
840
842
  try {
841
843
  const ee = JSON.parse(_);
842
844
  ee.index === 0 && ve(
@@ -874,7 +876,7 @@ const lt = (e) => {
874
876
  }
875
877
  ]);
876
878
  try {
877
- const B = ye, Q = localStorage.getItem("customerNumber"), U = localStorage.getItem("isLoggedIn"), L = await wr(fe, Ie);
879
+ const B = ye, Q = localStorage.getItem("customerNumber"), U = localStorage.getItem("isLoggedIn"), L = await pr(fe, Ie);
878
880
  if (!L)
879
881
  throw new Error("Failed to obtain access token");
880
882
  const Z = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
@@ -900,21 +902,21 @@ const lt = (e) => {
900
902
  throw new Error(`HTTP error! status: ${oe.status}`);
901
903
  if (!oe.body) throw new Error("Readable stream not supported");
902
904
  const $e = oe.body.getReader(), Re = new TextDecoder();
903
- let G = "", me = "";
905
+ let G = "", he = "";
904
906
  for (; ; ) {
905
907
  C(!0);
906
- const { done: Ne, value: he } = await $e.read();
908
+ const { done: Ne, value: pe } = await $e.read();
907
909
  if (Ne) break;
908
- G += Re.decode(he, { stream: !0 });
909
- const pe = G.split(`
910
+ G += Re.decode(pe, { stream: !0 });
911
+ const X = G.split(`
910
912
  `);
911
- G = pe.pop() || "";
912
- for (const _ of pe)
913
+ G = X.pop() || "";
914
+ for (const _ of X)
913
915
  if (_.startsWith("data:")) {
914
916
  const ee = _.slice(5).trim();
915
917
  try {
916
918
  const D = JSON.parse(ee);
917
- D.index == 1 && (me = D.data), ve(
919
+ D.index == 1 && (he = D.data), ve(
918
920
  (ae) => ae.map(
919
921
  (se, Ae) => Ae === ae.length - 1 ? {
920
922
  ...se,
@@ -927,7 +929,7 @@ const lt = (e) => {
927
929
  }
928
930
  }
929
931
  }
930
- X(ne(me));
932
+ me(ne(he));
931
933
  } catch (B) {
932
934
  console.error("Error sending message to Tanya:", B);
933
935
  } finally {
@@ -939,7 +941,7 @@ const lt = (e) => {
939
941
  /top five relevant product or category names are: (.*)/i
940
942
  ), U = (O ? O[1] : h).split(", ").map((W) => W.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
941
943
  return [...new Set(U)].filter(Boolean).join(",");
942
- }, X = async (h) => {
944
+ }, me = async (h) => {
943
945
  var B, Q, U;
944
946
  const O = typeof h == "string" ? h.split(",") : h;
945
947
  C(!0);
@@ -976,15 +978,15 @@ const lt = (e) => {
976
978
  const R = JSON.parse(
977
979
  sessionStorage.getItem("customerData") || "{}"
978
980
  );
979
- R != null && R.isGuest || (console.log("running secondary flow", Vt), Te(s.current, 0));
981
+ R != null && R.isGuest || (console.log("running secondary flow", Rt), Te(s.current, 0));
980
982
  }
981
983
  } catch (L) {
982
984
  console.error("error in keyword search", L);
983
985
  } finally {
984
986
  C(!1);
985
987
  }
986
- }, kt = async (h, O) => {
987
- var B, Q, U, L, W, Z, R, oe, $e, Re, G, me, Ne, he, pe;
988
+ }, vt = async (h, O) => {
989
+ var B, Q, U, L, W, Z, R, oe, $e, Re, G, he, Ne, pe, X;
988
990
  J(!0);
989
991
  try {
990
992
  const _ = await Rn(h.id);
@@ -1001,11 +1003,11 @@ const lt = (e) => {
1001
1003
  quantity: O
1002
1004
  }
1003
1005
  ];
1004
- console.log(ee, "product data", "app version", Vt);
1006
+ console.log(ee, "product data", "app version", Rt);
1005
1007
  const D = JSON.parse(
1006
1008
  sessionStorage.getItem("customerData") || "{}"
1007
- ), ae = (D == null ? void 0 : D.basketId) || localStorage.getItem(Lt), se = !1, Ae = localStorage.getItem(zt), St = Date.now();
1008
- if (!se || !Ae || St >= parseInt(Ae)) {
1009
+ ), ae = (D == null ? void 0 : D.basketId) || localStorage.getItem($t), se = !1, Ae = localStorage.getItem(Lt), kt = Date.now();
1010
+ if (!se || !Ae || kt >= parseInt(Ae)) {
1009
1011
  const Oe = await Un();
1010
1012
  let { customer_token: ie } = await qn(
1011
1013
  Oe
@@ -1014,26 +1016,26 @@ const lt = (e) => {
1014
1016
  console.error("Failed to get customer_token");
1015
1017
  return;
1016
1018
  }
1017
- const Nt = St + 300 * 1e3;
1018
- if (rr(ie), localStorage.setItem(zt, Nt.toString()), console.log(ae, "basketIdFromCustomer"), ae) {
1019
- const Ct = await Hn({
1019
+ const St = kt + 300 * 1e3;
1020
+ if (er(ie), localStorage.setItem(Lt, St.toString()), console.log(ae, "basketIdFromCustomer"), ae) {
1021
+ const Nt = await Hn({
1020
1022
  basketId: ae,
1021
1023
  customer_token: ie
1022
1024
  });
1023
- if (Ct.status === 200 && Ct) {
1024
- const _t = await yr(
1025
+ if (Nt.status === 200 && Nt) {
1026
+ const Ct = await gr(
1025
1027
  ae,
1026
1028
  ee,
1027
1029
  ie
1028
1030
  );
1029
- ((R = _t == null ? void 0 : _t.product_items) == null ? void 0 : R.length) > 0 && (Be.success("Added to cart", {
1031
+ ((R = Ct == null ? void 0 : Ct.product_items) == null ? void 0 : R.length) > 0 && (Be.success("Added to cart", {
1030
1032
  position: "bottom-right",
1031
1033
  autoClose: 3e3,
1032
1034
  hideProgressBar: !1,
1033
1035
  closeOnClick: !0,
1034
1036
  pauseOnHover: !0,
1035
1037
  draggable: !0
1036
- }), tr(ae), J(!1));
1038
+ }), Zt(ae), J(!1));
1037
1039
  return;
1038
1040
  }
1039
1041
  }
@@ -1044,7 +1046,7 @@ const lt = (e) => {
1044
1046
  quantity: 1
1045
1047
  }
1046
1048
  ]
1047
- }, F = await Ir(ie, Ce);
1049
+ }, F = await Cr(ie, Ce);
1048
1050
  if (console.log(
1049
1051
  F,
1050
1052
  F == null ? void 0 : F.basket_id,
@@ -1054,7 +1056,7 @@ const lt = (e) => {
1054
1056
  J(!1), console.error("Failed to create basket");
1055
1057
  return;
1056
1058
  }
1057
- lt(
1059
+ it(
1058
1060
  (F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId)
1059
1061
  );
1060
1062
  const te = await r(
@@ -1071,14 +1073,14 @@ const lt = (e) => {
1071
1073
  closeOnClick: !0,
1072
1074
  pauseOnHover: !0,
1073
1075
  draggable: !0
1074
- }), tr(F.basket_id || (F == null ? void 0 : F.basketId));
1076
+ }), Zt(F.basket_id || (F == null ? void 0 : F.basketId));
1075
1077
  }
1076
1078
  } catch (_) {
1077
1079
  J(!1), console.error("Error adding to cart:", _), Be.error("Failed to add product to cart", {
1078
1080
  position: "bottom-right",
1079
1081
  autoClose: 3e3
1080
- }), ((me = _ == null ? void 0 : _.response) == null ? void 0 : me.status) === 404 || // Basket not found
1081
- ((Ne = _ == null ? void 0 : _.response) == null ? void 0 : Ne.status) === 401 ? (((he = _ == null ? void 0 : _.response) == null ? void 0 : he.status) === 404 && lt(null), ((pe = _ == null ? void 0 : _.response) == null ? void 0 : pe.status) === 401 && (lt(null), rr(null))) : (console.error("Failed to add product to basket:", _.message), Be.error("Failed to add product to cart", {
1082
+ }), ((he = _ == null ? void 0 : _.response) == null ? void 0 : he.status) === 404 || // Basket not found
1083
+ ((Ne = _ == null ? void 0 : _.response) == null ? void 0 : Ne.status) === 401 ? (((pe = _ == null ? void 0 : _.response) == null ? void 0 : pe.status) === 404 && it(null), ((X = _ == null ? void 0 : _.response) == null ? void 0 : X.status) === 401 && (it(null), er(null))) : (console.error("Failed to add product to basket:", _.message), Be.error("Failed to add product to cart", {
1082
1084
  position: "bottom-right",
1083
1085
  autoClose: 3e3
1084
1086
  }));
@@ -1086,8 +1088,8 @@ const lt = (e) => {
1086
1088
  J(!1);
1087
1089
  };
1088
1090
  return xe(() => {
1089
- A ? setTimeout(() => S(!0), 10) : S(!1);
1090
- }, [A]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ d(ra, { open: y, onOpenChange: x, children: [
1091
+ T ? setTimeout(() => S(!0), 10) : S(!1);
1092
+ }, [T]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ d(ra, { open: y, onOpenChange: x, children: [
1091
1093
  /* @__PURE__ */ a(
1092
1094
  na,
1093
1095
  {
@@ -1151,7 +1153,7 @@ const lt = (e) => {
1151
1153
  ) })
1152
1154
  }
1153
1155
  ),
1154
- A && /* @__PURE__ */ d(ke, { children: [
1156
+ T && /* @__PURE__ */ d(ke, { children: [
1155
1157
  /* @__PURE__ */ a(
1156
1158
  "div",
1157
1159
  {
@@ -1312,7 +1314,7 @@ const lt = (e) => {
1312
1314
  /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: n.map((h) => /* @__PURE__ */ a(
1313
1315
  "button",
1314
1316
  {
1315
- onClick: () => nt(h),
1317
+ onClick: () => rt(h),
1316
1318
  className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
1317
1319
  style: {
1318
1320
  backgroundColor: ye === o[h] ? "#FFFFFF" : "#F3F3F3",
@@ -1340,7 +1342,7 @@ const lt = (e) => {
1340
1342
  {
1341
1343
  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",
1342
1344
  dangerouslySetInnerHTML: {
1343
- __html: lr(h.response)
1345
+ __html: sr(h.response)
1344
1346
  }
1345
1347
  }
1346
1348
  ) }) : /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
@@ -1348,7 +1350,7 @@ const lt = (e) => {
1348
1350
  {
1349
1351
  className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
1350
1352
  dangerouslySetInnerHTML: {
1351
- __html: lr(h.response)
1353
+ __html: sr(h.response)
1352
1354
  }
1353
1355
  }
1354
1356
  ) }),
@@ -1424,7 +1426,7 @@ const lt = (e) => {
1424
1426
  backgroundColor: $.tanyaThemeColorLight
1425
1427
  },
1426
1428
  dangerouslySetInnerHTML: {
1427
- __html: lr(
1429
+ __html: sr(
1428
1430
  h.secondaryResponse
1429
1431
  )
1430
1432
  }
@@ -1532,8 +1534,8 @@ const lt = (e) => {
1532
1534
  "button",
1533
1535
  {
1534
1536
  onClick: () => {
1535
- kt(
1536
- dt(
1537
+ vt(
1538
+ lt(
1537
1539
  h.productSnapshot
1538
1540
  ),
1539
1541
  h.productSnapshot.quantity
@@ -1631,30 +1633,30 @@ const lt = (e) => {
1631
1633
  ] })
1632
1634
  ] }) });
1633
1635
  };
1634
- var xr = function(e, t) {
1635
- return xr = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
1636
+ var wr = function(e, t) {
1637
+ return wr = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
1636
1638
  r.__proto__ = n;
1637
1639
  } || function(r, n) {
1638
1640
  for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
1639
- }, xr(e, t);
1641
+ }, wr(e, t);
1640
1642
  };
1641
1643
  function pa(e, t) {
1642
1644
  if (typeof t != "function" && t !== null)
1643
1645
  throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
1644
- xr(e, t);
1646
+ wr(e, t);
1645
1647
  function r() {
1646
1648
  this.constructor = e;
1647
1649
  }
1648
1650
  e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
1649
1651
  }
1650
- var Ge = function() {
1651
- return Ge = Object.assign || function(t) {
1652
+ var Qe = function() {
1653
+ return Qe = Object.assign || function(t) {
1652
1654
  for (var r, n = 1, o = arguments.length; n < o; n++) {
1653
1655
  r = arguments[n];
1654
1656
  for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
1655
1657
  }
1656
1658
  return t;
1657
- }, Ge.apply(this, arguments);
1659
+ }, Qe.apply(this, arguments);
1658
1660
  };
1659
1661
  function ga(e, t) {
1660
1662
  var r = {};
@@ -1664,26 +1666,26 @@ function ga(e, t) {
1664
1666
  t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (r[n[o]] = e[n[o]]);
1665
1667
  return r;
1666
1668
  }
1667
- var cr = "Invariant Violation", ln = Object.setPrototypeOf, wa = ln === void 0 ? function(e, t) {
1669
+ var ir = "Invariant Violation", sn = Object.setPrototypeOf, wa = sn === void 0 ? function(e, t) {
1668
1670
  return e.__proto__ = t, e;
1669
- } : ln, Vn = (
1671
+ } : sn, Vn = (
1670
1672
  /** @class */
1671
1673
  (function(e) {
1672
1674
  pa(t, e);
1673
1675
  function t(r) {
1674
- r === void 0 && (r = cr);
1675
- var n = e.call(this, typeof r == "number" ? cr + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
1676
- return n.framesToPop = 1, n.name = cr, wa(n, t.prototype), n;
1676
+ r === void 0 && (r = ir);
1677
+ var n = e.call(this, typeof r == "number" ? ir + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
1678
+ return n.framesToPop = 1, n.name = ir, wa(n, t.prototype), n;
1677
1679
  }
1678
1680
  return t;
1679
1681
  })(Error)
1680
1682
  );
1681
- function it(e, t) {
1683
+ function st(e, t) {
1682
1684
  if (!e)
1683
1685
  throw new Vn(t);
1684
1686
  }
1685
1687
  var Yn = ["debug", "log", "warn", "error", "silent"], ya = Yn.indexOf("log");
1686
- function Yt(e) {
1688
+ function Ht(e) {
1687
1689
  return function() {
1688
1690
  if (Yn.indexOf(e) >= ya) {
1689
1691
  var t = console[e] || console.log;
@@ -1692,22 +1694,22 @@ function Yt(e) {
1692
1694
  };
1693
1695
  }
1694
1696
  (function(e) {
1695
- e.debug = Yt("debug"), e.log = Yt("log"), e.warn = Yt("warn"), e.error = Yt("error");
1696
- })(it || (it = {}));
1697
+ e.debug = Ht("debug"), e.log = Ht("log"), e.warn = Ht("warn"), e.error = Ht("error");
1698
+ })(st || (st = {}));
1697
1699
  var Jn = "3.14.0";
1698
- function pt(e) {
1700
+ function ht(e) {
1699
1701
  try {
1700
1702
  return e();
1701
1703
  } catch {
1702
1704
  }
1703
1705
  }
1704
- const br = pt(function() {
1706
+ const yr = ht(function() {
1705
1707
  return globalThis;
1706
- }) || pt(function() {
1708
+ }) || ht(function() {
1707
1709
  return window;
1708
- }) || pt(function() {
1710
+ }) || ht(function() {
1709
1711
  return self;
1710
- }) || pt(function() {
1712
+ }) || ht(function() {
1711
1713
  return global;
1712
1714
  }) || // We don't expect the Function constructor ever to be invoked at runtime, as
1713
1715
  // long as at least one of globalThis, window, self, or global is defined, so
@@ -1715,13 +1717,13 @@ const br = pt(function() {
1715
1717
  // detect syntactic usage of the Function constructor. If you think you can
1716
1718
  // improve your static analysis to detect this obfuscation, think again. This
1717
1719
  // is an arms race you cannot win, at least not in JavaScript.
1718
- pt(function() {
1719
- return pt.constructor("return this")();
1720
+ ht(function() {
1721
+ return ht.constructor("return this")();
1720
1722
  });
1721
- var cn = /* @__PURE__ */ new Map();
1723
+ var ln = /* @__PURE__ */ new Map();
1722
1724
  function xa(e) {
1723
- var t = cn.get(e) || 1;
1724
- return cn.set(e, t + 1), "".concat(e, ":").concat(t, ":").concat(Math.random().toString(36).slice(2));
1725
+ var t = ln.get(e) || 1;
1726
+ return ln.set(e, t + 1), "".concat(e, ":").concat(t, ":").concat(Math.random().toString(36).slice(2));
1725
1727
  }
1726
1728
  function ba(e, t) {
1727
1729
  var r = xa("stringifyForDisplay");
@@ -1729,33 +1731,33 @@ function ba(e, t) {
1729
1731
  return o === void 0 ? r : o;
1730
1732
  }, t).split(JSON.stringify(r)).join("<undefined>");
1731
1733
  }
1732
- function Jt(e) {
1734
+ function Vt(e) {
1733
1735
  return function(t) {
1734
1736
  for (var r = [], n = 1; n < arguments.length; n++)
1735
1737
  r[n - 1] = arguments[n];
1736
1738
  if (typeof t == "number") {
1737
1739
  var o = t;
1738
- t = Pr(o), t || (t = Fr(o, r), r = []);
1740
+ t = _r(o), t || (t = Ir(o, r), r = []);
1739
1741
  }
1740
1742
  e.apply(void 0, [t].concat(r));
1741
1743
  };
1742
1744
  }
1743
- var dr = Object.assign(function(t, r) {
1745
+ var lr = Object.assign(function(t, r) {
1744
1746
  for (var n = [], o = 2; o < arguments.length; o++)
1745
1747
  n[o - 2] = arguments[o];
1746
- t || it(t, Pr(r, n) || Fr(r, n));
1748
+ t || st(t, _r(r, n) || Ir(r, n));
1747
1749
  }, {
1748
- debug: Jt(it.debug),
1749
- log: Jt(it.log),
1750
- warn: Jt(it.warn),
1751
- error: Jt(it.error)
1750
+ debug: Vt(st.debug),
1751
+ log: Vt(st.log),
1752
+ warn: Vt(st.warn),
1753
+ error: Vt(st.error)
1752
1754
  });
1753
1755
  function Kn(e) {
1754
1756
  for (var t = [], r = 1; r < arguments.length; r++)
1755
1757
  t[r - 1] = arguments[r];
1756
- return new Vn(Pr(e, t) || Fr(e, t));
1758
+ return new Vn(_r(e, t) || Ir(e, t));
1757
1759
  }
1758
- var dn = Symbol.for("ApolloErrorMessageHandler_" + Jn);
1760
+ var cn = Symbol.for("ApolloErrorMessageHandler_" + Jn);
1759
1761
  function Wn(e) {
1760
1762
  if (typeof e == "string")
1761
1763
  return e;
@@ -1765,11 +1767,11 @@ function Wn(e) {
1765
1767
  return "<non-serializable>";
1766
1768
  }
1767
1769
  }
1768
- function Pr(e, t) {
1770
+ function _r(e, t) {
1769
1771
  if (t === void 0 && (t = []), !!e)
1770
- return br[dn] && br[dn](e, t.map(Wn));
1772
+ return yr[cn] && yr[cn](e, t.map(Wn));
1771
1773
  }
1772
- function Fr(e, t) {
1774
+ function Ir(e, t) {
1773
1775
  if (t === void 0 && (t = []), !!e)
1774
1776
  return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
1775
1777
  version: Jn,
@@ -1784,8 +1786,8 @@ function va(e) {
1784
1786
  return t.name.value;
1785
1787
  })[0] || null;
1786
1788
  }
1787
- let de = null;
1788
- const un = {};
1789
+ let ce = null;
1790
+ const dn = {};
1789
1791
  let ka = 1;
1790
1792
  const Sa = () => class {
1791
1793
  constructor() {
@@ -1797,78 +1799,78 @@ const Sa = () => class {
1797
1799
  ].join(":");
1798
1800
  }
1799
1801
  hasValue() {
1800
- for (let t = de; t; t = t.parent)
1802
+ for (let t = ce; t; t = t.parent)
1801
1803
  if (this.id in t.slots) {
1802
1804
  const r = t.slots[this.id];
1803
- if (r === un)
1805
+ if (r === dn)
1804
1806
  break;
1805
- return t !== de && (de.slots[this.id] = r), !0;
1807
+ return t !== ce && (ce.slots[this.id] = r), !0;
1806
1808
  }
1807
- return de && (de.slots[this.id] = un), !1;
1809
+ return ce && (ce.slots[this.id] = dn), !1;
1808
1810
  }
1809
1811
  getValue() {
1810
1812
  if (this.hasValue())
1811
- return de.slots[this.id];
1813
+ return ce.slots[this.id];
1812
1814
  }
1813
1815
  withValue(t, r, n, o) {
1814
1816
  const s = {
1815
1817
  __proto__: null,
1816
1818
  [this.id]: t
1817
- }, i = de;
1818
- de = { parent: i, slots: s };
1819
+ }, i = ce;
1820
+ ce = { parent: i, slots: s };
1819
1821
  try {
1820
1822
  return r.apply(o, n);
1821
1823
  } finally {
1822
- de = i;
1824
+ ce = i;
1823
1825
  }
1824
1826
  }
1825
1827
  // Capture the current context and wrap a callback function so that it
1826
1828
  // reestablishes the captured context when called.
1827
1829
  static bind(t) {
1828
- const r = de;
1830
+ const r = ce;
1829
1831
  return function() {
1830
- const n = de;
1832
+ const n = ce;
1831
1833
  try {
1832
- return de = r, t.apply(this, arguments);
1834
+ return ce = r, t.apply(this, arguments);
1833
1835
  } finally {
1834
- de = n;
1836
+ ce = n;
1835
1837
  }
1836
1838
  };
1837
1839
  }
1838
1840
  // Immediately run a callback function without any captured context.
1839
1841
  static noContext(t, r, n) {
1840
- if (de) {
1841
- const o = de;
1842
+ if (ce) {
1843
+ const o = ce;
1842
1844
  try {
1843
- return de = null, t.apply(n, r);
1845
+ return ce = null, t.apply(n, r);
1844
1846
  } finally {
1845
- de = o;
1847
+ ce = o;
1846
1848
  }
1847
1849
  } else
1848
1850
  return t.apply(n, r);
1849
1851
  }
1850
1852
  };
1851
- function fn(e) {
1853
+ function un(e) {
1852
1854
  try {
1853
1855
  return e();
1854
1856
  } catch {
1855
1857
  }
1856
1858
  }
1857
- const ur = "@wry/context:Slot", Na = (
1859
+ const cr = "@wry/context:Slot", Na = (
1858
1860
  // Prefer globalThis when available.
1859
1861
  // https://github.com/benjamn/wryware/issues/347
1860
- fn(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
1862
+ un(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
1861
1863
  // bundlers to the appropriate identifier (window, self, ...) depending on the
1862
1864
  // bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
1863
- fn(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
1865
+ un(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
1864
1866
  // back to using the Array constructor as a namespace, but that was flagged in
1865
1867
  // https://github.com/benjamn/wryware/issues/347, and can be avoided.
1866
1868
  /* @__PURE__ */ Object.create(null)
1867
- ), mn = Na, Er = mn[ur] || // Earlier versions of this package stored the globalKey property on the Array
1869
+ ), fn = Na, Pr = fn[cr] || // Earlier versions of this package stored the globalKey property on the Array
1868
1870
  // constructor, so we check there as well, to prevent Slot class duplication.
1869
- Array[ur] || (function(e) {
1871
+ Array[cr] || (function(e) {
1870
1872
  try {
1871
- Object.defineProperty(mn, ur, {
1873
+ Object.defineProperty(fn, cr, {
1872
1874
  value: e,
1873
1875
  enumerable: !1,
1874
1876
  writable: !1,
@@ -1883,8 +1885,8 @@ Array[ur] || (function(e) {
1883
1885
  } finally {
1884
1886
  return e;
1885
1887
  }
1886
- })(Sa()), { bind: yi, noContext: xi } = Er;
1887
- new Er();
1888
+ })(Sa()), { bind: yi, noContext: xi } = Pr;
1889
+ new Pr();
1888
1890
  function Ca(e, t) {
1889
1891
  var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1890
1892
  if (r) return (r = r.call(e)).next.bind(r);
@@ -1900,61 +1902,61 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1900
1902
  }
1901
1903
  function _a(e, t) {
1902
1904
  if (e) {
1903
- if (typeof e == "string") return hn(e, t);
1905
+ if (typeof e == "string") return mn(e, t);
1904
1906
  var r = Object.prototype.toString.call(e).slice(8, -1);
1905
1907
  if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
1906
- if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return hn(e, t);
1908
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return mn(e, t);
1907
1909
  }
1908
1910
  }
1909
- function hn(e, t) {
1911
+ function mn(e, t) {
1910
1912
  (t == null || t > e.length) && (t = e.length);
1911
1913
  for (var r = 0, n = new Array(t); r < t; r++)
1912
1914
  n[r] = e[r];
1913
1915
  return n;
1914
1916
  }
1915
- function pn(e, t) {
1917
+ function hn(e, t) {
1916
1918
  for (var r = 0; r < t.length; r++) {
1917
1919
  var n = t[r];
1918
1920
  n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
1919
1921
  }
1920
1922
  }
1921
- function Tr(e, t, r) {
1922
- return t && pn(e.prototype, t), r && pn(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1923
+ function Fr(e, t, r) {
1924
+ return t && hn(e.prototype, t), r && hn(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1923
1925
  }
1924
- var Ar = function() {
1926
+ var Er = function() {
1925
1927
  return typeof Symbol == "function";
1926
- }, Or = function(e) {
1927
- return Ar() && !!Symbol[e];
1928
- }, jr = function(e) {
1929
- return Or(e) ? Symbol[e] : "@@" + e;
1928
+ }, Tr = function(e) {
1929
+ return Er() && !!Symbol[e];
1930
+ }, Ar = function(e) {
1931
+ return Tr(e) ? Symbol[e] : "@@" + e;
1930
1932
  };
1931
- Ar() && !Or("observable") && (Symbol.observable = Symbol("observable"));
1932
- var Ia = jr("iterator"), vr = jr("observable"), Qn = jr("species");
1933
- function nr(e, t) {
1933
+ Er() && !Tr("observable") && (Symbol.observable = Symbol("observable"));
1934
+ var Ia = Ar("iterator"), xr = Ar("observable"), Qn = Ar("species");
1935
+ function tr(e, t) {
1934
1936
  var r = e[t];
1935
1937
  if (r != null) {
1936
1938
  if (typeof r != "function") throw new TypeError(r + " is not a function");
1937
1939
  return r;
1938
1940
  }
1939
1941
  }
1940
- function Tt(e) {
1942
+ function Et(e) {
1941
1943
  var t = e.constructor;
1942
1944
  return t !== void 0 && (t = t[Qn], t === null && (t = void 0)), t !== void 0 ? t : we;
1943
1945
  }
1944
1946
  function Pa(e) {
1945
1947
  return e instanceof we;
1946
1948
  }
1947
- function bt(e) {
1948
- bt.log ? bt.log(e) : setTimeout(function() {
1949
+ function xt(e) {
1950
+ xt.log ? xt.log(e) : setTimeout(function() {
1949
1951
  throw e;
1950
1952
  });
1951
1953
  }
1952
- function Wt(e) {
1954
+ function Jt(e) {
1953
1955
  Promise.resolve().then(function() {
1954
1956
  try {
1955
1957
  e();
1956
1958
  } catch (t) {
1957
- bt(t);
1959
+ xt(t);
1958
1960
  }
1959
1961
  });
1960
1962
  }
@@ -1965,14 +1967,14 @@ function Gn(e) {
1965
1967
  if (typeof t == "function")
1966
1968
  t();
1967
1969
  else {
1968
- var r = nr(t, "unsubscribe");
1970
+ var r = tr(t, "unsubscribe");
1969
1971
  r && r.call(t);
1970
1972
  }
1971
1973
  } catch (n) {
1972
- bt(n);
1974
+ xt(n);
1973
1975
  }
1974
1976
  }
1975
- function kr(e) {
1977
+ function br(e) {
1976
1978
  e._observer = void 0, e._queue = void 0, e._state = "closed";
1977
1979
  }
1978
1980
  function Fa(e) {
@@ -1987,25 +1989,25 @@ function Xn(e, t, r) {
1987
1989
  e._state = "running";
1988
1990
  var n = e._observer;
1989
1991
  try {
1990
- var o = nr(n, t);
1992
+ var o = tr(n, t);
1991
1993
  switch (t) {
1992
1994
  case "next":
1993
1995
  o && o.call(n, r);
1994
1996
  break;
1995
1997
  case "error":
1996
- if (kr(e), o) o.call(n, r);
1998
+ if (br(e), o) o.call(n, r);
1997
1999
  else throw r;
1998
2000
  break;
1999
2001
  case "complete":
2000
- kr(e), o && o.call(n);
2002
+ br(e), o && o.call(n);
2001
2003
  break;
2002
2004
  }
2003
2005
  } catch (s) {
2004
- bt(s);
2006
+ xt(s);
2005
2007
  }
2006
2008
  e._state === "closed" ? Gn(e) : e._state === "running" && (e._state = "ready");
2007
2009
  }
2008
- function fr(e, t, r) {
2010
+ function dr(e, t, r) {
2009
2011
  if (e._state !== "closed") {
2010
2012
  if (e._state === "buffering") {
2011
2013
  e._queue.push({
@@ -2018,7 +2020,7 @@ function fr(e, t, r) {
2018
2020
  e._state = "buffering", e._queue = [{
2019
2021
  type: t,
2020
2022
  value: r
2021
- }], Wt(function() {
2023
+ }], Jt(function() {
2022
2024
  return Fa(e);
2023
2025
  });
2024
2026
  return;
@@ -2039,8 +2041,8 @@ var Ea = /* @__PURE__ */ (function() {
2039
2041
  }
2040
2042
  var t = e.prototype;
2041
2043
  return t.unsubscribe = function() {
2042
- this._state !== "closed" && (kr(this), Gn(this));
2043
- }, Tr(e, [{
2044
+ this._state !== "closed" && (br(this), Gn(this));
2045
+ }, Fr(e, [{
2044
2046
  key: "closed",
2045
2047
  get: function() {
2046
2048
  return this._state === "closed";
@@ -2052,12 +2054,12 @@ var Ea = /* @__PURE__ */ (function() {
2052
2054
  }
2053
2055
  var t = e.prototype;
2054
2056
  return t.next = function(n) {
2055
- fr(this._subscription, "next", n);
2057
+ dr(this._subscription, "next", n);
2056
2058
  }, t.error = function(n) {
2057
- fr(this._subscription, "error", n);
2059
+ dr(this._subscription, "error", n);
2058
2060
  }, t.complete = function() {
2059
- fr(this._subscription, "complete");
2060
- }, Tr(e, [{
2061
+ dr(this._subscription, "complete");
2062
+ }, Fr(e, [{
2061
2063
  key: "closed",
2062
2064
  get: function() {
2063
2065
  return this._subscription._state === "closed";
@@ -2101,7 +2103,7 @@ var Ea = /* @__PURE__ */ (function() {
2101
2103
  }, t.map = function(n) {
2102
2104
  var o = this;
2103
2105
  if (typeof n != "function") throw new TypeError(n + " is not a function");
2104
- var s = Tt(this);
2106
+ var s = Et(this);
2105
2107
  return new s(function(i) {
2106
2108
  return o.subscribe({
2107
2109
  next: function(c) {
@@ -2123,7 +2125,7 @@ var Ea = /* @__PURE__ */ (function() {
2123
2125
  }, t.filter = function(n) {
2124
2126
  var o = this;
2125
2127
  if (typeof n != "function") throw new TypeError(n + " is not a function");
2126
- var s = Tt(this);
2128
+ var s = Et(this);
2127
2129
  return new s(function(i) {
2128
2130
  return o.subscribe({
2129
2131
  next: function(c) {
@@ -2145,7 +2147,7 @@ var Ea = /* @__PURE__ */ (function() {
2145
2147
  }, t.reduce = function(n) {
2146
2148
  var o = this;
2147
2149
  if (typeof n != "function") throw new TypeError(n + " is not a function");
2148
- var s = Tt(this), i = arguments.length > 1, c = !1, l = arguments[1], p = l;
2150
+ var s = Et(this), i = arguments.length > 1, c = !1, l = arguments[1], p = l;
2149
2151
  return new s(function(g) {
2150
2152
  return o.subscribe({
2151
2153
  next: function(y) {
@@ -2171,7 +2173,7 @@ var Ea = /* @__PURE__ */ (function() {
2171
2173
  }, t.concat = function() {
2172
2174
  for (var n = this, o = arguments.length, s = new Array(o), i = 0; i < o; i++)
2173
2175
  s[i] = arguments[i];
2174
- var c = Tt(this);
2176
+ var c = Et(this);
2175
2177
  return new c(function(l) {
2176
2178
  var p, g = 0;
2177
2179
  function y(x) {
@@ -2194,7 +2196,7 @@ var Ea = /* @__PURE__ */ (function() {
2194
2196
  }, t.flatMap = function(n) {
2195
2197
  var o = this;
2196
2198
  if (typeof n != "function") throw new TypeError(n + " is not a function");
2197
- var s = Tt(this);
2199
+ var s = Et(this);
2198
2200
  return new s(function(i) {
2199
2201
  var c = [], l = o.subscribe({
2200
2202
  next: function(g) {
@@ -2234,12 +2236,12 @@ var Ea = /* @__PURE__ */ (function() {
2234
2236
  }), l.unsubscribe();
2235
2237
  };
2236
2238
  });
2237
- }, t[vr] = function() {
2239
+ }, t[xr] = function() {
2238
2240
  return this;
2239
2241
  }, e.from = function(n) {
2240
2242
  var o = typeof this == "function" ? this : e;
2241
2243
  if (n == null) throw new TypeError(n + " is not an object");
2242
- var s = nr(n, vr);
2244
+ var s = tr(n, xr);
2243
2245
  if (s) {
2244
2246
  var i = s.call(n);
2245
2247
  if (Object(i) !== i) throw new TypeError(i + " is not an object");
@@ -2247,9 +2249,9 @@ var Ea = /* @__PURE__ */ (function() {
2247
2249
  return i.subscribe(c);
2248
2250
  });
2249
2251
  }
2250
- if (Or("iterator") && (s = nr(n, Ia), s))
2252
+ if (Tr("iterator") && (s = tr(n, Ia), s))
2251
2253
  return new o(function(c) {
2252
- Wt(function() {
2254
+ Jt(function() {
2253
2255
  if (!c.closed) {
2254
2256
  for (var l = Ca(s.call(n)), p; !(p = l()).done; ) {
2255
2257
  var g = p.value;
@@ -2261,7 +2263,7 @@ var Ea = /* @__PURE__ */ (function() {
2261
2263
  });
2262
2264
  if (Array.isArray(n))
2263
2265
  return new o(function(c) {
2264
- Wt(function() {
2266
+ Jt(function() {
2265
2267
  if (!c.closed) {
2266
2268
  for (var l = 0; l < n.length; ++l)
2267
2269
  if (c.next(n[l]), c.closed) return;
@@ -2275,7 +2277,7 @@ var Ea = /* @__PURE__ */ (function() {
2275
2277
  o[s] = arguments[s];
2276
2278
  var i = typeof this == "function" ? this : e;
2277
2279
  return new i(function(c) {
2278
- Wt(function() {
2280
+ Jt(function() {
2279
2281
  if (!c.closed) {
2280
2282
  for (var l = 0; l < o.length; ++l)
2281
2283
  if (c.next(o[l]), c.closed) return;
@@ -2283,17 +2285,17 @@ var Ea = /* @__PURE__ */ (function() {
2283
2285
  }
2284
2286
  });
2285
2287
  });
2286
- }, Tr(e, null, [{
2288
+ }, Fr(e, null, [{
2287
2289
  key: Qn,
2288
2290
  get: function() {
2289
2291
  return this;
2290
2292
  }
2291
2293
  }]), e;
2292
2294
  })();
2293
- Ar() && Object.defineProperty(we, Symbol("extensions"), {
2295
+ Er() && Object.defineProperty(we, Symbol("extensions"), {
2294
2296
  value: {
2295
- symbol: vr,
2296
- hostReportError: bt
2297
+ symbol: xr,
2298
+ hostReportError: xt
2297
2299
  },
2298
2300
  configurable: !0
2299
2301
  });
@@ -2313,11 +2315,11 @@ function Aa(e) {
2313
2315
  t = "@@observable";
2314
2316
  return t;
2315
2317
  }
2316
- var xt;
2317
- typeof self < "u" ? xt = self : typeof window < "u" ? xt = window : typeof global < "u" ? xt = global : typeof module < "u" ? xt = module : xt = Function("return this")();
2318
- Aa(xt);
2319
- var gn = we.prototype, wn = "@@observable";
2320
- gn[wn] || (gn[wn] = function() {
2318
+ var wt;
2319
+ typeof self < "u" ? wt = self : typeof window < "u" ? wt = window : typeof global < "u" ? wt = global : typeof module < "u" ? wt = module : wt = Function("return this")();
2320
+ Aa(wt);
2321
+ var pn = we.prototype, gn = "@@observable";
2322
+ pn[gn] || (pn[gn] = function() {
2321
2323
  return this;
2322
2324
  });
2323
2325
  function Oa(e) {
@@ -2335,10 +2337,10 @@ function Oa(e) {
2335
2337
  return e;
2336
2338
  }
2337
2339
  function ja(e, t) {
2338
- var r = Ge({}, e), n = function(s) {
2339
- typeof s == "function" ? r = Ge(Ge({}, r), s(r)) : r = Ge(Ge({}, r), s);
2340
+ var r = Qe({}, e), n = function(s) {
2341
+ typeof s == "function" ? r = Qe(Qe({}, r), s(r)) : r = Qe(Qe({}, r), s);
2340
2342
  }, o = function() {
2341
- return Ge({}, r);
2343
+ return Qe({}, r);
2342
2344
  };
2343
2345
  return Object.defineProperty(t, "setContext", {
2344
2346
  enumerable: !1,
@@ -2357,20 +2359,20 @@ function $a(e) {
2357
2359
  };
2358
2360
  return t.operationName || (t.operationName = typeof t.query != "string" ? va(t.query) || void 0 : ""), t;
2359
2361
  }
2360
- var La = Symbol.for("apollo.deprecations"), za = br, Da = new Er();
2362
+ var La = Symbol.for("apollo.deprecations"), za = yr, Da = new Pr();
2361
2363
  function Ma(e) {
2362
2364
  return za[La] || (Da.getValue() || []).includes(e);
2363
2365
  }
2364
2366
  function Ba(e, t) {
2365
2367
  Ma(e) || t();
2366
2368
  }
2367
- function yn(e, t) {
2369
+ function wn(e, t) {
2368
2370
  return t ? t(e) : we.of();
2369
2371
  }
2370
- function At(e) {
2372
+ function Tt(e) {
2371
2373
  return typeof e == "function" ? new Zn(e) : e;
2372
2374
  }
2373
- function Kt(e) {
2375
+ function Yt(e) {
2374
2376
  return e.request.length <= 1;
2375
2377
  }
2376
2378
  var Zn = (
@@ -2384,12 +2386,12 @@ var Zn = (
2384
2386
  return we.of();
2385
2387
  });
2386
2388
  }, e.from = function(t) {
2387
- return t.length === 0 ? e.empty() : t.map(At).reduce(function(r, n) {
2389
+ return t.length === 0 ? e.empty() : t.map(Tt).reduce(function(r, n) {
2388
2390
  return r.concat(n);
2389
2391
  });
2390
2392
  }, e.split = function(t, r, n) {
2391
- var o = At(r), s = At(n || new e(yn)), i;
2392
- return Kt(o) && Kt(s) ? i = new e(function(c) {
2393
+ var o = Tt(r), s = Tt(n || new e(wn)), i;
2394
+ return Yt(o) && Yt(s) ? i = new e(function(c) {
2393
2395
  return t(c) ? o.request(c) || we.of() : s.request(c) || we.of();
2394
2396
  }) : i = new e(function(c, l) {
2395
2397
  return t(c) ? o.request(c, l) || we.of() : s.request(c, l) || we.of();
@@ -2397,11 +2399,11 @@ var Zn = (
2397
2399
  }, e.execute = function(t, r) {
2398
2400
  return t.request(ja(r.context, $a(Oa(r)))) || we.of();
2399
2401
  }, e.concat = function(t, r) {
2400
- var n = At(t);
2401
- if (Kt(n))
2402
- return globalThis.__DEV__ !== !1 && dr.warn(47, n), n;
2403
- var o = At(r), s;
2404
- return Kt(o) ? s = new e(function(i) {
2402
+ var n = Tt(t);
2403
+ if (Yt(n))
2404
+ return globalThis.__DEV__ !== !1 && lr.warn(47, n), n;
2405
+ var o = Tt(r), s;
2406
+ return Yt(o) ? s = new e(function(i) {
2405
2407
  return n.request(i, function(c) {
2406
2408
  return o.request(c) || we.of();
2407
2409
  }) || we.of();
@@ -2411,19 +2413,19 @@ var Zn = (
2411
2413
  }) || we.of();
2412
2414
  }), Object.assign(s, { left: n, right: o });
2413
2415
  }, e.prototype.split = function(t, r, n) {
2414
- return this.concat(e.split(t, r, n || new e(yn)));
2416
+ return this.concat(e.split(t, r, n || new e(wn)));
2415
2417
  }, e.prototype.concat = function(t) {
2416
2418
  return e.concat(this, t);
2417
2419
  }, e.prototype.request = function(t, r) {
2418
2420
  throw Kn(48);
2419
2421
  }, e.prototype.onError = function(t, r) {
2420
2422
  if (globalThis.__DEV__ !== !1 && Ba("onError", function() {
2421
- globalThis.__DEV__ !== !1 && dr.warn(49);
2423
+ globalThis.__DEV__ !== !1 && lr.warn(49);
2422
2424
  }), r && r.error)
2423
2425
  return r.error(t), !1;
2424
2426
  throw t;
2425
2427
  }, e.prototype.setOnError = function(t) {
2426
- return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 && dr.warn(50), this.onError = t, this;
2428
+ return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 && lr.warn(50), this.onError = t, this;
2427
2429
  }, e;
2428
2430
  })()
2429
2431
  );
@@ -2504,15 +2506,15 @@ const eo = Object.freeze({
2504
2506
  top: 0,
2505
2507
  width: 16,
2506
2508
  height: 16
2507
- }), or = Object.freeze({
2509
+ }), rr = Object.freeze({
2508
2510
  rotate: 0,
2509
2511
  vFlip: !1,
2510
2512
  hFlip: !1
2511
- }), $r = Object.freeze({
2513
+ }), Or = Object.freeze({
2512
2514
  ...eo,
2513
- ...or
2514
- }), Sr = Object.freeze({
2515
- ...$r,
2515
+ ...rr
2516
+ }), vr = Object.freeze({
2517
+ ...Or,
2516
2518
  body: "",
2517
2519
  hidden: !1
2518
2520
  });
@@ -2522,18 +2524,18 @@ function Ka(e, t) {
2522
2524
  const n = ((e.rotate || 0) + (t.rotate || 0)) % 4;
2523
2525
  return n && (r.rotate = n), r;
2524
2526
  }
2525
- function xn(e, t) {
2527
+ function yn(e, t) {
2526
2528
  const r = Ka(e, t);
2527
- for (const n in Sr) n in or ? n in e && !(n in r) && (r[n] = or[n]) : n in t ? r[n] = t[n] : n in e && (r[n] = e[n]);
2529
+ for (const n in vr) n in rr ? n in e && !(n in r) && (r[n] = rr[n]) : n in t ? r[n] = t[n] : n in e && (r[n] = e[n]);
2528
2530
  return r;
2529
2531
  }
2530
2532
  function Wa(e, t, r) {
2531
2533
  const n = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null);
2532
2534
  let s = {};
2533
2535
  function i(c) {
2534
- s = xn(n[c] || o[c], s);
2536
+ s = yn(n[c] || o[c], s);
2535
2537
  }
2536
- return i(t), r.forEach(i), xn(e, s);
2538
+ return i(t), r.forEach(i), yn(e, s);
2537
2539
  }
2538
2540
  function to(e, t) {
2539
2541
  const r = [];
@@ -2554,27 +2556,27 @@ const Qa = {
2554
2556
  not_found: {},
2555
2557
  ...eo
2556
2558
  };
2557
- function mr(e, t) {
2559
+ function ur(e, t) {
2558
2560
  for (const r in t) if (r in e && typeof e[r] != typeof t[r]) return !1;
2559
2561
  return !0;
2560
2562
  }
2561
2563
  function ro(e) {
2562
2564
  if (typeof e != "object" || e === null) return null;
2563
2565
  const t = e;
2564
- if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !mr(e, Qa)) return null;
2566
+ if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !ur(e, Qa)) return null;
2565
2567
  const r = t.icons;
2566
2568
  for (const o in r) {
2567
2569
  const s = r[o];
2568
- if (!o || typeof s.body != "string" || !mr(s, Sr)) return null;
2570
+ if (!o || typeof s.body != "string" || !ur(s, vr)) return null;
2569
2571
  }
2570
2572
  const n = t.aliases || /* @__PURE__ */ Object.create(null);
2571
2573
  for (const o in n) {
2572
2574
  const s = n[o], i = s.parent;
2573
- if (!o || typeof i != "string" || !r[i] && !n[i] || !mr(s, Sr)) return null;
2575
+ if (!o || typeof i != "string" || !r[i] && !n[i] || !ur(s, vr)) return null;
2574
2576
  }
2575
2577
  return t;
2576
2578
  }
2577
- const bn = /* @__PURE__ */ Object.create(null);
2579
+ const xn = /* @__PURE__ */ Object.create(null);
2578
2580
  function Ga(e, t) {
2579
2581
  return {
2580
2582
  provider: e,
@@ -2583,8 +2585,8 @@ function Ga(e, t) {
2583
2585
  missing: /* @__PURE__ */ new Set()
2584
2586
  };
2585
2587
  }
2586
- function vt(e, t) {
2587
- const r = bn[e] || (bn[e] = /* @__PURE__ */ Object.create(null));
2588
+ function bt(e, t) {
2589
+ const r = xn[e] || (xn[e] = /* @__PURE__ */ Object.create(null));
2588
2590
  return r[t] || (r[t] = Ga(e, t));
2589
2591
  }
2590
2592
  function no(e, t) {
@@ -2600,7 +2602,7 @@ function Xa(e, t, r) {
2600
2602
  }
2601
2603
  return !1;
2602
2604
  }
2603
- const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, ar = (e, t, r, n = "") => {
2605
+ const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, nr = (e, t, r, n = "") => {
2604
2606
  const o = e.split(":");
2605
2607
  if (e.slice(0, 1) === "@") {
2606
2608
  if (o.length < 2 || o.length > 3) return null;
@@ -2613,7 +2615,7 @@ const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, ar = (e, t, r, n = "") => {
2613
2615
  prefix: l,
2614
2616
  name: c
2615
2617
  };
2616
- return t && !Qt(p) ? null : p;
2618
+ return t && !Kt(p) ? null : p;
2617
2619
  }
2618
2620
  const s = o[0], i = s.split("-");
2619
2621
  if (i.length > 1) {
@@ -2622,7 +2624,7 @@ const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, ar = (e, t, r, n = "") => {
2622
2624
  prefix: i.shift(),
2623
2625
  name: i.join("-")
2624
2626
  };
2625
- return t && !Qt(c) ? null : c;
2627
+ return t && !Kt(c) ? null : c;
2626
2628
  }
2627
2629
  if (r && n === "") {
2628
2630
  const c = {
@@ -2630,41 +2632,41 @@ const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, ar = (e, t, r, n = "") => {
2630
2632
  prefix: "",
2631
2633
  name: s
2632
2634
  };
2633
- return t && !Qt(c, r) ? null : c;
2635
+ return t && !Kt(c, r) ? null : c;
2634
2636
  }
2635
2637
  return null;
2636
- }, Qt = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
2637
- let Dt = !1;
2638
+ }, Kt = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
2639
+ let zt = !1;
2638
2640
  function ao(e) {
2639
- return typeof e == "boolean" && (Dt = e), Dt;
2641
+ return typeof e == "boolean" && (zt = e), zt;
2640
2642
  }
2641
- function vn(e) {
2642
- const t = typeof e == "string" ? ar(e, !0, Dt) : e;
2643
+ function bn(e) {
2644
+ const t = typeof e == "string" ? nr(e, !0, zt) : e;
2643
2645
  if (t) {
2644
- const r = vt(t.provider, t.prefix), n = t.name;
2646
+ const r = bt(t.provider, t.prefix), n = t.name;
2645
2647
  return r.icons[n] || (r.missing.has(n) ? null : void 0);
2646
2648
  }
2647
2649
  }
2648
2650
  function Za(e, t) {
2649
- const r = ar(e, !0, Dt);
2651
+ const r = nr(e, !0, zt);
2650
2652
  if (!r) return !1;
2651
- const n = vt(r.provider, r.prefix);
2653
+ const n = bt(r.provider, r.prefix);
2652
2654
  return t ? Xa(n, r.name, t) : (n.missing.add(r.name), !0);
2653
2655
  }
2654
2656
  function es(e, t) {
2655
2657
  if (typeof e != "object") return !1;
2656
- if (typeof t != "string" && (t = e.provider || ""), Dt && !t && !e.prefix) {
2658
+ if (typeof t != "string" && (t = e.provider || ""), zt && !t && !e.prefix) {
2657
2659
  let o = !1;
2658
2660
  return ro(e) && (e.prefix = "", to(e, (s, i) => {
2659
2661
  Za(s, i) && (o = !0);
2660
2662
  })), o;
2661
2663
  }
2662
2664
  const r = e.prefix;
2663
- if (!Qt({
2665
+ if (!Kt({
2664
2666
  prefix: r,
2665
2667
  name: "a"
2666
2668
  })) return !1;
2667
- const n = vt(t, r);
2669
+ const n = bt(t, r);
2668
2670
  return !!no(n, e);
2669
2671
  }
2670
2672
  const so = Object.freeze({
@@ -2672,9 +2674,9 @@ const so = Object.freeze({
2672
2674
  height: null
2673
2675
  }), io = Object.freeze({
2674
2676
  ...so,
2675
- ...or
2677
+ ...rr
2676
2678
  }), ts = /(-?[0-9.]*[0-9]+[0-9.]*)/g, rs = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
2677
- function kn(e, t, r) {
2679
+ function vn(e, t, r) {
2678
2680
  if (t === 1) return e;
2679
2681
  if (r = r || 100, typeof e == "number") return Math.ceil(e * t * r) / r;
2680
2682
  if (typeof e != "string") return e;
@@ -2716,7 +2718,7 @@ function as(e, t, r) {
2716
2718
  const ss = (e) => e === "unset" || e === "undefined" || e === "none";
2717
2719
  function is(e, t) {
2718
2720
  const r = {
2719
- ...$r,
2721
+ ...Or,
2720
2722
  ...e
2721
2723
  }, n = {
2722
2724
  ...io,
@@ -2728,9 +2730,9 @@ function is(e, t) {
2728
2730
  height: r.height
2729
2731
  };
2730
2732
  let s = r.body;
2731
- [r, n].forEach((A) => {
2732
- const k = [], P = A.hFlip, J = A.vFlip;
2733
- let q = A.rotate;
2733
+ [r, n].forEach((T) => {
2734
+ const k = [], P = T.hFlip, J = T.vFlip;
2735
+ let q = T.rotate;
2734
2736
  P ? J ? q += 2 : (k.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), k.push("scale(-1 1)"), o.top = o.left = 0) : J && (k.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), k.push("scale(1 -1)"), o.top = o.left = 0);
2735
2737
  let Y;
2736
2738
  switch (q < 0 && (q -= Math.floor(q / 4) * 4), q = q % 4, q) {
@@ -2748,9 +2750,9 @@ function is(e, t) {
2748
2750
  });
2749
2751
  const i = n.width, c = n.height, l = o.width, p = o.height;
2750
2752
  let g, y;
2751
- i === null ? (y = c === null ? "1em" : c === "auto" ? p : c, g = kn(y, l / p)) : (g = i === "auto" ? l : i, y = c === null ? kn(g, p / l) : c === "auto" ? p : c);
2752
- const x = {}, I = (A, k) => {
2753
- ss(k) || (x[A] = k.toString());
2753
+ i === null ? (y = c === null ? "1em" : c === "auto" ? p : c, g = vn(y, l / p)) : (g = i === "auto" ? l : i, y = c === null ? vn(g, p / l) : c === "auto" ? p : c);
2754
+ const x = {}, I = (T, k) => {
2755
+ ss(k) || (x[T] = k.toString());
2754
2756
  };
2755
2757
  I("width", g), I("height", y);
2756
2758
  const S = [
@@ -2778,14 +2780,14 @@ function us(e, t = cs) {
2778
2780
  e = e.replace(new RegExp('([#;"])(' + c + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
2779
2781
  }), e = e.replace(new RegExp(o, "g"), ""), e;
2780
2782
  }
2781
- const Nr = /* @__PURE__ */ Object.create(null);
2783
+ const kr = /* @__PURE__ */ Object.create(null);
2782
2784
  function fs(e, t) {
2783
- Nr[e] = t;
2785
+ kr[e] = t;
2784
2786
  }
2785
- function Cr(e) {
2786
- return Nr[e] || Nr[""];
2787
+ function Sr(e) {
2788
+ return kr[e] || kr[""];
2787
2789
  }
2788
- function Lr(e) {
2790
+ function jr(e) {
2789
2791
  let t;
2790
2792
  if (typeof e.resources == "string") t = [e.resources];
2791
2793
  else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
@@ -2800,15 +2802,15 @@ function Lr(e) {
2800
2802
  dataAfterTimeout: e.dataAfterTimeout !== !1
2801
2803
  };
2802
2804
  }
2803
- const zr = /* @__PURE__ */ Object.create(null), Ot = ["https://api.simplesvg.com", "https://api.unisvg.com"], Gt = [];
2804
- for (; Ot.length > 0; ) Ot.length === 1 || Math.random() > 0.5 ? Gt.push(Ot.shift()) : Gt.push(Ot.pop());
2805
- zr[""] = Lr({ resources: ["https://api.iconify.design"].concat(Gt) });
2805
+ const $r = /* @__PURE__ */ Object.create(null), At = ["https://api.simplesvg.com", "https://api.unisvg.com"], Wt = [];
2806
+ for (; At.length > 0; ) At.length === 1 || Math.random() > 0.5 ? Wt.push(At.shift()) : Wt.push(At.pop());
2807
+ $r[""] = jr({ resources: ["https://api.iconify.design"].concat(Wt) });
2806
2808
  function ms(e, t) {
2807
- const r = Lr(t);
2808
- return r === null ? !1 : (zr[e] = r, !0);
2809
+ const r = jr(t);
2810
+ return r === null ? !1 : ($r[e] = r, !0);
2809
2811
  }
2810
- function Dr(e) {
2811
- return zr[e];
2812
+ function Lr(e) {
2813
+ return $r[e];
2812
2814
  }
2813
2815
  const hs = () => {
2814
2816
  let e;
@@ -2817,9 +2819,9 @@ const hs = () => {
2817
2819
  } catch {
2818
2820
  }
2819
2821
  };
2820
- let Sn = hs();
2822
+ let kn = hs();
2821
2823
  function ps(e, t) {
2822
- const r = Dr(e);
2824
+ const r = Lr(e);
2823
2825
  if (!r) return 0;
2824
2826
  let n;
2825
2827
  if (!r.maxURL) n = 0;
@@ -2855,13 +2857,13 @@ const ws = (e, t, r) => {
2855
2857
  };
2856
2858
  function ys(e) {
2857
2859
  if (typeof e == "string") {
2858
- const t = Dr(e);
2860
+ const t = Lr(e);
2859
2861
  if (t) return t.path;
2860
2862
  }
2861
2863
  return "/";
2862
2864
  }
2863
2865
  const xs = (e, t, r) => {
2864
- if (!Sn) {
2866
+ if (!kn) {
2865
2867
  r("abort", 424);
2866
2868
  return;
2867
2869
  }
@@ -2882,7 +2884,7 @@ const xs = (e, t, r) => {
2882
2884
  return;
2883
2885
  }
2884
2886
  let o = 503;
2885
- Sn(e + n).then((s) => {
2887
+ kn(e + n).then((s) => {
2886
2888
  const i = s.status;
2887
2889
  if (i !== 200) {
2888
2890
  setTimeout(() => {
@@ -2972,7 +2974,7 @@ function Ns(e) {
2972
2974
  return e.forEach((o) => {
2973
2975
  if (n.name === o.name && n.prefix === o.prefix && n.provider === o.provider) return;
2974
2976
  n = o;
2975
- const s = o.provider, i = o.prefix, c = o.name, l = r[s] || (r[s] = /* @__PURE__ */ Object.create(null)), p = l[i] || (l[i] = vt(s, i));
2977
+ const s = o.provider, i = o.prefix, c = o.name, l = r[s] || (r[s] = /* @__PURE__ */ Object.create(null)), p = l[i] || (l[i] = bt(s, i));
2976
2978
  let g;
2977
2979
  c in p.icons ? g = t.loaded : i === "" || p.missing.has(c) ? g = t.missing : g = t.pending;
2978
2980
  const y = {
@@ -2986,7 +2988,7 @@ function Ns(e) {
2986
2988
  function Cs(e, t = !0, r = !1) {
2987
2989
  const n = [];
2988
2990
  return e.forEach((o) => {
2989
- const s = typeof o == "string" ? ar(o, t, r) : o;
2991
+ const s = typeof o == "string" ? nr(o, t, r) : o;
2990
2992
  s && n.push(s);
2991
2993
  }), n;
2992
2994
  }
@@ -3015,7 +3017,7 @@ function Is(e, t, r, n) {
3015
3017
  function S() {
3016
3018
  y && (clearTimeout(y), y = null);
3017
3019
  }
3018
- function A() {
3020
+ function T() {
3019
3021
  l === "pending" && (l = "aborted"), S(), x.forEach((C) => {
3020
3022
  C.status === "pending" && (C.status = "aborted");
3021
3023
  }), x = [];
@@ -3031,7 +3033,7 @@ function Is(e, t, r, n) {
3031
3033
  queriesSent: p,
3032
3034
  queriesPending: x.length,
3033
3035
  subscribe: k,
3034
- abort: A
3036
+ abort: T
3035
3037
  };
3036
3038
  }
3037
3039
  function J() {
@@ -3124,41 +3126,41 @@ function co(e) {
3124
3126
  cleanup: n
3125
3127
  };
3126
3128
  }
3127
- function Nn() {
3129
+ function Sn() {
3128
3130
  }
3129
- const hr = /* @__PURE__ */ Object.create(null);
3131
+ const fr = /* @__PURE__ */ Object.create(null);
3130
3132
  function Ps(e) {
3131
- if (!hr[e]) {
3132
- const t = Dr(e);
3133
+ if (!fr[e]) {
3134
+ const t = Lr(e);
3133
3135
  if (!t) return;
3134
3136
  const r = co(t), n = {
3135
3137
  config: t,
3136
3138
  redundancy: r
3137
3139
  };
3138
- hr[e] = n;
3140
+ fr[e] = n;
3139
3141
  }
3140
- return hr[e];
3142
+ return fr[e];
3141
3143
  }
3142
3144
  function Fs(e, t, r) {
3143
3145
  let n, o;
3144
3146
  if (typeof e == "string") {
3145
- const s = Cr(e);
3147
+ const s = Sr(e);
3146
3148
  if (!s)
3147
- return r(void 0, 424), Nn;
3149
+ return r(void 0, 424), Sn;
3148
3150
  o = s.send;
3149
3151
  const i = Ps(e);
3150
3152
  i && (n = i.redundancy);
3151
3153
  } else {
3152
- const s = Lr(e);
3154
+ const s = jr(e);
3153
3155
  if (s) {
3154
3156
  n = co(s);
3155
- const i = e.resources ? e.resources[0] : "", c = Cr(i);
3157
+ const i = e.resources ? e.resources[0] : "", c = Sr(i);
3156
3158
  c && (o = c.send);
3157
3159
  }
3158
3160
  }
3159
- return !n || !o ? (r(void 0, 424), Nn) : n.query(t, o, r)().abort;
3161
+ return !n || !o ? (r(void 0, 424), Sn) : n.query(t, o, r)().abort;
3160
3162
  }
3161
- function Cn() {
3163
+ function Nn() {
3162
3164
  }
3163
3165
  function Es(e) {
3164
3166
  e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
@@ -3174,7 +3176,7 @@ function Ts(e) {
3174
3176
  invalid: r
3175
3177
  };
3176
3178
  }
3177
- function jt(e, t, r) {
3179
+ function Ot(e, t, r) {
3178
3180
  function n() {
3179
3181
  const o = e.pendingIcons;
3180
3182
  t.forEach((s) => {
@@ -3191,7 +3193,7 @@ function jt(e, t, r) {
3191
3193
  }
3192
3194
  n(), Es(e);
3193
3195
  }
3194
- function _n(e, t) {
3196
+ function Cn(e, t) {
3195
3197
  e instanceof Promise ? e.then((r) => {
3196
3198
  t(r);
3197
3199
  }).catch(() => {
@@ -3205,34 +3207,34 @@ function As(e, t) {
3205
3207
  if (delete e.iconsToLoad, !o || !o.length) return;
3206
3208
  const s = e.loadIcon;
3207
3209
  if (e.loadIcons && (o.length > 1 || !s)) {
3208
- _n(e.loadIcons(o, n, r), (g) => {
3209
- jt(e, o, g);
3210
+ Cn(e.loadIcons(o, n, r), (g) => {
3211
+ Ot(e, o, g);
3210
3212
  });
3211
3213
  return;
3212
3214
  }
3213
3215
  if (s) {
3214
3216
  o.forEach((g) => {
3215
3217
  const y = s(g, n, r);
3216
- _n(y, (x) => {
3218
+ Cn(y, (x) => {
3217
3219
  const I = x ? {
3218
3220
  prefix: n,
3219
3221
  icons: { [g]: x }
3220
3222
  } : null;
3221
- jt(e, [g], I);
3223
+ Ot(e, [g], I);
3222
3224
  });
3223
3225
  });
3224
3226
  return;
3225
3227
  }
3226
3228
  const { valid: i, invalid: c } = Ts(o);
3227
- if (c.length && jt(e, c, null), !i.length) return;
3228
- const l = n.match(oo) ? Cr(r) : null;
3229
+ if (c.length && Ot(e, c, null), !i.length) return;
3230
+ const l = n.match(oo) ? Sr(r) : null;
3229
3231
  if (!l) {
3230
- jt(e, i, null);
3232
+ Ot(e, i, null);
3231
3233
  return;
3232
3234
  }
3233
3235
  l.prepare(r, n, i).forEach((g) => {
3234
3236
  Fs(r, g, (y) => {
3235
- jt(e, g.icons, y);
3237
+ Ot(e, g.icons, y);
3236
3238
  });
3237
3239
  });
3238
3240
  }));
@@ -3242,7 +3244,7 @@ const Os = (e, t) => {
3242
3244
  if (!n.pending.length) {
3243
3245
  let l = !0;
3244
3246
  return t && setTimeout(() => {
3245
- l && t(n.loaded, n.missing, n.pending, Cn);
3247
+ l && t(n.loaded, n.missing, n.pending, Nn);
3246
3248
  }), () => {
3247
3249
  l = !1;
3248
3250
  };
@@ -3252,16 +3254,16 @@ const Os = (e, t) => {
3252
3254
  return n.pending.forEach((l) => {
3253
3255
  const { provider: p, prefix: g } = l;
3254
3256
  if (g === c && p === i) return;
3255
- i = p, c = g, s.push(vt(p, g));
3257
+ i = p, c = g, s.push(bt(p, g));
3256
3258
  const y = o[p] || (o[p] = /* @__PURE__ */ Object.create(null));
3257
3259
  y[g] || (y[g] = []);
3258
3260
  }), n.pending.forEach((l) => {
3259
- const { provider: p, prefix: g, name: y } = l, x = vt(p, g), I = x.pendingIcons || (x.pendingIcons = /* @__PURE__ */ new Set());
3261
+ const { provider: p, prefix: g, name: y } = l, x = bt(p, g), I = x.pendingIcons || (x.pendingIcons = /* @__PURE__ */ new Set());
3260
3262
  I.has(y) || (I.add(y), o[p][g].push(y));
3261
3263
  }), s.forEach((l) => {
3262
3264
  const p = o[l.provider][l.prefix];
3263
3265
  p.length && As(l, p);
3264
- }), t ? Ss(t, n, s) : Cn;
3266
+ }), t ? Ss(t, n, s) : Nn;
3265
3267
  };
3266
3268
  function js(e, t) {
3267
3269
  const r = { ...e };
@@ -3323,16 +3325,16 @@ function Bs(e) {
3323
3325
  function Us(e) {
3324
3326
  return 'url("' + Bs(e) + '")';
3325
3327
  }
3326
- let $t;
3328
+ let jt;
3327
3329
  function qs() {
3328
3330
  try {
3329
- $t = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
3331
+ jt = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
3330
3332
  } catch {
3331
- $t = null;
3333
+ jt = null;
3332
3334
  }
3333
3335
  }
3334
3336
  function Rs(e) {
3335
- return $t === void 0 && qs(), $t ? $t.createHTML(e) : e;
3337
+ return jt === void 0 && qs(), jt ? jt.createHTML(e) : e;
3336
3338
  }
3337
3339
  const uo = {
3338
3340
  ...io,
@@ -3344,29 +3346,29 @@ const uo = {
3344
3346
  role: "img"
3345
3347
  }, Vs = {
3346
3348
  display: "inline-block"
3347
- }, _r = {
3349
+ }, Nr = {
3348
3350
  backgroundColor: "currentColor"
3349
3351
  }, fo = {
3350
3352
  backgroundColor: "transparent"
3351
- }, In = {
3353
+ }, _n = {
3352
3354
  Image: "var(--svg)",
3353
3355
  Repeat: "no-repeat",
3354
3356
  Size: "100% 100%"
3355
- }, Pn = {
3356
- WebkitMask: _r,
3357
- mask: _r,
3357
+ }, In = {
3358
+ WebkitMask: Nr,
3359
+ mask: Nr,
3358
3360
  background: fo
3359
3361
  };
3360
- for (const e in Pn) {
3361
- const t = Pn[e];
3362
- for (const r in In)
3363
- t[e + r] = In[r];
3362
+ for (const e in In) {
3363
+ const t = In[e];
3364
+ for (const r in _n)
3365
+ t[e + r] = _n[r];
3364
3366
  }
3365
3367
  const Ys = {
3366
3368
  ...uo,
3367
3369
  inline: !0
3368
3370
  };
3369
- function Fn(e) {
3371
+ function Pn(e) {
3370
3372
  return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
3371
3373
  }
3372
3374
  const Js = (e, t, r) => {
@@ -3374,7 +3376,7 @@ const Js = (e, t, r) => {
3374
3376
  ...s === "svg" ? Hs : {}
3375
3377
  };
3376
3378
  if (r) {
3377
- const k = ar(r, !1, !0);
3379
+ const k = nr(r, !1, !0);
3378
3380
  if (k) {
3379
3381
  const P = ["iconify"], J = [
3380
3382
  "provider",
@@ -3443,22 +3445,22 @@ const Js = (e, t, r) => {
3443
3445
  let k = 0, P = t.id;
3444
3446
  return typeof P == "string" && (P = P.replace(/-/g, "_")), l.dangerouslySetInnerHTML = {
3445
3447
  __html: Rs(us(p.body, P ? () => P + "ID" + k++ : "iconifyReact"))
3446
- }, pr("svg", l);
3448
+ }, mr("svg", l);
3447
3449
  }
3448
- const { body: y, width: x, height: I } = e, S = s === "mask" || (s === "bg" ? !1 : y.indexOf("currentColor") !== -1), A = Ds(y, {
3450
+ const { body: y, width: x, height: I } = e, S = s === "mask" || (s === "bg" ? !1 : y.indexOf("currentColor") !== -1), T = Ds(y, {
3449
3451
  ...g,
3450
3452
  width: x + "",
3451
3453
  height: I + ""
3452
3454
  });
3453
3455
  return l.style = {
3454
3456
  ...i,
3455
- "--svg": Us(A),
3456
- width: Fn(g.width),
3457
- height: Fn(g.height),
3457
+ "--svg": Us(T),
3458
+ width: Pn(g.width),
3459
+ height: Pn(g.height),
3458
3460
  ...Vs,
3459
- ...S ? _r : fo,
3461
+ ...S ? Nr : fo,
3460
3462
  ...c
3461
- }, pr("span", l);
3463
+ }, mr("span", l);
3462
3464
  };
3463
3465
  ao(!0);
3464
3466
  fs("", bs);
@@ -3503,11 +3505,11 @@ function mo(e) {
3503
3505
  name: "",
3504
3506
  data: S
3505
3507
  };
3506
- const A = vn(S);
3507
- if (A)
3508
+ const T = bn(S);
3509
+ if (T)
3508
3510
  return {
3509
3511
  name: S,
3510
- data: A
3512
+ data: T
3511
3513
  };
3512
3514
  }
3513
3515
  return {
@@ -3533,28 +3535,28 @@ function mo(e) {
3533
3535
  });
3534
3536
  return;
3535
3537
  }
3536
- const A = vn(S);
3538
+ const T = bn(S);
3537
3539
  if (p({
3538
3540
  name: S,
3539
- data: A
3541
+ data: T
3540
3542
  }))
3541
- if (A === void 0) {
3543
+ if (T === void 0) {
3542
3544
  const k = Os([S], g);
3543
3545
  o({
3544
3546
  callback: k
3545
3547
  });
3546
- } else A && ((I = e.onLoad) === null || I === void 0 || I.call(e, S));
3548
+ } else T && ((I = e.onLoad) === null || I === void 0 || I.call(e, S));
3547
3549
  }
3548
3550
  xe(() => (r(!0), l), []), xe(() => {
3549
3551
  t && g();
3550
3552
  }, [e.icon, t]);
3551
3553
  const { name: y, data: x } = i;
3552
3554
  return x ? Js({
3553
- ...$r,
3555
+ ...Or,
3554
3556
  ...x
3555
- }, e, y) : e.children ? e.children : e.fallback ? e.fallback : pr("span", {});
3557
+ }, e, y) : e.children ? e.children : e.fallback ? e.fallback : mr("span", {});
3556
3558
  }
3557
- const ce = $n((e, t) => mo({
3559
+ const de = $n((e, t) => mo({
3558
3560
  ...e,
3559
3561
  _ref: t
3560
3562
  }));
@@ -3563,7 +3565,7 @@ $n((e, t) => mo({
3563
3565
  ...e,
3564
3566
  _ref: t
3565
3567
  }));
3566
- const ct = "USD", Ks = (e, t = ct) => {
3568
+ const yt = "USD", Ks = (e, t = yt) => {
3567
3569
  const r = (e == null ? void 0 : e.prices) ?? [];
3568
3570
  if (!r.length) return null;
3569
3571
  const n = (i) => {
@@ -3601,7 +3603,7 @@ const ct = "USD", Ks = (e, t = ct) => {
3601
3603
  r && r.value && (t = typeof r.value == "object" ? r.value.label || "" : r.value);
3602
3604
  }
3603
3605
  return { sizeLabel: t };
3604
- }, gt = (e) => Ws((e == null ? void 0 : e.attributesRaw) ?? [], "color"), wt = (e) => Qs((e == null ? void 0 : e.attributesRaw) ?? []).sizeLabel, We = (e) => e.charAt(0).toUpperCase() + e.slice(1), yt = {
3606
+ }, pt = (e) => Ws((e == null ? void 0 : e.attributesRaw) ?? [], "color"), gt = (e) => Qs((e == null ? void 0 : e.attributesRaw) ?? []).sizeLabel, We = (e) => e.charAt(0).toUpperCase() + e.slice(1), Fn = {
3605
3607
  standard: {
3606
3608
  label: "Standard Delivery",
3607
3609
  fee: 0,
@@ -3624,7 +3626,7 @@ const ct = "USD", Ks = (e, t = ct) => {
3624
3626
  standard: "GROUND",
3625
3627
  express: "2-DAY SHIPPING",
3626
3628
  sameday: "OVERNIGHT"
3627
- }, Qe = (e, t) => {
3629
+ }, at = (e, t) => {
3628
3630
  try {
3629
3631
  return e.toLocaleString("en-US", {
3630
3632
  style: "currency",
@@ -3633,28 +3635,28 @@ const ct = "USD", Ks = (e, t = ct) => {
3633
3635
  } catch {
3634
3636
  return `${t} ${e.toFixed(2)}`;
3635
3637
  }
3636
- }, ho = (e) => e == null ? void 0 : e.masterVariant, En = (e) => Array.isArray(e == null ? void 0 : e.variants) ? e.variants : [], Xt = (e) => {
3638
+ }, ho = (e) => e == null ? void 0 : e.masterVariant, En = (e) => Array.isArray(e == null ? void 0 : e.variants) ? e.variants : [], Qt = (e) => {
3637
3639
  const t = ho(e);
3638
3640
  return t ? [t, ...En(e)] : En(e);
3639
- }, Xs = (e, t = 0) => Xt(e)[t], Zs = (e) => {
3641
+ }, Xs = (e, t = 0) => Qt(e)[t], Zs = (e) => {
3640
3642
  var t, r;
3641
3643
  return ((r = (t = e == null ? void 0 : e.images) == null ? void 0 : t[0]) == null ? void 0 : r.url) ?? "";
3642
3644
  }, Tn = (e, t) => {
3643
3645
  var r, n, o, s, i, c, l, p;
3644
3646
  return Zs(t) || ((s = (o = (n = (r = e.imageGroups) == null ? void 0 : r[0]) == null ? void 0 : n.images) == null ? void 0 : o[0]) == null ? void 0 : s.link) || ((p = (l = (c = (i = e.image_groups) == null ? void 0 : i[0]) == null ? void 0 : c.images) == null ? void 0 : l[0]) == null ? void 0 : p.link) || "";
3645
- }, An = (e) => (e == null ? void 0 : e.name) || (e == null ? void 0 : e.title) || (e == null ? void 0 : e.productName) || "any", Zt = (e) => {
3647
+ }, An = (e) => (e == null ? void 0 : e.name) || (e == null ? void 0 : e.title) || (e == null ? void 0 : e.productName) || "any", Gt = (e) => {
3646
3648
  var s, i, c, l, p, g;
3647
- const t = e ? Ks(e, ct) : null;
3649
+ const t = e ? Ks(e, yt) : null;
3648
3650
  if (t != null && t.cent && (t != null && t.cur))
3649
3651
  return {
3650
3652
  amount: +(t.cent / 100),
3651
3653
  currency: t.cur,
3652
3654
  regularAmount: t.regularCent ? t.regularCent / 100 : void 0
3653
3655
  };
3654
- const r = (c = (i = (s = e == null ? void 0 : e.prices) == null ? void 0 : s[0]) == null ? void 0 : i.value) == null ? void 0 : c.centAmount, n = ((g = (p = (l = e == null ? void 0 : e.prices) == null ? void 0 : l[0]) == null ? void 0 : p.value) == null ? void 0 : g.currencyCode) ?? ct;
3656
+ const r = (c = (i = (s = e == null ? void 0 : e.prices) == null ? void 0 : s[0]) == null ? void 0 : i.value) == null ? void 0 : c.centAmount, n = ((g = (p = (l = e == null ? void 0 : e.prices) == null ? void 0 : l[0]) == null ? void 0 : p.value) == null ? void 0 : g.currencyCode) ?? yt;
3655
3657
  return { amount: Number.isFinite(r) ? +(Number(r) / 100) : 0, currency: n };
3656
3658
  }, On = (e, t) => {
3657
- const { amount: r } = Zt(t);
3659
+ const { amount: r } = Gt(t);
3658
3660
  if (r) return r;
3659
3661
  const n = (e == null ? void 0 : e.price) ?? (e == null ? void 0 : e.sellingPrice) ?? (e == null ? void 0 : e.unitPrice) ?? (e == null ? void 0 : e.mrp) ?? 0, o = Number(n);
3660
3662
  return Number.isFinite(o) ? o : 0;
@@ -3676,10 +3678,10 @@ const ct = "USD", Ks = (e, t = ct) => {
3676
3678
  addressLoading: s,
3677
3679
  variationAttributes: i
3678
3680
  }) => {
3679
- const p = Xt(r), g = Math.min(
3681
+ const p = Qt(r), g = Math.min(
3680
3682
  Math.max(0, n || 0),
3681
3683
  Math.max(0, p.length - 1)
3682
- ), [y, x] = b([]), [I, S] = b(0), [A, k] = b([]);
3684
+ ), [y, x] = b([]), [I, S] = b(0), [T, k] = b([]);
3683
3685
  xe(() => {
3684
3686
  if (r != null && r.variants) {
3685
3687
  const u = P(
@@ -3692,35 +3694,35 @@ const ct = "USD", Ks = (e, t = ct) => {
3692
3694
  }, [r]);
3693
3695
  const P = (u, m, f) => {
3694
3696
  const { colorMap: w, sizeMap: v } = J(f), j = {};
3695
- m == null || m.forEach((E) => {
3697
+ m == null || m.forEach((A) => {
3696
3698
  var le, Pe, ze;
3697
- const M = (le = E.variationAttributes) == null ? void 0 : le.find(
3699
+ const M = (le = A.variationAttributes) == null ? void 0 : le.find(
3698
3700
  (De) => De.id === "color"
3699
- ), T = (ze = (Pe = M == null ? void 0 : M.values) == null ? void 0 : Pe[0]) == null ? void 0 : ze.value;
3700
- T && (j[T] || (j[T] = {}), j[T][E.viewType] = E.images);
3701
+ ), E = (ze = (Pe = M == null ? void 0 : M.values) == null ? void 0 : Pe[0]) == null ? void 0 : ze.value;
3702
+ E && (j[E] || (j[E] = {}), j[E][A.viewType] = A.images);
3701
3703
  });
3702
- const H = u.reduce((E, M) => {
3703
- const T = M.variationValues.color, le = M.variationValues.size;
3704
- return E[T] || (E[T] = {
3705
- color: T,
3706
- name: w[T] || T,
3704
+ const H = u.reduce((A, M) => {
3705
+ const E = M.variationValues.color, le = M.variationValues.size;
3706
+ return A[E] || (A[E] = {
3707
+ color: E,
3708
+ name: w[E] || E,
3707
3709
  // ✅ DISPLAY NAME
3708
- images: j[T] || {},
3710
+ images: j[E] || {},
3709
3711
  variants: []
3710
- }), E[T].variants.push({
3712
+ }), A[E].variants.push({
3711
3713
  size: le,
3712
3714
  name: v[le] || le,
3713
3715
  // ✅ DISPLAY NAME
3714
3716
  ...M
3715
- }), E;
3717
+ }), A;
3716
3718
  }, {});
3717
- return Object.values(H).sort((E, M) => {
3718
- const T = E.colorName || E.color || "", le = M.colorName || M.color || "";
3719
- return T.localeCompare(le);
3720
- }).map((E) => ({
3721
- ...E,
3722
- variants: E.variants.sort(
3723
- (M, T) => Number(M.size) - Number(T.size)
3719
+ return Object.values(H).sort((A, M) => {
3720
+ const E = A.colorName || A.color || "", le = M.colorName || M.color || "";
3721
+ return E.localeCompare(le);
3722
+ }).map((A) => ({
3723
+ ...A,
3724
+ variants: A.variants.sort(
3725
+ (M, E) => Number(M.size) - Number(E.size)
3724
3726
  )
3725
3727
  }));
3726
3728
  }, J = (u) => {
@@ -3732,17 +3734,17 @@ const ct = "USD", Ks = (e, t = ct) => {
3732
3734
  f[v.value] = v.name;
3733
3735
  });
3734
3736
  }), { colorMap: m, sizeMap: f };
3735
- }, q = p.length, [Y, _e] = b(g), [C, K] = b(null), [re, ye] = b(null), be = Ve(null), dt = Ve(null), N = Xs(r, Y), [ve, V] = b(""), [$, Je] = b(""), [ut, qe] = b(!1), [nt, fe] = b(!1), [Ie, je] = b(!1), [z, Te] = b(""), [Se, ne] = b(!1), [X, kt] = b(null), [h, O] = b([]), [B, Q] = b([]), [U, L] = b([]), [W, Z] = b(!1), [R, oe] = b(), [$e, Re] = b(!0), [G, me] = b(!1), [Ne, he] = b(!1), [pe, _] = b("standard"), [ee, D] = b(!1), [ae, se] = b(!1), [Ae, St] = b("card"), [Oe, ie] = b(!1), [Nt, Ce] = b(!1), [F, te] = b(!1), [Ct, _t] = b(null), [Mt, Mr] = b(null), [sr, Br] = b(""), [Ur, qr] = b(!1), [It, po] = b(r == null ? void 0 : r.id), Bt = Ve(null);
3737
+ }, q = p.length, [Y, _e] = b(g), [C, K] = b(null), [re, ye] = b(null), be = Ve(null), lt = Ve(null), N = Xs(r, Y), [ve, V] = b(""), [$, Je] = b(""), [ct, qe] = b(!1), [rt, fe] = b(!1), [Ie, je] = b(!1), [z, Te] = b(""), [Se, ne] = b(!1), [me, vt] = b(null), [h, O] = b([]), [B, Q] = b([]), [U, L] = b([]), [W, Z] = b(!1), [R, oe] = b(), [$e, Re] = b(!0), [G, he] = b(!1), [Ne, pe] = b(!1), [X, _] = b({ id: "001" }), [ee, D] = b(!1), [ae, se] = b(!1), [Ae, kt] = b("card"), [Oe, ie] = b(!1), [St, Ce] = b(!1), [F, te] = b(!1), [Nt, Ct] = b(null), [Dt, zr] = b(null), [or, Dr] = b(""), [Mr, Br] = b(!1), [_t, po] = b(r == null ? void 0 : r.id), Mt = Ve(null);
3736
3738
  xe(() => {
3737
- const u = Xt(r), m = Math.min(
3739
+ const u = Qt(r), m = Math.min(
3738
3740
  Math.max(0, n || 0),
3739
3741
  Math.max(0, u.length - 1)
3740
3742
  );
3741
3743
  _e(m);
3742
- const f = ho(r), w = gt(f), v = wt(f);
3743
- be.current = w || null, dt.current = v || null, K(w || null), ye(v || null);
3744
+ const f = ho(r), w = pt(f), v = gt(f);
3745
+ be.current = w || null, lt.current = v || null, K(w || null), ye(v || null);
3744
3746
  }, [n, r]), xe(() => {
3745
- Bt.current && (Bt.current.scrollTop = Bt.current.scrollHeight);
3747
+ Mt.current && (Mt.current.scrollTop = Mt.current.scrollHeight);
3746
3748
  }, [
3747
3749
  h,
3748
3750
  W,
@@ -3751,22 +3753,22 @@ const ct = "USD", Ks = (e, t = ct) => {
3751
3753
  ee,
3752
3754
  ae,
3753
3755
  Oe,
3754
- Nt,
3756
+ St,
3755
3757
  F,
3756
- ut,
3757
- nt
3758
+ ct,
3759
+ rt
3758
3760
  ]);
3759
- const ft = "var(--tanya)", Rr = "var(--tanya-contrast)", Ut = ft, Le = "#804c9e", go = () => {
3761
+ const dt = "var(--tanya)", Ur = "var(--tanya-contrast)", Bt = dt, Le = "#804c9e", go = () => {
3760
3762
  console.log("AgenticShopping feedback:", {
3761
- rating: Mt,
3762
- comment: sr
3763
- }), qr(!0);
3763
+ rating: Dt,
3764
+ comment: or
3765
+ }), Br(!0);
3764
3766
  }, wo = () => {
3765
- Mr(null), Br(""), qr(!0);
3766
- }, Hr = (u) => {
3767
- const f = ((u == null ? void 0 : u.intentMandateId) || (u == null ? void 0 : u.intent_mandate_id) || (u == null ? void 0 : u.id) || null) ?? Ct;
3767
+ zr(null), Dr(""), Br(!0);
3768
+ }, qr = (u) => {
3769
+ const f = ((u == null ? void 0 : u.intentMandateId) || (u == null ? void 0 : u.intent_mandate_id) || (u == null ? void 0 : u.id) || null) ?? Nt;
3768
3770
  return e ? /* @__PURE__ */ d("div", { className: "mt-3 flex items-start gap-3 rounded-lg border border-green-200 bg-green-50 p-4 text-green-800", children: [
3769
- /* @__PURE__ */ a("div", { className: "success-tick-animation", children: /* @__PURE__ */ a(ce, { icon: "mdi:check-circle", width: "28", color: "#16a34a" }) }),
3771
+ /* @__PURE__ */ a("div", { className: "success-tick-animation", children: /* @__PURE__ */ a(de, { icon: "mdi:check-circle", width: "28", color: "#16a34a" }) }),
3770
3772
  /* @__PURE__ */ d("div", { className: "text-sm w-full", children: [
3771
3773
  /* @__PURE__ */ a("div", { className: "font-semibold", children: "Success!" }),
3772
3774
  /* @__PURE__ */ a("div", { children: "Your smart order has been saved. I’ll watch the price and auto-purchase when the conditions are met." }),
@@ -3780,19 +3782,19 @@ const ct = "USD", Ks = (e, t = ct) => {
3780
3782
  }
3781
3783
  )
3782
3784
  ] }),
3783
- !Ur && /* @__PURE__ */ d("div", { className: "mt-4 rounded-lg bg-white/70 p-3 text-gray-900", children: [
3785
+ !Mr && /* @__PURE__ */ d("div", { className: "mt-4 rounded-lg bg-white/70 p-3 text-gray-900", children: [
3784
3786
  /* @__PURE__ */ a("h4", { className: "font-semibold mb-1", children: "Please post your feedback here" }),
3785
3787
  /* @__PURE__ */ a("p", { className: "text-sm text-gray-700 mb-3", children: "Rate us on how much our response was helpful" }),
3786
3788
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1 mb-3", children: [1, 2, 3, 4, 5].map((w) => /* @__PURE__ */ a(
3787
3789
  "button",
3788
3790
  {
3789
3791
  type: "button",
3790
- onClick: () => Mr(w),
3792
+ onClick: () => zr(w),
3791
3793
  className: "p-0.5",
3792
3794
  children: /* @__PURE__ */ a(
3793
- ce,
3795
+ de,
3794
3796
  {
3795
- icon: Mt && Mt >= w ? "mdi:star" : "mdi:star-outline",
3797
+ icon: Dt && Dt >= w ? "mdi:star" : "mdi:star-outline",
3796
3798
  width: "20",
3797
3799
  className: "text-yellow-500"
3798
3800
  }
@@ -3804,8 +3806,8 @@ const ct = "USD", Ks = (e, t = ct) => {
3804
3806
  /* @__PURE__ */ a(
3805
3807
  "textarea",
3806
3808
  {
3807
- value: sr,
3808
- onChange: (w) => Br(w.target.value),
3809
+ value: or,
3810
+ onChange: (w) => Dr(w.target.value),
3809
3811
  rows: 3,
3810
3812
  className: "mt-1 w-full rounded-md border border-gray-300 p-2 text-sm outline-none focus:ring-1 focus:ring-gray-300",
3811
3813
  placeholder: "Your feedback helps us improve..."
@@ -3827,14 +3829,14 @@ const ct = "USD", Ks = (e, t = ct) => {
3827
3829
  type: "button",
3828
3830
  onClick: go,
3829
3831
  className: "px-4 py-2 rounded-full text-sm font-semibold text-white shadow",
3830
- style: { background: ft },
3831
- disabled: !Mt && !sr.trim(),
3832
+ style: { background: dt },
3833
+ disabled: !Dt && !or.trim(),
3832
3834
  children: "Submit"
3833
3835
  }
3834
3836
  )
3835
3837
  ] })
3836
3838
  ] }),
3837
- Ur && /* @__PURE__ */ a("div", { className: "mt-3 text-xs text-green-900 font-medium", children: "Thanks for your feedback! 💚" })
3839
+ Mr && /* @__PURE__ */ a("div", { className: "mt-3 text-xs text-green-900 font-medium", children: "Thanks for your feedback! 💚" })
3838
3840
  ] })
3839
3841
  ] }) : null;
3840
3842
  }, yo = async () => {
@@ -3843,9 +3845,9 @@ const ct = "USD", Ks = (e, t = ct) => {
3843
3845
  const u = JSON.parse(
3844
3846
  sessionStorage.getItem("customerData") || "{}"
3845
3847
  );
3846
- let m = (u == null ? void 0 : u.basketId) || localStorage.getItem(Lt);
3848
+ let m = (u == null ? void 0 : u.basketId) || localStorage.getItem($t);
3847
3849
  if (!m) {
3848
- const f = await Xe(), w = "Bearer " + (f == null ? void 0 : f.access_token), v = await Ir(w);
3850
+ const f = await Ge(), w = "Bearer " + (f == null ? void 0 : f.access_token), v = await Cr(w);
3849
3851
  m = (v == null ? void 0 : v.basket_id) || v.basketId;
3850
3852
  }
3851
3853
  xo(m), V(m);
@@ -3857,7 +3859,7 @@ const ct = "USD", Ks = (e, t = ct) => {
3857
3859
  console.log(m, "shipping methods"), k(m);
3858
3860
  };
3859
3861
  console.log(ve, "the basket id");
3860
- const Pt = (u, m) => {
3862
+ const It = (u, m) => {
3861
3863
  O((f) => [
3862
3864
  ...f,
3863
3865
  {
@@ -3867,7 +3869,7 @@ const ct = "USD", Ks = (e, t = ct) => {
3867
3869
  snapshotPayload: m
3868
3870
  }
3869
3871
  ]);
3870
- }, Vr = (u, m) => {
3872
+ }, Rr = (u, m) => {
3871
3873
  O(
3872
3874
  (f) => f.map(
3873
3875
  (w) => w.response === "__CARD__" ? {
@@ -3884,34 +3886,33 @@ const ct = "USD", Ks = (e, t = ct) => {
3884
3886
  (m) => !(m.query === "" && m.response !== "__SNAPSHOT__" && m.response !== "__TEXT__")
3885
3887
  )
3886
3888
  );
3887
- }, qt = () => {
3888
- Ce(!1), Z(!1), he(!1), se(!1), me(!1), D(!1), ie(!1), te(!1), ne(!1), kt(null), bo(), qe(!1), fe(!1);
3889
+ }, Ut = () => {
3890
+ Ce(!1), Z(!1), pe(!1), se(!1), he(!1), D(!1), ie(!1), te(!1), ne(!1), vt(null), bo(), qe(!1), fe(!1);
3889
3891
  }, vo = () => {
3890
- Z(!1), me(!1), he(!1), _("standard"), D(!1), se(!1), St("card"), ie(!1), Ce(!1), te(!1), Re(!0), kt(null), localStorage.removeItem("agentic_order"), localStorage.removeItem("agentic_order_address"), localStorage.removeItem("agentic_order_delivery"), localStorage.removeItem("agentic_order_payment"), localStorage.removeItem("agentic_order_final");
3891
- }, Rt = en(() => Xt(r).map((m, f) => ({
3892
+ Z(!1), he(!1), pe(!1), _("standard"), D(!1), se(!1), kt("card"), ie(!1), Ce(!1), te(!1), Re(!0), vt(null), localStorage.removeItem("agentic_order"), localStorage.removeItem("agentic_order_address"), localStorage.removeItem("agentic_order_delivery"), localStorage.removeItem("agentic_order_payment"), localStorage.removeItem("agentic_order_final");
3893
+ }, qt = Zr(() => Qt(r).map((m, f) => ({
3892
3894
  index: f,
3893
3895
  variant: m,
3894
3896
  images: ((m == null ? void 0 : m.images) || []).map((w) => (w == null ? void 0 : w.url) || "").filter(Boolean)
3895
- })), [r]), Ft = en(() => Rt.length ? !!((C || void 0) && (re || void 0)) : !1, [Rt, C, re, N]), ko = Ie || Se || !Ft, Et = (u) => {
3897
+ })), [r]), Pt = Zr(() => qt.length ? !!((C || void 0) && (re || void 0)) : !1, [qt, C, re, N]), ko = Ie || Se || !Pt, Ft = (u) => {
3896
3898
  const m = Number((u == null ? void 0 : u.quantity) ?? 1);
3897
3899
  return Number.isFinite(m) && m > 0 ? m : 1;
3898
- }, Yr = (u) => {
3899
- const m = Et(u), f = Number((u == null ? void 0 : u.max_price_minor) ?? 0);
3900
+ }, Hr = (u) => {
3901
+ const m = Ft(u), f = Number((u == null ? void 0 : u.max_price_minor) ?? 0);
3900
3902
  return Number.isFinite(f) && f > 0 ? +(f / 100) : +(On(r, N) * m);
3901
- }, Jr = (u) => {
3902
- var E;
3903
- const m = X, f = Zt(N), w = u || (m == null ? void 0 : m.currency) || f.currency || ct, v = Yr(m), j = +(v * 0.08).toFixed(2), H = ((E = yt[pe]) == null ? void 0 : E.fee) || 0;
3903
+ }, Vr = (u) => {
3904
+ const m = me, f = Gt(N), w = u || (m == null ? void 0 : m.currency) || f.currency || yt, v = Hr(m), j = +(v * 0.08).toFixed(2), H = (X == null ? void 0 : X.price) || 0;
3904
3905
  return { product_total: v, tax: j, shipping_fee: H, currency: w };
3905
- }, ir = async (u, m, f) => {
3906
- Vr(), vo(), je(!0), ne(!0), qe(!1), fe(!1);
3906
+ }, ar = async (u, m, f) => {
3907
+ Rr(), vo(), je(!0), ne(!0), qe(!1), fe(!1);
3907
3908
  const w = B.slice(-jn);
3908
3909
  try {
3909
- const v = await wr(null, null);
3910
+ const v = await pr(null, null);
3910
3911
  if (!v) throw new Error("Failed to fetch token");
3911
3912
  const j = localStorage.getItem("customerNumber"), H = localStorage.getItem("isLoggedIn"), M = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
3912
3913
  registered: String(H || !1),
3913
3914
  userId: String(j || (/* @__PURE__ */ new Date()).getTime())
3914
- }).toString()}`, T = await fetch(`${M}`, {
3915
+ }).toString()}`, E = await fetch(`${M}`, {
3915
3916
  method: "POST",
3916
3917
  headers: {
3917
3918
  "Content-Type": "application/json",
@@ -3931,22 +3932,22 @@ const ct = "USD", Ks = (e, t = ct) => {
3931
3932
  }
3932
3933
  })
3933
3934
  });
3934
- if (!T.body) throw new Error("Readable stream not supported");
3935
- const le = T.body.getReader(), Pe = new TextDecoder();
3936
- let ze = "", De = "", ot = "";
3935
+ if (!E.body) throw new Error("Readable stream not supported");
3936
+ const le = E.body.getReader(), Pe = new TextDecoder();
3937
+ let ze = "", De = "", nt = "";
3937
3938
  for (; ; ) {
3938
3939
  const { done: Ee, value: Ke } = await le.read();
3939
3940
  if (Ee) break;
3940
3941
  ze += Pe.decode(Ke, { stream: !0 });
3941
- const mt = ze.split(`
3942
+ const ut = ze.split(`
3942
3943
  `);
3943
- ze = mt.pop() || "";
3944
- for (const ht of mt) {
3945
- if (!ht.startsWith("data:")) continue;
3946
- const at = ht.slice(5).trim();
3944
+ ze = ut.pop() || "";
3945
+ for (const ft of ut) {
3946
+ if (!ft.startsWith("data:")) continue;
3947
+ const ot = ft.slice(5).trim();
3947
3948
  try {
3948
- const He = JSON.parse(at), Me = He.index, ge = He.data;
3949
- Me === 0 ? De = String(ge ?? "") : Me === 1 && (ot = String(ge ?? ""));
3949
+ const He = JSON.parse(ot), Me = He.index, ge = He.data;
3950
+ Me === 0 ? De = String(ge ?? "") : Me === 1 && (nt = String(ge ?? ""));
3950
3951
  } catch (He) {
3951
3952
  console.error("Error parsing JSON chunk:", He);
3952
3953
  }
@@ -3962,7 +3963,7 @@ const ct = "USD", Ks = (e, t = ct) => {
3962
3963
  console.log(Ke);
3963
3964
  }
3964
3965
  }
3965
- kt(Fe), Fe && O((Ee) => [
3966
+ vt(Fe), Fe && O((Ee) => [
3966
3967
  ...Ee,
3967
3968
  {
3968
3969
  query: "",
@@ -3974,7 +3975,7 @@ const ct = "USD", Ks = (e, t = ct) => {
3974
3975
  {
3975
3976
  userQuery: u,
3976
3977
  mainResponse: De || "",
3977
- keywords: ot || ""
3978
+ keywords: nt || ""
3978
3979
  }
3979
3980
  ].slice(-jn));
3980
3981
  } catch (v) {
@@ -3982,15 +3983,15 @@ const ct = "USD", Ks = (e, t = ct) => {
3982
3983
  } finally {
3983
3984
  je(!1);
3984
3985
  }
3985
- }, Kr = async (u) => {
3986
- if (Se || Ie || !Ft) return;
3986
+ }, Yr = async (u) => {
3987
+ if (Se || Ie || !Pt) return;
3987
3988
  const m = z.trim();
3988
3989
  if (!m) return;
3989
3990
  O((w) => [...w, { query: m, response: "" }]), Te(""), Je(m);
3990
- const f = It || "";
3991
+ const f = _t || "";
3991
3992
  if (q <= 1) {
3992
3993
  if (f) {
3993
- ir(m, f, Y);
3994
+ ar(m, f, Y);
3994
3995
  return;
3995
3996
  }
3996
3997
  fe(!0), ne(!0);
@@ -3998,32 +3999,32 @@ const ct = "USD", Ks = (e, t = ct) => {
3998
3999
  }
3999
4000
  f ? (qe(!0), ne(!0)) : (fe(!0), ne(!0));
4000
4001
  }, So = () => {
4001
- const u = It;
4002
- u && ir($, u, Y);
4002
+ const u = _t;
4003
+ u && ar($, u, Y);
4003
4004
  }, No = () => {
4004
4005
  qe(!1), fe(!0), ne(!0);
4005
4006
  }, Co = () => {
4006
- if (!It) return;
4007
- ir($, It, Y);
4007
+ if (!_t) return;
4008
+ ar($, _t, Y);
4008
4009
  }, _o = async () => {
4009
- Z(!0), he(!1), se(!1), Ce(!1), me(!1), D(!1), ie(!1), te(!1), await yo(), console.log("calling"), Vr("initial", {
4010
- extractedDetails: X ?? void 0
4010
+ Z(!0), pe(!1), se(!1), Ce(!1), he(!1), D(!1), ie(!1), te(!1), await yo(), console.log("calling"), Rr("initial", {
4011
+ extractedDetails: me ?? void 0
4011
4012
  });
4012
4013
  }, Io = () => {
4013
4014
  if (!R) return;
4014
4015
  const u = U.find(
4015
4016
  (m) => String(m.addressId ?? m.id) === R
4016
4017
  ) || null;
4017
- u && (localStorage.setItem("agentic_order_address", JSON.stringify(u)), me(!0), he(!0), D(!1), se(!1), ie(!1), Ce(!1), te(!1), Pt("address", u));
4018
+ u && (localStorage.setItem("agentic_order_address", JSON.stringify(u)), he(!0), pe(!0), D(!1), se(!1), ie(!1), Ce(!1), te(!1), It("address", u));
4018
4019
  }, Po = () => {
4019
- me(!1), he(!1), D(!1), se(!1), ie(!1), Ce(!1), te(!1), localStorage.removeItem("agentic_order_address");
4020
+ he(!1), pe(!1), D(!1), se(!1), ie(!1), Ce(!1), te(!1), localStorage.removeItem("agentic_order_address");
4020
4021
  }, Fo = () => {
4021
- pe && (localStorage.setItem("agentic_order_delivery", pe), D(!0), se(!0), ie(!1), Ce(!1), te(!1), Pt("delivery", {
4022
- method: pe,
4023
- ...yt[pe]
4022
+ X.id && (localStorage.setItem("agentic_order_delivery", X.id), D(!0), se(!0), ie(!1), Ce(!1), te(!1), It("delivery", {
4023
+ method: X.id,
4024
+ ...X
4024
4025
  }));
4025
- }, Wr = () => {
4026
- he(!1), D(!1), se(!1), ie(!1), Ce(!1), te(!1), ne(!1), qt(), O((u) => [
4026
+ }, Jr = () => {
4027
+ pe(!1), D(!1), se(!1), ie(!1), Ce(!1), te(!1), ne(!1), Ut(), O((u) => [
4027
4028
  ...u,
4028
4029
  {
4029
4030
  query: "",
@@ -4036,9 +4037,9 @@ const ct = "USD", Ks = (e, t = ct) => {
4036
4037
  }, Eo = () => {
4037
4038
  D(!1), se(!1), ie(!1), Ce(!1), te(!1), localStorage.removeItem("agentic_order_delivery");
4038
4039
  }, To = () => {
4039
- Ae && (localStorage.setItem("agentic_order_payment", Ae), ie(!0), Ce(!0), te(!1), Pt("payment", { method: Ae }));
4040
+ Ae && (localStorage.setItem("agentic_order_payment", Ae), ie(!0), Ce(!0), te(!1), It("payment", { method: Ae }));
4040
4041
  }, Ao = () => {
4041
- se(!1), ie(!1), Ce(!1), te(!1), ne(!1), qt(), O((u) => [
4042
+ se(!1), ie(!1), Ce(!1), te(!1), ne(!1), Ut(), O((u) => [
4042
4043
  ...u,
4043
4044
  {
4044
4045
  query: "",
@@ -4053,46 +4054,46 @@ const ct = "USD", Ks = (e, t = ct) => {
4053
4054
  }, jo = async () => {
4054
4055
  try {
4055
4056
  je(!0);
4056
- const u = X || {}, m = JSON.parse(
4057
+ const u = me || {}, m = JSON.parse(
4057
4058
  localStorage.getItem("agentic_order_address") || "null"
4058
4059
  ), f = localStorage.getItem(
4059
4060
  "agentic_order_delivery"
4060
- ), w = localStorage.getItem("agentic_order_payment") || "card", { product_total: v, tax: j, shipping_fee: H, currency: E } = Jr(), M = u.shopper_id || localStorage.getItem("customerId") || void 0, T = (m == null ? void 0 : m.addressId) || (m == null ? void 0 : m.id) || void 0, le = f ? Gs[f] : "GROUND", Pe = "card-visa", ze = N == null ? void 0 : N.sku, De = (r == null ? void 0 : r.id) || "", ot = Et(u), Fe = typeof u.max_price_minor == "number" ? u.max_price_minor : Math.round(v * 100), mt = {
4061
+ ), w = localStorage.getItem("agentic_order_payment") || "card", { product_total: v, tax: j, shipping_fee: H, currency: A } = Vr(), M = u.shopper_id || localStorage.getItem("customerId") || void 0, E = (m == null ? void 0 : m.addressId) || (m == null ? void 0 : m.id) || void 0, le = f ? Gs[f] : "GROUND", Pe = "card-visa", ze = N == null ? void 0 : N.sku, De = (r == null ? void 0 : r.id) || "", nt = Ft(u), Fe = typeof u.max_price_minor == "number" ? u.max_price_minor : Math.round(v * 100), ut = {
4061
4062
  shopper_id: M,
4062
- shipping_address_id: T,
4063
+ shipping_address_id: E,
4063
4064
  shipping_method_id: le,
4064
4065
  payment_method_id: Pe,
4065
4066
  sku: ze,
4066
4067
  platform: "SFCC",
4067
4068
  storeCode: "Sites-SiteGenesis-Site",
4068
4069
  product_id: De,
4069
- quantity: ot,
4070
+ quantity: nt,
4070
4071
  max_price_minor: Fe,
4071
- currency: E,
4072
+ currency: A,
4072
4073
  instruction_text: $
4073
4074
  };
4074
- if (console.log(M, T, "the selected ids"), !M || !T) {
4075
+ if (console.log(M, E, "the selected ids"), !M || !E) {
4075
4076
  console.error(
4076
4077
  "Missing shopper_id or shipping_address_id for intent-mandate",
4077
4078
  {
4078
4079
  shopperId: M,
4079
- shippingAddressId: T
4080
+ shippingAddressId: E
4080
4081
  }
4081
4082
  ), alert(
4082
4083
  "Missing customer or address information. Please re-select address and try again."
4083
4084
  ), je(!1);
4084
4085
  return;
4085
4086
  }
4086
- const at = (await Xe()).access_token;
4087
- if (!at)
4087
+ const ot = (await Ge()).access_token;
4088
+ if (!ot)
4088
4089
  throw new Error("Failed to fetch auth token for intent-mandate");
4089
- const { serverUrl: He } = Ze(), Me = await fetch(`${He}/api/intent-mandate`, {
4090
+ const { serverUrl: He } = Xe(), Me = await fetch(`${He}/api/intent-mandate`, {
4090
4091
  method: "POST",
4091
4092
  headers: {
4092
4093
  "Content-Type": "application/json",
4093
- Authorization: `Bearer ${at}`
4094
+ Authorization: `Bearer ${ot}`
4094
4095
  },
4095
- body: JSON.stringify(mt)
4096
+ body: JSON.stringify(ut)
4096
4097
  });
4097
4098
  if (!Me.ok) {
4098
4099
  const Bo = await Me.text().catch(() => "");
@@ -4103,17 +4104,17 @@ const ct = "USD", Ks = (e, t = ct) => {
4103
4104
  }
4104
4105
  const ge = await Me.json().catch(() => null);
4105
4106
  console.log("intent-mandate success:", ge);
4106
- const st = (ge == null ? void 0 : ge.intent_mandate_id) || (ge == null ? void 0 : ge.intent_mandateId) || (ge == null ? void 0 : ge.key) || null;
4107
- st && _t(st);
4108
- const Ht = {
4107
+ const mt = (ge == null ? void 0 : ge.intent_mandate_id) || (ge == null ? void 0 : ge.intent_mandateId) || (ge == null ? void 0 : ge.key) || null;
4108
+ mt && Ct(mt);
4109
+ const Xr = {
4109
4110
  ...u,
4110
4111
  address: m,
4111
4112
  delivery: f,
4112
4113
  payment: w,
4113
- summary: { product_total: v, tax: j, shipping_fee: H, currency: E },
4114
- intent_mandate_id: st
4114
+ summary: { product_total: v, tax: j, shipping_fee: H, currency: A },
4115
+ intent_mandate_id: mt
4115
4116
  };
4116
- localStorage.setItem("agentic_order_final", JSON.stringify(Ht)), te(!0), Re(!1), Pt("final", Ht), Pt("success", { intentMandateId: st }), qt();
4117
+ localStorage.setItem("agentic_order_final", JSON.stringify(Xr)), te(!0), Re(!1), It("final", Xr), It("success", { intentMandateId: mt }), Ut();
4117
4118
  } catch (u) {
4118
4119
  console.error("Error in handleConfirmWatch / intent-mandate:", u), alert(
4119
4120
  "Unable to complete your smart order right now. Please try again in a moment."
@@ -4121,8 +4122,8 @@ const ct = "USD", Ks = (e, t = ct) => {
4121
4122
  } finally {
4122
4123
  je(!1);
4123
4124
  }
4124
- }, Qr = () => {
4125
- qt(), O((u) => [
4125
+ }, Kr = () => {
4126
+ Ut(), O((u) => [
4126
4127
  ...u,
4127
4128
  {
4128
4129
  query: "",
@@ -4133,8 +4134,8 @@ const ct = "USD", Ks = (e, t = ct) => {
4133
4134
  }
4134
4135
  ]);
4135
4136
  }, $o = ({ selectedIndex: u }) => {
4136
- var T;
4137
- const m = ((T = y[u]) == null ? void 0 : T.images.large[0].link) || Tn(r, N), f = An(r), w = It || "", v = gt(N) || "", j = wt(N) || "", { amount: H } = Zt(N), E = !!(r != null && r.id), M = E;
4137
+ var E;
4138
+ const m = ((E = y[u]) == null ? void 0 : E.images.large[0].link) || Tn(r, N), f = An(r), w = _t || "", v = pt(N) || "", j = gt(N) || "", { amount: H } = Gt(N), A = !!(r != null && r.id), M = A;
4138
4139
  return /* @__PURE__ */ a("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4", children: /* @__PURE__ */ d("div", { className: "flex flex-col sm:flex-row items-center sm:items-center gap-4", children: [
4139
4140
  /* @__PURE__ */ a("div", { className: "flex-shrink-0 flex justify-center sm:justify-start", children: /* @__PURE__ */ a("div", { className: "w-[150px] h-[150px] rounded-lg bg-gray-50 border border-gray-200 flex items-center justify-center overflow-hidden", children: m ? /* @__PURE__ */ a(
4140
4141
  "img",
@@ -4144,7 +4145,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4144
4145
  className: "object-contain w-full h-full"
4145
4146
  }
4146
4147
  ) : /* @__PURE__ */ a(
4147
- ce,
4148
+ de,
4148
4149
  {
4149
4150
  icon: "mdi:image-outline",
4150
4151
  width: "28",
@@ -4158,20 +4159,20 @@ const ct = "USD", Ks = (e, t = ct) => {
4158
4159
  v && `Color: ${v}`,
4159
4160
  j && `Size: ${j}`
4160
4161
  ].filter(Boolean).join(" • ") || "—" }),
4161
- /* @__PURE__ */ a("div", { className: "mt-1 text-xl font-semibold text-gray-900", children: E ? (
4162
+ /* @__PURE__ */ a("div", { className: "mt-1 text-xl font-semibold text-gray-900", children: A ? (
4162
4163
  // ? formatCurrency(Number(unitPrice) || 0, CURRENCY_PREF)
4163
4164
  `$${r.price}`
4164
4165
  ) : "Currently unavailable" }),
4165
- E && !M && /* @__PURE__ */ a("div", { className: "mt-1 text-xs font-medium text-red-600", children: "Currently out of stock" })
4166
+ A && !M && /* @__PURE__ */ a("div", { className: "mt-1 text-xs font-medium text-red-600", children: "Currently out of stock" })
4166
4167
  ] })
4167
4168
  ] }) });
4168
- }, Gr = ({
4169
+ }, Wr = ({
4169
4170
  showSubmit: u = !0
4170
4171
  }) => {
4171
4172
  const m = {};
4172
- Rt.map((w) => gt(w.variant)).filter((w) => !!w && !m[w] && (m[w] = !0));
4173
+ qt.map((w) => pt(w.variant)).filter((w) => !!w && !m[w] && (m[w] = !0));
4173
4174
  const f = {};
4174
- return Rt.map((w) => wt(w.variant)).filter((w) => !!w && !f[w] && (f[w] = !0)), /* @__PURE__ */ d("div", { className: "mx-4 mt-4 mb-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in", children: [
4175
+ return qt.map((w) => gt(w.variant)).filter((w) => !!w && !f[w] && (f[w] = !0)), /* @__PURE__ */ d("div", { className: "mx-4 mt-4 mb-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in", children: [
4175
4176
  /* @__PURE__ */ a("h3", { className: "font-semibold text-gray-800", children: "Choose a variant" }),
4176
4177
  /* @__PURE__ */ d("div", { className: "mt-4", children: [
4177
4178
  /* @__PURE__ */ d("div", { className: "flex items-baseline gap-2", children: [
@@ -4179,7 +4180,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4179
4180
  C && /* @__PURE__ */ a("div", { className: "text-sm text-gray-600", children: C })
4180
4181
  ] }),
4181
4182
  /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4 mt-2", children: y.map((w, v) => {
4182
- const j = w.name, H = C === j, E = w.images.large[0].disBaseLink || w.images.large[0].link;
4183
+ const j = w.name, H = C === j, A = w.images.large[0].disBaseLink || w.images.large[0].link;
4183
4184
  return /* @__PURE__ */ a(
4184
4185
  "div",
4185
4186
  {
@@ -4193,10 +4194,10 @@ const ct = "USD", Ks = (e, t = ct) => {
4193
4194
  },
4194
4195
  className: "w-full h-20 flex items-center justify-center overflow-hidden",
4195
4196
  title: j,
4196
- children: E ? /* @__PURE__ */ a(
4197
+ children: A ? /* @__PURE__ */ a(
4197
4198
  "img",
4198
4199
  {
4199
- src: E,
4200
+ src: A,
4200
4201
  alt: j,
4201
4202
  className: "w/full h-full object-contain"
4202
4203
  }
@@ -4240,16 +4241,16 @@ const ct = "USD", Ks = (e, t = ct) => {
4240
4241
  onClick: Co,
4241
4242
  className: "px-6 py-2.5 rounded-full font-semibold text-white shadow-md",
4242
4243
  style: { background: Le },
4243
- disabled: !Ft,
4244
+ disabled: !Pt,
4244
4245
  children: "Submit"
4245
4246
  }
4246
4247
  ) })
4247
4248
  ] });
4248
- }, Xr = (u, m = !0) => {
4249
+ }, Qr = (u, m = !0) => {
4249
4250
  !(u != null && u.extractedDetails) && u && (u = { extractedDetails: u });
4250
- const f = (u == null ? void 0 : u.extractedDetails) || X;
4251
+ const f = (u == null ? void 0 : u.extractedDetails) || me;
4251
4252
  if (!f) return null;
4252
- const w = Et(f), { currency: v } = Zt(N), j = On(r, N), H = Number((f == null ? void 0 : f.max_price_minor) ?? 0), M = Number.isFinite(H) && H > 0 ? +(H / 100) : +(j * w), T = (f == null ? void 0 : f.currency) || v || ct, le = N != null && N.sku ? N.sku : f.product_id;
4253
+ const w = Ft(f), { currency: v } = Gt(N), j = On(r, N), H = Number((f == null ? void 0 : f.max_price_minor) ?? 0), M = Number.isFinite(H) && H > 0 ? +(H / 100) : +(j * w), E = (f == null ? void 0 : f.currency) || v || yt, le = N != null && N.sku ? N.sku : f.product_id;
4253
4254
  return /* @__PURE__ */ d(
4254
4255
  "div",
4255
4256
  {
@@ -4260,7 +4261,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4260
4261
  "p",
4261
4262
  {
4262
4263
  className: "text-base font-semibold text-center mt-2",
4263
- style: { color: Rr },
4264
+ style: { color: Ur },
4264
4265
  children: "Here’s what I found from your instruction:"
4265
4266
  }
4266
4267
  ),
@@ -4269,20 +4270,20 @@ const ct = "USD", Ks = (e, t = ct) => {
4269
4270
  /* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "SKU:" }),
4270
4271
  /* @__PURE__ */ a("p", { className: "text-gray-800", children: le }),
4271
4272
  /* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Quantity:" }),
4272
- /* @__PURE__ */ a("p", { className: "text-gray-800", children: Et(f) }),
4273
+ /* @__PURE__ */ a("p", { className: "text-gray-800", children: Ft(f) }),
4273
4274
  /* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Currency:" }),
4274
- /* @__PURE__ */ a("p", { className: "text-gray-800", children: T }),
4275
+ /* @__PURE__ */ a("p", { className: "text-gray-800", children: E }),
4275
4276
  /* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Maximum Total Price:" }),
4276
- /* @__PURE__ */ a("p", { className: "text-gray-800", children: Qe(M, T) })
4277
+ /* @__PURE__ */ a("p", { className: "text-gray-800", children: at(M, E) })
4277
4278
  ] }),
4278
4279
  /* @__PURE__ */ d("div", { className: "mt-3 flex flex-wrap gap-2 text-xs", children: [
4279
- gt(N) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
4280
+ pt(N) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
4280
4281
  "Color: ",
4281
- gt(N)
4282
+ pt(N)
4282
4283
  ] }),
4283
- wt(N) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
4284
+ gt(N) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
4284
4285
  "Size: ",
4285
- wt(N)
4286
+ gt(N)
4286
4287
  ] }),
4287
4288
  (N == null ? void 0 : N.sku) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
4288
4289
  "SKU: ",
@@ -4295,7 +4296,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4295
4296
  "p",
4296
4297
  {
4297
4298
  className: "text-sm font-medium text-gray-700 text-center max-w-[90%] leading-relaxed",
4298
- style: { color: Rr },
4299
+ style: { color: Ur },
4299
4300
  children: [
4300
4301
  "Would you like me to ",
4301
4302
  /* @__PURE__ */ a("strong", { children: "lock this in" }),
@@ -4313,7 +4314,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4313
4314
  style: { background: Le },
4314
4315
  children: [
4315
4316
  /* @__PURE__ */ a(
4316
- ce,
4317
+ de,
4317
4318
  {
4318
4319
  icon: "fluent:checkmark-circle-24-filled",
4319
4320
  className: "mr-2",
@@ -4328,13 +4329,13 @@ const ct = "USD", Ks = (e, t = ct) => {
4328
4329
  /* @__PURE__ */ d(
4329
4330
  "button",
4330
4331
  {
4331
- onClick: Qr,
4332
+ onClick: Kr,
4332
4333
  disabled: W,
4333
4334
  className: `relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold border transition-all duration-300 ${W ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
4334
4335
  style: { borderColor: Le, color: Le },
4335
4336
  children: [
4336
4337
  /* @__PURE__ */ a(
4337
- ce,
4338
+ de,
4338
4339
  {
4339
4340
  icon: "fluent:dismiss-circle-24-filled",
4340
4341
  className: "mr-2",
@@ -4351,15 +4352,15 @@ const ct = "USD", Ks = (e, t = ct) => {
4351
4352
  ]
4352
4353
  }
4353
4354
  );
4354
- }, Zr = (u, m = !0) => {
4355
- var ht, at, He, Me, ge, st;
4356
- const f = u || {}, w = ((ht = f == null ? void 0 : f.summary) == null ? void 0 : ht.currency) || (X == null ? void 0 : X.currency) || ct, v = Tn(r, N), j = An(r), H = N != null && N.sku ? N.sku : (r == null ? void 0 : r.id) ?? (X == null ? void 0 : X.product_id), E = (N == null ? void 0 : N.sku) ?? ei(r), M = gt(N) || ti(r), T = wt(N) || ri(r), le = Et(f), Pe = ((at = f == null ? void 0 : f.summary) == null ? void 0 : at.product_total) != null ? +f.summary.product_total : Yr(f), ze = le > 0 ? +(Pe / le).toFixed(2) : 0, De = Pe, ot = ((He = f == null ? void 0 : f.summary) == null ? void 0 : He.tax) ?? +(Pe * 0.08).toFixed(2), Fe = ((Me = f == null ? void 0 : f.summary) == null ? void 0 : Me.shipping_fee) ?? (((ge = yt[pe]) == null ? void 0 : ge.fee) || 0), Ee = f != null && f.address ? [
4355
+ }, Gr = (u, m = !0) => {
4356
+ var ft, ot, He, Me, ge;
4357
+ const f = u || {}, w = ((ft = f == null ? void 0 : f.summary) == null ? void 0 : ft.currency) || (me == null ? void 0 : me.currency) || yt, v = Tn(r, N), j = An(r), H = N != null && N.sku ? N.sku : (r == null ? void 0 : r.id) ?? (me == null ? void 0 : me.product_id), A = (N == null ? void 0 : N.sku) ?? ei(r), M = pt(N) || ti(r), E = gt(N) || ri(r), le = Ft(f), Pe = ((ot = f == null ? void 0 : f.summary) == null ? void 0 : ot.product_total) != null ? +f.summary.product_total : Hr(f), ze = le > 0 ? +(Pe / le).toFixed(2) : 0, De = Pe, nt = ((He = f == null ? void 0 : f.summary) == null ? void 0 : He.tax) ?? +(Pe * 0.08).toFixed(2), Fe = ((Me = f == null ? void 0 : f.summary) == null ? void 0 : Me.shipping_fee) ?? ((X == null ? void 0 : X.price) || 0), Ee = f != null && f.address ? [
4357
4358
  f.address.addressLine1,
4358
4359
  f.address.addressLine2,
4359
4360
  f.address.street,
4360
4361
  [f.address.city, f.address.state, f.address.postalCode].filter(Boolean).join(", "),
4361
4362
  f.address.country
4362
- ].filter(Boolean).map((Ht) => We(String(Ht))).join(", ") : "—", Ke = (f == null ? void 0 : f.payment) || "card", mt = Ke === "card" ? /* @__PURE__ */ d(ke, { children: [
4363
+ ].filter(Boolean).map((mt) => We(String(mt))).join(", ") : "—", Ke = (f == null ? void 0 : f.payment) || "card", ut = Ke === "card" ? /* @__PURE__ */ d(ke, { children: [
4363
4364
  "Credit Card — Mastercard",
4364
4365
  /* @__PURE__ */ a("br", {}),
4365
4366
  "•••• 7820 Exp: 12/26"
@@ -4367,11 +4368,11 @@ const ct = "USD", Ks = (e, t = ct) => {
4367
4368
  return /* @__PURE__ */ d("div", { className: "mx-auto mt-3 mb-3 rounded-2xl bg-white", children: [
4368
4369
  /* @__PURE__ */ a("div", { className: "px-6 pt-5 pb-3", children: /* @__PURE__ */ d("h3", { className: "font-semibold text-lg mb-2 text-gray-800 flex items-center gap-2", children: [
4369
4370
  /* @__PURE__ */ a(
4370
- ce,
4371
+ de,
4371
4372
  {
4372
4373
  icon: "mdi:receipt-text-check-outline",
4373
4374
  width: "24",
4374
- color: ft
4375
+ color: dt
4375
4376
  }
4376
4377
  ),
4377
4378
  "All set! Here’s what your smart order looks like 🧾"
@@ -4385,7 +4386,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4385
4386
  className: "w-full h-full object-contain"
4386
4387
  }
4387
4388
  ) : /* @__PURE__ */ a(
4388
- ce,
4389
+ de,
4389
4390
  {
4390
4391
  icon: "mdi:image-outline",
4391
4392
  width: "24",
@@ -4400,11 +4401,11 @@ const ct = "USD", Ks = (e, t = ct) => {
4400
4401
  " ",
4401
4402
  H ?? "—"
4402
4403
  ] }),
4403
- (E || M || T) && /* @__PURE__ */ d("div", { className: "text-xs text-gray-600 mt-0.5 text-center", children: [
4404
- E && /* @__PURE__ */ d(ke, { children: [
4404
+ (A || M || E) && /* @__PURE__ */ d("div", { className: "text-xs text-gray-600 mt-0.5 text-center", children: [
4405
+ A && /* @__PURE__ */ d(ke, { children: [
4405
4406
  /* @__PURE__ */ a("span", { className: "font-medium", children: "SKU:" }),
4406
4407
  " ",
4407
- E,
4408
+ A,
4408
4409
  "  "
4409
4410
  ] }),
4410
4411
  M && /* @__PURE__ */ d(ke, { children: [
@@ -4413,17 +4414,17 @@ const ct = "USD", Ks = (e, t = ct) => {
4413
4414
  M,
4414
4415
  "  "
4415
4416
  ] }),
4416
- T && /* @__PURE__ */ d(ke, { children: [
4417
+ E && /* @__PURE__ */ d(ke, { children: [
4417
4418
  /* @__PURE__ */ a("span", { className: "font-medium", children: "Size:" }),
4418
4419
  " ",
4419
- T
4420
+ E
4420
4421
  ] })
4421
4422
  ] })
4422
4423
  ] }),
4423
4424
  /* @__PURE__ */ d("div", { className: "grid grid-cols-1 md-grid-cols-3 md:grid-cols-3 gap-3", children: [
4424
4425
  /* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
4425
4426
  /* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Unit Price" }),
4426
- /* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: Qe(ze, w) })
4427
+ /* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: at(ze, w) })
4427
4428
  ] }),
4428
4429
  /* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
4429
4430
  /* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Quantity" }),
@@ -4431,7 +4432,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4431
4432
  ] }),
4432
4433
  /* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
4433
4434
  /* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Subtotal" }),
4434
- /* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: Qe(De, w) })
4435
+ /* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: at(De, w) })
4435
4436
  ] })
4436
4437
  ] })
4437
4438
  ] })
@@ -4444,58 +4445,58 @@ const ct = "USD", Ks = (e, t = ct) => {
4444
4445
  ] }),
4445
4446
  /* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3", children: [
4446
4447
  /* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "💳 Payment" }),
4447
- /* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: mt })
4448
+ /* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: ut })
4448
4449
  ] }),
4449
4450
  /* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3", children: [
4450
4451
  /* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🚚 Delivery" }),
4451
- /* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: f != null && f.delivery && ((st = yt[f.delivery]) == null ? void 0 : st.label) || "—" })
4452
+ /* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: f != null && f.delivery && ((ge = Fn[f.delivery]) == null ? void 0 : ge.name) || "—" })
4452
4453
  ] })
4453
4454
  ] }),
4454
4455
  /* @__PURE__ */ d("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-3", children: [
4455
4456
  /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center", children: [
4456
4457
  /* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "💰 any(s)" }),
4457
- /* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: Qe(Pe, w) })
4458
+ /* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: at(Pe, w) })
4458
4459
  ] }),
4459
4460
  /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center", children: [
4460
4461
  /* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🏛️ Taxes" }),
4461
- /* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: Qe(ot, w) })
4462
+ /* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: at(nt, w) })
4462
4463
  ] }),
4463
4464
  /* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center", children: [
4464
4465
  /* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🚚 Shipping" }),
4465
- /* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: Qe(Fe, w) })
4466
+ /* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: at(Fe, w) })
4466
4467
  ] })
4467
4468
  ] }),
4468
4469
  /* @__PURE__ */ d(
4469
4470
  "div",
4470
4471
  {
4471
4472
  className: "mt-4 rounded-xl p-4 text-center text-white shadow-sm",
4472
- style: { background: Ut },
4473
+ style: { background: Bt },
4473
4474
  children: [
4474
4475
  /* @__PURE__ */ a("div", { className: "text-sm/5 opacity-95", children: "🔹 Total Payable" }),
4475
- /* @__PURE__ */ a("div", { className: "mt-1 text-3xl font-extrabold tracking-tight", children: Qe(Pe + ot + Fe, w) })
4476
+ /* @__PURE__ */ a("div", { className: "mt-1 text-3xl font-extrabold tracking-tight", children: at(Pe + nt + Fe, w) })
4476
4477
  ]
4477
4478
  }
4478
4479
  )
4479
4480
  ] }),
4480
4481
  !m && /* @__PURE__ */ d("div", { className: "px-6 pb-5", children: [
4481
4482
  !F && /* @__PURE__ */ a("p", { className: "mt-3 text-center text-sm text-gray-700", children: "Everything looks good! Do you want me to watch this product and buy it automatically when it meets your condition?" }),
4482
- F && Hr({ intentMandateId: Ct }),
4483
+ F && qr({ intentMandateId: Nt }),
4483
4484
  $e && !F && /* @__PURE__ */ d("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-3", children: [
4484
4485
  /* @__PURE__ */ a(
4485
4486
  "button",
4486
4487
  {
4487
4488
  onClick: jo,
4488
4489
  className: "inline-flex items-center justify-center rounded-full px-6 py-2.5 font-semibold text-white shadow-md transition-transform duration-150 hover:-translate-y-0.5 hover:shadow-lg",
4489
- style: { background: Ut },
4490
+ style: { background: Bt },
4490
4491
  children: "Confirm"
4491
4492
  }
4492
4493
  ),
4493
4494
  /* @__PURE__ */ a(
4494
4495
  "button",
4495
4496
  {
4496
- onClick: Qr,
4497
+ onClick: Kr,
4497
4498
  className: "inline-flex items-center justify-center rounded-full border px-6 py-2.5 font-semibold hover:bg-gray-50",
4498
- style: { borderColor: Ut, color: Ut },
4499
+ style: { borderColor: Bt, color: Bt },
4499
4500
  children: "Cancel"
4500
4501
  }
4501
4502
  )
@@ -4518,7 +4519,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4518
4519
  style: { backgroundColor: "var(--tanya-light)" },
4519
4520
  children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
4520
4521
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-2", children: [
4521
- /* @__PURE__ */ a(ce, { icon: "mdi:home-map-marker", width: "20", color: ft }),
4522
+ /* @__PURE__ */ a(de, { icon: "mdi:home-map-marker", width: "20", color: dt }),
4522
4523
  /* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Delivery Address" })
4523
4524
  ] }),
4524
4525
  /* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: m })
@@ -4526,7 +4527,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4526
4527
  }
4527
4528
  );
4528
4529
  }, zo = (u) => {
4529
- const m = u == null ? void 0 : u.method, f = m ? yt[m] : void 0;
4530
+ const m = u == null ? void 0 : u.method, f = m ? Fn[m] : void 0;
4530
4531
  return /* @__PURE__ */ a(
4531
4532
  "div",
4532
4533
  {
@@ -4534,12 +4535,12 @@ const ct = "USD", Ks = (e, t = ct) => {
4534
4535
  style: { backgroundColor: "var(--tanya-light)" },
4535
4536
  children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
4536
4537
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-1", children: [
4537
- /* @__PURE__ */ a(ce, { icon: "mdi:truck-delivery", width: "20", color: ft }),
4538
+ /* @__PURE__ */ a(de, { icon: "mdi:truck-delivery", width: "20", color: dt }),
4538
4539
  /* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Delivery Method" })
4539
4540
  ] }),
4540
4541
  /* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: f ? /* @__PURE__ */ d(ke, { children: [
4541
4542
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
4542
- /* @__PURE__ */ a(ce, { icon: f.icon, width: "18" }),
4543
+ /* @__PURE__ */ a(de, { icon: f.icon, width: "18" }),
4543
4544
  /* @__PURE__ */ a("span", { className: "font-medium", children: f.label })
4544
4545
  ] }),
4545
4546
  /* @__PURE__ */ a("div", { className: "text-gray-600", children: f.subtitle })
@@ -4557,11 +4558,11 @@ const ct = "USD", Ks = (e, t = ct) => {
4557
4558
  children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
4558
4559
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-1", children: [
4559
4560
  /* @__PURE__ */ a(
4560
- ce,
4561
+ de,
4561
4562
  {
4562
4563
  icon: "mdi:credit-card-outline",
4563
4564
  width: "20",
4564
- color: ft
4565
+ color: dt
4565
4566
  }
4566
4567
  ),
4567
4568
  /* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Payment Method" })
@@ -4576,11 +4577,11 @@ const ct = "USD", Ks = (e, t = ct) => {
4576
4577
  );
4577
4578
  }, Mo = (u, m) => {
4578
4579
  const f = u.snapshotStage;
4579
- if (!f || f === "address" && W || f === "delivery" && Ne || f === "payment" && ae || f === "final" && Nt)
4580
+ if (!f || f === "address" && W || f === "delivery" && Ne || f === "payment" && ae || f === "final" && St)
4580
4581
  return null;
4581
4582
  switch (f) {
4582
4583
  case "initial":
4583
- return Xr(u.snapshotPayload, !m);
4584
+ return Qr(u.snapshotPayload, !m);
4584
4585
  case "address":
4585
4586
  return Lo(u.snapshotPayload);
4586
4587
  case "delivery":
@@ -4588,9 +4589,9 @@ const ct = "USD", Ks = (e, t = ct) => {
4588
4589
  case "payment":
4589
4590
  return Do(u.snapshotPayload);
4590
4591
  case "final":
4591
- return Zr(u.snapshotPayload, !m);
4592
+ return Gr(u.snapshotPayload, !m);
4592
4593
  case "success":
4593
- return Hr(u.snapshotPayload);
4594
+ return qr(u.snapshotPayload);
4594
4595
  default:
4595
4596
  return null;
4596
4597
  }
@@ -4668,7 +4669,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4668
4669
  margin: "0.75rem"
4669
4670
  },
4670
4671
  children: /* @__PURE__ */ a(
4671
- ce,
4672
+ de,
4672
4673
  {
4673
4674
  icon: "fluent:dismiss-24-filled",
4674
4675
  color: "#ffffff",
@@ -4686,7 +4687,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4686
4687
  /* @__PURE__ */ d(
4687
4688
  "div",
4688
4689
  {
4689
- ref: Bt,
4690
+ ref: Mt,
4690
4691
  className: "overflow-y-auto pr-5 pb-4 space-y-4 hide-scrollbar flex-grow",
4691
4692
  children: [
4692
4693
  /* @__PURE__ */ d(
@@ -4706,7 +4707,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4706
4707
  }
4707
4708
  ),
4708
4709
  /* @__PURE__ */ a($o, { selectedIndex: I }),
4709
- q > 1 && /* @__PURE__ */ a(Gr, { showSubmit: !1 }),
4710
+ q > 1 && /* @__PURE__ */ a(Wr, { showSubmit: !1 }),
4710
4711
  h.map((u, m) => {
4711
4712
  var v;
4712
4713
  const f = m === h.length - 1, w = !!u.snapshotStage;
@@ -4733,7 +4734,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4733
4734
  children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a("p", { children: u.snapshotPayload.text }) })
4734
4735
  }
4735
4736
  ) }),
4736
- f && ut && q > 1 && /* @__PURE__ */ d("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in", children: [
4737
+ f && ct && q > 1 && /* @__PURE__ */ d("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in", children: [
4737
4738
  /* @__PURE__ */ d("div", { className: "text-sm text-gray-800", children: [
4738
4739
  "Proceed with color:",
4739
4740
  " ",
@@ -4767,7 +4768,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4767
4768
  )
4768
4769
  ] })
4769
4770
  ] }),
4770
- f && nt && /* @__PURE__ */ a(Gr, { showSubmit: !0 }),
4771
+ f && rt && /* @__PURE__ */ a(Wr, { showSubmit: !0 }),
4771
4772
  f && Ie && /* @__PURE__ */ a("div", { className: "mt-4", children: /* @__PURE__ */ a(
4772
4773
  "div",
4773
4774
  {
@@ -4789,7 +4790,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4789
4790
  boxShadow: "0 2px 8px rgba(0,0,0,0.08)",
4790
4791
  overflow: "hidden"
4791
4792
  },
4792
- children: w ? Mo(u, f) : Xr(
4793
+ children: w ? Mo(u, f) : Qr(
4793
4794
  u.snapshotPayload,
4794
4795
  !1
4795
4796
  )
@@ -4801,7 +4802,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4801
4802
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
4802
4803
  /* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
4803
4804
  /* @__PURE__ */ a(
4804
- ce,
4805
+ de,
4805
4806
  {
4806
4807
  icon: "mdi:home-map-marker",
4807
4808
  width: "24",
@@ -4843,7 +4844,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4843
4844
  className: `space-y-3 ${G ? "opacity-70" : ""}`,
4844
4845
  children: [
4845
4846
  U.map((u) => {
4846
- const m = [u.addressLine1, u.addressLine2].filter(Boolean).map((E) => We(E || "")).join(" "), f = We(u.city || ""), w = `${We(u.state || "")}${u.state && u.postalCode ? ", " : ""}${u.postalCode || ""}`, v = We(u.country || ""), j = String(u.addressId ?? u.id), H = R === j;
4847
+ const m = [u.addressLine1, u.addressLine2].filter(Boolean).map((A) => We(A || "")).join(" "), f = We(u.city || ""), w = `${We(u.state || "")}${u.state && u.postalCode ? ", " : ""}${u.postalCode || ""}`, v = We(u.country || ""), j = String(u.addressId ?? u.id), H = R === j;
4847
4848
  return /* @__PURE__ */ d(
4848
4849
  "label",
4849
4850
  {
@@ -4881,7 +4882,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4881
4882
  /* @__PURE__ */ a(
4882
4883
  "button",
4883
4884
  {
4884
- onClick: Wr,
4885
+ onClick: Jr,
4885
4886
  className: "px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",
4886
4887
  style: {
4887
4888
  borderColor: "var(--tanya-light)",
@@ -4909,7 +4910,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4909
4910
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
4910
4911
  /* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
4911
4912
  /* @__PURE__ */ a(
4912
- ce,
4913
+ de,
4913
4914
  {
4914
4915
  icon: "mdi:truck-delivery",
4915
4916
  width: "24",
@@ -4940,13 +4941,13 @@ const ct = "USD", Ks = (e, t = ct) => {
4940
4941
  "div",
4941
4942
  {
4942
4943
  className: `space-y-3 ${ee ? "opacity-70" : ""}`,
4943
- children: Object.keys(A).map(
4944
+ children: T.map(
4944
4945
  (u) => {
4945
- const m = yt[u], f = pe === u;
4946
+ const m = X.id === u.id;
4946
4947
  return /* @__PURE__ */ d(
4947
4948
  "label",
4948
4949
  {
4949
- className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${f ? "border-tanya-light" : "border-gray-300"} ${ee ? "pointer-events-none" : ""}`,
4950
+ className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${m ? "border-tanya-light" : "border-gray-300"} ${ee ? "pointer-events-none" : ""}`,
4950
4951
  title: ee ? "Delivery already submitted" : "",
4951
4952
  children: [
4952
4953
  /* @__PURE__ */ a(
@@ -4955,26 +4956,19 @@ const ct = "USD", Ks = (e, t = ct) => {
4955
4956
  type: "radio",
4956
4957
  name: "delivery",
4957
4958
  className: "mt-1 accent-tanya-light",
4958
- checked: f,
4959
+ checked: m,
4959
4960
  disabled: ee,
4960
4961
  onChange: () => _(u)
4961
4962
  }
4962
4963
  ),
4963
4964
  /* @__PURE__ */ d("div", { className: "flex-1", children: [
4964
- /* @__PURE__ */ d("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children: [
4965
- /* @__PURE__ */ a(ce, { icon: m.icon, width: "18" }),
4966
- " ",
4967
- m.label
4968
- ] }),
4969
- /* @__PURE__ */ a("div", { className: "text-sm text-gray-700", children: m.subtitle })
4965
+ /* @__PURE__ */ a("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children: u.name }),
4966
+ /* @__PURE__ */ a("div", { className: "text-sm text-gray-700", children: u.description })
4970
4967
  ] }),
4971
- /* @__PURE__ */ a("div", { className: "text-sm font-semibold text-gray-800", children: m.fee === 0 ? "Free" : Qe(
4972
- m.fee,
4973
- (X == null ? void 0 : X.currency) || ct
4974
- ) })
4968
+ /* @__PURE__ */ a("div", { className: "text-sm font-semibold text-gray-800", children: u.price === 0 ? "Free" : u.price })
4975
4969
  ]
4976
4970
  },
4977
- u
4971
+ key
4978
4972
  );
4979
4973
  }
4980
4974
  )
@@ -4984,7 +4978,7 @@ const ct = "USD", Ks = (e, t = ct) => {
4984
4978
  /* @__PURE__ */ a(
4985
4979
  "button",
4986
4980
  {
4987
- onClick: Wr,
4981
+ onClick: Jr,
4988
4982
  className: "px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",
4989
4983
  style: {
4990
4984
  borderColor: "var(--tanya-light)",
@@ -5009,7 +5003,7 @@ const ct = "USD", Ks = (e, t = ct) => {
5009
5003
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
5010
5004
  /* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
5011
5005
  /* @__PURE__ */ a(
5012
- ce,
5006
+ de,
5013
5007
  {
5014
5008
  icon: "mdi:credit-card-outline",
5015
5009
  width: "24",
@@ -5054,12 +5048,12 @@ const ct = "USD", Ks = (e, t = ct) => {
5054
5048
  className: "mt-1 accent-tanya-light",
5055
5049
  checked: Ae === "card",
5056
5050
  disabled: Oe,
5057
- onChange: () => St("card")
5051
+ onChange: () => kt("card")
5058
5052
  }
5059
5053
  ),
5060
5054
  /* @__PURE__ */ d("div", { className: "flex-1", children: [
5061
5055
  /* @__PURE__ */ d("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children: [
5062
- /* @__PURE__ */ a(ce, { icon: "mdi:credit-card-chip-outline", width: "18" }),
5056
+ /* @__PURE__ */ a(de, { icon: "mdi:credit-card-chip-outline", width: "18" }),
5063
5057
  " ",
5064
5058
  "Credit Card"
5065
5059
  ] }),
@@ -5099,15 +5093,15 @@ const ct = "USD", Ks = (e, t = ct) => {
5099
5093
  )
5100
5094
  ] })
5101
5095
  ] }),
5102
- Nt && Zr(
5096
+ St && Gr(
5103
5097
  {
5104
- ...X,
5098
+ ...me,
5105
5099
  address: JSON.parse(
5106
5100
  localStorage.getItem("agentic_order_address") || "null"
5107
5101
  ),
5108
5102
  delivery: localStorage.getItem("agentic_order_delivery"),
5109
5103
  payment: localStorage.getItem("agentic_order_payment"),
5110
- summary: Jr(X == null ? void 0 : X.currency)
5104
+ summary: Vr(me == null ? void 0 : me.currency)
5111
5105
  },
5112
5106
  !1
5113
5107
  )
@@ -5118,13 +5112,13 @@ const ct = "USD", Ks = (e, t = ct) => {
5118
5112
  /* @__PURE__ */ a(
5119
5113
  "input",
5120
5114
  {
5121
- placeholder: Se ? "Complete the current step…" : Ft ? `What would you like me to do? (e.g., If this product goes below $${parseInt(r.price) - 5}, grab it for me.)` : "Please select a combination first.",
5115
+ placeholder: Se ? "Complete the current step…" : Pt ? `What would you like me to do? (e.g., If this product goes below $${parseInt(r.price) - 5}, grab it for me.)` : "Please select a combination first.",
5122
5116
  disabled: ko,
5123
5117
  className: `w-full rounded-full p-4 outline-none border-none focus:ring-0 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed
5124
- ${Ft ? "" : "placeholder:text-red-400 text-red-500"}`,
5118
+ ${Pt ? "" : "placeholder:text-red-400 text-red-500"}`,
5125
5119
  value: z,
5126
5120
  onKeyDown: (u) => {
5127
- u.key === "Enter" && !Ie && !Se && Kr();
5121
+ u.key === "Enter" && !Ie && !Se && Yr();
5128
5122
  },
5129
5123
  onChange: (u) => Te(u.target.value)
5130
5124
  }
@@ -5136,7 +5130,7 @@ const ct = "USD", Ks = (e, t = ct) => {
5136
5130
  disabled: Ie || Se,
5137
5131
  className: "mr-6 font-medium",
5138
5132
  style: { color: "var(--tanya-light)" },
5139
- onClick: () => Kr(),
5133
+ onClick: () => Yr(),
5140
5134
  children: Ie ? /* @__PURE__ */ a(
5141
5135
  "div",
5142
5136
  {
@@ -5144,7 +5138,7 @@ const ct = "USD", Ks = (e, t = ct) => {
5144
5138
  style: { borderBottom: "2px solid" }
5145
5139
  }
5146
5140
  ) : /* @__PURE__ */ a(
5147
- ce,
5141
+ de,
5148
5142
  {
5149
5143
  icon: "fluent:send-48-filled",
5150
5144
  color: "var(--tanya-light)",