@chrryai/chrry 1.6.64 → 1.6.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3129,7 +3129,7 @@ var init_utils = __esm({
3129
3129
  };
3130
3130
  isFirefox = typeof navigator !== "undefined" && navigator?.userAgent?.includes("Firefox");
3131
3131
  config = getSiteConfig(getClientHostname());
3132
- VERSION = config.version || "1.6.64";
3132
+ VERSION = config.version || "1.6.67";
3133
3133
  getSlugFromPathname = (path) => {
3134
3134
  return getAppAndStoreSlugs(path, {
3135
3135
  defaultAppSlug: config.slug,
@@ -23887,7 +23887,11 @@ function AuthProvider({
23887
23887
  return true;
23888
23888
  }
23889
23889
  });
23890
- const [threadId, setThreadId] = (0, import_react20.useState)(getThreadId(pathname));
23890
+ const threadIdRef = (0, import_react20.useRef)(getThreadId(pathname));
23891
+ const threadId = threadIdRef.current;
23892
+ const setThreadId = (id) => {
23893
+ threadIdRef.current = id;
23894
+ };
23891
23895
  (0, import_react20.useEffect)(() => {
23892
23896
  const id = getThreadId(pathname);
23893
23897
  if (id) {
@@ -24242,7 +24246,7 @@ function AuthProvider({
24242
24246
  const setApp = (0, import_react20.useCallback)(
24243
24247
  (item) => {
24244
24248
  if (!item) return;
24245
- (item?.id !== baseApp?.id || !isExtension2) && setLastAppId(item?.id);
24249
+ setLastAppId(item?.id);
24246
24250
  setAppInternal((prevApp) => {
24247
24251
  const newApp2 = item ? {
24248
24252
  ...item,
@@ -24261,7 +24265,13 @@ function AuthProvider({
24261
24265
  },
24262
24266
  [setColorScheme, setAppTheme, baseApp, mergeApps]
24263
24267
  );
24264
- const [thread2, setThread] = (0, import_react20.useState)(props.thread?.thread);
24268
+ const [thread2, setThreadInternal] = (0, import_react20.useState)(
24269
+ props.thread?.thread
24270
+ );
24271
+ const setThread = (thread3) => {
24272
+ setThreadInternal(thread3);
24273
+ setThreadId(thread3?.id);
24274
+ };
24265
24275
  const [tasks, setTasks] = (0, import_react20.useState)(void 0);
24266
24276
  (0, import_react20.useEffect)(() => {
24267
24277
  if (!threadId) {
@@ -24446,6 +24456,13 @@ function AuthProvider({
24446
24456
  showAccountStatusRef.current = true;
24447
24457
  }
24448
24458
  }, [isLoggedOut, isWelcome]);
24459
+ const auth_token = searchParams.get("auth_token");
24460
+ (0, import_react20.useEffect)(() => {
24461
+ const params = new URLSearchParams(window.location.search);
24462
+ if (auth_token) {
24463
+ removeParams("auth_token");
24464
+ }
24465
+ }, [searchParams]);
24449
24466
  return /* @__PURE__ */ import_react20.default.createElement(
24450
24467
  AuthContext.Provider,
24451
24468
  {
@@ -24658,12 +24675,12 @@ function DataProvider({ children, ...rest }) {
24658
24675
  const [instructions, setInstructions] = (0, import_react21.useState)([]);
24659
24676
  const [affiliateStats, setAffiliateStats] = (0, import_react21.useState)(null);
24660
24677
  const [loadingAffiliateStats, setLoadingAffiliateStats] = (0, import_react21.useState)(false);
24661
- const VERSION4 = "1.6.64";
24678
+ const VERSION4 = "1.6.67";
24662
24679
  const [weather, setWeather] = useLocalStorage2("weather", user?.weather || guest?.weather || void 0);
24663
24680
  const {
24664
24681
  API_URL: API_URL2,
24665
24682
  WS_URL: WS_URL2,
24666
- FRONTEND_URL: FRONTEND_URL2,
24683
+ FRONTEND_URL: FRONTEND_URL3,
24667
24684
  PROD_FRONTEND_URL: PROD_FRONTEND_URL2,
24668
24685
  env,
24669
24686
  setEnv,
@@ -24905,7 +24922,7 @@ function DataProvider({ children, ...rest }) {
24905
24922
  WS_URL: WS_URL2,
24906
24923
  TEST_GUEST_FINGERPRINTS,
24907
24924
  TEST_MEMBER_FINGERPRINTS,
24908
- FRONTEND_URL: FRONTEND_URL2,
24925
+ FRONTEND_URL: FRONTEND_URL3,
24909
24926
  PROMPT_LIMITS: PROMPT_LIMITS2,
24910
24927
  setPromptLimits,
24911
24928
  setToken,
@@ -24963,7 +24980,7 @@ function Toast({ containerStyle, toastOptions }) {
24963
24980
  return null;
24964
24981
  }
24965
24982
  function VexToast() {
24966
- const { FRONTEND_URL: FRONTEND_URL2 } = useData();
24983
+ const { FRONTEND_URL: FRONTEND_URL3 } = useData();
24967
24984
  const toastConfig = {
24968
24985
  containerStyle: {
24969
24986
  zIndex: 1e4
@@ -24981,7 +24998,7 @@ function VexToast() {
24981
24998
  icon: /* @__PURE__ */ import_react22.default.createElement(
24982
24999
  "img",
24983
25000
  {
24984
- src: `${FRONTEND_URL2}/frog.png`,
25001
+ src: `${FRONTEND_URL3}/frog.png`,
24985
25002
  width: 24,
24986
25003
  height: 24,
24987
25004
  alt: "Success"
@@ -24993,7 +25010,7 @@ function VexToast() {
24993
25010
  icon: /* @__PURE__ */ import_react22.default.createElement(
24994
25011
  "img",
24995
25012
  {
24996
- src: `${FRONTEND_URL2}/hamster.png`,
25013
+ src: `${FRONTEND_URL3}/hamster.png`,
24997
25014
  width: 24,
24998
25015
  height: 24,
24999
25016
  alt: "Error"
@@ -26587,6 +26604,7 @@ function ChatProvider({
26587
26604
  setCollaborationStep(0);
26588
26605
  setThread(void 0);
26589
26606
  setProfile(void 0);
26607
+ setThreadId(void 0);
26590
26608
  setMessages([]);
26591
26609
  setStatus(null);
26592
26610
  isIncognito && setWasIncognito(true);
@@ -26848,14 +26866,12 @@ function ChatProvider({
26848
26866
  setIsLoading(!!threadId);
26849
26867
  }, [threadId]);
26850
26868
  const [status, setStatus] = (0, import_react29.useState)(null);
26851
- const keyParts = { threadId, liked, until };
26852
- const finalKey = Object.entries(keyParts).filter(([_, value]) => value !== void 0 && value !== null).map(([key, value]) => `${key}-${value}`).join("-") || "thread";
26853
26869
  const {
26854
26870
  data: threadSWR,
26855
26871
  mutate,
26856
26872
  error
26857
26873
  } = (0, import_swr3.default)(
26858
- shouldFetchThread && token && threadId ? [finalKey] : null,
26874
+ shouldFetchThread && token && threadId ? [threadId, liked, until] : null,
26859
26875
  async () => {
26860
26876
  if (!threadId) return;
26861
26877
  const threadData2 = await actions.getThread({
@@ -31083,9 +31099,9 @@ function Logo({
31083
31099
  app
31084
31100
  }) {
31085
31101
  const { isExtension: isExtension2 } = usePlatform();
31086
- const { FRONTEND_URL: FRONTEND_URL2 } = useData();
31087
- const logoSrc = isLifeOS ? `${FRONTEND_URL2}/icons/lifeOS-128.png` : isExtension2 ? `/icons/icon-128${isMagenta ? "-m" : ""}${isVivid ? "-v" : ""}.png` : `${FRONTEND_URL2}/icons/icon-128${isMagenta ? "-m" : ""}${isVivid ? "-v" : ""}.png`;
31088
- const appImage = slug ? `${FRONTEND_URL2}/images/apps/${slug.toLowerCase()}.png` : app && ["atlas", "bloom", "vault", "peach"].includes(app.slug) ? `${FRONTEND_URL2}/images/apps/${app.slug}.png` : app?.images?.[0]?.url ? app?.images?.[0]?.url : app ? `${FRONTEND_URL2}/images/pacman/space-invader.png` : logoSrc;
31102
+ const { FRONTEND_URL: FRONTEND_URL3 } = useData();
31103
+ const logoSrc = isLifeOS ? `${FRONTEND_URL3}/icons/lifeOS-128.png` : isExtension2 ? `/icons/icon-128${isMagenta ? "-m" : ""}${isVivid ? "-v" : ""}.png` : `${FRONTEND_URL3}/icons/icon-128${isMagenta ? "-m" : ""}${isVivid ? "-v" : ""}.png`;
31104
+ const appImage = slug ? `${FRONTEND_URL3}/images/apps/${slug.toLowerCase()}.png` : app && ["atlas", "bloom", "vault", "peach"].includes(app.slug) ? `${FRONTEND_URL3}/images/apps/${app.slug}.png` : app?.images?.[0]?.url ? app?.images?.[0]?.url : app ? `${FRONTEND_URL3}/images/pacman/space-invader.png` : logoSrc;
31089
31105
  return /* @__PURE__ */ import_react40.default.createElement(
31090
31106
  Img,
31091
31107
  {
@@ -33999,16 +34015,16 @@ function Anchor({
33999
34015
  preventDefault,
34000
34016
  ...props
34001
34017
  }) {
34002
- const { FRONTEND_URL: FRONTEND_URL2 } = useData();
34018
+ const { FRONTEND_URL: FRONTEND_URL3 } = useData();
34003
34019
  const { addHapticFeedback } = useTheme2();
34004
34020
  const { isExtension: isExtension2, BrowserInstance: BrowserInstance3 } = usePlatform();
34005
34021
  const router = useNavigation();
34006
34022
  const isExternalUrl = (url) => {
34007
34023
  if (openInNewTab) return true;
34008
34024
  if (!url) return false;
34009
- return (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("mailto:") || url.startsWith("//")) && !url.startsWith(FRONTEND_URL2);
34025
+ return (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("mailto:") || url.startsWith("//")) && !url.startsWith(FRONTEND_URL3);
34010
34026
  };
34011
- const href = !openInNewTab && props.href?.startsWith(FRONTEND_URL2) ? props.href.replace(FRONTEND_URL2, "") || "/" : props.href;
34027
+ const href = !openInNewTab && props.href?.startsWith(FRONTEND_URL3) ? props.href.replace(FRONTEND_URL3, "") || "/" : props.href;
34012
34028
  return /* @__PURE__ */ import_react49.default.createElement(
34013
34029
  A,
34014
34030
  {
@@ -35532,7 +35548,7 @@ function App({
35532
35548
  hasStoreApps,
35533
35549
  setLoadingApp
35534
35550
  } = useAuth();
35535
- const { FRONTEND_URL: FRONTEND_URL2, API_URL: API_URL2 } = useData();
35551
+ const { FRONTEND_URL: FRONTEND_URL3, API_URL: API_URL2 } = useData();
35536
35552
  const { router, getStoreSlug } = useNavigationContext();
35537
35553
  const { setInput, setIsWebSearchEnabled, setIsNewAppChat } = useChat();
35538
35554
  const { addHapticFeedback } = useTheme2();
@@ -36143,7 +36159,7 @@ function App({
36143
36159
  ), !isManagingApp && /* @__PURE__ */ import_react53.default.createElement(
36144
36160
  Anchor,
36145
36161
  {
36146
- href: `${FRONTEND_URL2}/calendar`,
36162
+ href: `${FRONTEND_URL3}/calendar`,
36147
36163
  title: t5("Organize your life"),
36148
36164
  openInNewTab: isExtension2 && isFirefox2,
36149
36165
  className: "button transparent",
@@ -37335,7 +37351,7 @@ function Chat({
37335
37351
  track,
37336
37352
  deviceId,
37337
37353
  API_URL: API_URL2,
37338
- FRONTEND_URL: FRONTEND_URL2,
37354
+ FRONTEND_URL: FRONTEND_URL3,
37339
37355
  chrry,
37340
37356
  app,
37341
37357
  sushiAgent,
@@ -39213,7 +39229,7 @@ function Chat({
39213
39229
  needsReview ? /* @__PURE__ */ React.createElement(Span, { "data-testid": "chat-accept-button" }, /* @__PURE__ */ React.createElement(icons_exports.CircleCheck, { size: 30, color: "var(--accent-6)" })) : /* @__PURE__ */ React.createElement(Div, { title: t5("Sound"), style: styles4.videoContainer.style }, needsReview ? /* @__PURE__ */ React.createElement(Span, { "data-testid": "chat-accept-button" }, /* @__PURE__ */ React.createElement(icons_exports.CircleCheck, { size: 30, color: "var(--accent-6)" })) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
39214
39230
  Video_web_default,
39215
39231
  {
39216
- src: `${FRONTEND_URL2}/video/blob.mp4`,
39232
+ src: `${FRONTEND_URL3}/video/blob.mp4`,
39217
39233
  style: styles4.video.style,
39218
39234
  loop: true,
39219
39235
  autoPlay: true,
@@ -42344,7 +42360,7 @@ function Account({ style }) {
42344
42360
  signInContext,
42345
42361
  signOutContext,
42346
42362
  isExtensionRedirect,
42347
- FRONTEND_URL: FRONTEND_URL2,
42363
+ FRONTEND_URL: FRONTEND_URL3,
42348
42364
  API_URL: API_URL2
42349
42365
  } = useAuth();
42350
42366
  const { isAccountVisible: isModalOpen, setIsAccountVisible: setIsModalOpen } = useNavigationContext();
@@ -42431,12 +42447,12 @@ function Account({ style }) {
42431
42447
  await signOut();
42432
42448
  BrowserInstance?.runtime?.sendMessage({
42433
42449
  action: "openInSameTab",
42434
- url: `${FRONTEND_URL2}?account=true&logout=true&extension=true`
42450
+ url: `${FRONTEND_URL3}?account=true&logout=true&extension=true`
42435
42451
  });
42436
42452
  }
42437
42453
  await signOut();
42438
42454
  !isExtension2 && signOutContext?.({
42439
- callbackUrl: `${FRONTEND_URL2}/?loggedOut=true${isExtensionRedirect ? "&extension=true" : ""}`
42455
+ callbackUrl: `${FRONTEND_URL3}/?loggedOut=true${isExtensionRedirect ? "&extension=true" : ""}`
42440
42456
  });
42441
42457
  const searchParams2 = new URLSearchParams(window.location.search);
42442
42458
  searchParams2.delete("account");
@@ -42550,7 +42566,7 @@ function Account({ style }) {
42550
42566
  Img,
42551
42567
  {
42552
42568
  showLoading: false,
42553
- src: `${FRONTEND_URL2}/images/pacman/space-invader.png`,
42569
+ src: `${FRONTEND_URL3}/images/pacman/space-invader.png`,
42554
42570
  alt: "Space Invader",
42555
42571
  width: 40,
42556
42572
  height: 40
@@ -42771,7 +42787,7 @@ function SignIn({
42771
42787
  };
42772
42788
  const { t: t5 } = useAppContext();
42773
42789
  const {
42774
- FRONTEND_URL: FRONTEND_URL2,
42790
+ FRONTEND_URL: FRONTEND_URL3,
42775
42791
  isE2E: isE2E3,
42776
42792
  isCI: isCI2,
42777
42793
  API_URL: API_URL2,
@@ -42812,7 +42828,7 @@ function SignIn({
42812
42828
  if (isExtension2) {
42813
42829
  BrowserInstance?.runtime?.sendMessage({
42814
42830
  action: "openInSameTab",
42815
- url: `${FRONTEND_URL2}?signIn=${part2}&extension=true`
42831
+ url: `${FRONTEND_URL3}?signIn=${part2}&extension=true`
42816
42832
  });
42817
42833
  return;
42818
42834
  }
@@ -42830,7 +42846,7 @@ function SignIn({
42830
42846
  isCallbackUrlURI = false;
42831
42847
  }
42832
42848
  }
42833
- const baseUrl = isDevelopment ? FRONTEND_URL2 : "https://chrry.ai";
42849
+ const baseUrl = isDevelopment ? FRONTEND_URL3 : "https://chrry.ai";
42834
42850
  const errorUrl = new URL(baseUrl + "/?signIn=login&error");
42835
42851
  const successUrl = new URL(
42836
42852
  callbackUrl ? isCallbackUrlURI ? callbackUrl : baseUrl + callbackUrl : baseUrl
@@ -43001,7 +43017,7 @@ function SignIn({
43001
43017
  if (isExtension2) {
43002
43018
  BrowserInstance?.runtime?.sendMessage({
43003
43019
  action: "openInSameTab",
43004
- url: `${FRONTEND_URL2}?subscribe=true&plan=${plan}`
43020
+ url: `${FRONTEND_URL3}?subscribe=true&plan=${plan}`
43005
43021
  });
43006
43022
  return;
43007
43023
  }
@@ -43026,7 +43042,7 @@ function SignIn({
43026
43042
  "video",
43027
43043
  {
43028
43044
  className: import_SignIn_module.default.video,
43029
- src: `${FRONTEND_URL2}/video/blob.mp4`,
43045
+ src: `${FRONTEND_URL3}/video/blob.mp4`,
43030
43046
  autoPlay: true,
43031
43047
  loop: true,
43032
43048
  muted: true,
@@ -43074,7 +43090,7 @@ function SignIn({
43074
43090
  "a",
43075
43091
  {
43076
43092
  target: "_blank",
43077
- href: `${FRONTEND_URL2}/privacy`,
43093
+ href: `${FRONTEND_URL3}/privacy`,
43078
43094
  className: "button small transparent",
43079
43095
  onClick: (e) => {
43080
43096
  if (e.metaKey || e.ctrlKey) {
@@ -43084,11 +43100,11 @@ function SignIn({
43084
43100
  if (checkIsExtension()) {
43085
43101
  BrowserInstance?.runtime?.sendMessage({
43086
43102
  action: "openInSameTab",
43087
- url: `${FRONTEND_URL2}/privacy`
43103
+ url: `${FRONTEND_URL3}/privacy`
43088
43104
  });
43089
43105
  return;
43090
43106
  }
43091
- window.open(`${FRONTEND_URL2}/privacy`, "_blank");
43107
+ window.open(`${FRONTEND_URL3}/privacy`, "_blank");
43092
43108
  }
43093
43109
  },
43094
43110
  /* @__PURE__ */ import_react64.default.createElement(icons_exports.LinkIcon, { size: 16 }),
@@ -43625,7 +43641,7 @@ function Subscribe({
43625
43641
  const {
43626
43642
  affiliateCode,
43627
43643
  API_URL: API_URL2,
43628
- FRONTEND_URL: FRONTEND_URL2,
43644
+ FRONTEND_URL: FRONTEND_URL3,
43629
43645
  ADDITIONAL_CREDITS: ADDITIONAL_CREDITS2,
43630
43646
  CREDITS_PRICE: CREDITS_PRICE2,
43631
43647
  FREE_DAYS: FREE_DAYS2,
@@ -43669,11 +43685,11 @@ function Subscribe({
43669
43685
  const checkoutSuccessUrl = (() => {
43670
43686
  params.set("checkout", "success");
43671
43687
  params.set("purchaseType", part2);
43672
- return `${FRONTEND_URL2}/?${params.toString()}&session_id={CHECKOUT_SESSION_ID}`;
43688
+ return `${FRONTEND_URL3}/?${params.toString()}&session_id={CHECKOUT_SESSION_ID}`;
43673
43689
  })();
43674
43690
  const checkoutCancelUrl = (() => {
43675
43691
  params.set("checkout", "cancel");
43676
- return `${FRONTEND_URL2}/?${params.toString()}`;
43692
+ return `${FRONTEND_URL3}/?${params.toString()}`;
43677
43693
  })();
43678
43694
  console.log("Checkout success URL:", checkoutSuccessUrl);
43679
43695
  console.log("Checkout cancel URL:", checkoutCancelUrl);
@@ -44365,7 +44381,7 @@ function Subscribe({
44365
44381
  if (isExtension2) {
44366
44382
  BrowserInstance3?.runtime?.sendMessage({
44367
44383
  action: "openInSameTab",
44368
- url: `${FRONTEND_URL2}?subscribe=true&extension=true&plan=${subs.plan}`
44384
+ url: `${FRONTEND_URL3}?subscribe=true&extension=true&plan=${subs.plan}`
44369
44385
  });
44370
44386
  return;
44371
44387
  }
@@ -44397,7 +44413,7 @@ function Subscribe({
44397
44413
  if (isExtension2) {
44398
44414
  BrowserInstance3?.runtime?.sendMessage({
44399
44415
  action: "openInSameTab",
44400
- url: `${FRONTEND_URL2}?subscribe=true&extension=true`
44416
+ url: `${FRONTEND_URL3}?subscribe=true&extension=true`
44401
44417
  });
44402
44418
  return;
44403
44419
  }
@@ -44612,7 +44628,7 @@ function Version() {
44612
44628
  const { showAddToHomeScreen, setShowAddToHomeScreen } = useNavigationContext();
44613
44629
  const { t: t5 } = (0, import_react_i18next6.useTranslation)();
44614
44630
  const { os, isStandalone: isStandalone2, isFirefox: isFirefox2, isExtension: isExtension2, BrowserInstance: BrowserInstance3 } = usePlatform();
44615
- const { FRONTEND_URL: FRONTEND_URL2 } = useData();
44631
+ const { FRONTEND_URL: FRONTEND_URL3 } = useData();
44616
44632
  const styles4 = useVersionStyles();
44617
44633
  const { utilities } = useStyles();
44618
44634
  return /* @__PURE__ */ import_react67.default.createElement(Div, null, needsUpdateModalOpen && versions && /* @__PURE__ */ import_react67.default.createElement(
@@ -44628,7 +44644,7 @@ function Version() {
44628
44644
  Video_web_default,
44629
44645
  {
44630
44646
  style: styles4.video.style,
44631
- src: `${FRONTEND_URL2}/video/blob.mp4`,
44647
+ src: `${FRONTEND_URL3}/video/blob.mp4`,
44632
44648
  autoPlay: true,
44633
44649
  loop: true,
44634
44650
  muted: true,
@@ -44637,7 +44653,7 @@ function Version() {
44637
44653
  ),
44638
44654
  title: /* @__PURE__ */ import_react67.default.createElement(Div, null, t5("Thinking"), "...")
44639
44655
  },
44640
- /* @__PURE__ */ import_react67.default.createElement(Div, { style: styles4.updateModalDescription.style }, /* @__PURE__ */ import_react67.default.createElement(Img, { src: `${FRONTEND_URL2}/hamster.png`, width: 24, height: 24 }), /* @__PURE__ */ import_react67.default.createElement(Span, null, t5("Let's update your app to the latest version"), " ", isStandalone2 ? null : isFirefox2 ? versions.firefoxVersion : versions.chromeVersion)),
44656
+ /* @__PURE__ */ import_react67.default.createElement(Div, { style: styles4.updateModalDescription.style }, /* @__PURE__ */ import_react67.default.createElement(Img, { src: `${FRONTEND_URL3}/hamster.png`, width: 24, height: 24 }), /* @__PURE__ */ import_react67.default.createElement(Span, null, t5("Let's update your app to the latest version"), " ", isStandalone2 ? null : isFirefox2 ? versions.firefoxVersion : versions.chromeVersion)),
44641
44657
  /* @__PURE__ */ import_react67.default.createElement(Div, { style: styles4.updateModalButtons.style }, os && ["ios", "android"].includes(os) ? /* @__PURE__ */ import_react67.default.createElement(
44642
44658
  Button,
44643
44659
  {
@@ -44921,9 +44937,8 @@ function Skeleton({
44921
44937
  const { isEmpty } = useChat();
44922
44938
  const { pathname, setIsNewChat, hasNotification } = useNavigationContext();
44923
44939
  const { isDrawerOpen, setIsDrawerOpen, isSmallDevice, isMobileDevice } = useTheme2();
44924
- console.log(`\u{1F680} ~ isSmallDevice:`, isSmallDevice);
44925
44940
  const { isStandalone: isStandalone2 } = usePlatform();
44926
- const { FRONTEND_URL: FRONTEND_URL2 } = useData();
44941
+ const { FRONTEND_URL: FRONTEND_URL3 } = useData();
44927
44942
  const { app, isRemovingApp, isSavingApp } = useApp();
44928
44943
  const { addHapticFeedback } = useTheme2();
44929
44944
  const toggleMenu = () => {
@@ -44934,8 +44949,8 @@ function Skeleton({
44934
44949
  const isHome = pathname === "/" || pathname === "";
44935
44950
  (0, import_react70.useEffect)(() => {
44936
44951
  const preloadImages = [
44937
- `${FRONTEND_URL2}/frog.png`,
44938
- `${FRONTEND_URL2}/hamster.png`
44952
+ `${FRONTEND_URL3}/frog.png`,
44953
+ `${FRONTEND_URL3}/hamster.png`
44939
44954
  ];
44940
44955
  if (typeof Image !== "undefined") {
44941
44956
  preloadImages.forEach((src) => {
@@ -45093,7 +45108,7 @@ function Store({
45093
45108
  slug,
45094
45109
  ...rest
45095
45110
  }) {
45096
- const { FRONTEND_URL: FRONTEND_URL2 } = useData();
45111
+ const { FRONTEND_URL: FRONTEND_URL3 } = useData();
45097
45112
  const { isMobileDevice } = useTheme2();
45098
45113
  const { utilities } = useStyles();
45099
45114
  const { router, searchParams } = useNavigationContext();
@@ -45192,7 +45207,7 @@ function Store({
45192
45207
  ImageComponent,
45193
45208
  {
45194
45209
  showLoading: false,
45195
- src: `${FRONTEND_URL2}/images/pacman/space-invader.png`,
45210
+ src: `${FRONTEND_URL3}/images/pacman/space-invader.png`,
45196
45211
  alt: "Space Invader",
45197
45212
  size: 28
45198
45213
  }
@@ -45200,7 +45215,7 @@ function Store({
45200
45215
  ImageComponent,
45201
45216
  {
45202
45217
  showLoading: false,
45203
- src: `${FRONTEND_URL2}/images/pacman/pacman.png`,
45218
+ src: `${FRONTEND_URL3}/images/pacman/pacman.png`,
45204
45219
  alt: "Pacman",
45205
45220
  size: 28
45206
45221
  }
@@ -45209,7 +45224,7 @@ function Store({
45209
45224
  {
45210
45225
  style: { marginLeft: "auto" },
45211
45226
  showLoading: false,
45212
- src: `${FRONTEND_URL2}/images/pacman/heart.png`,
45227
+ src: `${FRONTEND_URL3}/images/pacman/heart.png`,
45213
45228
  alt: "Heart",
45214
45229
  size: 28
45215
45230
  }
@@ -45334,7 +45349,7 @@ function Store({
45334
45349
  ImageComponent,
45335
45350
  {
45336
45351
  showLoading: false,
45337
- src: `${FRONTEND_URL2}/images/pacman/tetris1.png`,
45352
+ src: `${FRONTEND_URL3}/images/pacman/tetris1.png`,
45338
45353
  alt: "Tetris 1",
45339
45354
  width: 28,
45340
45355
  height: 28
@@ -45343,7 +45358,7 @@ function Store({
45343
45358
  ImageComponent,
45344
45359
  {
45345
45360
  showLoading: false,
45346
- src: `${FRONTEND_URL2}/images/pacman/tetris2.png`,
45361
+ src: `${FRONTEND_URL3}/images/pacman/tetris2.png`,
45347
45362
  alt: "Tetris 2",
45348
45363
  width: 28,
45349
45364
  height: 28
@@ -46079,7 +46094,7 @@ function Message({
46079
46094
  user,
46080
46095
  guest,
46081
46096
  API_URL: API_URL2,
46082
- FRONTEND_URL: FRONTEND_URL2,
46097
+ FRONTEND_URL: FRONTEND_URL3,
46083
46098
  setUser,
46084
46099
  setGuest,
46085
46100
  deviceId,
@@ -46509,7 +46524,7 @@ function Message({
46509
46524
  ImageComponent,
46510
46525
  {
46511
46526
  showLoading: false,
46512
- src: `${FRONTEND_URL2}/images/pacman/space-invader.png`,
46527
+ src: `${FRONTEND_URL3}/images/pacman/space-invader.png`,
46513
46528
  alt: "Space Invader",
46514
46529
  width: 35,
46515
46530
  height: 35
@@ -46552,7 +46567,7 @@ function Message({
46552
46567
  ImageComponent,
46553
46568
  {
46554
46569
  showLoading: false,
46555
- src: `${FRONTEND_URL2}/images/pacman/space-invader.png`,
46570
+ src: `${FRONTEND_URL3}/images/pacman/space-invader.png`,
46556
46571
  alt: "Space Invader",
46557
46572
  width: 35,
46558
46573
  height: 35
@@ -46740,7 +46755,7 @@ function Message({
46740
46755
  ImageComponent,
46741
46756
  {
46742
46757
  showLoading: false,
46743
- src: `${FRONTEND_URL2}/images/pacman/space-invader.png`,
46758
+ src: `${FRONTEND_URL3}/images/pacman/space-invader.png`,
46744
46759
  alt: "Space Invader",
46745
46760
  size: 35
46746
46761
  }
@@ -46811,7 +46826,7 @@ function Message({
46811
46826
  message2.message.isStreaming && message2.message.content.trim() === "" ? /* @__PURE__ */ React.createElement(Div, { style: styles4.thinking.style }, /* @__PURE__ */ React.createElement(
46812
46827
  ImageComponent,
46813
46828
  {
46814
- src: `${FRONTEND_URL2}/${evenChance ? "frog" : "hamster"}.png`,
46829
+ src: `${FRONTEND_URL3}/${evenChance ? "frog" : "hamster"}.png`,
46815
46830
  width: 21,
46816
46831
  height: 21
46817
46832
  }
@@ -47124,7 +47139,7 @@ var init_Messages = __esm({
47124
47139
  user,
47125
47140
  guest,
47126
47141
  setShowCharacterProfiles,
47127
- FRONTEND_URL: FRONTEND_URL2
47142
+ FRONTEND_URL: FRONTEND_URL3
47128
47143
  } = useAuth();
47129
47144
  const { threadId, scrollToBottom } = useChat();
47130
47145
  const { router } = useNavigationContext();
@@ -47248,7 +47263,7 @@ var init_Messages = __esm({
47248
47263
  Video_web_default,
47249
47264
  {
47250
47265
  style: { ...styles4.video.style },
47251
- src: `${FRONTEND_URL2}/video/blob.mp4`,
47266
+ src: `${FRONTEND_URL3}/video/blob.mp4`,
47252
47267
  autoPlay: true,
47253
47268
  loop: true,
47254
47269
  muted: true,
@@ -47666,13 +47681,13 @@ function Share3({
47666
47681
  const [isOpen, setIsOpen] = (0, import_react78.useState)(false);
47667
47682
  const [copied, setCopied] = (0, import_react78.useState)(false);
47668
47683
  const { collaborationStep } = useNavigationContext();
47669
- const { token, FRONTEND_URL: FRONTEND_URL2, API_URL: API_URL2 } = useAuth();
47684
+ const { token, FRONTEND_URL: FRONTEND_URL3, API_URL: API_URL2 } = useAuth();
47670
47685
  const { t: t5 } = useAppContext();
47671
47686
  const [visibility, setVisibility] = (0, import_react78.useState)(thread2.visibility);
47672
47687
  const copyToClipboard = async () => {
47673
47688
  try {
47674
47689
  await navigator.clipboard.writeText(
47675
- `${FRONTEND_URL2}/threads/${thread2.id}`
47690
+ `${FRONTEND_URL3}/threads/${thread2.id}`
47676
47691
  );
47677
47692
  setCopied(true);
47678
47693
  import_react_hot_toast18.default.success(t5("Copied"));
@@ -47927,7 +47942,7 @@ function Share3({
47927
47942
  "data-testid": `${dataTestId}share-input`,
47928
47943
  style: styles4.shareModalInput.style,
47929
47944
  type: "text",
47930
- value: `${FRONTEND_URL2}/threads/${thread2.id}`
47945
+ value: `${FRONTEND_URL3}/threads/${thread2.id}`
47931
47946
  }
47932
47947
  ), /* @__PURE__ */ import_react78.default.createElement(
47933
47948
  Button,
@@ -48060,7 +48075,7 @@ function Share3({
48060
48075
  {
48061
48076
  style: styles4.shareModalInput.style,
48062
48077
  type: "text",
48063
- value: `${FRONTEND_URL2}/threads/${thread2.id}`
48078
+ value: `${FRONTEND_URL3}/threads/${thread2.id}`
48064
48079
  }
48065
48080
  ), /* @__PURE__ */ import_react78.default.createElement(
48066
48081
  Button,
@@ -63603,7 +63618,7 @@ function About2() {
63603
63618
  const {
63604
63619
  ADDITIONAL_CREDITS: ADDITIONAL_CREDITS2,
63605
63620
  CREDITS_PRICE: CREDITS_PRICE2,
63606
- FRONTEND_URL: FRONTEND_URL2,
63621
+ FRONTEND_URL: FRONTEND_URL3,
63607
63622
  PLUS_PRICE: PLUS_PRICE2,
63608
63623
  PRO_PRICE: PRO_PRICE2
63609
63624
  } = useData();
@@ -63651,21 +63666,21 @@ function About2() {
63651
63666
  e.preventDefault();
63652
63667
  router.push("/why");
63653
63668
  },
63654
- href: isStandalone2 ? void 0 : `${FRONTEND_URL2}/why`
63669
+ href: isStandalone2 ? void 0 : `${FRONTEND_URL3}/why`
63655
63670
  },
63656
63671
  t5("why_vex")
63657
63672
  ), config2.mode === "vex" && /* @__PURE__ */ import_react94.default.createElement(import_react94.default.Fragment, null, ", ", /* @__PURE__ */ import_react94.default.createElement(
63658
63673
  Anchor,
63659
63674
  {
63660
63675
  openInNewTab: true,
63661
- href: `${FRONTEND_URL2}/blog`,
63676
+ href: `${FRONTEND_URL3}/blog`,
63662
63677
  onClick: (e) => {
63663
63678
  addHapticFeedback();
63664
63679
  if (e.metaKey || e.ctrlKey) {
63665
63680
  return;
63666
63681
  }
63667
63682
  e.preventDefault();
63668
- window.location.href = `${FRONTEND_URL2}/blog`;
63683
+ window.location.href = `${FRONTEND_URL3}/blog`;
63669
63684
  }
63670
63685
  },
63671
63686
  t5("Blog")
@@ -63680,7 +63695,7 @@ function About2() {
63680
63695
  e.preventDefault();
63681
63696
  router.push("/terms");
63682
63697
  },
63683
- href: isStandalone2 ? void 0 : `${FRONTEND_URL2}/terms`
63698
+ href: isStandalone2 ? void 0 : `${FRONTEND_URL3}/terms`
63684
63699
  },
63685
63700
  t5("Terms of Use")
63686
63701
  ), ", ", /* @__PURE__ */ import_react94.default.createElement(
@@ -63694,7 +63709,7 @@ function About2() {
63694
63709
  e.preventDefault();
63695
63710
  router.push("/privacy");
63696
63711
  },
63697
- href: isStandalone2 ? void 0 : `${FRONTEND_URL2}/privacy`
63712
+ href: isStandalone2 ? void 0 : `${FRONTEND_URL3}/privacy`
63698
63713
  },
63699
63714
  t5("Privacy Policy")
63700
63715
  ), ", ", /* @__PURE__ */ import_react94.default.createElement("a", { href: "https://x.com/askvexai" }, "@askvexAI"), ", ", /* @__PURE__ */ import_react94.default.createElement("a", { href: "mailto:iliyan@chrry.ai" }, "iliyan@chrry.ai"))),
@@ -63738,7 +63753,7 @@ function About2() {
63738
63753
  if (checkIsExtension()) {
63739
63754
  BrowserInstance?.runtime?.sendMessage({
63740
63755
  action: "openInSameTab",
63741
- url: `${FRONTEND_URL2}/about?signIn=register`
63756
+ url: `${FRONTEND_URL3}/about?signIn=register`
63742
63757
  });
63743
63758
  return;
63744
63759
  }
@@ -63756,7 +63771,7 @@ function About2() {
63756
63771
  if (checkIsExtension()) {
63757
63772
  BrowserInstance?.runtime?.sendMessage({
63758
63773
  action: "openInSameTab",
63759
- url: `${FRONTEND_URL2}/about?subscribe=true&plan=credits`
63774
+ url: `${FRONTEND_URL3}/about?subscribe=true&plan=credits`
63760
63775
  });
63761
63776
  return;
63762
63777
  }
@@ -63793,7 +63808,7 @@ function About2() {
63793
63808
  if (checkIsExtension()) {
63794
63809
  BrowserInstance?.runtime?.sendMessage({
63795
63810
  action: "openInSameTab",
63796
- url: `${FRONTEND_URL2}/about?subscribe=true&plan=plus`
63811
+ url: `${FRONTEND_URL3}/about?subscribe=true&plan=plus`
63797
63812
  });
63798
63813
  return;
63799
63814
  }
@@ -63818,7 +63833,7 @@ function About2() {
63818
63833
  if (checkIsExtension()) {
63819
63834
  BrowserInstance?.runtime?.sendMessage({
63820
63835
  action: "openInSameTab",
63821
- url: `${FRONTEND_URL2}/about?subscribe=true&plan=pro`
63836
+ url: `${FRONTEND_URL3}/about?subscribe=true&plan=pro`
63822
63837
  });
63823
63838
  return;
63824
63839
  }
@@ -63998,7 +64013,7 @@ function About2() {
63998
64013
  "Claude"
63999
64014
  ))
64000
64015
  )),
64001
- /* @__PURE__ */ import_react94.default.createElement(Div, { style: styles4.lastUpdated.style }, /* @__PURE__ */ import_react94.default.createElement(ImageComponent, { src: `${FRONTEND_URL2}/hamster.png`, width: 24, height: 24 }), t5("about.last_updated", { date: "September 29, 2025" }))
64016
+ /* @__PURE__ */ import_react94.default.createElement(Div, { style: styles4.lastUpdated.style }, /* @__PURE__ */ import_react94.default.createElement(ImageComponent, { src: `${FRONTEND_URL3}/hamster.png`, width: 24, height: 24 }), t5("about.last_updated", { date: "September 29, 2025" }))
64002
64017
  ));
64003
64018
  }
64004
64019
  var import_react94, import_ri, import_bi, import_si, import_fa7;
@@ -64614,7 +64629,7 @@ var init_Collaborate = __esm({
64614
64629
  init_Collaborate_styles();
64615
64630
  Collaborate = ({ withUser }) => {
64616
64631
  const { addParams } = useNavigationContext();
64617
- const { token, user, API_URL: API_URL2, FRONTEND_URL: FRONTEND_URL2 } = useAuth();
64632
+ const { token, user, API_URL: API_URL2, FRONTEND_URL: FRONTEND_URL3 } = useAuth();
64618
64633
  const { t: t5 } = useAppContext();
64619
64634
  const { addHapticFeedback } = useTheme2();
64620
64635
  const [isOpen, setIsOpen] = (0, import_react97.useState)(false);
@@ -64630,7 +64645,7 @@ var init_Collaborate = __esm({
64630
64645
  if (checkIsExtension()) {
64631
64646
  BrowserInstance?.runtime?.sendMessage({
64632
64647
  action: "openInSameTab",
64633
- url: `${FRONTEND_URL2}/?signIn=register`
64648
+ url: `${FRONTEND_URL3}/?signIn=register`
64634
64649
  });
64635
64650
  return;
64636
64651
  }
@@ -65268,7 +65283,7 @@ var init_Affiliate_styles = __esm({
65268
65283
 
65269
65284
  // affiliate/Affiliate.tsx
65270
65285
  function Affiliate() {
65271
- const { user, token, API_URL: API_URL2, FRONTEND_URL: FRONTEND_URL2 } = useAuth();
65286
+ const { user, token, API_URL: API_URL2, FRONTEND_URL: FRONTEND_URL3 } = useAuth();
65272
65287
  const router = useNavigation();
65273
65288
  const { t: t5 } = useAppContext();
65274
65289
  const styles4 = useAffiliateStyles();
@@ -65308,7 +65323,7 @@ function Affiliate() {
65308
65323
  ImageComponent,
65309
65324
  {
65310
65325
  showLoading: false,
65311
- src: `${FRONTEND_URL2}/images/pacman/heart.png`,
65326
+ src: `${FRONTEND_URL3}/images/pacman/heart.png`,
65312
65327
  alt: "Heart",
65313
65328
  width: 50,
65314
65329
  height: 50
@@ -65701,7 +65716,7 @@ function AffiliateDashboard() {
65701
65716
  const styles4 = useAffiliateDashboardStyles();
65702
65717
  const { affiliateStats, refetchAffiliateData, loadingAffiliateStats } = useData();
65703
65718
  const { addHapticFeedback } = useTheme2();
65704
- const { user, token, API_URL: API_URL2, FRONTEND_URL: FRONTEND_URL2 } = useAuth();
65719
+ const { user, token, API_URL: API_URL2, FRONTEND_URL: FRONTEND_URL3 } = useAuth();
65705
65720
  const { router, setIsNewChat } = useNavigationContext();
65706
65721
  const copyLink = () => {
65707
65722
  if (affiliateStats?.affiliateLink) {
@@ -65807,7 +65822,7 @@ ${affiliateStats.affiliateLink}`
65807
65822
  })), /* @__PURE__ */ import_react100.default.createElement(P, { style: styles4.infoUlLi.style }, t5("Cookie Duration {{duration}}", { duration: "30 days" })), /* @__PURE__ */ import_react100.default.createElement(P, { style: styles4.infoUlLi.style }, t5("Minimum Payout {{payout}}", { payout: "\u20AC50" })))), /* @__PURE__ */ import_react100.default.createElement(Div, { style: styles4.footer.style }, /* @__PURE__ */ import_react100.default.createElement(
65808
65823
  "a",
65809
65824
  {
65810
- href: `${FRONTEND_URL2}`,
65825
+ href: `${FRONTEND_URL3}`,
65811
65826
  className: (0, import_clsx13.default)("link", styles4.logo),
65812
65827
  onClick: (e) => {
65813
65828
  if (e.metaKey || e.ctrlKey) {
@@ -65865,7 +65880,6 @@ var init_Hey = __esm({
65865
65880
  import_react101 = require("react");
65866
65881
  init_Image();
65867
65882
  init_AuthProvider();
65868
- init_ChatProvider();
65869
65883
  init_NavigationProvider();
65870
65884
  init_platform();
65871
65885
  init_Sidebar_styles();
@@ -65873,6 +65887,7 @@ var init_Hey = __esm({
65873
65887
  init_ErrorBoundary();
65874
65888
  init_Thread();
65875
65889
  init_Home();
65890
+ init_utils();
65876
65891
  init_providers();
65877
65892
  Store2 = (0, import_react101.lazy)(() => Promise.resolve().then(() => (init_Store(), Store_exports)));
65878
65893
  Calendar3 = (0, import_react101.lazy)(() => Promise.resolve().then(() => (init_Calendar(), Calendar_exports)));
@@ -65911,7 +65926,17 @@ var init_Hey = __esm({
65911
65926
  setPathnameLocal(pathname);
65912
65927
  }
65913
65928
  }, [pathname, isExtension2]);
65914
- const { threadId } = useChat();
65929
+ const threadIdRef = (0, import_react101.useRef)(getThreadId(pathname));
65930
+ const threadId = threadIdRef.current;
65931
+ const setThreadId = (id) => {
65932
+ threadIdRef.current = id;
65933
+ };
65934
+ (0, import_react101.useEffect)(() => {
65935
+ const id = getThreadId(pathname);
65936
+ if (id) {
65937
+ setThreadId(id);
65938
+ }
65939
+ }, [pathname]);
65915
65940
  const { app, isSplash, setIsSplash, storeApps } = useAuth();
65916
65941
  const { currentStore } = useApp();
65917
65942
  const lastPathSegment = pathname.split("/").pop()?.split("?")[0];