@deriv-web-design/ui 0.1.40 → 0.1.41

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.mjs CHANGED
@@ -4885,6 +4885,7 @@ var DayNightTransition = ({
4885
4885
  const [nightMarginStart, setNightMarginStart] = useState13("0px");
4886
4886
  const [nightMarginEnd, setNightMarginEnd] = useState13("0px");
4887
4887
  const [ixMedia, setIxMedia] = useState13("desktop");
4888
+ const [isRtl, setIsRtl] = useState13(false);
4888
4889
  const webflowV2 = scrollPreset === "webflow-day-night-v2";
4889
4890
  useEffect11(() => {
4890
4891
  const mq = window.matchMedia("(max-width: 991px)");
@@ -4893,6 +4894,21 @@ var DayNightTransition = ({
4893
4894
  mq.addEventListener("change", sync);
4894
4895
  return () => mq.removeEventListener("change", sync);
4895
4896
  }, []);
4897
+ useEffect11(() => {
4898
+ const syncRtl = () => {
4899
+ const doc = document.documentElement;
4900
+ setIsRtl(
4901
+ doc.getAttribute("dir") === "rtl" || doc.lang.toLowerCase().startsWith("ar")
4902
+ );
4903
+ };
4904
+ syncRtl();
4905
+ const mo = new MutationObserver(syncRtl);
4906
+ mo.observe(document.documentElement, {
4907
+ attributes: true,
4908
+ attributeFilter: ["dir", "lang"]
4909
+ });
4910
+ return () => mo.disconnect();
4911
+ }, []);
4896
4912
  const MotionHeadline = headlineLevel === "h1" ? motion3.h1 : motion3.h2;
4897
4913
  useLayoutEffect2(() => {
4898
4914
  if (!inlineDayNightHeadline) return;
@@ -4981,7 +4997,7 @@ var DayNightTransition = ({
4981
4997
  const v2NightWordOp = useTransform2(progress, (t) => webflowV2NightWordOpacity(t, ixMedia));
4982
4998
  const v2DayHeight = useTransform2(
4983
4999
  progress,
4984
- (t) => ixMedia === "mobile" ? `${webflowV2DayClipPercent(t, ixMedia)}%` : "100vh"
5000
+ (t) => ixMedia === "mobile" || isRtl ? `${webflowV2DayClipPercent(t, "mobile")}%` : "100vh"
4985
5001
  );
4986
5002
  const hasDescription = Boolean(dayDescription || nightDescription);
4987
5003
  const useInlineHeadline = Boolean(inlineDayNightHeadline);
@@ -5003,19 +5019,23 @@ var DayNightTransition = ({
5003
5019
  motion3.div,
5004
5020
  {
5005
5021
  className: "dnt__v2-bg-day trade-day-night_background-day is-alternative",
5006
- style: {
5007
- backgroundImage: `url(${dayImageUrl})`,
5008
- height: v2DayHeight
5009
- }
5022
+ style: { height: v2DayHeight },
5023
+ children: /* @__PURE__ */ jsx36(
5024
+ "div",
5025
+ {
5026
+ className: "dnt__v2-bg-media",
5027
+ style: { backgroundImage: `url(${dayImageUrl})` }
5028
+ }
5029
+ )
5010
5030
  }
5011
5031
  ),
5012
- /* @__PURE__ */ jsx36(
5032
+ /* @__PURE__ */ jsx36("div", { className: "dnt__v2-bg-night trade-day-night_background-night is-alternative", children: /* @__PURE__ */ jsx36(
5013
5033
  "div",
5014
5034
  {
5015
- className: "dnt__v2-bg-night trade-day-night_background-night is-alternative",
5035
+ className: "dnt__v2-bg-media",
5016
5036
  style: { backgroundImage: `url(${nightImageUrl})` }
5017
5037
  }
5018
- )
5038
+ ) })
5019
5039
  ] }),
5020
5040
  /* @__PURE__ */ jsxs33("div", { className: webflowV2 ? "dnt__sticky dnt__sticky--webflow-v2" : "dnt__sticky", children: [
5021
5041
  !webflowV2 && /* @__PURE__ */ jsxs33(Fragment5, { children: [
@@ -7278,6 +7298,9 @@ var CoralBanner = ({
7278
7298
  ] }) }) });
7279
7299
  };
7280
7300
 
7301
+ // templates/FeatureAwards/FeatureAwards.tsx
7302
+ import { useEffect as useEffect17, useState as useState19 } from "react";
7303
+
7281
7304
  // assets/award-leaf-left.png
7282
7305
  var award_leaf_left_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAABUCAYAAADjyTUjAAAGfUlEQVR4AbyabW/cRBDH7fUdRwMRLxohQnmIVNGW13z/j8ArXpAWVSrQEkCpBGqb9npnu/5t7u/Mrdc+P6VV52YfZ/4zszu7tuOSj/jv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
7283
7306
 
@@ -7319,9 +7342,12 @@ var LaurelIcon = ({ side }) => /* @__PURE__ */ jsx52(
7319
7342
  draggable: false
7320
7343
  }
7321
7344
  );
7322
- var AwardBadge2 = ({ award }) => /* @__PURE__ */ jsxs48("div", { className: "fa__item", role: "listitem", children: [
7345
+ var AwardBadge2 = ({
7346
+ award,
7347
+ textDir
7348
+ }) => /* @__PURE__ */ jsxs48("div", { className: "fa__item", role: "listitem", dir: "ltr", children: [
7323
7349
  /* @__PURE__ */ jsx52(LaurelIcon, { side: "left" }),
7324
- /* @__PURE__ */ jsxs48("div", { className: "fa__item-text", children: [
7350
+ /* @__PURE__ */ jsxs48("div", { className: "fa__item-text", dir: textDir, children: [
7325
7351
  /* @__PURE__ */ jsx52("p", { className: "fa__item-title", children: award.title }),
7326
7352
  /* @__PURE__ */ jsx52("p", { className: "fa__item-subtitle", children: award.subtitle })
7327
7353
  ] }),
@@ -7334,6 +7360,21 @@ var FeatureAwards = ({
7334
7360
  className,
7335
7361
  ...props
7336
7362
  }) => {
7363
+ const [textDir, setTextDir] = useState19("ltr");
7364
+ useEffect17(() => {
7365
+ const sync = () => {
7366
+ setTextDir(
7367
+ document.documentElement.getAttribute("dir") === "rtl" ? "rtl" : "ltr"
7368
+ );
7369
+ };
7370
+ sync();
7371
+ const mo = new MutationObserver(sync);
7372
+ mo.observe(document.documentElement, {
7373
+ attributes: true,
7374
+ attributeFilter: ["dir"]
7375
+ });
7376
+ return () => mo.disconnect();
7377
+ }, []);
7337
7378
  if (!awards || awards.length === 0) return null;
7338
7379
  const trackStyle = {
7339
7380
  "--fa-duration": `${autoScrollDuration}s`
@@ -7345,16 +7386,16 @@ var FeatureAwards = ({
7345
7386
  ...props,
7346
7387
  children: /* @__PURE__ */ jsxs48("div", { className: "fa__inner", children: [
7347
7388
  title && /* @__PURE__ */ jsx52("h2", { className: "fa__title", children: title }),
7348
- /* @__PURE__ */ jsx52("div", { className: "fa__grid", role: "list", children: awards.map((award, i) => /* @__PURE__ */ jsx52(AwardBadge2, { award }, `g-${i}`)) }),
7389
+ /* @__PURE__ */ jsx52("div", { className: "fa__grid", role: "list", children: awards.map((award, i) => /* @__PURE__ */ jsx52(AwardBadge2, { award, textDir }, `g-${i}`)) }),
7349
7390
  /* @__PURE__ */ jsx52("div", { className: "fa__scroller", dir: "ltr", children: /* @__PURE__ */ jsxs48("div", { className: "fa__track fa__track--auto", style: trackStyle, children: [
7350
- /* @__PURE__ */ jsx52("div", { className: "fa__track-group", role: "list", children: awards.map((award, i) => /* @__PURE__ */ jsx52(AwardBadge2, { award }, `m-${i}`)) }),
7391
+ /* @__PURE__ */ jsx52("div", { className: "fa__track-group", role: "list", children: awards.map((award, i) => /* @__PURE__ */ jsx52(AwardBadge2, { award, textDir }, `m-${i}`)) }),
7351
7392
  /* @__PURE__ */ jsx52(
7352
7393
  "div",
7353
7394
  {
7354
7395
  className: "fa__track-group",
7355
7396
  role: "presentation",
7356
7397
  "aria-hidden": "true",
7357
- children: awards.map((award, i) => /* @__PURE__ */ jsx52(AwardBadge2, { award }, `m-dup-${i}`))
7398
+ children: awards.map((award, i) => /* @__PURE__ */ jsx52(AwardBadge2, { award, textDir }, `m-dup-${i}`))
7358
7399
  }
7359
7400
  )
7360
7401
  ] }) })
@@ -7441,7 +7482,7 @@ var FeatureBlog = ({
7441
7482
  };
7442
7483
 
7443
7484
  // templates/FeatureBlogCategories/FeatureBlogCategories.tsx
7444
- import { useMemo as useMemo3, useState as useState19 } from "react";
7485
+ import { useMemo as useMemo3, useState as useState20 } from "react";
7445
7486
  import { jsx as jsx54, jsxs as jsxs50 } from "react/jsx-runtime";
7446
7487
  var isExternalUrl = (href) => Boolean(href && /^https?:\/\//i.test(href));
7447
7488
  var FEATURE_BLOG_CATEGORIES_TEXT_CONTENT = {
@@ -7505,8 +7546,8 @@ var FeatureBlogCategories = ({
7505
7546
  className,
7506
7547
  ...props
7507
7548
  }) => {
7508
- const [search, setSearch] = useState19("");
7509
- const [internalActiveId, setInternalActiveId] = useState19(defaultActiveCategoryId ?? allCategoryId);
7549
+ const [search, setSearch] = useState20("");
7550
+ const [internalActiveId, setInternalActiveId] = useState20(defaultActiveCategoryId ?? allCategoryId);
7510
7551
  const isControlled = activeCategoryId !== void 0;
7511
7552
  const activeId = isControlled ? activeCategoryId : internalActiveId;
7512
7553
  const tabs = useMemo3(
@@ -7614,7 +7655,7 @@ var HelpCentreCategories = ({
7614
7655
  };
7615
7656
 
7616
7657
  // templates/HelpCentreSubCategories/HelpCentreSubCategories.tsx
7617
- import { useMemo as useMemo4, useState as useState20 } from "react";
7658
+ import { useMemo as useMemo4, useState as useState21 } from "react";
7618
7659
  import { jsx as jsx56, jsxs as jsxs52 } from "react/jsx-runtime";
7619
7660
  var externalLinkRel4 = (href) => href && /^https?:\/\//i.test(href) ? "noopener noreferrer" : void 0;
7620
7661
  var QuestionCard = ({ item }) => {
@@ -7631,7 +7672,7 @@ var HelpCentreSubCategories = ({
7631
7672
  noResultsText = 'No results found for "{query}"',
7632
7673
  onSearchChange
7633
7674
  }) => {
7634
- const [search, setSearch] = useState20("");
7675
+ const [search, setSearch] = useState21("");
7635
7676
  const filtered = useMemo4(() => {
7636
7677
  const q = search.trim().toLowerCase();
7637
7678
  if (!q) return items;
@@ -7663,7 +7704,7 @@ var HelpCentreSubCategories = ({
7663
7704
  };
7664
7705
 
7665
7706
  // templates/HelpCenterPage/HelpCenterPage.tsx
7666
- import { useMemo as useMemo5, useState as useState21 } from "react";
7707
+ import { useMemo as useMemo5, useState as useState22 } from "react";
7667
7708
  import { jsx as jsx57, jsxs as jsxs53 } from "react/jsx-runtime";
7668
7709
  var externalLinkRel5 = (href) => href && /^https?:\/\//i.test(href) ? "noopener noreferrer" : void 0;
7669
7710
  var ChevronDownIcon5 = () => /* @__PURE__ */ jsx57("svg", { "aria-hidden": "true", fill: "none", height: "16", viewBox: "0 0 16 16", width: "16", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx57("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) });
@@ -7729,9 +7770,9 @@ var HelpCenterPage = ({
7729
7770
  articlesSheetTitle = "Articles in this section",
7730
7771
  className
7731
7772
  }) => {
7732
- const [search, setSearch] = useState21("");
7733
- const [internalActiveId, setInternalActiveId] = useState21(defaultActiveQuestionId ?? questions[0]?.id);
7734
- const [sheetOpen, setSheetOpen] = useState21(false);
7773
+ const [search, setSearch] = useState22("");
7774
+ const [internalActiveId, setInternalActiveId] = useState22(defaultActiveQuestionId ?? questions[0]?.id);
7775
+ const [sheetOpen, setSheetOpen] = useState22(false);
7735
7776
  const isControlled = activeQuestionId !== void 0;
7736
7777
  const activeId = isControlled ? activeQuestionId : internalActiveId;
7737
7778
  const activeItem = questions.find((item) => item.id === activeId);
@@ -7798,7 +7839,7 @@ var HelpCenterPage = ({
7798
7839
  };
7799
7840
 
7800
7841
  // templates/FeatureBlogPage/FeatureBlogPage.tsx
7801
- import { useEffect as useEffect17, useMemo as useMemo6, useState as useState22 } from "react";
7842
+ import { useEffect as useEffect18, useMemo as useMemo6, useState as useState23 } from "react";
7802
7843
 
7803
7844
  // assets/share-link.png
7804
7845
  var share_link_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABYklEQVR4AezVgU3DMBAFUMRAzMEQzMEQzMEQzMFE+FX5kuNGF4cgIVWp8us73/n/76vaPj/98+sycE3gmsBDTuCl/bQELayfv5zAW5P6avgYwEzb2n7OGBiJGYjK9xLoYWhJ75ffGCCUm2bF/N7e4HVZxS28Pc7cgvHtiAG3ITiSZd+tIRrizyXRs4TrZdYAgowyxG4IcqyjMXupOS+/w4wBh3txoojsqUVky0D20uPcCnsGCBByCEnEe2JjVtOj3wpiEKcuXmHPwJZ4SBEhloM8kPdnmUxttVYGeoLcfHV4SJiBUbw8WxkI/+ieSGo+CoL29IkPGa8MIIvQuBKz1xvQf0gcQWXArfQgtvZgoK8zAnrUyrFrCmYMIAZnmBEDEWAECAd6p1AZ6MkI+hU0YjEQIMwE9P1qU6gMIAgpITlkT3waewYIEHRDfzIgB7XTmDFwWqQiuAxcE3j8CVTfALUfAAAA//85/ClxAAAABklEQVQDABFpTkF24Li2AAAAAElFTkSuQmCC";
@@ -7855,7 +7896,7 @@ var TocCard = ({
7855
7896
  idSuffix,
7856
7897
  collapsible
7857
7898
  }) => {
7858
- const [open, setOpen] = useState22(defaultOpen);
7899
+ const [open, setOpen] = useState23(defaultOpen);
7859
7900
  const panelId = `fbp-toc-panel-${idSuffix}`;
7860
7901
  const isOpen = collapsible ? open : true;
7861
7902
  const list = /* @__PURE__ */ jsx58("ol", { className: "fbp-tocList", id: panelId, children: headings.map((heading) => /* @__PURE__ */ jsx58("li", { className: "fbp-tocItem", children: /* @__PURE__ */ jsx58(
@@ -7897,7 +7938,7 @@ var ShareRow = ({
7897
7938
  onShare,
7898
7939
  copiedLabel
7899
7940
  }) => {
7900
- const [copied, setCopied] = useState22(false);
7941
+ const [copied, setCopied] = useState23(false);
7901
7942
  const handleCopy = async () => {
7902
7943
  onShare?.("copy");
7903
7944
  try {
@@ -8007,8 +8048,8 @@ var FeatureBlogPage = ({
8007
8048
  ).map(({ block, i }) => ({ id: headingIds.get(i), text: block.text ?? "" })),
8008
8049
  [content, headingIds]
8009
8050
  );
8010
- const [activeId, setActiveId] = useState22(null);
8011
- useEffect17(() => {
8051
+ const [activeId, setActiveId] = useState23(null);
8052
+ useEffect18(() => {
8012
8053
  if (typeof IntersectionObserver === "undefined" || headings.length === 0) return;
8013
8054
  const elements = headings.map((heading) => document.getElementById(heading.id)).filter((el) => el !== null);
8014
8055
  if (elements.length === 0) return;
@@ -8222,7 +8263,7 @@ var ParallaxBanner = ({
8222
8263
  };
8223
8264
 
8224
8265
  // templates/TradingCalculator/TradingCalculator.tsx
8225
- import { useCallback as useCallback6, useEffect as useEffect18, useId as useId6, useMemo as useMemo7, useRef as useRef21, useState as useState23 } from "react";
8266
+ import { useCallback as useCallback6, useEffect as useEffect19, useId as useId6, useMemo as useMemo7, useRef as useRef21, useState as useState24 } from "react";
8226
8267
 
8227
8268
  // templates/TradingCalculator/TradingCalculator.types.ts
8228
8269
  var DEFAULT_TRADING_CALCULATOR_LABELS = {
@@ -8313,7 +8354,7 @@ function useExchangeRates(wsUrl) {
8313
8354
  /* @__PURE__ */ new Map()
8314
8355
  );
8315
8356
  const cacheRef = useRef21(/* @__PURE__ */ new Map());
8316
- useEffect18(() => {
8357
+ useEffect19(() => {
8317
8358
  const pending = pendingRef.current;
8318
8359
  return () => {
8319
8360
  socketRef.current?.close();
@@ -8384,11 +8425,11 @@ function useExchangeRates(wsUrl) {
8384
8425
  return getRates;
8385
8426
  }
8386
8427
  function useSymbols(symbolsProp, endpoint) {
8387
- const [state, setState] = useState23(
8428
+ const [state, setState] = useState24(
8388
8429
  symbolsProp ? { status: "ready", data: symbolsProp } : { status: "loading" }
8389
8430
  );
8390
- const [retryToken, setRetryToken] = useState23(0);
8391
- useEffect18(() => {
8431
+ const [retryToken, setRetryToken] = useState24(0);
8432
+ useEffect19(() => {
8392
8433
  if (symbolsProp) {
8393
8434
  setState({ status: "ready", data: symbolsProp });
8394
8435
  return;
@@ -8440,9 +8481,9 @@ var SymbolCombobox = ({
8440
8481
  inputId,
8441
8482
  copy
8442
8483
  }) => {
8443
- const [query, setQuery] = useState23("");
8444
- const [isOpen, setIsOpen] = useState23(false);
8445
- const [activeIndex, setActiveIndex] = useState23(-1);
8484
+ const [query, setQuery] = useState24("");
8485
+ const [isOpen, setIsOpen] = useState24(false);
8486
+ const [activeIndex, setActiveIndex] = useState24(-1);
8446
8487
  const wrapperRef = useRef21(null);
8447
8488
  const listboxId = useId6();
8448
8489
  const isLoading = symbolsState.status === "loading";
@@ -8457,7 +8498,7 @@ var SymbolCombobox = ({
8457
8498
  }, [allSymbols, query]);
8458
8499
  const grouped = useMemo7(() => groupByAssetClass(filtered), [filtered]);
8459
8500
  const flatOptions = useMemo7(() => grouped.flatMap(([, items]) => items), [grouped]);
8460
- useEffect18(() => {
8501
+ useEffect19(() => {
8461
8502
  if (!isOpen) return;
8462
8503
  const handlePointerDown = (event) => {
8463
8504
  if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
@@ -8599,15 +8640,15 @@ var TradingCalculator = ({
8599
8640
  const showTradeVolume = variant === "main";
8600
8641
  const [symbolsState, retrySymbols] = useSymbols(symbolsProp, symbolsEndpoint);
8601
8642
  const getRates = useExchangeRates(exchangeRateWsUrl);
8602
- const [selectedSymbol, setSelectedSymbol] = useState23(null);
8603
- const [volumeInLots, setVolumeInLots] = useState23("");
8604
- const [assetPrice, setAssetPrice] = useState23("");
8605
- const [errors, setErrors] = useState23({});
8606
- const [results, setResults] = useState23(null);
8607
- const [isCalculating, setIsCalculating] = useState23(false);
8608
- const [calcError, setCalcError] = useState23(null);
8643
+ const [selectedSymbol, setSelectedSymbol] = useState24(null);
8644
+ const [volumeInLots, setVolumeInLots] = useState24("");
8645
+ const [assetPrice, setAssetPrice] = useState24("");
8646
+ const [errors, setErrors] = useState24({});
8647
+ const [results, setResults] = useState24(null);
8648
+ const [isCalculating, setIsCalculating] = useState24(false);
8649
+ const [calcError, setCalcError] = useState24(null);
8609
8650
  const didPreselect = useRef21(false);
8610
- useEffect18(() => {
8651
+ useEffect19(() => {
8611
8652
  if (didPreselect.current || !defaultSymbol || symbolsState.status !== "ready") return;
8612
8653
  const match = symbolsState.data.find((item) => item.symbol === defaultSymbol);
8613
8654
  if (match) {
@@ -8817,7 +8858,7 @@ var TradingCalculator = ({
8817
8858
  };
8818
8859
 
8819
8860
  // templates/TradingCalculatorHowTo/TradingCalculatorHowTo.tsx
8820
- import { Fragment as Fragment12, useEffect as useEffect19, useLayoutEffect as useLayoutEffect3, useRef as useRef22, useState as useState24 } from "react";
8861
+ import { Fragment as Fragment12, useEffect as useEffect20, useLayoutEffect as useLayoutEffect3, useRef as useRef22, useState as useState25 } from "react";
8821
8862
 
8822
8863
  // templates/TradingCalculatorHowTo/TradingCalculatorHowTo.types.ts
8823
8864
  var DEFAULT_TRADING_CALCULATOR_HOWTO_LABELS = {
@@ -9018,7 +9059,7 @@ function swapTabsForLabels(labels) {
9018
9059
  { id: "percentage", label: percentage }
9019
9060
  ];
9020
9061
  }
9021
- var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect3 : useEffect19;
9062
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect3 : useEffect20;
9022
9063
  var FormulaBlockView = ({ block }) => {
9023
9064
  if (block.type === "footnote") {
9024
9065
  return /* @__PURE__ */ jsx61("p", { className: "tchow-footnote", children: block.content });
@@ -9042,7 +9083,7 @@ var ConnectorArrow = () => /* @__PURE__ */ jsxs57("svg", { width: "8", height: "
9042
9083
  var CalculationStrip = ({ tokens }) => {
9043
9084
  const wrapperRef = useRef22(null);
9044
9085
  const stripRef = useRef22(null);
9045
- const [fit, setFit] = useState24({ scale: 1, naturalHeight: 0 });
9086
+ const [fit, setFit] = useState25({ scale: 1, naturalHeight: 0 });
9046
9087
  useIsomorphicLayoutEffect(() => {
9047
9088
  const wrapper = wrapperRef.current;
9048
9089
  const strip = stripRef.current;
@@ -9126,8 +9167,8 @@ var TradingCalculatorHowTo = ({
9126
9167
  ...props
9127
9168
  }) => {
9128
9169
  const isSwap = variant === "swap-points" || variant === "swap-percentage";
9129
- const [swapTab, setSwapTab] = useState24(() => swapModeForVariant(variant));
9130
- useEffect19(() => {
9170
+ const [swapTab, setSwapTab] = useState25(() => swapModeForVariant(variant));
9171
+ useEffect20(() => {
9131
9172
  setSwapTab(swapModeForVariant(variant));
9132
9173
  }, [variant]);
9133
9174
  const baseContent = variant === "pip" ? PIP_CONTENT : isSwap ? swapTab === "percentage" ? SWAP_PERCENTAGE_CONTENT : SWAP_POINTS_CONTENT : MARGIN_CONTENT;
@@ -9172,11 +9213,11 @@ var TradingCalculatorHowTo = ({
9172
9213
  // templates/CryptoTradeConverter/CryptoTradeConverter.tsx
9173
9214
  import {
9174
9215
  useCallback as useCallback7,
9175
- useEffect as useEffect21,
9216
+ useEffect as useEffect22,
9176
9217
  useId as useId7,
9177
9218
  useMemo as useMemo8,
9178
9219
  useRef as useRef23,
9179
- useState as useState26
9220
+ useState as useState27
9180
9221
  } from "react";
9181
9222
 
9182
9223
  // templates/cryptoMarketData/origins.ts
@@ -10012,7 +10053,7 @@ function getSharedMarketDataClient(apiOrigin) {
10012
10053
  }
10013
10054
 
10014
10055
  // templates/cryptoMarketData/useCryptoMarketData.ts
10015
- import { useEffect as useEffect20, useState as useState25 } from "react";
10056
+ import { useEffect as useEffect21, useState as useState26 } from "react";
10016
10057
  var EMPTY = {
10017
10058
  kind: "spot",
10018
10059
  status: "idle",
@@ -10025,8 +10066,8 @@ var EMPTY = {
10025
10066
  };
10026
10067
  function useCryptoMarketData(options) {
10027
10068
  const { kind, kline, apiOrigin, enabled = true } = options;
10028
- const [snapshot, setSnapshot] = useState25({ ...EMPTY, kind });
10029
- useEffect20(() => {
10069
+ const [snapshot, setSnapshot] = useState26({ ...EMPTY, kind });
10070
+ useEffect21(() => {
10030
10071
  if (!enabled || typeof window === "undefined") return;
10031
10072
  const client = getSharedMarketDataClient(apiOrigin);
10032
10073
  return client.subscribe({ kind, kline }, setSnapshot);
@@ -10076,7 +10117,7 @@ function matchPair(rows, defaultPair) {
10076
10117
  return rows.find((r) => r.id === needle) ?? rows.find((r) => r.name.toLowerCase() === needle) ?? rows.find((r) => r.name.replace("/", "").toLowerCase() === needle.replace("/", "")) ?? rows[0] ?? null;
10077
10118
  }
10078
10119
  function CoinAvatar({ base, icon, label }) {
10079
- const [failed, setFailed] = useState26(false);
10120
+ const [failed, setFailed] = useState27(false);
10080
10121
  if (failed) {
10081
10122
  return /* @__PURE__ */ jsx62("span", { className: "ctc-avatar ctc-avatar--fallback", "aria-hidden": "true", children: base.slice(0, 3) });
10082
10123
  }
@@ -10132,18 +10173,18 @@ var CryptoTradeConverter = ({
10132
10173
  const statusId = `ctc-status-${reactId}`;
10133
10174
  const snapshot = useCryptoMarketData({ kind: "spot", kline: false, apiOrigin });
10134
10175
  const rows = useMemo8(() => [...snapshot.rows.values()], [snapshot.rows]);
10135
- const [side, setSide] = useState26("buy");
10136
- const [selectedId, setSelectedId] = useState26(null);
10137
- const [pay, setPay] = useState26("");
10138
- const [receive, setReceive] = useState26("");
10139
- const [edited, setEdited] = useState26("pay");
10140
- const [pickerOpen, setPickerOpen] = useState26(false);
10141
- const [activeOption, setActiveOption] = useState26(0);
10176
+ const [side, setSide] = useState27("buy");
10177
+ const [selectedId, setSelectedId] = useState27(null);
10178
+ const [pay, setPay] = useState27("");
10179
+ const [receive, setReceive] = useState27("");
10180
+ const [edited, setEdited] = useState27("pay");
10181
+ const [pickerOpen, setPickerOpen] = useState27(false);
10182
+ const [activeOption, setActiveOption] = useState27(0);
10142
10183
  const rootRef = useRef23(null);
10143
10184
  const buttonRef = useRef23(null);
10144
10185
  const listRef = useRef23(null);
10145
10186
  const selected = (selectedId ? rows.find((r) => r.id === selectedId) : null) ?? matchPair(rows, defaultPair);
10146
- useEffect21(() => {
10187
+ useEffect22(() => {
10147
10188
  if (!selectedId && selected) setSelectedId(selected.id);
10148
10189
  }, [selected, selectedId]);
10149
10190
  const conversion = useMemo8(
@@ -10160,7 +10201,7 @@ var CryptoTradeConverter = ({
10160
10201
  }),
10161
10202
  [side, selected?.last, pay, receive, edited, copy.waitingForPrice, copy.invalidAmount]
10162
10203
  );
10163
- useEffect21(() => {
10204
+ useEffect22(() => {
10164
10205
  if (edited === "pay") setReceive(conversion.receive);
10165
10206
  else setPay(conversion.pay);
10166
10207
  }, [conversion.pay, conversion.receive, edited]);
@@ -10169,7 +10210,7 @@ var CryptoTradeConverter = ({
10169
10210
  setPickerOpen(false);
10170
10211
  buttonRef.current?.focus();
10171
10212
  }, []);
10172
- useEffect21(() => {
10213
+ useEffect22(() => {
10173
10214
  if (!pickerOpen) return;
10174
10215
  const onDoc = (event) => {
10175
10216
  if (!rootRef.current?.contains(event.target)) setPickerOpen(false);
@@ -10217,7 +10258,7 @@ var CryptoTradeConverter = ({
10217
10258
  closePicker();
10218
10259
  }
10219
10260
  };
10220
- useEffect21(() => {
10261
+ useEffect22(() => {
10221
10262
  if (!pickerOpen) return;
10222
10263
  listRef.current?.querySelectorAll('[role="option"]')[activeOption]?.scrollIntoView({
10223
10264
  block: "nearest"
@@ -10479,7 +10520,7 @@ var CryptoTradeConverter = ({
10479
10520
  };
10480
10521
 
10481
10522
  // templates/CryptoMarketsTable/CryptoMarketsTable.tsx
10482
- import { useEffect as useEffect22, useId as useId8, useMemo as useMemo9, useRef as useRef24, useState as useState27 } from "react";
10523
+ import { useEffect as useEffect23, useId as useId8, useMemo as useMemo9, useRef as useRef24, useState as useState28 } from "react";
10483
10524
 
10484
10525
  // templates/CryptoMarketsTable/CryptoMarketsTable.types.ts
10485
10526
  var DEFAULT_CRYPTO_MARKETS_TABLE_TITLE = "Explore the markets";
@@ -10512,7 +10553,7 @@ function mergeLabels3(overrides) {
10512
10553
  return { ...DEFAULT_CRYPTO_MARKETS_TABLE_LABELS, ...overrides };
10513
10554
  }
10514
10555
  function CoinAvatar2({ base, icon }) {
10515
- const [failed, setFailed] = useState27(false);
10556
+ const [failed, setFailed] = useState28(false);
10516
10557
  if (failed) {
10517
10558
  return /* @__PURE__ */ jsx63("span", { className: "cmt-avatar cmt-avatar--fallback", "aria-hidden": "true", children: base.slice(0, 3) });
10518
10559
  }
@@ -10537,7 +10578,7 @@ function Sparkline({
10537
10578
  reducedMotion
10538
10579
  }) {
10539
10580
  const canvasRef = useRef24(null);
10540
- useEffect22(() => {
10581
+ useEffect23(() => {
10541
10582
  const canvas = canvasRef.current;
10542
10583
  if (!canvas) return;
10543
10584
  const points = values.map(Number).filter(Number.isFinite);
@@ -10622,15 +10663,15 @@ var CryptoMarketsTable = ({
10622
10663
  }) => {
10623
10664
  const copy = mergeLabels3(labelsProp);
10624
10665
  const reactId = useId8().replace(/:/g, "");
10625
- const [kind, setKind] = useState27(initialMarket);
10626
- const [quote, setQuote] = useState27(initialQuoteCurrency.toUpperCase());
10627
- const [sortKey, setSortKey] = useState27("last");
10628
- const [sortDir, setSortDir] = useState27("desc");
10629
- const [reducedMotion, setReducedMotion] = useState27(false);
10666
+ const [kind, setKind] = useState28(initialMarket);
10667
+ const [quote, setQuote] = useState28(initialQuoteCurrency.toUpperCase());
10668
+ const [sortKey, setSortKey] = useState28("last");
10669
+ const [sortDir, setSortDir] = useState28("desc");
10670
+ const [reducedMotion, setReducedMotion] = useState28(false);
10630
10671
  const scrollRef = useRef24(null);
10631
- const [scrolled, setScrolled] = useState27(false);
10672
+ const [scrolled, setScrolled] = useState28(false);
10632
10673
  const snapshot = useCryptoMarketData({ kind, kline: true, apiOrigin });
10633
- useEffect22(() => {
10674
+ useEffect23(() => {
10634
10675
  if (typeof window === "undefined") return;
10635
10676
  const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
10636
10677
  const update = () => setReducedMotion(mq.matches);
@@ -10638,7 +10679,7 @@ var CryptoMarketsTable = ({
10638
10679
  mq.addEventListener?.("change", update);
10639
10680
  return () => mq.removeEventListener?.("change", update);
10640
10681
  }, []);
10641
- useEffect22(() => {
10682
+ useEffect23(() => {
10642
10683
  const node = scrollRef.current;
10643
10684
  if (!node) return;
10644
10685
  const onScroll = () => setScrolled(node.scrollLeft > 0);
@@ -10646,7 +10687,7 @@ var CryptoMarketsTable = ({
10646
10687
  node.addEventListener("scroll", onScroll, { passive: true });
10647
10688
  return () => node.removeEventListener("scroll", onScroll);
10648
10689
  }, []);
10649
- useEffect22(() => {
10690
+ useEffect23(() => {
10650
10691
  if (snapshot.quotes.length && !snapshot.quotes.includes(quote)) {
10651
10692
  setQuote(snapshot.quotes[0]);
10652
10693
  }
@@ -10786,7 +10827,7 @@ var CryptoMarketsTable = ({
10786
10827
  };
10787
10828
 
10788
10829
  // templates/FeatureOffices/FeatureOffices.tsx
10789
- import { useMemo as useMemo10, useState as useState28 } from "react";
10830
+ import { useMemo as useMemo10, useState as useState29 } from "react";
10790
10831
  import { jsx as jsx64, jsxs as jsxs60 } from "react/jsx-runtime";
10791
10832
  var isExternalUrl2 = (href) => Boolean(href && /^https?:\/\//i.test(href));
10792
10833
  var FEATURE_OFFICES_TEXT_CONTENT = {
@@ -10840,7 +10881,7 @@ var FeatureOffices = ({
10840
10881
  className,
10841
10882
  ...props
10842
10883
  }) => {
10843
- const [internalActiveId, setInternalActiveId] = useState28(
10884
+ const [internalActiveId, setInternalActiveId] = useState29(
10844
10885
  defaultActiveRegionId ?? regions[0]?.id
10845
10886
  );
10846
10887
  const isControlled = activeRegionId !== void 0;
@@ -11104,10 +11145,10 @@ var ResourceBanner = ({
11104
11145
 
11105
11146
  // templates/OptionsTypes/OptionsTypes.tsx
11106
11147
  import {
11107
- useEffect as useEffect23,
11148
+ useEffect as useEffect24,
11108
11149
  useId as useId9,
11109
11150
  useRef as useRef25,
11110
- useState as useState29
11151
+ useState as useState30
11111
11152
  } from "react";
11112
11153
  import { Fragment as Fragment15, jsx as jsx69, jsxs as jsxs65 } from "react/jsx-runtime";
11113
11154
  var OPTIONS_TYPES_PLACEHOLDER_ITEMS = [
@@ -11315,10 +11356,10 @@ function TogglePanel({
11315
11356
  setPlaying
11316
11357
  }) {
11317
11358
  const animations = item.animations;
11318
- const [activeIndex, setActiveIndex] = useState29(0);
11359
+ const [activeIndex, setActiveIndex] = useState30(0);
11319
11360
  const switchRefs = useRef25([]);
11320
11361
  const safeIndex = Math.min(activeIndex, Math.max(animations.length - 1, 0));
11321
- useEffect23(() => {
11362
+ useEffect24(() => {
11322
11363
  setPlaying({});
11323
11364
  }, [safeIndex, setPlaying]);
11324
11365
  const hasMarkets = Boolean(item.markets && item.markets.length > 0);
@@ -11441,15 +11482,15 @@ function OptionsTypes({
11441
11482
  ...props
11442
11483
  }) {
11443
11484
  const usableItems = Array.isArray(items) ? items.filter((item) => item?.id) : [];
11444
- const [internalActiveId, setInternalActiveId] = useState29(
11485
+ const [internalActiveId, setInternalActiveId] = useState30(
11445
11486
  defaultActiveId ?? usableItems[0]?.id ?? ""
11446
11487
  );
11447
11488
  const selectedId = usableItems.find((item) => item.id === activeId)?.id ?? usableItems.find((item) => item.id === internalActiveId)?.id ?? usableItems[0]?.id ?? "";
11448
- const [playing, setPlaying] = useState29({});
11489
+ const [playing, setPlaying] = useState30({});
11449
11490
  const generatedId = useId9().replace(/:/g, "");
11450
11491
  const tabPrefix = `options-types-${generatedId}`;
11451
11492
  const Heading = headingLevel;
11452
- useEffect23(() => {
11493
+ useEffect24(() => {
11453
11494
  setPlaying({});
11454
11495
  }, [selectedId]);
11455
11496
  const selectItem = (id) => {
@@ -11865,7 +11906,7 @@ var CountryLinkGrid = ({
11865
11906
  };
11866
11907
 
11867
11908
  // templates/DocumentChips/DocumentChips.tsx
11868
- import { useState as useState30 } from "react";
11909
+ import { useState as useState31 } from "react";
11869
11910
  import { jsx as jsx72, jsxs as jsxs68 } from "react/jsx-runtime";
11870
11911
  var DEFAULT_GROUPS = [
11871
11912
  {
@@ -11969,7 +12010,7 @@ var DocumentChips = ({
11969
12010
  }) => {
11970
12011
  const resolvedGroups = groups && groups.length > 0 ? groups : DEFAULT_GROUPS;
11971
12012
  const groupKeys = resolvedGroups.map((group, i) => String(group.id ?? i));
11972
- const [openKeys, setOpenKeys] = useState30(void 0);
12013
+ const [openKeys, setOpenKeys] = useState31(void 0);
11973
12014
  const resolvedOpenKeys = openKeys === void 0 ? groupKeys.slice(0, 1) : openKeys;
11974
12015
  const handleToggle = (key, next) => {
11975
12016
  setOpenKeys((current) => {
@@ -12020,7 +12061,7 @@ var DocumentChips = ({
12020
12061
  };
12021
12062
 
12022
12063
  // components/LinkModal/LinkModal.tsx
12023
- import { useCallback as useCallback8, useEffect as useEffect24, useId as useId10, useRef as useRef26 } from "react";
12064
+ import { useCallback as useCallback8, useEffect as useEffect25, useId as useId10, useRef as useRef26 } from "react";
12024
12065
  import { createPortal as createPortal2 } from "react-dom";
12025
12066
  import { jsx as jsx73, jsxs as jsxs69 } from "react/jsx-runtime";
12026
12067
  var XMarkIcon3 = () => /* @__PURE__ */ jsx73(
@@ -12072,7 +12113,7 @@ var LinkModal = ({
12072
12113
  (el) => el.offsetParent !== null || el === document.activeElement
12073
12114
  );
12074
12115
  }, []);
12075
- useEffect24(() => {
12116
+ useEffect25(() => {
12076
12117
  if (!open || typeof document === "undefined") return;
12077
12118
  triggerRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
12078
12119
  panelRef.current?.focus();
@@ -12082,7 +12123,7 @@ var LinkModal = ({
12082
12123
  if (trigger && document.contains(trigger)) trigger.focus();
12083
12124
  };
12084
12125
  }, [open]);
12085
- useEffect24(() => {
12126
+ useEffect25(() => {
12086
12127
  if (!open || typeof document === "undefined") return;
12087
12128
  const handleKeyDown = (event) => {
12088
12129
  if (event.key === "Escape") {
@@ -12093,7 +12134,7 @@ var LinkModal = ({
12093
12134
  document.addEventListener("keydown", handleKeyDown);
12094
12135
  return () => document.removeEventListener("keydown", handleKeyDown);
12095
12136
  }, [open, onClose]);
12096
- useEffect24(() => {
12137
+ useEffect25(() => {
12097
12138
  if (!open || typeof document === "undefined") return;
12098
12139
  const body = document.body;
12099
12140
  const previousOverflow = body.style.overflow;
@@ -12233,7 +12274,7 @@ var LanguageSelectModal = ({
12233
12274
  };
12234
12275
 
12235
12276
  // templates/AffiliatesSlider/AffiliatesSlider.tsx
12236
- import { useCallback as useCallback9, useMemo as useMemo11, useState as useState31 } from "react";
12277
+ import { useCallback as useCallback9, useMemo as useMemo11, useState as useState32 } from "react";
12237
12278
  import { jsx as jsx75, jsxs as jsxs71 } from "react/jsx-runtime";
12238
12279
  var ArrowIcon2 = () => /* @__PURE__ */ jsx75(
12239
12280
  "svg",
@@ -12318,7 +12359,7 @@ var AffiliatesSlider = ({
12318
12359
  className,
12319
12360
  ...props
12320
12361
  }) => {
12321
- const [internalValue, setInternalValue] = useState31(defaultValue);
12362
+ const [internalValue, setInternalValue] = useState32(defaultValue);
12322
12363
  const currentValue = value ?? internalValue;
12323
12364
  const handleChange = useCallback9(
12324
12365
  (next) => {