randmarcomps 1.157.0 → 1.158.0

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.
@@ -125,14 +125,14 @@ var jt = React.createContext({}), Lt = React.forwardRef((e, t) => {
125
125
  }, [j, Q]), React.useEffect(() => {
126
126
  q !== void 0 && j !== q && q.length < u && j.length === u && (g == null || g(j));
127
127
  }, [u, g, q, j]);
128
- let he = Tt({ containerRef: G, inputRef: U, pushPasswordManagerStrategy: b, isFocused: Q }), ve = React.useCallback((se) => {
128
+ let de = Tt({ containerRef: G, inputRef: U, pushPasswordManagerStrategy: b, isFocused: Q }), ve = React.useCallback((se) => {
129
129
  let _e = se.currentTarget.value.slice(0, u);
130
130
  if (_e.length > 0 && H && !H.test(_e)) {
131
131
  se.preventDefault();
132
132
  return;
133
133
  }
134
134
  typeof q == "string" && _e.length < q.length && document.dispatchEvent(new Event("selectionchange")), F(_e);
135
- }, [u, F, q, H]), de = React.useCallback(() => {
135
+ }, [u, F, q, H]), he = React.useCallback(() => {
136
136
  var se;
137
137
  if (U.current) {
138
138
  let _e = Math.min(U.current.value.length, u - 1), xe = U.current.value.length;
@@ -150,7 +150,7 @@ var jt = React.createContext({}), Lt = React.forwardRef((e, t) => {
150
150
  Ee.value = Me, F(Me);
151
151
  let Fe = Math.min(Me.length, u - 1), He = Me.length;
152
152
  Ee.setSelectionRange(Fe, He), ce(Fe), pe(He);
153
- }, [u, F, H, j]), fe = React.useMemo(() => ({ position: "relative", cursor: I.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [I.disabled]), le = React.useMemo(() => ({ position: "absolute", inset: 0, width: he.willPushPWMBadge ? `calc(100% + ${he.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: he.willPushPWMBadge ? `inset(0 ${he.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: d, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [he.PWM_BADGE_SPACE_WIDTH, he.willPushPWMBadge, d]), oe = React.useMemo(() => React.createElement("input", bt(St({ autoComplete: I.autoComplete || "one-time-code" }, I), { "data-input-otp": !0, "data-input-otp-placeholder-shown": j.length === 0 || void 0, "data-input-otp-mss": ie, "data-input-otp-mse": ue, inputMode: m, pattern: H == null ? void 0 : H.source, "aria-placeholder": p, style: le, maxLength: u, value: j, ref: U, onPaste: (se) => {
153
+ }, [u, F, H, j]), fe = React.useMemo(() => ({ position: "relative", cursor: I.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [I.disabled]), le = React.useMemo(() => ({ position: "absolute", inset: 0, width: de.willPushPWMBadge ? `calc(100% + ${de.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: de.willPushPWMBadge ? `inset(0 ${de.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: d, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [de.PWM_BADGE_SPACE_WIDTH, de.willPushPWMBadge, d]), oe = React.useMemo(() => React.createElement("input", bt(St({ autoComplete: I.autoComplete || "one-time-code" }, I), { "data-input-otp": !0, "data-input-otp-placeholder-shown": j.length === 0 || void 0, "data-input-otp-mss": ie, "data-input-otp-mse": ue, inputMode: m, pattern: H == null ? void 0 : H.source, "aria-placeholder": p, style: le, maxLength: u, value: j, ref: U, onPaste: (se) => {
154
154
  var _e;
155
155
  ye(se), (_e = I.onPaste) == null || _e.call(I, se);
156
156
  }, onChange: ve, onMouseOver: (se) => {
@@ -161,11 +161,11 @@ var jt = React.createContext({}), Lt = React.forwardRef((e, t) => {
161
161
  W(!1), (_e = I.onMouseLeave) == null || _e.call(I, se);
162
162
  }, onFocus: (se) => {
163
163
  var _e;
164
- de(), (_e = I.onFocus) == null || _e.call(I, se);
164
+ he(), (_e = I.onFocus) == null || _e.call(I, se);
165
165
  }, onBlur: (se) => {
166
166
  var _e;
167
167
  ee(!1), (_e = I.onBlur) == null || _e.call(I, se);
168
- } })), [ve, de, ye, m, le, u, ue, ie, I, H == null ? void 0 : H.source, j]), te = React.useMemo(() => ({ slots: Array.from({ length: u }).map((se, _e) => {
168
+ } })), [ve, he, ye, m, le, u, ue, ie, I, H == null ? void 0 : H.source, j]), te = React.useMemo(() => ({ slots: Array.from({ length: u }).map((se, _e) => {
169
169
  var xe;
170
170
  let Ee = Q && ie !== null && ue !== null && (ie === ue && _e === ie || _e >= ie && _e < ue), Ae = j[_e] !== void 0 ? j[_e] : null, we = j[0] !== void 0 ? null : (xe = p == null ? void 0 : p[_e]) != null ? xe : null;
171
171
  return { char: Ae, placeholderChar: we, isActive: Ee, hasFakeCaret: Ee && Ae === null };
@@ -1112,7 +1112,7 @@ const fromTheme = (e) => {
1112
1112
  m,
1113
1113
  isArbitraryVariable,
1114
1114
  isArbitraryValue
1115
- ], pe = () => ["", isNumber$2, isArbitraryVariableLength, isArbitraryLength], he = () => ["solid", "dashed", "dotted", "double"], ve = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], de = () => [isNumber$2, isPercent$1, isArbitraryVariablePosition, isArbitraryPosition], ye = () => [
1115
+ ], pe = () => ["", isNumber$2, isArbitraryVariableLength, isArbitraryLength], de = () => ["solid", "dashed", "dotted", "double"], ve = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], he = () => [isNumber$2, isPercent$1, isArbitraryVariablePosition, isArbitraryPosition], ye = () => [
1116
1116
  // Deprecated since Tailwind CSS v4.0.0
1117
1117
  "",
1118
1118
  "none",
@@ -1953,7 +1953,7 @@ const fromTheme = (e) => {
1953
1953
  * @see https://tailwindcss.com/docs/text-decoration-style
1954
1954
  */
1955
1955
  "text-decoration-style": [{
1956
- decoration: [...he(), "wavy"]
1956
+ decoration: [...de(), "wavy"]
1957
1957
  }],
1958
1958
  /**
1959
1959
  * Text Decoration Thickness
@@ -2349,14 +2349,14 @@ const fromTheme = (e) => {
2349
2349
  * @see https://tailwindcss.com/docs/border-style
2350
2350
  */
2351
2351
  "border-style": [{
2352
- border: [...he(), "hidden", "none"]
2352
+ border: [...de(), "hidden", "none"]
2353
2353
  }],
2354
2354
  /**
2355
2355
  * Divide Style
2356
2356
  * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
2357
2357
  */
2358
2358
  "divide-style": [{
2359
- divide: [...he(), "hidden", "none"]
2359
+ divide: [...de(), "hidden", "none"]
2360
2360
  }],
2361
2361
  /**
2362
2362
  * Border Color
@@ -2433,7 +2433,7 @@ const fromTheme = (e) => {
2433
2433
  * @see https://tailwindcss.com/docs/outline-style
2434
2434
  */
2435
2435
  "outline-style": [{
2436
- outline: [...he(), "none", "hidden"]
2436
+ outline: [...de(), "none", "hidden"]
2437
2437
  }],
2438
2438
  /**
2439
2439
  * Outline Offset
@@ -2604,10 +2604,10 @@ const fromTheme = (e) => {
2604
2604
  "mask-linear": [isNumber$2]
2605
2605
  }],
2606
2606
  "mask-image-linear-from-pos": [{
2607
- "mask-linear-from": de()
2607
+ "mask-linear-from": he()
2608
2608
  }],
2609
2609
  "mask-image-linear-to-pos": [{
2610
- "mask-linear-to": de()
2610
+ "mask-linear-to": he()
2611
2611
  }],
2612
2612
  "mask-image-linear-from-color": [{
2613
2613
  "mask-linear-from": W()
@@ -2616,10 +2616,10 @@ const fromTheme = (e) => {
2616
2616
  "mask-linear-to": W()
2617
2617
  }],
2618
2618
  "mask-image-t-from-pos": [{
2619
- "mask-t-from": de()
2619
+ "mask-t-from": he()
2620
2620
  }],
2621
2621
  "mask-image-t-to-pos": [{
2622
- "mask-t-to": de()
2622
+ "mask-t-to": he()
2623
2623
  }],
2624
2624
  "mask-image-t-from-color": [{
2625
2625
  "mask-t-from": W()
@@ -2628,10 +2628,10 @@ const fromTheme = (e) => {
2628
2628
  "mask-t-to": W()
2629
2629
  }],
2630
2630
  "mask-image-r-from-pos": [{
2631
- "mask-r-from": de()
2631
+ "mask-r-from": he()
2632
2632
  }],
2633
2633
  "mask-image-r-to-pos": [{
2634
- "mask-r-to": de()
2634
+ "mask-r-to": he()
2635
2635
  }],
2636
2636
  "mask-image-r-from-color": [{
2637
2637
  "mask-r-from": W()
@@ -2640,10 +2640,10 @@ const fromTheme = (e) => {
2640
2640
  "mask-r-to": W()
2641
2641
  }],
2642
2642
  "mask-image-b-from-pos": [{
2643
- "mask-b-from": de()
2643
+ "mask-b-from": he()
2644
2644
  }],
2645
2645
  "mask-image-b-to-pos": [{
2646
- "mask-b-to": de()
2646
+ "mask-b-to": he()
2647
2647
  }],
2648
2648
  "mask-image-b-from-color": [{
2649
2649
  "mask-b-from": W()
@@ -2652,10 +2652,10 @@ const fromTheme = (e) => {
2652
2652
  "mask-b-to": W()
2653
2653
  }],
2654
2654
  "mask-image-l-from-pos": [{
2655
- "mask-l-from": de()
2655
+ "mask-l-from": he()
2656
2656
  }],
2657
2657
  "mask-image-l-to-pos": [{
2658
- "mask-l-to": de()
2658
+ "mask-l-to": he()
2659
2659
  }],
2660
2660
  "mask-image-l-from-color": [{
2661
2661
  "mask-l-from": W()
@@ -2664,10 +2664,10 @@ const fromTheme = (e) => {
2664
2664
  "mask-l-to": W()
2665
2665
  }],
2666
2666
  "mask-image-x-from-pos": [{
2667
- "mask-x-from": de()
2667
+ "mask-x-from": he()
2668
2668
  }],
2669
2669
  "mask-image-x-to-pos": [{
2670
- "mask-x-to": de()
2670
+ "mask-x-to": he()
2671
2671
  }],
2672
2672
  "mask-image-x-from-color": [{
2673
2673
  "mask-x-from": W()
@@ -2676,10 +2676,10 @@ const fromTheme = (e) => {
2676
2676
  "mask-x-to": W()
2677
2677
  }],
2678
2678
  "mask-image-y-from-pos": [{
2679
- "mask-y-from": de()
2679
+ "mask-y-from": he()
2680
2680
  }],
2681
2681
  "mask-image-y-to-pos": [{
2682
- "mask-y-to": de()
2682
+ "mask-y-to": he()
2683
2683
  }],
2684
2684
  "mask-image-y-from-color": [{
2685
2685
  "mask-y-from": W()
@@ -2691,10 +2691,10 @@ const fromTheme = (e) => {
2691
2691
  "mask-radial": [isArbitraryVariable, isArbitraryValue]
2692
2692
  }],
2693
2693
  "mask-image-radial-from-pos": [{
2694
- "mask-radial-from": de()
2694
+ "mask-radial-from": he()
2695
2695
  }],
2696
2696
  "mask-image-radial-to-pos": [{
2697
- "mask-radial-to": de()
2697
+ "mask-radial-to": he()
2698
2698
  }],
2699
2699
  "mask-image-radial-from-color": [{
2700
2700
  "mask-radial-from": W()
@@ -2718,10 +2718,10 @@ const fromTheme = (e) => {
2718
2718
  "mask-conic": [isNumber$2]
2719
2719
  }],
2720
2720
  "mask-image-conic-from-pos": [{
2721
- "mask-conic-from": de()
2721
+ "mask-conic-from": he()
2722
2722
  }],
2723
2723
  "mask-image-conic-to-pos": [{
2724
- "mask-conic-to": de()
2724
+ "mask-conic-to": he()
2725
2725
  }],
2726
2726
  "mask-image-conic-from-color": [{
2727
2727
  "mask-conic-from": W()
@@ -6406,7 +6406,7 @@ var ANCHOR_NAME$1 = "PopperAnchor", PopperAnchor = React.forwardRef(
6406
6406
  PopperAnchor.displayName = ANCHOR_NAME$1;
6407
6407
  var CONTENT_NAME$5 = "PopperContent", [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$5), PopperContent = React.forwardRef(
6408
6408
  (e, t) => {
6409
- var de, ye, fe, le, oe, te;
6409
+ var he, ye, fe, le, oe, te;
6410
6410
  const {
6411
6411
  __scopePopper: n,
6412
6412
  side: o = "bottom",
@@ -6461,7 +6461,7 @@ var CONTENT_NAME$5 = "PopperContent", [PopperContentProvider, useContentContext]
6461
6461
  useLayoutEffect2(() => {
6462
6462
  ae && (ie == null || ie());
6463
6463
  }, [ae, ie]);
6464
- const ce = (de = W.arrow) == null ? void 0 : de.x, ue = (ye = W.arrow) == null ? void 0 : ye.y, pe = ((fe = W.arrow) == null ? void 0 : fe.centerOffset) !== 0, [he, ve] = React.useState();
6464
+ const ce = (he = W.arrow) == null ? void 0 : he.x, ue = (ye = W.arrow) == null ? void 0 : ye.y, pe = ((fe = W.arrow) == null ? void 0 : fe.centerOffset) !== 0, [de, ve] = React.useState();
6465
6465
  return useLayoutEffect2(() => {
6466
6466
  I && ve(window.getComputedStyle(I).zIndex);
6467
6467
  }, [I]), /* @__PURE__ */ jsx(
@@ -6474,7 +6474,7 @@ var CONTENT_NAME$5 = "PopperContent", [PopperContentProvider, useContentContext]
6474
6474
  transform: ae ? J.transform : "translate(0, -200%)",
6475
6475
  // keep off the page when measuring
6476
6476
  minWidth: "max-content",
6477
- zIndex: he,
6477
+ zIndex: de,
6478
6478
  "--radix-popper-transform-origin": [
6479
6479
  (le = W.transformOrigin) == null ? void 0 : le.x,
6480
6480
  (oe = W.transformOrigin) == null ? void 0 : oe.y
@@ -6866,8 +6866,8 @@ var CONTENT_NAME$4 = "MenuContent", [MenuContentProvider, useMenuContentContext]
6866
6866
  disableOutsideScroll: T,
6867
6867
  ...E
6868
6868
  } = e, C = useMenuContext(CONTENT_NAME$4, n), I = useMenuRootContext(CONTENT_NAME$4, n), N = usePopperScope$2(n), O = useRovingFocusGroupScope$1(n), V = useCollection$2(n), [M, R] = React.useState(null), D = React.useRef(null), L = useComposedRefs(t, D, C.onContentChange), j = React.useRef(0), q = React.useRef(""), F = React.useRef(0), H = React.useRef(null), U = React.useRef("right"), G = React.useRef(0), J = T ? ReactRemoveScroll : React.Fragment, Z = T ? { as: Slot$1, allowPinchZoom: !0 } : void 0, ae = (Q) => {
6869
- var de, ye;
6870
- const ee = q.current + Q, ie = V().filter((fe) => !fe.disabled), ce = document.activeElement, ue = (de = ie.find((fe) => fe.ref.current === ce)) == null ? void 0 : de.textValue, pe = ie.map((fe) => fe.textValue), he = getNextMatch(pe, ee, ue), ve = (ye = ie.find((fe) => fe.textValue === he)) == null ? void 0 : ye.ref.current;
6869
+ var he, ye;
6870
+ const ee = q.current + Q, ie = V().filter((fe) => !fe.disabled), ce = document.activeElement, ue = (he = ie.find((fe) => fe.ref.current === ce)) == null ? void 0 : he.textValue, pe = ie.map((fe) => fe.textValue), de = getNextMatch(pe, ee, ue), ve = (ye = ie.find((fe) => fe.textValue === de)) == null ? void 0 : ye.ref.current;
6871
6871
  (function fe(le) {
6872
6872
  q.current = le, window.clearTimeout(j.current), le !== "" && (j.current = window.setTimeout(() => fe(""), 1e3));
6873
6873
  })(ee), ve && setTimeout(() => ve.focus());
@@ -6957,7 +6957,7 @@ var CONTENT_NAME$4 = "MenuContent", [MenuContentProvider, useMenuContentContext]
6957
6957
  const pe = D.current;
6958
6958
  if (Q.target !== pe || !FIRST_LAST_KEYS.includes(Q.key)) return;
6959
6959
  Q.preventDefault();
6960
- const ve = V().filter((de) => !de.disabled).map((de) => de.ref.current);
6960
+ const ve = V().filter((he) => !he.disabled).map((he) => he.ref.current);
6961
6961
  LAST_KEYS.includes(Q.key) && ve.reverse(), focusFirst$1(ve);
6962
6962
  }),
6963
6963
  onBlur: composeEventHandlers(e.onBlur, (Q) => {
@@ -10269,13 +10269,13 @@ function requireReactIs_development$1() {
10269
10269
  function pe(se) {
10270
10270
  return typeof se == "object" && se !== null && se.$$typeof === e;
10271
10271
  }
10272
- function he(se) {
10272
+ function de(se) {
10273
10273
  return M(se) === p;
10274
10274
  }
10275
10275
  function ve(se) {
10276
10276
  return M(se) === n;
10277
10277
  }
10278
- function de(se) {
10278
+ function he(se) {
10279
10279
  return M(se) === _;
10280
10280
  }
10281
10281
  function ye(se) {
@@ -10296,7 +10296,7 @@ function requireReactIs_development$1() {
10296
10296
  function be(se) {
10297
10297
  return M(se) === g;
10298
10298
  }
10299
- reactIs_development$1.ContextConsumer = R, reactIs_development$1.ContextProvider = D, reactIs_development$1.Element = L, reactIs_development$1.ForwardRef = j, reactIs_development$1.Fragment = q, reactIs_development$1.Lazy = F, reactIs_development$1.Memo = H, reactIs_development$1.Portal = U, reactIs_development$1.Profiler = G, reactIs_development$1.StrictMode = J, reactIs_development$1.Suspense = Z, reactIs_development$1.SuspenseList = ae, reactIs_development$1.isAsyncMode = ee, reactIs_development$1.isConcurrentMode = ie, reactIs_development$1.isContextConsumer = ce, reactIs_development$1.isContextProvider = ue, reactIs_development$1.isElement = pe, reactIs_development$1.isForwardRef = he, reactIs_development$1.isFragment = ve, reactIs_development$1.isLazy = de, reactIs_development$1.isMemo = ye, reactIs_development$1.isPortal = fe, reactIs_development$1.isProfiler = le, reactIs_development$1.isStrictMode = oe, reactIs_development$1.isSuspense = te, reactIs_development$1.isSuspenseList = be, reactIs_development$1.isValidElementType = V, reactIs_development$1.typeOf = M;
10299
+ reactIs_development$1.ContextConsumer = R, reactIs_development$1.ContextProvider = D, reactIs_development$1.Element = L, reactIs_development$1.ForwardRef = j, reactIs_development$1.Fragment = q, reactIs_development$1.Lazy = F, reactIs_development$1.Memo = H, reactIs_development$1.Portal = U, reactIs_development$1.Profiler = G, reactIs_development$1.StrictMode = J, reactIs_development$1.Suspense = Z, reactIs_development$1.SuspenseList = ae, reactIs_development$1.isAsyncMode = ee, reactIs_development$1.isConcurrentMode = ie, reactIs_development$1.isContextConsumer = ce, reactIs_development$1.isContextProvider = ue, reactIs_development$1.isElement = pe, reactIs_development$1.isForwardRef = de, reactIs_development$1.isFragment = ve, reactIs_development$1.isLazy = he, reactIs_development$1.isMemo = ye, reactIs_development$1.isPortal = fe, reactIs_development$1.isProfiler = le, reactIs_development$1.isStrictMode = oe, reactIs_development$1.isSuspense = te, reactIs_development$1.isSuspenseList = be, reactIs_development$1.isValidElementType = V, reactIs_development$1.typeOf = M;
10300
10300
  }()), reactIs_development$1;
10301
10301
  }
10302
10302
  var hasRequiredReactIs$1;
@@ -16458,7 +16458,7 @@ function formatLocale(e) {
16458
16458
  }, V = {
16459
16459
  a: ue,
16460
16460
  A: pe,
16461
- b: he,
16461
+ b: de,
16462
16462
  B: ve,
16463
16463
  c: null,
16464
16464
  d: formatUTCDayOfMonth,
@@ -16472,7 +16472,7 @@ function formatLocale(e) {
16472
16472
  L: formatUTCMilliseconds,
16473
16473
  m: formatUTCMonthNumber,
16474
16474
  M: formatUTCMinutes,
16475
- p: de,
16475
+ p: he,
16476
16476
  q: ye,
16477
16477
  Q: formatUnixTimestamp,
16478
16478
  s: formatUnixTimestampSeconds,
@@ -16607,13 +16607,13 @@ function formatLocale(e) {
16607
16607
  function pe(fe) {
16608
16608
  return u[fe.getUTCDay()];
16609
16609
  }
16610
- function he(fe) {
16610
+ function de(fe) {
16611
16611
  return p[fe.getUTCMonth()];
16612
16612
  }
16613
16613
  function ve(fe) {
16614
16614
  return f[fe.getUTCMonth()];
16615
16615
  }
16616
- function de(fe) {
16616
+ function he(fe) {
16617
16617
  return l[+(fe.getUTCHours() >= 12)];
16618
16618
  }
16619
16619
  function ye(fe) {
@@ -19862,13 +19862,13 @@ function requireReactIs_development() {
19862
19862
  function pe(te) {
19863
19863
  return V(te) === g;
19864
19864
  }
19865
- function he(te) {
19865
+ function de(te) {
19866
19866
  return V(te) === o;
19867
19867
  }
19868
19868
  function ve(te) {
19869
19869
  return V(te) === T;
19870
19870
  }
19871
- function de(te) {
19871
+ function he(te) {
19872
19872
  return V(te) === S;
19873
19873
  }
19874
19874
  function ye(te) {
@@ -19883,7 +19883,7 @@ function requireReactIs_development() {
19883
19883
  function oe(te) {
19884
19884
  return V(te) === b;
19885
19885
  }
19886
- reactIs_development.AsyncMode = M, reactIs_development.ConcurrentMode = R, reactIs_development.ContextConsumer = D, reactIs_development.ContextProvider = L, reactIs_development.Element = j, reactIs_development.ForwardRef = q, reactIs_development.Fragment = F, reactIs_development.Lazy = H, reactIs_development.Memo = U, reactIs_development.Portal = G, reactIs_development.Profiler = J, reactIs_development.StrictMode = Z, reactIs_development.Suspense = ae, reactIs_development.isAsyncMode = Q, reactIs_development.isConcurrentMode = ee, reactIs_development.isContextConsumer = ie, reactIs_development.isContextProvider = ce, reactIs_development.isElement = ue, reactIs_development.isForwardRef = pe, reactIs_development.isFragment = he, reactIs_development.isLazy = ve, reactIs_development.isMemo = de, reactIs_development.isPortal = ye, reactIs_development.isProfiler = fe, reactIs_development.isStrictMode = le, reactIs_development.isSuspense = oe, reactIs_development.isValidElementType = O, reactIs_development.typeOf = V;
19886
+ reactIs_development.AsyncMode = M, reactIs_development.ConcurrentMode = R, reactIs_development.ContextConsumer = D, reactIs_development.ContextProvider = L, reactIs_development.Element = j, reactIs_development.ForwardRef = q, reactIs_development.Fragment = F, reactIs_development.Lazy = H, reactIs_development.Memo = U, reactIs_development.Portal = G, reactIs_development.Profiler = J, reactIs_development.StrictMode = Z, reactIs_development.Suspense = ae, reactIs_development.isAsyncMode = Q, reactIs_development.isConcurrentMode = ee, reactIs_development.isContextConsumer = ie, reactIs_development.isContextProvider = ce, reactIs_development.isElement = ue, reactIs_development.isForwardRef = pe, reactIs_development.isFragment = de, reactIs_development.isLazy = ve, reactIs_development.isMemo = he, reactIs_development.isPortal = ye, reactIs_development.isProfiler = fe, reactIs_development.isStrictMode = le, reactIs_development.isSuspense = oe, reactIs_development.isValidElementType = O, reactIs_development.typeOf = V;
19887
19887
  }()), reactIs_development;
19888
19888
  }
19889
19889
  var hasRequiredReactIs;
@@ -20056,33 +20056,33 @@ function requireFactoryWithTypeCheckers() {
20056
20056
  function C(ee) {
20057
20057
  if (process.env.NODE_ENV !== "production")
20058
20058
  var ie = {}, ce = 0;
20059
- function ue(he, ve, de, ye, fe, le, oe) {
20060
- if (ye = ye || _, le = le || de, oe !== n) {
20059
+ function ue(de, ve, he, ye, fe, le, oe) {
20060
+ if (ye = ye || _, le = le || he, oe !== n) {
20061
20061
  if (p) {
20062
20062
  var te = new Error(
20063
20063
  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
20064
20064
  );
20065
20065
  throw te.name = "Invariant Violation", te;
20066
20066
  } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
20067
- var be = ye + ":" + de;
20067
+ var be = ye + ":" + he;
20068
20068
  !ie[be] && // Avoid spamming the console because they are often not actionable except for lib authors
20069
20069
  ce < 3 && (u(
20070
20070
  "You are manually calling a React.PropTypes validation function for the `" + le + "` prop on `" + ye + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
20071
20071
  ), ie[be] = !0, ce++);
20072
20072
  }
20073
20073
  }
20074
- return ve[de] == null ? he ? ve[de] === null ? new E("The " + fe + " `" + le + "` is marked as required " + ("in `" + ye + "`, but its value is `null`.")) : new E("The " + fe + " `" + le + "` is marked as required in " + ("`" + ye + "`, but its value is `undefined`.")) : null : ee(ve, de, ye, fe, le);
20074
+ return ve[he] == null ? de ? ve[he] === null ? new E("The " + fe + " `" + le + "` is marked as required " + ("in `" + ye + "`, but its value is `null`.")) : new E("The " + fe + " `" + le + "` is marked as required in " + ("`" + ye + "`, but its value is `undefined`.")) : null : ee(ve, he, ye, fe, le);
20075
20075
  }
20076
20076
  var pe = ue.bind(null, !1);
20077
20077
  return pe.isRequired = ue.bind(null, !0), pe;
20078
20078
  }
20079
20079
  function I(ee) {
20080
- function ie(ce, ue, pe, he, ve, de) {
20080
+ function ie(ce, ue, pe, de, ve, he) {
20081
20081
  var ye = ce[ue], fe = Z(ye);
20082
20082
  if (fe !== ee) {
20083
20083
  var le = ae(ye);
20084
20084
  return new E(
20085
- "Invalid " + he + " `" + ve + "` of type " + ("`" + le + "` supplied to `" + pe + "`, expected ") + ("`" + ee + "`."),
20085
+ "Invalid " + de + " `" + ve + "` of type " + ("`" + le + "` supplied to `" + pe + "`, expected ") + ("`" + ee + "`."),
20086
20086
  { expectedType: ee }
20087
20087
  );
20088
20088
  }
@@ -20094,16 +20094,16 @@ function requireFactoryWithTypeCheckers() {
20094
20094
  return C(d);
20095
20095
  }
20096
20096
  function O(ee) {
20097
- function ie(ce, ue, pe, he, ve) {
20097
+ function ie(ce, ue, pe, de, ve) {
20098
20098
  if (typeof ee != "function")
20099
20099
  return new E("Property `" + ve + "` of component `" + pe + "` has invalid PropType notation inside arrayOf.");
20100
- var de = ce[ue];
20101
- if (!Array.isArray(de)) {
20102
- var ye = Z(de);
20103
- return new E("Invalid " + he + " `" + ve + "` of type " + ("`" + ye + "` supplied to `" + pe + "`, expected an array."));
20100
+ var he = ce[ue];
20101
+ if (!Array.isArray(he)) {
20102
+ var ye = Z(he);
20103
+ return new E("Invalid " + de + " `" + ve + "` of type " + ("`" + ye + "` supplied to `" + pe + "`, expected an array."));
20104
20104
  }
20105
- for (var fe = 0; fe < de.length; fe++) {
20106
- var le = ee(de, fe, pe, he, ve + "[" + fe + "]", n);
20105
+ for (var fe = 0; fe < he.length; fe++) {
20106
+ var le = ee(he, fe, pe, de, ve + "[" + fe + "]", n);
20107
20107
  if (le instanceof Error)
20108
20108
  return le;
20109
20109
  }
@@ -20112,32 +20112,32 @@ function requireFactoryWithTypeCheckers() {
20112
20112
  return C(ie);
20113
20113
  }
20114
20114
  function V() {
20115
- function ee(ie, ce, ue, pe, he) {
20115
+ function ee(ie, ce, ue, pe, de) {
20116
20116
  var ve = ie[ce];
20117
20117
  if (!f(ve)) {
20118
- var de = Z(ve);
20119
- return new E("Invalid " + pe + " `" + he + "` of type " + ("`" + de + "` supplied to `" + ue + "`, expected a single ReactElement."));
20118
+ var he = Z(ve);
20119
+ return new E("Invalid " + pe + " `" + de + "` of type " + ("`" + he + "` supplied to `" + ue + "`, expected a single ReactElement."));
20120
20120
  }
20121
20121
  return null;
20122
20122
  }
20123
20123
  return C(ee);
20124
20124
  }
20125
20125
  function M() {
20126
- function ee(ie, ce, ue, pe, he) {
20126
+ function ee(ie, ce, ue, pe, de) {
20127
20127
  var ve = ie[ce];
20128
20128
  if (!e.isValidElementType(ve)) {
20129
- var de = Z(ve);
20130
- return new E("Invalid " + pe + " `" + he + "` of type " + ("`" + de + "` supplied to `" + ue + "`, expected a single ReactElement type."));
20129
+ var he = Z(ve);
20130
+ return new E("Invalid " + pe + " `" + de + "` of type " + ("`" + he + "` supplied to `" + ue + "`, expected a single ReactElement type."));
20131
20131
  }
20132
20132
  return null;
20133
20133
  }
20134
20134
  return C(ee);
20135
20135
  }
20136
20136
  function R(ee) {
20137
- function ie(ce, ue, pe, he, ve) {
20137
+ function ie(ce, ue, pe, de, ve) {
20138
20138
  if (!(ce[ue] instanceof ee)) {
20139
- var de = ee.name || _, ye = Q(ce[ue]);
20140
- return new E("Invalid " + he + " `" + ve + "` of type " + ("`" + ye + "` supplied to `" + pe + "`, expected ") + ("instance of `" + de + "`."));
20139
+ var he = ee.name || _, ye = Q(ce[ue]);
20140
+ return new E("Invalid " + de + " `" + ve + "` of type " + ("`" + ye + "` supplied to `" + pe + "`, expected ") + ("instance of `" + he + "`."));
20141
20141
  }
20142
20142
  return null;
20143
20143
  }
@@ -20148,28 +20148,28 @@ function requireFactoryWithTypeCheckers() {
20148
20148
  return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? u(
20149
20149
  "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
20150
20150
  ) : u("Invalid argument supplied to oneOf, expected an array.")), d;
20151
- function ie(ce, ue, pe, he, ve) {
20152
- for (var de = ce[ue], ye = 0; ye < ee.length; ye++)
20153
- if (T(de, ee[ye]))
20151
+ function ie(ce, ue, pe, de, ve) {
20152
+ for (var he = ce[ue], ye = 0; ye < ee.length; ye++)
20153
+ if (T(he, ee[ye]))
20154
20154
  return null;
20155
20155
  var fe = JSON.stringify(ee, function(oe, te) {
20156
20156
  var be = ae(te);
20157
20157
  return be === "symbol" ? String(te) : te;
20158
20158
  });
20159
- return new E("Invalid " + he + " `" + ve + "` of value `" + String(de) + "` " + ("supplied to `" + pe + "`, expected one of " + fe + "."));
20159
+ return new E("Invalid " + de + " `" + ve + "` of value `" + String(he) + "` " + ("supplied to `" + pe + "`, expected one of " + fe + "."));
20160
20160
  }
20161
20161
  return C(ie);
20162
20162
  }
20163
20163
  function L(ee) {
20164
- function ie(ce, ue, pe, he, ve) {
20164
+ function ie(ce, ue, pe, de, ve) {
20165
20165
  if (typeof ee != "function")
20166
20166
  return new E("Property `" + ve + "` of component `" + pe + "` has invalid PropType notation inside objectOf.");
20167
- var de = ce[ue], ye = Z(de);
20167
+ var he = ce[ue], ye = Z(he);
20168
20168
  if (ye !== "object")
20169
- return new E("Invalid " + he + " `" + ve + "` of type " + ("`" + ye + "` supplied to `" + pe + "`, expected an object."));
20170
- for (var fe in de)
20171
- if (o(de, fe)) {
20172
- var le = ee(de, fe, pe, he, ve + "." + fe, n);
20169
+ return new E("Invalid " + de + " `" + ve + "` of type " + ("`" + ye + "` supplied to `" + pe + "`, expected an object."));
20170
+ for (var fe in he)
20171
+ if (o(he, fe)) {
20172
+ var le = ee(he, fe, pe, de, ve + "." + fe, n);
20173
20173
  if (le instanceof Error)
20174
20174
  return le;
20175
20175
  }
@@ -20187,21 +20187,21 @@ function requireFactoryWithTypeCheckers() {
20187
20187
  "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + W(ce) + " at index " + ie + "."
20188
20188
  ), d;
20189
20189
  }
20190
- function ue(pe, he, ve, de, ye) {
20190
+ function ue(pe, de, ve, he, ye) {
20191
20191
  for (var fe = [], le = 0; le < ee.length; le++) {
20192
- var oe = ee[le], te = oe(pe, he, ve, de, ye, n);
20192
+ var oe = ee[le], te = oe(pe, de, ve, he, ye, n);
20193
20193
  if (te == null)
20194
20194
  return null;
20195
20195
  te.data && o(te.data, "expectedType") && fe.push(te.data.expectedType);
20196
20196
  }
20197
20197
  var be = fe.length > 0 ? ", expected one of type [" + fe.join(", ") + "]" : "";
20198
- return new E("Invalid " + de + " `" + ye + "` supplied to " + ("`" + ve + "`" + be + "."));
20198
+ return new E("Invalid " + he + " `" + ye + "` supplied to " + ("`" + ve + "`" + be + "."));
20199
20199
  }
20200
20200
  return C(ue);
20201
20201
  }
20202
20202
  function q() {
20203
- function ee(ie, ce, ue, pe, he) {
20204
- return G(ie[ce]) ? null : new E("Invalid " + pe + " `" + he + "` supplied to " + ("`" + ue + "`, expected a ReactNode."));
20203
+ function ee(ie, ce, ue, pe, de) {
20204
+ return G(ie[ce]) ? null : new E("Invalid " + pe + " `" + de + "` supplied to " + ("`" + ue + "`, expected a ReactNode."));
20205
20205
  }
20206
20206
  return C(ee);
20207
20207
  }
@@ -20211,15 +20211,15 @@ function requireFactoryWithTypeCheckers() {
20211
20211
  );
20212
20212
  }
20213
20213
  function H(ee) {
20214
- function ie(ce, ue, pe, he, ve) {
20215
- var de = ce[ue], ye = Z(de);
20214
+ function ie(ce, ue, pe, de, ve) {
20215
+ var he = ce[ue], ye = Z(he);
20216
20216
  if (ye !== "object")
20217
- return new E("Invalid " + he + " `" + ve + "` of type `" + ye + "` " + ("supplied to `" + pe + "`, expected `object`."));
20217
+ return new E("Invalid " + de + " `" + ve + "` of type `" + ye + "` " + ("supplied to `" + pe + "`, expected `object`."));
20218
20218
  for (var fe in ee) {
20219
20219
  var le = ee[fe];
20220
20220
  if (typeof le != "function")
20221
- return F(pe, he, ve, fe, ae(le));
20222
- var oe = le(de, fe, pe, he, ve + "." + fe, n);
20221
+ return F(pe, de, ve, fe, ae(le));
20222
+ var oe = le(he, fe, pe, de, ve + "." + fe, n);
20223
20223
  if (oe)
20224
20224
  return oe;
20225
20225
  }
@@ -20228,21 +20228,21 @@ function requireFactoryWithTypeCheckers() {
20228
20228
  return C(ie);
20229
20229
  }
20230
20230
  function U(ee) {
20231
- function ie(ce, ue, pe, he, ve) {
20232
- var de = ce[ue], ye = Z(de);
20231
+ function ie(ce, ue, pe, de, ve) {
20232
+ var he = ce[ue], ye = Z(he);
20233
20233
  if (ye !== "object")
20234
- return new E("Invalid " + he + " `" + ve + "` of type `" + ye + "` " + ("supplied to `" + pe + "`, expected `object`."));
20234
+ return new E("Invalid " + de + " `" + ve + "` of type `" + ye + "` " + ("supplied to `" + pe + "`, expected `object`."));
20235
20235
  var fe = t({}, ce[ue], ee);
20236
20236
  for (var le in fe) {
20237
20237
  var oe = ee[le];
20238
20238
  if (o(ee, le) && typeof oe != "function")
20239
- return F(pe, he, ve, le, ae(oe));
20239
+ return F(pe, de, ve, le, ae(oe));
20240
20240
  if (!oe)
20241
20241
  return new E(
20242
- "Invalid " + he + " `" + ve + "` key `" + le + "` supplied to `" + pe + "`.\nBad object: " + JSON.stringify(ce[ue], null, " ") + `
20242
+ "Invalid " + de + " `" + ve + "` key `" + le + "` supplied to `" + pe + "`.\nBad object: " + JSON.stringify(ce[ue], null, " ") + `
20243
20243
  Valid keys: ` + JSON.stringify(Object.keys(ee), null, " ")
20244
20244
  );
20245
- var te = oe(de, le, pe, he, ve + "." + le, n);
20245
+ var te = oe(he, le, pe, de, ve + "." + le, n);
20246
20246
  if (te)
20247
20247
  return te;
20248
20248
  }
@@ -23275,22 +23275,22 @@ _defineProperty$d(Bar, "getComposedData", function(e) {
23275
23275
  U -= ue, J += ue;
23276
23276
  }
23277
23277
  } else {
23278
- var pe = [u.scale(F[0]), u.scale(F[1])], he = pe[0], ve = pe[1];
23279
- if (H = he, U = getCateCoordinateOfBar({
23278
+ var pe = [u.scale(F[0]), u.scale(F[1])], de = pe[0], ve = pe[1];
23279
+ if (H = de, U = getCateCoordinateOfBar({
23280
23280
  axis: d,
23281
23281
  ticks: p,
23282
23282
  bandSize: l,
23283
23283
  offset: S.offset,
23284
23284
  entry: j,
23285
23285
  index: q
23286
- }), G = ve - he, J = S.size, Z = {
23286
+ }), G = ve - de, J = S.size, Z = {
23287
23287
  x: u.x,
23288
23288
  y: U,
23289
23289
  width: u.width,
23290
23290
  height: J
23291
23291
  }, Math.abs(ae) > 0 && Math.abs(G) < Math.abs(ae)) {
23292
- var de = mathSign(G || ae) * (Math.abs(ae) - Math.abs(G));
23293
- G += de;
23292
+ var he = mathSign(G || ae) * (Math.abs(ae) - Math.abs(G));
23293
+ G += he;
23294
23294
  }
23295
23295
  }
23296
23296
  return _objectSpread$a(_objectSpread$a(_objectSpread$a({}, j), {}, {
@@ -23388,8 +23388,8 @@ var formatAxisMap = function(t, n, o, l, u) {
23388
23388
  var E = n[T], C = E.orientation, I = E.domain, N = E.padding, O = N === void 0 ? {} : N, V = E.mirror, M = E.reversed, R = "".concat(C).concat(V ? "Mirror" : ""), D, L, j, q, F;
23389
23389
  if (E.type === "number" && (E.padding === "gap" || E.padding === "no-gap")) {
23390
23390
  var H = I[1] - I[0], U = 1 / 0, G = E.categoricalDomain.sort(compareValues);
23391
- if (G.forEach(function(pe, he) {
23392
- he > 0 && (U = Math.min((pe || 0) - (G[he - 1] || 0), U));
23391
+ if (G.forEach(function(pe, de) {
23392
+ de > 0 && (U = Math.min((pe || 0) - (G[de - 1] || 0), U));
23393
23393
  }), Number.isFinite(U)) {
23394
23394
  var J = U / H, Z = E.layout === "vertical" ? o.height : o.width;
23395
23395
  if (E.padding === "gap" && (D = J * Z / 2), E.padding === "no-gap") {
@@ -26479,8 +26479,8 @@ var getTooltipContent = function(t, n, o, l) {
26479
26479
  }, []);
26480
26480
  else if (N === "number") {
26481
26481
  var Q = parseErrorBarsOfAxis(q, l.filter(function(ce) {
26482
- var ue, pe, he = d in ce.props ? ce.props[d] : (ue = ce.type.defaultProps) === null || ue === void 0 ? void 0 : ue[d], ve = "hide" in ce.props ? ce.props.hide : (pe = ce.type.defaultProps) === null || pe === void 0 ? void 0 : pe.hide;
26483
- return he === j && (L || !ve);
26482
+ var ue, pe, de = d in ce.props ? ce.props[d] : (ue = ce.type.defaultProps) === null || ue === void 0 ? void 0 : ue[d], ve = "hide" in ce.props ? ce.props.hide : (pe = ce.type.defaultProps) === null || pe === void 0 ? void 0 : pe.hide;
26483
+ return de === j && (L || !ve);
26484
26484
  }), O, u, g);
26485
26485
  Q && (H = Q);
26486
26486
  }
@@ -26631,7 +26631,7 @@ var getTooltipContent = function(t, n, o, l) {
26631
26631
  graphicalItems: [Q],
26632
26632
  dataStartIndex: D,
26633
26633
  dataEndIndex: L
26634
- }), ce = Q.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, Q.type.defaultProps), Q.props) : Q.props, ue = ce.dataKey, pe = ce.maxBarSize, he = ce["".concat(J, "Id")], ve = ce["".concat(Z, "Id")], de = {}, ye = p.reduce(function(Be, Me) {
26634
+ }), ce = Q.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, Q.type.defaultProps), Q.props) : Q.props, ue = ce.dataKey, pe = ce.maxBarSize, de = ce["".concat(J, "Id")], ve = ce["".concat(Z, "Id")], he = {}, ye = p.reduce(function(Be, Me) {
26635
26635
  var Fe, He, Le = N["".concat(Me.axisType, "Map")], Ne = ce["".concat(Me.axisType, "Id")];
26636
26636
  Le && Le[Ne] || Me.axisType === "zAxis" || (process.env.NODE_ENV !== "production" ? invariant(!1, "Specifying a(n) ".concat(Me.axisType, "Id requires a corresponding ").concat(
26637
26637
  Me.axisType,
@@ -26639,7 +26639,7 @@ var getTooltipContent = function(t, n, o, l) {
26639
26639
  ).concat((Fe = Q == null || (He = Q.type) === null || He === void 0 ? void 0 : He.displayName) !== null && Fe !== void 0 ? Fe : "")) : invariant());
26640
26640
  var qe = Le[Ne];
26641
26641
  return _objectSpread(_objectSpread({}, Be), {}, _defineProperty(_defineProperty({}, Me.axisType, qe), "".concat(Me.axisType, "Ticks"), getTicksOfAxis(qe)));
26642
- }, de), fe = ye[Z], le = ye["".concat(Z, "Ticks")], oe = V && V[he] && V[he].hasStack && getStackedDataOfItem(Q, V[he].stackGroups), te = getDisplayName(Q.type).indexOf("Bar") >= 0, be = getBandSizeOfAxis(fe, le), se = [], _e = ae && getBarSizeList({
26642
+ }, he), fe = ye[Z], le = ye["".concat(Z, "Ticks")], oe = V && V[de] && V[de].hasStack && getStackedDataOfItem(Q, V[de].stackGroups), te = getDisplayName(Q.type).indexOf("Bar") >= 0, be = getBandSizeOfAxis(fe, le), se = [], _e = ae && getBarSizeList({
26643
26643
  barSize: j,
26644
26644
  stackGroups: V,
26645
26645
  totalSize: getCartesianAxisSize(ye, Z)
@@ -26882,13 +26882,13 @@ var getTooltipContent = function(t, n, o, l) {
26882
26882
  var ee = _objectSpread(_objectSpread({}, ae), {}, {
26883
26883
  x: ae.left,
26884
26884
  y: ae.top
26885
- }), ie = Math.min(U, ee.x + ee.width), ce = Math.min(G, ee.y + ee.height), ue = W[J] && W[J].value, pe = getTooltipContent(M.state, M.props.data, J), he = W[J] ? {
26885
+ }), ie = Math.min(U, ee.x + ee.width), ce = Math.min(G, ee.y + ee.height), ue = W[J] && W[J].value, pe = getTooltipContent(M.state, M.props.data, J), de = W[J] ? {
26886
26886
  x: L === "horizontal" ? W[J].coordinate : ie,
26887
26887
  y: L === "horizontal" ? ce : W[J].coordinate
26888
26888
  } : originCoordinate;
26889
26889
  M.setState(_objectSpread(_objectSpread({}, R), {}, {
26890
26890
  activeLabel: ue,
26891
- activeCoordinate: he,
26891
+ activeCoordinate: de,
26892
26892
  activePayload: pe,
26893
26893
  activeTooltipIndex: J
26894
26894
  }));
@@ -27014,7 +27014,7 @@ var getTooltipContent = function(t, n, o, l) {
27014
27014
  var j = M.filterFormatItem(R, D, L);
27015
27015
  if (!j)
27016
27016
  return null;
27017
- var q = M.getTooltipEventType(), F = M.state, H = F.isTooltipActive, U = F.tooltipAxis, G = F.activeTooltipIndex, J = F.activeLabel, Z = M.props.children, ae = findChildByType(Z, Tooltip), W = j.props, Q = W.points, ee = W.isRange, ie = W.baseLine, ce = j.item.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, j.item.type.defaultProps), j.item.props) : j.item.props, ue = ce.activeDot, pe = ce.hide, he = ce.activeBar, ve = ce.activeShape, de = !!(!pe && H && ae && (ue || he || ve)), ye = {};
27017
+ var q = M.getTooltipEventType(), F = M.state, H = F.isTooltipActive, U = F.tooltipAxis, G = F.activeTooltipIndex, J = F.activeLabel, Z = M.props.children, ae = findChildByType(Z, Tooltip), W = j.props, Q = W.points, ee = W.isRange, ie = W.baseLine, ce = j.item.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, j.item.type.defaultProps), j.item.props) : j.item.props, ue = ce.activeDot, pe = ce.hide, de = ce.activeBar, ve = ce.activeShape, he = !!(!pe && H && ae && (ue || de || ve)), ye = {};
27018
27018
  q !== "axis" && ae && ae.props.trigger === "click" ? ye = {
27019
27019
  onClick: combineEventHandlers(M.handleItemMouseEnter, R.props.onClick)
27020
27020
  } : q !== "axis" && (ye = {
@@ -27025,7 +27025,7 @@ var getTooltipContent = function(t, n, o, l) {
27025
27025
  function le(Me) {
27026
27026
  return typeof U.dataKey == "function" ? U.dataKey(Me.payload) : null;
27027
27027
  }
27028
- if (de)
27028
+ if (he)
27029
27029
  if (G >= 0) {
27030
27030
  var oe, te;
27031
27031
  if (U.dataKey && !U.allowDuplicatedCategory) {
@@ -27033,7 +27033,7 @@ var getTooltipContent = function(t, n, o, l) {
27033
27033
  oe = findEntryInArray(Q, be, J), te = ee && ie && findEntryInArray(ie, be, J);
27034
27034
  } else
27035
27035
  oe = Q == null ? void 0 : Q[G], te = ee && ie && ie[G];
27036
- if (ve || he) {
27036
+ if (ve || de) {
27037
27037
  var se = R.props.activeIndex !== void 0 ? R.props.activeIndex : G;
27038
27038
  return [/* @__PURE__ */ cloneElement(R, _objectSpread(_objectSpread(_objectSpread({}, j.props), ye), {}, {
27039
27039
  activeIndex: se
@@ -27496,7 +27496,7 @@ var getTooltipContent = function(t, n, o, l) {
27496
27496
  });
27497
27497
  }
27498
27498
  if (!isChildrenEqual(V, I.prevChildren)) {
27499
- var ae, W, Q, ee, ie = findChildByType(V, Brush), ce = ie && (ae = (W = ie.props) === null || W === void 0 ? void 0 : W.startIndex) !== null && ae !== void 0 ? ae : q, ue = ie && (Q = (ee = ie.props) === null || ee === void 0 ? void 0 : ee.endIndex) !== null && Q !== void 0 ? Q : F, pe = ce !== q || ue !== F, he = !isNil(O), ve = he && !pe ? I.updateId : I.updateId + 1;
27499
+ var ae, W, Q, ee, ie = findChildByType(V, Brush), ce = ie && (ae = (W = ie.props) === null || W === void 0 ? void 0 : W.startIndex) !== null && ae !== void 0 ? ae : q, ue = ie && (Q = (ee = ie.props) === null || ee === void 0 ? void 0 : ee.endIndex) !== null && Q !== void 0 ? Q : F, pe = ce !== q || ue !== F, de = !isNil(O), ve = de && !pe ? I.updateId : I.updateId + 1;
27500
27500
  return _objectSpread(_objectSpread({
27501
27501
  updateId: ve
27502
27502
  }, S(_objectSpread(_objectSpread({
@@ -29108,17 +29108,17 @@ var lottie = createCommonjsModule(function(module, exports) {
29108
29108
  function _(W, Q, ee) {
29109
29109
  return ee || ee === 0 || (ee = 1), W === 1 && Q === 1 && ee === 1 ? this : this._t(W, 0, 0, 0, 0, Q, 0, 0, 0, 0, ee, 0, 0, 0, 0, 1);
29110
29110
  }
29111
- function S(W, Q, ee, ie, ce, ue, pe, he, ve, de, ye, fe, le, oe, te, be) {
29112
- return this.props[0] = W, this.props[1] = Q, this.props[2] = ee, this.props[3] = ie, this.props[4] = ce, this.props[5] = ue, this.props[6] = pe, this.props[7] = he, this.props[8] = ve, this.props[9] = de, this.props[10] = ye, this.props[11] = fe, this.props[12] = le, this.props[13] = oe, this.props[14] = te, this.props[15] = be, this;
29111
+ function S(W, Q, ee, ie, ce, ue, pe, de, ve, he, ye, fe, le, oe, te, be) {
29112
+ return this.props[0] = W, this.props[1] = Q, this.props[2] = ee, this.props[3] = ie, this.props[4] = ce, this.props[5] = ue, this.props[6] = pe, this.props[7] = de, this.props[8] = ve, this.props[9] = he, this.props[10] = ye, this.props[11] = fe, this.props[12] = le, this.props[13] = oe, this.props[14] = te, this.props[15] = be, this;
29113
29113
  }
29114
29114
  function T(W, Q, ee) {
29115
29115
  return ee = ee || 0, W !== 0 || Q !== 0 || ee !== 0 ? this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, W, Q, ee, 1) : this;
29116
29116
  }
29117
- function E(W, Q, ee, ie, ce, ue, pe, he, ve, de, ye, fe, le, oe, te, be) {
29117
+ function E(W, Q, ee, ie, ce, ue, pe, de, ve, he, ye, fe, le, oe, te, be) {
29118
29118
  var se = this.props;
29119
- if (W === 1 && Q === 0 && ee === 0 && ie === 0 && ce === 0 && ue === 1 && pe === 0 && he === 0 && ve === 0 && de === 0 && ye === 1 && fe === 0) return se[12] = se[12] * W + se[15] * le, se[13] = se[13] * ue + se[15] * oe, se[14] = se[14] * ye + se[15] * te, se[15] *= be, this._identityCalculated = !1, this;
29119
+ if (W === 1 && Q === 0 && ee === 0 && ie === 0 && ce === 0 && ue === 1 && pe === 0 && de === 0 && ve === 0 && he === 0 && ye === 1 && fe === 0) return se[12] = se[12] * W + se[15] * le, se[13] = se[13] * ue + se[15] * oe, se[14] = se[14] * ye + se[15] * te, se[15] *= be, this._identityCalculated = !1, this;
29120
29120
  var _e = se[0], xe = se[1], Ee = se[2], Ae = se[3], we = se[4], ke = se[5], Be = se[6], Me = se[7], Fe = se[8], He = se[9], Le = se[10], Ne = se[11], qe = se[12], Ge = se[13], Je = se[14], Xe = se[15];
29121
- return se[0] = _e * W + xe * ce + Ee * ve + Ae * le, se[1] = _e * Q + xe * ue + Ee * de + Ae * oe, se[2] = _e * ee + xe * pe + Ee * ye + Ae * te, se[3] = _e * ie + xe * he + Ee * fe + Ae * be, se[4] = we * W + ke * ce + Be * ve + Me * le, se[5] = we * Q + ke * ue + Be * de + Me * oe, se[6] = we * ee + ke * pe + Be * ye + Me * te, se[7] = we * ie + ke * he + Be * fe + Me * be, se[8] = Fe * W + He * ce + Le * ve + Ne * le, se[9] = Fe * Q + He * ue + Le * de + Ne * oe, se[10] = Fe * ee + He * pe + Le * ye + Ne * te, se[11] = Fe * ie + He * he + Le * fe + Ne * be, se[12] = qe * W + Ge * ce + Je * ve + Xe * le, se[13] = qe * Q + Ge * ue + Je * de + Xe * oe, se[14] = qe * ee + Ge * pe + Je * ye + Xe * te, se[15] = qe * ie + Ge * he + Je * fe + Xe * be, this._identityCalculated = !1, this;
29121
+ return se[0] = _e * W + xe * ce + Ee * ve + Ae * le, se[1] = _e * Q + xe * ue + Ee * he + Ae * oe, se[2] = _e * ee + xe * pe + Ee * ye + Ae * te, se[3] = _e * ie + xe * de + Ee * fe + Ae * be, se[4] = we * W + ke * ce + Be * ve + Me * le, se[5] = we * Q + ke * ue + Be * he + Me * oe, se[6] = we * ee + ke * pe + Be * ye + Me * te, se[7] = we * ie + ke * de + Be * fe + Me * be, se[8] = Fe * W + He * ce + Le * ve + Ne * le, se[9] = Fe * Q + He * ue + Le * he + Ne * oe, se[10] = Fe * ee + He * pe + Le * ye + Ne * te, se[11] = Fe * ie + He * de + Le * fe + Ne * be, se[12] = qe * W + Ge * ce + Je * ve + Xe * le, se[13] = qe * Q + Ge * ue + Je * he + Xe * oe, se[14] = qe * ee + Ge * pe + Je * ye + Xe * te, se[15] = qe * ie + Ge * de + Je * fe + Xe * be, this._identityCalculated = !1, this;
29122
29122
  }
29123
29123
  function C(W) {
29124
29124
  var Q = W.props;
@@ -29156,8 +29156,8 @@ var lottie = createCommonjsModule(function(module, exports) {
29156
29156
  return W * this.props[2] + Q * this.props[6] + ee * this.props[10] + this.props[14];
29157
29157
  }
29158
29158
  function j() {
29159
- var W = this.props[0] * this.props[5] - this.props[1] * this.props[4], Q = this.props[5] / W, ee = -this.props[1] / W, ie = -this.props[4] / W, ce = this.props[0] / W, ue = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / W, pe = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / W, he = new Matrix();
29160
- return he.props[0] = Q, he.props[1] = ee, he.props[4] = ie, he.props[5] = ce, he.props[12] = ue, he.props[13] = pe, he;
29159
+ var W = this.props[0] * this.props[5] - this.props[1] * this.props[4], Q = this.props[5] / W, ee = -this.props[1] / W, ie = -this.props[4] / W, ce = this.props[0] / W, ue = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / W, pe = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / W, de = new Matrix();
29160
+ return de.props[0] = Q, de.props[1] = ee, de.props[4] = ie, de.props[5] = ce, de.props[12] = ue, de.props[13] = pe, de;
29161
29161
  }
29162
29162
  function q(W) {
29163
29163
  return this.getInverseMatrix().applyToPointArray(W[0], W[1], W[2] || 0);
@@ -29171,8 +29171,8 @@ var lottie = createCommonjsModule(function(module, exports) {
29171
29171
  var ie = createTypedArray("float32", 6);
29172
29172
  if (this.isIdentity()) ie[0] = W[0], ie[1] = W[1], ie[2] = Q[0], ie[3] = Q[1], ie[4] = ee[0], ie[5] = ee[1];
29173
29173
  else {
29174
- var ce = this.props[0], ue = this.props[1], pe = this.props[4], he = this.props[5], ve = this.props[12], de = this.props[13];
29175
- ie[0] = W[0] * ce + W[1] * pe + ve, ie[1] = W[0] * ue + W[1] * he + de, ie[2] = Q[0] * ce + Q[1] * pe + ve, ie[3] = Q[0] * ue + Q[1] * he + de, ie[4] = ee[0] * ce + ee[1] * pe + ve, ie[5] = ee[0] * ue + ee[1] * he + de;
29174
+ var ce = this.props[0], ue = this.props[1], pe = this.props[4], de = this.props[5], ve = this.props[12], he = this.props[13];
29175
+ ie[0] = W[0] * ce + W[1] * pe + ve, ie[1] = W[0] * ue + W[1] * de + he, ie[2] = Q[0] * ce + Q[1] * pe + ve, ie[3] = Q[0] * ue + Q[1] * de + he, ie[4] = ee[0] * ce + ee[1] * pe + ve, ie[5] = ee[0] * ue + ee[1] * de + he;
29176
29176
  }
29177
29177
  return ie;
29178
29178
  }
@@ -30848,7 +30848,7 @@ var lottie = createCommonjsModule(function(module, exports) {
30848
30848
  u = F.length, n = 0, o = 0;
30849
30849
  var G, J, Z, ae, W, Q = 1.2 * e.finalSize * 0.714, ee = !0;
30850
30850
  Z = R.length;
30851
- var ie, ce, ue, pe, he, ve, de, ye, fe, le, oe, te, be = -1, se = f, _e = _, xe = b, Ee = -1, Ae = "", we = this.defaultPropsArray;
30851
+ var ie, ce, ue, pe, de, ve, he, ye, fe, le, oe, te, be = -1, se = f, _e = _, xe = b, Ee = -1, Ae = "", we = this.defaultPropsArray;
30852
30852
  if (e.j === 2 || e.j === 1) {
30853
30853
  var ke = 0, Be = 0, Me = e.j === 2 ? -0.5 : -1, Fe = 0, He = !0;
30854
30854
  for (l = 0; l < u; l += 1) if (F[l].n) {
@@ -30881,17 +30881,17 @@ var lottie = createCommonjsModule(function(module, exports) {
30881
30881
  ie = F[l].an / 2 - F[l].add, L.translate(-ie, 0, 0);
30882
30882
  } else ie = F[l].an / 2 - F[l].add, L.translate(-ie, 0, 0), L.translate(-M[0] * F[l].an * 5e-3, -M[1] * Q * 0.01, 0);
30883
30883
  for (J = 0; J < Z; J += 1) (G = R[J].a).t.propType && (W = R[J].s.getMult(F[l].anIndexes[J], D.a[J].s.totalChars), n === 0 && e.j === 0 || (this._hasMaskedPath ? W.length ? f += G.t.v * W[0] : f += G.t.v * W : W.length ? n += G.t.v * W[0] : n += G.t.v * W));
30884
- for (e.strokeWidthAnim && (ve = e.sw || 0), e.strokeColorAnim && (he = e.sc ? [e.sc[0], e.sc[1], e.sc[2]] : [0, 0, 0]), e.fillColorAnim && e.fc && (de = [e.fc[0], e.fc[1], e.fc[2]]), J = 0; J < Z; J += 1) (G = R[J].a).a.propType && ((W = R[J].s.getMult(F[l].anIndexes[J], D.a[J].s.totalChars)).length ? L.translate(-G.a.v[0] * W[0], -G.a.v[1] * W[1], G.a.v[2] * W[2]) : L.translate(-G.a.v[0] * W, -G.a.v[1] * W, G.a.v[2] * W));
30884
+ for (e.strokeWidthAnim && (ve = e.sw || 0), e.strokeColorAnim && (de = e.sc ? [e.sc[0], e.sc[1], e.sc[2]] : [0, 0, 0]), e.fillColorAnim && e.fc && (he = [e.fc[0], e.fc[1], e.fc[2]]), J = 0; J < Z; J += 1) (G = R[J].a).a.propType && ((W = R[J].s.getMult(F[l].anIndexes[J], D.a[J].s.totalChars)).length ? L.translate(-G.a.v[0] * W[0], -G.a.v[1] * W[1], G.a.v[2] * W[2]) : L.translate(-G.a.v[0] * W, -G.a.v[1] * W, G.a.v[2] * W));
30885
30885
  for (J = 0; J < Z; J += 1) (G = R[J].a).s.propType && ((W = R[J].s.getMult(F[l].anIndexes[J], D.a[J].s.totalChars)).length ? L.scale(1 + (G.s.v[0] - 1) * W[0], 1 + (G.s.v[1] - 1) * W[1], 1) : L.scale(1 + (G.s.v[0] - 1) * W, 1 + (G.s.v[1] - 1) * W, 1));
30886
30886
  for (J = 0; J < Z; J += 1) {
30887
- if (G = R[J].a, W = R[J].s.getMult(F[l].anIndexes[J], D.a[J].s.totalChars), G.sk.propType && (W.length ? L.skewFromAxis(-G.sk.v * W[0], G.sa.v * W[1]) : L.skewFromAxis(-G.sk.v * W, G.sa.v * W)), G.r.propType && (W.length ? L.rotateZ(-G.r.v * W[2]) : L.rotateZ(-G.r.v * W)), G.ry.propType && (W.length ? L.rotateY(G.ry.v * W[1]) : L.rotateY(G.ry.v * W)), G.rx.propType && (W.length ? L.rotateX(G.rx.v * W[0]) : L.rotateX(G.rx.v * W)), G.o.propType && (W.length ? pe += (G.o.v * W[0] - pe) * W[0] : pe += (G.o.v * W - pe) * W), e.strokeWidthAnim && G.sw.propType && (W.length ? ve += G.sw.v * W[0] : ve += G.sw.v * W), e.strokeColorAnim && G.sc.propType) for (ye = 0; ye < 3; ye += 1) W.length ? he[ye] += (G.sc.v[ye] - he[ye]) * W[0] : he[ye] += (G.sc.v[ye] - he[ye]) * W;
30887
+ if (G = R[J].a, W = R[J].s.getMult(F[l].anIndexes[J], D.a[J].s.totalChars), G.sk.propType && (W.length ? L.skewFromAxis(-G.sk.v * W[0], G.sa.v * W[1]) : L.skewFromAxis(-G.sk.v * W, G.sa.v * W)), G.r.propType && (W.length ? L.rotateZ(-G.r.v * W[2]) : L.rotateZ(-G.r.v * W)), G.ry.propType && (W.length ? L.rotateY(G.ry.v * W[1]) : L.rotateY(G.ry.v * W)), G.rx.propType && (W.length ? L.rotateX(G.rx.v * W[0]) : L.rotateX(G.rx.v * W)), G.o.propType && (W.length ? pe += (G.o.v * W[0] - pe) * W[0] : pe += (G.o.v * W - pe) * W), e.strokeWidthAnim && G.sw.propType && (W.length ? ve += G.sw.v * W[0] : ve += G.sw.v * W), e.strokeColorAnim && G.sc.propType) for (ye = 0; ye < 3; ye += 1) W.length ? de[ye] += (G.sc.v[ye] - de[ye]) * W[0] : de[ye] += (G.sc.v[ye] - de[ye]) * W;
30888
30888
  if (e.fillColorAnim && e.fc) {
30889
- if (G.fc.propType) for (ye = 0; ye < 3; ye += 1) W.length ? de[ye] += (G.fc.v[ye] - de[ye]) * W[0] : de[ye] += (G.fc.v[ye] - de[ye]) * W;
30890
- G.fh.propType && (de = W.length ? addHueToRGB(de, G.fh.v * W[0]) : addHueToRGB(de, G.fh.v * W)), G.fs.propType && (de = W.length ? addSaturationToRGB(de, G.fs.v * W[0]) : addSaturationToRGB(de, G.fs.v * W)), G.fb.propType && (de = W.length ? addBrightnessToRGB(de, G.fb.v * W[0]) : addBrightnessToRGB(de, G.fb.v * W));
30889
+ if (G.fc.propType) for (ye = 0; ye < 3; ye += 1) W.length ? he[ye] += (G.fc.v[ye] - he[ye]) * W[0] : he[ye] += (G.fc.v[ye] - he[ye]) * W;
30890
+ G.fh.propType && (he = W.length ? addHueToRGB(he, G.fh.v * W[0]) : addHueToRGB(he, G.fh.v * W)), G.fs.propType && (he = W.length ? addSaturationToRGB(he, G.fs.v * W[0]) : addSaturationToRGB(he, G.fs.v * W)), G.fb.propType && (he = W.length ? addBrightnessToRGB(he, G.fb.v * W[0]) : addBrightnessToRGB(he, G.fb.v * W));
30891
30891
  }
30892
30892
  }
30893
30893
  for (J = 0; J < Z; J += 1) (G = R[J].a).p.propType && (W = R[J].s.getMult(F[l].anIndexes[J], D.a[J].s.totalChars), this._hasMaskedPath ? W.length ? L.translate(0, G.p.v[1] * W[0], -G.p.v[2] * W[1]) : L.translate(0, G.p.v[1] * W, -G.p.v[2] * W) : W.length ? L.translate(G.p.v[0] * W[0], G.p.v[1] * W[1], -G.p.v[2] * W[2]) : L.translate(G.p.v[0] * W, G.p.v[1] * W, -G.p.v[2] * W));
30894
- if (e.strokeWidthAnim && (fe = ve < 0 ? 0 : ve), e.strokeColorAnim && (le = "rgb(" + Math.round(255 * he[0]) + "," + Math.round(255 * he[1]) + "," + Math.round(255 * he[2]) + ")"), e.fillColorAnim && e.fc && (oe = "rgb(" + Math.round(255 * de[0]) + "," + Math.round(255 * de[1]) + "," + Math.round(255 * de[2]) + ")"), this._hasMaskedPath) {
30894
+ if (e.strokeWidthAnim && (fe = ve < 0 ? 0 : ve), e.strokeColorAnim && (le = "rgb(" + Math.round(255 * de[0]) + "," + Math.round(255 * de[1]) + "," + Math.round(255 * de[2]) + ")"), e.fillColorAnim && e.fc && (oe = "rgb(" + Math.round(255 * he[0]) + "," + Math.round(255 * he[1]) + "," + Math.round(255 * he[2]) + ")"), this._hasMaskedPath) {
30895
30895
  if (L.translate(0, -e.ls), L.translate(0, M[1] * Q * 0.01 + o, 0), this._pathData.p.v) {
30896
30896
  O = (p.point[1] - S.point[1]) / (p.point[0] - S.point[0]);
30897
30897
  var Ne = 180 * Math.atan(O) / Math.PI;
@@ -40227,8 +40227,8 @@ function fetchBaseQuery({
40227
40227
  }) || R;
40228
40228
  const J = (pe) => typeof pe == "object" && (isPlainObject$1(pe) || Array.isArray(pe) || typeof pe.toJSON == "function");
40229
40229
  if (!G.headers.has("content-type") && J(G.body) && G.headers.set("content-type", u), J(G.body) && l(G.headers) && (G.body = JSON.stringify(G.body, d)), D) {
40230
- const pe = ~M.indexOf("?") ? "&" : "?", he = o ? o(D) : new URLSearchParams(stripUndefined(D));
40231
- M += pe + he;
40230
+ const pe = ~M.indexOf("?") ? "&" : "?", de = o ? o(D) : new URLSearchParams(stripUndefined(D));
40231
+ M += pe + de;
40232
40232
  }
40233
40233
  M = joinUrls(e, M);
40234
40234
  const Z = new Request(M, G);
@@ -40257,10 +40257,10 @@ function fetchBaseQuery({
40257
40257
  try {
40258
40258
  let pe;
40259
40259
  if (await Promise.all([
40260
- b(W, L).then((he) => ce = he, (he) => pe = he),
40260
+ b(W, L).then((de) => ce = de, (de) => pe = de),
40261
40261
  // see https://github.com/node-fetch/node-fetch/issues/665#issuecomment-538995182
40262
40262
  // we *have* to "use up" both streams at the same time or they will stop running in node-fetch scenarios
40263
- ie.text().then((he) => ue = he, () => {
40263
+ ie.text().then((de) => ue = de, () => {
40264
40264
  })
40265
40265
  ]), pe) throw pe;
40266
40266
  } catch (pe) {
@@ -40389,7 +40389,7 @@ You must add the middleware for RTK-Query to function correctly!`);
40389
40389
  [forceQueryFnSymbol]: F,
40390
40390
  ...H
40391
40391
  } = {}) => (U, G) => {
40392
- var de;
40392
+ var he;
40393
40393
  const J = e({
40394
40394
  queryArgs: D,
40395
40395
  endpointDefinition: M,
@@ -40427,10 +40427,10 @@ You must add the middleware for RTK-Query to function correctly!`);
40427
40427
  const {
40428
40428
  requestId: ie,
40429
40429
  abort: ce
40430
- } = Q, ue = ee.requestId !== ie, pe = (de = d.get(U)) == null ? void 0 : de[J], he = () => W(G()), ve = Object.assign(F ? (
40430
+ } = Q, ue = ee.requestId !== ie, pe = (he = d.get(U)) == null ? void 0 : he[J], de = () => W(G()), ve = Object.assign(F ? (
40431
40431
  // a query has been forced (upsertQueryData)
40432
40432
  // -> we want to resolve it once data has been written with the data that will be written
40433
- Q.then(he)
40433
+ Q.then(de)
40434
40434
  ) : ue && !pe ? (
40435
40435
  // a query has been skipped due to a condition and we do not have any currently running query
40436
40436
  // -> we want to resolve it immediately with the current data
@@ -40438,7 +40438,7 @@ You must add the middleware for RTK-Query to function correctly!`);
40438
40438
  ) : (
40439
40439
  // query just started or one is already in flight
40440
40440
  // -> wait for the running query, then resolve with data from after that
40441
- Promise.all([pe, Q]).then(he)
40441
+ Promise.all([pe, Q]).then(de)
40442
40442
  ), {
40443
40443
  arg: D,
40444
40444
  requestId: ie,
@@ -40636,7 +40636,7 @@ function buildThunks({
40636
40636
  } = Q;
40637
40637
  try {
40638
40638
  let pe = E(Q, "transformResponse");
40639
- const he = {
40639
+ const de = {
40640
40640
  signal: H,
40641
40641
  abort: U,
40642
40642
  dispatch: Z,
@@ -40647,7 +40647,7 @@ function buildThunks({
40647
40647
  forced: F.type === "query" ? I(F, ae()) : void 0,
40648
40648
  queryCacheKey: F.type === "query" ? F.queryCacheKey : void 0
40649
40649
  }, ve = F.type === "query" ? F[forceQueryFnSymbol] : void 0;
40650
- let de;
40650
+ let he;
40651
40651
  const ye = async (le, oe, te, be) => {
40652
40652
  if (oe == null && le.pages.length)
40653
40653
  return Promise.resolve({
@@ -40679,7 +40679,7 @@ function buildThunks({
40679
40679
  "argSchema",
40680
40680
  {}
40681
40681
  // we don't have a meta yet, so we can't pass it
40682
- )), ve ? oe = ve() : Q.query ? oe = await t(Q.query(le), he, te) : oe = await Q.queryFn(le, he, te, (Ae) => t(Ae, he, te)), typeof process < "u" && process.env.NODE_ENV === "development") {
40682
+ )), ve ? oe = ve() : Q.query ? oe = await t(Q.query(le), de, te) : oe = await Q.queryFn(le, de, te, (Ae) => t(Ae, de, te)), typeof process < "u" && process.env.NODE_ENV === "development") {
40683
40683
  const Ae = Q.query ? "`baseQuery`" : "`queryFn`";
40684
40684
  let we;
40685
40685
  if (!oe)
@@ -40738,57 +40738,57 @@ function buildThunks({
40738
40738
  te = await ye(te.data, Me, oe);
40739
40739
  }
40740
40740
  }
40741
- de = te;
40741
+ he = te;
40742
40742
  } else
40743
- de = await fe(F.originalArgs);
40744
- return ee && !ie && de.meta && (de.meta = await parseWithSchema(ee, de.meta, "metaSchema", de.meta)), J(de.data, addShouldAutoBatch({
40743
+ he = await fe(F.originalArgs);
40744
+ return ee && !ie && he.meta && (he.meta = await parseWithSchema(ee, he.meta, "metaSchema", he.meta)), J(he.data, addShouldAutoBatch({
40745
40745
  fulfilledTimeStamp: Date.now(),
40746
- baseQueryMeta: de.meta
40746
+ baseQueryMeta: he.meta
40747
40747
  }));
40748
40748
  } catch (pe) {
40749
- let he = pe;
40750
- if (he instanceof HandledError) {
40749
+ let de = pe;
40750
+ if (de instanceof HandledError) {
40751
40751
  let ve = E(Q, "transformErrorResponse");
40752
40752
  const {
40753
- rawErrorResponseSchema: de,
40753
+ rawErrorResponseSchema: he,
40754
40754
  errorResponseSchema: ye
40755
40755
  } = Q;
40756
40756
  let {
40757
40757
  value: fe,
40758
40758
  meta: le
40759
- } = he;
40759
+ } = de;
40760
40760
  try {
40761
- de && !ie && (fe = await parseWithSchema(de, fe, "rawErrorResponseSchema", le)), ee && !ie && (le = await parseWithSchema(ee, le, "metaSchema", le));
40761
+ he && !ie && (fe = await parseWithSchema(he, fe, "rawErrorResponseSchema", le)), ee && !ie && (le = await parseWithSchema(ee, le, "metaSchema", le));
40762
40762
  let oe = await ve(fe, le, F.originalArgs);
40763
40763
  return ye && !ie && (oe = await parseWithSchema(ye, oe, "errorResponseSchema", le)), G(oe, addShouldAutoBatch({
40764
40764
  baseQueryMeta: le
40765
40765
  }));
40766
40766
  } catch (oe) {
40767
- he = oe;
40767
+ de = oe;
40768
40768
  }
40769
40769
  }
40770
40770
  try {
40771
- if (he instanceof NamedSchemaError) {
40771
+ if (de instanceof NamedSchemaError) {
40772
40772
  const ve = {
40773
40773
  endpoint: F.endpointName,
40774
40774
  arg: F.originalArgs,
40775
40775
  type: F.type,
40776
40776
  queryCacheKey: F.type === "query" ? F.queryCacheKey : void 0
40777
40777
  };
40778
- (ue = Q.onSchemaFailure) == null || ue.call(Q, he, ve), f == null || f(he, ve);
40778
+ (ue = Q.onSchemaFailure) == null || ue.call(Q, de, ve), f == null || f(de, ve);
40779
40779
  const {
40780
- catchSchemaFailure: de = p
40780
+ catchSchemaFailure: he = p
40781
40781
  } = Q;
40782
- if (de)
40783
- return G(de(he, ve), addShouldAutoBatch({
40784
- baseQueryMeta: he._bqMeta
40782
+ if (he)
40783
+ return G(he(de, ve), addShouldAutoBatch({
40784
+ baseQueryMeta: de._bqMeta
40785
40785
  }));
40786
40786
  }
40787
40787
  } catch (ve) {
40788
- he = ve;
40788
+ de = ve;
40789
40789
  }
40790
40790
  throw typeof process < "u" && process.env.NODE_ENV !== "production" ? console.error(`An unhandled error occurred processing a request for the endpoint "${F.endpointName}".
40791
- In the case of an unhandled error, no tags will be "provided" or "invalidated".`, he) : console.error(he), he;
40791
+ In the case of an unhandled error, no tags will be "provided" or "invalidated".`, de) : console.error(de), de;
40792
40792
  }
40793
40793
  };
40794
40794
  function I(F, H) {
@@ -42072,7 +42072,7 @@ var coreModuleName = /* @__PURE__ */ Symbol(), coreModule = ({
42072
42072
  skipSchemaValidation: S
42073
42073
  }, T) {
42074
42074
  enablePatches();
42075
- const E = (he) => (typeof process < "u" && process.env.NODE_ENV === "development" && (o.includes(he.type) || console.error(`Tag type '${he.type}' was used, but not specified in \`tagTypes\`!`)), he);
42075
+ const E = (de) => (typeof process < "u" && process.env.NODE_ENV === "development" && (o.includes(de.type) || console.error(`Tag type '${de.type}' was used, but not specified in \`tagTypes\`!`)), de);
42076
42076
  Object.assign(t, {
42077
42077
  reducerPath: l,
42078
42078
  endpoints: {},
@@ -42186,22 +42186,22 @@ var coreModuleName = /* @__PURE__ */ Symbol(), coreModule = ({
42186
42186
  getRunningQueriesThunk: ue
42187
42187
  }), {
42188
42188
  name: coreModuleName,
42189
- injectEndpoint(he, ve) {
42189
+ injectEndpoint(de, ve) {
42190
42190
  var fe;
42191
- const ye = (fe = t.endpoints)[he] ?? (fe[he] = {});
42191
+ const ye = (fe = t.endpoints)[de] ?? (fe[de] = {});
42192
42192
  isQueryDefinition$1(ve) && safeAssign$1(ye, {
42193
- name: he,
42194
- select: O(he, ve),
42195
- initiate: W(he, ve)
42196
- }, U(R, he)), isMutationDefinition$1(ve) && safeAssign$1(ye, {
42197
- name: he,
42193
+ name: de,
42194
+ select: O(de, ve),
42195
+ initiate: W(de, ve)
42196
+ }, U(R, de)), isMutationDefinition$1(ve) && safeAssign$1(ye, {
42197
+ name: de,
42198
42198
  select: M(),
42199
- initiate: ee(he)
42200
- }, U(L, he)), isInfiniteQueryDefinition$1(ve) && safeAssign$1(ye, {
42201
- name: he,
42202
- select: V(he, ve),
42203
- initiate: Q(he, ve)
42204
- }, U(R, he));
42199
+ initiate: ee(de)
42200
+ }, U(L, de)), isInfiniteQueryDefinition$1(ve) && safeAssign$1(ye, {
42201
+ name: de,
42202
+ select: V(de, ve),
42203
+ initiate: Q(de, ve)
42204
+ }, U(R, de));
42205
42205
  }
42206
42206
  };
42207
42207
  }
@@ -42627,11 +42627,11 @@ function buildHooks({
42627
42627
  initiate: U
42628
42628
  } = e.endpoints[V], G = n(), J = useRef(void 0);
42629
42629
  if (!J.current) {
42630
- const he = G(e.internalActions.internal_getRTKQSubscriptions());
42631
- if (process.env.NODE_ENV !== "production" && (typeof he != "object" || typeof (he == null ? void 0 : he.type) == "string"))
42630
+ const de = G(e.internalActions.internal_getRTKQSubscriptions());
42631
+ if (process.env.NODE_ENV !== "production" && (typeof de != "object" || typeof (de == null ? void 0 : de.type) == "string"))
42632
42632
  throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(37) : `Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
42633
42633
  You must add the middleware for RTK-Query to function correctly!`);
42634
- J.current = he;
42634
+ J.current = de;
42635
42635
  }
42636
42636
  const Z = useStableQueryArgs(
42637
42637
  j ? skipToken : M,
@@ -42658,15 +42658,15 @@ function buildHooks({
42658
42658
  return m(() => {
42659
42659
  pe && (ee.current = void 0);
42660
42660
  }, [pe]), m(() => {
42661
- var de;
42662
- const he = ee.current;
42661
+ var he;
42662
+ const de = ee.current;
42663
42663
  if (typeof process < "u" && process.env.NODE_ENV === "removeMeOnCompilation" && console.log(pe), Z === skipToken) {
42664
- he == null || he.unsubscribe(), ee.current = void 0;
42664
+ de == null || de.unsubscribe(), ee.current = void 0;
42665
42665
  return;
42666
42666
  }
42667
- const ve = (de = ee.current) == null ? void 0 : de.subscriptionOptions;
42668
- if (!he || he.arg !== Z) {
42669
- he == null || he.unsubscribe();
42667
+ const ve = (he = ee.current) == null ? void 0 : he.subscriptionOptions;
42668
+ if (!de || de.arg !== Z) {
42669
+ de == null || de.unsubscribe();
42670
42670
  const ye = G(U(Z, {
42671
42671
  subscriptionOptions: ae,
42672
42672
  forceRefetch: L,
@@ -42675,7 +42675,7 @@ function buildHooks({
42675
42675
  } : {}
42676
42676
  }));
42677
42677
  ee.current = ye;
42678
- } else ae !== ve && he.updateSubscriptionOptions(ae);
42678
+ } else ae !== ve && de.updateSubscriptionOptions(ae);
42679
42679
  }, [G, U, L, Z, ae, pe, Q, V]), [ee, G, U, ae];
42680
42680
  }
42681
42681
  function T(V, M) {
@@ -52426,7 +52426,7 @@ const ASSISTANT_ID = "RandmarAIChatAssistant", ChatLayout = forwardRef(
52426
52426
  /* @__PURE__ */ jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4" }),
52427
52427
  /* @__PURE__ */ jsx("p", { children: "Loading API functions..." })
52428
52428
  ] }) }) });
52429
- const he = () => {
52429
+ const de = () => {
52430
52430
  !V.trim() || !N || !H || (ae(G.length), ue(V, N, H));
52431
52431
  }, ve = () => {
52432
52432
  const te = {
@@ -52438,7 +52438,7 @@ const ASSISTANT_ID = "RandmarAIChatAssistant", ChatLayout = forwardRef(
52438
52438
  emailAddress: t,
52439
52439
  body: te
52440
52440
  });
52441
- }, de = () => {
52441
+ }, he = () => {
52442
52442
  j((oe) => oe.map((be) => be.partner1 !== ASSISTANT_ID && be.partner2 !== ASSISTANT_ID ? be : { ...be, messages: [] })), E();
52443
52443
  };
52444
52444
  return /* @__PURE__ */ jsxs("div", { className: "flex h-[85vh] overflow-hidden", children: [
@@ -52469,7 +52469,7 @@ const ASSISTANT_ID = "RandmarAIChatAssistant", ChatLayout = forwardRef(
52469
52469
  /* @__PURE__ */ jsx("div", { className: "flex items-center p-4 border-b", children: N[0] == ASSISTANT_ID || N[1] == ASSISTANT_ID ? /* @__PURE__ */ jsxs(Fragment, { children: [
52470
52470
  /* @__PURE__ */ jsx(Avatar, { className: "h-8 w-8 flex-shrink-0 rounded-none", children: /* @__PURE__ */ jsx(Bot, { className: "text-primary fill-white min-h-full" }) }),
52471
52471
  /* @__PURE__ */ jsx("div", { className: "ml-3 font-medium", children: "Randmar Assistant" }),
52472
- /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "ml-auto", onClick: () => de(), children: /* @__PURE__ */ jsx(MessageCircleX, { className: "h-5 w-5" }) }),
52472
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "ml-auto", onClick: () => he(), children: /* @__PURE__ */ jsx(MessageCircleX, { className: "h-5 w-5" }) }),
52473
52473
  /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", className: "ml-1", confirmationDialog: { title: "Report Issue", content: "This action will send a copy of your chat to Randmar. Send it?", onConfirm: () => ve() }, children: /* @__PURE__ */ jsx(MessageSquareShare, { className: "h-5 w-5" }) })
52474
52474
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
52475
52475
  /* @__PURE__ */ jsxs(Avatar, { className: "h-8 w-8 flex-shrink-0 rounded-none", children: [
@@ -52500,7 +52500,7 @@ const ASSISTANT_ID = "RandmarAIChatAssistant", ChatLayout = forwardRef(
52500
52500
  value: V,
52501
52501
  onChange: (oe) => M(oe.target.value),
52502
52502
  onKeyDown: (oe) => {
52503
- oe.key !== "Enter" || oe.shiftKey || (oe.preventDefault(), he());
52503
+ oe.key !== "Enter" || oe.shiftKey || (oe.preventDefault(), de());
52504
52504
  },
52505
52505
  className: "flex-1 resize-none"
52506
52506
  }
@@ -52512,7 +52512,7 @@ const ASSISTANT_ID = "RandmarAIChatAssistant", ChatLayout = forwardRef(
52512
52512
  variant: "default",
52513
52513
  className: "ml-2 h-15 w-15",
52514
52514
  disabled: T !== "",
52515
- onClick: he,
52515
+ onClick: de,
52516
52516
  children: /* @__PURE__ */ jsx(Send, { className: "h-6 w-6" })
52517
52517
  }
52518
52518
  )
@@ -53380,7 +53380,7 @@ var __create = Object.create, __getProtoOf = Object.getPrototypeOf, __defProp =
53380
53380
  ++z, K = ne;
53381
53381
  }
53382
53382
  }
53383
- var he = {
53383
+ var de = {
53384
53384
  ecmaVersion: null,
53385
53385
  sourceType: "script",
53386
53386
  onInsertedSemicolon: null,
@@ -53401,10 +53401,10 @@ var __create = Object.create, __getProtoOf = Object.getPrototypeOf, __defProp =
53401
53401
  directSourceFile: null,
53402
53402
  preserveParens: !1
53403
53403
  }, ve = !1;
53404
- function de(A) {
53404
+ function he(A) {
53405
53405
  var B = {};
53406
- for (var z in he)
53407
- B[z] = A && Z(A, z) ? A[z] : he[z];
53406
+ for (var z in de)
53407
+ B[z] = A && Z(A, z) ? A[z] : de[z];
53408
53408
  if (B.ecmaVersion === "latest" ? B.ecmaVersion = 1e8 : B.ecmaVersion == null ? (!ve && typeof console == "object" && console.warn && (ve = !0, console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
53409
53409
  Defaulting to 2020, but this will stop working in the future.`)), B.ecmaVersion = 11) : B.ecmaVersion >= 2015 && (B.ecmaVersion -= 2009), B.allowReserved == null && (B.allowReserved = B.ecmaVersion < 5), (!A || A.allowHashBang == null) && (B.allowHashBang = B.ecmaVersion >= 14), ae(B.onToken)) {
53410
53410
  var K = B.onToken;
@@ -53430,7 +53430,7 @@ Defaulting to 2020, but this will stop working in the future.`)), B.ecmaVersion
53430
53430
  return le | (A ? oe : 0) | (B ? te : 0);
53431
53431
  }
53432
53432
  var ke = 0, Be = 1, Me = 2, Fe = 3, He = 4, Le = 5, Ne = function(B, z, K) {
53433
- this.options = B = de(B), this.sourceFile = B.sourceFile, this.keywords = Q(m[B.ecmaVersion >= 6 ? 6 : B.sourceType === "module" ? "5module" : 5]);
53433
+ this.options = B = he(B), this.sourceFile = B.sourceFile, this.keywords = Q(m[B.ecmaVersion >= 6 ? 6 : B.sourceType === "module" ? "5module" : 5]);
53434
53434
  var ne = "";
53435
53435
  B.allowReserved !== !0 && (ne = f[B.ecmaVersion >= 6 ? 6 : B.ecmaVersion === 5 ? 5 : 3], B.sourceType === "module" && (ne += " await")), this.reservedWords = Q(ne);
53436
53436
  var me = (ne ? ne + " " : "") + f.strict;
@@ -55630,7 +55630,7 @@ Defaulting to 2020, but this will stop working in the future.`)), B.ecmaVersion
55630
55630
  Ne.acorn = {
55631
55631
  Parser: Ne,
55632
55632
  version: xr,
55633
- defaultOptions: he,
55633
+ defaultOptions: de,
55634
55634
  Position: ce,
55635
55635
  SourceLocation: ue,
55636
55636
  getLineInfo: pe,
@@ -55657,7 +55657,7 @@ Defaulting to 2020, but this will stop working in the future.`)), B.ecmaVersion
55657
55657
  function Wr(A, B) {
55658
55658
  return Ne.tokenizer(A, B);
55659
55659
  }
55660
- n.Node = ft, n.Parser = Ne, n.Position = ce, n.SourceLocation = ue, n.TokContext = Ke, n.Token = $t, n.TokenType = C, n.defaultOptions = he, n.getLineInfo = pe, n.isIdentifierChar = E, n.isIdentifierStart = T, n.isNewLine = j, n.keywordTypes = V, n.lineBreak = D, n.lineBreakG = L, n.nonASCIIwhitespace = F, n.parse = Gr, n.parseExpressionAt = zr, n.tokContexts = Ue, n.tokTypes = R, n.tokenizer = Wr, n.version = xr;
55660
+ n.Node = ft, n.Parser = Ne, n.Position = ce, n.SourceLocation = ue, n.TokContext = Ke, n.Token = $t, n.TokenType = C, n.defaultOptions = de, n.getLineInfo = pe, n.isIdentifierChar = E, n.isIdentifierStart = T, n.isNewLine = j, n.keywordTypes = V, n.lineBreak = D, n.lineBreakG = L, n.nonASCIIwhitespace = F, n.parse = Gr, n.parseExpressionAt = zr, n.tokContexts = Ue, n.tokTypes = R, n.tokenizer = Wr, n.version = xr;
55661
55661
  });
55662
55662
  }), require_acorn_jsx = __commonJS((e, t) => {
55663
55663
  var n = require_xhtml(), o = /^[\da-fA-F]+$/, l = /^\d+$/, u = /* @__PURE__ */ new WeakMap();
@@ -58935,38 +58935,123 @@ Dt = new WeakMap(), je = new WeakMap(), Ft = new WeakMap(), qt = new WeakMap(),
58935
58935
  renderUnrecognized: () => null
58936
58936
  });
58937
58937
  var source_default = JsxParser;
58938
- const GetJSXFromAI = async (e, t, n, o = 3) => {
58939
- const l = "In addition to basic html tags, You have access to these beautiful Handmade Components: Button.", u = "Here is the data to display to the user (If a Handmade Component is a perfect fit for the data, use it. Otherwise, use regular html tags) (You have access to this data object in React via the data variable):", d = "Only output a single JSX code snippet. Start with <> and end with </>. All other code will be ignored, so make sure to place all CSS styles inline. Use CSS flex layouts when there is a lot of stuff to display.", f = JSON.stringify(n), p = [t, l, d, u, f, d].join(`\r
58940
- `), b = await new GoogleGenAI({ apiKey: e }).chats.create({
58941
- model: "gemini-2.0-flash-lite"
58942
- }).sendMessage({ message: p }), _ = trimJSXString(b.text ?? "");
58943
- return _ || (o == 0 ? "<p>Failed to generate. Reload the page.</p>" : await GetJSXFromAI(e, t, n, o - 1));
58938
+ const imgSizeMap = {
58939
+ sm: 100,
58940
+ md: 200,
58941
+ lg: 300,
58942
+ xl: 400
58944
58943
  };
58945
- function trimJSXString(e) {
58946
- const t = e.indexOf("<"), n = e.lastIndexOf("</");
58947
- return t === -1 || n === -1 ? "" : e.slice(t, e.indexOf(">", n) + 1);
58948
- }
58949
- function AiGeneratedContent(e) {
58950
- const [t, n] = useState(""), { apiKey: o } = useApiKey();
58951
- return useEffect(() => {
58952
- if (!o || !e.prompt || !e.data) return;
58953
- n("");
58954
- let l = !1;
58955
- return GetJSXFromAI(o, e.prompt, e.data).then((u) => {
58956
- l || n(u);
58957
- }), () => {
58958
- l = !0;
58959
- };
58960
- }, [e.prompt, e.data, n, o]), t ? /* @__PURE__ */ jsx(
58961
- source_default,
58962
- {
58963
- bindings: {
58964
- data: e.data
58965
- },
58966
- components: { Button },
58967
- jsx: t
58944
+ function ProductImage({ randmarSKU: e, size: t = "md", alt: n, secondaryContent: o }) {
58945
+ const [l, u] = React.useState(!1), [d, f] = React.useState(!1), [p, m] = React.useState(!1), [g, b] = React.useState(!1), _ = `https://api.randmar.io/Product/${e}/Video`;
58946
+ React.useEffect(() => {
58947
+ (async () => {
58948
+ try {
58949
+ const O = await (await fetch(_ + "/Exists")).json();
58950
+ f(O);
58951
+ } catch (N) {
58952
+ console.error("Error checking for video:", N), f(!1);
58953
+ }
58954
+ })();
58955
+ }, [e, _]);
58956
+ async function S() {
58957
+ if (d) {
58958
+ b(!0);
58959
+ try {
58960
+ const N = await (await fetch(_)).blob(), O = window.URL.createObjectURL(N), V = document.createElement("a");
58961
+ V.href = O, V.download = `${e || "product"}-video.mp4`, document.body.appendChild(V), V.click(), document.body.removeChild(V), window.URL.revokeObjectURL(O);
58962
+ } catch (I) {
58963
+ console.error("Error downloading video:", I);
58964
+ } finally {
58965
+ b(!1);
58966
+ }
58968
58967
  }
58969
- ) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-32", children: /* @__PURE__ */ jsx(Bot, { className: "m-auto align-middle h-full" }) }) });
58968
+ }
58969
+ function T() {
58970
+ navigator.clipboard.writeText(_), m(!0), setTimeout(() => {
58971
+ m(!1);
58972
+ }, 2e3);
58973
+ }
58974
+ function E() {
58975
+ u(!0);
58976
+ }
58977
+ const C = imgSizeMap[t || "xl"];
58978
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
58979
+ /* @__PURE__ */ jsx(Dialog, { open: l, onOpenChange: u, children: /* @__PURE__ */ jsx(DialogContent, { className: "max-w-4xl p-0 overflow-hidden", children: o ? /* @__PURE__ */ jsxs("div", { className: "flex flex-row", children: [
58980
+ /* @__PURE__ */ jsxs(
58981
+ "video",
58982
+ {
58983
+ className: "w-full rounded-l-lg max-h-[720px] object-contain",
58984
+ controls: !0,
58985
+ autoPlay: !0,
58986
+ muted: !0,
58987
+ loop: !0,
58988
+ children: [
58989
+ /* @__PURE__ */ jsx("source", { src: _, type: "video/mp4" }),
58990
+ "Your browser does not support the video tag."
58991
+ ]
58992
+ }
58993
+ ),
58994
+ /* @__PURE__ */ jsx("div", { className: "flex-grow min-w-[400px] h-[70vh] p-6", children: o })
58995
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "w-full relative", children: [
58996
+ /* @__PURE__ */ jsxs("video", { className: "w-full max-h-[720px] object-contain", controls: !0, autoPlay: !0, children: [
58997
+ /* @__PURE__ */ jsx("source", { src: _, type: "video/mp4" }),
58998
+ "Your browser does not support the video tag."
58999
+ ] }),
59000
+ /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-12 flex gap-1", children: [
59001
+ /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
59002
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(
59003
+ Button,
59004
+ {
59005
+ variant: "secondary",
59006
+ size: "icon",
59007
+ onClick: T,
59008
+ children: p ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Copy, { className: "h-4 w-4" })
59009
+ }
59010
+ ) }),
59011
+ /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Copy video link" }) })
59012
+ ] }) }),
59013
+ /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
59014
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(
59015
+ Button,
59016
+ {
59017
+ variant: "secondary",
59018
+ size: "icon",
59019
+ onClick: S,
59020
+ disabled: g,
59021
+ children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" })
59022
+ }
59023
+ ) }),
59024
+ /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Download video" }) })
59025
+ ] }) })
59026
+ ] })
59027
+ ] }) }) }),
59028
+ /* @__PURE__ */ jsxs("div", { className: "relative w-max h-max", children: [
59029
+ /* @__PURE__ */ jsx(
59030
+ "img",
59031
+ {
59032
+ alt: n || `Product ${e}`,
59033
+ className: `rounded-md ${d ? "cursor-pointer" : ""}`,
59034
+ onClick: d ? E : void 0,
59035
+ src: `https://api.randmar.io/Product/${e}/Image?width=${C * 1.5}&height=${C * 1.5}`,
59036
+ width: C,
59037
+ height: C
59038
+ }
59039
+ ),
59040
+ d && /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
59041
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(
59042
+ Button,
59043
+ {
59044
+ variant: "secondary",
59045
+ size: "icon",
59046
+ className: "absolute top-2 right-2",
59047
+ onClick: E,
59048
+ children: /* @__PURE__ */ jsx(Play, { className: "h-4 w-4" })
59049
+ }
59050
+ ) }),
59051
+ /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Play video" }) })
59052
+ ] }) })
59053
+ ] })
59054
+ ] });
58970
59055
  }
58971
59056
  const CountryFlag = ({ countryCode: e, className: t = "" }) => {
58972
59057
  const [n, o] = useState(null), [l, u] = useState(!1);
@@ -58988,150 +59073,671 @@ const CountryFlag = ({ countryCode: e, className: t = "" }) => {
58988
59073
  }
58989
59074
  );
58990
59075
  };
58991
- function GeneralDocumentCard({ document: e, loading: t = !1 }) {
58992
- return t ? /* @__PURE__ */ jsx("div", { children: "loading..." }) : /* @__PURE__ */ jsxs("div", { children: [
58993
- "GENERAL DOCUMENT CARD - ",
58994
- e == null ? void 0 : e.OrderNumber,
58995
- " for P.O. ",
58996
- e == null ? void 0 : e.PONumber
58997
- ] });
58998
- }
58999
- const Navbar = forwardRef(
59000
- ({ routes: e, footer: t, dashboardTitle: n, withRandmarAssistant: o, chatUserName: l, chatApiKey: u }, d) => {
59001
- const { appID: f } = useParams(), p = e.filter((_) => _.showInNav), m = useRef(null), g = useRef(null), b = useRef(null);
59002
- return useImperativeHandle(d, () => ({
59003
- setActiveChatAndSendMessage: (_, S) => {
59004
- var T;
59005
- return (T = b.current) == null || T.click(), setTimeout(() => {
59006
- var E;
59007
- (E = m.current) == null || E.focus(), g.current && g.current.setActiveChatAndSendMessage(_, S);
59008
- }, 100), !0;
59009
- }
59010
- })), /* @__PURE__ */ jsxs(Sidebar, { className: "border-r border-sidebar-border", children: [
59011
- /* @__PURE__ */ jsx(SidebarHeader, { className: "border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
59012
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
59013
- "img",
59014
- {
59015
- src: "https://api.randmar.io/images/RandmarIcon.svg",
59016
- alt: "Randmar Icon",
59017
- className: "h-4 w-4 filter brightness-0 saturate-100 invert"
59076
+ function ProductCard({
59077
+ item: e,
59078
+ addToCart: t = !1,
59079
+ syncToShopify: n = !1,
59080
+ customAction: o = /* @__PURE__ */ jsx(Fragment, {}),
59081
+ defaultOpportunityNumber: l = "",
59082
+ viewProductLink: u,
59083
+ addToCartAction: d,
59084
+ isAddToCartActionLoading: f = !1,
59085
+ syncToShopifyAction: p,
59086
+ isSyncToShopifyActionLoading: m = !1
59087
+ }) {
59088
+ var Q, ee, ie, ce, ue, pe, de, ve, he, ye, fe;
59089
+ const [g, b] = useState(1), [_, S] = useState(null), [T, E] = useState(0), [C, I] = useState(!1), N = ((Q = e == null ? void 0 : e.Distribution) == null ? void 0 : Q.Cost) || 0, O = ((ee = e == null ? void 0 : e.Distribution) == null ? void 0 : ee.RegularPrice) || 0, V = ((ie = e == null ? void 0 : e.Distribution) == null ? void 0 : ie.Price) || 0;
59090
+ useEffect(() => {
59091
+ b(1), S(null), E(0), I(!1);
59092
+ }, [e == null ? void 0 : e.RandmarSKU]);
59093
+ const [M, R] = useState(null), [D, L] = useState(!1);
59094
+ useEffect(() => {
59095
+ const le = async () => {
59096
+ if (e != null && e.ManufacturerId) {
59097
+ L(!0);
59098
+ try {
59099
+ const oe = await fetch(
59100
+ `https://api.randmar.io/V4/Partner/${e.ManufacturerId}/Account/Logo?width=60&height=40`
59101
+ );
59102
+ if (oe.ok) {
59103
+ const te = await oe.blob();
59104
+ R(URL.createObjectURL(te));
59018
59105
  }
59019
- ) }),
59020
- /* @__PURE__ */ jsx("span", { className: "font-semibold text-lg", children: n })
59021
- ] }) }),
59022
- /* @__PURE__ */ jsx(SidebarContent, { className: "py-4 bg-sidebar text-sidebar-foreground", children: /* @__PURE__ */ jsx(SidebarMenu, { children: p.map((_) => {
59023
- const S = _.icon, T = `/${_.path.replace(":appID", f ?? "")}`;
59024
- return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, { asChild: !0, children: /* @__PURE__ */ jsxs(Link, { to: T, className: "transition-colors hover:bg-muted px-6", children: [
59025
- S && /* @__PURE__ */ jsx(S, { className: "h-4 w-4" }),
59026
- /* @__PURE__ */ jsx("span", { children: _.label })
59027
- ] }) }) }, _.key);
59028
- }) }) }),
59029
- /* @__PURE__ */ jsxs(SidebarFooter, { className: "border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground", children: [
59030
- o === !0 && /* @__PURE__ */ jsxs(Dialog, { children: [
59031
- /* @__PURE__ */ jsx(DialogTrigger, { asChild: !0, children: /* @__PURE__ */ jsxs(
59032
- Button,
59106
+ } catch (oe) {
59107
+ console.error("Failed to load logo:", oe);
59108
+ } finally {
59109
+ L(!1);
59110
+ }
59111
+ }
59112
+ };
59113
+ e != null && e.ManufacturerId && le();
59114
+ }, [e == null ? void 0 : e.ManufacturerId]), useEffect(() => {
59115
+ var le;
59116
+ if (e && l) {
59117
+ const oe = (le = e.Opportunities) == null ? void 0 : le.find((te) => te.BidNumber == l);
59118
+ oe && S(oe);
59119
+ }
59120
+ }, [e, l]), useEffect(() => {
59121
+ if (!e) return;
59122
+ const le = _ != null && _.Price ? _.Price : V;
59123
+ E(O > 0 ? Math.round((O - le) / O * 100) : 0);
59124
+ }, [e, _, V, O]), useEffect(() => {
59125
+ f || b(1);
59126
+ }, [f]);
59127
+ const j = (le) => {
59128
+ if (le.Active !== !0) return !1;
59129
+ const oe = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
59130
+ return !(le.EndDate && le.EndDate.split("T")[0] < oe || le.StartDate && le.StartDate.split("T")[0] > oe);
59131
+ };
59132
+ if (!e)
59133
+ return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "p-6", children: [
59134
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start mb-3", children: [
59135
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-3/4" }),
59136
+ /* @__PURE__ */ jsx("div", { className: "h-10 w-24 flex items-center justify-end ml-4", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-24 rounded-md" }) })
59137
+ ] }),
59138
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 mb-4", children: [
59139
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-20 rounded-full" }),
59140
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-24 rounded-full" }),
59141
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-28 rounded-full" })
59142
+ ] }),
59143
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-6", children: [
59144
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-x-4 gap-y-6 flex-1", children: [
59145
+ /* @__PURE__ */ jsxs("div", { children: [
59146
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-12 mb-1" }),
59147
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-20" })
59148
+ ] }),
59149
+ /* @__PURE__ */ jsxs("div", { children: [
59150
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-12 mb-1" }),
59151
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-24" })
59152
+ ] }),
59153
+ /* @__PURE__ */ jsxs("div", { children: [
59154
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20 mb-1" }),
59155
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-16" })
59156
+ ] }),
59157
+ /* @__PURE__ */ jsxs("div", { children: [
59158
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-12 mb-1" }),
59159
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-20" })
59160
+ ] })
59161
+ ] }),
59162
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "w-60 h-40", children: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-full rounded-lg" }) }) })
59163
+ ] }),
59164
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-6 mt-4", children: [
59165
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1", children: /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
59166
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24 mb-3" }),
59167
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-16 w-full rounded-md" })
59168
+ ] }) }),
59169
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
59170
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-32 rounded-md" }),
59171
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-24 mt-4" })
59172
+ ] })
59173
+ ] }),
59174
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-6 mt-4", children: [
59175
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-1 mb-2", children: [
59176
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-32" }),
59177
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-24" })
59178
+ ] }),
59179
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-2", children: [
59180
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-24 rounded-md" }),
59181
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 flex-1 rounded-md" })
59182
+ ] })
59183
+ ] })
59184
+ ] }) });
59185
+ const q = (e == null ? void 0 : e.Opportunities) || [], F = q.length > 0, H = () => {
59186
+ if (g == null) {
59187
+ b(1);
59188
+ return;
59189
+ }
59190
+ g > 1 && b(g - 1);
59191
+ }, U = () => {
59192
+ if (g == null) {
59193
+ b(1);
59194
+ return;
59195
+ }
59196
+ b(g + 1);
59197
+ }, G = (le) => {
59198
+ const oe = parseInt(le.target.value, 10);
59199
+ if (!isNaN(oe) && oe > 0) {
59200
+ b(oe);
59201
+ return;
59202
+ }
59203
+ b(void 0);
59204
+ }, J = () => {
59205
+ (g == null || g < 1) && b(1);
59206
+ }, Z = ((ue = (ce = e.Distribution) == null ? void 0 : ce.Inventory) == null ? void 0 : ue.reduce((le, oe) => le + (oe.AvailableQuantity || 0), 0)) || 0, ae = (le) => {
59207
+ try {
59208
+ return new Date(le).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
59209
+ } catch (oe) {
59210
+ return console.error(oe), le.split("T")[0] || "N/A";
59211
+ }
59212
+ }, W = () => {
59213
+ d && d({ quantity: g ?? 1, bidNumber: (_ == null ? void 0 : _.BidNumber) ?? null });
59214
+ };
59215
+ return /* @__PURE__ */ jsx(Card, { className: "hover:shadow-lg transition-shadow", children: /* @__PURE__ */ jsxs(CardContent, { className: "p-6", children: [
59216
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start mb-3", children: [
59217
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-xl", children: e.Title || e.RandmarTitle }),
59218
+ /* @__PURE__ */ jsx("div", { className: "h-10 w-24 flex items-center justify-end ml-4", children: D ? /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-24 rounded-md" }) : M && /* @__PURE__ */ jsx(
59219
+ "img",
59220
+ {
59221
+ src: M,
59222
+ alt: e.ManufacturerName ?? "",
59223
+ className: "max-h-10 max-w-24 object-contain"
59224
+ }
59225
+ ) })
59226
+ ] }),
59227
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-6", children: [
59228
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
59229
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 mb-4", children: [
59230
+ e.State && /* @__PURE__ */ jsxs(
59231
+ Badge,
59033
59232
  {
59034
- ref: b,
59035
- size: "lg",
59036
- className: "collapse md:visible",
59037
- onClick: () => setTimeout(() => {
59038
- var _;
59039
- return (_ = m.current) == null ? void 0 : _.focus();
59040
- }, 50),
59233
+ variant: "outline",
59234
+ className: `rounded-full px-3 ${e.State === "Active" ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-red-50 text-red-700 hover:bg-red-50"}`,
59041
59235
  children: [
59042
- /* @__PURE__ */ jsx(Bot, {}),
59043
- "Assistant"
59236
+ /* @__PURE__ */ jsx(Check, { size: "12", className: "mr-1.5" }),
59237
+ " ",
59238
+ e.State
59044
59239
  ]
59045
59240
  }
59046
- ) }),
59047
- /* @__PURE__ */ jsx(DialogContent, { className: "max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible", forceMount: !0, animateExit: !1, children: /* @__PURE__ */ jsx(ChatLayout, { ref: g, inputRef: m, userId: f ?? "2", userName: l ?? "Unknown user", apiKey: u ?? "" }) })
59241
+ ),
59242
+ /* @__PURE__ */ jsxs(
59243
+ Badge,
59244
+ {
59245
+ variant: "outline",
59246
+ className: `rounded-full px-3 ${e.SerialNumber ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,
59247
+ children: [
59248
+ /* @__PURE__ */ jsx(QrCode, { size: "12", className: "mr-1.5" }),
59249
+ " ",
59250
+ e.SerialNumber ? "Serialized" : "Unserialized"
59251
+ ]
59252
+ }
59253
+ ),
59254
+ e.TransparencyCode && /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50", children: [
59255
+ /* @__PURE__ */ jsx(CircleDashed, { size: "12", className: "mr-1.5" }),
59256
+ " Transparency Code"
59257
+ ] }),
59258
+ e.AvailableToBuy !== void 0 && /* @__PURE__ */ jsxs(
59259
+ Badge,
59260
+ {
59261
+ variant: "outline",
59262
+ className: `rounded-full px-3 ${e.AvailableToBuy ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-red-50 text-red-700 hover:bg-red-50"}`,
59263
+ children: [
59264
+ /* @__PURE__ */ jsx(ShoppingCart, { size: "12", className: "mr-1.5" }),
59265
+ " ",
59266
+ e.AvailableToBuy ? "Available" : "Unavailable"
59267
+ ]
59268
+ }
59269
+ ),
59270
+ e.ManufacturerCategory !== void 0 && /* @__PURE__ */ jsxs(
59271
+ Badge,
59272
+ {
59273
+ variant: "outline",
59274
+ className: `rounded-full px-3 ${(pe = e.ManufacturerCategory) != null && pe.QualificationRequired ? "bg-blue-50 text-blue-700 hover:bg-blue-50" : "bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,
59275
+ children: [
59276
+ /* @__PURE__ */ jsx(ShieldCheck, { size: "12", className: "mr-1.5" }),
59277
+ " ",
59278
+ (de = e.ManufacturerCategory) != null && de.QualificationRequired ? "Qualified Only" : "Available to all"
59279
+ ]
59280
+ }
59281
+ ),
59282
+ e.ManufacturerId && /* @__PURE__ */ jsxs(
59283
+ Badge,
59284
+ {
59285
+ variant: "outline",
59286
+ className: `rounded-full px-3 ${e.AutoUpdate ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-red-50 text-red-700 hover:bg-red-50"}`,
59287
+ children: [
59288
+ /* @__PURE__ */ jsx(RefreshCw, { size: "12", className: "mr-1.5" }),
59289
+ " ",
59290
+ e.AutoUpdate ? `Automatic Reorder (${e.MasterCarton})` : "Manually Reorders"
59291
+ ]
59292
+ }
59293
+ ),
59294
+ /* @__PURE__ */ jsxs(
59295
+ Badge,
59296
+ {
59297
+ variant: "outline",
59298
+ className: `rounded-full px-3 ${e.BodyHTML && e.Title && e.MAP ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-red-50 text-red-700 hover:bg-red-50"}`,
59299
+ children: [
59300
+ /* @__PURE__ */ jsx(Store, { size: "12", className: "mr-1.5" }),
59301
+ " ",
59302
+ e.BodyHTML && e.Title && e.MAP ? "Shopify Ready" : "Not Shopify Ready"
59303
+ ]
59304
+ }
59305
+ )
59048
59306
  ] }),
59049
- t
59050
- ] })
59051
- ] });
59052
- }
59053
- ), Layout = forwardRef(({
59054
- children: e,
59055
- rightMenu: t,
59056
- routes: n,
59057
- footer: o,
59058
- handleValidSearch: l,
59059
- dashboardTitle: u,
59060
- onSignOut: d,
59061
- searchPlaceholder: f,
59062
- withRandmarAssistant: p,
59063
- chatUserName: m,
59064
- chatApiKey: g,
59065
- chatRef: b
59066
- }, _) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(SidebarProvider, { children: /* @__PURE__ */ jsxs("div", { className: "flex grow", children: [
59067
- /* @__PURE__ */ jsx(
59068
- Navbar,
59069
- {
59070
- routes: n,
59071
- footer: o,
59072
- dashboardTitle: u,
59073
- withRandmarAssistant: p,
59074
- chatUserName: m,
59075
- chatApiKey: g,
59076
- ref: b
59077
- }
59078
- ),
59079
- /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
59080
- /* @__PURE__ */ jsx(
59081
- Topbar,
59082
- {
59083
- ref: _,
59084
- onSignOut: d,
59085
- rightMenu: t,
59086
- handleValidSearch: l,
59087
- searchPlaceholder: f
59088
- }
59089
- ),
59090
- /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-auto mt-16", children: e }),
59091
- /* @__PURE__ */ jsx(Toaster, {})
59092
- ] })
59093
- ] }) }) }));
59094
- Layout.displayName = "Layout";
59095
- function usePrevious(e) {
59096
- const t = React.useRef({ value: e, previous: e });
59097
- return React.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
59098
- }
59099
- var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"], SELECTION_KEYS = [" ", "Enter"], SELECT_NAME = "Select", [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME), [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [
59100
- createCollectionScope,
59101
- createPopperScope
59102
- ]), usePopperScope = createPopperScope(), [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME), [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME), Select$1 = (e) => {
59103
- const {
59104
- __scopeSelect: t,
59105
- children: n,
59106
- open: o,
59107
- defaultOpen: l,
59108
- onOpenChange: u,
59109
- value: d,
59110
- defaultValue: f,
59111
- onValueChange: p,
59112
- dir: m,
59113
- name: g,
59114
- autoComplete: b,
59115
- disabled: _,
59116
- required: S,
59117
- form: T
59118
- } = e, E = usePopperScope(t), [C, I] = React.useState(null), [N, O] = React.useState(null), [V, M] = React.useState(!1), R = useDirection(m), [D, L] = useControllableState({
59119
- prop: o,
59120
- defaultProp: l ?? !1,
59121
- onChange: u,
59122
- caller: SELECT_NAME
59123
- }), [j, q] = useControllableState({
59124
- prop: d,
59125
- defaultProp: f,
59126
- onChange: p,
59127
- caller: SELECT_NAME
59128
- }), F = React.useRef(null), H = C ? T || !!C.closest("form") : !0, [U, G] = React.useState(/* @__PURE__ */ new Set()), J = Array.from(U).map((Z) => Z.props.value).join(";");
59129
- return /* @__PURE__ */ jsx(Root2$4, { ...E, children: /* @__PURE__ */ jsxs(
59130
- SelectProvider,
59131
- {
59132
- required: S,
59133
- scope: t,
59134
- trigger: C,
59307
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-x-4 gap-y-4 flex-1", children: [
59308
+ /* @__PURE__ */ jsxs("div", { children: [
59309
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "MPN" }),
59310
+ /* @__PURE__ */ jsx("div", { className: "font-medium", children: e.MPN || "N/A" })
59311
+ ] }),
59312
+ /* @__PURE__ */ jsxs("div", { children: [
59313
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "UPC" }),
59314
+ /* @__PURE__ */ jsx("div", { className: "font-medium", children: e.UPC || "N/A" })
59315
+ ] }),
59316
+ /* @__PURE__ */ jsxs("div", { children: [
59317
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Unit Weight" }),
59318
+ /* @__PURE__ */ jsx("div", { className: "font-medium", children: e.UnitWeight ? `${e.UnitWeight} lbs` : "N/A" })
59319
+ ] }),
59320
+ /* @__PURE__ */ jsxs("div", { children: [
59321
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "MAP" }),
59322
+ /* @__PURE__ */ jsx("div", { className: "font-medium", children: e.MAP ? "$" + e.MAP.toFixed(2) : "N/A" })
59323
+ ] }),
59324
+ e.CountryCodeOfOrigin && /* @__PURE__ */ jsxs("div", { children: [
59325
+ /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Origin" }),
59326
+ /* @__PURE__ */ jsxs("div", { className: "font-medium flex items-center", children: [
59327
+ /* @__PURE__ */ jsx(
59328
+ CountryFlag,
59329
+ {
59330
+ countryCode: e.CountryCodeOfOrigin,
59331
+ className: "mr-2"
59332
+ }
59333
+ ),
59334
+ e.CountryCodeOfOrigin
59335
+ ] })
59336
+ ] })
59337
+ ] })
59338
+ ] }),
59339
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx(ProductImage, { randmarSKU: e.RandmarSKU || "", alt: e.RandmarTitle || "" }) })
59340
+ ] }),
59341
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-6 mt-4", children: [
59342
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1", children: F && e.Distribution && /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
59343
+ /* @__PURE__ */ jsx("div", { className: "flex items-center", children: "You have " + q.length + (q.length > 1 ? " opportunities" : " opportunity") + " for this product:" }),
59344
+ /* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1", children: q.map((le, oe) => {
59345
+ var te;
59346
+ return /* @__PURE__ */ jsxs(
59347
+ "div",
59348
+ {
59349
+ className: `flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
59350
+ ${le.BidNumber == (_ == null ? void 0 : _.BidNumber) ? "cursor-pointer border-2 border-purple-900" : j(le) ? "hover:bg-purple-200 cursor-pointer" : "!bg-neutral-50"}
59351
+ `,
59352
+ onClick: () => {
59353
+ j(le) && S(
59354
+ le.BidNumber != (_ == null ? void 0 : _.BidNumber) ? le : null
59355
+ );
59356
+ },
59357
+ children: [
59358
+ /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
59359
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: le.Opportunity }),
59360
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-neutral-900", children: [
59361
+ le.BidNumber,
59362
+ " ",
59363
+ !j(le) && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-xs mx-1 h-5 bg-gray-100", children: "Currently unavailable" })
59364
+ ] })
59365
+ ] }) }),
59366
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end", children: [
59367
+ /* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
59368
+ "$",
59369
+ (te = le.Price) == null ? void 0 : te.toFixed(2)
59370
+ ] }),
59371
+ le.Rebate && le.Rebate > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-green-600", children: [
59372
+ "Rebate: $",
59373
+ le.Rebate.toFixed(2)
59374
+ ] }),
59375
+ le.EndDate && /* @__PURE__ */ jsxs("span", { className: "text-xs text-neutral-600", children: [
59376
+ "Ends: ",
59377
+ ae(le.EndDate)
59378
+ ] })
59379
+ ] })
59380
+ ]
59381
+ },
59382
+ oe
59383
+ );
59384
+ }) })
59385
+ ] }) }),
59386
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
59387
+ u && /* @__PURE__ */ jsx(Link, { to: u, children: /* @__PURE__ */ jsxs(Button, { variant: "secondary", children: [
59388
+ /* @__PURE__ */ jsx(Eye, { className: "mr-2" }),
59389
+ "View Product"
59390
+ ] }) }),
59391
+ ((ve = e.Distribution) == null ? void 0 : ve.Inventory) && /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxs(Dialog, { open: C, onOpenChange: I, children: [
59392
+ /* @__PURE__ */ jsx(DialogTrigger, { asChild: !0, children: /* @__PURE__ */ jsxs(
59393
+ Button,
59394
+ {
59395
+ variant: "ghost",
59396
+ className: `flex items-center text-sm ${Z > 0 ? "text-green-700" : "text-red-700"}`,
59397
+ children: [
59398
+ /* @__PURE__ */ jsx(Warehouse, { size: "16", className: "mr-2" }),
59399
+ Z > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
59400
+ Z,
59401
+ " in stock"
59402
+ ] }) : /* @__PURE__ */ jsx(Fragment, { children: "Out of stock" })
59403
+ ]
59404
+ }
59405
+ ) }),
59406
+ /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-4xl", children: [
59407
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(DialogTitle, { className: "flex items-center", children: [
59408
+ /* @__PURE__ */ jsx(Warehouse, { className: "mr-2", size: 18 }),
59409
+ "Inventory Information"
59410
+ ] }) }),
59411
+ /* @__PURE__ */ jsx(ProductInventoryGrid, { inventory: e.Distribution.Inventory })
59412
+ ] })
59413
+ ] }) })
59414
+ ] })
59415
+ ] }),
59416
+ e.Distribution && /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-end mt-4", children: [
59417
+ /* @__PURE__ */ jsx("div", { className: "flex-shrink-1 flex flex-col items-start gap-1", children: N > 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxs("span", { className: "text-2xl font-bold whitespace-nowrap", children: [
59418
+ /* @__PURE__ */ jsx("span", { children: "Cost: $" }),
59419
+ N.toFixed(2),
59420
+ /* @__PURE__ */ jsx("span", { children: " CAD" })
59421
+ ] }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
59422
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center flex-wrap", children: [
59423
+ /* @__PURE__ */ jsxs("span", { className: "text-2xl font-bold whitespace-nowrap", children: [
59424
+ /* @__PURE__ */ jsx("span", { children: "$" }),
59425
+ _ ? (ye = (he = e.Opportunities) == null ? void 0 : he.find((le) => le.BidNumber == _.BidNumber)) == null ? void 0 : ye.Price : V.toFixed(2),
59426
+ /* @__PURE__ */ jsx("span", { children: " CAD" })
59427
+ ] }),
59428
+ T > 0 && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground line-through ml-2 whitespace-nowrap", children: [
59429
+ "$",
59430
+ O.toFixed(2)
59431
+ ] })
59432
+ ] }),
59433
+ T > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap", children: [
59434
+ /* @__PURE__ */ jsxs("span", { children: [
59435
+ T,
59436
+ "% OFF"
59437
+ ] }),
59438
+ ((fe = e.InstantRebate) == null ? void 0 : fe.EndDate) && /* @__PURE__ */ jsxs(Fragment, { children: [
59439
+ /* @__PURE__ */ jsx("span", { className: "mx-1.5", children: "●" }),
59440
+ " Ends ",
59441
+ e.InstantRebate.EndDate.split("T")[0]
59442
+ ] }),
59443
+ (_ == null ? void 0 : _.EndDate) && /* @__PURE__ */ jsxs(Fragment, { children: [
59444
+ /* @__PURE__ */ jsx("span", { className: "mx-1.5", children: "●" }),
59445
+ " Ends ",
59446
+ _.EndDate.split("T")[0]
59447
+ ] })
59448
+ ] }) })
59449
+ ] }) }),
59450
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 gap-2 ml-4", children: [
59451
+ typeof t < "u" && t && /* @__PURE__ */ jsxs("div", { className: "flex items-center border rounded-md", children: [
59452
+ /* @__PURE__ */ jsx(
59453
+ Button,
59454
+ {
59455
+ variant: "ghost",
59456
+ size: "icon",
59457
+ className: "rounded-r-none",
59458
+ onClick: H,
59459
+ disabled: typeof g < "u" && (g <= 1 || !e.AvailableToBuy || f || !d),
59460
+ children: "-"
59461
+ }
59462
+ ),
59463
+ /* @__PURE__ */ jsx(
59464
+ "input",
59465
+ {
59466
+ value: g,
59467
+ onChange: G,
59468
+ onBlur: J,
59469
+ onClick: (le) => le.currentTarget.select(),
59470
+ className: `w-12 text-center border-0 focus:ring-0 focus:outline-none ${!e.AvailableToBuy || f || !d ? "text-gray-400" : ""}`,
59471
+ disabled: !e.AvailableToBuy || f || !d
59472
+ }
59473
+ ),
59474
+ /* @__PURE__ */ jsx(
59475
+ Button,
59476
+ {
59477
+ variant: "ghost",
59478
+ size: "icon",
59479
+ className: "rounded-l-none",
59480
+ onClick: U,
59481
+ disabled: !e.AvailableToBuy || f || !d,
59482
+ children: "+"
59483
+ }
59484
+ )
59485
+ ] }),
59486
+ typeof t < "u" && t && /* @__PURE__ */ jsx(
59487
+ Button,
59488
+ {
59489
+ className: "gap-2 whitespace-nowrap",
59490
+ onClick: W,
59491
+ disabled: !e.AvailableToBuy || f || !d,
59492
+ children: f ? /* @__PURE__ */ jsxs(Fragment, { children: [
59493
+ /* @__PURE__ */ jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }),
59494
+ "Adding..."
59495
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
59496
+ /* @__PURE__ */ jsx(ShoppingCart, { className: "mr-2" }),
59497
+ "Add to Cart"
59498
+ ] })
59499
+ }
59500
+ ),
59501
+ n && /* @__PURE__ */ jsx(
59502
+ Button,
59503
+ {
59504
+ className: "gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",
59505
+ onClick: p,
59506
+ disabled: m || !p,
59507
+ children: m ? /* @__PURE__ */ jsxs(Fragment, { children: [
59508
+ /* @__PURE__ */ jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }),
59509
+ "Syncing..."
59510
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
59511
+ /* @__PURE__ */ jsx(ShoppingCart, { className: "mr-2" }),
59512
+ "Sync to Shopify"
59513
+ ] })
59514
+ }
59515
+ ),
59516
+ o
59517
+ ] })
59518
+ ] })
59519
+ ] }) });
59520
+ }
59521
+ const complexComponents = [
59522
+ `----
59523
+ PartnerCard: For data that fits this shape:
59524
+ { "ApplicationId": "19022", "PublicName": "BiOSS", "VoiceName": null, "VoiceStyle": null, "About": "example", "SceneName": "Kitchen Counter", "IsReseller": true, "IsManufacturer": true, "IsSalesAgency": false, "Socials": [ { "ApplicationId": "19022", "SocialNetwork": "Facebook", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "Instagram", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "LinkedIn", "Tag": "@biossinc" }, { "ApplicationId": "19022", "SocialNetwork": "Youtube", "Tag": "@biosssolutionssanitairessa4095" } ], "Manufacturer": null, "Reseller": null }
59525
+ Use <PartnerCard account={data}>`,
59526
+ `----
59527
+ ManufacturerCard: For data that fits this shape:
59528
+ { "ManufacturerId": "19022", "Website": "https://www.example.ca", "PublicName": "BiOSS", "LastUpdatedDate": 20241217, "AutoReorderDate": -1, "AutoUpdate": false, "PublicEmail": "example@example.ca", "DefaultWeeksOfStocking": 4, "Tags": "Health & Cleaning", "CreationDate": 20220127, "PartnerPortal": "", "PartnerRegistrationLink": "", "About": "example...", "OpenToWork": false, "PublicResourcesLink": "https://drive.google.com/drive/folders/example", "CurrencyCode": "CAD", "YoutubePlaylist": "null" }
59529
+ Use <ManufacturerCard manufacturer={data}>`,
59530
+ `----
59531
+ ResellerCard: For data that fits this shape:
59532
+ { "ResellerId": "Y8IUSIHNG", "Name": "Montmorency", "OnHold": 0, "Address1": "475 Bd De L'avenir", "Address2": "", "PublicName": "Mccormick Casey LLCC", "City": "Laval", "Province": "QC", "PostalCode": "H7N 5H9", "Country": "CA", "PriceProfile": 3, "Language": "ENG", "Website": "", "Terms": "STRIPE", "DefaultWarehouse": "MTL", "Domain": "", "AREmail": "", "POEmail": "", "ShippingProfile": "E", "ShipVia": "", "ShipViaDescription": "", "Phone": "", "Priority": "Starter", "AllowSystemIntegration": 1, "CreditLimit": 1000.000, "PriceList": "DEF", "ContactName": "", "CreationDate": 20250310.0, "LastInvoiceDate": 0.0, "PublicEmail": "", "CurrencyCode": "CAD", "AllowBackorderQuantities": true, "AllowPartialShipments": true, "FiscalYearMonthStart": 1, "About": "", "Qualifications": [], "SalesData": null }
59533
+ Use <ResellerCard reseller={data}>`,
59534
+ `----
59535
+ Sometimes, manufacturer and reseller data can be embed into a partner object: For example, for data that fits this shape:
59536
+ { "ApplicationId": "19022", "PublicName": "BiOSS", "VoiceName": null, "VoiceStyle": null, "About": "example", "SceneName": "Kitchen Counter", "IsReseller": true, "IsManufacturer": true, "IsSalesAgency": false, "Socials": [ { "ApplicationId": "19022", "SocialNetwork": "Facebook", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "Instagram", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "LinkedIn", "Tag": "@biossinc" }, { "ApplicationId": "19022", "SocialNetwork": "Youtube", "Tag": "@biosssolutionssanitairessa4095" } ], "Manufacturer": { "ManufacturerId": "19022", "Website": "https://www.example.ca", "PublicName": "BiOSS", "LastUpdatedDate": 20241217, "AutoReorderDate": -1, "AutoUpdate": false, "PublicEmail": "example@example.ca", "DefaultWeeksOfStocking": 4, "Tags": "Health & Cleaning", "CreationDate": 20220127, "PartnerPortal": "", "PartnerRegistrationLink": "", "About": "example...", "OpenToWork": false, "PublicResourcesLink": "https://drive.google.com/drive/folders/example", "CurrencyCode": "CAD", "YoutubePlaylist": "null" }, "Reseller": null }
59537
+ Use both <PartnerCard account={data}> and <ManufacturerCard manufacturer={data.Manufacturer}>`,
59538
+ `----
59539
+ ProductCard, for data that fits this shape:
59540
+ { "RandmarSKU": "3007864", "RandmarTitle": "CTTN450 COMPATIBLE TN450 TONER", "Category": "CT", "UnitWeight": 1.5500, "UPC": "628277000035", "ManufacturerName": "Balloon Brand", "ProductType": "Toners", "AutoUpdate": 1, "CreatedBy": "", "LastMaintainedDate": 20190314.0, "Title": "CTTN450 COMPATIBLE TN450 TONER", "BodyHTML": "<p>CTTN450 COMPATIBLE TN450 TONER</p>", "MAP": 17.5500, "ManufacturerId": "90200", "State": "Active", "MPN": "CTTN450", "MasterCarton": 12, "SkidQuantity": null, "SerialNumber": true, "OpportunityOnly": false, "VoiceoverCaption": "example...", "SceneName": "Top of Clouds", "Require3DScan": false, "TransparencyCode": false, "CountryCodeOfOrigin": null, "UnitLength": null, "UnitWidth": null, "UnitHeight": null, "Distribution": { "Price": 14.29, "RegularPrice": 14.29, "MAP": 17.55, "Currency": "CAD", "ExchangeRate": 1.000000000, "Inventory": [ { "RandmarSKU": "3007864", "WarehouseId": "EDM", "WarehouseType": "Fulfillment Center", "Name": "Randmar Edmonton", "City": "Edmonton", "Province": "AB", "Country": "CA", "AvailableQuantity": 7, "PurchaseOrderQuantity": 0, "BinLocation": "" }, { "RandmarSKU": "3007864", "WarehouseId": "MTL", "WarehouseType": "Fulfillment Center", "Name": "Randmar Montreal", "City": "Pierrefonds", "Province": "QC", "Country": "CA", "AvailableQuantity": 45, "PurchaseOrderQuantity": 0, "BinLocation": "C3EB" }, { "RandmarSKU": "3007864", "WarehouseId": "TOR", "WarehouseType": "Fulfillment Center", "Name": "Randmar Toronto", "City": "Mississauga", "Province": "ON", "Country": "CA", "AvailableQuantity": 15, "PurchaseOrderQuantity": 0, "BinLocation": "A6A" }, { "RandmarSKU": "3007864", "WarehouseId": "VAN", "WarehouseType": "Fulfillment Center", "Name": "Randmar Vancouver", "City": "Richmond", "Province": "BC", "Country": "CA", "AvailableQuantity": 8, "PurchaseOrderQuantity": 0, "BinLocation": "" } ] }, "ManufacturerCategory": { "ManufacturerId": "90200", "CategoryCode": "CT", "CategoryName": "Toners", "Starred": false, "AutoReorder": true, "QualificationRequired": false, "Niche": "Print" }, "InstantRebate": null, "Opportunities": null, "AvailableToBuy": true }
59541
+ Use <ProductCard item={data}>`
59542
+ ], basicComponents = [
59543
+ "<Card> <CardHeader> <CardTitle>...</CardTitle> <CardDescription>...</CardDescription> </CardHeader> <CardContent> ... </CardContent> </Card>",
59544
+ "<Badge>...</Badge>",
59545
+ '<Tabs defaultValue="eg1"> <TabsList> <TabsTrigger value="eg1">Example1</TabsTrigger> <TabsTrigger value="eg2">Example2</TabsTrigger> </TabsList> <TabsContent value="eg1"> ... </TabsContent> <TabsContent value="eg2"> ... </TabsContent> </Tabs>',
59546
+ "<ScrollArea>...</ScrollArea>",
59547
+ "<ScrollArea orientation='horizontal'>...</ScrollArea>"
59548
+ ], GetJSXFromAI = async (e, t, n, o = 3) => {
59549
+ const l = "In addition to basic html tags, You have access to these beautiful Handmade Components:", u = "You also have access to these few Shadcn UI components:", d = "Here is the data to display to the user (If a Handmade Component is a good fit for the data, use it. Otherwise, use regular html tags) (You have access to this data object in React via the data variable):", f = "Only output a single JSX code snippet. Start with <> and end with </>. All other code will be ignored, so make sure to place all CSS styles inline. Use CSS flex layouts when there is a lot of stuff to display.", p = JSON.stringify(n), m = [t, l, ...complexComponents, u, ...basicComponents, f, d, p, f].join(`\r
59550
+ `), _ = await new GoogleGenAI({ apiKey: e }).chats.create({
59551
+ model: "gemini-2.0-flash-lite"
59552
+ }).sendMessage({ message: m }), S = trimJSXString(_.text ?? "");
59553
+ return S || (o == 0 ? "<p>Failed to generate. Reload the page.</p>" : await GetJSXFromAI(e, t, n, o - 1));
59554
+ };
59555
+ function trimJSXString(e) {
59556
+ const t = e.indexOf("<"), n = e.lastIndexOf("</");
59557
+ return t === -1 || n === -1 ? "" : e.slice(t, e.indexOf(">", n) + 1);
59558
+ }
59559
+ function AiGeneratedContent(e) {
59560
+ const [t, n] = useState(""), { apiKey: o } = useApiKey();
59561
+ return useEffect(() => {
59562
+ if (!o || !e.prompt || !e.data) return;
59563
+ n("");
59564
+ let l = !1;
59565
+ return GetJSXFromAI(o, e.prompt, e.data).then((u) => {
59566
+ l || n(u);
59567
+ }), () => {
59568
+ l = !0;
59569
+ };
59570
+ }, [e.prompt, e.data, n, o]), t ? /* @__PURE__ */ jsx(
59571
+ source_default,
59572
+ {
59573
+ bindings: {
59574
+ data: e.data
59575
+ },
59576
+ components: {
59577
+ ResellerCard,
59578
+ ManufacturerCard,
59579
+ PartnerCard,
59580
+ ProductCard,
59581
+ Card,
59582
+ CardHeader,
59583
+ CardTitle,
59584
+ CardContent,
59585
+ CardDescription,
59586
+ Badge,
59587
+ Tabs,
59588
+ TabsList,
59589
+ TabsContent,
59590
+ TabsTrigger,
59591
+ ScrollArea
59592
+ },
59593
+ jsx: t
59594
+ }
59595
+ ) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-32", children: /* @__PURE__ */ jsx(Bot, { className: "m-auto align-middle h-full" }) }) });
59596
+ }
59597
+ function GeneralDocumentCard({ document: e, loading: t = !1 }) {
59598
+ return t ? /* @__PURE__ */ jsx("div", { children: "loading..." }) : /* @__PURE__ */ jsxs("div", { children: [
59599
+ "GENERAL DOCUMENT CARD - ",
59600
+ e == null ? void 0 : e.OrderNumber,
59601
+ " for P.O. ",
59602
+ e == null ? void 0 : e.PONumber
59603
+ ] });
59604
+ }
59605
+ const Navbar = forwardRef(
59606
+ ({ routes: e, footer: t, dashboardTitle: n, withRandmarAssistant: o, chatUserName: l, chatApiKey: u }, d) => {
59607
+ const { appID: f } = useParams(), p = e.filter((_) => _.showInNav), m = useRef(null), g = useRef(null), b = useRef(null);
59608
+ return useImperativeHandle(d, () => ({
59609
+ setActiveChatAndSendMessage: (_, S) => {
59610
+ var T;
59611
+ return (T = b.current) == null || T.click(), setTimeout(() => {
59612
+ var E;
59613
+ (E = m.current) == null || E.focus(), g.current && g.current.setActiveChatAndSendMessage(_, S);
59614
+ }, 100), !0;
59615
+ }
59616
+ })), /* @__PURE__ */ jsxs(Sidebar, { className: "border-r border-sidebar-border", children: [
59617
+ /* @__PURE__ */ jsx(SidebarHeader, { className: "border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
59618
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
59619
+ "img",
59620
+ {
59621
+ src: "https://api.randmar.io/images/RandmarIcon.svg",
59622
+ alt: "Randmar Icon",
59623
+ className: "h-4 w-4 filter brightness-0 saturate-100 invert"
59624
+ }
59625
+ ) }),
59626
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-lg", children: n })
59627
+ ] }) }),
59628
+ /* @__PURE__ */ jsx(SidebarContent, { className: "py-4 bg-sidebar text-sidebar-foreground", children: /* @__PURE__ */ jsx(SidebarMenu, { children: p.map((_) => {
59629
+ const S = _.icon, T = `/${_.path.replace(":appID", f ?? "")}`;
59630
+ return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, { asChild: !0, children: /* @__PURE__ */ jsxs(Link, { to: T, className: "transition-colors hover:bg-muted px-6", children: [
59631
+ S && /* @__PURE__ */ jsx(S, { className: "h-4 w-4" }),
59632
+ /* @__PURE__ */ jsx("span", { children: _.label })
59633
+ ] }) }) }, _.key);
59634
+ }) }) }),
59635
+ /* @__PURE__ */ jsxs(SidebarFooter, { className: "border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground", children: [
59636
+ o === !0 && /* @__PURE__ */ jsxs(Dialog, { children: [
59637
+ /* @__PURE__ */ jsx(DialogTrigger, { asChild: !0, children: /* @__PURE__ */ jsxs(
59638
+ Button,
59639
+ {
59640
+ ref: b,
59641
+ size: "lg",
59642
+ className: "collapse md:visible",
59643
+ onClick: () => setTimeout(() => {
59644
+ var _;
59645
+ return (_ = m.current) == null ? void 0 : _.focus();
59646
+ }, 50),
59647
+ children: [
59648
+ /* @__PURE__ */ jsx(Bot, {}),
59649
+ "Assistant"
59650
+ ]
59651
+ }
59652
+ ) }),
59653
+ /* @__PURE__ */ jsx(DialogContent, { className: "max-w-[85vw] p-0 data-[state=open]:visible data-[state=closed]:invisible", forceMount: !0, animateExit: !1, children: /* @__PURE__ */ jsx(ChatLayout, { ref: g, inputRef: m, userId: f ?? "2", userName: l ?? "Unknown user", apiKey: u ?? "" }) })
59654
+ ] }),
59655
+ t
59656
+ ] })
59657
+ ] });
59658
+ }
59659
+ ), Layout = forwardRef(({
59660
+ children: e,
59661
+ rightMenu: t,
59662
+ routes: n,
59663
+ footer: o,
59664
+ handleValidSearch: l,
59665
+ dashboardTitle: u,
59666
+ onSignOut: d,
59667
+ searchPlaceholder: f,
59668
+ withRandmarAssistant: p,
59669
+ chatUserName: m,
59670
+ chatApiKey: g,
59671
+ chatRef: b
59672
+ }, _) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(SidebarProvider, { children: /* @__PURE__ */ jsxs("div", { className: "flex grow", children: [
59673
+ /* @__PURE__ */ jsx(
59674
+ Navbar,
59675
+ {
59676
+ routes: n,
59677
+ footer: o,
59678
+ dashboardTitle: u,
59679
+ withRandmarAssistant: p,
59680
+ chatUserName: m,
59681
+ chatApiKey: g,
59682
+ ref: b
59683
+ }
59684
+ ),
59685
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
59686
+ /* @__PURE__ */ jsx(
59687
+ Topbar,
59688
+ {
59689
+ ref: _,
59690
+ onSignOut: d,
59691
+ rightMenu: t,
59692
+ handleValidSearch: l,
59693
+ searchPlaceholder: f
59694
+ }
59695
+ ),
59696
+ /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-auto mt-16", children: e }),
59697
+ /* @__PURE__ */ jsx(Toaster, {})
59698
+ ] })
59699
+ ] }) }) }));
59700
+ Layout.displayName = "Layout";
59701
+ function usePrevious(e) {
59702
+ const t = React.useRef({ value: e, previous: e });
59703
+ return React.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
59704
+ }
59705
+ var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"], SELECTION_KEYS = [" ", "Enter"], SELECT_NAME = "Select", [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME), [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [
59706
+ createCollectionScope,
59707
+ createPopperScope
59708
+ ]), usePopperScope = createPopperScope(), [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME), [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME), Select$1 = (e) => {
59709
+ const {
59710
+ __scopeSelect: t,
59711
+ children: n,
59712
+ open: o,
59713
+ defaultOpen: l,
59714
+ onOpenChange: u,
59715
+ value: d,
59716
+ defaultValue: f,
59717
+ onValueChange: p,
59718
+ dir: m,
59719
+ name: g,
59720
+ autoComplete: b,
59721
+ disabled: _,
59722
+ required: S,
59723
+ form: T
59724
+ } = e, E = usePopperScope(t), [C, I] = React.useState(null), [N, O] = React.useState(null), [V, M] = React.useState(!1), R = useDirection(m), [D, L] = useControllableState({
59725
+ prop: o,
59726
+ defaultProp: l ?? !1,
59727
+ onChange: u,
59728
+ caller: SELECT_NAME
59729
+ }), [j, q] = useControllableState({
59730
+ prop: d,
59731
+ defaultProp: f,
59732
+ onChange: p,
59733
+ caller: SELECT_NAME
59734
+ }), F = React.useRef(null), H = C ? T || !!C.closest("form") : !0, [U, G] = React.useState(/* @__PURE__ */ new Set()), J = Array.from(U).map((Z) => Z.props.value).join(";");
59735
+ return /* @__PURE__ */ jsx(Root2$4, { ...E, children: /* @__PURE__ */ jsxs(
59736
+ SelectProvider,
59737
+ {
59738
+ required: S,
59739
+ scope: t,
59740
+ trigger: C,
59135
59741
  onTriggerChange: I,
59136
59742
  valueNode: N,
59137
59743
  onValueNodeChange: O,
@@ -59294,16 +59900,16 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
59294
59900
  avoidCollisions: C,
59295
59901
  //
59296
59902
  ...I
59297
- } = e, N = useSelectContext(CONTENT_NAME, n), [O, V] = React.useState(null), [M, R] = React.useState(null), D = useComposedRefs(t, (de) => V(de)), [L, j] = React.useState(null), [q, F] = React.useState(
59903
+ } = e, N = useSelectContext(CONTENT_NAME, n), [O, V] = React.useState(null), [M, R] = React.useState(null), D = useComposedRefs(t, (he) => V(he)), [L, j] = React.useState(null), [q, F] = React.useState(
59298
59904
  null
59299
59905
  ), H = useCollection(n), [U, G] = React.useState(!1), J = React.useRef(!1);
59300
59906
  React.useEffect(() => {
59301
59907
  if (O) return hideOthers(O);
59302
59908
  }, [O]), useFocusGuards();
59303
59909
  const Z = React.useCallback(
59304
- (de) => {
59910
+ (he) => {
59305
59911
  const [ye, ...fe] = H().map((te) => te.ref.current), [le] = fe.slice(-1), oe = document.activeElement;
59306
- for (const te of de)
59912
+ for (const te of he)
59307
59913
  if (te === oe || (te == null || te.scrollIntoView({ block: "nearest" }), te === ye && M && (M.scrollTop = 0), te === le && M && (M.scrollTop = M.scrollHeight), te == null || te.focus(), document.activeElement !== oe)) return;
59308
59914
  },
59309
59915
  [H, M]
@@ -59317,42 +59923,42 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
59317
59923
  const { onOpenChange: W, triggerPointerDownPosRef: Q } = N;
59318
59924
  React.useEffect(() => {
59319
59925
  if (O) {
59320
- let de = { x: 0, y: 0 };
59926
+ let he = { x: 0, y: 0 };
59321
59927
  const ye = (le) => {
59322
59928
  var oe, te;
59323
- de = {
59929
+ he = {
59324
59930
  x: Math.abs(Math.round(le.pageX) - (((oe = Q.current) == null ? void 0 : oe.x) ?? 0)),
59325
59931
  y: Math.abs(Math.round(le.pageY) - (((te = Q.current) == null ? void 0 : te.y) ?? 0))
59326
59932
  };
59327
59933
  }, fe = (le) => {
59328
- de.x <= 10 && de.y <= 10 ? le.preventDefault() : O.contains(le.target) || W(!1), document.removeEventListener("pointermove", ye), Q.current = null;
59934
+ he.x <= 10 && he.y <= 10 ? le.preventDefault() : O.contains(le.target) || W(!1), document.removeEventListener("pointermove", ye), Q.current = null;
59329
59935
  };
59330
59936
  return Q.current !== null && (document.addEventListener("pointermove", ye), document.addEventListener("pointerup", fe, { capture: !0, once: !0 })), () => {
59331
59937
  document.removeEventListener("pointermove", ye), document.removeEventListener("pointerup", fe, { capture: !0 });
59332
59938
  };
59333
59939
  }
59334
59940
  }, [O, W, Q]), React.useEffect(() => {
59335
- const de = () => W(!1);
59336
- return window.addEventListener("blur", de), window.addEventListener("resize", de), () => {
59337
- window.removeEventListener("blur", de), window.removeEventListener("resize", de);
59941
+ const he = () => W(!1);
59942
+ return window.addEventListener("blur", he), window.addEventListener("resize", he), () => {
59943
+ window.removeEventListener("blur", he), window.removeEventListener("resize", he);
59338
59944
  };
59339
59945
  }, [W]);
59340
- const [ee, ie] = useTypeaheadSearch((de) => {
59341
- const ye = H().filter((oe) => !oe.disabled), fe = ye.find((oe) => oe.ref.current === document.activeElement), le = findNextItem(ye, de, fe);
59946
+ const [ee, ie] = useTypeaheadSearch((he) => {
59947
+ const ye = H().filter((oe) => !oe.disabled), fe = ye.find((oe) => oe.ref.current === document.activeElement), le = findNextItem(ye, he, fe);
59342
59948
  le && setTimeout(() => le.ref.current.focus());
59343
59949
  }), ce = React.useCallback(
59344
- (de, ye, fe) => {
59950
+ (he, ye, fe) => {
59345
59951
  const le = !J.current && !fe;
59346
- (N.value !== void 0 && N.value === ye || le) && (j(de), le && (J.current = !0));
59952
+ (N.value !== void 0 && N.value === ye || le) && (j(he), le && (J.current = !0));
59347
59953
  },
59348
59954
  [N.value]
59349
59955
  ), ue = React.useCallback(() => O == null ? void 0 : O.focus(), [O]), pe = React.useCallback(
59350
- (de, ye, fe) => {
59956
+ (he, ye, fe) => {
59351
59957
  const le = !J.current && !fe;
59352
- (N.value !== void 0 && N.value === ye || le) && F(de);
59958
+ (N.value !== void 0 && N.value === ye || le) && F(he);
59353
59959
  },
59354
59960
  [N.value]
59355
- ), he = o === "popper" ? SelectPopperPosition : SelectItemAlignedPosition, ve = he === SelectPopperPosition ? {
59961
+ ), de = o === "popper" ? SelectPopperPosition : SelectItemAlignedPosition, ve = de === SelectPopperPosition ? {
59356
59962
  side: f,
59357
59963
  sideOffset: p,
59358
59964
  align: m,
@@ -59385,12 +59991,12 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
59385
59991
  {
59386
59992
  asChild: !0,
59387
59993
  trapped: N.open,
59388
- onMountAutoFocus: (de) => {
59389
- de.preventDefault();
59994
+ onMountAutoFocus: (he) => {
59995
+ he.preventDefault();
59390
59996
  },
59391
- onUnmountAutoFocus: composeEventHandlers(l, (de) => {
59997
+ onUnmountAutoFocus: composeEventHandlers(l, (he) => {
59392
59998
  var ye;
59393
- (ye = N.trigger) == null || ye.focus({ preventScroll: !0 }), de.preventDefault();
59999
+ (ye = N.trigger) == null || ye.focus({ preventScroll: !0 }), he.preventDefault();
59394
60000
  }),
59395
60001
  children: /* @__PURE__ */ jsx(
59396
60002
  DismissableLayer,
@@ -59399,16 +60005,16 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
59399
60005
  disableOutsidePointerEvents: !0,
59400
60006
  onEscapeKeyDown: u,
59401
60007
  onPointerDownOutside: d,
59402
- onFocusOutside: (de) => de.preventDefault(),
60008
+ onFocusOutside: (he) => he.preventDefault(),
59403
60009
  onDismiss: () => N.onOpenChange(!1),
59404
60010
  children: /* @__PURE__ */ jsx(
59405
- he,
60011
+ de,
59406
60012
  {
59407
60013
  role: "listbox",
59408
60014
  id: N.contentId,
59409
60015
  "data-state": N.open ? "open" : "closed",
59410
60016
  dir: N.dir,
59411
- onContextMenu: (de) => de.preventDefault(),
60017
+ onContextMenu: (he) => he.preventDefault(),
59412
60018
  ...I,
59413
60019
  ...ve,
59414
60020
  onPlaced: () => G(!0),
@@ -59421,15 +60027,15 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
59421
60027
  outline: "none",
59422
60028
  ...I.style
59423
60029
  },
59424
- onKeyDown: composeEventHandlers(I.onKeyDown, (de) => {
59425
- const ye = de.ctrlKey || de.altKey || de.metaKey;
59426
- if (de.key === "Tab" && de.preventDefault(), !ye && de.key.length === 1 && ie(de.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(de.key)) {
60030
+ onKeyDown: composeEventHandlers(I.onKeyDown, (he) => {
60031
+ const ye = he.ctrlKey || he.altKey || he.metaKey;
60032
+ if (he.key === "Tab" && he.preventDefault(), !ye && he.key.length === 1 && ie(he.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(he.key)) {
59427
60033
  let le = H().filter((oe) => !oe.disabled).map((oe) => oe.ref.current);
59428
- if (["ArrowUp", "End"].includes(de.key) && (le = le.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(de.key)) {
59429
- const oe = de.target, te = le.indexOf(oe);
60034
+ if (["ArrowUp", "End"].includes(he.key) && (le = le.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(he.key)) {
60035
+ const oe = he.target, te = le.indexOf(oe);
59430
60036
  le = le.slice(te + 1);
59431
60037
  }
59432
- setTimeout(() => Z(le)), de.preventDefault();
60038
+ setTimeout(() => Z(le)), he.preventDefault();
59433
60039
  }
59434
60040
  })
59435
60041
  }
@@ -59465,12 +60071,12 @@ var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition", SelectItemAlignedP
59465
60071
  ]);
59466
60072
  f.style.minWidth = se + "px", f.style.right = Ee + "px";
59467
60073
  }
59468
- const F = _(), H = window.innerHeight - CONTENT_MARGIN * 2, U = E.scrollHeight, G = window.getComputedStyle(m), J = parseInt(G.borderTopWidth, 10), Z = parseInt(G.paddingTop, 10), ae = parseInt(G.borderBottomWidth, 10), W = parseInt(G.paddingBottom, 10), Q = J + Z + U + W + ae, ee = Math.min(C.offsetHeight * 5, Q), ie = window.getComputedStyle(E), ce = parseInt(ie.paddingTop, 10), ue = parseInt(ie.paddingBottom, 10), pe = D.top + D.height / 2 - CONTENT_MARGIN, he = H - pe, ve = C.offsetHeight / 2, de = C.offsetTop + ve, ye = J + Z + de, fe = Q - ye;
60074
+ const F = _(), H = window.innerHeight - CONTENT_MARGIN * 2, U = E.scrollHeight, G = window.getComputedStyle(m), J = parseInt(G.borderTopWidth, 10), Z = parseInt(G.paddingTop, 10), ae = parseInt(G.borderBottomWidth, 10), W = parseInt(G.paddingBottom, 10), Q = J + Z + U + W + ae, ee = Math.min(C.offsetHeight * 5, Q), ie = window.getComputedStyle(E), ce = parseInt(ie.paddingTop, 10), ue = parseInt(ie.paddingBottom, 10), pe = D.top + D.height / 2 - CONTENT_MARGIN, de = H - pe, ve = C.offsetHeight / 2, he = C.offsetTop + ve, ye = J + Z + he, fe = Q - ye;
59469
60075
  if (ye <= pe) {
59470
60076
  const oe = F.length > 0 && C === F[F.length - 1].ref.current;
59471
60077
  f.style.bottom = "0px";
59472
60078
  const te = m.clientHeight - E.offsetTop - E.offsetHeight, be = Math.max(
59473
- he,
60079
+ de,
59474
60080
  ve + // viewport might have padding bottom, include it to avoid a scrollable viewport
59475
60081
  (oe ? ue : 0) + te + ae
59476
60082
  ), se = ye + be;
@@ -60331,569 +60937,6 @@ function ManufacturerReorderingCard({
60331
60937
  ] }) })
60332
60938
  ] });
60333
60939
  }
60334
- const imgSizeMap = {
60335
- sm: 100,
60336
- md: 200,
60337
- lg: 300,
60338
- xl: 400
60339
- };
60340
- function ProductImage({ randmarSKU: e, size: t = "md", alt: n, secondaryContent: o }) {
60341
- const [l, u] = React.useState(!1), [d, f] = React.useState(!1), [p, m] = React.useState(!1), [g, b] = React.useState(!1), _ = `https://api.randmar.io/Product/${e}/Video`;
60342
- React.useEffect(() => {
60343
- (async () => {
60344
- try {
60345
- const O = await (await fetch(_ + "/Exists")).json();
60346
- f(O);
60347
- } catch (N) {
60348
- console.error("Error checking for video:", N), f(!1);
60349
- }
60350
- })();
60351
- }, [e, _]);
60352
- async function S() {
60353
- if (d) {
60354
- b(!0);
60355
- try {
60356
- const N = await (await fetch(_)).blob(), O = window.URL.createObjectURL(N), V = document.createElement("a");
60357
- V.href = O, V.download = `${e || "product"}-video.mp4`, document.body.appendChild(V), V.click(), document.body.removeChild(V), window.URL.revokeObjectURL(O);
60358
- } catch (I) {
60359
- console.error("Error downloading video:", I);
60360
- } finally {
60361
- b(!1);
60362
- }
60363
- }
60364
- }
60365
- function T() {
60366
- navigator.clipboard.writeText(_), m(!0), setTimeout(() => {
60367
- m(!1);
60368
- }, 2e3);
60369
- }
60370
- function E() {
60371
- u(!0);
60372
- }
60373
- const C = imgSizeMap[t || "xl"];
60374
- return /* @__PURE__ */ jsxs(Fragment, { children: [
60375
- /* @__PURE__ */ jsx(Dialog, { open: l, onOpenChange: u, children: /* @__PURE__ */ jsx(DialogContent, { className: "max-w-4xl p-0 overflow-hidden", children: o ? /* @__PURE__ */ jsxs("div", { className: "flex flex-row", children: [
60376
- /* @__PURE__ */ jsxs(
60377
- "video",
60378
- {
60379
- className: "w-full rounded-l-lg max-h-[720px] object-contain",
60380
- controls: !0,
60381
- autoPlay: !0,
60382
- muted: !0,
60383
- loop: !0,
60384
- children: [
60385
- /* @__PURE__ */ jsx("source", { src: _, type: "video/mp4" }),
60386
- "Your browser does not support the video tag."
60387
- ]
60388
- }
60389
- ),
60390
- /* @__PURE__ */ jsx("div", { className: "flex-grow min-w-[400px] h-[70vh] p-6", children: o })
60391
- ] }) : /* @__PURE__ */ jsxs("div", { className: "w-full relative", children: [
60392
- /* @__PURE__ */ jsxs("video", { className: "w-full max-h-[720px] object-contain", controls: !0, autoPlay: !0, children: [
60393
- /* @__PURE__ */ jsx("source", { src: _, type: "video/mp4" }),
60394
- "Your browser does not support the video tag."
60395
- ] }),
60396
- /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-12 flex gap-1", children: [
60397
- /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
60398
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(
60399
- Button,
60400
- {
60401
- variant: "secondary",
60402
- size: "icon",
60403
- onClick: T,
60404
- children: p ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(Copy, { className: "h-4 w-4" })
60405
- }
60406
- ) }),
60407
- /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Copy video link" }) })
60408
- ] }) }),
60409
- /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
60410
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(
60411
- Button,
60412
- {
60413
- variant: "secondary",
60414
- size: "icon",
60415
- onClick: S,
60416
- disabled: g,
60417
- children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" })
60418
- }
60419
- ) }),
60420
- /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Download video" }) })
60421
- ] }) })
60422
- ] })
60423
- ] }) }) }),
60424
- /* @__PURE__ */ jsxs("div", { className: "relative w-max h-max", children: [
60425
- /* @__PURE__ */ jsx(
60426
- "img",
60427
- {
60428
- alt: n || `Product ${e}`,
60429
- className: `rounded-md ${d ? "cursor-pointer" : ""}`,
60430
- onClick: d ? E : void 0,
60431
- src: `https://api.randmar.io/Product/${e}/Image?width=${C * 1.5}&height=${C * 1.5}`,
60432
- width: C,
60433
- height: C
60434
- }
60435
- ),
60436
- d && /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip$1, { children: [
60437
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: !0, children: /* @__PURE__ */ jsx(
60438
- Button,
60439
- {
60440
- variant: "secondary",
60441
- size: "icon",
60442
- className: "absolute top-2 right-2",
60443
- onClick: E,
60444
- children: /* @__PURE__ */ jsx(Play, { className: "h-4 w-4" })
60445
- }
60446
- ) }),
60447
- /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Play video" }) })
60448
- ] }) })
60449
- ] })
60450
- ] });
60451
- }
60452
- function ProductCard({
60453
- item: e,
60454
- addToCart: t = !1,
60455
- syncToShopify: n = !1,
60456
- customAction: o = /* @__PURE__ */ jsx(Fragment, {}),
60457
- defaultOpportunityNumber: l = "",
60458
- viewProductLink: u,
60459
- addToCartAction: d,
60460
- isAddToCartActionLoading: f = !1,
60461
- syncToShopifyAction: p,
60462
- isSyncToShopifyActionLoading: m = !1
60463
- }) {
60464
- var Q, ee, ie, ce, ue, pe, he, ve, de, ye, fe;
60465
- const [g, b] = useState(1), [_, S] = useState(null), [T, E] = useState(0), [C, I] = useState(!1), N = ((Q = e == null ? void 0 : e.Distribution) == null ? void 0 : Q.Cost) || 0, O = ((ee = e == null ? void 0 : e.Distribution) == null ? void 0 : ee.RegularPrice) || 0, V = ((ie = e == null ? void 0 : e.Distribution) == null ? void 0 : ie.Price) || 0;
60466
- useEffect(() => {
60467
- b(1), S(null), E(0), I(!1);
60468
- }, [e == null ? void 0 : e.RandmarSKU]);
60469
- const [M, R] = useState(null), [D, L] = useState(!1);
60470
- useEffect(() => {
60471
- const le = async () => {
60472
- if (e != null && e.ManufacturerId) {
60473
- L(!0);
60474
- try {
60475
- const oe = await fetch(
60476
- `https://api.randmar.io/V4/Partner/${e.ManufacturerId}/Account/Logo?width=60&height=40`
60477
- );
60478
- if (oe.ok) {
60479
- const te = await oe.blob();
60480
- R(URL.createObjectURL(te));
60481
- }
60482
- } catch (oe) {
60483
- console.error("Failed to load logo:", oe);
60484
- } finally {
60485
- L(!1);
60486
- }
60487
- }
60488
- };
60489
- e != null && e.ManufacturerId && le();
60490
- }, [e == null ? void 0 : e.ManufacturerId]), useEffect(() => {
60491
- var le;
60492
- if (e && l) {
60493
- const oe = (le = e.Opportunities) == null ? void 0 : le.find((te) => te.BidNumber == l);
60494
- oe && S(oe);
60495
- }
60496
- }, [e, l]), useEffect(() => {
60497
- if (!e) return;
60498
- const le = _ != null && _.Price ? _.Price : V;
60499
- E(O > 0 ? Math.round((O - le) / O * 100) : 0);
60500
- }, [e, _, V, O]), useEffect(() => {
60501
- f || b(1);
60502
- }, [f]);
60503
- const j = (le) => {
60504
- if (le.Active !== !0) return !1;
60505
- const oe = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
60506
- return !(le.EndDate && le.EndDate.split("T")[0] < oe || le.StartDate && le.StartDate.split("T")[0] > oe);
60507
- };
60508
- if (!e)
60509
- return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "p-6", children: [
60510
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start mb-3", children: [
60511
- /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-3/4" }),
60512
- /* @__PURE__ */ jsx("div", { className: "h-10 w-24 flex items-center justify-end ml-4", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-24 rounded-md" }) })
60513
- ] }),
60514
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 mb-4", children: [
60515
- /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-20 rounded-full" }),
60516
- /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-24 rounded-full" }),
60517
- /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-28 rounded-full" })
60518
- ] }),
60519
- /* @__PURE__ */ jsxs("div", { className: "flex gap-6", children: [
60520
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-x-4 gap-y-6 flex-1", children: [
60521
- /* @__PURE__ */ jsxs("div", { children: [
60522
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-12 mb-1" }),
60523
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-20" })
60524
- ] }),
60525
- /* @__PURE__ */ jsxs("div", { children: [
60526
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-12 mb-1" }),
60527
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-24" })
60528
- ] }),
60529
- /* @__PURE__ */ jsxs("div", { children: [
60530
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20 mb-1" }),
60531
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-16" })
60532
- ] }),
60533
- /* @__PURE__ */ jsxs("div", { children: [
60534
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-12 mb-1" }),
60535
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-20" })
60536
- ] })
60537
- ] }),
60538
- /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx("div", { className: "w-60 h-40", children: /* @__PURE__ */ jsx(Skeleton, { className: "w-full h-full rounded-lg" }) }) })
60539
- ] }),
60540
- /* @__PURE__ */ jsxs("div", { className: "flex gap-6 mt-4", children: [
60541
- /* @__PURE__ */ jsx("div", { className: "flex flex-1", children: /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
60542
- /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24 mb-3" }),
60543
- /* @__PURE__ */ jsx(Skeleton, { className: "h-16 w-full rounded-md" })
60544
- ] }) }),
60545
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
60546
- /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-32 rounded-md" }),
60547
- /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-24 mt-4" })
60548
- ] })
60549
- ] }),
60550
- /* @__PURE__ */ jsxs("div", { className: "flex gap-6 mt-4", children: [
60551
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start gap-1 mb-2", children: [
60552
- /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-32" }),
60553
- /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-24" })
60554
- ] }),
60555
- /* @__PURE__ */ jsxs("div", { className: "flex flex-1 items-center gap-2", children: [
60556
- /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-24 rounded-md" }),
60557
- /* @__PURE__ */ jsx(Skeleton, { className: "h-10 flex-1 rounded-md" })
60558
- ] })
60559
- ] })
60560
- ] }) });
60561
- const q = (e == null ? void 0 : e.Opportunities) || [], F = q.length > 0, H = () => {
60562
- if (g == null) {
60563
- b(1);
60564
- return;
60565
- }
60566
- g > 1 && b(g - 1);
60567
- }, U = () => {
60568
- if (g == null) {
60569
- b(1);
60570
- return;
60571
- }
60572
- b(g + 1);
60573
- }, G = (le) => {
60574
- const oe = parseInt(le.target.value, 10);
60575
- if (!isNaN(oe) && oe > 0) {
60576
- b(oe);
60577
- return;
60578
- }
60579
- b(void 0);
60580
- }, J = () => {
60581
- (g == null || g < 1) && b(1);
60582
- }, Z = ((ue = (ce = e.Distribution) == null ? void 0 : ce.Inventory) == null ? void 0 : ue.reduce((le, oe) => le + (oe.AvailableQuantity || 0), 0)) || 0, ae = (le) => {
60583
- try {
60584
- return new Date(le).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
60585
- } catch (oe) {
60586
- return console.error(oe), le.split("T")[0] || "N/A";
60587
- }
60588
- }, W = () => {
60589
- d && d({ quantity: g ?? 1, bidNumber: (_ == null ? void 0 : _.BidNumber) ?? null });
60590
- };
60591
- return /* @__PURE__ */ jsx(Card, { className: "hover:shadow-lg transition-shadow", children: /* @__PURE__ */ jsxs(CardContent, { className: "p-6", children: [
60592
- /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start mb-3", children: [
60593
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-xl", children: e.Title || e.RandmarTitle }),
60594
- /* @__PURE__ */ jsx("div", { className: "h-10 w-24 flex items-center justify-end ml-4", children: D ? /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-24 rounded-md" }) : M && /* @__PURE__ */ jsx(
60595
- "img",
60596
- {
60597
- src: M,
60598
- alt: e.ManufacturerName ?? "",
60599
- className: "max-h-10 max-w-24 object-contain"
60600
- }
60601
- ) })
60602
- ] }),
60603
- /* @__PURE__ */ jsxs("div", { className: "flex gap-6", children: [
60604
- /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
60605
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 mb-4", children: [
60606
- e.State && /* @__PURE__ */ jsxs(
60607
- Badge,
60608
- {
60609
- variant: "outline",
60610
- className: `rounded-full px-3 ${e.State === "Active" ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-red-50 text-red-700 hover:bg-red-50"}`,
60611
- children: [
60612
- /* @__PURE__ */ jsx(Check, { size: "12", className: "mr-1.5" }),
60613
- " ",
60614
- e.State
60615
- ]
60616
- }
60617
- ),
60618
- /* @__PURE__ */ jsxs(
60619
- Badge,
60620
- {
60621
- variant: "outline",
60622
- className: `rounded-full px-3 ${e.SerialNumber ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,
60623
- children: [
60624
- /* @__PURE__ */ jsx(QrCode, { size: "12", className: "mr-1.5" }),
60625
- " ",
60626
- e.SerialNumber ? "Serialized" : "Unserialized"
60627
- ]
60628
- }
60629
- ),
60630
- e.TransparencyCode && /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50", children: [
60631
- /* @__PURE__ */ jsx(CircleDashed, { size: "12", className: "mr-1.5" }),
60632
- " Transparency Code"
60633
- ] }),
60634
- e.AvailableToBuy !== void 0 && /* @__PURE__ */ jsxs(
60635
- Badge,
60636
- {
60637
- variant: "outline",
60638
- className: `rounded-full px-3 ${e.AvailableToBuy ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-red-50 text-red-700 hover:bg-red-50"}`,
60639
- children: [
60640
- /* @__PURE__ */ jsx(ShoppingCart, { size: "12", className: "mr-1.5" }),
60641
- " ",
60642
- e.AvailableToBuy ? "Available" : "Unavailable"
60643
- ]
60644
- }
60645
- ),
60646
- e.ManufacturerCategory !== void 0 && /* @__PURE__ */ jsxs(
60647
- Badge,
60648
- {
60649
- variant: "outline",
60650
- className: `rounded-full px-3 ${(pe = e.ManufacturerCategory) != null && pe.QualificationRequired ? "bg-blue-50 text-blue-700 hover:bg-blue-50" : "bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,
60651
- children: [
60652
- /* @__PURE__ */ jsx(ShieldCheck, { size: "12", className: "mr-1.5" }),
60653
- " ",
60654
- (he = e.ManufacturerCategory) != null && he.QualificationRequired ? "Qualified Only" : "Available to all"
60655
- ]
60656
- }
60657
- ),
60658
- e.ManufacturerId && /* @__PURE__ */ jsxs(
60659
- Badge,
60660
- {
60661
- variant: "outline",
60662
- className: `rounded-full px-3 ${e.AutoUpdate ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-red-50 text-red-700 hover:bg-red-50"}`,
60663
- children: [
60664
- /* @__PURE__ */ jsx(RefreshCw, { size: "12", className: "mr-1.5" }),
60665
- " ",
60666
- e.AutoUpdate ? `Automatic Reorder (${e.MasterCarton})` : "Manually Reorders"
60667
- ]
60668
- }
60669
- ),
60670
- /* @__PURE__ */ jsxs(
60671
- Badge,
60672
- {
60673
- variant: "outline",
60674
- className: `rounded-full px-3 ${e.BodyHTML && e.Title && e.MAP ? "bg-green-50 text-green-700 hover:bg-green-50" : "bg-red-50 text-red-700 hover:bg-red-50"}`,
60675
- children: [
60676
- /* @__PURE__ */ jsx(Store, { size: "12", className: "mr-1.5" }),
60677
- " ",
60678
- e.BodyHTML && e.Title && e.MAP ? "Shopify Ready" : "Not Shopify Ready"
60679
- ]
60680
- }
60681
- )
60682
- ] }),
60683
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-x-4 gap-y-4 flex-1", children: [
60684
- /* @__PURE__ */ jsxs("div", { children: [
60685
- /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "MPN" }),
60686
- /* @__PURE__ */ jsx("div", { className: "font-medium", children: e.MPN || "N/A" })
60687
- ] }),
60688
- /* @__PURE__ */ jsxs("div", { children: [
60689
- /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "UPC" }),
60690
- /* @__PURE__ */ jsx("div", { className: "font-medium", children: e.UPC || "N/A" })
60691
- ] }),
60692
- /* @__PURE__ */ jsxs("div", { children: [
60693
- /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Unit Weight" }),
60694
- /* @__PURE__ */ jsx("div", { className: "font-medium", children: e.UnitWeight ? `${e.UnitWeight} lbs` : "N/A" })
60695
- ] }),
60696
- /* @__PURE__ */ jsxs("div", { children: [
60697
- /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "MAP" }),
60698
- /* @__PURE__ */ jsx("div", { className: "font-medium", children: e.MAP ? "$" + e.MAP.toFixed(2) : "N/A" })
60699
- ] }),
60700
- e.CountryCodeOfOrigin && /* @__PURE__ */ jsxs("div", { children: [
60701
- /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Origin" }),
60702
- /* @__PURE__ */ jsxs("div", { className: "font-medium flex items-center", children: [
60703
- /* @__PURE__ */ jsx(
60704
- CountryFlag,
60705
- {
60706
- countryCode: e.CountryCodeOfOrigin,
60707
- className: "mr-2"
60708
- }
60709
- ),
60710
- e.CountryCodeOfOrigin
60711
- ] })
60712
- ] })
60713
- ] })
60714
- ] }),
60715
- /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx(ProductImage, { randmarSKU: e.RandmarSKU || "", alt: e.RandmarTitle || "" }) })
60716
- ] }),
60717
- /* @__PURE__ */ jsxs("div", { className: "flex gap-6 mt-4", children: [
60718
- /* @__PURE__ */ jsx("div", { className: "flex flex-1", children: F && e.Distribution && /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
60719
- /* @__PURE__ */ jsx("div", { className: "flex items-center", children: "You have " + q.length + (q.length > 1 ? " opportunities" : " opportunity") + " for this product:" }),
60720
- /* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1", children: q.map((le, oe) => {
60721
- var te;
60722
- return /* @__PURE__ */ jsxs(
60723
- "div",
60724
- {
60725
- className: `flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
60726
- ${le.BidNumber == (_ == null ? void 0 : _.BidNumber) ? "cursor-pointer border-2 border-purple-900" : j(le) ? "hover:bg-purple-200 cursor-pointer" : "!bg-neutral-50"}
60727
- `,
60728
- onClick: () => {
60729
- j(le) && S(
60730
- le.BidNumber != (_ == null ? void 0 : _.BidNumber) ? le : null
60731
- );
60732
- },
60733
- children: [
60734
- /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
60735
- /* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: le.Opportunity }),
60736
- /* @__PURE__ */ jsxs("span", { className: "text-xs text-neutral-900", children: [
60737
- le.BidNumber,
60738
- " ",
60739
- !j(le) && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-xs mx-1 h-5 bg-gray-100", children: "Currently unavailable" })
60740
- ] })
60741
- ] }) }),
60742
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end", children: [
60743
- /* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
60744
- "$",
60745
- (te = le.Price) == null ? void 0 : te.toFixed(2)
60746
- ] }),
60747
- le.Rebate && le.Rebate > 0 && /* @__PURE__ */ jsxs("span", { className: "text-xs text-green-600", children: [
60748
- "Rebate: $",
60749
- le.Rebate.toFixed(2)
60750
- ] }),
60751
- le.EndDate && /* @__PURE__ */ jsxs("span", { className: "text-xs text-neutral-600", children: [
60752
- "Ends: ",
60753
- ae(le.EndDate)
60754
- ] })
60755
- ] })
60756
- ]
60757
- },
60758
- oe
60759
- );
60760
- }) })
60761
- ] }) }),
60762
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
60763
- u && /* @__PURE__ */ jsx(Link, { to: u, children: /* @__PURE__ */ jsxs(Button, { variant: "secondary", children: [
60764
- /* @__PURE__ */ jsx(Eye, { className: "mr-2" }),
60765
- "View Product"
60766
- ] }) }),
60767
- ((ve = e.Distribution) == null ? void 0 : ve.Inventory) && /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsxs(Dialog, { open: C, onOpenChange: I, children: [
60768
- /* @__PURE__ */ jsx(DialogTrigger, { asChild: !0, children: /* @__PURE__ */ jsxs(
60769
- Button,
60770
- {
60771
- variant: "ghost",
60772
- className: `flex items-center text-sm ${Z > 0 ? "text-green-700" : "text-red-700"}`,
60773
- children: [
60774
- /* @__PURE__ */ jsx(Warehouse, { size: "16", className: "mr-2" }),
60775
- Z > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
60776
- Z,
60777
- " in stock"
60778
- ] }) : /* @__PURE__ */ jsx(Fragment, { children: "Out of stock" })
60779
- ]
60780
- }
60781
- ) }),
60782
- /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-4xl", children: [
60783
- /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(DialogTitle, { className: "flex items-center", children: [
60784
- /* @__PURE__ */ jsx(Warehouse, { className: "mr-2", size: 18 }),
60785
- "Inventory Information"
60786
- ] }) }),
60787
- /* @__PURE__ */ jsx(ProductInventoryGrid, { inventory: e.Distribution.Inventory })
60788
- ] })
60789
- ] }) })
60790
- ] })
60791
- ] }),
60792
- e.Distribution && /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-end mt-4", children: [
60793
- /* @__PURE__ */ jsx("div", { className: "flex-shrink-1 flex flex-col items-start gap-1", children: N > 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxs("span", { className: "text-2xl font-bold whitespace-nowrap", children: [
60794
- /* @__PURE__ */ jsx("span", { children: "Cost: $" }),
60795
- N.toFixed(2),
60796
- /* @__PURE__ */ jsx("span", { children: " CAD" })
60797
- ] }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
60798
- /* @__PURE__ */ jsxs("div", { className: "flex items-center flex-wrap", children: [
60799
- /* @__PURE__ */ jsxs("span", { className: "text-2xl font-bold whitespace-nowrap", children: [
60800
- /* @__PURE__ */ jsx("span", { children: "$" }),
60801
- _ ? (ye = (de = e.Opportunities) == null ? void 0 : de.find((le) => le.BidNumber == _.BidNumber)) == null ? void 0 : ye.Price : V.toFixed(2),
60802
- /* @__PURE__ */ jsx("span", { children: " CAD" })
60803
- ] }),
60804
- T > 0 && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground line-through ml-2 whitespace-nowrap", children: [
60805
- "$",
60806
- O.toFixed(2)
60807
- ] })
60808
- ] }),
60809
- T > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap", children: [
60810
- /* @__PURE__ */ jsxs("span", { children: [
60811
- T,
60812
- "% OFF"
60813
- ] }),
60814
- ((fe = e.InstantRebate) == null ? void 0 : fe.EndDate) && /* @__PURE__ */ jsxs(Fragment, { children: [
60815
- /* @__PURE__ */ jsx("span", { className: "mx-1.5", children: "●" }),
60816
- " Ends ",
60817
- e.InstantRebate.EndDate.split("T")[0]
60818
- ] }),
60819
- (_ == null ? void 0 : _.EndDate) && /* @__PURE__ */ jsxs(Fragment, { children: [
60820
- /* @__PURE__ */ jsx("span", { className: "mx-1.5", children: "●" }),
60821
- " Ends ",
60822
- _.EndDate.split("T")[0]
60823
- ] })
60824
- ] }) })
60825
- ] }) }),
60826
- /* @__PURE__ */ jsxs("div", { className: "flex flex-shrink-0 gap-2 ml-4", children: [
60827
- typeof t < "u" && t && /* @__PURE__ */ jsxs("div", { className: "flex items-center border rounded-md", children: [
60828
- /* @__PURE__ */ jsx(
60829
- Button,
60830
- {
60831
- variant: "ghost",
60832
- size: "icon",
60833
- className: "rounded-r-none",
60834
- onClick: H,
60835
- disabled: typeof g < "u" && (g <= 1 || !e.AvailableToBuy || f || !d),
60836
- children: "-"
60837
- }
60838
- ),
60839
- /* @__PURE__ */ jsx(
60840
- "input",
60841
- {
60842
- value: g,
60843
- onChange: G,
60844
- onBlur: J,
60845
- onClick: (le) => le.currentTarget.select(),
60846
- className: `w-12 text-center border-0 focus:ring-0 focus:outline-none ${!e.AvailableToBuy || f || !d ? "text-gray-400" : ""}`,
60847
- disabled: !e.AvailableToBuy || f || !d
60848
- }
60849
- ),
60850
- /* @__PURE__ */ jsx(
60851
- Button,
60852
- {
60853
- variant: "ghost",
60854
- size: "icon",
60855
- className: "rounded-l-none",
60856
- onClick: U,
60857
- disabled: !e.AvailableToBuy || f || !d,
60858
- children: "+"
60859
- }
60860
- )
60861
- ] }),
60862
- typeof t < "u" && t && /* @__PURE__ */ jsx(
60863
- Button,
60864
- {
60865
- className: "gap-2 whitespace-nowrap",
60866
- onClick: W,
60867
- disabled: !e.AvailableToBuy || f || !d,
60868
- children: f ? /* @__PURE__ */ jsxs(Fragment, { children: [
60869
- /* @__PURE__ */ jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }),
60870
- "Adding..."
60871
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
60872
- /* @__PURE__ */ jsx(ShoppingCart, { className: "mr-2" }),
60873
- "Add to Cart"
60874
- ] })
60875
- }
60876
- ),
60877
- n && /* @__PURE__ */ jsx(
60878
- Button,
60879
- {
60880
- className: "gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",
60881
- onClick: p,
60882
- disabled: m || !p,
60883
- children: m ? /* @__PURE__ */ jsxs(Fragment, { children: [
60884
- /* @__PURE__ */ jsx(LoaderCircle, { className: "h-4 w-4 animate-spin" }),
60885
- "Syncing..."
60886
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
60887
- /* @__PURE__ */ jsx(ShoppingCart, { className: "mr-2" }),
60888
- "Sync to Shopify"
60889
- ] })
60890
- }
60891
- ),
60892
- o
60893
- ] })
60894
- ] })
60895
- ] }) });
60896
- }
60897
60940
  function ResellerBillingOverviewCard({ reseller: e, actions: t, loading: n = !1 }) {
60898
60941
  return n || !e ? /* @__PURE__ */ jsx(ResellerBillingOverviewSkeleton, {}) : /* @__PURE__ */ jsx(ResellerBillingOverviewData, { reseller: e, actions: t });
60899
60942
  }