@tight-embedded/react 1.0.0-alpha.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.
- package/README.md +11 -0
- package/dist/duplet.css +60 -0
- package/dist/duplet.css.gz +0 -0
- package/dist/fonts/Duplet-Bold.woff +0 -0
- package/dist/fonts/Duplet-Bold.woff.gz +0 -0
- package/dist/fonts/Duplet-Bold.woff2 +0 -0
- package/dist/fonts/Duplet-BoldItalic.woff +0 -0
- package/dist/fonts/Duplet-BoldItalic.woff.gz +0 -0
- package/dist/fonts/Duplet-BoldItalic.woff2 +0 -0
- package/dist/fonts/Duplet-BoldItalic.woff2.gz +0 -0
- package/dist/fonts/Duplet-Italic.woff +0 -0
- package/dist/fonts/Duplet-Italic.woff.gz +0 -0
- package/dist/fonts/Duplet-Italic.woff2 +0 -0
- package/dist/fonts/Duplet-Regular.woff +0 -0
- package/dist/fonts/Duplet-Regular.woff.gz +0 -0
- package/dist/fonts/Duplet-Regular.woff2 +0 -0
- package/dist/fonts/Duplet-Semibold.woff +0 -0
- package/dist/fonts/Duplet-Semibold.woff.gz +0 -0
- package/dist/fonts/Duplet-Semibold.woff2 +0 -0
- package/dist/fonts/Duplet-SemiboldItalic.woff +0 -0
- package/dist/fonts/Duplet-SemiboldItalic.woff.gz +0 -0
- package/dist/fonts/Duplet-SemiboldItalic.woff2 +0 -0
- package/dist/fonts/Inter-Bold.ttf +0 -0
- package/dist/fonts/Inter-Bold.ttf.gz +0 -0
- package/dist/fonts/Inter-ExtraLight.ttf +0 -0
- package/dist/fonts/Inter-ExtraLight.ttf.gz +0 -0
- package/dist/fonts/Inter-Light.ttf +0 -0
- package/dist/fonts/Inter-Light.ttf.gz +0 -0
- package/dist/fonts/Inter-Medium.ttf +0 -0
- package/dist/fonts/Inter-Medium.ttf.gz +0 -0
- package/dist/fonts/Inter-Regular.ttf +0 -0
- package/dist/fonts/Inter-Regular.ttf.gz +0 -0
- package/dist/fonts/Inter-SemiBold.ttf +0 -0
- package/dist/fonts/Inter-SemiBold.ttf.gz +0 -0
- package/dist/index.css +2974 -0
- package/dist/index.css.gz +0 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +3285 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -0
- package/dist/index.js.map.gz +0 -0
- package/dist/inter.css +36 -0
- package/dist/inter.css.gz +0 -0
- package/package.json +110 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,3285 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { create as e } from "zustand";
|
|
5
|
+
import { devtools as t } from "zustand/middleware";
|
|
6
|
+
import { cloneDeep as r, entries as n, mapValues as o, isEqual as a, isEmpty as i } from "lodash-es";
|
|
7
|
+
import * as l from "zod";
|
|
8
|
+
import { z as s } from "zod";
|
|
9
|
+
import * as c from "react";
|
|
10
|
+
import { useRef as d, useMemo as u, createContext as h, useContext as g, Component as p, useState as v, useCallback as m, useEffect as b, createElement as f, forwardRef as y, useReducer as T, useLayoutEffect as x } from "react";
|
|
11
|
+
import { jsx as w, Fragment as k, jsxs as C } from "react/jsx-runtime";
|
|
12
|
+
import { QueryClient as S, useIsRestoring as E, useQuery as I, keepPreviousData as P, useMutation as A } from "@tanstack/react-query";
|
|
13
|
+
import D from "yocto-queue";
|
|
14
|
+
import M from "big.js";
|
|
15
|
+
import { ResponsiveContainer as N, BarChart as R, Legend as O, CartesianGrid as L, XAxis as F, YAxis as _, Tooltip as W, Bar as B, ReferenceLine as H, Line as z } from "recharts";
|
|
16
|
+
import { flexRender as V, createColumnHelper as j, useReactTable as q, getCoreRowModel as $, getExpandedRowModel as U } from "@tanstack/react-table";
|
|
17
|
+
import { useFloatingNodeId as K, useFloating as Y, offset as G, flip as Q, shift as X, size as Z, autoUpdate as J, useClick as ee, useDismiss as te, useRole as re, useInteractions as ne, useFloatingParentNodeId as oe, FloatingTree as ae, FloatingNode as ie, useMergeRefs as le, FloatingOverlay as se, FloatingPortal as ce, FloatingFocusManager as de } from "@floating-ui/react";
|
|
18
|
+
import { usePlaidLink as ue } from "react-plaid-link";
|
|
19
|
+
import { ContextAwareConfirmation as he, confirmable as ge } from "react-confirm";
|
|
20
|
+
import pe from "fuse.js";
|
|
21
|
+
import { openDB as ve } from "idb";
|
|
22
|
+
import { PersistQueryClientProvider as me } from "@tanstack/react-query-persist-client";
|
|
23
|
+
import { createFormHookContexts as be, useStore as fe, createFormHook as ye } from "@tanstack/react-form";
|
|
24
|
+
import { NumericFormat as Te } from "react-number-format";
|
|
25
|
+
function xe(e2, t2) {
|
|
26
|
+
return `${e2.trim()}:${t2.trim()}`;
|
|
27
|
+
}
|
|
28
|
+
const we = (e2) => ({ hasBulkSelect: false, updateFlags: (t2) => e2((e3) => ({ ...e3, ...t2 }), void 0, xe("featureFlags", "updateFlags")) }), ke = "drawerNavigation", Ce = (e2) => ({ drawerHistory: [], openDrawer: (t2, n2 = {}) => e2((e3) => {
|
|
29
|
+
const { replaceHistory: o2, routeProps: a2 } = n2, i2 = { [t2]: { routeProps: a2 } };
|
|
30
|
+
if (o2 || 0 === e3.drawerHistory.length) return { drawerHistory: [i2] };
|
|
31
|
+
{
|
|
32
|
+
const t3 = r(e3.drawerHistory);
|
|
33
|
+
return t3.push(i2), { drawerHistory: t3 };
|
|
34
|
+
}
|
|
35
|
+
}, void 0, xe(ke, "openDrawer")), closeDrawer: () => e2((e3) => {
|
|
36
|
+
const t2 = e3.drawerHistory;
|
|
37
|
+
return { drawerHistory: t2.slice(0, t2.length - 1) };
|
|
38
|
+
}, void 0, xe(ke, "closeDrawer")), closeAllDrawers: () => e2(() => ({ drawerHistory: [] }), void 0, xe(ke, "closeAllDrawers")) }), Se = (e2) => ({ externalOptions: {}, setOptions: (t2, r2 = false) => e2((e3) => r2 ? { externalOptions: { ...t2 } } : { externalOptions: { ...e3.externalOptions, ...t2 } }, void 0, xe("externalOptions", "setOptions")) });
|
|
39
|
+
function Ee(e2, t2) {
|
|
40
|
+
if (t2 > -1 && t2 <= e2.length - 1) {
|
|
41
|
+
return [...e2.slice(0, t2), ...e2.slice(t2 + 1)];
|
|
42
|
+
}
|
|
43
|
+
return [...e2];
|
|
44
|
+
}
|
|
45
|
+
function Ie(e2) {
|
|
46
|
+
return e2[e2.length - 1];
|
|
47
|
+
}
|
|
48
|
+
const Pe = "transactionsDashFilters", Ae = (e2) => ({ transactionsDashFilters: [], addTransactionsDashFilters: (t2) => e2((e3) => ({ ...e3, transactionsDashFilters: [...e3.transactionsDashFilters, ...t2] }), void 0, xe(Pe, "addFilter")), removeTransactionsDashFilter: (t2) => e2((e3) => ({ ...e3, transactionsDashFilters: Ee(e3.transactionsDashFilters, t2) }), void 0, xe(Pe, "removeFilter")), setTransactionsDashFilters: (t2) => e2((e3) => ({ ...e3, transactionsDashFilters: t2 }), void 0, xe(Pe, "setFilters")) });
|
|
49
|
+
const De = e()(t((...e2) => ({ ...we(...e2), ...Ce(...e2), ...Se(...e2), ...Ae(...e2) }), { name: "globalStore", enabled: false, store: "globalStore" })), Me = { SELECT: "select", EXPAND: "expand", DATE: "date", DESCRIPTION: "description", AMOUNT: "amount", CATEGORY: "category", CLASS_SEGMENT: "classSegment", REVIEW_STATUS: "reviewStatus", COMMENTS: "comments" }, Ne = [Me.DATE, Me.DESCRIPTION, Me.AMOUNT, Me.CATEGORY, Me.REVIEW_STATUS, Me.CLASS_SEGMENT, Me.COMMENTS], Re = l.object({ pageSize: l.optional(l.int32().positive()), columns: l.optional(l.array(l.enum(Ne))) }), Oe = l.optional(l.string().trim()), Le = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/, Fe = l.optional(l.array(l.string().trim())), _e = { transactionsDashboard: (e2) => {
|
|
50
|
+
const t2 = Re.safeParse(e2);
|
|
51
|
+
return t2.success ? t2.data : void 0;
|
|
52
|
+
}, accessToken: (e2) => {
|
|
53
|
+
const t2 = Oe.safeParse(e2);
|
|
54
|
+
return t2.success ? t2.data : void 0;
|
|
55
|
+
}, dataVisualizationColors: (e2) => {
|
|
56
|
+
const t2 = Fe.safeParse(e2);
|
|
57
|
+
if (!t2.success || void 0 === t2.data) return;
|
|
58
|
+
const r2 = t2.data.filter((e3) => Le.test(e3));
|
|
59
|
+
return r2.length > 0 ? r2 : void 0;
|
|
60
|
+
} };
|
|
61
|
+
const We = (e2, t2) => {
|
|
62
|
+
if (void 0 === _e[e2]) return;
|
|
63
|
+
return (0, _e[e2])(t2);
|
|
64
|
+
};
|
|
65
|
+
function Be(e2) {
|
|
66
|
+
const t2 = d(false), o2 = De((e3) => e3.setOptions);
|
|
67
|
+
if (e2 && !t2.current) {
|
|
68
|
+
const r2 = function(e3) {
|
|
69
|
+
let t3 = {};
|
|
70
|
+
for (const [r3, o3] of n(e3)) {
|
|
71
|
+
const e4 = We(r3, o3);
|
|
72
|
+
void 0 !== e4 && (t3 = { ...t3, [r3]: e4 });
|
|
73
|
+
}
|
|
74
|
+
return t3;
|
|
75
|
+
}(e2);
|
|
76
|
+
o2(r2), t2.current = true;
|
|
77
|
+
}
|
|
78
|
+
const a2 = De((e3) => e3.externalOptions);
|
|
79
|
+
return { options: u(() => r(a2), [a2]), setOptions: o2 };
|
|
80
|
+
}
|
|
81
|
+
function He(e2) {
|
|
82
|
+
return "object" == typeof e2 && null != e2 && !Array.isArray(e2);
|
|
83
|
+
}
|
|
84
|
+
var ze = (e2) => "object" == typeof e2 && null !== e2;
|
|
85
|
+
function Ve(e2) {
|
|
86
|
+
return Object.fromEntries(Object.entries(e2 ?? {}).filter(([e3, t2]) => void 0 !== t2));
|
|
87
|
+
}
|
|
88
|
+
var je = (e2) => "base" === e2;
|
|
89
|
+
function qe(e2) {
|
|
90
|
+
return String.fromCharCode(e2 + (e2 > 25 ? 39 : 97));
|
|
91
|
+
}
|
|
92
|
+
function $e(e2) {
|
|
93
|
+
return function(e3) {
|
|
94
|
+
let t2, r2 = "";
|
|
95
|
+
for (t2 = Math.abs(e3); t2 > 52; t2 = t2 / 52 | 0) r2 = qe(t2 % 52) + r2;
|
|
96
|
+
return qe(t2 % 52) + r2;
|
|
97
|
+
}(function(e3, t2) {
|
|
98
|
+
let r2 = t2.length;
|
|
99
|
+
for (; r2; ) e3 = 33 * e3 ^ t2.charCodeAt(--r2);
|
|
100
|
+
return e3;
|
|
101
|
+
}(5381, e2) >>> 0);
|
|
102
|
+
}
|
|
103
|
+
var Ue = /\s*!(important)?/i;
|
|
104
|
+
function Ke(e2) {
|
|
105
|
+
return "string" == typeof e2 ? e2.replaceAll(" ", "_") : e2;
|
|
106
|
+
}
|
|
107
|
+
var Ye = (e2) => {
|
|
108
|
+
const t2 = /* @__PURE__ */ new Map();
|
|
109
|
+
return (...r2) => {
|
|
110
|
+
const n2 = JSON.stringify(r2);
|
|
111
|
+
if (t2.has(n2)) return t2.get(n2);
|
|
112
|
+
const o2 = e2(...r2);
|
|
113
|
+
return t2.set(n2, o2), o2;
|
|
114
|
+
};
|
|
115
|
+
}, Ge = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
116
|
+
function Qe(...e2) {
|
|
117
|
+
return e2.reduce((e3, t2) => t2 ? (Object.keys(t2).forEach((r2) => {
|
|
118
|
+
if (Ge.has(r2)) return;
|
|
119
|
+
const n2 = e3[r2], o2 = t2[r2];
|
|
120
|
+
He(n2) && He(o2) ? e3[r2] = Qe(n2, o2) : e3[r2] = o2;
|
|
121
|
+
}), e3) : e3, {});
|
|
122
|
+
}
|
|
123
|
+
var Xe = (e2) => null != e2;
|
|
124
|
+
function Ze(e2, t2, r2 = {}) {
|
|
125
|
+
const { stop: n2, getKey: o2 } = r2;
|
|
126
|
+
return function e3(r3, a2 = []) {
|
|
127
|
+
if (ze(r3)) {
|
|
128
|
+
const i2 = {};
|
|
129
|
+
for (const [l2, s2] of Object.entries(r3)) {
|
|
130
|
+
const c2 = (o2 == null ? void 0 : o2(l2, s2)) ?? l2, d2 = [...a2, c2];
|
|
131
|
+
if (n2 == null ? void 0 : n2(r3, d2)) return t2(r3, a2);
|
|
132
|
+
const u2 = e3(s2, d2);
|
|
133
|
+
Xe(u2) && (i2[c2] = u2);
|
|
134
|
+
}
|
|
135
|
+
return i2;
|
|
136
|
+
}
|
|
137
|
+
return t2(r3, a2);
|
|
138
|
+
}(e2);
|
|
139
|
+
}
|
|
140
|
+
function Je(e2, t2, r2 = true) {
|
|
141
|
+
const { utility: n2, conditions: o2 } = t2, { hasShorthand: a2, resolveShorthand: i2 } = n2;
|
|
142
|
+
return Ze(e2, (e3) => {
|
|
143
|
+
return Array.isArray(e3) ? (t3 = e3, r3 = o2.breakpoints.keys, t3.reduce((e4, t4, n3) => {
|
|
144
|
+
const o3 = r3[n3];
|
|
145
|
+
return null != t4 && (e4[o3] = t4), e4;
|
|
146
|
+
}, {})) : e3;
|
|
147
|
+
var t3, r3;
|
|
148
|
+
}, { stop: (e3) => Array.isArray(e3), getKey: r2 ? (e3) => a2 ? i2(e3) : e3 : void 0 });
|
|
149
|
+
}
|
|
150
|
+
var et = { shift: (e2) => e2, finalize: (e2) => e2, breakpoints: { keys: [] } };
|
|
151
|
+
var tt = /([A-Z])/g, rt = /^ms-/, nt = Ye((e2) => e2.startsWith("--") ? e2 : e2.replace(tt, "-$1").replace(rt, "-ms-").toLowerCase());
|
|
152
|
+
"cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%".split(",").join("|");
|
|
153
|
+
const ot = new Set("_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_complete,_incomplete,_dragging,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_grabbed,_underValue,_overValue,_atValue,_default,_optional,_open,_closed,_fullscreen,_loading,_hidden,_current,_currentPage,_currentStep,_today,_unavailable,_rangeStart,_rangeEnd,_now,_topmost,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_icon,_starting,_noscript,_invertedColors,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,1.5xl,1.5xlOnly,1.5xlDown,2xl,2xlOnly,2xlDown,smToMd,smToLg,smToXl,smTo1.5xl,smTo2xl,mdToLg,mdToXl,mdTo1.5xl,mdTo2xl,lgToXl,lgTo1.5xl,lgTo2xl,xlTo1.5xl,xlTo2xl,1.5xlTo2xl,base".split(",")), at = /^@|&|&$/;
|
|
154
|
+
function it(e2) {
|
|
155
|
+
return ot.has(e2) || at.test(e2);
|
|
156
|
+
}
|
|
157
|
+
const lt = /^_/, st = /&|@/;
|
|
158
|
+
const ct = /* @__PURE__ */ new Map();
|
|
159
|
+
"aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos,top:top,left:left,inset:inset,insetInline:inset-x,insetBlock:inset-y,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e,insetInlineStart:inset-s,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p,paddingLeft:pl,paddingRight:pr,paddingTop:pt,paddingBottom:pb,paddingBlock:py,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px,paddingInlineEnd:pe,paddingInlineStart:ps,marginLeft:ml,marginRight:mr,marginTop:mt,marginBottom:mb,margin:m,marginBlock:my,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx,marginInlineEnd:me,marginInlineStart:ms,spaceX:sx,spaceY:sy,outlineWidth:ring-w,outlineColor:ring-c,outline:ring,outlineOffset:ring-o,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w,inlineSize:w-is,minWidth:min-w,minInlineSize:min-w-is,maxWidth:max-w,maxInlineSize:max-w-is,height:h,blockSize:h-bs,minHeight:min-h,minBlockSize:min-h-bs,maxHeight:max-h,maxBlockSize:max-b,boxSize:size,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p,backgroundPositionX:bg-p-x,backgroundPositionY:bg-p-y,backgroundAttachment:bg-a,backgroundClip:bg-cp,background:bg,backgroundColor:bg-c,backgroundOrigin:bg-o,backgroundImage:bg-i,backgroundRepeat:bg-r,backgroundBlendMode:bg-bm,backgroundSize:bg-s,backgroundGradient:bg-grad,backgroundLinear:bg-linear,backgroundRadial:bg-radial,backgroundConic:bg-conic,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr,borderTopLeftRadius:bdr-tl,borderTopRightRadius:bdr-tr,borderBottomRightRadius:bdr-br,borderBottomLeftRadius:bdr-bl,borderTopRadius:bdr-t,borderRightRadius:bdr-r,borderBottomRadius:bdr-b,borderLeftRadius:bdr-l,borderStartStartRadius:bdr-ss,borderStartEndRadius:bdr-se,borderStartRadius:bdr-s,borderEndStartRadius:bdr-es,borderEndEndRadius:bdr-ee,borderEndRadius:bdr-e,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderBlockStartWidth:bd-bs-w,borderBlockEndWidth:bd-be-w,borderColor:bd-c,borderInline:bd-x,borderInlineWidth:bd-x-w,borderInlineColor:bd-x-c,borderBlock:bd-y,borderBlockWidth:bd-y-w,borderBlockColor:bd-y-c,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s,borderInlineStartWidth:bd-s-w,borderInlineStartColor:bd-s-c,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e,borderInlineEndWidth:bd-e-w,borderInlineEndColor:bd-e-c,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh,boxShadowColor:bx-sh-c,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x,translateY:translate-y,translateZ:translate-z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,cursor:cursor".split(",").forEach((e2) => {
|
|
160
|
+
const [t2, r2] = e2.split(":");
|
|
161
|
+
ct.set(t2, r2);
|
|
162
|
+
});
|
|
163
|
+
const dt = { conditions: { shift: function(e2) {
|
|
164
|
+
return e2.sort((e3, t2) => {
|
|
165
|
+
const r2 = it(e3), n2 = it(t2);
|
|
166
|
+
return r2 && !n2 ? 1 : !r2 && n2 ? -1 : 0;
|
|
167
|
+
});
|
|
168
|
+
}, finalize: function(e2) {
|
|
169
|
+
return e2.map((e3) => ot.has(e3) ? e3.replace(lt, "") : st.test(e3) ? `[${Ke(e3.trim())}]` : e3);
|
|
170
|
+
}, breakpoints: { keys: ["base", "sm", "md", "lg", "xl", "1.5xl", "2xl"] } }, utility: { prefix: "tsystem", transform: (e2, t2) => ({ className: `${ct.get(e2) || nt(e2)}_${Ke(t2)}` }), toHash: (e2, t2) => t2(e2.join(":")), resolveShorthand: (e2) => e2 } }, ut = function(e2) {
|
|
171
|
+
const { utility: t2, hash: r2, conditions: n2 = et } = e2, o2 = (e3) => [t2.prefix, e3].filter(Boolean).join("-");
|
|
172
|
+
return Ye(({ base: a2, ...i2 } = {}) => {
|
|
173
|
+
const l2 = Je(Object.assign(i2, a2), e2), s2 = /* @__PURE__ */ new Set();
|
|
174
|
+
return Ze(l2, (e3, a3) => {
|
|
175
|
+
if (null == e3) return;
|
|
176
|
+
const i3 = function(e4) {
|
|
177
|
+
return "string" == typeof e4 && Ue.test(e4);
|
|
178
|
+
}(e3), [l3, ...c2] = n2.shift(a3), d2 = c2.slice().filter((e4) => !je(e4));
|
|
179
|
+
const u2 = t2.transform(l3, function(e4) {
|
|
180
|
+
return "string" == typeof e4 ? e4.replace(Ue, "").trim() : e4;
|
|
181
|
+
}(((e4) => "string" == typeof e4 ? e4.replaceAll(/[\n\s]+/g, " ") : e4)(e3)));
|
|
182
|
+
let h2 = ((e4, a4) => {
|
|
183
|
+
let i4;
|
|
184
|
+
if (r2) {
|
|
185
|
+
const r3 = [...n2.finalize(e4), a4];
|
|
186
|
+
i4 = o2(t2.toHash(r3, $e));
|
|
187
|
+
} else i4 = [...n2.finalize(e4), o2(a4)].join(":");
|
|
188
|
+
return i4;
|
|
189
|
+
})(d2, u2.className);
|
|
190
|
+
i3 && (h2 = `${h2}!`), s2.add(h2);
|
|
191
|
+
}), Array.from(s2).join(" ");
|
|
192
|
+
});
|
|
193
|
+
}(dt), ht = (...e2) => ut(gt(...e2));
|
|
194
|
+
ht.raw = (...e2) => gt(...e2);
|
|
195
|
+
const { mergeCss: gt } = function(e2) {
|
|
196
|
+
function t2(t3) {
|
|
197
|
+
const r2 = function(...e3) {
|
|
198
|
+
return e3.flat().filter((e4) => He(e4) && Object.keys(Ve(e4)).length > 0);
|
|
199
|
+
}(...t3);
|
|
200
|
+
return 1 === r2.length ? r2 : r2.map((t4) => Je(t4, e2));
|
|
201
|
+
}
|
|
202
|
+
return { mergeCss: Ye(function(...e3) {
|
|
203
|
+
return Qe(...t2(e3));
|
|
204
|
+
}), assignCss: function(...e3) {
|
|
205
|
+
return Object.assign({}, ...t2(e3));
|
|
206
|
+
} };
|
|
207
|
+
}(dt);
|
|
208
|
+
function pt() {
|
|
209
|
+
let e2, t2 = "", r2 = 0;
|
|
210
|
+
for (; r2 < arguments.length; ) (e2 = arguments[r2++]) && "string" == typeof e2 && (t2 && (t2 += " "), t2 += e2);
|
|
211
|
+
return t2;
|
|
212
|
+
}
|
|
213
|
+
const vt = (e2) => ({ base: {}, variants: {}, defaultVariants: {}, compoundVariants: [], ...e2 });
|
|
214
|
+
function mt(e2) {
|
|
215
|
+
const { base: t2, variants: r2, defaultVariants: n2, compoundVariants: o2 } = vt(e2), a2 = (e3) => ({ ...n2, ...Ve(e3) });
|
|
216
|
+
function i2(e3 = {}) {
|
|
217
|
+
var _a2;
|
|
218
|
+
const n3 = a2(e3);
|
|
219
|
+
let i3 = { ...t2 };
|
|
220
|
+
for (const [e4, t3] of Object.entries(n3)) ((_a2 = r2[e4]) == null ? void 0 : _a2[t3]) && (i3 = gt(i3, r2[e4][t3]));
|
|
221
|
+
const l3 = function(e4, t3) {
|
|
222
|
+
let r3 = {};
|
|
223
|
+
return e4.forEach((e5) => {
|
|
224
|
+
Object.entries(e5).every(([e6, r4]) => {
|
|
225
|
+
if ("css" === e6) return true;
|
|
226
|
+
return (Array.isArray(r4) ? r4 : [r4]).some((r5) => t3[e6] === r5);
|
|
227
|
+
}) && (r3 = gt(r3, e5.css));
|
|
228
|
+
}), r3;
|
|
229
|
+
}(o2, n3);
|
|
230
|
+
return gt(i3, l3);
|
|
231
|
+
}
|
|
232
|
+
const l2 = Object.keys(r2);
|
|
233
|
+
const s2 = Object.fromEntries(Object.entries(r2).map(([e3, t3]) => [e3, Object.keys(t3)]));
|
|
234
|
+
return Object.assign(Ye(function(e3) {
|
|
235
|
+
return ht(i2(e3));
|
|
236
|
+
}), { __cva__: true, variantMap: s2, variantKeys: l2, raw: i2, config: e2, merge: function(e3) {
|
|
237
|
+
const a3 = vt(e3.config), i3 = ((...e4) => {
|
|
238
|
+
const t3 = e4.reduce((e5, t4) => (t4 && t4.forEach((t5) => e5.add(t5)), e5), /* @__PURE__ */ new Set([]));
|
|
239
|
+
return Array.from(t3);
|
|
240
|
+
})(e3.variantKeys, Object.keys(r2));
|
|
241
|
+
return mt({ base: gt(t2, a3.base), variants: Object.fromEntries(i3.map((e4) => [e4, gt(r2[e4], a3.variants[e4])])), defaultVariants: Qe(n2, a3.defaultVariants), compoundVariants: [...o2, ...a3.compoundVariants] });
|
|
242
|
+
}, splitVariantProps: function(e3) {
|
|
243
|
+
return function(e4, ...t3) {
|
|
244
|
+
const r3 = Object.getOwnPropertyDescriptors(e4), n3 = Object.keys(r3), o3 = (e5) => {
|
|
245
|
+
const t4 = {};
|
|
246
|
+
for (let n4 = 0; n4 < e5.length; n4++) {
|
|
247
|
+
const o4 = e5[n4];
|
|
248
|
+
r3[o4] && (Object.defineProperty(t4, o4, r3[o4]), delete r3[o4]);
|
|
249
|
+
}
|
|
250
|
+
return t4;
|
|
251
|
+
};
|
|
252
|
+
return t3.map((e5) => o3(Array.isArray(e5) ? e5 : n3.filter(e5))).concat(o3(n3));
|
|
253
|
+
}(e3, l2);
|
|
254
|
+
}, getVariantProps: a2 });
|
|
255
|
+
}
|
|
256
|
+
var bt = ((e2) => (e2.component = "component", e2["dashboard-placeholder-table"] = "dashboard-placeholder-table", e2["dashboard-header"] = "dashboard-header", e2["dashboard-table"] = "dashboard-table", e2["dashboard-table-body"] = "dashboard-table-body", e2["dashboard-table-cell"] = "dashboard-table-cell", e2["dashboard-table-column-header"] = "dashboard-table-column-header", e2["dashboard-table-header"] = "dashboard-table-header", e2.label = "label", e2.popup = "popup", e2["popup-sort-row"] = "popup-sort-row", e2["progress-bar"] = "progress-bar", e2["progress-bar-fill"] = "progress-bar-fill", e2.summation = "summation", e2["table-parent-row"] = "table-parent-row", e2["table-row"] = "table-row", e2["table-sub-row"] = "table-sub-row", e2.tile = "tile", e2["tile-bar-label"] = "tile-bar-label", e2["tile-body"] = "tile-body", e2["tile-filter-button"] = "tile-filter-button", e2["tile-filter-list"] = "tile-filter-list", e2["tile-filter-row"] = "tile-filter-row", e2["tile-header"] = "tile-header", e2["tile-title"] = "tile-title", e2.title = "title", e2["business-owner-dashboard"] = "business-owner-dashboard", e2["business-owner-dashboard-header"] = "business-owner-dashboard-header", e2["business-owner-table"] = "business-owner-table", e2["transaction-type-label"] = "transaction-type-label", e2["selector-row"] = "selector-row", e2["popup-list"] = "popup-list", e2.badge = "badge", e2["date-cell"] = "date-cell", e2["expander-cell"] = "expander-cell", e2["vertical-divider"] = "vertical-divider", e2["horizontal-divider"] = "horizontal-divider", e2["table-cell-divider"] = "table-cell-divider", e2["checkbox-input"] = "checkbox-input", e2["bulk-select"] = "bulk-select", e2["button-base"] = "button-base", e2["button-discrete-small"] = "button-discrete-small", e2["button-primary"] = "button-primary", e2["button-secondary"] = "button-secondary", e2["button-tertiary"] = "button-tertiary", e2["button-danger"] = "button-danger", e2["button-warning"] = "button-warning", e2["button-action"] = "button-action", e2.text = "text", e2["cell-button"] = "cell-button", e2["month-picker-left-button"] = "month-picker-left-button", e2["month-picker-right-button"] = "month-picker-right-button", e2["filter-bar"] = "filter-bar", e2["filter-search-bar"] = "filter-search-bar", e2["filter-pill"] = "filter-pill", e2["discrete-form-input"] = "discrete-form-input", e2["editable-form-input"] = "editable-form-input", e2["category-text"] = "category-text", e2["amount-input-container"] = "amount-input-container", e2["amount-input"] = "amount-input", e2["modal-popup"] = "modal-popup", e2["drawer-header"] = "drawer-header", e2["drawer-header-border"] = "drawer-header-border", e2["transaction-form-body"] = "transaction-form-body", e2.body = "body", e2.heading = "heading", e2["sub-label"] = "sub-label", e2["strong-label"] = "strong-label", e2["strong-sub-label"] = "strong-sub-label", e2["metric-xl"] = "metric-xl", e2["metric-md"] = "metric-md", e2["large-icon"] = "large-icon", e2["medium-icon"] = "medium-icon", e2["small-icon"] = "small-icon", e2["tiny-icon"] = "tiny-icon", e2["neutral-badge"] = "neutral-badge", e2["highlight-badge"] = "highlight-badge", e2["success-badge"] = "success-badge", e2["warning-badge"] = "warning-badge", e2["critical-badge"] = "critical-badge", e2["button-group"] = "button-group", e2["alert-dialog"] = "alert-dialog", e2["emphasis-label"] = "emphasis-label", e2["profit-loss-graph"] = "profit-loss-graph", e2.banner = "banner", e2["banner-high"] = "banner-high", e2["banner-medium"] = "banner-medium", e2["banner-low"] = "banner-low", e2["banner-urgent"] = "banner-urgent", e2["banner-button"] = "banner-button", e2["banner-button-text"] = "banner-button-text", e2["banner-button-icon"] = "banner-button-icon", e2["empty-dashboard-layout"] = "empty-dashboard-layout", e2["zero-state-layout"] = "zero-state-layout", e2))(bt || {});
|
|
257
|
+
const ft = "Tight-", yt = (e2) => `${ft}${e2}`;
|
|
258
|
+
function Tt(e2) {
|
|
259
|
+
return e2 in bt;
|
|
260
|
+
}
|
|
261
|
+
function xt(e2) {
|
|
262
|
+
const t2 = e2.indexOf("-"), r2 = e2.slice(0, t2 + 1), n2 = e2.slice(t2 + 1);
|
|
263
|
+
return r2 === ft && n2 in bt;
|
|
264
|
+
}
|
|
265
|
+
function wt(e2) {
|
|
266
|
+
return !Tt(e2) && !xt(e2);
|
|
267
|
+
}
|
|
268
|
+
const kt = (e2, ...t2) => {
|
|
269
|
+
const r2 = [], n2 = [];
|
|
270
|
+
return null !== e2 && r2.push(yt(e2)), t2.forEach((e3) => {
|
|
271
|
+
void 0 !== e3 && (wt(e3) ? n2.push(e3) : Tt(e3) && r2.push(yt(e3)));
|
|
272
|
+
}), { className: pt(...r2, ...n2) };
|
|
273
|
+
}, Ct = kt(bt["business-owner-dashboard-header"], ht({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", height: 80 }));
|
|
274
|
+
function St({ children: e2 }) {
|
|
275
|
+
return w("div", { ...Ct, children: e2 });
|
|
276
|
+
}
|
|
277
|
+
function Et(e2) {
|
|
278
|
+
return e2.reduce((e3, t2) => {
|
|
279
|
+
const r2 = t2.className.split(" ").reduce((e4, t3) => (xt(t3) && e4.push(t3), e4), []);
|
|
280
|
+
return [...e3, ...r2];
|
|
281
|
+
}, []);
|
|
282
|
+
}
|
|
283
|
+
function It(e2) {
|
|
284
|
+
return e2.reduce((e3, t2) => {
|
|
285
|
+
const r2 = t2.className.split(" ").reduce((e4, t3) => (wt(t3) && e4.push(t3), e4), []);
|
|
286
|
+
return [...e3, ...r2];
|
|
287
|
+
}, []);
|
|
288
|
+
}
|
|
289
|
+
function Pt(e2) {
|
|
290
|
+
const t2 = Array.isArray(e2) ? e2 : [e2];
|
|
291
|
+
return { className: pt(...Et(t2), ...It(t2)) };
|
|
292
|
+
}
|
|
293
|
+
const At = mt({ base: {}, variants: { body: { default: { fontWeight: "body", fontSize: "body", fontFamily: "body", color: "typography.base", lineHeight: "16px", letterSpacing: "0.84px" } }, label: { subLabel: { fontWeight: "label.sub", fontSize: "label.sub", fontFamily: "label", color: "typography.label.sub", lineHeight: "14px", letterSpacing: "0.66px" }, strongLabel: { fontWeight: "label.strong", fontSize: "label.strong", fontFamily: "label", color: "typography.label.strong", lineHeight: "16px", letterSpacing: "0.84px" }, strongSubLabel: { fontWeight: "label.strongSub", fontSize: "label.strongSub", fontFamily: "label", color: "typography.label.strongSub", lineHeight: "14px", letterSpacing: "0.84px" } }, heading: { default: { fontWeight: "heading", fontSize: "heading", fontFamily: "heading", color: "typography.heading", lineHeight: "25px", letterSpacing: "2px" } }, metric: { sm: { fontWeight: "metric.sm", fontSize: "metric.sm", fontFamily: "metric", color: "typography.metric.sm" }, md: { fontWeight: "metric.md", fontSize: "metric.md", fontFamily: "metric", color: "typography.metric.md" }, lg: { fontWeight: "metric.lg", fontSize: "metric.lg", fontFamily: "metric", color: "typography.metric.lg" }, xl: { fontWeight: "metric.xl", fontSize: "metric.xl", fontFamily: "metric", color: "typography.metric.xl" } } } }), Dt = kt(bt.heading, At({ heading: "default" }), ht({ whiteSpace: "nowrap" }));
|
|
294
|
+
function Mt({ children: e2, stylists: t2 = [] }) {
|
|
295
|
+
const r2 = Pt([Dt, ...t2]);
|
|
296
|
+
return w("div", { ...r2, children: e2 });
|
|
297
|
+
}
|
|
298
|
+
function Nt(e2) {
|
|
299
|
+
return `${e2.getFullYear()}-${String(e2.getMonth() + 1).padStart(2, "0")}-${String(e2.getDate()).padStart(2, "0")}`;
|
|
300
|
+
}
|
|
301
|
+
function Rt(e2, t2, r2) {
|
|
302
|
+
return new Date(e2, t2, r2);
|
|
303
|
+
}
|
|
304
|
+
function Ot(e2, t2) {
|
|
305
|
+
return Nt(Rt(t2, e2, 1));
|
|
306
|
+
}
|
|
307
|
+
const Lt = { THIS_YEAR: "THIS_YEAR", THIS_MONTH: "THIS_MONTH", LAST_YEAR: "LAST_YEAR", LAST_MONTH: "LAST_MONTH", PAST_YEAR: "PAST_YEAR" };
|
|
308
|
+
const Ft = (e2) => {
|
|
309
|
+
switch (e2) {
|
|
310
|
+
case Lt.THIS_YEAR:
|
|
311
|
+
return Nt(Rt((/* @__PURE__ */ new Date()).getFullYear(), 0, 1));
|
|
312
|
+
case Lt.THIS_MONTH:
|
|
313
|
+
return function() {
|
|
314
|
+
const e3 = /* @__PURE__ */ new Date();
|
|
315
|
+
return Ot(e3.getMonth(), e3.getFullYear());
|
|
316
|
+
}();
|
|
317
|
+
case Lt.LAST_YEAR:
|
|
318
|
+
return Nt(Rt((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 1));
|
|
319
|
+
case Lt.LAST_MONTH:
|
|
320
|
+
return function() {
|
|
321
|
+
const e3 = /* @__PURE__ */ new Date();
|
|
322
|
+
return Nt(Rt(e3.getFullYear(), e3.getMonth() - 1, 1));
|
|
323
|
+
}();
|
|
324
|
+
case Lt.PAST_YEAR:
|
|
325
|
+
return function() {
|
|
326
|
+
const e3 = /* @__PURE__ */ new Date();
|
|
327
|
+
return Nt(Rt(e3.getFullYear() - 1, e3.getMonth(), 1));
|
|
328
|
+
}();
|
|
329
|
+
default:
|
|
330
|
+
return "";
|
|
331
|
+
}
|
|
332
|
+
}, _t = (e2) => {
|
|
333
|
+
switch (e2) {
|
|
334
|
+
case Lt.THIS_YEAR:
|
|
335
|
+
return Nt(Rt((/* @__PURE__ */ new Date()).getFullYear() + 1, 0, 0));
|
|
336
|
+
case Lt.THIS_MONTH:
|
|
337
|
+
return function() {
|
|
338
|
+
const e3 = /* @__PURE__ */ new Date();
|
|
339
|
+
return Nt(Rt(e3.getFullYear(), e3.getMonth() + 1, 0));
|
|
340
|
+
}();
|
|
341
|
+
case Lt.LAST_YEAR:
|
|
342
|
+
return Nt(Rt((/* @__PURE__ */ new Date()).getFullYear(), 0, 0));
|
|
343
|
+
case Lt.PAST_YEAR:
|
|
344
|
+
case Lt.LAST_MONTH:
|
|
345
|
+
return function() {
|
|
346
|
+
const e3 = /* @__PURE__ */ new Date();
|
|
347
|
+
return Nt(Rt(e3.getFullYear(), e3.getMonth(), 0));
|
|
348
|
+
}();
|
|
349
|
+
default:
|
|
350
|
+
return "";
|
|
351
|
+
}
|
|
352
|
+
}, Wt = (e2) => {
|
|
353
|
+
return t2 = e2, Object.values(Lt).includes(t2) ? { beginDate: Ft(e2), endDate: _t(e2) } : { beginDate: Nt((r2 = e2).beginDate), endDate: Nt(r2.endDate) };
|
|
354
|
+
var t2, r2;
|
|
355
|
+
}, Bt = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"], Ht = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
356
|
+
function zt({ yearsBack: e2 = 10, startYear: t2 }) {
|
|
357
|
+
const r2 = t2 ?? (/* @__PURE__ */ new Date()).getFullYear(), n2 = [r2];
|
|
358
|
+
for (let t3 = r2 - 1; t3 >= r2 - e2; t3--) n2.push(t3);
|
|
359
|
+
return n2;
|
|
360
|
+
}
|
|
361
|
+
function Vt(e2, t2) {
|
|
362
|
+
return e2.toDateString() === t2.toDateString();
|
|
363
|
+
}
|
|
364
|
+
function jt(e2) {
|
|
365
|
+
return Vt(e2, /* @__PURE__ */ new Date());
|
|
366
|
+
}
|
|
367
|
+
function qt(e2, t2) {
|
|
368
|
+
const r2 = Rt(e2.getFullYear(), e2.getMonth(), e2.getDate()), n2 = Rt(t2.getFullYear(), t2.getMonth(), t2.getDate());
|
|
369
|
+
return r2.getTime() > n2.getTime();
|
|
370
|
+
}
|
|
371
|
+
function $t(e2) {
|
|
372
|
+
if (!e2 || !(e2 instanceof Date) || isNaN(e2.getTime())) return "";
|
|
373
|
+
return `${String(e2.getMonth() + 1).padStart(2, "0")}/${String(e2.getDate()).padStart(2, "0")}/${e2.getFullYear()}`;
|
|
374
|
+
}
|
|
375
|
+
function Ut(e2, t2, r2) {
|
|
376
|
+
if (e2 < 1 || e2 > 12 || t2 < 1 || t2 > 31) return false;
|
|
377
|
+
const n2 = Rt(r2, e2 - 1, t2);
|
|
378
|
+
return !(n2.getFullYear() !== r2 || n2.getMonth() !== e2 - 1 || n2.getDate() !== t2);
|
|
379
|
+
}
|
|
380
|
+
function Kt(e2) {
|
|
381
|
+
if (!e2.trim()) return null;
|
|
382
|
+
const t2 = e2.match(/^(\d{1,2})\/(\d{1,2})\/(\d{1,4})$/);
|
|
383
|
+
if (!t2) return null;
|
|
384
|
+
const [, r2, n2, o2] = t2, a2 = parseInt(r2, 10), i2 = parseInt(n2, 10), l2 = parseInt(o2, 10);
|
|
385
|
+
return Ut(a2, i2, l2) ? Rt(l2, a2 - 1, i2) : null;
|
|
386
|
+
}
|
|
387
|
+
function Yt(e2) {
|
|
388
|
+
if (!e2.trim()) return null;
|
|
389
|
+
const t2 = e2.match(/^(\d{1,4})-(\d{1,2})-(\d{1,2})$/);
|
|
390
|
+
if (!t2) return null;
|
|
391
|
+
const [, r2, n2, o2] = t2, a2 = parseInt(r2, 10), i2 = parseInt(n2, 10), l2 = parseInt(o2, 10);
|
|
392
|
+
return Ut(i2, l2, a2) ? Rt(a2, i2 - 1, l2) : null;
|
|
393
|
+
}
|
|
394
|
+
function Gt(e2) {
|
|
395
|
+
if (!e2 || !(e2 instanceof Date) || isNaN(e2.getTime())) return "";
|
|
396
|
+
return `${e2.getFullYear()}-${String(e2.getMonth() + 1).padStart(2, "0")}-${String(e2.getDate()).padStart(2, "0")}`;
|
|
397
|
+
}
|
|
398
|
+
const Qt = (e2, t2) => {
|
|
399
|
+
const r2 = { month: t2.abbreviateMonth ? "short" : "long", year: t2.abbreviateYear ? "2-digit" : "numeric" };
|
|
400
|
+
return e2.toLocaleString("default", r2);
|
|
401
|
+
};
|
|
402
|
+
function Xt(e2, t2, r2) {
|
|
403
|
+
return [...e2, { accessToken: t2, environment: r2 }];
|
|
404
|
+
}
|
|
405
|
+
function Zt(e2, t2) {
|
|
406
|
+
return [...e2, t2];
|
|
407
|
+
}
|
|
408
|
+
const Jt = (e2) => null == e2, er = (e2) => !Jt(e2);
|
|
409
|
+
function tr(e2) {
|
|
410
|
+
return Jt(e2) || function(e3) {
|
|
411
|
+
return "" === e3.trim();
|
|
412
|
+
}(e2);
|
|
413
|
+
}
|
|
414
|
+
function rr(e2) {
|
|
415
|
+
return !tr(e2);
|
|
416
|
+
}
|
|
417
|
+
const nr = h({ activeToken: void 0, accountantToken: void 0 });
|
|
418
|
+
function or() {
|
|
419
|
+
const { activeToken: e2 } = g(nr);
|
|
420
|
+
return e2;
|
|
421
|
+
}
|
|
422
|
+
const ar = () => {
|
|
423
|
+
throw new Error("No access token provided");
|
|
424
|
+
}, ir = 72e5, lr = new S({ defaultOptions: { queries: { gcTime: ir, staleTime: 3e4, refetchInterval: 6e4 } } }), sr = h("SANDBOX");
|
|
425
|
+
function cr() {
|
|
426
|
+
return g(sr);
|
|
427
|
+
}
|
|
428
|
+
function dr({ queryKey: e2, queryFn: t2, ...r2 }) {
|
|
429
|
+
const n2 = or(), o2 = cr(), a2 = rr(n2), i2 = Xt(e2, n2 ?? "", o2), l2 = E(), s2 = I({ ...r2, queryKey: i2, queryFn: a2 ? t2 : ar, placeholderData: r2.keepPreviousDataPlaceholder ? P : void 0, ...a2 ? {} : { retry: false, staleTime: 1 / 0 } }, lr);
|
|
430
|
+
return { isRehydrating: l2, isFilling: l2 || s2.isLoading, query: s2 };
|
|
431
|
+
}
|
|
432
|
+
class ur {
|
|
433
|
+
constructor(e2) {
|
|
434
|
+
this.client = e2;
|
|
435
|
+
}
|
|
436
|
+
async sendEvent({ apiKey: e2, events: t2, notifier: r2, payloadVersion: n2 }) {
|
|
437
|
+
const o2 = (/* @__PURE__ */ new Date()).toISOString(), a2 = JSON.stringify({ apiKey: e2, payloadVersion: n2, notifier: r2, events: t2 });
|
|
438
|
+
await fetch(this.client.endpoints.notify, { method: "POST", mode: "cors", credentials: "omit", headers: { "Content-Type": "application/json", "Bugsnag-Api-Key": e2, "Bugsnag-Payload-Version": n2, "Bugsnag-Sent-At": o2 }, referrerPolicy: "no-referrer", body: a2 });
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
const hr = Symbol("Circular"), gr = Symbol("AccessError");
|
|
442
|
+
function pr(e2, t2, r2) {
|
|
443
|
+
return vr({ key: "", value: e2, replacer: t2, seen: [], depth: 0, depthLimit: r2 == null ? void 0 : r2.depthLimit, edgeIndex: 0, edgesLimit: r2 == null ? void 0 : r2.edgesLimit });
|
|
444
|
+
}
|
|
445
|
+
function vr({ key: e2, value: t2, replacer: r2, seen: n2, depthLimit: o2 = 1 / 0, depth: a2, edgeIndex: i2, edgesLimit: l2 = 1 / 0 }) {
|
|
446
|
+
let s2 = t2;
|
|
447
|
+
if (n2.includes(s2) && (s2 = hr), r2 && (s2 = r2(e2, s2)), function(e3) {
|
|
448
|
+
return "object" == typeof e3 && null !== e3 && "toJSON" in e3 && "function" == typeof e3.toJSON;
|
|
449
|
+
}(s2) && (s2 = mr(() => s2.toJSON(String(e2)))), null === s2 || "object" != typeof s2) return s2;
|
|
450
|
+
if (a2 > o2 || i2 + 1 > l2) return "[...]";
|
|
451
|
+
if (n2.push(t2), Array.isArray(s2)) {
|
|
452
|
+
const e3 = [], t3 = Math.min(s2.length, l2);
|
|
453
|
+
for (let i3 = 0; i3 < t3; i3++) {
|
|
454
|
+
const t4 = mr(() => s2[i3]);
|
|
455
|
+
e3.push(vr({ key: i3, value: t4, replacer: r2, seen: n2, depth: a2, depthLimit: o2, edgeIndex: i3, edgesLimit: l2 }));
|
|
456
|
+
}
|
|
457
|
+
t3 < s2.length && e3.push("[...]"), s2 = e3;
|
|
458
|
+
} else {
|
|
459
|
+
const e3 = {}, t3 = Object.keys(s2);
|
|
460
|
+
for (let i3 = 0; i3 < t3.length; i3++) {
|
|
461
|
+
const c2 = t3[i3], d2 = mr(() => s2[c2]);
|
|
462
|
+
e3[c2] = vr({ key: c2, value: d2, replacer: r2, seen: n2, depth: a2, depthLimit: o2, edgeIndex: i3, edgesLimit: l2 });
|
|
463
|
+
}
|
|
464
|
+
s2 = e3;
|
|
465
|
+
}
|
|
466
|
+
return n2.pop(), s2;
|
|
467
|
+
}
|
|
468
|
+
function mr(e2) {
|
|
469
|
+
try {
|
|
470
|
+
return e2();
|
|
471
|
+
} catch {
|
|
472
|
+
return gr;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
const br = Object.prototype.toString, fr = Object.getPrototypeOf, yr = "[object Error]";
|
|
476
|
+
function Tr(e2) {
|
|
477
|
+
return "object" == typeof e2 && null !== e2 && !Array.isArray(e2);
|
|
478
|
+
}
|
|
479
|
+
const xr = /^\s*at .*(\S+:\d+|\(native\))/m, wr = /^(eval@)?(\[native code])?$/;
|
|
480
|
+
function kr(e2) {
|
|
481
|
+
const t2 = e2.match(xr) ? function(e3) {
|
|
482
|
+
const t3 = e3.split("\n").filter((e4) => !!e4.match(xr));
|
|
483
|
+
return t3.map((e4) => {
|
|
484
|
+
e4.indexOf("(eval ") > -1 && (e4 = e4.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(\),.*$)/g, ""));
|
|
485
|
+
let t4 = e4.replace(/^\s+/, "").replace(/\(eval code/g, "(");
|
|
486
|
+
const r2 = t4.match(/ (\((.+):(\d+):(\d+)\)$)/);
|
|
487
|
+
t4 = r2 ? t4.replace(r2[0], "") : t4;
|
|
488
|
+
const n2 = t4.split(/\s+/).slice(1), o2 = Cr(r2 ? r2[1] : n2.pop() || "(no location)"), a2 = n2.join(" ") || void 0;
|
|
489
|
+
return { file: ["eval", "<anonymous>"].indexOf(o2[0]) > -1 ? void 0 : o2[0], lineNumber: o2[1], columnNumber: o2[2], method: a2 };
|
|
490
|
+
});
|
|
491
|
+
}(e2) : function(e3) {
|
|
492
|
+
const t3 = e3.split("\n").filter((e4) => !e4.match(wr));
|
|
493
|
+
return t3.map((e4) => {
|
|
494
|
+
if (e4.indexOf(" > eval") > -1 && (e4 = e4.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), -1 === e4.indexOf("@") && -1 === e4.indexOf(":")) return { method: e4 };
|
|
495
|
+
{
|
|
496
|
+
const t4 = /((.*".+"[^@]*)?[^@]*)(?:@)/, r2 = e4.match(t4), n2 = r2 && r2[1] ? r2[1] : void 0, o2 = Cr(e4.replace(t4, ""));
|
|
497
|
+
return { file: o2[0], lineNumber: o2[1], columnNumber: o2[2], method: n2 };
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
}(e2);
|
|
501
|
+
return t2.reduce((e3, t3) => {
|
|
502
|
+
if ("{}" === JSON.stringify(t3)) return e3;
|
|
503
|
+
let r2 = t3.file || t3.method || "number" != typeof t3.lineNumber ? t3.file || "(unknown file)" : "global code";
|
|
504
|
+
r2 = r2.replace(/\?.*$/, "").replace(/#.*$/, "");
|
|
505
|
+
let n2 = t3.method || "(unknown function)";
|
|
506
|
+
return n2 = /^global code$/i.test(n2) ? "global code" : n2, e3.concat([{ file: r2, lineNumber: t3.lineNumber, columnNumber: t3.columnNumber, method: n2 }]);
|
|
507
|
+
}, []);
|
|
508
|
+
}
|
|
509
|
+
function Cr(e2) {
|
|
510
|
+
if (-1 === e2.indexOf(":")) return [e2];
|
|
511
|
+
const t2 = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e2.replace(/[()]/g, ""));
|
|
512
|
+
if (!t2) return [e2];
|
|
513
|
+
const r2 = t2[2] ? parseInt(t2[2], 10) : void 0, n2 = t2[3] ? parseInt(t2[3], 10) : void 0;
|
|
514
|
+
return [t2[1], r2, n2];
|
|
515
|
+
}
|
|
516
|
+
function Sr(e2, t2) {
|
|
517
|
+
const r2 = Er(e2, t2);
|
|
518
|
+
let n2;
|
|
519
|
+
"InvalidError" === r2.name && (n2 = { [t2]: { "non-error parameter": e2 } }), void 0 !== r2.metadata && Tr(r2.metadata) && (n2 = { ...n2, [r2.name]: r2.metadata });
|
|
520
|
+
const o2 = [Ir(r2)];
|
|
521
|
+
return o2.push(...Dr(r2).map((e3) => Ir(e3, { backtrace: false }))), { exceptions: o2, metadata: n2 };
|
|
522
|
+
}
|
|
523
|
+
function Er(e2, t2) {
|
|
524
|
+
if (function(e3) {
|
|
525
|
+
if (e3 instanceof Error) return true;
|
|
526
|
+
let t3 = e3;
|
|
527
|
+
for (; t3; ) {
|
|
528
|
+
if (br.call(t3) === yr) return true;
|
|
529
|
+
t3 = fr(t3);
|
|
530
|
+
}
|
|
531
|
+
return false;
|
|
532
|
+
}(e2)) return e2;
|
|
533
|
+
let r2 = function(e3) {
|
|
534
|
+
if (!Tr(e3)) return null;
|
|
535
|
+
const t3 = (t4) => {
|
|
536
|
+
const r4 = e3[t4];
|
|
537
|
+
if ("string" == typeof r4 && e3[t4.length]) return r4;
|
|
538
|
+
}, r3 = t3("name") || t3("errorClass"), n2 = t3("message") || t3("errorMessage");
|
|
539
|
+
if (!r3 || !n2) return null;
|
|
540
|
+
const o2 = new Error(n2);
|
|
541
|
+
return o2.name = r3, o2;
|
|
542
|
+
}(e2);
|
|
543
|
+
if (r2) return r2;
|
|
544
|
+
switch (typeof r2) {
|
|
545
|
+
case "string":
|
|
546
|
+
case "number":
|
|
547
|
+
case "boolean":
|
|
548
|
+
return new Error(String(e2));
|
|
549
|
+
default:
|
|
550
|
+
return r2 = new Error(`${t2} received a non-error. See "${t2}" tab for more detail.`), r2.name = "InvalidError", r2;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
function Ir(e2, t2 = { backtrace: false }) {
|
|
554
|
+
return { errorClass: e2.name, message: e2.message, stacktrace: Pr(e2, t2), type: "object" == typeof self && self.navigator ? "browserjs" : "nodejs" };
|
|
555
|
+
}
|
|
556
|
+
function Pr(e2, { backtrace: t2 }) {
|
|
557
|
+
const r2 = function(e3) {
|
|
558
|
+
let t3 = e3.stack;
|
|
559
|
+
if (void 0 === t3) {
|
|
560
|
+
t3 = e3.stacktrace;
|
|
561
|
+
}
|
|
562
|
+
return "string" == typeof t3 && t3.length && t3 !== `${e3.name}: ${e3.message}` ? t3 : void 0;
|
|
563
|
+
}(e2);
|
|
564
|
+
return r2 ? kr(r2) : t2 ? function() {
|
|
565
|
+
const e3 = [];
|
|
566
|
+
let t3;
|
|
567
|
+
try {
|
|
568
|
+
t3 = arguments.callee;
|
|
569
|
+
} catch {
|
|
570
|
+
return [];
|
|
571
|
+
}
|
|
572
|
+
for (; t3 && e3.length < Ar; ) {
|
|
573
|
+
t3.name ? e3.push({ method: t3.name, file: "(unknown file)" }) : /function(?:\s+([\w$]+))+\s*\(/.test(t3.toString()) && e3.push({ method: RegExp.$1, file: "(unknown file)" });
|
|
574
|
+
try {
|
|
575
|
+
t3 = t3.caller;
|
|
576
|
+
} catch {
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return e3;
|
|
581
|
+
}() : [];
|
|
582
|
+
}
|
|
583
|
+
const Ar = 20;
|
|
584
|
+
function Dr(e2) {
|
|
585
|
+
const t2 = e2;
|
|
586
|
+
if (t2.cause) {
|
|
587
|
+
const e3 = Er(t2.cause, "cause");
|
|
588
|
+
return "InvalidError" === e3.name ? [] : [e3].concat(Dr(e3));
|
|
589
|
+
}
|
|
590
|
+
return [];
|
|
591
|
+
}
|
|
592
|
+
function Mr(...e2) {
|
|
593
|
+
console.error;
|
|
594
|
+
}
|
|
595
|
+
const Nr = { name: "browserNotifyUnhandledExceptions", load(e2) {
|
|
596
|
+
self.addEventListener("error", (t2) => {
|
|
597
|
+
let r2, n2;
|
|
598
|
+
if (t2 instanceof ErrorEvent) {
|
|
599
|
+
const { message: e3, filename: o2, lineno: a2, colno: i2, error: l2 } = t2, s2 = Number.isSafeInteger(a2) ? a2 : void 0;
|
|
600
|
+
if (0 === s2 && /Script error\.?/.test(e3)) return void console.log;
|
|
601
|
+
({ exceptions: r2, metadata: n2 } = Sr(l2, "window onerror"));
|
|
602
|
+
const c2 = Number.isSafeInteger(i2) ? i2 : void 0, { stacktrace: d2 } = r2[0];
|
|
603
|
+
if (d2.length) {
|
|
604
|
+
const e4 = d2[0];
|
|
605
|
+
e4.file = e4.file || o2, e4.lineNumber = e4.lineNumber ?? s2, e4.columnNumber = e4.columnNumber ?? c2;
|
|
606
|
+
} else d2.push({ file: o2, lineNumber: s2, columnNumber: c2, method: "(unknown file)" });
|
|
607
|
+
} else ({ exceptions: r2, metadata: n2 } = Sr(t2, "window onerror"));
|
|
608
|
+
e2.notifyEvent({ exceptions: r2, unhandled: true, severity: "error", severityReason: { type: "unhandledException" }, metadata: n2 }, t2);
|
|
609
|
+
});
|
|
610
|
+
} }, Rr = { name: "browserNotifyUnhandledRejections", load(e2) {
|
|
611
|
+
self.addEventListener("unhandledrejection", (t2) => {
|
|
612
|
+
const r2 = t2.reason, { exceptions: n2, metadata: o2 } = Sr(r2, "unhandledrejection");
|
|
613
|
+
e2.notifyEvent({ exceptions: n2, unhandled: true, severity: "error", severityReason: { type: "unhandledPromiseRejection" }, metadata: o2 }, r2);
|
|
614
|
+
});
|
|
615
|
+
} }, Or = { name: "errorBreadcrumbs", load(e2) {
|
|
616
|
+
e2.addOnPostError((t2) => {
|
|
617
|
+
e2.leaveBreadcrumb(t2.exceptions[0].errorClass, { errorClass: t2.exceptions[0].errorClass, errorMessage: t2.exceptions[0].message, severity: t2.severity }, "error");
|
|
618
|
+
});
|
|
619
|
+
} };
|
|
620
|
+
let Lr = Date.now();
|
|
621
|
+
const Fr = () => {
|
|
622
|
+
Lr = Date.now();
|
|
623
|
+
}, _r = { name: "appDuration", load: (e2) => (e2.addOnError((e3) => {
|
|
624
|
+
const t2 = Date.now();
|
|
625
|
+
return e3.app = e3.app || {}, e3.app.duration = t2 - Lr, true;
|
|
626
|
+
}), { reset: Fr }) };
|
|
627
|
+
const Wr = [["Edge (EdgeHTML)", /Edge\/([0-9._]+)/], ["Edge (iOS)", /EdgiOS\/([0-9._]+)/], ["Yandex", /YaBrowser\/([0-9._]+)/], ["KakaoTalk", /KAKAOTALK\s([0-9.]+)/], ["Samsung", /SamsungBrowser\/([0-9.]+)/], ["Silk", /\bSilk\/([0-9._-]+)\b/], ["MIUI", /MiuiBrowser\/([0-9.]+)$/], ["Beaker", /BeakerBrowser\/([0-9.]+)/], ["Edge (Chromium)", /EdgA?\/([0-9.]+)/], ["Chromium WebView", /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/], ["Chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9.]+)(:?\s|$)/], ["Chrome (iOS)", /CriOS\/([0-9.]+)(:?\s|$)/], ["Firefox", /Firefox\/([0-9.]+)(?:\s|$)/], ["Firefox (iOS)", /FxiOS\/([0-9.]+)/], ["Opera Mini", /Opera Mini.*Version\/([0-9.]+)/], ["Opera", /Opera\/([0-9.]+)(?:\s|$)/], ["Opera", /OPR\/([0-9.]+)(:?\s|$)/], ["Internet Explorer", /Trident\/7\.0.*rv:([0-9.]+).*\).*Gecko$/], ["Internet Explorer", /MSIE\s([0-9.]+);.*Trident\/[4-7].0/], ["Internet Explorer", /MSIE\s(7\.0)/], ["Blackberry", /BB10;\sTouch.*Version\/([0-9.]+)/], ["Android", /Android\s([0-9.]+)/], ["Safari (iOS)", /Version\/([0-9._]+).*Mobile.*Safari.*/], ["Safari", /Version\/([0-9._]+).*Safari/], ["Facebook", /FB[AS]V\/([0-9.]+)/], ["Instagram", /Instagram\s([0-9.]+)/], ["iOS WebView", /AppleWebKit\/([0-9.]+).*Mobile/], ["iOS WebView", /AppleWebKit\/([0-9.]+).*Gecko\)$/]];
|
|
628
|
+
const Br = [["iOS", void 0, /iP(hone|od|ad)/], ["Android", void 0, /Android/], ["BlackBerry", void 0, /BlackBerry|BB10/], ["Windows Mobile", void 0, /IEMobile/], ["Kindle", void 0, /Kindle/], ["Windows", "3.11", /Win16/], ["Windows", "95", /(Windows 95)|(Win95)|(Windows_95)/], ["Windows", "98", /(Windows 98)|(Win98)/], ["Windows", "2000", /(Windows NT 5.0)|(Windows 2000)/], ["Windows", "XP", /(Windows NT 5.1)|(Windows XP)/], ["Windows", "Server 2003", /(Windows NT 5.2)/], ["Windows", "Vista", /(Windows NT 6.0)/], ["Windows", "7", /(Windows NT 6.1)/], ["Windows", "8", /(Windows NT 6.2)/], ["Windows", "8.1", /(Windows NT 6.3)/], ["Windows", "10+", /(Windows NT 10.0)/], ["Windows", "ME", /Windows ME/], ["Open BSD", void 0, /OpenBSD/], ["Sun OS", void 0, /SunOS/], ["Chrome OS", void 0, /CrOS/], ["Linux", void 0, /(Linux)|(X11)/], ["Mac OS", void 0, /(Mac_PowerPC)|(Macintosh)/], ["QNX", void 0, /QNX/], ["BeOS", void 0, /BeOS/], ["OS/2", void 0, /OS\/2/]];
|
|
629
|
+
const Hr = (zr = function(e2) {
|
|
630
|
+
const t2 = function(e3) {
|
|
631
|
+
return "" !== e3 && Wr.reduce((t3, [r3, n3]) => {
|
|
632
|
+
if (t3) return t3;
|
|
633
|
+
const o3 = n3.exec(e3);
|
|
634
|
+
return !!o3 && [r3, o3];
|
|
635
|
+
}, false);
|
|
636
|
+
}(e2);
|
|
637
|
+
if (!t2) return {};
|
|
638
|
+
const [r2, n2] = t2, o2 = function(e3) {
|
|
639
|
+
for (const [t3, r3, n3] of Br) if (n3.exec(e3)) return { osName: t3, osVersion: r3 };
|
|
640
|
+
return null;
|
|
641
|
+
}(e2), a2 = "iOS" === (o2 == null ? void 0 : o2.osName) ? function(e3) {
|
|
642
|
+
const t3 = /iPad|iPhone|iPod/.exec(e3);
|
|
643
|
+
return t3 ? { manufacturer: "Apple", model: t3[0] } : /MacIntel/.test(e3) && self.navigator && self.navigator.maxTouchPoints && self.navigator.maxTouchPoints > 2 ? { manufacturer: "Apple", model: "iPad" } : null;
|
|
644
|
+
}(e2) : {};
|
|
645
|
+
return { browserName: r2, browserVersion: n2[1], osName: o2 == null ? void 0 : o2.osName, osVersion: o2 == null ? void 0 : o2.osVersion, manufacturer: a2 == null ? void 0 : a2.manufacturer, model: a2 == null ? void 0 : a2.model };
|
|
646
|
+
}, { name: "browserContext", load(e2) {
|
|
647
|
+
e2.addOnError((e3) => {
|
|
648
|
+
e3.request = { ...e3.request, url: self.location.href }, e3.context = e3.context || self.location.pathname, e3.device = { ...e3.device, ...zr(self.navigator.userAgent), locale: self.navigator.language, userAgent: self.navigator.userAgent };
|
|
649
|
+
let t2 = ["n/a"];
|
|
650
|
+
try {
|
|
651
|
+
t2 = self.navigator.languages;
|
|
652
|
+
} catch {
|
|
653
|
+
}
|
|
654
|
+
return e3.metaData = { ...e3.metaData, language: { language: self.navigator.language, languages: t2 } }, true;
|
|
655
|
+
});
|
|
656
|
+
} });
|
|
657
|
+
var zr;
|
|
658
|
+
class Vr {
|
|
659
|
+
constructor(e2, t2) {
|
|
660
|
+
__publicField(this, "limit");
|
|
661
|
+
__publicField(this, "period");
|
|
662
|
+
__publicField(this, "events");
|
|
663
|
+
this.limit = e2, this.period = t2, this.events = new D();
|
|
664
|
+
}
|
|
665
|
+
reset() {
|
|
666
|
+
this.events.clear();
|
|
667
|
+
}
|
|
668
|
+
increment() {
|
|
669
|
+
const e2 = (/* @__PURE__ */ new Date()).getTime();
|
|
670
|
+
if (void 0 !== this.period) {
|
|
671
|
+
let t3 = this.events.peek();
|
|
672
|
+
for (; void 0 !== t3 && e2 - this.period > t3; ) this.events.dequeue(), t3 = this.events.peek();
|
|
673
|
+
}
|
|
674
|
+
const t2 = this.events.size + 1 <= this.limit;
|
|
675
|
+
return t2 && this.events.enqueue(e2), t2;
|
|
676
|
+
}
|
|
677
|
+
get size() {
|
|
678
|
+
return this.events.size;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
class jr extends p {
|
|
682
|
+
constructor(e2) {
|
|
683
|
+
super(e2), this.state = { error: void 0, errorInfo: void 0 };
|
|
684
|
+
}
|
|
685
|
+
handleClearError() {
|
|
686
|
+
this.setState({ error: void 0, errorInfo: void 0 });
|
|
687
|
+
}
|
|
688
|
+
static getDerivedStateFromError(e2) {
|
|
689
|
+
return { error: e2 };
|
|
690
|
+
}
|
|
691
|
+
componentDidCatch(e2, t2) {
|
|
692
|
+
const { exceptions: r2, metadata: n2 } = Sr(e2, "notify");
|
|
693
|
+
t2 && t2.componentStack && (t2.componentStack = function(e3) {
|
|
694
|
+
const t3 = e3.split(/\s*\n\s*/g);
|
|
695
|
+
let r3 = "";
|
|
696
|
+
for (let e4 = 0, n3 = t3.length; e4 < n3; e4++) t3[e4].length && (r3 += `${r3.length ? "\n" : ""}${t3[e4]}`);
|
|
697
|
+
return r3;
|
|
698
|
+
}(t2.componentStack));
|
|
699
|
+
const { onError: o2, client: a2 } = this.props;
|
|
700
|
+
a2.notifyEvent({ exceptions: r2, unhandled: true, severity: "error", severityReason: { type: "unhandledException" }, metadata: { ...n2, react: t2 }, onError: o2 }, e2), this.setState({ errorInfo: t2 });
|
|
701
|
+
}
|
|
702
|
+
render() {
|
|
703
|
+
const { error: e2 } = this.state;
|
|
704
|
+
if (e2) {
|
|
705
|
+
const { FallbackComponent: e3 } = this.props;
|
|
706
|
+
if (e3) return w(e3, { error: this.state.error, errorInfo: this.state.errorInfo, clearError: () => this.handleClearError() });
|
|
707
|
+
}
|
|
708
|
+
return w(k, { children: this.props.children });
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
const qr = { name: "react", load: (e2) => ({ BugsnagErrorBoundary: ({ onError: t2, fallbackComponent: r2, children: n2 }) => w(jr, { client: e2, onError: t2, FallbackComponent: r2, children: n2 }) }) };
|
|
712
|
+
const $r = new class {
|
|
713
|
+
constructor() {
|
|
714
|
+
__publicField(this, "breadcrumbs", []);
|
|
715
|
+
__publicField(this, "config");
|
|
716
|
+
__publicField(this, "delivery", new ur(this));
|
|
717
|
+
__publicField(this, "errorCallbacks", /* @__PURE__ */ new Set());
|
|
718
|
+
__publicField(this, "postErrorCallbacks", /* @__PURE__ */ new Set());
|
|
719
|
+
__publicField(this, "plugins", []);
|
|
720
|
+
}
|
|
721
|
+
start(e2) {
|
|
722
|
+
if (this.config) return Mr(), this;
|
|
723
|
+
let t2;
|
|
724
|
+
this.config = e2, this.config.onError && (t2 = Array.isArray(this.config.onError) ? this.config.onError : [this.config.onError]), this.errorCallbacks = new Set(t2);
|
|
725
|
+
for (const e3 of this.config.plugins || []) this.plugins.push({ name: e3.name || "unknown", plugin: e3.load(this) });
|
|
726
|
+
return this;
|
|
727
|
+
}
|
|
728
|
+
get endpoints() {
|
|
729
|
+
var _a2, _b2;
|
|
730
|
+
return { notify: ((_b2 = (_a2 = this.config) == null ? void 0 : _a2.endpoints) == null ? void 0 : _b2.notify) || "https://notify.bugsnag.com/" };
|
|
731
|
+
}
|
|
732
|
+
notify(e2, t2 = {}) {
|
|
733
|
+
const { exceptions: r2, metadata: n2 } = Sr(e2, "notify");
|
|
734
|
+
let o2, a2, i2 = n2;
|
|
735
|
+
return "function" == typeof t2 ? o2 = t2 : (a2 = t2.severity, t2.metadata && (i2 = { ...n2, ...t2.metadata })), this.notifyEvent({ exceptions: r2, metadata: i2, severity: a2, onError: o2 }, e2);
|
|
736
|
+
}
|
|
737
|
+
leaveBreadcrumb(e2, t2, r2) {
|
|
738
|
+
if (!this.config) return;
|
|
739
|
+
if ("string" != typeof e2) try {
|
|
740
|
+
e2 = String(e2);
|
|
741
|
+
} catch {
|
|
742
|
+
e2 = "Unable to stringify breadcrumb message";
|
|
743
|
+
}
|
|
744
|
+
if (!e2.length) return;
|
|
745
|
+
this.breadcrumbs.push({ name: e2, metaData: t2, type: r2 || "manual", timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
746
|
+
const { maxBreadcrumbs: n2 = 25 } = this.config;
|
|
747
|
+
this.breadcrumbs.length > n2 && this.breadcrumbs.splice(0, this.breadcrumbs.length - n2);
|
|
748
|
+
}
|
|
749
|
+
async notifyEvent({ exceptions: e2, unhandled: t2, severity: r2, severityReason: n2, metadata: o2, onError: a2 }, i2) {
|
|
750
|
+
if (!this.config) return;
|
|
751
|
+
const l2 = this.config.releaseStage || "production";
|
|
752
|
+
if (this.config.enabledReleaseStages && !this.config.enabledReleaseStages.includes(l2)) return;
|
|
753
|
+
const s2 = { exceptions: e2, breadcrumbs: this.breadcrumbs.length ? this.breadcrumbs : void 0, originalError: i2, unhandled: "boolean" == typeof t2 && t2, severity: r2 || "warning", severityReason: n2, user: this.config.user || void 0, app: { releaseStage: l2, version: this.config.appVersion, type: this.config.appType || ("object" == typeof window ? "browser" : "node") }, device: { time: (/* @__PURE__ */ new Date()).toISOString() }, metaData: o2 || {} }, c2 = [...this.errorCallbacks];
|
|
754
|
+
a2 && c2.push(a2);
|
|
755
|
+
const d2 = ["stringifyValues", "redact"];
|
|
756
|
+
c2.sort((e3, t3) => d2.includes(e3.name) && d2.includes(t3.name) ? 0 : d2.includes(e3.name) ? 1 : d2.includes(t3.name) ? -1 : 0);
|
|
757
|
+
for (const e3 of c2) {
|
|
758
|
+
const t3 = await e3(s2);
|
|
759
|
+
if ("boolean" == typeof t3 && !t3) return;
|
|
760
|
+
}
|
|
761
|
+
const u2 = pr(s2, (e3, t3) => {
|
|
762
|
+
if ("originalError" !== e3) return t3;
|
|
763
|
+
}, { depthLimit: 20, edgesLimit: 500 });
|
|
764
|
+
let h2;
|
|
765
|
+
const g2 = { apiKey: this.config.apiKey, payloadVersion: "5", notifier: { name: "Tight Components", version: "1", url: "https://github.com/Hurdlr/TraxComponents/tree/dev/src/bugsnag/README.md" }, events: [u2] };
|
|
766
|
+
try {
|
|
767
|
+
h2 = JSON.stringify(g2);
|
|
768
|
+
} catch {
|
|
769
|
+
u2.metaData = { notifier: "Unable to serialize metadata" }, h2 = JSON.stringify(g2);
|
|
770
|
+
}
|
|
771
|
+
if (h2.length > 1e6 && (u2.metaData = { notifier: `Payload was ${h2.length / 1e6}Mb. Metadata removed.` }, h2 = JSON.stringify(g2), h2.length > 1e6)) throw new Error("Payload exceeded 1Mb limit");
|
|
772
|
+
for (const e3 of this.postErrorCallbacks) e3(s2);
|
|
773
|
+
try {
|
|
774
|
+
await this.delivery.sendEvent(g2);
|
|
775
|
+
} catch (e3) {
|
|
776
|
+
Mr();
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
getUser() {
|
|
780
|
+
var _a2;
|
|
781
|
+
return ((_a2 = this.config) == null ? void 0 : _a2.user) || {};
|
|
782
|
+
}
|
|
783
|
+
setUser(e2, t2, r2) {
|
|
784
|
+
this.config && (this.config.user = { id: e2, email: t2, name: r2 });
|
|
785
|
+
}
|
|
786
|
+
setProperties(e2) {
|
|
787
|
+
this.config && (this.config.releaseStage = e2);
|
|
788
|
+
}
|
|
789
|
+
addOnError(e2) {
|
|
790
|
+
this.errorCallbacks.add(e2);
|
|
791
|
+
}
|
|
792
|
+
removeOnError(e2) {
|
|
793
|
+
this.errorCallbacks.delete(e2);
|
|
794
|
+
}
|
|
795
|
+
addOnPostError(e2) {
|
|
796
|
+
this.postErrorCallbacks.add(e2);
|
|
797
|
+
}
|
|
798
|
+
removeOnPostError(e2) {
|
|
799
|
+
this.postErrorCallbacks.delete(e2);
|
|
800
|
+
}
|
|
801
|
+
getPlugin(e2) {
|
|
802
|
+
var _a2;
|
|
803
|
+
return (_a2 = this.plugins.find((t2) => t2.name === e2)) == null ? void 0 : _a2.plugin;
|
|
804
|
+
}
|
|
805
|
+
setDelivery(e2) {
|
|
806
|
+
this.delivery = e2;
|
|
807
|
+
}
|
|
808
|
+
}();
|
|
809
|
+
let Ur = "";
|
|
810
|
+
const Kr = "prod", Yr = $r.start({ apiKey: "899aec02393ac236377b73b483800d2c", appVersion: "1.0.0-alpha.0", appType: "browser", releaseStage: Kr, plugins: [_r, Hr, Or, ((e2, t2) => {
|
|
811
|
+
const r2 = new Vr(e2, t2);
|
|
812
|
+
return "undefined" != typeof window && window.addEventListener("popstate", r2.reset), { name: "limitEvents", load: (e3) => (e3.addOnError(function() {
|
|
813
|
+
return r2.increment();
|
|
814
|
+
}), { reset: r2.reset }) };
|
|
815
|
+
})(15, 1e3), qr, Nr, Rr] }), Gr = (e2, t2) => {
|
|
816
|
+
try {
|
|
817
|
+
$r.leaveBreadcrumb(e2, t2);
|
|
818
|
+
} catch (e3) {
|
|
819
|
+
e3 instanceof Error ? Qr({ error: e3, severity: "error" }) : Qr({ error: new Error("Unknown error in logging.breadcrumb"), severity: "error", extraData: { originalError: e3 } });
|
|
820
|
+
}
|
|
821
|
+
}, Qr = async (e2) => {
|
|
822
|
+
try {
|
|
823
|
+
await $r.notify(e2.error, (t2) => (t2.severity = e2.severity, e2.groupingHash && (t2.groupingHash = e2.groupingHash), t2.metaData = { ...t2.metaData, custom: { ...e2.extraData, accessToken: "", environment: Ur } }, true)), e2.error, e2.error.message, e2.extraData, console.warn;
|
|
824
|
+
} catch (e3) {
|
|
825
|
+
e3 instanceof Error ? await Qr({ error: e3, severity: "error" }) : await Qr({ error: new Error("Unknown error in logging.notify"), severity: "error", extraData: { originalError: e3 } });
|
|
826
|
+
}
|
|
827
|
+
}, Xr = Yr.getPlugin("react"), Zr = Xr == null ? void 0 : Xr.BugsnagErrorBoundary, Jr = { POST: "POST" }, en = "include", tn = (e2, t2) => `${encodeURIComponent(e2)}=${encodeURIComponent(t2)}`, rn = ({ url: e2, params: t2 }) => {
|
|
828
|
+
let r2 = e2;
|
|
829
|
+
const n2 = ((e3) => null == e3 ? "" : Object.entries(e3).map(([e4, t3]) => {
|
|
830
|
+
let r3;
|
|
831
|
+
return r3 = Array.isArray(t3) ? t3.map((t4) => tn(e4, t4)).join("&") : tn(e4, t3), r3;
|
|
832
|
+
}).join("&"))(t2);
|
|
833
|
+
return "" !== n2 && (r2 += `?${n2}`), r2;
|
|
834
|
+
}, nn = ({ accessToken: e2, extraHeaders: t2 }) => {
|
|
835
|
+
const r2 = { Accept: "application/json", "Content-Type": "application/json", Authorization: `Bearer ${e2}` };
|
|
836
|
+
if (void 0 !== t2) {
|
|
837
|
+
return { ...o(t2, (e3) => `${e3}`), ...r2 };
|
|
838
|
+
}
|
|
839
|
+
return r2;
|
|
840
|
+
}, on = ({ extraHeaders: e2, authorization: t2 }) => {
|
|
841
|
+
const r2 = { ...e2 };
|
|
842
|
+
return void 0 !== t2 && (r2.Authorization = t2), r2;
|
|
843
|
+
}, an = async (e2) => {
|
|
844
|
+
const t2 = await e2.json();
|
|
845
|
+
return e2.ok ? t2 : Promise.reject(t2);
|
|
846
|
+
}, ln = (e2, t2) => (void 0 !== t2 && Object.entries(t2).forEach(([t3, r2]) => {
|
|
847
|
+
e2 = e2.replace(`{${t3}}`, r2);
|
|
848
|
+
}), e2), sn = (e2) => en, cn = { "hurdlr-cache-session": true, "hurdlr-auto-refresh-token": true };
|
|
849
|
+
function dn(e2) {
|
|
850
|
+
const t2 = nn({ accessToken: e2.accessToken, extraHeaders: { ...e2.extraHeaders, ...e2.pagination, ..."v5" === e2.endpointManager.apiVersion ? cn : {} } }), r2 = e2.endpointManager.getUrl(e2.path);
|
|
851
|
+
return { url: ln(r2, e2.pathParams), headers: t2 };
|
|
852
|
+
}
|
|
853
|
+
async function un({ authorization: e2, extraHeaders: t2, includeCredentials: r2, method: n2 = Jr.POST, params: o2, url: a2 }) {
|
|
854
|
+
const i2 = on({ extraHeaders: t2, authorization: e2 }), l2 = sn();
|
|
855
|
+
Gr("HTTP POST Request", { url: a2, accessToken: e2 });
|
|
856
|
+
try {
|
|
857
|
+
const e3 = await fetch(a2, { method: n2, headers: i2, credentials: l2, body: JSON.stringify(o2) });
|
|
858
|
+
return Gr("HTTP POST Response", { url: a2, status: e3.status, statusText: e3.statusText }), an(e3);
|
|
859
|
+
} catch (e3) {
|
|
860
|
+
return Promise.reject(e3);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
async function hn(e2) {
|
|
864
|
+
const { url: t2, headers: r2 } = dn(e2);
|
|
865
|
+
return un({ url: t2, params: e2.bodyParams, includeCredentials: true, extraHeaders: r2, method: e2.method });
|
|
866
|
+
}
|
|
867
|
+
async function gn(e2) {
|
|
868
|
+
return hn(e2);
|
|
869
|
+
}
|
|
870
|
+
async function pn(e2) {
|
|
871
|
+
return hn(e2);
|
|
872
|
+
}
|
|
873
|
+
const vn = (e2, t2) => ({ getUrl: (t3) => ((e3, t4) => {
|
|
874
|
+
let r2 = t4;
|
|
875
|
+
for (; r2.length > 0 && "/" === r2.charAt(0); ) r2 = r2.slice(1);
|
|
876
|
+
return `${e3}/${r2}`;
|
|
877
|
+
})(e2, t3), baseUrl: e2, apiVersion: t2 }), mn = { DEVELOPMENT: "https://dev.hurdlr.com/rest", PRODUCTION: "https://prod.hurdlr.com/rest", SANDBOX: "https://sandbox.hurdlr.com/rest", LOCAL: "http://localhost:8081/TraxAngular/rest" }, bn = { DEVELOPMENT: "https://dev.tight.com", PRODUCTION: "https://prod.tight.com", SANDBOX: "https://sandbox.tight.com", LOCAL: "http://localhost:8080" };
|
|
878
|
+
function fn(e2) {
|
|
879
|
+
return vn(`${function(e3) {
|
|
880
|
+
return mn[e3];
|
|
881
|
+
}(e2)}/v5`, "v5");
|
|
882
|
+
}
|
|
883
|
+
const yn = { of: ({ filter: e2, grouping: t2 }) => ["reports", "profitAndLoss", { filter: e2, ...t2 && { grouping: t2 } }] }, Tn = async (e2) => {
|
|
884
|
+
const t2 = e2.queryKey, r2 = t2[2], n2 = t2[3].accessToken, o2 = t2[3].environment, a2 = { path: "/reports/profitAndLoss", bodyParams: { exportType: "JSON", ...Wt(r2.filter), ...r2.grouping && { grouping: r2.grouping } }, method: "POST", accessToken: n2, endpointManager: fn(o2) };
|
|
885
|
+
return await pn(a2);
|
|
886
|
+
};
|
|
887
|
+
function xn({ filter: e2, grouping: t2, select: r2 }) {
|
|
888
|
+
return dr({ queryKey: yn.of({ filter: e2, grouping: t2 }), queryFn: Tn, select: r2 });
|
|
889
|
+
}
|
|
890
|
+
const wn = 0.03, kn = 3, Cn = { income: "income", expenses: "expenses", profit: "profit", loss: "loss", netIncome: "netIncome", noDataHeight: "noDataHeight" };
|
|
891
|
+
function Sn(e2) {
|
|
892
|
+
var _a2, _b2, _c2;
|
|
893
|
+
const t2 = function(e3) {
|
|
894
|
+
const t3 = Yt(e3 ?? "");
|
|
895
|
+
return null !== t3 ? Qt(t3, { abbreviateMonth: true, abbreviateYear: true }) : "";
|
|
896
|
+
}((_a2 = e2.period) == null ? void 0 : _a2.beginDate), r2 = e2.netIncome ?? 0, { profit: n2, remainingIncome: o2, loss: a2, remainingExpenses: i2 } = function(e3, t3, r3) {
|
|
897
|
+
const n3 = e3 > 0 ? e3 : 0, o3 = e3 < 0 ? e3 : 0;
|
|
898
|
+
return { profit: n3, remainingIncome: void 0 !== t3 ? M(t3).minus(n3).toNumber() : 0, loss: o3, remainingExpenses: void 0 !== r3 ? M(r3).plus(o3).toNumber() : 0 };
|
|
899
|
+
}(r2, (_b2 = e2.income) == null ? void 0 : _b2.total, (_c2 = e2.expenses) == null ? void 0 : _c2.total), l2 = /* @__PURE__ */ function(e3, t3, r3) {
|
|
900
|
+
return 0 === e3 && 0 === t3 && 0 === r3;
|
|
901
|
+
}(r2, o2, i2);
|
|
902
|
+
return { month: { month: t2, income: o2, expenses: -i2, profit: n2, loss: a2, netIncome: r2, hasNoData: l2 }, netIncome: r2 };
|
|
903
|
+
}
|
|
904
|
+
function En(e2) {
|
|
905
|
+
var _a2;
|
|
906
|
+
const t2 = { total: 0, domain: [], months: [], hasAnyData: false };
|
|
907
|
+
if ("FAILURE_NO_DATA" === e2.result) return t2;
|
|
908
|
+
const r2 = (_a2 = e2.json) == null ? void 0 : _a2.data;
|
|
909
|
+
if (Jt(r2)) return t2;
|
|
910
|
+
for (const e3 of r2) {
|
|
911
|
+
const { month: r3, netIncome: n3 } = Sn(e3);
|
|
912
|
+
t2.total = M(n3).plus(t2.total).toNumber(), t2.months.push(r3);
|
|
913
|
+
}
|
|
914
|
+
const { domainMin: n2, domainMax: o2 } = function(e3) {
|
|
915
|
+
return e3.reduce((e4, t3) => {
|
|
916
|
+
var _a3, _b2;
|
|
917
|
+
return { domainMin: Math.min(e4.domainMin, -(((_a3 = t3.expenses) == null ? void 0 : _a3.total) ?? 0)), domainMax: Math.max(e4.domainMax, ((_b2 = t3.income) == null ? void 0 : _b2.total) ?? 0) };
|
|
918
|
+
}, { domainMin: 0, domainMax: 0 });
|
|
919
|
+
}(r2);
|
|
920
|
+
t2.domain = [n2, o2], t2.hasAnyData = t2.months.some((e3) => !e3.hasNoData);
|
|
921
|
+
const a2 = function(e3, t3) {
|
|
922
|
+
const r3 = t3 - e3;
|
|
923
|
+
return r3 > 0 ? r3 * wn : kn;
|
|
924
|
+
}(n2, o2);
|
|
925
|
+
return t2.months = t2.months.map((e3) => e3.hasNoData ? { ...e3, noDataHeight: a2 } : e3), t2;
|
|
926
|
+
}
|
|
927
|
+
const In = { MONTHLY: "MONTHLY" }, Pn = kt(bt["tile-header"], ht({ backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid {colors.border.layout.strong}", borderTopRadius: "lg", display: "flex", justifyContent: "space-between", alignItems: "center", padding: "15px" }));
|
|
928
|
+
function An({ title: e2 }) {
|
|
929
|
+
return w("div", { ...Pn, children: w(Mt, { children: e2 }) });
|
|
930
|
+
}
|
|
931
|
+
const Dn = kt(bt["tile-body"], ht({ display: "flex", justifyContent: "start", alignItems: "start", flexDirection: "column", gap: "20px", height: "100%", padding: "20px 15px", backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid {colors.border.layout.strong}", borderBottomRadius: "lg", borderTop: "hidden" }));
|
|
932
|
+
function Mn({ children: e2 }) {
|
|
933
|
+
return w("div", { ...Dn, children: e2 });
|
|
934
|
+
}
|
|
935
|
+
const Nn = mt({ base: { display: "flex", flexDirection: "column", boxShadow: "box-shadow", transition: "height 0.5s, width 0.5s", position: "relative" }, variants: { type: { default: { width: "400px", flexShrink: 0, height: "300px" }, chart: { minWidth: "900px", maxWidth: "1440px", height: "481px" } }, isSample: { true: { pointerEvents: "none" }, false: {} } }, defaultVariants: { type: "default" } });
|
|
936
|
+
function Rn({ children: e2, type: t2, isSample: r2 = false }) {
|
|
937
|
+
const n2 = kt(bt.tile, Nn({ type: t2, isSample: r2 }));
|
|
938
|
+
return w("div", { ...n2, children: e2 });
|
|
939
|
+
}
|
|
940
|
+
const On = ht({ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }), Ln = ht.raw({ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }), Fn = ht({ fontSize: "sm", fontStyle: "normal", fontWeight: "sm", lineHeight: "12px", letterSpacing: "0.66px" }), _n = kt(bt.text, ht({ fontSize: "md", fontWeight: "sm", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), On);
|
|
941
|
+
function Wn({ children: e2 }) {
|
|
942
|
+
return w("div", { ..._n, children: e2 });
|
|
943
|
+
}
|
|
944
|
+
const Bn = kt(bt["metric-xl"], At({ metric: "xl" }));
|
|
945
|
+
function Hn(e2) {
|
|
946
|
+
return w("div", { ...Bn, children: e2.children });
|
|
947
|
+
}
|
|
948
|
+
const zn = kt(bt.summation, ht({ display: "flex", flexDirection: "column", flexShrink: 1, alignItems: "flex-start", justifyContent: "space-between" }));
|
|
949
|
+
function Vn({ title: e2, label: t2 }) {
|
|
950
|
+
return C("div", { ...zn, children: [w(Hn, { children: e2 }), w(Wn, { children: t2 })] });
|
|
951
|
+
}
|
|
952
|
+
const jn = kt(null, ht({ display: "flex", flexDirection: "column", justifyContent: "space-evenly", alignItems: "start", height: "100%", width: "100%" }));
|
|
953
|
+
function qn({ children: e2 }) {
|
|
954
|
+
return w("div", { ...jn, children: e2 });
|
|
955
|
+
}
|
|
956
|
+
const $n = (e2) => Math.sign(e2) * Math.floor(Math.abs(e2)), Un = (e2, t2 = 0) => {
|
|
957
|
+
const r2 = Math.abs(e2);
|
|
958
|
+
let n2;
|
|
959
|
+
if (t2 <= 0) n2 = Math.round(r2);
|
|
960
|
+
else {
|
|
961
|
+
const e3 = r2.toFixed(t2);
|
|
962
|
+
n2 = parseFloat(e3);
|
|
963
|
+
}
|
|
964
|
+
return Math.sign(e2) * n2;
|
|
965
|
+
}, Kn = (e2, t2 = 0, r2 = 2) => e2.toLocaleString(void 0, { useGrouping: true, minimumFractionDigits: t2, maximumFractionDigits: r2 }), Yn = 1e9, Gn = 1e6;
|
|
966
|
+
function Qn(e2, { cents: t2 = "default", condense: r2 = false, dollarSign: n2 = false, signage: o2 = "default" } = {}) {
|
|
967
|
+
const a2 = "string" == typeof e2 ? parseFloat(e2) : e2;
|
|
968
|
+
if (Number.isNaN(a2)) return "";
|
|
969
|
+
let i2;
|
|
970
|
+
const l2 = Math.abs(a2);
|
|
971
|
+
let s2;
|
|
972
|
+
if (r2 && l2 > 99999) {
|
|
973
|
+
s2 = Math.sign(a2) < 0;
|
|
974
|
+
const e3 = Math.floor((c2 = 1e3, d2 = l2, Math.log(d2) / Math.log(c2))) - 1, t3 = Math.pow(1e3, e3), r3 = Math.round(l2 / t3), n3 = r3 * t3;
|
|
975
|
+
let o3, u3 = r3 / 1e3;
|
|
976
|
+
l2 < Yn && u3 >= 1e3 && (u3 /= 1e3), n3 >= Yn ? o3 = "B" : n3 >= Gn ? o3 = "M" : (u3 = Math.round(u3), o3 = "K");
|
|
977
|
+
i2 = `${Kn(u3, 0, 1)}${o3}`;
|
|
978
|
+
} else {
|
|
979
|
+
let e3;
|
|
980
|
+
const r3 = 2, n3 = 0;
|
|
981
|
+
let o3, l3;
|
|
982
|
+
"floor" === t2 ? (o3 = n3, l3 = n3, e3 = $n(a2)) : "round" === t2 ? (o3 = n3, l3 = n3, e3 = Un(a2, o3)) : "always" === t2 ? (o3 = r3, l3 = r3, e3 = Un(a2, o3)) : "default" === t2 && Math.abs(a2) >= 1e3 ? (o3 = n3, l3 = n3, e3 = Un(a2, o3)) : (o3 = r3, e3 = Un(a2, o3), l3 = e3 % 1 == 0 ? n3 : r3), s2 = Math.sign(e3) < 0;
|
|
983
|
+
const c3 = Math.abs(e3);
|
|
984
|
+
i2 = Kn(c3, l3, o3);
|
|
985
|
+
}
|
|
986
|
+
var c2, d2;
|
|
987
|
+
let u2 = i2;
|
|
988
|
+
const h2 = n2 ? "$" : "";
|
|
989
|
+
if (void 0 === o2 || "off" === o2) u2 = i2;
|
|
990
|
+
else if ("parens" === o2) {
|
|
991
|
+
u2 = `${h2}${s2 ? `(${i2})` : i2}`;
|
|
992
|
+
} else if ("always" === o2) {
|
|
993
|
+
u2 = `${s2 ? "-" : "+"}${h2}${i2}`;
|
|
994
|
+
} else if ("default" === o2) {
|
|
995
|
+
u2 = `${s2 ? "-" : ""}${h2}${i2}`;
|
|
996
|
+
}
|
|
997
|
+
return u2;
|
|
998
|
+
}
|
|
999
|
+
function Xn(e2) {
|
|
1000
|
+
return Qn(e2, { condense: true, dollarSign: true });
|
|
1001
|
+
}
|
|
1002
|
+
const Zn = { "sm-sm": kt(bt.text, ht({ fontSize: "sm", fontWeight: "sm", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), On), "sm-med": kt(bt.text, ht({ fontSize: "sm", fontWeight: "md", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), On), "med-sm": kt(bt.text, ht({ fontSize: "md", fontWeight: "sm", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), On), "med-med": kt(bt.text, ht({ fontSize: "md", fontWeight: "md", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), On), "med-lg": kt(bt.text, ht({ fontSize: "md", fontWeight: "lg", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", maxWidth: "100%" }), On) };
|
|
1003
|
+
function Jn({ children: e2, size: t2, weight: r2, stylists: n2 = [] }) {
|
|
1004
|
+
const o2 = Pt([Zn[`${t2}-${r2}`], ...n2]);
|
|
1005
|
+
return w("div", { title: e2, ...o2, children: e2 });
|
|
1006
|
+
}
|
|
1007
|
+
const eo = kt(bt["strong-label"], At({ label: "strongLabel" }));
|
|
1008
|
+
function to({ children: e2, stylists: t2 = [] }) {
|
|
1009
|
+
return tr(e2) ? null : w(Jn, { size: "med", weight: "med", stylists: [eo, ...t2], children: e2 });
|
|
1010
|
+
}
|
|
1011
|
+
const ro = kt(bt["sub-label"], At({ label: "subLabel" }), ht({ fontStyle: "normal" }));
|
|
1012
|
+
function no({ children: e2, stylists: t2 = [] }) {
|
|
1013
|
+
return tr(e2) ? null : w(Jn, { size: "sm", weight: "sm", stylists: [ro, ...t2], children: e2 });
|
|
1014
|
+
}
|
|
1015
|
+
const oo = kt(null, ht({ display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", border: "1px solid {colors.border.layout}", borderRadius: "sm", backgroundColor: "surface.background", boxShadow: "box-shadow", padding: "10px", width: "fit-content", height: "fit-content" }));
|
|
1016
|
+
function ao({ active: e2, payload: t2 }) {
|
|
1017
|
+
if (t2.length <= 0 || !e2 || t2[0].dataKey === Cn.noDataHeight) return null;
|
|
1018
|
+
let r2 = t2[0].value ?? 0;
|
|
1019
|
+
return "expenses" === t2[0].dataKey ? r2 += t2[0].payload.loss : "income" === t2[0].dataKey && (r2 += t2[0].payload.profit), C("div", { ...oo, children: [w(to, { children: t2[0].name ?? "" }), w(no, { children: Xn(Number(r2)) })] });
|
|
1020
|
+
}
|
|
1021
|
+
const io = { "colors.white100": { value: "#FFFFFF", variable: "var(--Tight-colors-white100)" }, "colors.white200": { value: "#F9F9F9", variable: "var(--Tight-colors-white200)" }, "colors.white300": { value: "#EDEDED", variable: "var(--Tight-colors-white300)" }, "colors.white600": { value: "#E7E8E9", variable: "var(--Tight-colors-white600)" }, "colors.black100": { value: "#CED1D2", variable: "var(--Tight-colors-black100)" }, "colors.black400": { value: "#6F7576", variable: "var(--Tight-colors-black400)" }, "colors.black600": { value: "#50595C", variable: "var(--Tight-colors-black600)" }, "colors.black700": { value: "#182428", variable: "var(--Tight-colors-black700)" }, "colors.blue300": { value: "#DAF4FA", variable: "var(--Tight-colors-blue300)" }, "colors.blue400": { value: "#CAECF3", variable: "var(--Tight-colors-blue400)" }, "colors.blue500": { value: "#94D8E8", variable: "var(--Tight-colors-blue500)" }, "colors.blue700": { value: "#2AB2D1", variable: "var(--Tight-colors-blue700)" }, "colors.blue900": { value: "#177F96", variable: "var(--Tight-colors-blue900)" }, "colors.green300": { value: "#B8F3D5", variable: "var(--Tight-colors-green300)" }, "colors.green400": { value: "#94E8BD", variable: "var(--Tight-colors-green400)" }, "colors.green500": { value: "#5FDD9C", variable: "var(--Tight-colors-green500)" }, "colors.green700": { value: "#009C75", variable: "var(--Tight-colors-green700)" }, "colors.yellow300": { value: "#FFE787", variable: "var(--Tight-colors-yellow300)" }, "colors.yellow400": { value: "#FCD34D", variable: "var(--Tight-colors-yellow400)" }, "colors.yellow500": { value: "#FBBF24", variable: "var(--Tight-colors-yellow500)" }, "colors.red300": { value: "#FF9797", variable: "var(--Tight-colors-red300)" }, "colors.red400": { value: "#F45C5C", variable: "var(--Tight-colors-red400)" }, "colors.red500": { value: "#E84747", variable: "var(--Tight-colors-red500)" }, "colors.red700": { value: "#E42525", variable: "var(--Tight-colors-red700)" }, "fonts.base": { value: "Duplet Regular, sans-serif", variable: "var(--Tight-fonts-base)" }, "fontSizes.sm": { value: "11px", variable: "var(--Tight-fontSizes-sm)" }, "fontSizes.md": { value: "14px", variable: "var(--Tight-fontSizes-md)" }, "fontSizes.lg": { value: "20px", variable: "var(--Tight-fontSizes-lg)" }, "fontSizes.xl": { value: "36px", variable: "var(--Tight-fontSizes-xl)" }, "fontWeights.sm": { value: "400", variable: "var(--Tight-fontWeights-sm)" }, "fontWeights.md": { value: "600", variable: "var(--Tight-fontWeights-md)" }, "fontWeights.lg": { value: "900", variable: "var(--Tight-fontWeights-lg)" }, "radii.zero": { value: "0", variable: "var(--Tight-radii-zero)" }, "radii.sm": { value: "1px", variable: "var(--Tight-radii-sm)" }, "radii.md": { value: "2px", variable: "var(--Tight-radii-md)" }, "radii.lg": { value: "4px", variable: "var(--Tight-radii-lg)" }, "borderWidths.sm": { value: "0.5px", variable: "var(--Tight-borderWidths-sm)" }, "borderWidths.md": { value: "0.75px", variable: "var(--Tight-borderWidths-md)" }, "borderWidths.lg": { value: "1px", variable: "var(--Tight-borderWidths-lg)" }, "borderWidths.xl": { value: "2px", variable: "var(--Tight-borderWidths-xl)" }, "animations.appear.instant": { value: "0.25s linear fade-in", variable: "var(--Tight-animations-appear-instant)" }, "animations.appear.delay": { value: "0.25s linear both 1.5s fade-in", variable: "var(--Tight-animations-appear-delay)" }, "animations.shimmer": { value: "2s ease-in-out infinite shimmer", variable: "var(--Tight-animations-shimmer)" }, "shadows.box-shadow": { value: "0px 10px 30px 0px rgba(24, 36, 40, 0.10)", variable: "var(--Tight-shadows-box-shadow)" }, "breakpoints.sm": { value: "640px", variable: "var(--Tight-breakpoints-sm)" }, "breakpoints.md": { value: "850px", variable: "var(--Tight-breakpoints-md)" }, "breakpoints.lg": { value: "1024px", variable: "var(--Tight-breakpoints-lg)" }, "breakpoints.xl": { value: "1280px", variable: "var(--Tight-breakpoints-xl)" }, "breakpoints.1.5xl": { value: "1400px", variable: "var(--Tight-breakpoints-1.5xl)" }, "breakpoints.2xl": { value: "1536px", variable: "var(--Tight-breakpoints-2xl)" }, "sizes.breakpoint-sm": { value: "640px", variable: "var(--Tight-sizes-breakpoint-sm)" }, "sizes.breakpoint-md": { value: "850px", variable: "var(--Tight-sizes-breakpoint-md)" }, "sizes.breakpoint-lg": { value: "1024px", variable: "var(--Tight-sizes-breakpoint-lg)" }, "sizes.breakpoint-xl": { value: "1280px", variable: "var(--Tight-sizes-breakpoint-xl)" }, "sizes.breakpoint-1.5xl": { value: "1400px", variable: "var(--Tight-sizes-breakpoint-1.5xl)" }, "sizes.breakpoint-2xl": { value: "1536px", variable: "var(--Tight-sizes-breakpoint-2xl)" }, "colors.brand.primary.weak": { value: "var(--Tight-colors-black400)", variable: "var(--Tight-colors-brand-primary-weak)" }, "colors.brand.primary": { value: "var(--Tight-colors-black600)", variable: "var(--Tight-colors-brand-primary)" }, "colors.brand.primary.strong": { value: "var(--Tight-colors-black700)", variable: "var(--Tight-colors-brand-primary-strong)" }, "colors.brand.secondary.weak": { value: "var(--Tight-colors-white200)", variable: "var(--Tight-colors-brand-secondary-weak)" }, "colors.brand.secondary": { value: "var(--Tight-colors-white600)", variable: "var(--Tight-colors-brand-secondary)" }, "colors.brand.secondary.strong": { value: "var(--Tight-colors-black100)", variable: "var(--Tight-colors-brand-secondary-strong)" }, "colors.brand.action.weak": { value: "var(--Tight-colors-blue300)", variable: "var(--Tight-colors-brand-action-weak)" }, "colors.brand.action": { value: "var(--Tight-colors-blue400)", variable: "var(--Tight-colors-brand-action)" }, "colors.brand.action.strong": { value: "var(--Tight-colors-blue500)", variable: "var(--Tight-colors-brand-action-strong)" }, "colors.brand.action.stronger": { value: "var(--Tight-colors-blue700)", variable: "var(--Tight-colors-brand-action-stronger)" }, "colors.brand.action.strongest": { value: "var(--Tight-colors-blue900)", variable: "var(--Tight-colors-brand-action-strongest)" }, "colors.brand.success.weak": { value: "var(--Tight-colors-green300)", variable: "var(--Tight-colors-brand-success-weak)" }, "colors.brand.success": { value: "var(--Tight-colors-green400)", variable: "var(--Tight-colors-brand-success)" }, "colors.brand.success.strong": { value: "var(--Tight-colors-green500)", variable: "var(--Tight-colors-brand-success-strong)" }, "colors.brand.warning.weak": { value: "var(--Tight-colors-yellow300)", variable: "var(--Tight-colors-brand-warning-weak)" }, "colors.brand.warning": { value: "var(--Tight-colors-yellow400)", variable: "var(--Tight-colors-brand-warning)" }, "colors.brand.warning.strong": { value: "var(--Tight-colors-yellow500)", variable: "var(--Tight-colors-brand-warning-strong)" }, "colors.brand.danger.weak": { value: "var(--Tight-colors-red300)", variable: "var(--Tight-colors-brand-danger-weak)" }, "colors.brand.danger": { value: "var(--Tight-colors-red400)", variable: "var(--Tight-colors-brand-danger)" }, "colors.brand.danger.strong": { value: "var(--Tight-colors-red500)", variable: "var(--Tight-colors-brand-danger-strong)" }, "colors.surface.background": { value: "var(--Tight-colors-white200)", variable: "var(--Tight-colors-surface-background)" }, "colors.surface.background.hover": { value: "var(--Tight-colors-white300)", variable: "var(--Tight-colors-surface-background-hover)" }, "colors.surface.foreground": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-surface-foreground)" }, "colors.surface.foreground.hover": { value: "var(--Tight-colors-white200)", variable: "var(--Tight-colors-surface-foreground-hover)" }, "colors.surface.foreground.disabled": { value: "var(--Tight-colors-white600)", variable: "var(--Tight-colors-surface-foreground-disabled)" }, "colors.surface.elevated": { value: "var(--Tight-colors-white300)", variable: "var(--Tight-colors-surface-elevated)" }, "colors.surface.elevated.hover": { value: "var(--Tight-colors-white600)", variable: "var(--Tight-colors-surface-elevated-hover)" }, "colors.surface.intent.primary": { value: "var(--Tight-colors-brand-primary-weak)", variable: "var(--Tight-colors-surface-intent-primary)" }, "colors.surface.intent.primary.hover": { value: "var(--Tight-colors-brand-primary)", variable: "var(--Tight-colors-surface-intent-primary-hover)" }, "colors.surface.intent.primary.active": { value: "var(--Tight-colors-brand-primary-strong)", variable: "var(--Tight-colors-surface-intent-primary-active)" }, "colors.surface.intent.primary.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-primary-disabled)" }, "colors.surface.intent.secondary": { value: "var(--Tight-colors-brand-secondary-weak)", variable: "var(--Tight-colors-surface-intent-secondary)" }, "colors.surface.intent.secondary.hover": { value: "var(--Tight-colors-brand-secondary)", variable: "var(--Tight-colors-surface-intent-secondary-hover)" }, "colors.surface.intent.secondary.active": { value: "var(--Tight-colors-brand-secondary-strong)", variable: "var(--Tight-colors-surface-intent-secondary-active)" }, "colors.surface.intent.secondary.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-secondary-disabled)" }, "colors.surface.intent.action": { value: "var(--Tight-colors-brand-action-weak)", variable: "var(--Tight-colors-surface-intent-action)" }, "colors.surface.intent.action.hover": { value: "var(--Tight-colors-brand-action)", variable: "var(--Tight-colors-surface-intent-action-hover)" }, "colors.surface.intent.action.active": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-surface-intent-action-active)" }, "colors.surface.intent.action.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-action-disabled)" }, "colors.surface.intent.action.discrete": { value: "transparent", variable: "var(--Tight-colors-surface-intent-action-discrete)" }, "colors.surface.intent.action.discrete.hover": { value: "var(--Tight-colors-brand-action-weak)", variable: "var(--Tight-colors-surface-intent-action-discrete-hover)" }, "colors.surface.intent.action.discrete.active": { value: "var(--Tight-colors-brand-action)", variable: "var(--Tight-colors-surface-intent-action-discrete-active)" }, "colors.surface.intent.success": { value: "var(--Tight-colors-brand-success-weak)", variable: "var(--Tight-colors-surface-intent-success)" }, "colors.surface.intent.success.hover": { value: "var(--Tight-colors-brand-success)", variable: "var(--Tight-colors-surface-intent-success-hover)" }, "colors.surface.intent.success.active": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-surface-intent-success-active)" }, "colors.surface.intent.success.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-success-disabled)" }, "colors.surface.intent.warning": { value: "var(--Tight-colors-brand-warning-weak)", variable: "var(--Tight-colors-surface-intent-warning)" }, "colors.surface.intent.warning.hover": { value: "var(--Tight-colors-brand-warning)", variable: "var(--Tight-colors-surface-intent-warning-hover)" }, "colors.surface.intent.warning.active": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-surface-intent-warning-active)" }, "colors.surface.intent.warning.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-warning-disabled)" }, "colors.surface.intent.danger": { value: "var(--Tight-colors-brand-danger-weak)", variable: "var(--Tight-colors-surface-intent-danger)" }, "colors.surface.intent.danger.hover": { value: "var(--Tight-colors-brand-danger)", variable: "var(--Tight-colors-surface-intent-danger-hover)" }, "colors.surface.intent.danger.active": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-surface-intent-danger-active)" }, "colors.surface.intent.danger.disabled": { value: "var(--Tight-colors-surface-foreground-disabled)", variable: "var(--Tight-colors-surface-intent-danger-disabled)" }, "colors.typography.base": { value: "var(--Tight-colors-black700)", variable: "var(--Tight-colors-typography-base)" }, "colors.typography.base.weak": { value: "var(--Tight-colors-black400)", variable: "var(--Tight-colors-typography-base-weak)" }, "colors.typography.contrast": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-typography-contrast)" }, "colors.typography.contrast.weak": { value: "var(--Tight-colors-black100)", variable: "var(--Tight-colors-typography-contrast-weak)" }, "colors.typography.intent.primary": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-typography-intent-primary)" }, "colors.typography.intent.primary.hover": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-typography-intent-primary-hover)" }, "colors.typography.intent.primary.active": { value: "var(--Tight-colors-white100)", variable: "var(--Tight-colors-typography-intent-primary-active)" }, "colors.typography.intent.secondary": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-secondary)" }, "colors.typography.intent.secondary.hover": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-secondary-hover)" }, "colors.typography.intent.secondary.active": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-secondary-active)" }, "colors.typography.intent.action": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-action)" }, "colors.typography.intent.action.hover": { value: "var(--Tight-colors-brand-action)", variable: "var(--Tight-colors-typography-intent-action-hover)" }, "colors.typography.intent.action.active": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-typography-intent-action-active)" }, "colors.typography.intent.success": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-success)" }, "colors.typography.intent.success.hover": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-success-hover)" }, "colors.typography.intent.success.active": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-success-active)" }, "colors.typography.intent.warning": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-warning)" }, "colors.typography.intent.warning.hover": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-warning-hover)" }, "colors.typography.intent.warning.active": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-warning-active)" }, "colors.typography.intent.danger": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-danger)" }, "colors.typography.intent.danger.hover": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-danger-hover)" }, "colors.typography.intent.danger.active": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-intent-danger-active)" }, "colors.typography.accent.success": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-typography-accent-success)" }, "colors.typography.accent.warning": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-typography-accent-warning)" }, "colors.typography.accent.danger": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-typography-accent-danger)" }, "colors.typography.body": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-body)" }, "colors.typography.label": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-label)" }, "colors.typography.label.sub": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-label-sub)" }, "colors.typography.label.strong": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-label-strong)" }, "colors.typography.label.strongSub": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-label-strongSub)" }, "colors.typography.heading": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-heading)" }, "colors.typography.metric.sm": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-metric-sm)" }, "colors.typography.metric.md": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-metric-md)" }, "colors.typography.metric.lg": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-metric-lg)" }, "colors.typography.metric.xl": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-typography-metric-xl)" }, "colors.icon.base": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-icon-base)" }, "colors.icon.base.weak": { value: "var(--Tight-colors-typography-base-weak)", variable: "var(--Tight-colors-icon-base-weak)" }, "colors.icon.contrast": { value: "var(--Tight-colors-typography-contrast)", variable: "var(--Tight-colors-icon-contrast)" }, "colors.icon.contrast.weak": { value: "var(--Tight-colors-typography-contrast-weak)", variable: "var(--Tight-colors-icon-contrast-weak)" }, "colors.icon.intent.primary": { value: "var(--Tight-colors-typography-intent-primary)", variable: "var(--Tight-colors-icon-intent-primary)" }, "colors.icon.intent.primary.hover": { value: "var(--Tight-colors-typography-intent-primary-hover)", variable: "var(--Tight-colors-icon-intent-primary-hover)" }, "colors.icon.intent.primary.active": { value: "var(--Tight-colors-typography-intent-primary-active)", variable: "var(--Tight-colors-icon-intent-primary-active)" }, "colors.icon.intent.secondary": { value: "var(--Tight-colors-typography-intent-secondary)", variable: "var(--Tight-colors-icon-intent-secondary)" }, "colors.icon.intent.secondary.hover": { value: "var(--Tight-colors-typography-intent-secondary-hover)", variable: "var(--Tight-colors-icon-intent-secondary-hover)" }, "colors.icon.intent.secondary.active": { value: "var(--Tight-colors-typography-intent-secondary-active)", variable: "var(--Tight-colors-icon-intent-secondary-active)" }, "colors.icon.intent.action": { value: "var(--Tight-colors-typography-intent-action)", variable: "var(--Tight-colors-icon-intent-action)" }, "colors.icon.intent.action.hover": { value: "var(--Tight-colors-typography-intent-action-hover)", variable: "var(--Tight-colors-icon-intent-action-hover)" }, "colors.icon.intent.action.active": { value: "var(--Tight-colors-typography-intent-action-active)", variable: "var(--Tight-colors-icon-intent-action-active)" }, "colors.icon.intent.success": { value: "var(--Tight-colors-typography-intent-success)", variable: "var(--Tight-colors-icon-intent-success)" }, "colors.icon.intent.success.hover": { value: "var(--Tight-colors-typography-intent-success-hover)", variable: "var(--Tight-colors-icon-intent-success-hover)" }, "colors.icon.intent.success.active": { value: "var(--Tight-colors-typography-intent-success-active)", variable: "var(--Tight-colors-icon-intent-success-active)" }, "colors.icon.intent.warning": { value: "var(--Tight-colors-typography-intent-warning)", variable: "var(--Tight-colors-icon-intent-warning)" }, "colors.icon.intent.warning.hover": { value: "var(--Tight-colors-typography-intent-warning-hover)", variable: "var(--Tight-colors-icon-intent-warning-hover)" }, "colors.icon.intent.warning.active": { value: "var(--Tight-colors-typography-intent-warning-active)", variable: "var(--Tight-colors-icon-intent-warning-active)" }, "colors.icon.intent.danger": { value: "var(--Tight-colors-typography-intent-danger)", variable: "var(--Tight-colors-icon-intent-danger)" }, "colors.icon.intent.danger.hover": { value: "var(--Tight-colors-typography-intent-danger-hover)", variable: "var(--Tight-colors-icon-intent-danger-hover)" }, "colors.icon.intent.danger.active": { value: "var(--Tight-colors-typography-intent-danger-active)", variable: "var(--Tight-colors-icon-intent-danger-active)" }, "colors.icon.accent.success": { value: "var(--Tight-colors-typography-accent-success)", variable: "var(--Tight-colors-icon-accent-success)" }, "colors.icon.accent.warning": { value: "var(--Tight-colors-typography-accent-warning)", variable: "var(--Tight-colors-icon-accent-warning)" }, "colors.icon.accent.danger": { value: "var(--Tight-colors-typography-accent-danger)", variable: "var(--Tight-colors-icon-accent-danger)" }, "colors.border.layout.weak": { value: "var(--Tight-colors-white300)", variable: "var(--Tight-colors-border-layout-weak)" }, "colors.border.layout": { value: "var(--Tight-colors-black100)", variable: "var(--Tight-colors-border-layout)" }, "colors.border.layout.strong": { value: "var(--Tight-colors-black600)", variable: "var(--Tight-colors-border-layout-strong)" }, "colors.border.intent.primary.hover": { value: "var(--Tight-colors-brand-primary-strong)", variable: "var(--Tight-colors-border-intent-primary-hover)" }, "colors.border.intent.primary": { value: "var(--Tight-colors-brand-primary-strong)", variable: "var(--Tight-colors-border-intent-primary)" }, "colors.border.intent.primary.active": { value: "var(--Tight-colors-brand-primary-strong)", variable: "var(--Tight-colors-border-intent-primary-active)" }, "colors.border.intent.primary.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-primary-disabled)" }, "colors.border.intent.secondary.hover": { value: "var(--Tight-colors-brand-secondary-strong)", variable: "var(--Tight-colors-border-intent-secondary-hover)" }, "colors.border.intent.secondary": { value: "var(--Tight-colors-brand-secondary-strong)", variable: "var(--Tight-colors-border-intent-secondary)" }, "colors.border.intent.secondary.active": { value: "var(--Tight-colors-brand-secondary-strong)", variable: "var(--Tight-colors-border-intent-secondary-active)" }, "colors.border.intent.secondary.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-secondary-disabled)" }, "colors.border.intent.danger.hover": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-border-intent-danger-hover)" }, "colors.border.intent.danger": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-border-intent-danger)" }, "colors.border.intent.danger.active": { value: "var(--Tight-colors-brand-danger-strong)", variable: "var(--Tight-colors-border-intent-danger-active)" }, "colors.border.intent.danger.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-danger-disabled)" }, "colors.border.intent.warning.hover": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-border-intent-warning-hover)" }, "colors.border.intent.warning": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-border-intent-warning)" }, "colors.border.intent.warning.active": { value: "var(--Tight-colors-brand-warning-strong)", variable: "var(--Tight-colors-border-intent-warning-active)" }, "colors.border.intent.warning.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-warning-disabled)" }, "colors.border.intent.success.hover": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-border-intent-success-hover)" }, "colors.border.intent.success": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-border-intent-success)" }, "colors.border.intent.success.active": { value: "var(--Tight-colors-brand-success-strong)", variable: "var(--Tight-colors-border-intent-success-active)" }, "colors.border.intent.success.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-success-disabled)" }, "colors.border.intent.action.hover": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-border-intent-action-hover)" }, "colors.border.intent.action": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-border-intent-action)" }, "colors.border.intent.action.active": { value: "var(--Tight-colors-brand-action-strong)", variable: "var(--Tight-colors-border-intent-action-active)" }, "colors.border.intent.action.disabled": { value: "var(--Tight-colors-border-layout)", variable: "var(--Tight-colors-border-intent-action-disabled)" }, "colors.money": { value: "var(--Tight-colors-typography-base)", variable: "var(--Tight-colors-money)" }, "colors.money.positive": { value: "var(--Tight-colors-green700)", variable: "var(--Tight-colors-money-positive)" }, "colors.money.positive.weak": { value: "var(--Tight-colors-green500)", variable: "var(--Tight-colors-money-positive-weak)" }, "colors.money.negative": { value: "var(--Tight-colors-red700)", variable: "var(--Tight-colors-money-negative)" }, "colors.money.negative.weak": { value: "var(--Tight-colors-red300)", variable: "var(--Tight-colors-money-negative-weak)" }, "colors.overlay": { value: "rgba(0, 0, 0, 0.5)", variable: "var(--Tight-colors-overlay)" }, "colors.transparent": { value: "transparent", variable: "var(--Tight-colors-transparent)" }, "colors.none": { value: "none", variable: "var(--Tight-colors-none)" }, "colors.inherit": { value: "inherit", variable: "var(--Tight-colors-inherit)" }, "colors.currentColor": { value: "currentColor", variable: "var(--Tight-colors-currentColor)" }, "fonts.body": { value: "var(--Tight-fonts-base)", variable: "var(--Tight-fonts-body)" }, "fonts.label": { value: "var(--Tight-fonts-base)", variable: "var(--Tight-fonts-label)" }, "fonts.heading": { value: "var(--Tight-fonts-base)", variable: "var(--Tight-fonts-heading)" }, "fonts.metric": { value: "var(--Tight-fonts-base)", variable: "var(--Tight-fonts-metric)" }, "fontWeights.global": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-global)" }, "fontWeights.body": { value: "var(--Tight-fontWeights-md)", variable: "var(--Tight-fontWeights-body)" }, "fontWeights.label": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-label)" }, "fontWeights.label.strong": { value: "var(--Tight-fontWeights-md)", variable: "var(--Tight-fontWeights-label-strong)" }, "fontWeights.label.sub": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-label-sub)" }, "fontWeights.label.strongSub": { value: "var(--Tight-fontWeights-md)", variable: "var(--Tight-fontWeights-label-strongSub)" }, "fontWeights.heading": { value: "var(--Tight-fontWeights-md)", variable: "var(--Tight-fontWeights-heading)" }, "fontWeights.title": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-title)" }, "fontWeights.metric.sm": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-metric-sm)" }, "fontWeights.metric.md": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-metric-md)" }, "fontWeights.metric.lg": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-metric-lg)" }, "fontWeights.metric.xl": { value: "var(--Tight-fontWeights-sm)", variable: "var(--Tight-fontWeights-metric-xl)" }, "fontSizes.title": { value: "var(--Tight-fontSizes-xl)", variable: "var(--Tight-fontSizes-title)" }, "fontSizes.body": { value: "var(--Tight-fontSizes-md)", variable: "var(--Tight-fontSizes-body)" }, "fontSizes.label": { value: "var(--Tight-fontSizes-md)", variable: "var(--Tight-fontSizes-label)" }, "fontSizes.label.strong": { value: "var(--Tight-fontSizes-md)", variable: "var(--Tight-fontSizes-label-strong)" }, "fontSizes.label.sub": { value: "var(--Tight-fontSizes-sm)", variable: "var(--Tight-fontSizes-label-sub)" }, "fontSizes.label.strongSub": { value: "var(--Tight-fontSizes-sm)", variable: "var(--Tight-fontSizes-label-strongSub)" }, "fontSizes.heading": { value: "var(--Tight-fontSizes-lg)", variable: "var(--Tight-fontSizes-heading)" }, "fontSizes.metric.sm": { value: "var(--Tight-fontSizes-sm)", variable: "var(--Tight-fontSizes-metric-sm)" }, "fontSizes.metric.md": { value: "var(--Tight-fontSizes-md)", variable: "var(--Tight-fontSizes-metric-md)" }, "fontSizes.metric.lg": { value: "var(--Tight-fontSizes-lg)", variable: "var(--Tight-fontSizes-metric-lg)" }, "fontSizes.metric.xl": { value: "var(--Tight-fontSizes-xl)", variable: "var(--Tight-fontSizes-metric-xl)" }, "colors.colorPalette": { value: "var(--Tight-colors-colorPalette)", variable: "var(--Tight-colors-colorPalette)" }, "colors.colorPalette.primary.weak": { value: "var(--Tight-colors-colorPalette-primary-weak)", variable: "var(--Tight-colors-colorPalette-primary-weak)" }, "colors.colorPalette.weak": { value: "var(--Tight-colors-colorPalette-weak)", variable: "var(--Tight-colors-colorPalette-weak)" }, "colors.colorPalette.primary": { value: "var(--Tight-colors-colorPalette-primary)", variable: "var(--Tight-colors-colorPalette-primary)" }, "colors.colorPalette.primary.strong": { value: "var(--Tight-colors-colorPalette-primary-strong)", variable: "var(--Tight-colors-colorPalette-primary-strong)" }, "colors.colorPalette.strong": { value: "var(--Tight-colors-colorPalette-strong)", variable: "var(--Tight-colors-colorPalette-strong)" }, "colors.colorPalette.secondary.weak": { value: "var(--Tight-colors-colorPalette-secondary-weak)", variable: "var(--Tight-colors-colorPalette-secondary-weak)" }, "colors.colorPalette.secondary": { value: "var(--Tight-colors-colorPalette-secondary)", variable: "var(--Tight-colors-colorPalette-secondary)" }, "colors.colorPalette.secondary.strong": { value: "var(--Tight-colors-colorPalette-secondary-strong)", variable: "var(--Tight-colors-colorPalette-secondary-strong)" }, "colors.colorPalette.action.weak": { value: "var(--Tight-colors-colorPalette-action-weak)", variable: "var(--Tight-colors-colorPalette-action-weak)" }, "colors.colorPalette.action": { value: "var(--Tight-colors-colorPalette-action)", variable: "var(--Tight-colors-colorPalette-action)" }, "colors.colorPalette.action.strong": { value: "var(--Tight-colors-colorPalette-action-strong)", variable: "var(--Tight-colors-colorPalette-action-strong)" }, "colors.colorPalette.action.stronger": { value: "var(--Tight-colors-colorPalette-action-stronger)", variable: "var(--Tight-colors-colorPalette-action-stronger)" }, "colors.colorPalette.stronger": { value: "var(--Tight-colors-colorPalette-stronger)", variable: "var(--Tight-colors-colorPalette-stronger)" }, "colors.colorPalette.action.strongest": { value: "var(--Tight-colors-colorPalette-action-strongest)", variable: "var(--Tight-colors-colorPalette-action-strongest)" }, "colors.colorPalette.strongest": { value: "var(--Tight-colors-colorPalette-strongest)", variable: "var(--Tight-colors-colorPalette-strongest)" }, "colors.colorPalette.success.weak": { value: "var(--Tight-colors-colorPalette-success-weak)", variable: "var(--Tight-colors-colorPalette-success-weak)" }, "colors.colorPalette.success": { value: "var(--Tight-colors-colorPalette-success)", variable: "var(--Tight-colors-colorPalette-success)" }, "colors.colorPalette.success.strong": { value: "var(--Tight-colors-colorPalette-success-strong)", variable: "var(--Tight-colors-colorPalette-success-strong)" }, "colors.colorPalette.warning.weak": { value: "var(--Tight-colors-colorPalette-warning-weak)", variable: "var(--Tight-colors-colorPalette-warning-weak)" }, "colors.colorPalette.warning": { value: "var(--Tight-colors-colorPalette-warning)", variable: "var(--Tight-colors-colorPalette-warning)" }, "colors.colorPalette.warning.strong": { value: "var(--Tight-colors-colorPalette-warning-strong)", variable: "var(--Tight-colors-colorPalette-warning-strong)" }, "colors.colorPalette.danger.weak": { value: "var(--Tight-colors-colorPalette-danger-weak)", variable: "var(--Tight-colors-colorPalette-danger-weak)" }, "colors.colorPalette.danger": { value: "var(--Tight-colors-colorPalette-danger)", variable: "var(--Tight-colors-colorPalette-danger)" }, "colors.colorPalette.danger.strong": { value: "var(--Tight-colors-colorPalette-danger-strong)", variable: "var(--Tight-colors-colorPalette-danger-strong)" }, "colors.colorPalette.background": { value: "var(--Tight-colors-colorPalette-background)", variable: "var(--Tight-colors-colorPalette-background)" }, "colors.colorPalette.background.hover": { value: "var(--Tight-colors-colorPalette-background-hover)", variable: "var(--Tight-colors-colorPalette-background-hover)" }, "colors.colorPalette.hover": { value: "var(--Tight-colors-colorPalette-hover)", variable: "var(--Tight-colors-colorPalette-hover)" }, "colors.colorPalette.foreground": { value: "var(--Tight-colors-colorPalette-foreground)", variable: "var(--Tight-colors-colorPalette-foreground)" }, "colors.colorPalette.foreground.hover": { value: "var(--Tight-colors-colorPalette-foreground-hover)", variable: "var(--Tight-colors-colorPalette-foreground-hover)" }, "colors.colorPalette.foreground.disabled": { value: "var(--Tight-colors-colorPalette-foreground-disabled)", variable: "var(--Tight-colors-colorPalette-foreground-disabled)" }, "colors.colorPalette.disabled": { value: "var(--Tight-colors-colorPalette-disabled)", variable: "var(--Tight-colors-colorPalette-disabled)" }, "colors.colorPalette.elevated": { value: "var(--Tight-colors-colorPalette-elevated)", variable: "var(--Tight-colors-colorPalette-elevated)" }, "colors.colorPalette.elevated.hover": { value: "var(--Tight-colors-colorPalette-elevated-hover)", variable: "var(--Tight-colors-colorPalette-elevated-hover)" }, "colors.colorPalette.intent.primary": { value: "var(--Tight-colors-colorPalette-intent-primary)", variable: "var(--Tight-colors-colorPalette-intent-primary)" }, "colors.colorPalette.intent.primary.hover": { value: "var(--Tight-colors-colorPalette-intent-primary-hover)", variable: "var(--Tight-colors-colorPalette-intent-primary-hover)" }, "colors.colorPalette.primary.hover": { value: "var(--Tight-colors-colorPalette-primary-hover)", variable: "var(--Tight-colors-colorPalette-primary-hover)" }, "colors.colorPalette.intent.primary.active": { value: "var(--Tight-colors-colorPalette-intent-primary-active)", variable: "var(--Tight-colors-colorPalette-intent-primary-active)" }, "colors.colorPalette.primary.active": { value: "var(--Tight-colors-colorPalette-primary-active)", variable: "var(--Tight-colors-colorPalette-primary-active)" }, "colors.colorPalette.active": { value: "var(--Tight-colors-colorPalette-active)", variable: "var(--Tight-colors-colorPalette-active)" }, "colors.colorPalette.intent.primary.disabled": { value: "var(--Tight-colors-colorPalette-intent-primary-disabled)", variable: "var(--Tight-colors-colorPalette-intent-primary-disabled)" }, "colors.colorPalette.primary.disabled": { value: "var(--Tight-colors-colorPalette-primary-disabled)", variable: "var(--Tight-colors-colorPalette-primary-disabled)" }, "colors.colorPalette.intent.secondary": { value: "var(--Tight-colors-colorPalette-intent-secondary)", variable: "var(--Tight-colors-colorPalette-intent-secondary)" }, "colors.colorPalette.intent.secondary.hover": { value: "var(--Tight-colors-colorPalette-intent-secondary-hover)", variable: "var(--Tight-colors-colorPalette-intent-secondary-hover)" }, "colors.colorPalette.secondary.hover": { value: "var(--Tight-colors-colorPalette-secondary-hover)", variable: "var(--Tight-colors-colorPalette-secondary-hover)" }, "colors.colorPalette.intent.secondary.active": { value: "var(--Tight-colors-colorPalette-intent-secondary-active)", variable: "var(--Tight-colors-colorPalette-intent-secondary-active)" }, "colors.colorPalette.secondary.active": { value: "var(--Tight-colors-colorPalette-secondary-active)", variable: "var(--Tight-colors-colorPalette-secondary-active)" }, "colors.colorPalette.intent.secondary.disabled": { value: "var(--Tight-colors-colorPalette-intent-secondary-disabled)", variable: "var(--Tight-colors-colorPalette-intent-secondary-disabled)" }, "colors.colorPalette.secondary.disabled": { value: "var(--Tight-colors-colorPalette-secondary-disabled)", variable: "var(--Tight-colors-colorPalette-secondary-disabled)" }, "colors.colorPalette.intent.action": { value: "var(--Tight-colors-colorPalette-intent-action)", variable: "var(--Tight-colors-colorPalette-intent-action)" }, "colors.colorPalette.intent.action.hover": { value: "var(--Tight-colors-colorPalette-intent-action-hover)", variable: "var(--Tight-colors-colorPalette-intent-action-hover)" }, "colors.colorPalette.action.hover": { value: "var(--Tight-colors-colorPalette-action-hover)", variable: "var(--Tight-colors-colorPalette-action-hover)" }, "colors.colorPalette.intent.action.active": { value: "var(--Tight-colors-colorPalette-intent-action-active)", variable: "var(--Tight-colors-colorPalette-intent-action-active)" }, "colors.colorPalette.action.active": { value: "var(--Tight-colors-colorPalette-action-active)", variable: "var(--Tight-colors-colorPalette-action-active)" }, "colors.colorPalette.intent.action.disabled": { value: "var(--Tight-colors-colorPalette-intent-action-disabled)", variable: "var(--Tight-colors-colorPalette-intent-action-disabled)" }, "colors.colorPalette.action.disabled": { value: "var(--Tight-colors-colorPalette-action-disabled)", variable: "var(--Tight-colors-colorPalette-action-disabled)" }, "colors.colorPalette.intent.action.discrete": { value: "var(--Tight-colors-colorPalette-intent-action-discrete)", variable: "var(--Tight-colors-colorPalette-intent-action-discrete)" }, "colors.colorPalette.action.discrete": { value: "var(--Tight-colors-colorPalette-action-discrete)", variable: "var(--Tight-colors-colorPalette-action-discrete)" }, "colors.colorPalette.discrete": { value: "var(--Tight-colors-colorPalette-discrete)", variable: "var(--Tight-colors-colorPalette-discrete)" }, "colors.colorPalette.intent.action.discrete.hover": { value: "var(--Tight-colors-colorPalette-intent-action-discrete-hover)", variable: "var(--Tight-colors-colorPalette-intent-action-discrete-hover)" }, "colors.colorPalette.action.discrete.hover": { value: "var(--Tight-colors-colorPalette-action-discrete-hover)", variable: "var(--Tight-colors-colorPalette-action-discrete-hover)" }, "colors.colorPalette.discrete.hover": { value: "var(--Tight-colors-colorPalette-discrete-hover)", variable: "var(--Tight-colors-colorPalette-discrete-hover)" }, "colors.colorPalette.intent.action.discrete.active": { value: "var(--Tight-colors-colorPalette-intent-action-discrete-active)", variable: "var(--Tight-colors-colorPalette-intent-action-discrete-active)" }, "colors.colorPalette.action.discrete.active": { value: "var(--Tight-colors-colorPalette-action-discrete-active)", variable: "var(--Tight-colors-colorPalette-action-discrete-active)" }, "colors.colorPalette.discrete.active": { value: "var(--Tight-colors-colorPalette-discrete-active)", variable: "var(--Tight-colors-colorPalette-discrete-active)" }, "colors.colorPalette.intent.success": { value: "var(--Tight-colors-colorPalette-intent-success)", variable: "var(--Tight-colors-colorPalette-intent-success)" }, "colors.colorPalette.intent.success.hover": { value: "var(--Tight-colors-colorPalette-intent-success-hover)", variable: "var(--Tight-colors-colorPalette-intent-success-hover)" }, "colors.colorPalette.success.hover": { value: "var(--Tight-colors-colorPalette-success-hover)", variable: "var(--Tight-colors-colorPalette-success-hover)" }, "colors.colorPalette.intent.success.active": { value: "var(--Tight-colors-colorPalette-intent-success-active)", variable: "var(--Tight-colors-colorPalette-intent-success-active)" }, "colors.colorPalette.success.active": { value: "var(--Tight-colors-colorPalette-success-active)", variable: "var(--Tight-colors-colorPalette-success-active)" }, "colors.colorPalette.intent.success.disabled": { value: "var(--Tight-colors-colorPalette-intent-success-disabled)", variable: "var(--Tight-colors-colorPalette-intent-success-disabled)" }, "colors.colorPalette.success.disabled": { value: "var(--Tight-colors-colorPalette-success-disabled)", variable: "var(--Tight-colors-colorPalette-success-disabled)" }, "colors.colorPalette.intent.warning": { value: "var(--Tight-colors-colorPalette-intent-warning)", variable: "var(--Tight-colors-colorPalette-intent-warning)" }, "colors.colorPalette.intent.warning.hover": { value: "var(--Tight-colors-colorPalette-intent-warning-hover)", variable: "var(--Tight-colors-colorPalette-intent-warning-hover)" }, "colors.colorPalette.warning.hover": { value: "var(--Tight-colors-colorPalette-warning-hover)", variable: "var(--Tight-colors-colorPalette-warning-hover)" }, "colors.colorPalette.intent.warning.active": { value: "var(--Tight-colors-colorPalette-intent-warning-active)", variable: "var(--Tight-colors-colorPalette-intent-warning-active)" }, "colors.colorPalette.warning.active": { value: "var(--Tight-colors-colorPalette-warning-active)", variable: "var(--Tight-colors-colorPalette-warning-active)" }, "colors.colorPalette.intent.warning.disabled": { value: "var(--Tight-colors-colorPalette-intent-warning-disabled)", variable: "var(--Tight-colors-colorPalette-intent-warning-disabled)" }, "colors.colorPalette.warning.disabled": { value: "var(--Tight-colors-colorPalette-warning-disabled)", variable: "var(--Tight-colors-colorPalette-warning-disabled)" }, "colors.colorPalette.intent.danger": { value: "var(--Tight-colors-colorPalette-intent-danger)", variable: "var(--Tight-colors-colorPalette-intent-danger)" }, "colors.colorPalette.intent.danger.hover": { value: "var(--Tight-colors-colorPalette-intent-danger-hover)", variable: "var(--Tight-colors-colorPalette-intent-danger-hover)" }, "colors.colorPalette.danger.hover": { value: "var(--Tight-colors-colorPalette-danger-hover)", variable: "var(--Tight-colors-colorPalette-danger-hover)" }, "colors.colorPalette.intent.danger.active": { value: "var(--Tight-colors-colorPalette-intent-danger-active)", variable: "var(--Tight-colors-colorPalette-intent-danger-active)" }, "colors.colorPalette.danger.active": { value: "var(--Tight-colors-colorPalette-danger-active)", variable: "var(--Tight-colors-colorPalette-danger-active)" }, "colors.colorPalette.intent.danger.disabled": { value: "var(--Tight-colors-colorPalette-intent-danger-disabled)", variable: "var(--Tight-colors-colorPalette-intent-danger-disabled)" }, "colors.colorPalette.danger.disabled": { value: "var(--Tight-colors-colorPalette-danger-disabled)", variable: "var(--Tight-colors-colorPalette-danger-disabled)" }, "colors.colorPalette.base": { value: "var(--Tight-colors-colorPalette-base)", variable: "var(--Tight-colors-colorPalette-base)" }, "colors.colorPalette.base.weak": { value: "var(--Tight-colors-colorPalette-base-weak)", variable: "var(--Tight-colors-colorPalette-base-weak)" }, "colors.colorPalette.contrast": { value: "var(--Tight-colors-colorPalette-contrast)", variable: "var(--Tight-colors-colorPalette-contrast)" }, "colors.colorPalette.contrast.weak": { value: "var(--Tight-colors-colorPalette-contrast-weak)", variable: "var(--Tight-colors-colorPalette-contrast-weak)" }, "colors.colorPalette.accent.success": { value: "var(--Tight-colors-colorPalette-accent-success)", variable: "var(--Tight-colors-colorPalette-accent-success)" }, "colors.colorPalette.accent.warning": { value: "var(--Tight-colors-colorPalette-accent-warning)", variable: "var(--Tight-colors-colorPalette-accent-warning)" }, "colors.colorPalette.accent.danger": { value: "var(--Tight-colors-colorPalette-accent-danger)", variable: "var(--Tight-colors-colorPalette-accent-danger)" }, "colors.colorPalette.body": { value: "var(--Tight-colors-colorPalette-body)", variable: "var(--Tight-colors-colorPalette-body)" }, "colors.colorPalette.label": { value: "var(--Tight-colors-colorPalette-label)", variable: "var(--Tight-colors-colorPalette-label)" }, "colors.colorPalette.label.sub": { value: "var(--Tight-colors-colorPalette-label-sub)", variable: "var(--Tight-colors-colorPalette-label-sub)" }, "colors.colorPalette.sub": { value: "var(--Tight-colors-colorPalette-sub)", variable: "var(--Tight-colors-colorPalette-sub)" }, "colors.colorPalette.label.strong": { value: "var(--Tight-colors-colorPalette-label-strong)", variable: "var(--Tight-colors-colorPalette-label-strong)" }, "colors.colorPalette.label.strongSub": { value: "var(--Tight-colors-colorPalette-label-strongSub)", variable: "var(--Tight-colors-colorPalette-label-strongSub)" }, "colors.colorPalette.strongSub": { value: "var(--Tight-colors-colorPalette-strongSub)", variable: "var(--Tight-colors-colorPalette-strongSub)" }, "colors.colorPalette.heading": { value: "var(--Tight-colors-colorPalette-heading)", variable: "var(--Tight-colors-colorPalette-heading)" }, "colors.colorPalette.metric.sm": { value: "var(--Tight-colors-colorPalette-metric-sm)", variable: "var(--Tight-colors-colorPalette-metric-sm)" }, "colors.colorPalette.sm": { value: "var(--Tight-colors-colorPalette-sm)", variable: "var(--Tight-colors-colorPalette-sm)" }, "colors.colorPalette.metric.md": { value: "var(--Tight-colors-colorPalette-metric-md)", variable: "var(--Tight-colors-colorPalette-metric-md)" }, "colors.colorPalette.md": { value: "var(--Tight-colors-colorPalette-md)", variable: "var(--Tight-colors-colorPalette-md)" }, "colors.colorPalette.metric.lg": { value: "var(--Tight-colors-colorPalette-metric-lg)", variable: "var(--Tight-colors-colorPalette-metric-lg)" }, "colors.colorPalette.lg": { value: "var(--Tight-colors-colorPalette-lg)", variable: "var(--Tight-colors-colorPalette-lg)" }, "colors.colorPalette.metric.xl": { value: "var(--Tight-colors-colorPalette-metric-xl)", variable: "var(--Tight-colors-colorPalette-metric-xl)" }, "colors.colorPalette.xl": { value: "var(--Tight-colors-colorPalette-xl)", variable: "var(--Tight-colors-colorPalette-xl)" }, "colors.colorPalette.layout.weak": { value: "var(--Tight-colors-colorPalette-layout-weak)", variable: "var(--Tight-colors-colorPalette-layout-weak)" }, "colors.colorPalette.layout": { value: "var(--Tight-colors-colorPalette-layout)", variable: "var(--Tight-colors-colorPalette-layout)" }, "colors.colorPalette.layout.strong": { value: "var(--Tight-colors-colorPalette-layout-strong)", variable: "var(--Tight-colors-colorPalette-layout-strong)" }, "colors.colorPalette.positive": { value: "var(--Tight-colors-colorPalette-positive)", variable: "var(--Tight-colors-colorPalette-positive)" }, "colors.colorPalette.positive.weak": { value: "var(--Tight-colors-colorPalette-positive-weak)", variable: "var(--Tight-colors-colorPalette-positive-weak)" }, "colors.colorPalette.negative": { value: "var(--Tight-colors-colorPalette-negative)", variable: "var(--Tight-colors-colorPalette-negative)" }, "colors.colorPalette.negative.weak": { value: "var(--Tight-colors-colorPalette-negative-weak)", variable: "var(--Tight-colors-colorPalette-negative-weak)" } };
|
|
1022
|
+
function lo(e2, t2) {
|
|
1023
|
+
var _a2;
|
|
1024
|
+
return ((_a2 = io[e2]) == null ? void 0 : _a2.value) || t2;
|
|
1025
|
+
}
|
|
1026
|
+
lo.var = function(e2, t2) {
|
|
1027
|
+
var _a2;
|
|
1028
|
+
return ((_a2 = io[e2]) == null ? void 0 : _a2.variable) || t2;
|
|
1029
|
+
};
|
|
1030
|
+
const so = kt(null, ht({ borderRadius: "50%", flexShrink: 0 })), co = kt(null, ht({ display: "flex", flexDirection: "row", gap: "10px", alignItems: "center", minWidth: 0 })), uo = kt(null, On), ho = lo.var("colors.surface.foreground.disabled");
|
|
1031
|
+
function go({ color: e2 = ho, diameter: t2 = 17, label: r2 }) {
|
|
1032
|
+
return C("div", { ...co, "data-testid": "bullet-row", children: [w("div", { ...so, style: { backgroundColor: e2, width: `${t2}px`, height: `${t2}px` }, "data-testid": "bullet" }), r2 && w(no, { stylists: [uo], children: r2 })] });
|
|
1033
|
+
}
|
|
1034
|
+
const po = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: "30px" }));
|
|
1035
|
+
function vo({ payload: e2 }) {
|
|
1036
|
+
return void 0 === e2 ? null : w("div", { ...po, children: e2.map((e3, t2) => "none" !== e3.type && w(go, { color: e3.color, label: e3.value, diameter: 17 }, t2)) });
|
|
1037
|
+
}
|
|
1038
|
+
const mo = { right: 20, left: 20 }, bo = ["income", "profit", "expenses", "loss"], fo = (e2) => bo.findIndex((t2) => t2 === e2.dataKey), yo = { paddingBottom: "20px", marginLeft: "-20px" }, To = { stackId: "stack", isAnimationActive: false }, xo = kt(bt["profit-loss-graph"], ht({ "& .recharts-surface": { outline: "none" } })), wo = lo.var("colors.money"), ko = lo.var("colors.border.layout"), Co = lo.var("colors.border.layout.strong"), So = { fill: lo.var("colors.typography.base"), fontSize: lo.var("fontSizes.metric.sm") }, Eo = { profit: lo.var("colors.money.positive"), income: lo.var("colors.money.positive.weak"), loss: lo.var("colors.money.negative"), expenses: lo.var("colors.money.negative.weak") }, Io = [0, 100], Po = ["auto", "auto"];
|
|
1039
|
+
function Ao({ data: e2 }) {
|
|
1040
|
+
const [t2, r2] = v(true);
|
|
1041
|
+
if (void 0 === e2) return null;
|
|
1042
|
+
const n2 = e2.hasAnyData ? Po : Io;
|
|
1043
|
+
return w(N, { width: "100%", height: "100%", ...xo, children: C(R, { data: e2.months, stackOffset: "sign", accessibilityLayer: true, barSize: 35, margin: mo, children: [w(O, { verticalAlign: "top", itemSorter: fo, wrapperStyle: yo, content: ({ payload: e3 }) => w(vo, { payload: e3 }) }), w(L, { strokeDasharray: "0", vertical: false, stroke: ko }), w(F, { dataKey: "month", interval: 0, tickLine: false, stroke: ko, tick: So }), w(_, { type: "number", tickCount: 7, domain: n2, axisLine: false, tickLine: false, stroke: ko, tick: So, tickFormatter: (e3) => Xn(e3) }), w(W, { content: ({ active: e3, payload: t3 }) => w(ao, { active: e3, payload: t3 }), isAnimationActive: false, shared: false }), w(B, { name: "Profit", dataKey: Cn.profit, fill: Eo.profit, ...To }), w(B, { name: "Income", dataKey: Cn.income, fill: Eo.income, ...To }), w(B, { name: "Loss", dataKey: Cn.loss, fill: Eo.loss, ...To }), w(B, { name: "Expenses", dataKey: Cn.expenses, fill: Eo.expenses, ...To }), w(B, { dataKey: Cn.noDataHeight, fill: ko, legendType: "none", ...To }), w(H, { y: 0, stroke: Co }), w(z, { dataKey: Cn.netIncome, fill: wo, stroke: wo, strokeWidth: 1, legendType: "none", activeDot: false, isAnimationActive: t2, onAnimationStart: () => r2(true), onAnimationEnd: () => r2(false) })] }) });
|
|
1044
|
+
}
|
|
1045
|
+
const Do = ht({ backgroundColor: "surface.elevated", borderRadius: "sm", backgroundImage: "linear-gradient(90deg, {colors.surface.elevated} 30%, {colors.surface.foreground} 50%, {colors.surface.elevated} 70%)", backgroundSize: "400%", backgroundPosition: "100% 0", animation: "shimmer" });
|
|
1046
|
+
function Mo({ styles: e2 }) {
|
|
1047
|
+
const t2 = kt(null, Do, e2);
|
|
1048
|
+
return w("div", { ...t2 });
|
|
1049
|
+
}
|
|
1050
|
+
const No = ht({ width: "40%", minHeight: 65 });
|
|
1051
|
+
function Ro({ children: e2 }) {
|
|
1052
|
+
return C(k, { children: [w(Mo, { styles: No }), w(qn, { children: e2 })] });
|
|
1053
|
+
}
|
|
1054
|
+
const Oo = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: 16 })), Lo = ht({ width: "80px", height: "17px", marginBottom: "10px" }), Fo = ht({ width: "100%", height: "100%" });
|
|
1055
|
+
function _o() {
|
|
1056
|
+
return C(k, { children: [C("div", { ...Oo, children: [w(Mo, { styles: Lo }), w(Mo, { styles: Lo }), w(Mo, { styles: Lo }), w(Mo, { styles: Lo })] }), w(Mo, { styles: Fo })] });
|
|
1057
|
+
}
|
|
1058
|
+
function Wo({ filter: e2 = Lt.PAST_YEAR }) {
|
|
1059
|
+
const { query: { data: t2 }, isFilling: r2 } = function({ filter: e3, grouping: t3 }) {
|
|
1060
|
+
return xn({ filter: e3, grouping: t3, select: En });
|
|
1061
|
+
}({ filter: e2, grouping: In.MONTHLY });
|
|
1062
|
+
return C(Rn, { type: "chart", children: [w(An, { title: "Profit + Loss" }), w(Mn, { children: r2 ? w(Ro, { children: w(_o, {}) }) : C(k, { children: [w(Vn, { title: Xn((t2 == null ? void 0 : t2.total) ?? 0), label: "Profit" }), w(qn, { children: w(Ao, { data: t2 }) })] }) })] });
|
|
1063
|
+
}
|
|
1064
|
+
const Bo = kt(null, ht({ display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "flex-start", gap: "10px", alignSelf: "stretch" }));
|
|
1065
|
+
function Ho({ children: e2 }) {
|
|
1066
|
+
return w("div", { ...Bo, children: e2 });
|
|
1067
|
+
}
|
|
1068
|
+
const zo = "conversations-section", Vo = "transactions-section", jo = { MESSAGE_REVIEW: zo, TRANSACTION_REVIEW: Vo, LINK_BANK: "", RULE_REVIEW: "", BANK_ERROR: "", CSV_IMPORT_REVIEW: "" }, qo = { reviewStatus: { values: ["USER_REVIEW_REQUIRED"], operator: "IN" }, status: { values: ["ACTIVE"], operator: "IN" }, category: { expand: true }, glAccount: { expand: true }, bankAccount: { expand: true } }, $o = { resolutionStatus: { operator: "IN", values: ["OPEN"] } }, Uo = 10, Ko = [], Yo = [];
|
|
1069
|
+
function Go({ Component: e2, stylists: t2 }) {
|
|
1070
|
+
return w(e2, { stylists: [kt(bt["medium-icon"]), ...t2 ?? []], size: 15 });
|
|
1071
|
+
}
|
|
1072
|
+
const Qo = mt({ base: { stroke: "currentColor" }, variants: { primary: { DEFAULT: { stroke: "icon.intent.primary" }, hover: { stroke: "icon.intent.primary.hover" }, active: { stroke: "icon.intent.primary.active" } }, secondary: { DEFAULT: { stroke: "icon.intent.secondary" }, hover: { stroke: "icon.intent.secondary.hover" }, active: { stroke: "icon.intent.secondary.active" } }, success: { DEFAULT: { stroke: "icon.intent.success" }, hover: { stroke: "icon.intent.success.hover" }, active: { stroke: "icon.intent.success.active" } }, warning: { DEFAULT: { stroke: "icon.intent.warning" }, hover: { stroke: "icon.intent.warning.hover" }, active: { stroke: "icon.intent.warning.active" } }, danger: { DEFAULT: { stroke: "icon.intent.danger" }, hover: { stroke: "icon.intent.danger.hover" }, active: { stroke: "icon.intent.danger.active" } }, action: { DEFAULT: { stroke: "icon.intent.action" }, hover: { stroke: "icon.intent.action.hover" }, active: { stroke: "icon.intent.action.active" } } } });
|
|
1073
|
+
function Xo(e2, t2) {
|
|
1074
|
+
const r2 = ({ size: t3 = 24, fill: r3 = "transparent", stylists: n2 }) => {
|
|
1075
|
+
const o2 = Pt([kt(null, Qo()), ...n2]);
|
|
1076
|
+
return w(e2, { ...o2, style: { minHeight: t3, minWidth: t3 }, width: t3, height: t3, fill: r3 });
|
|
1077
|
+
};
|
|
1078
|
+
return r2.displayName = t2, r2;
|
|
1079
|
+
}
|
|
1080
|
+
const Zo = Xo((e2) => c.createElement("svg", { width: 25, height: 24, viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M12 1.47998C6.2 1.47998 1.5 5.74998 1.5 11C1.52866 13.0153 2.23294 14.9626 3.5 16.53L2.5 21.53L9.16 20.2C10.1031 20.4499 11.0744 20.5776 12.05 20.58C17.85 20.58 22.55 16.3 22.55 11.03C22.55 5.75998 17.8 1.47998 12 1.47998Z", strokeWidth: 1.5, strokeMiterlimit: 10 }), c.createElement("path", { d: "M11.05 11.02H12.95", strokeWidth: 1.5, strokeMiterlimit: 10 }), c.createElement("path", { d: "M15.82 11.02H17.73", strokeWidth: 1.5, strokeMiterlimit: 10 }), c.createElement("path", { d: "M6.27 11.02H8.18", strokeWidth: 1.5, strokeMiterlimit: 10 })), "Comment"), Jo = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M8.54708 2.09833H8.37602C8.21004 2.09808 8.04676 2.14026 7.90167 2.22087C7.75657 2.30147 7.6345 2.41783 7.54702 2.55888L1.70458 11.9081C1.60602 12.0636 1.55355 12.2438 1.55325 12.4279C1.55324 12.5569 1.57886 12.6846 1.62861 12.8036C1.67837 12.9226 1.75127 13.0305 1.84309 13.1211C1.93491 13.2117 2.04381 13.2832 2.16348 13.3313C2.28314 13.3795 2.41118 13.4034 2.54015 13.4016H14.3829C14.6412 13.4016 14.8889 13.299 15.0715 13.1164C15.2541 12.9338 15.3567 12.6861 15.3567 12.4279C15.3564 12.2438 15.3039 12.0636 15.2054 11.9081L9.37608 2.55888C9.2886 2.41783 9.16652 2.30147 9.02143 2.22087C8.87634 2.14026 8.71306 2.09808 8.54708 2.09833Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.46158 5.23663V9.00659", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.46158 10.2632V11.5199", stroke: "#182428", strokeMiterlimit: 10 })), "Attention"), ea = ht({ transition: "background 300ms ease-out, background-color 300ms ease-out, border-color 300ms ease-out, box-shadow 0ms", "&:hover": { transition: "background 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out, box-shadow 0ms" } }), ta = ht({ transition: "background 300ms ease-out, box-shadow 0ms", "&:hover": { transition: "background 100ms ease-out, box-shadow 0ms" } }), ra = ht({ transition: "color 300ms ease-out", "&:hover": { transition: "color 100ms ease-out" } }), na = ht({ "& > .Tight-text": { transition: "color 300ms ease-out" }, "&:hover > .Tight-text": { transition: "color 100ms ease-out" } }), oa = ht({ "& path": { transition: "stroke 300ms ease-out" }, "&:hover path": { transition: "stroke 100ms ease-out" } }), aa = ht({ display: "flex", alignItems: "center", justifyContent: "center", outline: "none", cursor: "pointer", borderRadius: "md", "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout", outlineOffset: "-1px" }, "&:disabled": { cursor: "not-allowed", opacity: 0.6 } }), ia = ht({ color: "typography.intent.secondary", border: "{borderWidths.md} solid", borderColor: "border.layout", backgroundColor: "surface.intent.action.discrete", "&:hover:not(:disabled)": { backgroundColor: "surface.intent.action.discrete.hover", borderColor: "border.layout", "& .Tight-text": { color: "typography.intent.secondary.hover" } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.action.discrete.active", "& .Tight-text": { color: "typography.intent.secondary.active" } }, "& .Tight-text": { color: "typography.intent.secondary" } }), la = ht({ padding: "10px", fontSize: "md", fontWeight: "md", gap: "9px" }), sa = { default: la, small: ht({ padding: "6px", fontSize: "sm", fontWeight: "sm", gap: "5px" }) }, ca = (e2) => {
|
|
1081
|
+
const t2 = sa[e2];
|
|
1082
|
+
return kt(bt["button-base"], ht({ width: "fit-content" }), t2, aa, ea);
|
|
1083
|
+
}, da = ["default", "small"], ua = { default: { className: "" }, small: { className: "" } };
|
|
1084
|
+
for (const e2 of da) ua[e2] = ca(e2);
|
|
1085
|
+
function ha({ children: e2, stylists: t2 = [], type: r2 = "button", onClick: n2, disabled: o2, size: a2 = "default", active: i2 = false }) {
|
|
1086
|
+
const l2 = Pt([ua[a2], ...t2]);
|
|
1087
|
+
return w("button", { ...l2, type: r2, onClick: n2, disabled: o2, "data-active": i2, children: e2 });
|
|
1088
|
+
}
|
|
1089
|
+
const ga = kt(bt["button-warning"], ht({ color: "typography.intent.warning", border: "1px solid {colors.border.intent.warning}", backgroundColor: "surface.intent.warning", "&:hover:not(:disabled)": { backgroundColor: "surface.intent.warning.hover", borderColor: "border.intent.warning.hover", "& .Tight-text": { color: "typography.intent.warning.hover" } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.warning.active", borderColor: "border.intent.warning.active", "& .Tight-text": { color: "typography.intent.warning.active" } }, "& .Tight-text": { color: "typography.intent.warning" } }));
|
|
1090
|
+
function pa({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
1091
|
+
return w(ha, { stylists: [ga, ...t2], ...r2, children: e2 });
|
|
1092
|
+
}
|
|
1093
|
+
const va = Xo((e2) => c.createElement("svg", { width: 13, height: 15, viewBox: "0 0 13 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M0.743464 14.9687V0.96875H11.6465L9.22218 4.59886L11.6465 8.24166H0.743464", stroke: "#182428", strokeMiterlimit: 10 })), "Flag"), ma = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M14.9092 4.60259V6.39635H1.78418V4.60259L8.34669 1.62134L14.9092 4.60259Z", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M14.9092 12.3589H1.78418V14.7464H14.9092V12.3589Z", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M2.97803 6.39648V12.359", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M6.55908 6.39648V12.359", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M10.1343 6.39648V12.359", strokeMiterlimit: 10, strokeLinecap: "square" }), c.createElement("path", { d: "M13.7153 6.39648V12.359", strokeMiterlimit: 10, strokeLinecap: "square" })), "Bank"), ba = kt(bt["button-danger"], ht({ color: "typography.intent.danger", border: "{borderWidths.md} solid", borderColor: "border.intent.danger", backgroundColor: "surface.intent.danger", "&:hover:not(:disabled)": { backgroundColor: "surface.intent.danger.hover", borderColor: "border.intent.danger.hover", "& .Tight-text": { color: "typography.intent.danger.hover" } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.danger.active", borderColor: "border.intent.danger.active", "& .Tight-text": { color: "typography.intent.danger.active" } }, "& .Tight-text": { color: "typography.intent.danger" } }));
|
|
1094
|
+
function fa({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
1095
|
+
return w(ha, { stylists: [ba, ...t2], ...r2, children: e2 });
|
|
1096
|
+
}
|
|
1097
|
+
const ya = kt(bt["button-action"], ht({ color: "typography.intent.action", border: "1px solid {colors.border.intent.action}", backgroundColor: "surface.intent.action", "&:hover:not(:disabled)": { backgroundColor: "surface.intent.action.hover", borderColor: "border.intent.action.hover", "& .Tight-text": { color: "typography.intent.action.hover" } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.action.active", borderColor: "border.intent.action.active", "& .Tight-text": { color: "typography.intent.action.active" } }, "& .Tight-text": { color: "typography.intent.action" } }));
|
|
1098
|
+
function Ta({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
1099
|
+
return w(ha, { stylists: [ya, ...t2], ...r2, children: e2 });
|
|
1100
|
+
}
|
|
1101
|
+
const xa = (e2) => {
|
|
1102
|
+
switch (e2) {
|
|
1103
|
+
case "URGENT":
|
|
1104
|
+
return { Button: fa };
|
|
1105
|
+
case "HIGH":
|
|
1106
|
+
return { Button: pa };
|
|
1107
|
+
case "MEDIUM":
|
|
1108
|
+
return { Button: Ta };
|
|
1109
|
+
default:
|
|
1110
|
+
return { Button: ha };
|
|
1111
|
+
}
|
|
1112
|
+
}, wa = (e2) => {
|
|
1113
|
+
switch (e2) {
|
|
1114
|
+
case "MESSAGE_REVIEW":
|
|
1115
|
+
return { Icon: Zo, buttonText: "Respond Now" };
|
|
1116
|
+
case "TRANSACTION_REVIEW":
|
|
1117
|
+
return { Icon: va, buttonText: "Review" };
|
|
1118
|
+
case "LINK_BANK":
|
|
1119
|
+
return { Icon: ma, buttonText: "Link your bank" };
|
|
1120
|
+
case "BANK_ERROR":
|
|
1121
|
+
return { Icon: Jo, buttonText: "Relink" };
|
|
1122
|
+
default:
|
|
1123
|
+
return { Icon: Jo, buttonText: "" };
|
|
1124
|
+
}
|
|
1125
|
+
}, ka = kt(null, ht({ display: "flex", alignItems: "center", gap: "15px" })), Ca = kt(null, ht({ width: "20px", height: "20px" }));
|
|
1126
|
+
function Sa({ title: e2, type: t2 }) {
|
|
1127
|
+
const { Icon: r2 } = wa(t2);
|
|
1128
|
+
return C("div", { ...ka, children: [w(Go, { Component: r2, stylists: [Ca] }), w(to, { children: e2 })] });
|
|
1129
|
+
}
|
|
1130
|
+
const Ea = kt(null, ht({ display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "flex-start", gap: "5px", flex: "1 1 0", minWidth: "200px" }));
|
|
1131
|
+
function Ia({ title: e2, description: t2, type: r2 }) {
|
|
1132
|
+
return C("div", { ...Ea, children: [w(Sa, { title: e2, type: r2 }), w(no, { children: t2 })] });
|
|
1133
|
+
}
|
|
1134
|
+
function Pa({ Component: e2, stylists: t2 }) {
|
|
1135
|
+
return w(e2, { stylists: [kt(bt["small-icon"]), ...t2 ?? []], size: 12 });
|
|
1136
|
+
}
|
|
1137
|
+
const Aa = Xo((e2) => c.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M4.31472 11.6L9.91473 5.99997L4.31472 0.399959", stroke: "#182428", strokeMiterlimit: 10 })), "ArrowRight"), Da = kt(bt["banner-button"], ht({ display: "flex", width: "202px", justifyContent: "flex-end", alignItems: "center", gap: "15px", flexShrink: "0" })), Ma = kt(bt["banner-button-text"]), Na = kt(bt["banner-button-icon"]);
|
|
1138
|
+
function Ra({ priority: e2, type: t2, handleClick: r2 }) {
|
|
1139
|
+
const { buttonText: n2 } = wa(t2), { Button: o2 } = xa(e2);
|
|
1140
|
+
return C(o2, { onClick: r2, stylists: [Da], children: [w(to, { stylists: [Ma], children: n2 }), w(Pa, { stylists: [Na], Component: Aa })] });
|
|
1141
|
+
}
|
|
1142
|
+
const Oa = mt({ base: { display: "flex", padding: "15px", justifyContent: "space-between", alignItems: "center", alignSelf: "stretch", flexWrap: "wrap", minWidth: "300px", gap: "15px", borderRadius: "lg", border: "1px solid", backgroundColor: "surface.foreground" }, variants: { priority: { HIGH: { borderColor: "border.intent.warning" }, MEDIUM: { borderColor: "border.intent.action" }, LOW: {}, URGENT: { borderColor: "border.intent.danger" } } } }), La = { HIGH: bt["banner-high"], MEDIUM: bt["banner-medium"], LOW: bt["banner-low"], URGENT: bt["banner-urgent"] };
|
|
1143
|
+
function Fa({ task: e2, handleClick: t2 }) {
|
|
1144
|
+
const { name: r2, description: n2, type: o2, priority: a2 } = e2, i2 = kt(bt.banner, La[a2], Oa({ priority: a2 }));
|
|
1145
|
+
return C("div", { ...i2, children: [w(Ia, { title: r2, description: n2, type: o2 }), w(Ra, { priority: a2, type: o2, handleClick: t2 })] });
|
|
1146
|
+
}
|
|
1147
|
+
function _a(e2) {
|
|
1148
|
+
return vn(`${function(e3) {
|
|
1149
|
+
return bn[e3];
|
|
1150
|
+
}(e2)}`, "v6");
|
|
1151
|
+
}
|
|
1152
|
+
const Wa = { all: () => ["tasks", {}], of: (e2) => ["tasks", e2 ?? {}] }, Ba = { URGENT: 0, HIGH: 1, MEDIUM: 2, LOW: 3 };
|
|
1153
|
+
function Ha(e2) {
|
|
1154
|
+
return Jt(e2) || Jt(e2.data) ? [] : [...e2.data].sort((e3, t2) => Ba[e3.priority] - Ba[t2.priority]);
|
|
1155
|
+
}
|
|
1156
|
+
const za = async (e2) => {
|
|
1157
|
+
const t2 = e2.queryKey, r2 = t2[1], n2 = { path: "/v6/tasks/query", method: "POST", accessToken: t2[2].accessToken, bodyParams: { ...r2 }, endpointManager: _a(t2[2].environment) }, o2 = await gn(n2);
|
|
1158
|
+
return "SUCCESS" === o2.result && void 0 !== o2.data ? { data: o2.data } : { data: void 0 };
|
|
1159
|
+
};
|
|
1160
|
+
const Va = Xo((e2) => c.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M8.31473 0.399963L2.71472 5.99997L8.31473 11.6", stroke: "#182428", strokeMiterlimit: 10 })), "ArrowLeft"), ja = h({ hasNextPage: false, hasPreviousPage: false, getFirstPage: () => {
|
|
1161
|
+
}, getLastPage: () => {
|
|
1162
|
+
}, pageBackwards: () => {
|
|
1163
|
+
}, pageForwards: () => {
|
|
1164
|
+
} });
|
|
1165
|
+
const qa = kt(null, ht({ backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid", borderRadius: "md", borderColor: "border.layout", color: "typography.base", display: "inline-flex", alignItems: "center", justifyContent: "center", height: "35px" })), $a = kt(null, ht({ border: "none", borderRadius: "sm", backgroundColor: "surface.intent.action.discrete", padding: "4px", margin: 0, cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", outline: "none", boxShadow: "0 0 0 0 transparent", "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout" }, "&:disabled": { opacity: 0.6, pointerEvents: "none" }, "&:hover": { backgroundColor: "surface.intent.action.discrete.hover" } }), ta), Ua = kt(null, ht({ display: "flex", gap: "9px", padding: "10px", justifyContent: "center", alignItems: "center" }));
|
|
1166
|
+
function Ka() {
|
|
1167
|
+
const { hasNextPage: e2, hasPreviousPage: t2, pageForwards: r2, pageBackwards: n2 } = function() {
|
|
1168
|
+
const e3 = g(ja);
|
|
1169
|
+
if (void 0 === e3) throw new Error("usePaginationContext must be used within a PaginationProvider");
|
|
1170
|
+
return e3;
|
|
1171
|
+
}();
|
|
1172
|
+
return C("div", { ...qa, children: [w("div", { ...Ua, children: w("button", { ...$a, onClick: n2, disabled: !t2, children: w(Pa, { Component: Va }) }) }), w("div", { ...Ua, children: w("button", { ...$a, onClick: r2, disabled: !e2, children: w(Pa, { Component: Aa }) }) })] });
|
|
1173
|
+
}
|
|
1174
|
+
const Ya = ht({ width: "100%", height: "50px" });
|
|
1175
|
+
function Ga() {
|
|
1176
|
+
return w(Mo, { styles: Ya });
|
|
1177
|
+
}
|
|
1178
|
+
const Qa = kt(bt["dashboard-placeholder-table"], ht({ display: "flex", flexDirection: "column", gap: "4px" })), Xa = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", height: "52px", paddingLeft: "64px", paddingRight: "64px" })), Za = ht({ width: "100px", height: "20px" });
|
|
1179
|
+
function Ja({ numColumns: e2 = 6 }) {
|
|
1180
|
+
return C("div", { ...Qa, children: [w("div", { ...Xa, children: Array.from({ length: e2 }, (e3, t2) => w(Mo, { styles: Za }, t2)) }), w(Ga, {}), w(Ga, {}), w(Ga, {}), w(Ga, {}), w(Ga, {}), w(Ga, {})] });
|
|
1181
|
+
}
|
|
1182
|
+
function ei(e2, t2) {
|
|
1183
|
+
const r2 = or(), n2 = cr();
|
|
1184
|
+
return m((o2) => {
|
|
1185
|
+
const a2 = rr(r2), i2 = a2 ? {} : { retry: false, staleTime: 1 / 0 };
|
|
1186
|
+
return lr.prefetchQuery({ queryKey: Xt(e2(o2), r2 ?? "", n2), queryFn: a2 ? t2 : ar, ...i2 });
|
|
1187
|
+
}, [e2, t2, r2, n2]);
|
|
1188
|
+
}
|
|
1189
|
+
const ti = Object.freeze({}), ri = Object.freeze({ cursor: "FINAL_PAGE" });
|
|
1190
|
+
function ni({ queryKey: e2, queryFn: t2, ...r2 }) {
|
|
1191
|
+
var _a2, _b2;
|
|
1192
|
+
const [n2, o2] = v(ti), i2 = d(e2);
|
|
1193
|
+
a(i2.current, e2) || (i2.current = e2, o2(ti));
|
|
1194
|
+
const l2 = dr({ ...r2, queryKey: Zt(e2, n2), queryFn: t2, keepPreviousDataPlaceholder: true }), s2 = u(() => {
|
|
1195
|
+
var _a3;
|
|
1196
|
+
return e3 = (_a3 = l2.query.data) == null ? void 0 : _a3.cursor, t3 = o2, { getFirstPage: () => t3(ti), getLastPage: () => t3(ri), hasNextPage: er(e3 == null ? void 0 : e3.after), hasPreviousPage: er(e3 == null ? void 0 : e3.before), pageForwards: () => {
|
|
1197
|
+
(e3 == null ? void 0 : e3.after) && t3({ cursor: e3.after });
|
|
1198
|
+
}, pageBackwards: () => {
|
|
1199
|
+
(e3 == null ? void 0 : e3.before) && t3({ cursor: e3.before });
|
|
1200
|
+
} };
|
|
1201
|
+
var e3, t3;
|
|
1202
|
+
}, [(_a2 = l2.query.data) == null ? void 0 : _a2.cursor]), c2 = ei(m((t3) => Zt(e2, t3), [e2]), t2), h2 = ei(m((t3) => Zt(e2, t3), [e2]), t2);
|
|
1203
|
+
return b(() => {
|
|
1204
|
+
var _a3;
|
|
1205
|
+
const e3 = (_a3 = l2.query.data) == null ? void 0 : _a3.cursor;
|
|
1206
|
+
!l2.query.isFetching && e3 && (e3.after && c2({ cursor: e3.after }).catch((e4) => {
|
|
1207
|
+
Qr({ error: e4, severity: "error" });
|
|
1208
|
+
}), e3.before && h2({ cursor: e3.before }).catch((e4) => {
|
|
1209
|
+
Qr({ error: e4, severity: "error" });
|
|
1210
|
+
}));
|
|
1211
|
+
}, [(_b2 = l2.query.data) == null ? void 0 : _b2.cursor, l2.query.isFetching, c2, h2]), { ...l2, paginationControls: s2 };
|
|
1212
|
+
}
|
|
1213
|
+
async function oi({ authorization: e2, extraHeaders: t2, includeCredentials: r2, params: n2, url: o2, cache: a2 }) {
|
|
1214
|
+
const i2 = on({ extraHeaders: t2, authorization: e2 }), l2 = rn({ url: o2, params: n2 }), s2 = sn();
|
|
1215
|
+
Gr("HTTP GET Request", { url: o2, accessToken: e2 });
|
|
1216
|
+
try {
|
|
1217
|
+
const e3 = await fetch(l2, { method: "GET", headers: i2, credentials: s2, cache: a2 });
|
|
1218
|
+
return Gr("HTTP GET Response", { url: o2, status: e3.status, statusText: e3.statusText }), an(e3);
|
|
1219
|
+
} catch (e3) {
|
|
1220
|
+
return Promise.reject(e3);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
async function ai(e2) {
|
|
1224
|
+
const { url: t2, headers: r2 } = dn(e2);
|
|
1225
|
+
return oi({ url: t2, params: e2.params, includeCredentials: true, extraHeaders: r2 });
|
|
1226
|
+
}
|
|
1227
|
+
async function ii(e2) {
|
|
1228
|
+
return ai({ ...e2, endpointManager: _a(e2.environment) });
|
|
1229
|
+
}
|
|
1230
|
+
async function li(e2) {
|
|
1231
|
+
return ai({ ...e2, endpointManager: fn(e2.environment) });
|
|
1232
|
+
}
|
|
1233
|
+
function si({ delay: e2, callback: t2 }) {
|
|
1234
|
+
const r2 = u(() => function({ delay: e3, callback: t3 }) {
|
|
1235
|
+
let r3;
|
|
1236
|
+
const n2 = () => {
|
|
1237
|
+
r3 && (clearTimeout(r3), r3 = void 0);
|
|
1238
|
+
};
|
|
1239
|
+
return { startCallback: (o2) => {
|
|
1240
|
+
n2(), r3 = setTimeout(() => {
|
|
1241
|
+
t3(o2);
|
|
1242
|
+
}, e3);
|
|
1243
|
+
}, cancelCallback: () => n2() };
|
|
1244
|
+
}({ delay: e2, callback: t2 }), [e2, t2]);
|
|
1245
|
+
b(() => () => {
|
|
1246
|
+
r2.cancelCallback();
|
|
1247
|
+
}, [r2]);
|
|
1248
|
+
return { startCallback: m((e3) => {
|
|
1249
|
+
r2.startCallback(e3);
|
|
1250
|
+
}, [r2]), cancelCallback: m(() => {
|
|
1251
|
+
r2.cancelCallback();
|
|
1252
|
+
}, [r2]) };
|
|
1253
|
+
}
|
|
1254
|
+
function ci({ prefetchFn: e2 }) {
|
|
1255
|
+
const { startCallback: t2, cancelCallback: r2 } = si({ delay: 250, callback: e2 });
|
|
1256
|
+
return { startPrefetch: t2, cancelPrefetch: r2 };
|
|
1257
|
+
}
|
|
1258
|
+
const di = { CREATED_DATE_TIME: "CREATED_DATE_TIME", SUBJECT: "SUBJECT", EMAIL: "EMAIL", LAST_MESSAGE_CREATED_DATE_TIME: "LAST_MESSAGE_CREATED_DATE_TIME", LAST_MESSAGE_TEXT: "LAST_MESSAGE_TEXT" }, ui = { ASC: "ASC", DESC: "DESC" }, hi = { base: () => ["conversations"], all: () => ["conversations", {}], of: (e2) => ["conversations", e2 ?? {}], conversation: (e2) => ["conversations", "conversation", e2] }, gi = async (e2) => {
|
|
1259
|
+
const t2 = e2.queryKey, r2 = { path: "/v6/conversations/query", bodyParams: { ...t2[1], cursor: t2[2].cursor }, accessToken: t2[3].accessToken, method: "POST", endpointManager: _a(t2[3].environment) }, n2 = await gn(r2);
|
|
1260
|
+
return "SUCCESS" === n2.result && void 0 !== n2.data ? { data: n2.data, cursor: n2.cursor } : { data: void 0, cursor: void 0 };
|
|
1261
|
+
};
|
|
1262
|
+
function pi(e2) {
|
|
1263
|
+
return ni({ queryKey: e2 ? hi.of(e2) : hi.all(), queryFn: gi });
|
|
1264
|
+
}
|
|
1265
|
+
const vi = async (e2) => {
|
|
1266
|
+
const t2 = e2.queryKey, { id: r2 } = t2[2], n2 = { path: "/v6/conversations/{id}", pathParams: { id: r2 }, accessToken: t2[3].accessToken, environment: t2[3].environment }, o2 = await ii(n2);
|
|
1267
|
+
return "SUCCESS" === o2.result && void 0 !== o2.data ? o2.data : null;
|
|
1268
|
+
};
|
|
1269
|
+
function mi(e2) {
|
|
1270
|
+
const t2 = er(e2), r2 = { id: e2 ?? "" };
|
|
1271
|
+
return dr({ queryKey: hi.conversation(r2), queryFn: vi, enabled: t2 });
|
|
1272
|
+
}
|
|
1273
|
+
const bi = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
1274
|
+
const n2 = { path: "/v6/conversations", bodyParams: e2, method: "POST", accessToken: t2, endpointManager: _a(r2) };
|
|
1275
|
+
return await gn(n2);
|
|
1276
|
+
};
|
|
1277
|
+
function fi() {
|
|
1278
|
+
return ci({ prefetchFn: ei(hi.conversation, vi) });
|
|
1279
|
+
}
|
|
1280
|
+
function yi(e2) {
|
|
1281
|
+
const t2 = e2.getSize(), r2 = e2.columnDef.maxSize;
|
|
1282
|
+
return { flex: `${t2} 0 auto`, width: t2, maxWidth: void 0 !== r2 ? `${r2}px` : "auto" };
|
|
1283
|
+
}
|
|
1284
|
+
function Ti({ header: e2 }) {
|
|
1285
|
+
const t2 = yi(e2.column);
|
|
1286
|
+
return w("div", { ...kt(bt["dashboard-table-column-header"]), style: t2, children: e2.isPlaceholder ? null : V(e2.column.columnDef.header, e2.getContext()) });
|
|
1287
|
+
}
|
|
1288
|
+
const xi = kt(bt["dashboard-table-header"], ht({ display: "flex", flexDirection: "row", alignItems: "center", paddingBlock: "10px" }));
|
|
1289
|
+
function wi({ headerGroups: e2 }) {
|
|
1290
|
+
return w("div", { children: e2.map((e3) => f("div", { ...xi, key: e3.id }, e3.headers.map((e4) => w(Ti, { header: e4 }, e4.id)))) });
|
|
1291
|
+
}
|
|
1292
|
+
const ki = kt(bt["dashboard-table-body"], ht({ display: "flex", flexDirection: "column" }));
|
|
1293
|
+
function Ci({ children: e2 }) {
|
|
1294
|
+
return w("div", { ...ki, children: e2 });
|
|
1295
|
+
}
|
|
1296
|
+
const Si = { vertical: kt(bt["vertical-divider"], ht({ width: "{borderWidths.md}", minWidth: "{borderWidths.md}", height: "100%", backgroundColor: "border.layout" })), horizontal: kt(bt["horizontal-divider"], ht({ width: "100%", height: "{borderWidths.md}", minHeight: "{borderWidths.md}", backgroundColor: "border.layout" })) };
|
|
1297
|
+
function Ei({ alignment: e2 = "vertical", stylists: t2 = [] }) {
|
|
1298
|
+
const r2 = Pt([Si[e2], ...t2]);
|
|
1299
|
+
return w("div", { ...r2 });
|
|
1300
|
+
}
|
|
1301
|
+
const Ii = kt(bt["table-cell-divider"]);
|
|
1302
|
+
function Pi() {
|
|
1303
|
+
return w(Ei, { stylists: [Ii] });
|
|
1304
|
+
}
|
|
1305
|
+
function Ai({ cell: e2, index: t2, onCellClick: r2, shouldDisplayDivider: n2 }) {
|
|
1306
|
+
const o2 = yi(e2.column), a2 = kt(bt["dashboard-table-cell"], ht({ height: "100%", display: "flex", justifyContent: "center", flexDirection: "column" })), i2 = kt(null, ht({ display: "flex", flexDirection: "row", height: "100%" })), l2 = n2(t2);
|
|
1307
|
+
return C("div", { ...i2, style: o2, onClick: () => {
|
|
1308
|
+
r2(e2);
|
|
1309
|
+
}, children: [l2 && w(Pi, {}), w("div", { style: o2, ...a2, children: V(e2.column.columnDef.cell, e2.getContext()) })] });
|
|
1310
|
+
}
|
|
1311
|
+
const Di = kt(bt["table-sub-row"], ht({ display: "flex", alignItems: "center", justifyContent: "flex-start", height: "60px", overflow: "hidden", minWidth: "fit-content", borderRadius: "zero" }));
|
|
1312
|
+
function Mi({ rowData: e2, onCellClick: t2, shouldDisplayDivider: r2 }) {
|
|
1313
|
+
const n2 = e2.getVisibleCells();
|
|
1314
|
+
return w("div", { ...Di, children: n2.map((e3, n3) => w(Ai, { cell: e3, index: n3, onCellClick: t2, shouldDisplayDivider: r2, isChild: true }, e3.id)) });
|
|
1315
|
+
}
|
|
1316
|
+
const Ni = ht({ display: "flex", flexDirection: "column", borderRadius: "zero", cursor: "pointer", minWidth: "fit-content" }), Ri = ht({ background: "surface.background" }), Oi = kt(bt["table-row"], ht({ display: "flex", alignItems: "center", justifyContent: "flex-start", height: "60px", minWidth: "fit-content" }));
|
|
1317
|
+
function Li({ rowData: e2, onMouseEnter: t2, onMouseLeave: r2, onCellClick: n2, shouldDisplayDivider: o2 }) {
|
|
1318
|
+
const a2 = e2.getIsExpanded(), i2 = kt(bt["table-parent-row"], Ni, e2.index % 2 == 0 ? Ri : void 0), l2 = e2.getVisibleCells();
|
|
1319
|
+
return C("div", { ...i2, onMouseEnter: t2, onMouseLeave: r2, children: [w("div", { ...Oi, children: l2.map((e3, t3) => w(Ai, { cell: e3, index: t3, onCellClick: n2, shouldDisplayDivider: o2 }, e3.id)) }), a2 && w("div", { children: e2.subRows.map((e3) => w(Mi, { rowData: e3, onCellClick: n2, shouldDisplayDivider: o2 }, e3.id)) })] });
|
|
1320
|
+
}
|
|
1321
|
+
const Fi = (e2, t2 = {}) => {
|
|
1322
|
+
De.getState().openDrawer(e2, t2);
|
|
1323
|
+
}, _i = () => {
|
|
1324
|
+
De.getState().closeAllDrawers();
|
|
1325
|
+
}, Wi = () => {
|
|
1326
|
+
De.getState().closeDrawer();
|
|
1327
|
+
}, Bi = { DATE: "DATE", DESCRIPTION: "DESCRIPTION", AMOUNT: "AMOUNT", STATUS: "STATUS", REVIEW_STATUS: "REVIEW_STATUS" }, Hi = { ASC: "ASC", DESC: "DESC" }, zi = { base: () => ["banks", "transactions"], all: () => ["banks", "transactions", {}], of: (e2) => ["banks", "transactions", e2 ?? {}], single: (e2) => ["banks", "transactions", e2.id] }, Vi = async (e2) => {
|
|
1328
|
+
const t2 = e2.queryKey, r2 = { path: "/v6/banks/transactions/query", bodyParams: { ...t2[2], cursor: t2[3].cursor }, method: "POST", accessToken: t2[4].accessToken, endpointManager: _a(t2[4].environment) }, n2 = await gn(r2);
|
|
1329
|
+
return "SUCCESS" === n2.result && void 0 !== n2.data ? { data: n2.data, cursor: n2.cursor } : { data: void 0, cursor: void 0 };
|
|
1330
|
+
};
|
|
1331
|
+
function ji(e2) {
|
|
1332
|
+
return ni({ queryKey: zi.of(e2), queryFn: Vi });
|
|
1333
|
+
}
|
|
1334
|
+
const qi = async (e2) => {
|
|
1335
|
+
const t2 = e2.queryKey, r2 = { path: "/v6/banks/transactions/{id}", pathParams: { id: t2[2] }, accessToken: t2[3].accessToken, environment: t2[3].environment }, n2 = await ii(r2);
|
|
1336
|
+
return "SUCCESS" === n2.result && void 0 !== n2.data ? n2.data : null;
|
|
1337
|
+
};
|
|
1338
|
+
function $i({ id: e2 }) {
|
|
1339
|
+
return dr({ queryKey: zi.single({ id: e2 }), queryFn: qi });
|
|
1340
|
+
}
|
|
1341
|
+
function Ui() {
|
|
1342
|
+
return ci({ prefetchFn: ei(zi.single, qi) });
|
|
1343
|
+
}
|
|
1344
|
+
const Ki = { BANK_ACCOUNT: "bka", GL_ACCOUNT: "gla", TRANSACTION_CATEGORY: "ctg", BANK_TRANSACTION: "btxn", PROCESSOR_TRANSACTION: "ptxn", TRANSACTION_LINE_ITEM: "tli" };
|
|
1345
|
+
function Yi(e2, t2) {
|
|
1346
|
+
return !tr(e2) && e2.startsWith(t2);
|
|
1347
|
+
}
|
|
1348
|
+
const Gi = { all: () => ["messages"], of: (e2) => ["messages", e2] };
|
|
1349
|
+
function Qi(e2) {
|
|
1350
|
+
if (Jt(e2) || 0 === e2.length) return null;
|
|
1351
|
+
const t2 = [[e2[0]]];
|
|
1352
|
+
for (let r2 = 1; r2 < e2.length; r2++) {
|
|
1353
|
+
const n2 = e2[r2], o2 = t2[t2.length - 1], a2 = o2[0].author.userId;
|
|
1354
|
+
n2.author.userId === a2 ? o2.push(n2) : t2.push([n2]);
|
|
1355
|
+
}
|
|
1356
|
+
return t2;
|
|
1357
|
+
}
|
|
1358
|
+
const Xi = async (e2) => {
|
|
1359
|
+
const t2 = e2.queryKey, { id: r2 } = t2[1], n2 = { path: "/v6/conversations/{id}/messages", pathParams: { id: r2 }, accessToken: t2[2].accessToken, environment: t2[2].environment }, o2 = await ii(n2);
|
|
1360
|
+
return "SUCCESS" === o2.result && void 0 !== o2.data ? o2.data : null;
|
|
1361
|
+
};
|
|
1362
|
+
const Zi = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
1363
|
+
const n2 = { path: "/v6/messages", bodyParams: { data: [e2] }, method: "POST", endpointManager: _a(r2), accessToken: t2 };
|
|
1364
|
+
return await gn(n2);
|
|
1365
|
+
};
|
|
1366
|
+
function Ji() {
|
|
1367
|
+
return ci({ prefetchFn: ei(Gi.of, Xi) });
|
|
1368
|
+
}
|
|
1369
|
+
const el = (e2, t2, r2) => {
|
|
1370
|
+
er(t2) && r2 ? Fi("BankTransactionFormRouter", { routeProps: { transactionId: t2, initialTab: "conversation" } }) : Fi("Conversation", { routeProps: { conversationId: e2 } });
|
|
1371
|
+
};
|
|
1372
|
+
function tl({ rowData: e2 }) {
|
|
1373
|
+
const { startPrefetch: t2, cancelPrefetch: r2 } = fi(), { startPrefetch: n2, cancelPrefetch: o2 } = Ji(), { startPrefetch: a2, cancelPrefetch: i2 } = Ui(), l2 = Yi(e2.original.attachedEntityId, Ki.BANK_TRANSACTION), s2 = m(() => {
|
|
1374
|
+
er(e2.original.attachedEntityId) && l2 && a2({ id: e2.original.attachedEntityId }), n2({ id: e2.original.id }), t2({ id: e2.original.id });
|
|
1375
|
+
}, [e2.original.attachedEntityId, e2.original.id, l2, n2, t2, a2]), c2 = m(() => {
|
|
1376
|
+
er(e2.original.attachedEntityId) && l2 && i2(), o2(), r2();
|
|
1377
|
+
}, [i2, r2, l2, o2, e2.original.attachedEntityId]);
|
|
1378
|
+
return w(Li, { rowData: e2, onMouseEnter: s2, onMouseLeave: c2, shouldDisplayDivider: (e3) => 0 !== e3, onCellClick: () => el(e2.original.id, e2.original.attachedEntityId, l2) });
|
|
1379
|
+
}
|
|
1380
|
+
const rl = Xo((e2) => c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 15, height: 15, viewBox: "0 0 15 15", fill: "none", ...e2 }, c.createElement("path", { d: "M0.328064 7.5H14.6719", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.5 0.328064V14.6719", strokeMiterlimit: 10 })), "Plus"), nl = kt(bt["button-primary"], ia);
|
|
1381
|
+
function ol({ children: e2, active: t2, stylists: r2 = [], ...n2 }) {
|
|
1382
|
+
return w(ha, { stylists: [nl, ...r2], active: t2, ...n2, children: e2 });
|
|
1383
|
+
}
|
|
1384
|
+
const al = () => {
|
|
1385
|
+
Fi("Conversation", { routeProps: { conversationId: null } });
|
|
1386
|
+
};
|
|
1387
|
+
function il() {
|
|
1388
|
+
return w(ol, { onClick: al, children: w(Pa, { Component: rl }) });
|
|
1389
|
+
}
|
|
1390
|
+
const ll = kt(null, ht({ display: "flex", flexDirection: "row", gap: "5px" }));
|
|
1391
|
+
function sl({ children: e2 }) {
|
|
1392
|
+
return w("div", { ...ll, children: e2 });
|
|
1393
|
+
}
|
|
1394
|
+
const cl = mt({ base: { display: "flex", flexDirection: "column", flexGrow: 1, animation: "appear.instant", overflow: "hidden" }, variants: { dashboard: { transactionDashboard: { border: "none" }, businessOwnerDashboard: { marginTop: "10px", border: "{borderWidths.lg} solid {colors.border.layout.strong}", borderRadius: "lg" } } } });
|
|
1395
|
+
function dl({ children: e2, dashboard: t2 }) {
|
|
1396
|
+
const r2 = kt(bt["dashboard-table"], cl({ dashboard: t2 }));
|
|
1397
|
+
return w("div", { ...r2, children: e2 });
|
|
1398
|
+
}
|
|
1399
|
+
const ul = h(null), hl = "from", gl = "subject", pl = "message", vl = "date", ml = mt({ base: { fontWeight: "label", fontSize: "label", fontFamily: "label", lineHeight: "16px", letterSpacing: "0.84px", maxWidth: "100%" }, variants: { intent: { default: { color: "typography.label" }, primary: { color: "typography.intent.primary" }, contrast: { color: "typography.contrast" } }, wrap: { ellipsis: Ln, wrap: { whiteSpace: "normal", overflowWrap: "break-word" } } } });
|
|
1400
|
+
function bl({ children: e2, intent: t2 = "default", wrap: r2 = "ellipsis" }) {
|
|
1401
|
+
const n2 = kt(bt.label, ml({ intent: t2, wrap: r2 }));
|
|
1402
|
+
return tr(e2) ? null : w("div", { ...n2, children: e2 });
|
|
1403
|
+
}
|
|
1404
|
+
const fl = kt(bt["emphasis-label"], ht({ lineHeight: "16px" }));
|
|
1405
|
+
function yl({ children: e2 }) {
|
|
1406
|
+
return w(Jn, { size: "med", weight: "lg", stylists: [fl], children: e2 });
|
|
1407
|
+
}
|
|
1408
|
+
function Tl({ text: e2, isRead: t2 }) {
|
|
1409
|
+
return w(t2 ? bl : yl, { children: e2 });
|
|
1410
|
+
}
|
|
1411
|
+
const xl = mt({ base: { padding: "0 25px", height: "100%", display: "flex", justifyContent: "center", flexDirection: "column", width: "100%" }, variants: { alignVariant: { flexStart: { alignItems: "flex-start" }, center: { alignItems: "center" } } }, defaultVariants: { alignVariant: "flexStart" } });
|
|
1412
|
+
function wl({ children: e2, alignVariant: t2 = "flexStart" }) {
|
|
1413
|
+
const r2 = kt(null, xl({ alignVariant: t2 }));
|
|
1414
|
+
return w("div", { ...r2, children: e2 });
|
|
1415
|
+
}
|
|
1416
|
+
function kl({ date: e2, isRead: t2 = false }) {
|
|
1417
|
+
const r2 = ((e3) => {
|
|
1418
|
+
const t3 = new Date(e3), r3 = /* @__PURE__ */ new Date();
|
|
1419
|
+
return jt(t3) ? ((e4) => e4.toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }))(t3) : t3.getFullYear() === r3.getFullYear() ? ((e4, t4) => e4.toLocaleString("default", { month: "short" }) + " " + e4.getDate())(t3) : Qt(t3, { abbreviateMonth: true, abbreviateYear: false });
|
|
1420
|
+
})(e2);
|
|
1421
|
+
return w(Tl, { text: r2, isRead: t2 });
|
|
1422
|
+
}
|
|
1423
|
+
const Cl = kt(bt["strong-sub-label"], At({ label: "strongSubLabel" }));
|
|
1424
|
+
function Sl({ children: e2, stylists: t2 = [] }) {
|
|
1425
|
+
return tr(e2) ? null : w(Jn, { size: "sm", weight: "med", stylists: [Cl, ...t2], children: e2 });
|
|
1426
|
+
}
|
|
1427
|
+
const El = h(null), Il = 314, Pl = ht({ overflow: "auto", display: "flex", flexDirection: "column", width: "325px", maxHeight: `${Il}px`, minWidth: "325px", "&:focus, &:focus-within": { outline: "none" }, scrollbar: "hidden" }), Al = 35, Dl = kt(bt["selector-row"], ht({ borderRadius: "zero", backgroundColor: "surface.intent.action.discrete", boxShadow: "none", border: "{borderWidths.md} solid", borderColor: "border.layout", display: "flex", width: "100%", minHeight: `${Al}px`, height: "fit-content", padding: "10px", alignItems: "flex-start", gap: "9px", flexShrink: 0, textAlign: "start", cursor: "pointer", "&[data-focused='true']": { boxShadow: "none", outline: "none", backgroundColor: "surface.intent.action.discrete.hover" } }));
|
|
1428
|
+
function Ml(e2, t2, r2) {
|
|
1429
|
+
const [n2, o2] = v(e2);
|
|
1430
|
+
return [t2 ?? n2, r2 ?? o2];
|
|
1431
|
+
}
|
|
1432
|
+
function Nl({ children: e2 }) {
|
|
1433
|
+
return null === oe() ? w(ae, { children: e2 }) : e2;
|
|
1434
|
+
}
|
|
1435
|
+
function Rl({ children: e2, modal: t2 = false, initialOpen: r2, placement: n2, offsetPx: o2, open: a2, onOpenChange: i2, blockInteraction: l2 = true, enableClickMiddleware: s2 = true }) {
|
|
1436
|
+
const c2 = function({ initialOpen: e3 = false, placement: t3 = "bottom", offsetPx: r3 = 0, modal: n3, open: o3, onOpenChange: a3, enableClickMiddleware: i3 = true } = {}) {
|
|
1437
|
+
const [l3, s3] = v(), [c3, d3] = v(), [h3, g3] = Ml(e3, o3, a3), p2 = K(), m2 = Al + 2, b2 = 1.5 * m2, f2 = Y({ placement: t3, open: h3, nodeId: p2, onOpenChange: (e4, t4) => {
|
|
1438
|
+
!e4 && t4 instanceof MouseEvent && (t4.clientX < 0 || t4.clientY < 0 || t4.clientX > window.innerWidth || t4.clientY > window.innerHeight) || g3(e4);
|
|
1439
|
+
}, whileElementsMounted: J, middleware: [G(r3), Q({ crossAxis: t3.includes("-"), fallbackStrategy: "bestFit", fallbackAxisSideDirection: "none", padding: 8 }), X({ padding: 8 }), Z({ apply({ availableHeight: e4, elements: t4 }) {
|
|
1440
|
+
let r4 = e4;
|
|
1441
|
+
if (e4 < Il) {
|
|
1442
|
+
const t5 = Math.floor(e4 / m2) * m2 - m2 / 2;
|
|
1443
|
+
r4 = Math.max(t5, b2);
|
|
1444
|
+
}
|
|
1445
|
+
Object.assign(t4.floating.style, { maxHeight: `${r4}px`, overflowY: "auto" });
|
|
1446
|
+
}, padding: 8 })] }), y2 = f2.context, T2 = ee(y2, { enabled: i3 }), x2 = te(y2, { bubbles: { escapeKey: true } }), w2 = re(y2), k2 = ne([T2, x2, w2]);
|
|
1447
|
+
return u(() => ({ open: h3, setOpen: g3, ...k2, ...f2, modal: n3, labelId: l3, descriptionId: c3, setLabelId: s3, setDescriptionId: d3, nodeId: p2 }), [h3, g3, k2, f2, n3, l3, c3, p2]);
|
|
1448
|
+
}({ modal: t2, initialOpen: r2, placement: n2, offsetPx: o2, open: a2, onOpenChange: i2, enableClickMiddleware: s2 }), d2 = oe(), h2 = l2 && null === d2, g2 = c2.nodeId;
|
|
1449
|
+
return w(Nl, { children: w(ie, { id: g2, children: w(El.Provider, { value: { ...c2, popupParentNodeId: d2, blockInteraction: h2 }, children: e2 }) }) });
|
|
1450
|
+
}
|
|
1451
|
+
function Ol() {
|
|
1452
|
+
const e2 = g(El);
|
|
1453
|
+
if (null == e2) throw new Error("Popup components must be wrapped in <PopupManager />");
|
|
1454
|
+
return e2;
|
|
1455
|
+
}
|
|
1456
|
+
function Ll({ children: e2 }) {
|
|
1457
|
+
const t2 = Ol(), r2 = t2.refs.setReference, n2 = t2.open ? "open" : "closed", o2 = { ...t2.getReferenceProps(), ref: r2, "data-state": n2 };
|
|
1458
|
+
return w(k, { children: e2(o2) });
|
|
1459
|
+
}
|
|
1460
|
+
const Fl = Xo((e2) => c.createElement("svg", { width: 10, height: 10, viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M1.23712 1.23718L8.76283 8.76289", stroke: "#182428", strokeWidth: 0.8, strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.76288 1.23718L1.23717 8.76289", stroke: "#182428", strokeWidth: 0.8, strokeMiterlimit: 10 })), "Cross");
|
|
1461
|
+
function _l({ Component: e2, stylists: t2 }) {
|
|
1462
|
+
return w(e2, { stylists: [kt(bt["tiny-icon"]), ...t2 ?? []], size: 9 });
|
|
1463
|
+
}
|
|
1464
|
+
const Wl = Xo((e2) => c.createElement("svg", { width: 11, height: 10, viewBox: "0 0 11 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M1.03625 2.20312H9.96378", stroke: "#182428" }), c.createElement("path", { d: "M1.03625 5H9.96378", stroke: "#182428" }), c.createElement("path", { d: "M1.03625 7.79688H7.24223", stroke: "#182428" })), "Sort"), Bl = kt(null, ht({ display: "flex", alignItems: "center", borderRadius: "md", border: "{borderWidths.lg} solid transparent", maxWidth: "fit-content", justifyContent: "center", "&:hover": { borderColor: "border.intent.action.hover", backgroundColor: "surface.intent.action.discrete.hover" }, "&[data-active='true']": { backgroundColor: "surface.intent.action.discrete.active", borderColor: "border.intent.action.active" }, "&:has(> .Tight-component:focus-visible)": { outline: "4px solid", outlineColor: "border.layout" } }), ea), Hl = kt(null, ht({ display: "flex", alignItems: "center", justifyContent: "center", gap: "5px", backgroundColor: "transparent", padding: "6px 0 6px 6px", border: "none", outline: "none", cursor: "pointer" })), zl = kt(null, ht({ display: "flex", alignItems: "center", justifyContent: "center", backgroundColor: "transparent", padding: 0, margin: "6px 6px 6px 5px", border: "none", outline: "none", position: "relative", cursor: "pointer", "&::before": { content: "''", position: "absolute", top: "-9px", right: "-7px", bottom: "-9px", left: "-5px" }, "&:focus-visible": { borderRadius: "sm", outline: "4px solid", outlineColor: "border.layout" } })), Vl = kt(null, ht({ padding: "0 6px 0 0", display: "flex", alignItems: "center" }));
|
|
1465
|
+
function jl({ onClearClick: e2, columnName: t2, active: r2, popupTriggerProps: n2 }) {
|
|
1466
|
+
const o2 = r2 || "open" === (n2 == null ? void 0 : n2["data-state"]);
|
|
1467
|
+
return C("div", { ...Bl, "data-active": o2, children: [C("button", { ...Hl, ...n2, children: [w(Sl, { children: t2 }), !o2 && w("div", { ...Vl, children: w(_l, { Component: Wl }) })] }), o2 && w("button", { ...zl, onClick: e2, children: w(_l, { Component: Fl }) })] });
|
|
1468
|
+
}
|
|
1469
|
+
const ql = mt({ base: { border: "{borderWidths.md} solid", borderColor: "border.layout", background: "surface.background", borderRadius: "zero", boxShadow: "box-shadow", animation: "appear.instant", display: "flex", flexShrink: 1, width: "max-content", position: "absolute", top: 0, left: 0, "& *": { boxSizing: "border-box" } }, variants: { type: { reaction: { borderRadius: "sm" } } } });
|
|
1470
|
+
function $l({ initialFocus: e2 = true, style: t2, ref: r2, type: n2, ...o2 }) {
|
|
1471
|
+
const { context: a2, blockInteraction: i2, ...l2 } = Ol(), s2 = le([l2.refs.setFloating, r2]), c2 = kt(bt.popup, ql({ type: n2 }));
|
|
1472
|
+
return a2.open ? C(k, { children: [i2 && w(se, { lockScroll: true }), w(ce, { children: w(de, { context: a2, modal: l2.modal, initialFocus: e2 ? void 0 : -1, children: w("div", { ref: s2, ...c2, style: { ...l2.floatingStyles, ...t2 }, ...l2.getFloatingProps(o2), "aria-labelledby": l2.labelId, "aria-describedby": l2.descriptionId, children: o2.children }) }) })] }) : null;
|
|
1473
|
+
}
|
|
1474
|
+
const Ul = mt({ base: { border: "none", background: "none", paddingLeft: "10px", paddingRight: "10px", paddingTop: 0, paddingBottom: "8px", margin: 0, cursor: "pointer", display: "flex", width: "100%", outline: "none", "& > .Tight-text": { color: "typography.intent.action" }, "&:hover > .Tight-text": { color: "typography.intent.action.hover" }, "&:focus-visible > .Tight-text": { color: "typography.intent.action.active" } }, variants: { active: { true: { "& > .Tight-text": { color: "typography.intent.action.active" } } } } }), Kl = kt(null, ht({ display: "flex", justifyContent: "flex-start" }));
|
|
1475
|
+
function Yl({ onClick: e2, children: t2, active: r2 }) {
|
|
1476
|
+
const n2 = kt(bt["popup-sort-row"], Ul({ active: r2 }), na);
|
|
1477
|
+
return w("button", { onClick: e2, ...n2, children: w(no, { stylists: [Kl], children: t2 }) });
|
|
1478
|
+
}
|
|
1479
|
+
const Gl = kt(null, ht({ display: "flex", flexDirection: "column", alignItems: "flex-start", width: "100%" })), Ql = kt(null, ht({ paddingTop: "10px", paddingLeft: "10px", paddingRight: "10px", paddingBottom: "8px", color: "typography.base.weak" }));
|
|
1480
|
+
function Xl({ sortDef: e2, sortAscDisplay: t2, sortDescDisplay: r2, handleSortClick: n2, sortInstance: o2 }) {
|
|
1481
|
+
const a2 = Ol(), i2 = (e3) => {
|
|
1482
|
+
n2(e3), a2 == null ? void 0 : a2.setOpen(false);
|
|
1483
|
+
};
|
|
1484
|
+
return C("div", { ...Gl, children: [w(Sl, { stylists: [Ql], children: "Sort by:" }), w(Yl, { onClick: () => i2({ orderBy: e2, direction: "ASC" }), active: "ASC" === (o2 == null ? void 0 : o2.direction), children: t2 }), w(Yl, { onClick: () => i2({ orderBy: e2, direction: "DESC" }), active: "DESC" === (o2 == null ? void 0 : o2.direction), children: r2 })] });
|
|
1485
|
+
}
|
|
1486
|
+
const Zl = ht({ display: "flex", alignItems: "center", gap: "5px", backgroundColor: "surface.intent.action.discrete", padding: "6px", borderRadius: "md", border: "{borderWidths.md} solid transparent", outline: "none", boxShadow: "0 0 0 0 transparent", width: "fit-content", position: "relative", cursor: "pointer", "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout" }, "&:disabled": { cursor: "default" }, "&:enabled:hover": { borderColor: "border.intent.action.hover", backgroundColor: "surface.intent.action.discrete.hover" }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.action.discrete.active", borderColor: "transparent" }, "&::before": { content: "''", position: "absolute", top: "-11px", left: "-11px", right: "-11px", bottom: "-11px" } }), Jl = kt(bt["button-discrete-small"], Zl, ea);
|
|
1487
|
+
function es({ children: e2, active: t2, disabled: r2, onClick: n2, popupTriggerProps: o2, ariaLabel: a2, ariaExpanded: i2 }) {
|
|
1488
|
+
const [l2, s2] = v(false), c2 = t2 ?? function(e3) {
|
|
1489
|
+
switch (e3) {
|
|
1490
|
+
case "open":
|
|
1491
|
+
return true;
|
|
1492
|
+
case "closed":
|
|
1493
|
+
return false;
|
|
1494
|
+
case void 0:
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1497
|
+
}(o2 == null ? void 0 : o2["data-state"]);
|
|
1498
|
+
return w("button", { type: "button", ...Jl, onClick: (e3) => {
|
|
1499
|
+
void 0 === c2 && s2(!l2), n2 && n2(e3);
|
|
1500
|
+
}, "data-active": c2 ?? l2, disabled: r2, ...o2, "aria-label": a2, "aria-expanded": i2, children: e2 });
|
|
1501
|
+
}
|
|
1502
|
+
const ts = { minWidth: "140px" };
|
|
1503
|
+
function rs({ columnName: e2, sortDef: t2, sortAscDisplay: r2, sortDescDisplay: n2 }) {
|
|
1504
|
+
const o2 = g(ul);
|
|
1505
|
+
if (!o2) return null;
|
|
1506
|
+
const { sortInstance: a2, setSortInstance: i2 } = o2, l2 = (a2 == null ? void 0 : a2.orderBy) === t2, s2 = () => {
|
|
1507
|
+
i2(void 0);
|
|
1508
|
+
};
|
|
1509
|
+
return t2 && r2 && n2 ? C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (t3) => w(jl, { active: l2, onClearClick: s2, columnName: e2, popupTriggerProps: t3 }) }), w($l, { style: ts, children: w(Xl, { sortDef: t2, sortAscDisplay: r2, sortDescDisplay: n2, handleSortClick: (e3) => {
|
|
1510
|
+
i2(e3);
|
|
1511
|
+
}, sortInstance: a2 }) })] }) : w(es, { disabled: true, children: w(Sl, { children: e2 }) });
|
|
1512
|
+
}
|
|
1513
|
+
const ns = kt(null, ht({ paddingLeft: "19px" }));
|
|
1514
|
+
function os({ columnName: e2, sortDef: t2, sortAscDisplay: r2, sortDescDisplay: n2 }) {
|
|
1515
|
+
return w("div", { ...ns, children: w(rs, { columnName: e2, sortDef: t2, sortAscDisplay: r2, sortDescDisplay: n2 }) });
|
|
1516
|
+
}
|
|
1517
|
+
const as = { ASC: "Oldest to Newest", DESC: "Newest to Oldest" };
|
|
1518
|
+
function is() {
|
|
1519
|
+
const [e2, t2] = v(void 0);
|
|
1520
|
+
return { sortInstance: e2, setSortInstance: m((e3) => {
|
|
1521
|
+
!function(e4) {
|
|
1522
|
+
if (void 0 === e4) return true;
|
|
1523
|
+
const t3 = (e4.orderBy && e4.orderBy in di) ?? false, r2 = (e4.direction && e4.direction in ui) ?? false;
|
|
1524
|
+
return t3 && r2;
|
|
1525
|
+
}(e3) ? t2(void 0) : t2(e3);
|
|
1526
|
+
}, [t2]), apiSort: e2 };
|
|
1527
|
+
}
|
|
1528
|
+
const ls = j(), ss = kt(null, ht({ paddingLeft: "25px" })), cs = [ls.accessor("latestMessage.author.userId", { id: hl, cell: ({ row: e2 }) => w(wl, { children: w(Tl, { text: e2.original.latestMessage.author.userId, isRead: "READ" === e2.original.readStatus }) }), header: () => w(Sl, { stylists: [ss], children: "From" }), size: 150, maxSize: 150 }), ls.accessor("subject", { id: gl, cell: ({ row: e2 }) => w(wl, { children: w(Tl, { text: e2.original.subject, isRead: "READ" === e2.original.readStatus }) }), header: () => w(Sl, { stylists: [ss], children: "Subject" }), size: 150 }), ls.accessor("latestMessage.text", { id: pl, cell: ({ row: e2 }) => w(wl, { children: w(Tl, { text: e2.original.latestMessage.text, isRead: "READ" === e2.original.readStatus }) }), header: () => w(Sl, { stylists: [ss], children: "Message" }), size: 200 }), ls.accessor("lastUpdatedDateTime", { id: vl, cell: ({ row: e2 }) => w(wl, { children: w(kl, { date: e2.original.lastUpdatedDateTime, isRead: "READ" === e2.original.readStatus }) }), header: () => w(os, { columnName: "Date", sortDef: "LAST_MESSAGE_CREATED_DATE_TIME", sortDescDisplay: as.DESC, sortAscDisplay: as.ASC }), size: 130, maxSize: 130 })];
|
|
1529
|
+
const ds = [];
|
|
1530
|
+
const us = ht({ display: "flex", flexDirection: "column", height: "250px", width: "100%", paddingBottom: "20px", alignItems: "center", justifyContent: "center", boxSizing: "border-box", textAlign: "center", minWidth: "900px", backgroundColor: "surface.background", gap: "10px" }), hs = kt(bt["empty-dashboard-layout"], us);
|
|
1531
|
+
function gs({ children: e2 }) {
|
|
1532
|
+
return w("div", { ...hs, "data-testid": "empty-dashboard-layout", children: e2 });
|
|
1533
|
+
}
|
|
1534
|
+
function ps({ Component: e2, stylists: t2 }) {
|
|
1535
|
+
return w(e2, { stylists: [kt(bt["large-icon"]), ...t2 ?? []], size: 25 });
|
|
1536
|
+
}
|
|
1537
|
+
const vs = Xo((e2) => c.createElement("svg", { width: 15, height: 15, viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M14.0625 2.14374L1.5625 6.90624L11.6813 12.8562L14.0625 2.14374Z", strokeWidth: 0.9375, strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.25624 10.8375L5.73124 12.8562L5.33749 9.12499L13.4687 2.73749", strokeWidth: 0.9375, strokeMiterlimit: 10 })), "Paperplane"), ms = () => {
|
|
1538
|
+
Fi("Conversation", { routeProps: { conversationId: null } });
|
|
1539
|
+
}, bs = "Need help with your financials?", fs = "Talk to a bookkeeper";
|
|
1540
|
+
function ys() {
|
|
1541
|
+
return C(k, { children: [w(ps, { Component: vs }), w(to, { children: bs }), w(ol, { onClick: ms, children: w(to, { children: fs }) })] });
|
|
1542
|
+
}
|
|
1543
|
+
const Ts = "All caught up", xs = "We'll let you know if something comes up.";
|
|
1544
|
+
function ws() {
|
|
1545
|
+
return C(k, { children: [w(ps, { Component: vs }), w(to, { children: Ts }), w(no, { children: xs })] });
|
|
1546
|
+
}
|
|
1547
|
+
const ks = ht({ minWidth: "900px" });
|
|
1548
|
+
function Cs(e2) {
|
|
1549
|
+
return w(e2 ? ws : ys, {});
|
|
1550
|
+
}
|
|
1551
|
+
function Ss({ sortInstance: e2, setSortInstance: t2, conversations: r2, paginationControls: n2, isFilling: o2 }) {
|
|
1552
|
+
var _a2;
|
|
1553
|
+
const a2 = function({ conversations: e3 }) {
|
|
1554
|
+
return q({ data: e3 ?? ds, manualPagination: true, manualSorting: true, manualFiltering: true, manualGrouping: true, rowCount: (e3 == null ? void 0 : e3.length) ?? ds.length, columns: cs, getCoreRowModel: $(), getRowId: (e4) => e4.id });
|
|
1555
|
+
}({ conversations: r2 }), { query: { data: i2 }, isFilling: l2 } = pi({ limit: 1, filter: { resolutionStatus: { values: ["OPEN", "CLOSED"] } } }), s2 = !Jt((_a2 = i2 == null ? void 0 : i2.data) == null ? void 0 : _a2[0]) && !l2;
|
|
1556
|
+
return C("div", { className: ks, children: [w("div", { id: zo }), C(ja.Provider, { value: n2, children: [C(St, { children: [w(Mt, { children: "Conversations" }), C(sl, { children: [w(Ka, {}), w(il, {})] })] }), w(dl, { dashboard: "businessOwnerDashboard", children: o2 ? w(Ja, { numColumns: 4 }) : C(k, { children: [w(ul.Provider, { value: { sortInstance: e2, setSortInstance: t2 }, children: w(wi, { headerGroups: a2.getHeaderGroups() }) }), r2.length > 0 ? w(Ci, { children: a2.getRowModel().rows.map((e3) => w(tl, { rowData: e3 }, e3.id)) }) : w(gs, { children: Cs(s2) })] }) })] })] });
|
|
1557
|
+
}
|
|
1558
|
+
const Es = { all: () => ["summaries", {}], of: (e2) => ["summaries", e2 ?? {}] }, Is = async (e2) => {
|
|
1559
|
+
const t2 = e2.queryKey, r2 = { path: "/v6/summaries/query", bodyParams: { ...t2[1] }, accessToken: t2[2].accessToken, method: "POST", endpointManager: _a(t2[2].environment) }, n2 = await gn(r2);
|
|
1560
|
+
return "SUCCESS" === n2.result && void 0 !== n2.data ? { data: n2.data } : { data: void 0 };
|
|
1561
|
+
};
|
|
1562
|
+
function Ps(e2) {
|
|
1563
|
+
const t2 = Ot(e2.month, e2.year);
|
|
1564
|
+
return n2 = { select: (e3) => {
|
|
1565
|
+
var _a2, _b2;
|
|
1566
|
+
return (_b2 = (_a2 = e3 == null ? void 0 : e3.data) == null ? void 0 : _a2[0]) == null ? void 0 : _b2.summary;
|
|
1567
|
+
} }, dr({ queryKey: (r2 = { limit: 1, filter: { date: { value: t2, operator: "EQUALS" }, status: { values: ["ACTIVE"], operator: "IN" } }, sort: { direction: "DESC", orderBy: "DATE" } }) ? Es.of(r2) : Es.all(), queryFn: Is, ...n2 });
|
|
1568
|
+
var r2, n2;
|
|
1569
|
+
}
|
|
1570
|
+
const As = kt(bt.body, At({ body: "default" }));
|
|
1571
|
+
function Ds({ children: e2, stylists: t2 = [] }) {
|
|
1572
|
+
return tr(e2) ? null : w(Jn, { size: "med", weight: "med", stylists: [As, ...t2], children: e2 });
|
|
1573
|
+
}
|
|
1574
|
+
const Ms = mt({ base: { color: "typography.base.weak", boxSizing: "border-box", position: "absolute", bottom: "0", left: "0", right: "0", top: "0", display: "flex", justifyContent: "center", alignItems: "center", pointerEvents: "none", margin: "0 auto", transform: "rotate(-20deg)", opacity: "80%" }, variants: { size: { sm: { fontSize: "4em" }, lg: { fontSize: "7em" } } }, defaultVariants: { size: "lg" } });
|
|
1575
|
+
function Ns({ size: e2 }) {
|
|
1576
|
+
const t2 = kt(null, Ms({ size: e2 }));
|
|
1577
|
+
return w("div", { ...t2, children: "Sample" });
|
|
1578
|
+
}
|
|
1579
|
+
const Rs = kt(null, ht({ display: "flex", flexDirection: "column", gap: "6px", width: "100%" })), Os = mt({ base: { height: 16 }, variants: { width: { w92: { width: "92%" }, w90: { width: "90%" }, w88: { width: "88%" }, w87: { width: "87%" }, w85: { width: "85%" }, w70: { width: "70%" } } } }), Ls = [{ width: "w85" }, { width: "w90" }, { width: "w88" }, { width: "w85" }, { width: "w92" }, { width: "w87" }, { width: "w90" }, { width: "w85" }, { width: "w88" }, { width: "w90" }, { width: "w87" }, { width: "w85" }, { width: "w70" }];
|
|
1580
|
+
function Fs() {
|
|
1581
|
+
return w("div", { ...Rs, children: Ls.map((e2, t2) => w(Mo, { styles: Os({ width: e2 == null ? void 0 : e2.width }) }, t2)) });
|
|
1582
|
+
}
|
|
1583
|
+
const _s = mt({ base: { display: "flex", flex: "1 1 0", maxHeight: "247px", minHeight: "247px", background: "surface.foreground", border: "{borderWidths.lg} solid {colors.border.layout.strong}", borderRadius: "lg", padding: "10px", gap: "10px", alignItems: "flex-start", boxSizing: "border-box", position: "relative", minWidth: "900px", overflow: "auto", marginBottom: 10 }, variants: { isSample: { true: { pointerEvents: "none" }, false: {} } } }), Ws = kt(null, ht({ whiteSpace: "pre-wrap", display: "flex", alignItems: "center", gap: "10px", height: "100%" }));
|
|
1584
|
+
function Bs({ children: e2, stylists: t2 = [], isSample: r2, isFilling: n2 }) {
|
|
1585
|
+
const o2 = kt(null, _s({ isSample: r2 }));
|
|
1586
|
+
return w("div", { "data-testid": "financial-summary-layout", ...Pt([o2, ...t2]), children: n2 ? w(Fs, {}) : C(k, { children: [w(Ds, { stylists: [Ws], children: e2 }), r2 && w(Ns, {})] }) });
|
|
1587
|
+
}
|
|
1588
|
+
const Hs = { id: "mock_task_link_bank", priority: "HIGH", name: "Link your bank account", description: "Effortlessly track every dollar by linking your bank account", type: "LINK_BANK", dismissable: "DISMISSABLE", status: "ACTIVE" };
|
|
1589
|
+
function zs(e2) {
|
|
1590
|
+
return vn(`${function(e3) {
|
|
1591
|
+
return mn[e3];
|
|
1592
|
+
}(e2)}/v1`, "v1");
|
|
1593
|
+
}
|
|
1594
|
+
const Vs = ["INVALID_CREDENTIALS", "INSUFFICIENT_CREDENTIALS", "INVALID_MFA", "ITEM_LOGIN_REQUIRED", "NO_ACCOUNTS", "OAUTH_ERROR", "PENDING_DISCONNECT", "ADDITIONAL_CONSENT_REQUIRED"], js = kt(bt["button-tertiary"], ht({ color: "typography.intent.success", border: "{borderWidths.md} solid", borderColor: "border.intent.success", backgroundColor: "surface.intent.success", "& .Tight-text": { color: "typography.intent.success" }, "& path": { stroke: "icon.intent.success" }, "&:hover:not(:disabled)": { backgroundColor: "surface.intent.success.hover", borderColor: "border.intent.success.hover", "& .Tight-text": { color: "typography.intent.success.hover" }, "& path": { stroke: "icon.intent.success.hover" } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.success.active", borderColor: "border.intent.success.active", "& .Tight-text": { color: "typography.intent.success.active" }, "& path": { stroke: "icon.intent.success.active" } } }));
|
|
1595
|
+
function qs({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
1596
|
+
return w(ha, { stylists: [js, ...t2], ...r2, children: e2 });
|
|
1597
|
+
}
|
|
1598
|
+
const $s = kt(null, ht({ position: "fixed", inset: 0, minHeight: "100dvh", display: "grid", placeItems: "center", backgroundColor: "overlay" })), Us = kt(bt["alert-dialog"], ht({ background: "surface.background", borderRadius: "md", display: "flex", flexDirection: "column", padding: "16px", maxWidth: "360px", width: "100%", gap: "16px" })), Ks = kt(null, ht({ display: "flex", justifyContent: "flex-end", gap: "8px" }));
|
|
1599
|
+
const Ys = he.createConfirmation(ge(function({ show: e2, proceed: t2, title: r2, body: n2, buttons: o2 = [{ key: "ok", label: "OK" }] }) {
|
|
1600
|
+
const { context: a2 } = Y({ open: e2, strategy: "fixed" }), i2 = te(a2, { outsidePress: false, escapeKey: true }), l2 = re(a2, { role: "alertdialog" }), { getFloatingProps: s2 } = ne([i2, l2]);
|
|
1601
|
+
return e2 ? w(ce, { children: w(se, { lockScroll: true, ...$s, children: w(de, { context: a2, modal: true, returnFocus: true, children: C("div", { ...s2(), ...Us, children: [w(to, { children: r2 }), n2 && "string" == typeof n2 ? w(bl, { wrap: "wrap", children: n2 }) : w(k, { children: n2 }), w("div", { ...Ks, children: o2.map((e3) => {
|
|
1602
|
+
const r3 = ((e4) => {
|
|
1603
|
+
switch (e4) {
|
|
1604
|
+
case "delete":
|
|
1605
|
+
return fa;
|
|
1606
|
+
case "success":
|
|
1607
|
+
return qs;
|
|
1608
|
+
default:
|
|
1609
|
+
return ol;
|
|
1610
|
+
}
|
|
1611
|
+
})(e3.key);
|
|
1612
|
+
return w(r3, { onClick: () => e3.onClick ? t2(e3.onClick()) : t2(e3.key), children: w(to, { children: e3.label }) }, e3.key);
|
|
1613
|
+
}) })] }) }) }) }) : null;
|
|
1614
|
+
}));
|
|
1615
|
+
function Gs(e2, t2, r2, n2) {
|
|
1616
|
+
const o2 = 1 === r2 ? e2 : t2;
|
|
1617
|
+
return n2 ? `${r2} ${o2}` : o2;
|
|
1618
|
+
}
|
|
1619
|
+
const Qs = (e2) => {
|
|
1620
|
+
Ys({ title: "Uh oh!", body: (e2 ? `${e2} failed to link.` : "Something went wrong.") + " Please try again later." });
|
|
1621
|
+
}, Xs = (e2, t2) => Ys({ title: "Success!", body: `Successfully linked ${t2} ${e2} ${Gs("account", "accounts", t2)}. Your transactions should begin appearing in a few minutes.`, buttons: [{ key: "success", label: "Get started" }] });
|
|
1622
|
+
function Zs(e2, t2, r2) {
|
|
1623
|
+
return ue({ token: e2, onSuccess: async (e3, n2) => {
|
|
1624
|
+
try {
|
|
1625
|
+
const { plaidItem: o2 } = await async function({ publicToken: e4, metadata: t3, accessToken: r3, environment: n3 }) {
|
|
1626
|
+
if (!r3) throw new Error("Access token is required to create Plaid link token");
|
|
1627
|
+
const o3 = { path: "/banks2/webPlaidPublicToken", accessToken: r3, endpointManager: zs(n3) }, { url: a2, headers: i2 } = dn(o3);
|
|
1628
|
+
return await un({ url: a2, params: { publicToken: e4, plaidMetadata: t3 }, includeCredentials: true, extraHeaders: i2 });
|
|
1629
|
+
}({ publicToken: e3, metadata: n2, accessToken: t2, environment: r2 });
|
|
1630
|
+
await Xs(o2.apiInstitutionName, o2.plaidItemAccounts.length), await lr.invalidateQueries();
|
|
1631
|
+
} catch {
|
|
1632
|
+
Qs();
|
|
1633
|
+
}
|
|
1634
|
+
}, onExit: (e3, t3) => {
|
|
1635
|
+
var _a2;
|
|
1636
|
+
e3 && Qs((_a2 = t3 == null ? void 0 : t3.institution) == null ? void 0 : _a2.name);
|
|
1637
|
+
} });
|
|
1638
|
+
}
|
|
1639
|
+
function Js(e2) {
|
|
1640
|
+
const t2 = or(), r2 = cr(), [n2, o2] = v(""), { open: a2, ready: i2 } = Zs(n2, t2, r2);
|
|
1641
|
+
b(() => {
|
|
1642
|
+
i2 && n2 && a2();
|
|
1643
|
+
}, [i2, a2, n2]);
|
|
1644
|
+
return { linkPlaid: async () => {
|
|
1645
|
+
try {
|
|
1646
|
+
const n3 = await async function({ accessToken: e3, plaidItemId: t3, environment: r3 }) {
|
|
1647
|
+
if (!e3) throw new Error("Access token is required to create Plaid link token");
|
|
1648
|
+
const n4 = { path: "/banks2/createPlaidLinkToken", accessToken: e3, endpointManager: zs(r3) }, { url: o3, headers: a3 } = dn(n4);
|
|
1649
|
+
return oi({ url: o3, includeCredentials: true, extraHeaders: a3, params: t3 ? { plaidItemId: t3 } : void 0 });
|
|
1650
|
+
}({ accessToken: t2, plaidItemId: e2, environment: r2 });
|
|
1651
|
+
o2(n3.link_token);
|
|
1652
|
+
} catch {
|
|
1653
|
+
Qs();
|
|
1654
|
+
}
|
|
1655
|
+
} };
|
|
1656
|
+
}
|
|
1657
|
+
function ec({ task: e2 }) {
|
|
1658
|
+
var _a2;
|
|
1659
|
+
const { linkPlaid: t2 } = Js((_a2 = e2 == null ? void 0 : e2.meta) == null ? void 0 : _a2.plaidItemId);
|
|
1660
|
+
return w(Fa, { task: e2, handleClick: t2 });
|
|
1661
|
+
}
|
|
1662
|
+
const tc = { all: () => ["banks", "plaidItems"] }, rc = async (e2) => {
|
|
1663
|
+
const t2 = e2.queryKey, r2 = { path: "/banks/plaidItems", accessToken: t2[2].accessToken, environment: t2[2].environment };
|
|
1664
|
+
return await li(r2);
|
|
1665
|
+
};
|
|
1666
|
+
function nc() {
|
|
1667
|
+
return e2 = { select: (e3) => {
|
|
1668
|
+
return t2 = e3, t2 == null ? void 0 : t2.filter((e4) => Vs.includes(e4.apiErrorCode || ""));
|
|
1669
|
+
var t2;
|
|
1670
|
+
} }, dr({ ...e2, queryKey: tc.all(), queryFn: rc });
|
|
1671
|
+
var e2;
|
|
1672
|
+
}
|
|
1673
|
+
const oc = { all: () => ["banks", "bankAccounts"] };
|
|
1674
|
+
const ac = async (e2) => {
|
|
1675
|
+
const t2 = e2.queryKey, r2 = { path: "/banks/accounts", accessToken: t2[2].accessToken, environment: t2[2].environment }, n2 = await li(r2), o2 = void 0 !== n2.data ? n2.data.map((e3) => ({ ...e3, id: `${Ki.BANK_ACCOUNT}_${e3.id}` })) : [];
|
|
1676
|
+
return { ...n2, data: o2 };
|
|
1677
|
+
};
|
|
1678
|
+
function ic(e2) {
|
|
1679
|
+
return dr({ ...e2, queryKey: oc.all(), queryFn: ac });
|
|
1680
|
+
}
|
|
1681
|
+
const lc = (e2, t2) => {
|
|
1682
|
+
const r2 = Number(t2.split("_")[1]);
|
|
1683
|
+
return e2 == null ? void 0 : e2.find((e3) => Number(e3.glAccountId) === r2);
|
|
1684
|
+
};
|
|
1685
|
+
const sc = (e2) => {
|
|
1686
|
+
const { query: { data: t2 } } = ic({ select: (t3) => {
|
|
1687
|
+
return r2 = t3 == null ? void 0 : t3.data, n2 = e2, r2 == null ? void 0 : r2.find((e3) => e3.id === n2);
|
|
1688
|
+
var r2, n2;
|
|
1689
|
+
} });
|
|
1690
|
+
return t2;
|
|
1691
|
+
}, cc = () => ic({ select: (e2) => {
|
|
1692
|
+
return t2 = e2 == null ? void 0 : e2.data, void 0 !== (t2 == null ? void 0 : t2.find((e3) => "PLAID" === e3.apiName));
|
|
1693
|
+
var t2;
|
|
1694
|
+
} }), dc = kt(null, ht({ display: "flex", alignItems: "center", gap: "15px", borderRadius: "md", border: "1px solid {colors.border.layout}", background: "surface.foreground", width: "fit-content" })), uc = kt(bt["month-picker-left-button"], ht({ border: "none", borderRight: "1px solid {colors.border.layout}", _disabled: { cursor: "default" } })), hc = kt(bt["month-picker-right-button"], ht({ border: "none", borderLeft: "1px solid {colors.border.layout}", _disabled: { cursor: "default" } })), gc = kt(null, ht({ cursor: "default", display: "flex", justifyContent: "center" })), pc = (e2) => 0 === e2.month ? { month: 11, year: e2.year - 1 } : { month: e2.month - 1, year: e2.year }, vc = (e2) => 11 === e2.month ? { month: 0, year: e2.year + 1 } : { month: e2.month + 1, year: e2.year };
|
|
1695
|
+
function mc({ period: e2, setPeriod: t2, disableNext: r2 = false, disablePrev: n2 = false }) {
|
|
1696
|
+
const o2 = Rt(e2.year, e2.month, 1), a2 = Qt(o2, { abbreviateMonth: true });
|
|
1697
|
+
return C("div", { ...dc, children: [w(ol, { stylists: [uc], onClick: () => t2(pc(e2)), disabled: n2, children: w(Pa, { Component: Va }) }), w(to, { stylists: [gc], children: a2 }), w(ol, { stylists: [hc], onClick: () => t2(vc(e2)), disabled: r2, children: w(Pa, { Component: Aa }) })] });
|
|
1698
|
+
}
|
|
1699
|
+
const bc = kt(null, ht({ display: "grid", justifyContent: "space-evenly", gridTemplateColumns: { base: "repeat(1, 400px)", md: "repeat(2, 400px)", "1.5xl": "400px 400px 400px minmax(150px, 400px)" }, gap: "10px", maxWidth: "1440px" }));
|
|
1700
|
+
function fc({ children: e2 }) {
|
|
1701
|
+
return w("div", { ...bc, children: e2 });
|
|
1702
|
+
}
|
|
1703
|
+
const yc = kt(bt["progress-bar"], ht({ height: "32px", backgroundColor: "surface.intent.secondary", display: "flex", flexDirection: "row", alignItems: "center", border: "{borderWidths.lg} solid {colors.border.layout.weak}", borderRadius: "sm" })), Tc = kt(bt["progress-bar-fill"], ht({ borderRadius: "sm", height: "100%", display: "flex", alignItems: "center" })), xc = kt(bt["tile-bar-label"], ht({ paddingLeft: "10px" }));
|
|
1704
|
+
function wc({ label: e2 = "", percentage: t2, color: r2, width: n2 }) {
|
|
1705
|
+
const o2 = void 0 === n2 ? "100%" : `${n2}px`, a2 = t2 >= 50, i2 = Pt([Tc, kt(null, r2)]);
|
|
1706
|
+
return C("div", { ...yc, style: { width: o2 }, children: [w("div", { ...i2, style: { width: `${t2}%` }, children: a2 && w("div", { ...xc, children: w(bl, { children: e2 }) }) }), !a2 && w("div", { ...xc, children: w(bl, { children: e2 }) })] });
|
|
1707
|
+
}
|
|
1708
|
+
const kc = kt(bt["metric-md"], At({ metric: "md" }));
|
|
1709
|
+
function Cc(e2) {
|
|
1710
|
+
return w("div", { ...kc, children: e2.children });
|
|
1711
|
+
}
|
|
1712
|
+
const Sc = kt(null, ht({ display: "flex", alignItems: "center", justifyContent: "space-between", gap: "45px", width: "100%" })), Ec = kt(null, ht({ overflow: "visible", width: "80px", display: "flex", justifyContent: "end" })), Ic = ({ label: e2, amount: t2, total: r2, colorCss: n2 }) => {
|
|
1713
|
+
const o2 = r2 > 0 ? function(e3, t3, r3, n3 = 0, o3 = 100) {
|
|
1714
|
+
return n3 + (e3 - t3) * (o3 - n3) / (r3 - t3);
|
|
1715
|
+
}(t2, 0, r2) : 0;
|
|
1716
|
+
return C("div", { ...Sc, children: [w(wc, { label: e2, percentage: o2, color: n2 }), w("div", { ...Ec, children: w(Cc, { children: Xn(t2) }) })] });
|
|
1717
|
+
}, Pc = { netIncome: 0, income: 0, expenses: 0, absoluteSum: 0 }, Ac = (e2) => {
|
|
1718
|
+
var _a2, _b2, _c2, _d2;
|
|
1719
|
+
if (void 0 === e2.result || "FAILURE_NO_DATA" === e2.result) return Pc;
|
|
1720
|
+
const t2 = (_b2 = (_a2 = e2.json) == null ? void 0 : _a2.data) == null ? void 0 : _b2[0];
|
|
1721
|
+
if (Jt(t2)) return Pc;
|
|
1722
|
+
const r2 = ((_c2 = t2.income) == null ? void 0 : _c2.total) ?? 0, n2 = ((_d2 = t2.expenses) == null ? void 0 : _d2.total) ?? 0, o2 = M(r2).plus(n2).toNumber();
|
|
1723
|
+
return { netIncome: t2.netIncome ?? 0, income: r2, expenses: n2, absoluteSum: o2 };
|
|
1724
|
+
};
|
|
1725
|
+
const Dc = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M13.3131 0.489685V4.15097H9.65182", strokeMiterlimit: 10 }), c.createElement("path", { d: "M2.32925 15.1348V11.4735H5.99054", strokeMiterlimit: 10 }), c.createElement("path", { d: "M1.34228 9.57602C1.18256 9.00181 1.10327 8.40823 1.10669 7.81223C1.1074 6.38654 1.56211 4.99811 2.4049 3.8482C3.2477 2.69828 4.4348 1.84664 5.79412 1.41671C7.15345 0.986775 8.61437 1.00089 9.96513 1.45702C11.3159 1.91314 12.4863 2.78757 13.3067 3.95356", strokeMiterlimit: 10 }), c.createElement("path", { d: "M14.2937 6.04849C14.4534 6.6227 14.5327 7.21628 14.5293 7.81228C14.5286 9.23797 14.0739 10.6264 13.2311 11.7763C12.3883 12.9262 11.2012 13.7779 9.84185 14.2078C8.48253 14.6377 7.02161 14.6236 5.67085 14.1675C4.32008 13.7114 3.14967 12.8369 2.32925 11.671", strokeMiterlimit: 10 })), "Sync"), Mc = kt(null, aa, ht({ position: "absolute", left: 1, right: 1, bottom: 1, width: "calc(100% - 2)", height: "44px", background: "surface.intent.primary", border: "none", borderRadius: 0, gap: 9, color: "icon.intent.primary", pointerEvents: "all", "&:hover:not(:disabled)": { backgroundColor: "surface.intent.primary.hover", borderColor: "border.intent.primary.hover", "& .Tight-text": { color: "typography.intent.primary.hover" } } }), ea);
|
|
1726
|
+
function Nc() {
|
|
1727
|
+
const { linkPlaid: e2 } = Js();
|
|
1728
|
+
return C("button", { onClick: e2, ...Mc, children: [w(Go, { Component: Dc }), w(bl, { intent: "primary", children: "Link Account" })] });
|
|
1729
|
+
}
|
|
1730
|
+
const Rc = ht({ width: 266, minHeight: 32 });
|
|
1731
|
+
function Oc() {
|
|
1732
|
+
return w(Mo, { styles: Rc });
|
|
1733
|
+
}
|
|
1734
|
+
const Lc = ht({ backgroundColor: "money.positive.weak" }), Fc = ht({ backgroundColor: "money.negative.weak" }), _c = Object.freeze({ income: 20200, expenses: 5043, netIncome: 15157, absoluteSum: Math.abs(20200) + Math.abs(5043) }), Wc = Object.freeze({ income: 0, expenses: 0, netIncome: 0, absoluteSum: 0 }), Bc = ({ defaultRange: e2 = Lt.THIS_YEAR, isSample: t2 = false }) => {
|
|
1735
|
+
const { query: { data: r2 }, isFilling: n2 } = function({ filter: e3 }) {
|
|
1736
|
+
return xn({ filter: e3, select: Ac });
|
|
1737
|
+
}({ filter: e2 });
|
|
1738
|
+
let o2;
|
|
1739
|
+
return o2 = t2 ? _c : r2 ?? Wc, C(Rn, { isSample: t2, children: [w(An, { title: "Profit + Loss" }), w(Mn, { children: n2 ? C(Ro, { children: [w(Oc, {}), w(Oc, {})] }) : C(k, { children: [w(Vn, { title: Xn(o2.netIncome), label: "Profit" }), C(qn, { children: [w(Ic, { amount: o2.income, total: o2.absoluteSum, colorCss: Lc, label: "Income" }), w(Ic, { amount: o2.expenses, total: o2.absoluteSum, colorCss: Fc, label: "Expenses" })] })] }) }), t2 && w(Ns, { size: "sm" }), t2 && w(Nc, {})] });
|
|
1740
|
+
}, Hc = ({ filter: e2 }) => ["reports", "cashflow", { filter: e2 }];
|
|
1741
|
+
const zc = { moneyIn: 0, moneyOut: 0, netMoneyIn: 0 };
|
|
1742
|
+
function Vc(e2) {
|
|
1743
|
+
var _a2;
|
|
1744
|
+
const t2 = void 0 === e2.result || "FAILURE_NO_DATA" === e2.result, r2 = (_a2 = e2.json) == null ? void 0 : _a2.data[0];
|
|
1745
|
+
return t2 || Jt(r2) || Jt(r2.operatingActivities) || !r2.operatingActivities.children ? zc : function(e3) {
|
|
1746
|
+
let t3 = new M(0), r3 = new M(0);
|
|
1747
|
+
for (const n2 of e3.children) n2.total < 0 ? r3 = r3.plus(M(n2.total).abs()) : t3 = t3.plus(n2.total);
|
|
1748
|
+
return { moneyIn: t3.toNumber(), moneyOut: r3.toNumber(), netMoneyIn: e3.total };
|
|
1749
|
+
}(r2.operatingActivities);
|
|
1750
|
+
}
|
|
1751
|
+
const jc = async (e2) => {
|
|
1752
|
+
const t2 = e2.queryKey, r2 = t2[2], n2 = t2[3].accessToken, o2 = t2[3].environment, a2 = { path: "/reports/cashFlowStatementDirect", bodyParams: { exportType: "JSON", ...Wt(r2.filter) }, method: "POST", accessToken: n2, endpointManager: fn(o2) };
|
|
1753
|
+
return Vc(await pn(a2));
|
|
1754
|
+
};
|
|
1755
|
+
const qc = ht({ backgroundColor: "money.positive.weak" }), $c = ht({ backgroundColor: "money.negative.weak" }), Uc = Object.freeze({ moneyIn: 25300, moneyOut: 8150, netMoneyIn: 17150 }), Kc = Object.freeze({ moneyIn: 0, moneyOut: 0, netMoneyIn: 0 }), Yc = ({ defaultRange: e2 = Lt.THIS_YEAR, isSample: t2 = false }) => {
|
|
1756
|
+
const { query: { data: r2, isFetched: n2 }, isFilling: o2 } = function({ filter: e3 }) {
|
|
1757
|
+
return dr({ queryKey: Hc({ filter: e3 }), queryFn: jc });
|
|
1758
|
+
}({ filter: e2 });
|
|
1759
|
+
let a2;
|
|
1760
|
+
a2 = t2 ? Uc : r2 ?? Kc;
|
|
1761
|
+
let i2 = 0;
|
|
1762
|
+
return (t2 || n2) && (i2 = Math.abs(a2.moneyIn) + Math.abs(a2.moneyOut)), C(Rn, { isSample: t2, children: [w(An, { title: "Cash Flow" }), w(Mn, { children: o2 ? C(Ro, { children: [w(Oc, {}), w(Oc, {})] }) : C(k, { children: [w(Vn, { title: Xn(a2.netMoneyIn), label: "Change in Cash" }), C(qn, { children: [w(Ic, { amount: a2.moneyIn, total: i2, colorCss: qc, label: "Money In" }), w(Ic, { amount: a2.moneyOut, total: i2, colorCss: $c, label: "Money Out" })] })] }) }), t2 && w(Ns, { size: "sm" }), t2 && w(Nc, {})] });
|
|
1763
|
+
}, Gc = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: "10px", width: "100%" })), Qc = kt(null, ht({ display: "flex", justifyContent: "end" }));
|
|
1764
|
+
function Xc({ color: e2, bulletLabel: t2, moneySummary: r2 }) {
|
|
1765
|
+
return C("div", { ...Gc, children: [w(go, { color: e2, label: t2 }), w("div", { ...Qc, children: w(bl, { children: r2 }) })] });
|
|
1766
|
+
}
|
|
1767
|
+
const Zc = { total: 0, children: [] }, Jc = (e2) => {
|
|
1768
|
+
var _a2, _b2;
|
|
1769
|
+
const t2 = void 0 === e2.result || "FAILURE_NO_DATA" === e2.result, r2 = (_b2 = (_a2 = e2.json) == null ? void 0 : _a2.data) == null ? void 0 : _b2[0];
|
|
1770
|
+
return t2 || Jt(r2) || Jt(r2.expenses) || !r2.expenses.children ? Zc : { total: r2.expenses.total ?? 0, children: (n2 = r2.expenses.children, n2.sort((e3, t3) => (t3.total ?? 0) - (e3.total ?? 0)).slice(0, 3).map((e3) => ({ name: e3.name ?? "", total: e3.total ?? 0 }))) };
|
|
1771
|
+
var n2;
|
|
1772
|
+
};
|
|
1773
|
+
const ed = kt(null, ht({ display: "flex", gap: "10px", alignItems: "center" })), td = ht({ width: "200px", height: "16px", backgroundColor: "brand.secondary" }), rd = kt(null, td);
|
|
1774
|
+
function nd({ bulletAmount: e2 = 3, shimmer: t2 = false }) {
|
|
1775
|
+
return w(k, { children: Array.from({ length: e2 }, (e3, r2) => C("div", { ...ed, children: [w(go, { color: lo.var("colors.brand.secondary") }), t2 ? w(Mo, { styles: td }) : w("div", { ...rd })] }, r2)) });
|
|
1776
|
+
}
|
|
1777
|
+
const od = kt(null, ht({ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%" })), ad = [lo.var("colors.brand.primary"), lo.var("colors.brand.success"), lo.var("colors.brand.action")], id = Object.freeze({ total: 5043, children: [{ name: "Plane/Train/Bus", total: 2500 }, { name: "Business Meals", total: 1800 }, { name: "Employee Entertainment", total: 743 }] }), ld = Object.freeze({ total: 0, children: [] });
|
|
1778
|
+
function sd({ defaultRange: e2 = Lt.THIS_YEAR, monthIndex: t2, isSample: r2 = false }) {
|
|
1779
|
+
const n2 = De((e3) => e3.externalOptions).dataVisualizationColors ?? ad, { query: { data: o2 }, isFilling: a2 } = function({ filter: e3 }) {
|
|
1780
|
+
return xn({ filter: e3, select: Jc });
|
|
1781
|
+
}({ filter: e2 });
|
|
1782
|
+
let i2;
|
|
1783
|
+
i2 = r2 ? id : o2 ?? ld;
|
|
1784
|
+
const l2 = void 0 === t2 ? "Total Expenses" : `${Ht[t2]} Total`, s2 = i2.children.length > 0;
|
|
1785
|
+
return C(Rn, { isSample: r2, children: [w(An, { title: "Expenses" }), w(Mn, { children: a2 ? w(Ro, { children: w(nd, { shimmer: true }) }) : C(k, { children: [w("div", { ...od, children: w(Vn, { title: Xn(i2.total), label: l2 }) }), w(qn, { children: s2 ? i2.children.map((e3, t3) => w(Xc, { color: n2[t3], bulletLabel: e3.name, moneySummary: Xn(e3.total) }, t3)) : w(nd, {}) })] }) }), r2 && w(Ns, { size: "sm" }), r2 && w(Nc, {})] });
|
|
1786
|
+
}
|
|
1787
|
+
const cd = kt(null, ht({ minWidth: "150px", width: "100%", height: "300px", opacity: 0.6, background: "surface.intent.action.disabled", cursor: "not-allowed", border: "1px solid {colors.border.intent.action.disabled}", gap: "8px" }));
|
|
1788
|
+
function dd() {
|
|
1789
|
+
return C("button", { disabled: true, ...cd, children: [w(ps, { Component: Aa }), w(bl, { children: "Review Reports" }), w(no, { children: "Coming soon" })] });
|
|
1790
|
+
}
|
|
1791
|
+
const ud = kt(null, ht({ display: "flex", flexDirection: "column", gap: "10px", maxWidth: "1440px" }));
|
|
1792
|
+
function hd({ period: e2, handleDateChange: t2, todayPeriod: r2, showSamples: n2 }) {
|
|
1793
|
+
const o2 = (a2 = e2.month, { beginDate: Rt(i2 = e2.year, a2, 1), endDate: Rt(i2, a2 + 1, 0) });
|
|
1794
|
+
var a2, i2, l2, s2, c2, d2, u2, h2;
|
|
1795
|
+
return C("div", { ...ud, children: [C(St, { children: [w(Mt, { children: "Monthly Review" }), w(mc, { period: e2, setPeriod: t2, disableNext: (l2 = e2, s2 = r2, u2 = l2.month, h2 = s2.month, u2 === h2 && (c2 = l2.year, d2 = s2.year, c2 === d2)) })] }), C(fc, { children: [w(Bc, { defaultRange: o2, isSample: n2 }), w(Yc, { defaultRange: o2, isSample: n2 }), w(sd, { defaultRange: o2, monthIndex: e2.month, isSample: n2 }), w(dd, {})] })] });
|
|
1796
|
+
}
|
|
1797
|
+
const gd = ht({ width: "100%", height: 72, minWidth: "300px" });
|
|
1798
|
+
function pd() {
|
|
1799
|
+
return C(k, { children: [w(Mo, { styles: gd }), w(Mo, { styles: gd }), w(Mo, { styles: gd })] });
|
|
1800
|
+
}
|
|
1801
|
+
const vd = { ASC: "Oldest to Newest", DESC: "Newest to Oldest" }, md = { ASC: "A-Z", DESC: "Z-A" }, bd = { ASC: "Lowest to Highest", DESC: "Highest to Lowest" }, fd = { ASC: "A-Z", DESC: "Z-A" };
|
|
1802
|
+
function yd() {
|
|
1803
|
+
const [e2, t2] = v(void 0), r2 = u(() => {
|
|
1804
|
+
if (e2 && (e2.orderBy || e2.direction)) return e2;
|
|
1805
|
+
}, [e2]);
|
|
1806
|
+
return { sortInstance: e2, setSortInstance: (e3) => {
|
|
1807
|
+
(function(e4) {
|
|
1808
|
+
if (void 0 === e4) return true;
|
|
1809
|
+
const t3 = (e4.orderBy && e4.orderBy in Bi) ?? false, r3 = (e4.direction && e4.direction in Hi) ?? false;
|
|
1810
|
+
return t3 && r3;
|
|
1811
|
+
})(e3) && t2(e3);
|
|
1812
|
+
}, apiSort: r2 };
|
|
1813
|
+
}
|
|
1814
|
+
const Td = Xo((e2) => c.createElement("svg", { width: 10, height: 10, viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("g", { id: "icon/check" }, c.createElement("path", { id: "Vector", d: "M0.986511 5L3.66217 7.67566L9.01349 2.32434", stroke: "white", strokeWidth: 1.25, strokeMiterlimit: 10 }))), "Check"), xd = ht({ width: "15px", height: "15px", borderRadius: "sm", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", padding: 0, margin: 0, position: "relative", "&::before": { content: "''", position: "absolute", top: "-10px", left: "-10px", right: "-10px", bottom: "-10px" }, "&[data-is-checked='false']:hover": { backgroundColor: "surface.background.hover" } }), wd = ht({ border: "{borderWidths.lg} solid", borderColor: "border.layout.strong", background: "surface.foreground" }), kd = ht({ background: "brand.primary.strong", border: "none" });
|
|
1815
|
+
function Cd({ checked: e2, onClick: t2 }) {
|
|
1816
|
+
const [r2, n2] = v(e2 ?? false), o2 = void 0 === e2 ? r2 : e2;
|
|
1817
|
+
return w("button", { ...kt(bt["checkbox-input"], xd, o2 ? kd : wd, ta), type: "button", onClick: (o3) => {
|
|
1818
|
+
void 0 === e2 && n2(!r2), t2 && t2(o3);
|
|
1819
|
+
}, "data-is-checked": o2, children: o2 && w(_l, { Component: Td }) });
|
|
1820
|
+
}
|
|
1821
|
+
const Sd = kt(null, ht({ paddingLeft: "20px", paddingRight: "5px" }));
|
|
1822
|
+
function Ed({ checked: e2, onClick: t2 }) {
|
|
1823
|
+
return w("div", { ...Sd, children: w(Cd, { checked: e2, onClick: t2 }) });
|
|
1824
|
+
}
|
|
1825
|
+
const Id = kt(bt.text, ht({ fontSize: "sm", fontWeight: "sm", color: "typography.base", fontStyle: "normal", letterSpacing: "0.66px", maxWidth: "100%" }), On);
|
|
1826
|
+
function Pd({ children: e2 }) {
|
|
1827
|
+
return w("div", { ...Id, children: e2 });
|
|
1828
|
+
}
|
|
1829
|
+
const Ad = kt(bt["date-cell"], ht({ display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center" }));
|
|
1830
|
+
function Dd({ date: e2, annotation: t2 }) {
|
|
1831
|
+
return C("div", { ...Ad, children: [t2 && w(Pd, { children: t2 }), w(bl, { children: e2 })] });
|
|
1832
|
+
}
|
|
1833
|
+
const Md = ht({ color: "money.negative" }), Nd = ht({ color: "money.positive" }), Rd = (e2) => {
|
|
1834
|
+
let t2;
|
|
1835
|
+
switch (e2.type) {
|
|
1836
|
+
case "EXPENSE":
|
|
1837
|
+
t2 = ((e3) => {
|
|
1838
|
+
var _a2;
|
|
1839
|
+
const t3 = e3.amount > 0;
|
|
1840
|
+
let r2;
|
|
1841
|
+
return r2 = t3 ? "Expense Refund" : ((_a2 = e3.children) == null ? void 0 : _a2.length) > 0 ? "Split Expense" : "Expense", { type: "EXPENSE", displayName: r2, css: t3 ? Nd : Md };
|
|
1842
|
+
})(e2);
|
|
1843
|
+
break;
|
|
1844
|
+
case "REVENUE":
|
|
1845
|
+
t2 = ((e3) => {
|
|
1846
|
+
const t3 = e3.amount < 0;
|
|
1847
|
+
return { type: "REVENUE", displayName: t3 ? "Income Refund" : "Income", css: t3 ? Md : Nd };
|
|
1848
|
+
})(e2);
|
|
1849
|
+
break;
|
|
1850
|
+
case "BANK_TRANSFER":
|
|
1851
|
+
t2 = ((e3) => {
|
|
1852
|
+
var _a2;
|
|
1853
|
+
let t3 = "Bank Transfer";
|
|
1854
|
+
return ((_a2 = e3.children) == null ? void 0 : _a2.length) > 0 && (t3 = "Payout"), { type: "BANK_TRANSFER", displayName: t3, css: e3.amount < 0 ? Md : Nd };
|
|
1855
|
+
})(e2);
|
|
1856
|
+
break;
|
|
1857
|
+
case "TAX_PAYMENT":
|
|
1858
|
+
t2 = { type: "TAX_PAYMENT", displayName: "Tax Payment", css: Md };
|
|
1859
|
+
break;
|
|
1860
|
+
case "INVOICE_PAYMENT":
|
|
1861
|
+
t2 = ((e3) => {
|
|
1862
|
+
let t3 = "Invoice Payment", r2 = Nd;
|
|
1863
|
+
return e3.amount < 0 && (t3 = "Invoice Payment Refund", r2 = Md), { type: "INVOICE_PAYMENT", displayName: t3, css: r2 };
|
|
1864
|
+
})(e2);
|
|
1865
|
+
}
|
|
1866
|
+
return t2;
|
|
1867
|
+
};
|
|
1868
|
+
function Od({ transaction: e2 }) {
|
|
1869
|
+
const t2 = Rd(e2), r2 = kt(bt["transaction-type-label"], t2.css), n2 = w("span", { ...r2, children: t2.displayName });
|
|
1870
|
+
return w(Dd, { date: e2.date, annotation: n2 });
|
|
1871
|
+
}
|
|
1872
|
+
function Ld({ label: e2, subLabel: t2 }) {
|
|
1873
|
+
return C(k, { children: [w(to, { children: e2 }), w(no, { children: t2 })] });
|
|
1874
|
+
}
|
|
1875
|
+
function Fd({ bankTransaction: e2 }) {
|
|
1876
|
+
var _a2;
|
|
1877
|
+
return w(Ld, { label: e2.description, subLabel: (_a2 = e2.bankAccount) == null ? void 0 : _a2.name });
|
|
1878
|
+
}
|
|
1879
|
+
function _d(e2) {
|
|
1880
|
+
return new M(e2).div(100).toNumber();
|
|
1881
|
+
}
|
|
1882
|
+
function Wd(e2) {
|
|
1883
|
+
return new M(e2).times(100).toNumber();
|
|
1884
|
+
}
|
|
1885
|
+
function Bd(e2) {
|
|
1886
|
+
const t2 = _d(e2.amount);
|
|
1887
|
+
return Qn(t2, { cents: "always", condense: false, dollarSign: true, signage: "always" });
|
|
1888
|
+
}
|
|
1889
|
+
function Hd({ transaction: e2 }) {
|
|
1890
|
+
return w(bl, { children: Bd(e2) });
|
|
1891
|
+
}
|
|
1892
|
+
const zd = kt(null, ht({ padding: "0 25px", height: "100%", display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", gap: "4px" }));
|
|
1893
|
+
function Vd({ annotation: e2, accountName: t2 }) {
|
|
1894
|
+
return C("div", { ...zd, children: [e2 && w(no, { children: e2 }), t2 && w(to, { children: t2 })] });
|
|
1895
|
+
}
|
|
1896
|
+
function jd(e2, t2) {
|
|
1897
|
+
return `${e2 ? `#${e2}` : ""} ${t2 ?? ""}`.trim();
|
|
1898
|
+
}
|
|
1899
|
+
const qd = kt(bt["cell-button"], ht({ border: "none", backgroundColor: "transparent", padding: "0 25px", gap: "10px", margin: 0, cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "flex-start", flexDirection: "row", flex: 1, outline: "none", borderRadius: "md", boxShadow: "0 0 0 0 transparent", "&:focus-visible": { transition: "none", position: "relative" }, "&:focus-visible::before": { content: "''", position: "absolute", top: 0, left: 0, right: 0, bottom: 0, borderRadius: "md", outline: "4px solid", outlineColor: "border.layout", pointerEvents: "none" }, "&:hover": { backgroundColor: "surface.intent.action.hover" }, "&[data-state='open']": { backgroundColor: "surface.intent.action.active" }, "& .Tight-text": { position: "relative" }, "& .Tight-text::after": { content: "''", position: "absolute", bottom: 0, left: 0, width: 0, height: "1px", backgroundColor: "currentColor", transition: "width 100ms ease-out" }, "&:hover .Tight-text::after, &[data-state='open'] > .Tight-text::after": { width: "100%", transition: "width 300ms ease-out" } }), ta), $d = y(function({ children: e2, ...t2 }, r2) {
|
|
1900
|
+
return w("button", { ref: r2, ...qd, ...t2, children: e2 });
|
|
1901
|
+
}), Ud = h(Object.freeze({ map: /* @__PURE__ */ new Map(), register: () => {
|
|
1902
|
+
}, unregister: () => {
|
|
1903
|
+
}, focusedIndex: null, isMousing: true, isScrolling: false, listRef: void 0, popupNodeId: void 0 })), Kd = (e2, t2) => {
|
|
1904
|
+
let r2;
|
|
1905
|
+
if (null === e2.focusedIndex) r2 = 0;
|
|
1906
|
+
else {
|
|
1907
|
+
const n2 = e2.focusedIndex + 1;
|
|
1908
|
+
r2 = !t2.repeat && n2 > e2.maxIndex ? 0 : Math.min(n2, e2.maxIndex);
|
|
1909
|
+
}
|
|
1910
|
+
return { ...e2, focusedIndex: r2 };
|
|
1911
|
+
}, Yd = (e2, t2) => {
|
|
1912
|
+
let r2;
|
|
1913
|
+
if (null === e2.focusedIndex) r2 = e2.maxIndex;
|
|
1914
|
+
else {
|
|
1915
|
+
const n2 = e2.focusedIndex - 1;
|
|
1916
|
+
r2 = !t2.repeat && n2 < 0 ? e2.maxIndex : Math.max(n2, 0);
|
|
1917
|
+
}
|
|
1918
|
+
return { ...e2, focusedIndex: r2 };
|
|
1919
|
+
};
|
|
1920
|
+
function Gd(e2, t2) {
|
|
1921
|
+
switch (t2.type) {
|
|
1922
|
+
case "increment":
|
|
1923
|
+
return Kd(e2, t2);
|
|
1924
|
+
case "decrement":
|
|
1925
|
+
return Yd(e2, t2);
|
|
1926
|
+
case "set":
|
|
1927
|
+
return { ...e2, focusedIndex: Math.min(t2.focusedIndex, e2.maxIndex) };
|
|
1928
|
+
case "max":
|
|
1929
|
+
return { ...e2, maxIndex: t2.max };
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
function Qd(e2, t2) {
|
|
1933
|
+
const r2 = e2.compareDocumentPosition(t2);
|
|
1934
|
+
return r2 & Node.DOCUMENT_POSITION_FOLLOWING || r2 & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : r2 & Node.DOCUMENT_POSITION_PRECEDING || r2 & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
1935
|
+
}
|
|
1936
|
+
function Xd(e2, t2) {
|
|
1937
|
+
const r2 = t2.getBoundingClientRect(), n2 = e2.getBoundingClientRect();
|
|
1938
|
+
return n2.top >= r2.top && n2.bottom <= r2.bottom && n2.left >= r2.left && n2.right <= r2.right;
|
|
1939
|
+
}
|
|
1940
|
+
function Zd(e2, t2, r2) {
|
|
1941
|
+
if (null === e2) return { node: void 0, metadata: void 0 };
|
|
1942
|
+
const n2 = t2[e2];
|
|
1943
|
+
return { node: n2, metadata: r2.get(n2) };
|
|
1944
|
+
}
|
|
1945
|
+
function Jd(e2, t2, r2, n2, o2, a2) {
|
|
1946
|
+
b(() => {
|
|
1947
|
+
const i2 = e2.current;
|
|
1948
|
+
if (!i2) return;
|
|
1949
|
+
const l2 = (e3) => {
|
|
1950
|
+
const { node: l3, metadata: s2 } = Zd(n2, t2, r2), { shouldOpenCascade: c2, shouldCloseCascade: d2 } = function(e4, t3, r3) {
|
|
1951
|
+
const n3 = e4.placement.includes("left"), o3 = e4 == null ? void 0 : e4.popupParentNodeId, a3 = o3 && (r3 == null ? void 0 : r3.hasCascading) && n3 ? "ArrowLeft" : "ArrowRight", i3 = n3 ? "ArrowRight" : "ArrowLeft";
|
|
1952
|
+
return { shouldOpenCascade: (r3 == null ? void 0 : r3.hasCascading) && t3.key === a3, shouldCloseCascade: o3 && t3.key === i3 };
|
|
1953
|
+
}(o2, e3, s2), u2 = !(e3.target instanceof HTMLInputElement && "" !== e3.target.value) && " " === e3.key;
|
|
1954
|
+
if (c2 || "Enter" === e3.key || u2) {
|
|
1955
|
+
const t3 = function(e4, t4, r3, n3, o3) {
|
|
1956
|
+
return !(!e4 || !e4.hasCascading || null === t4) && !(r3 && n3 && Xd(r3, n3) && (o3.setCascadeState(true, t4), o3.setFocus(true), 0));
|
|
1957
|
+
}(s2, n2, l3, i2, a2);
|
|
1958
|
+
t3 || function(e4) {
|
|
1959
|
+
const t4 = new MouseEvent("click", { view: window, bubbles: true, cancelable: true });
|
|
1960
|
+
e4 == null ? void 0 : e4.dispatchEvent(t4);
|
|
1961
|
+
}(l3), e3.preventDefault();
|
|
1962
|
+
} else d2 && (e3.preventDefault(), o2.setOpen(false));
|
|
1963
|
+
};
|
|
1964
|
+
return i2.addEventListener("keydown", l2), () => {
|
|
1965
|
+
i2.removeEventListener("keydown", l2);
|
|
1966
|
+
};
|
|
1967
|
+
}, [e2, t2, n2, r2, o2, a2]);
|
|
1968
|
+
}
|
|
1969
|
+
function eu(e2) {
|
|
1970
|
+
const [t2, r2] = v(() => /* @__PURE__ */ new Map()), { listRef: n2, focusedState: o2, isMousing: a2, isScrolling: i2 } = function(e3, t3) {
|
|
1971
|
+
const r3 = d(null), [n3, o3] = v(true), [a3, i3] = v(false), l3 = g(Ud), [s3, c3] = T(Gd, { focusedIndex: null, maxIndex: e3 });
|
|
1972
|
+
b(() => {
|
|
1973
|
+
const e4 = r3.current, t4 = () => {
|
|
1974
|
+
null == s3.focusedIndex && void 0 !== (l3 == null ? void 0 : l3.popupNodeId) && c3({ type: "set", focusedIndex: 0 });
|
|
1975
|
+
};
|
|
1976
|
+
return e4 == null ? void 0 : e4.addEventListener("focus", t4), () => {
|
|
1977
|
+
e4 == null ? void 0 : e4.removeEventListener("focus", t4);
|
|
1978
|
+
};
|
|
1979
|
+
}, [r3, s3.focusedIndex, c3, l3 == null ? void 0 : l3.popupNodeId]);
|
|
1980
|
+
const u2 = d(null);
|
|
1981
|
+
return b(() => {
|
|
1982
|
+
c3({ type: "max", max: e3 });
|
|
1983
|
+
}, [e3]), b(() => {
|
|
1984
|
+
const e4 = r3.current;
|
|
1985
|
+
if (null !== e4) {
|
|
1986
|
+
const r4 = (e5) => {
|
|
1987
|
+
i3(false);
|
|
1988
|
+
const r5 = e5.target instanceof HTMLElement && e5.target.getAttribute("data-listitem");
|
|
1989
|
+
if (!r5) return;
|
|
1990
|
+
const n5 = Number(e5.target.getAttribute("data-index"));
|
|
1991
|
+
s3.focusedIndex === n5 && u2.current === e5.target || (0 !== e5.movementX || 0 !== e5.movementY) && r5 && (o3(true), u2.current = e5.target, c3({ type: "set", focusedIndex: n5 }), t3.setCascadeState(true, n5));
|
|
1992
|
+
}, n4 = (e5) => {
|
|
1993
|
+
const t4 = "ArrowDown" === e5.key || "Tab" === e5.key && !e5.shiftKey, r5 = "ArrowUp" === e5.key || "Tab" === e5.key && e5.shiftKey;
|
|
1994
|
+
o3(false), i3(false), t4 ? (e5.preventDefault(), c3({ type: "increment", repeat: e5.repeat })) : r5 && (e5.preventDefault(), c3({ type: "decrement", repeat: e5.repeat }));
|
|
1995
|
+
}, a4 = () => i3(true);
|
|
1996
|
+
return e4.addEventListener("mousemove", r4), e4.addEventListener("keydown", n4), e4.addEventListener("scroll", a4), () => {
|
|
1997
|
+
e4.removeEventListener("mousemove", r4), e4.removeEventListener("keydown", n4), e4.removeEventListener("scroll", a4);
|
|
1998
|
+
};
|
|
1999
|
+
}
|
|
2000
|
+
}, [t3, s3.focusedIndex]), { listRef: r3, focusedState: s3, isMousing: n3, isScrolling: a3 };
|
|
2001
|
+
}(t2.size - 1, e2), l2 = Ol(), s2 = m((e3, t3) => {
|
|
2002
|
+
r2((r3) => new Map(r3).set(e3, t3 ?? null));
|
|
2003
|
+
}, []), c2 = m((e3) => {
|
|
2004
|
+
r2((t3) => {
|
|
2005
|
+
const r3 = new Map(t3);
|
|
2006
|
+
return r3.delete(e3), r3;
|
|
2007
|
+
});
|
|
2008
|
+
}, []), { sortedNodes: h2, sortedMap: p2 } = function(e3, t3) {
|
|
2009
|
+
const r3 = u(() => {
|
|
2010
|
+
let r4 = [];
|
|
2011
|
+
return null !== t3.current && (r4 = Array.from(e3.keys()).sort(Qd)), r4;
|
|
2012
|
+
}, [e3, t3]), n3 = u(() => {
|
|
2013
|
+
const t4 = /* @__PURE__ */ new Map();
|
|
2014
|
+
return r3.forEach((r4, n4) => {
|
|
2015
|
+
const o3 = e3.get(r4) ?? {};
|
|
2016
|
+
t4.set(r4, { ...o3, index: n4 });
|
|
2017
|
+
}), t4;
|
|
2018
|
+
}, [r3, e3]);
|
|
2019
|
+
return { sortedNodes: r3, sortedMap: n3 };
|
|
2020
|
+
}(t2, n2);
|
|
2021
|
+
Jd(n2, h2, p2, o2.focusedIndex, l2, e2);
|
|
2022
|
+
const { startCallback: f2, cancelCallback: y2 } = si({ delay: 200, callback: ({ focusedIndex: t3, node: r3, listElement: n3 }) => {
|
|
2023
|
+
!(!r3 || !n3) && Xd(r3, n3) ? e2.setCascadeState(true, t3) : e2.closeCurrentCascade();
|
|
2024
|
+
} });
|
|
2025
|
+
return function(e3, t3, r3, n3, o3, a3, i3, l3) {
|
|
2026
|
+
b(() => {
|
|
2027
|
+
const s3 = o3.current;
|
|
2028
|
+
if (null === e3 || t3) return;
|
|
2029
|
+
const { node: c3, metadata: d2 } = Zd(e3, r3, n3);
|
|
2030
|
+
return a3.lastOpenedIndex !== e3 && (d2 == null ? void 0 : d2.hasCascading) && (a3.closeCurrentCascade(), i3({ focusedIndex: e3, node: c3, listElement: s3 })), () => l3();
|
|
2031
|
+
}, [e3, t3, o3, a3, l3, r3, n3, i3]);
|
|
2032
|
+
}(o2.focusedIndex, a2, h2, p2, n2, e2, f2, y2), function(e3, t3, r3, n3) {
|
|
2033
|
+
b(() => {
|
|
2034
|
+
const { metadata: o3 } = Zd(e3, t3, r3);
|
|
2035
|
+
null === e3 || (o3 == null ? void 0 : o3.hasCascading) || n3.closeCurrentCascade();
|
|
2036
|
+
}, [n3, e3, r3, t3]);
|
|
2037
|
+
}(o2.focusedIndex, h2, p2, e2), u(() => ({ register: s2, unregister: c2, map: p2, focusedIndex: o2.focusedIndex, listRef: n2, isMousing: a2, isScrolling: i2, popupNodeId: l2 == null ? void 0 : l2.nodeId }), [s2, c2, p2, o2.focusedIndex, n2, a2, i2, l2 == null ? void 0 : l2.nodeId]);
|
|
2038
|
+
}
|
|
2039
|
+
const tu = h(Object.freeze({ cascadeIndex: null, setCascadeState: () => {
|
|
2040
|
+
}, onScroll: () => {
|
|
2041
|
+
}, focus: false, setFocus: () => {
|
|
2042
|
+
}, lastOpenedIndex: null, closeCurrentCascade: () => {
|
|
2043
|
+
} }));
|
|
2044
|
+
function ru({ style: e2, children: t2 }) {
|
|
2045
|
+
const r2 = kt(bt["popup-list"], Pl, e2), n2 = function() {
|
|
2046
|
+
const [e3, t3] = v(null), [r3, n3] = v(false), [o3, a2] = v(null), i2 = m((r4, o4) => {
|
|
2047
|
+
r4 && e3 !== o4 ? (a2(o4), t3(o4)) : r4 || e3 !== o4 || (n3(false), t3(null));
|
|
2048
|
+
}, [e3, n3]), l2 = m(() => {
|
|
2049
|
+
t3(null), a2(null), n3(false);
|
|
2050
|
+
}, [t3, a2, n3]), s2 = m(() => {
|
|
2051
|
+
t3(null), a2(null), n3(false);
|
|
2052
|
+
}, []);
|
|
2053
|
+
return { cascadeIndex: e3, setCascadeState: i2, onScroll: l2, focus: r3, setFocus: n3, lastOpenedIndex: o3, closeCurrentCascade: s2 };
|
|
2054
|
+
}(), o2 = eu(n2);
|
|
2055
|
+
return w("div", { ...r2, onScroll: n2.onScroll, ref: o2.listRef, tabIndex: 0, children: w(Ud.Provider, { value: o2, children: w(tu.Provider, { value: n2, children: t2 }) }) });
|
|
2056
|
+
}
|
|
2057
|
+
function nu({ hasCascading: e2 = false } = {}) {
|
|
2058
|
+
const t2 = d(null), { register: r2, unregister: n2, map: o2, focusedIndex: a2, isMousing: i2, listRef: l2 } = g(Ud);
|
|
2059
|
+
x(() => {
|
|
2060
|
+
const o3 = t2.current;
|
|
2061
|
+
if (o3) return r2(o3, { index: 0, hasCascading: e2 }), () => {
|
|
2062
|
+
n2(o3);
|
|
2063
|
+
};
|
|
2064
|
+
}, [r2, n2, e2]);
|
|
2065
|
+
const s2 = u(() => {
|
|
2066
|
+
var _a2;
|
|
2067
|
+
return void 0 !== o2 && null !== t2.current ? ((_a2 = o2.get(t2.current)) == null ? void 0 : _a2.index) ?? -1 : -1;
|
|
2068
|
+
}, [o2]), c2 = s2 === a2;
|
|
2069
|
+
x(() => {
|
|
2070
|
+
var _a2;
|
|
2071
|
+
c2 && (i2 || ((_a2 = t2.current) == null ? void 0 : _a2.scrollIntoView({ behavior: "instant", block: "nearest", inline: "nearest" })));
|
|
2072
|
+
}, [c2, i2]);
|
|
2073
|
+
const h2 = m(() => {
|
|
2074
|
+
var _a2;
|
|
2075
|
+
(_a2 = l2 == null ? void 0 : l2.current) == null ? void 0 : _a2.focus();
|
|
2076
|
+
}, [l2]), p2 = u(() => ({ onFocus: h2, "data-focused": c2 }), [h2, c2]);
|
|
2077
|
+
return { itemRef: t2, isActive: c2, index: s2, itemProps: p2 };
|
|
2078
|
+
}
|
|
2079
|
+
const ou = y(function({ onClick: e2, index: t2, children: r2, itemProps: n2, popupTriggerProps: o2 }, a2) {
|
|
2080
|
+
return w("button", { ...Dl, onClick: e2, "data-listitem": true, "data-index": t2, ...o2, ...n2, ref: a2, children: r2 });
|
|
2081
|
+
}), au = y(function({ onClick: e2, children: t2, popupTriggerProps: r2 }, n2) {
|
|
2082
|
+
const { index: o2, itemProps: a2, itemRef: i2 } = nu(), l2 = le([i2, n2]);
|
|
2083
|
+
return w(ou, { ...Dl, onClick: e2, index: o2, ...r2, itemProps: a2, ref: l2, children: t2 });
|
|
2084
|
+
}), iu = kt(bt.text, ht({ fontSize: "md", fontWeight: "md", color: "typography.base", fontStyle: "normal", letterSpacing: "0.84px", lineHeight: "16px", maxWidth: "100%", fontFamily: "label" }), On);
|
|
2085
|
+
function lu({ children: e2, stylists: t2 = [] }) {
|
|
2086
|
+
const r2 = Pt([iu, ...t2]);
|
|
2087
|
+
return w("div", { ...r2, children: e2 });
|
|
2088
|
+
}
|
|
2089
|
+
function su({ text: e2 }) {
|
|
2090
|
+
return w("div", { ...Dl, children: e2 ? w(to, { children: e2 }) : w(Mo, { styles: ht({ width: "100%", height: "16px" }) }) });
|
|
2091
|
+
}
|
|
2092
|
+
const cu = kt(bt["popup-list"], Pl), du = () => C("div", { ...cu, children: [w(su, {}), w(su, {}), w(su, {}), w(su, {}), w(su, {})] }), uu = ["LIABILITY", "EQUITY", "INCOME", "OTHER_INCOME"];
|
|
2093
|
+
function hu(e2, t2) {
|
|
2094
|
+
return u(() => (e2 == null ? void 0 : e2.filter((e3) => t2.includes(e3.type))) ?? [], [e2, t2]);
|
|
2095
|
+
}
|
|
2096
|
+
const gu = (e2) => ({ id: e2.id || "", name: e2.name, accountNo: e2.accountNo }), pu = { all: () => ["accounting", "glAccounts"] }, vu = async (e2) => {
|
|
2097
|
+
const t2 = e2.queryKey, r2 = { path: "/accounting/glAccounts", params: { leavesOnly: "false" }, accessToken: t2[2].accessToken, environment: t2[2].environment }, n2 = await li(r2);
|
|
2098
|
+
return fu(n2);
|
|
2099
|
+
};
|
|
2100
|
+
function mu(e2) {
|
|
2101
|
+
return dr({ ...e2, queryKey: pu.all(), queryFn: vu });
|
|
2102
|
+
}
|
|
2103
|
+
function bu() {
|
|
2104
|
+
return mu({ select: wu });
|
|
2105
|
+
}
|
|
2106
|
+
const fu = (e2) => e2.map((e3) => ({ ...e3, id: `${Ki.GL_ACCOUNT}_${e3.id}` }));
|
|
2107
|
+
function yu(e2, t2) {
|
|
2108
|
+
const r2 = t2.get(e2.accountNo) ?? [];
|
|
2109
|
+
return 0 === r2.length ? [{ ...e2, children: [] }] : r2.flatMap((e3) => yu(e3, t2));
|
|
2110
|
+
}
|
|
2111
|
+
const Tu = (e2) => !e2.parentAccountNo;
|
|
2112
|
+
function xu(e2) {
|
|
2113
|
+
const t2 = function(e3) {
|
|
2114
|
+
const t3 = /* @__PURE__ */ new Map();
|
|
2115
|
+
for (const r2 of e3) if (r2.parentAccountNo) {
|
|
2116
|
+
const e4 = t3.get(r2.parentAccountNo) ?? [];
|
|
2117
|
+
e4.push(r2), t3.set(r2.parentAccountNo, e4);
|
|
2118
|
+
}
|
|
2119
|
+
return t3;
|
|
2120
|
+
}(e2);
|
|
2121
|
+
return e2.filter(Tu).map((e3) => ({ ...e3, children: yu(e3, t2) }));
|
|
2122
|
+
}
|
|
2123
|
+
function wu(e2) {
|
|
2124
|
+
return xu(e2).flatMap((e3) => [e3, ...e3.children]);
|
|
2125
|
+
}
|
|
2126
|
+
const ku = [kt(null, ht({ marginLeft: "6px", marginRight: "6px" }))], Cu = kt(null, ht({ whiteSpace: "normal" })), Su = { keys: [{ name: "accountNo", weight: 0.3 }, { name: "name", weight: 0.7 }], threshold: 0.3, includeScore: true, minMatchCharLength: 1 };
|
|
2127
|
+
function Eu(e2, t2, r2) {
|
|
2128
|
+
(function(e3, t3) {
|
|
2129
|
+
return t3.some(({ child: t4 }) => t4.accountNo === e3.accountNo);
|
|
2130
|
+
})(t2, r2) || r2.push({ parent: e2, child: t2 });
|
|
2131
|
+
}
|
|
2132
|
+
function Iu(e2, t2) {
|
|
2133
|
+
const r2 = [];
|
|
2134
|
+
return e2.forEach((e3) => {
|
|
2135
|
+
const n2 = e3.item, o2 = function(e4, t3) {
|
|
2136
|
+
return t3.find((t4) => t4.accountNo === e4.accountNo || t4.children.some((t5) => t5.accountNo === e4.accountNo));
|
|
2137
|
+
}(n2, t2);
|
|
2138
|
+
if (!o2) return;
|
|
2139
|
+
o2.accountNo === n2.accountNo ? function(e4, t3) {
|
|
2140
|
+
e4.children.forEach((r3) => {
|
|
2141
|
+
Eu(e4, r3, t3);
|
|
2142
|
+
});
|
|
2143
|
+
}(o2, r2) : Eu(o2, n2, r2);
|
|
2144
|
+
}), r2;
|
|
2145
|
+
}
|
|
2146
|
+
function Pu({ types: e2, onClick: t2, searchTerm: r2 }) {
|
|
2147
|
+
const { query: { data: n2 }, isFilling: o2 } = bu(), a2 = hu(n2, e2), i2 = u(() => new pe(a2, Su), [a2]), l2 = u(() => Iu(i2.search(r2), a2), [a2, r2, i2]);
|
|
2148
|
+
return o2 ? w(du, {}) : l2.map(({ parent: e3, child: r3 }) => w(au, { onClick: () => t2(r3), children: C(lu, { stylists: [Cu], children: [jd(e3.accountNo, e3.name), w(Pa, { Component: Aa, stylists: ku }), jd(r3.accountNo, r3.name)] }) }, `${r3.accountNo}`));
|
|
2149
|
+
}
|
|
2150
|
+
const Au = y(function({ index: e2, popupTriggerProps: t2, children: r2, itemProps: n2 }, o2) {
|
|
2151
|
+
const a2 = le([o2, t2 == null ? void 0 : t2.ref]);
|
|
2152
|
+
return w(ou, { index: e2, ref: a2, itemProps: n2, popupTriggerProps: t2, children: r2 });
|
|
2153
|
+
});
|
|
2154
|
+
function Du({ triggerChildren: e2, popupChildren: t2 }) {
|
|
2155
|
+
const { cascadeIndex: r2, setCascadeState: n2, focus: o2 } = g(tu), { itemRef: a2, index: i2, itemProps: l2 } = nu({ hasCascading: true }), { isScrolling: s2 } = g(Ud);
|
|
2156
|
+
return C(Rl, { open: r2 === i2, onOpenChange: (e3) => {
|
|
2157
|
+
s2 || n2(e3, i2);
|
|
2158
|
+
}, placement: "right-start", children: [w(Ll, { children: (t3) => w(Au, { itemProps: l2, index: i2, ref: a2, popupTriggerProps: t3, children: e2 }) }), w($l, { initialFocus: o2, children: t2 })] });
|
|
2159
|
+
}
|
|
2160
|
+
const Mu = kt(null, ht({ display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center" })), Nu = kt(null, ht({ whiteSpace: "normal" }));
|
|
2161
|
+
function Ru({ icon: e2, displayLabel: t2 }) {
|
|
2162
|
+
return C("div", { ...Mu, children: [e2, w(to, { stylists: [Nu], children: t2 }), w(Pa, { Component: Aa })] });
|
|
2163
|
+
}
|
|
2164
|
+
function Ou({ types: e2, onClick: t2 }) {
|
|
2165
|
+
const { query: { data: r2, isFetching: n2 }, isFilling: o2 } = mu({ select: xu }), a2 = hu(r2, e2);
|
|
2166
|
+
return o2 ? w(du, {}) : o2 || n2 || void 0 !== r2 ? a2.map((e3) => {
|
|
2167
|
+
const r3 = jd(e3.accountNo, e3.name);
|
|
2168
|
+
return w(Du, { triggerChildren: w(Ru, { displayLabel: r3 }), popupChildren: w(Lu, { glAccount: e3, onClick: t2 }) }, e3.accountNo);
|
|
2169
|
+
}) : w(su, { text: "No data" });
|
|
2170
|
+
}
|
|
2171
|
+
function Lu({ glAccount: e2, onClick: t2 }) {
|
|
2172
|
+
return w(ru, { children: e2.children.map((e3) => w(au, { onClick: () => t2(e3), children: w(to, { children: jd(e3.accountNo, e3.name) }) }, e3.accountNo)) });
|
|
2173
|
+
}
|
|
2174
|
+
const Fu = kt(null, ht({ display: "flex", alignItems: "center", padding: "10px", flex: 1, border: "none", outline: "none", background: "transparent", fontSize: "sm", fontWeight: "sm", "&::placeholder": { color: "typography.base.weak" } }));
|
|
2175
|
+
function _u({ searchTerm: e2, setSearchTerm: t2, placeholder: r2 }) {
|
|
2176
|
+
const n2 = d(null);
|
|
2177
|
+
return b(() => {
|
|
2178
|
+
var _a2;
|
|
2179
|
+
(_a2 = n2.current) == null ? void 0 : _a2.focus({ preventScroll: true });
|
|
2180
|
+
const e3 = (e4) => {
|
|
2181
|
+
!n2.current || document.activeElement === n2.current || (1 !== e4.key.length || e4.ctrlKey || e4.altKey || e4.metaKey) && "Backspace" !== e4.key || n2.current.focus();
|
|
2182
|
+
};
|
|
2183
|
+
return document.addEventListener("keydown", e3), () => {
|
|
2184
|
+
document.removeEventListener("keydown", e3);
|
|
2185
|
+
};
|
|
2186
|
+
}, []), w("input", { ref: n2, type: "text", placeholder: r2, value: e2, onChange: (e3) => t2(e3.target.value), ...Fu });
|
|
2187
|
+
}
|
|
2188
|
+
const Wu = "Search revenue accounts...";
|
|
2189
|
+
function Bu({ onClick: e2, types: t2 }) {
|
|
2190
|
+
const r2 = Ol(), [n2, o2] = v(""), a2 = rr(n2) ? ht({ maxWidth: "420px", width: "fit-content" }) : void 0, i2 = (t3) => {
|
|
2191
|
+
e2(t3), r2 == null ? void 0 : r2.setOpen(false);
|
|
2192
|
+
};
|
|
2193
|
+
return w($l, { children: C(ru, { style: a2, children: [w(_u, { searchTerm: n2, setSearchTerm: o2, placeholder: Wu }), rr(n2) ? w(Pu, { types: t2, onClick: i2, searchTerm: n2 }) : w(Ou, { types: t2, onClick: i2 })] }) });
|
|
2194
|
+
}
|
|
2195
|
+
function Hu({ mutationFn: e2, onMutateFn: t2, ...r2 }) {
|
|
2196
|
+
const n2 = or(), o2 = cr(), a2 = !tr(n2);
|
|
2197
|
+
return A({ ...r2, mutationFn: a2 ? (t3) => e2({ data: t3, accessToken: n2, environment: o2 }) : ar, onMutate: a2 && er(t2) ? (e3) => t2({ data: e3, accessToken: n2, environment: o2 }) : void 0 }, lr);
|
|
2198
|
+
}
|
|
2199
|
+
const zu = async ({ data: e2, accessToken: t2, environment: r2 }) => ju({ data: { data: e2 }, accessToken: t2, environment: r2 }), Vu = async ({ data: e2, accessToken: t2, environment: r2 }) => zu({ data: [e2], accessToken: t2, environment: r2 }), ju = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
2200
|
+
const n2 = { path: "/v6/banks/transactions", bodyParams: e2, method: "POST", accessToken: t2, endpointManager: _a(r2) };
|
|
2201
|
+
return await gn(n2);
|
|
2202
|
+
};
|
|
2203
|
+
function qu() {
|
|
2204
|
+
return function(e2) {
|
|
2205
|
+
return Hu({ onSuccess: async () => {
|
|
2206
|
+
const e3 = zi.base();
|
|
2207
|
+
return Gr("mutation successful, invalidating BT queries"), lr.invalidateQueries({ queryKey: e3 }).catch((e4) => Qr({ error: e4, severity: "error" }));
|
|
2208
|
+
}, ...e2 });
|
|
2209
|
+
}({ mutationFn: zu });
|
|
2210
|
+
}
|
|
2211
|
+
function $u() {
|
|
2212
|
+
return function(e2) {
|
|
2213
|
+
return Hu({ onSuccess: async () => (Gr("mutation successful, invalidating BT queries"), lr.invalidateQueries({ predicate: (e3) => e3.queryKey.includes(Wa.all()[0]) || zi.base().every((t2) => e3.queryKey.includes(t2)) || e3.queryKey.includes("reports") }).catch((e3) => Qr({ error: e3, severity: "error" }))), ...e2 });
|
|
2214
|
+
}({ mutationFn: Vu });
|
|
2215
|
+
}
|
|
2216
|
+
function Uu({ transaction: e2, accountNo: t2, accountName: r2 }) {
|
|
2217
|
+
const { startPrefetch: n2, cancelPrefetch: o2 } = ci({ prefetchFn: ei(pu.all, vu) }), { mutate: a2 } = $u();
|
|
2218
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (e3) => w($d, { ...e3, onMouseEnter: n2, onMouseLeave: o2, children: w(to, { children: jd(t2, r2) }) }) }), w(Bu, { onClick: Yi(e2.id, Ki.TRANSACTION_LINE_ITEM) || Yi(e2.id, Ki.PROCESSOR_TRANSACTION) ? (t3) => {
|
|
2219
|
+
if (t3 == null ? void 0 : t3.id) {
|
|
2220
|
+
const { parentId: r3, parentsChildren: n3, ...o3 } = e2, i2 = n3.map((r4) => r4.id === e2.id ? { ...o3, glAccountId: t3.id.toString() } : r4);
|
|
2221
|
+
a2({ id: r3, children: i2 });
|
|
2222
|
+
}
|
|
2223
|
+
} : (t3) => {
|
|
2224
|
+
a2({ id: e2.id, glAccountId: t3.id });
|
|
2225
|
+
}, types: uu })] });
|
|
2226
|
+
}
|
|
2227
|
+
const Ku = { all: () => ["transactions", "expenseCategories"] }, Yu = async (e2) => {
|
|
2228
|
+
const t2 = e2.queryKey, r2 = { path: "/expenses/categories", accessToken: t2[2].accessToken, environment: t2[2].environment }, n2 = await li(r2);
|
|
2229
|
+
return { ...n2, data: n2.data ? (o2 = n2.data, o2.map((e3) => ({ ...e3, id: `${Ki.TRANSACTION_CATEGORY}_${e3.id}`, parentCategoryId: e3.parentCategoryId ? `${Ki.TRANSACTION_CATEGORY}_${e3.parentCategoryId}` : void 0 }))) : void 0 };
|
|
2230
|
+
var o2;
|
|
2231
|
+
};
|
|
2232
|
+
function Gu(e2) {
|
|
2233
|
+
return dr({ ...e2, queryKey: Ku.all(), queryFn: Yu });
|
|
2234
|
+
}
|
|
2235
|
+
function Qu(e2) {
|
|
2236
|
+
const t2 = /* @__PURE__ */ new Map();
|
|
2237
|
+
for (const r2 of e2) if (r2.parentCategoryId) {
|
|
2238
|
+
const e3 = t2.get(r2.parentCategoryId) ?? [];
|
|
2239
|
+
e3.push(r2), t2.set(r2.parentCategoryId, e3);
|
|
2240
|
+
}
|
|
2241
|
+
return t2;
|
|
2242
|
+
}
|
|
2243
|
+
function Xu(e2) {
|
|
2244
|
+
if (0 === e2.length) return [];
|
|
2245
|
+
const t2 = Qu(e2);
|
|
2246
|
+
return e2.map((e3) => ({ ...e3, children: e3.id ? t2.get(e3.id) : void 0 }));
|
|
2247
|
+
}
|
|
2248
|
+
function Zu(e2) {
|
|
2249
|
+
if (0 === e2.length) return [];
|
|
2250
|
+
const t2 = Qu(e2);
|
|
2251
|
+
return e2.filter((e3) => !e3.parentCategoryId).map((e3) => ({ ...e3, children: e3.id ? t2.get(e3.id) : void 0 }));
|
|
2252
|
+
}
|
|
2253
|
+
const Ju = (e2) => ({ id: e2.id, name: e2.name }), eh = kt(null, ht({ whiteSpace: "normal" })), th = [kt(null, ht({ marginLeft: "6px", marginRight: "6px" }))], rh = { keys: [{ name: "name" }], threshold: 0.2, includeScore: true, minMatchCharLength: 1 };
|
|
2254
|
+
function nh(e2, t2, r2) {
|
|
2255
|
+
(function(e3, t3) {
|
|
2256
|
+
return t3.some((t4) => t4.child.id === e3.id);
|
|
2257
|
+
})(t2, r2) || r2.push({ parent: e2, child: t2 });
|
|
2258
|
+
}
|
|
2259
|
+
function oh(e2, t2) {
|
|
2260
|
+
const r2 = [];
|
|
2261
|
+
return e2.forEach((e3) => {
|
|
2262
|
+
const n2 = e3.item, o2 = function(e4, t3) {
|
|
2263
|
+
return t3.find((t4) => {
|
|
2264
|
+
var _a2;
|
|
2265
|
+
return t4.id === e4.id || ((_a2 = t4.children) == null ? void 0 : _a2.some((t5) => t5.id === e4.id));
|
|
2266
|
+
});
|
|
2267
|
+
}(n2, t2);
|
|
2268
|
+
if (!o2) return;
|
|
2269
|
+
o2.id === n2.id ? o2.children && o2.children.length > 0 ? function(e4, t3) {
|
|
2270
|
+
e4.children && e4.children.forEach((r3) => {
|
|
2271
|
+
nh(e4, r3, t3);
|
|
2272
|
+
});
|
|
2273
|
+
}(o2, r2) : r2.push({ parent: o2, child: o2 }) : nh(o2, n2, r2);
|
|
2274
|
+
}), r2;
|
|
2275
|
+
}
|
|
2276
|
+
function ah({ searchTerm: e2, onClick: t2 }) {
|
|
2277
|
+
const { query: { data: r2, isFetched: n2 }, isFilling: o2 } = Gu({ select: (e3) => ({ ...e3, data: e3.data ? Xu(e3.data) : void 0 }) }), a2 = r2 == null ? void 0 : r2.data, i2 = !o2 && n2 && (void 0 === a2 || 0 === a2.length), l2 = u(() => new pe(a2 ?? [], rh), [a2]), s2 = u(() => {
|
|
2278
|
+
if (!a2) return [];
|
|
2279
|
+
return oh(l2.search(e2), a2);
|
|
2280
|
+
}, [a2, e2, l2]);
|
|
2281
|
+
return o2 ? w(du, {}) : i2 ? w(su, { text: "No data" }) : 0 === s2.length ? w(su, { text: "No results found" }) : w(k, { children: s2.map(({ parent: e3, child: r3 }) => {
|
|
2282
|
+
const n3 = e3.id === r3.id;
|
|
2283
|
+
return w(au, { onClick: () => t2(Ju(r3)), children: w(lu, { stylists: [eh], children: n3 ? r3.name : C(k, { children: [e3.name, w(Pa, { Component: Aa, stylists: th }), r3.name] }) }) }, `${e3.id}_${r3.id}`);
|
|
2284
|
+
}) });
|
|
2285
|
+
}
|
|
2286
|
+
const ih = kt(null, ht({ whiteSpace: "normal" }));
|
|
2287
|
+
function lh({ category: e2, handleCategoryChange: t2 }) {
|
|
2288
|
+
var _a2;
|
|
2289
|
+
return w(ru, { children: (_a2 = e2.children) == null ? void 0 : _a2.map((e3) => w(au, { onClick: () => t2(Ju(e3)), children: w(to, { stylists: [ih], children: e3.name }) }, e3.id)) });
|
|
2290
|
+
}
|
|
2291
|
+
function sh({ onClick: e2 }) {
|
|
2292
|
+
const { query: { data: t2, isFetched: r2 }, isFilling: n2 } = Gu({ select: (e3) => ({ ...e3, data: e3.data ? Zu(e3.data) : void 0 }) }), o2 = t2 == null ? void 0 : t2.data, a2 = !n2 && r2 && void 0 === o2;
|
|
2293
|
+
return n2 ? w(du, {}) : a2 ? w(su, { text: "No data" }) : w(k, { children: o2 == null ? void 0 : o2.map((t3) => t3.hasChilds ? w(Du, { triggerChildren: w(Ru, { displayLabel: t3.name }), popupChildren: w(lh, { category: t3, handleCategoryChange: e2 }) }, t3.id) : w(au, { onClick: () => e2(Ju(t3)), children: w(to, { stylists: [ih], children: t3.name }) }, t3 == null ? void 0 : t3.id)) });
|
|
2294
|
+
}
|
|
2295
|
+
const ch = ({ onClick: e2 }) => {
|
|
2296
|
+
const t2 = Ol(), [r2, n2] = v(""), o2 = (r3) => {
|
|
2297
|
+
void 0 !== e2 && e2(r3), t2.setOpen(false);
|
|
2298
|
+
};
|
|
2299
|
+
return w($l, { children: C(ru, { children: [w(_u, { searchTerm: r2, setSearchTerm: n2, placeholder: "Search expense categories..." }), rr(r2) ? w(ah, { searchTerm: r2, onClick: o2 }) : w(sh, { onClick: o2 })] }) });
|
|
2300
|
+
}, dh = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M12.6809 12.4781H12.0645L6.49121 9.38327V4.42636L12.0645 1.33154H12.6809V12.4781Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.01263 4.42627H6.49108V9.38317H4.01263C3.35531 9.38317 2.7249 9.12205 2.2601 8.65725C1.7953 8.19245 1.53418 7.56205 1.53418 6.90472C1.53418 6.2474 1.7953 5.61699 2.2601 5.15219C2.7249 4.68739 3.35531 4.42627 4.01263 4.42627Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.0127 9.3833H6.49115L7.72389 14.9566H5.25192L4.0127 9.3833Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.6807 5.66553H13.9199C14.2486 5.66553 14.5638 5.79609 14.7962 6.02849C15.0286 6.26089 15.1591 6.57609 15.1591 6.90475C15.1591 7.06749 15.1271 7.22864 15.0648 7.37898C15.0025 7.52933 14.9112 7.66595 14.7962 7.78102C14.6811 7.89609 14.5445 7.98737 14.3941 8.04965C14.2438 8.11193 14.0826 8.14398 13.9199 8.14398H12.6807V5.66553Z", stroke: "#182428", strokeMiterlimit: 10 })), "Advertising"), uh = Xo((e2) => c.createElement("svg", { width: "16px", height: "16px", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M7.84644 15.0764C11.6751 15.0764 14.7788 11.9727 14.7788 8.14405C14.7788 4.3154 11.6751 1.21167 7.84644 1.21167C4.0178 1.21167 0.914062 4.3154 0.914062 8.14405C0.914062 11.9727 4.0178 15.0764 7.84644 15.0764Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.79217 9.6784V8.95116C7.79192 8.79114 7.82335 8.63265 7.88467 8.48484C7.94598 8.33703 8.03596 8.20282 8.14941 8.08996L8.65337 7.586C8.88132 7.35726 9.00972 7.04774 9.01061 6.7248V6.61636C9.00892 6.29431 8.8798 5.98603 8.65149 5.75891C8.42317 5.53179 8.11422 5.40429 7.79217 5.4043C7.47012 5.40429 7.16117 5.53179 6.93285 5.75891C6.70453 5.98603 6.57542 6.29431 6.57373 6.61636", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.18604 10.8838H8.39809", stroke: "#182428", strokeMiterlimit: 10 })), "Uncategorized"), hh = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M7.71472 0.800293V4.79785C7.71535 5.25195 7.58889 5.69716 7.34964 6.08313C7.11039 6.46909 6.7679 6.78039 6.36091 6.98182C6.02094 7.15207 5.64596 7.24072 5.26574 7.24072C4.88552 7.24072 4.51053 7.15207 4.17056 6.98182C3.76928 6.77569 3.43283 6.4626 3.19841 6.07716C2.964 5.69173 2.84075 5.24897 2.8423 4.79785V0.800293", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M5.29443 0.800293V15.4878", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M10.1861 15.4879V1.43896C10.668 1.43896 11.1451 1.53399 11.5903 1.71859C12.0354 1.9032 12.4398 2.17377 12.7802 2.51482C13.1207 2.85587 13.3905 3.2607 13.5744 3.70616C13.7582 4.15161 13.8524 4.62894 13.8516 5.11084V8.78271L10.1797 10.6155", stroke: "#182428", strokeMiterlimit: 10 })), "Meals"), gh = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M13.7665 10.8572H2.9268C2.60718 10.8572 2.30065 10.7302 2.07465 10.5042C1.84865 10.2782 1.72168 9.9717 1.72168 9.65208V4.97673C1.72168 4.87842 1.74114 4.78109 1.77895 4.69035C1.81676 4.5996 1.87217 4.51725 1.94197 4.44803C2.01178 4.37881 2.0946 4.3241 2.18566 4.28706C2.27672 4.25001 2.37421 4.23137 2.47251 4.2322C2.598 4.23423 2.7211 4.2669 2.83107 4.32739C2.94104 4.38787 3.03455 4.47433 3.10346 4.57923C4.03096 5.93577 7.14155 5.34899 7.14155 4.2322L13.3312 7.08411C13.8209 7.31135 14.2355 7.67379 14.5261 8.12874C14.8167 8.5837 14.9713 9.11222 14.9717 9.65208C14.9717 9.9717 14.8447 10.2782 14.6187 10.5042C14.3927 10.7302 14.0862 10.8572 13.7665 10.8572Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M14.9717 9.6521V10.8572C14.97 11.4954 14.7153 12.1068 14.2635 12.5574C13.8117 13.0081 13.1996 13.2611 12.5614 13.2611H2.92681C2.76832 13.262 2.61124 13.2314 2.46465 13.1711C2.31806 13.1108 2.18487 13.0221 2.0728 12.91C1.96073 12.798 1.87199 12.6648 1.81173 12.5182C1.75146 12.3716 1.72086 12.2145 1.7217 12.056V9.6521", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M6.54199 3.0271L7.1414 4.23222", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.34668 7.24174L9.5518 5.43091", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M10.1514 8.44706L11.3565 6.63623", stroke: "#182428", strokeMiterlimit: 10 })), "Sports"), ph = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M2.64551 15.0589V13.3516", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M14.6148 10.5042H2.07861V13.3517H14.6148V10.5042Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M5.07515 7.62671H11.6417C12.2861 7.62671 12.9041 7.88269 13.3598 8.33833C13.8154 8.79398 14.0714 9.41197 14.0714 10.0563V10.4742H2.64551V10.0563C2.64551 9.41197 2.90149 8.79398 3.35713 8.33833C3.81278 7.88269 4.43077 7.62671 5.07515 7.62671Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M5.49942 5.37623H6.63962C6.86383 5.37623 7.08584 5.42039 7.29298 5.50619C7.50012 5.59199 7.68833 5.71775 7.84687 5.87629C8.00541 6.03483 8.13117 6.22304 8.21697 6.43018C8.30277 6.63733 8.34693 6.85934 8.34693 7.08355V7.68051H3.78613V7.08355C3.78613 6.85884 3.83049 6.63633 3.91666 6.4288C4.00284 6.22127 4.12913 6.03279 4.2883 5.87418C4.44747 5.71556 4.63639 5.58992 4.84422 5.50448C5.05205 5.41903 5.27471 5.37545 5.49942 5.37623Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M10.054 5.37622H11.1942C11.647 5.37622 12.0813 5.5561 12.4014 5.87628C12.7216 6.19647 12.9015 6.63073 12.9015 7.08354V7.6805H8.34668V7.08354C8.34668 6.63073 8.52656 6.19647 8.84674 5.87628C9.16692 5.5561 9.60119 5.37622 10.054 5.37622Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9018 3.0957H3.78613V7.6565H12.9018V3.0957Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M14.0479 15.0589V13.3516", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M3.78613 1.38843V3.09574", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9077 1.38843V3.09574", stroke: "#182428", strokeMiterlimit: 10 })), "Bedding"), vh = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M3.58312 11.8285C3.40778 11.6564 3.29681 11.4294 3.26874 11.1854C3.24068 10.9414 3.29723 10.6951 3.42894 10.4878L6.01648 6.34502L10.8698 1.4917C11.2763 1.0884 11.8256 0.861929 12.3982 0.861572C12.6808 0.861572 12.9606 0.917231 13.2217 1.02537C13.4827 1.13351 13.7199 1.29201 13.9198 1.49183C14.1196 1.69164 14.2781 1.92885 14.3862 2.18992C14.4944 2.451 14.55 2.73081 14.55 3.01339C14.5497 3.586 14.3232 4.1353 13.9199 4.54178L9.06657 9.3951L4.92381 11.9826C4.71647 12.1144 4.47021 12.1709 4.22618 12.1428C3.98215 12.1148 3.75515 12.0038 3.58312 11.8285Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.1101 6.34497L9.67676 8.78504L12.7201 14.2685L14.5502 13.0485L12.1101 6.34497Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M9.06658 3.30164L6.62651 5.735L1.14307 2.69162L2.3631 0.861572L9.06658 3.30164Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.49481 8.78516H1.75308L1.14307 10.6152L3.58313 11.8285L4.80317 14.2686L6.62651 13.6586V10.9169", stroke: "#182428", strokeMiterlimit: 10 })), "Airplane"), mh = Xo((e2) => c.createElement("svg", { width: 15, height: 11, viewBox: "0 0 15 11", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M8.58591 0.969731H4.86823C4.67602 0.970222 4.4865 1.01495 4.31436 1.10046C4.14222 1.18597 3.99207 1.30996 3.87555 1.46283L2.38978 3.44818L0.53418 4.06455V8.3986H2.38978C2.38978 8.06994 2.52034 7.75473 2.75274 7.52233C2.98514 7.28993 3.30034 7.15937 3.629 7.15937C3.95766 7.15937 4.27287 7.28993 4.50527 7.52233C4.73767 7.75473 4.86823 8.06994 4.86823 8.3986H9.20228C9.20228 8.06994 9.33284 7.75473 9.56524 7.52233C9.79764 7.28993 10.1128 7.15937 10.4415 7.15937C10.7702 7.15937 11.0854 7.28993 11.3178 7.52233C11.5502 7.75473 11.6807 8.06994 11.6807 8.3986H14.1592V5.52437C14.1588 5.27713 14.0844 5.03565 13.9457 4.831C13.8069 4.62636 13.6101 4.46789 13.3806 4.37598L11.0644 3.44818L9.57858 1.46283C9.46275 1.30922 9.31275 1.18469 9.14045 1.09911C8.96815 1.01352 8.77829 0.969227 8.58591 0.969731Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M10.4414 9.63788C11.1258 9.63788 11.6806 9.08306 11.6806 8.39865C11.6806 7.71424 11.1258 7.15942 10.4414 7.15942C9.75697 7.15942 9.20215 7.71424 9.20215 8.39865C9.20215 9.08306 9.75697 9.63788 10.4414 9.63788Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M3.62887 9.63788C4.31328 9.63788 4.8681 9.08306 4.8681 8.39865C4.8681 7.71424 4.31328 7.15942 3.62887 7.15942C2.94447 7.15942 2.38965 7.71424 2.38965 8.39865C2.38965 9.08306 2.94447 9.63788 3.62887 9.63788Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.6021 4.06445H4.25195", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9199 6.54297H14.1591", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.34668 2.20898V4.06458", stroke: "#182428", strokeMiterlimit: 10 })), "Vehicle");
|
|
2301
|
+
function bh(e2) {
|
|
2302
|
+
switch (e2) {
|
|
2303
|
+
case "Advertising":
|
|
2304
|
+
case "Advertising and Marketing":
|
|
2305
|
+
return dh;
|
|
2306
|
+
case "Bank Fees":
|
|
2307
|
+
case "Bank Charges & Fees":
|
|
2308
|
+
case "College Loans":
|
|
2309
|
+
case "Merchant Processing Fees":
|
|
2310
|
+
return ma;
|
|
2311
|
+
case "Health & Fitness":
|
|
2312
|
+
case "Sports":
|
|
2313
|
+
case "Sporting Goods":
|
|
2314
|
+
return gh;
|
|
2315
|
+
case "Linen/Key Service":
|
|
2316
|
+
case "Linens (sheets, towels, etc.)":
|
|
2317
|
+
case "Hotel":
|
|
2318
|
+
case "Hotels":
|
|
2319
|
+
return ph;
|
|
2320
|
+
case "Plane / Train / Bus":
|
|
2321
|
+
case "Airlines":
|
|
2322
|
+
case "Airfare":
|
|
2323
|
+
return vh;
|
|
2324
|
+
case "Vehicle":
|
|
2325
|
+
case "Taxi":
|
|
2326
|
+
case "Rental Car":
|
|
2327
|
+
case "Rental Cars":
|
|
2328
|
+
case "Car Payment":
|
|
2329
|
+
case "Auto Insurance":
|
|
2330
|
+
case "Other Vehicle Expenses":
|
|
2331
|
+
case "Parking and Tolls":
|
|
2332
|
+
case "Parking & Tolls":
|
|
2333
|
+
case "Transportation (Taxi, Rideshare, Train)":
|
|
2334
|
+
return mh;
|
|
2335
|
+
case "Meals & Entertainment":
|
|
2336
|
+
case "Meals":
|
|
2337
|
+
case "Business Meals":
|
|
2338
|
+
case "Food & Dining":
|
|
2339
|
+
case "Groceries":
|
|
2340
|
+
case "Restaurants":
|
|
2341
|
+
case "Other Food & Dining":
|
|
2342
|
+
case "Lead Gen - Meals":
|
|
2343
|
+
case "PAX Food & Drink":
|
|
2344
|
+
return hh;
|
|
2345
|
+
default:
|
|
2346
|
+
return uh;
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
function fh({ transaction: e2 }) {
|
|
2350
|
+
var _a2;
|
|
2351
|
+
const { startPrefetch: t2, cancelPrefetch: r2 } = ci({ prefetchFn: ei(Ku.all, Yu) }), n2 = ((_a2 = e2.category) == null ? void 0 : _a2.name) ?? "Uncategorized", { mutate: o2 } = $u();
|
|
2352
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (e3) => C($d, { ...e3, onMouseEnter: t2, onMouseLeave: r2, children: [w(Go, { Component: bh(n2) }), w(to, { children: n2 })] }) }), w(ch, { onClick: Yi(e2.id, Ki.TRANSACTION_LINE_ITEM) ? (t3) => {
|
|
2353
|
+
if (t3 == null ? void 0 : t3.id) {
|
|
2354
|
+
const { parentId: r3, parentsChildren: n3, ...a2 } = e2, i2 = n3.map((r4) => r4.id === e2.id ? { ...a2, categoryId: t3.id.toString() } : r4);
|
|
2355
|
+
o2({ id: r3, children: i2 });
|
|
2356
|
+
}
|
|
2357
|
+
} : (t3) => {
|
|
2358
|
+
(t3 == null ? void 0 : t3.id) && o2({ id: e2.id, categoryId: t3.id.toString() });
|
|
2359
|
+
} })] });
|
|
2360
|
+
}
|
|
2361
|
+
const yh = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M4.31676 1.37476L1.67926 4.01226L4.31676 6.64976", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.2292 6.64976L14.8667 4.01226L12.2292 1.37476", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.27301 14.5623V7.96852C8.27301 6.91926 7.85619 5.91297 7.11425 5.17103C6.37231 4.42909 5.36602 4.01227 4.31676 4.01227H1.67926", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M8.27301 14.5623V7.96852C8.27301 6.91926 8.68983 5.91297 9.43177 5.17103C10.1737 4.42909 11.18 4.01227 12.2293 4.01227H14.8668", stroke: "#182428", strokeMiterlimit: 10 })), "Split"), Th = kt(null, ht({ flexDirection: "column", textAlign: "start", width: "100%", overflow: "hidden" })), xh = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "center", width: "100%", gap: "10px" }));
|
|
2362
|
+
function wh({ transaction: e2 }) {
|
|
2363
|
+
const t2 = e2.children.map((e3) => {
|
|
2364
|
+
var _a2;
|
|
2365
|
+
return (_a2 = e3 == null ? void 0 : e3.category) == null ? void 0 : _a2.name;
|
|
2366
|
+
}).filter((e3) => void 0 !== e3), r2 = new Set(t2), n2 = [...r2].join(", "), o2 = Gs("Category", "Categories", r2.size, true);
|
|
2367
|
+
return w(wl, { children: C("div", { ...xh, children: [w(Go, { Component: yh }), C("div", { ...Th, children: [w(to, { children: o2 }), w(no, { children: n2 })] })] }) });
|
|
2368
|
+
}
|
|
2369
|
+
function kh({ transaction: e2 }) {
|
|
2370
|
+
var _a2;
|
|
2371
|
+
return ((_a2 = e2.children) == null ? void 0 : _a2.length) > 0 ? w(wh, { transaction: e2 }) : w(fh, { transaction: e2 });
|
|
2372
|
+
}
|
|
2373
|
+
const Ch = 4;
|
|
2374
|
+
function Sh(e2, t2) {
|
|
2375
|
+
return t2 ? `${e2} *${function(e3) {
|
|
2376
|
+
const t3 = Math.max(Ch - e3.length, 0);
|
|
2377
|
+
return `${e3 + "*".repeat(t3)}`;
|
|
2378
|
+
}(t2)}` : e2 ?? "";
|
|
2379
|
+
}
|
|
2380
|
+
const Eh = (e2) => e2 > 0 ? "Deposited to" : "Withdrawn from", Ih = (e2, t2) => {
|
|
2381
|
+
const r2 = "BANK_TRANSFER" === t2.type, n2 = Eh(t2.amount);
|
|
2382
|
+
return `${r2 ? `${n2} ` : ""}${Sh(e2.apiAccountName, e2.apiAccountNo)}`;
|
|
2383
|
+
};
|
|
2384
|
+
function Ph({ transaction: e2 }) {
|
|
2385
|
+
var _a2, _b2, _c2;
|
|
2386
|
+
switch (e2.type) {
|
|
2387
|
+
case "EXPENSE":
|
|
2388
|
+
return w(kh, { transaction: e2 });
|
|
2389
|
+
case "BANK_TRANSFER":
|
|
2390
|
+
return w(Vd, { annotation: Eh(e2.amount), accountName: (_a2 = e2.bankAccount) == null ? void 0 : _a2.name });
|
|
2391
|
+
default:
|
|
2392
|
+
return w(Uu, { transaction: e2, accountNo: (_b2 = e2.glAccount) == null ? void 0 : _b2.accountNo, accountName: (_c2 = e2.glAccount) == null ? void 0 : _c2.name });
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
function Ah({ name: e2 }) {
|
|
2396
|
+
return w(k, { children: e2 && w(bl, { children: e2 }) });
|
|
2397
|
+
}
|
|
2398
|
+
const Dh = "USER_REVIEW_REQUIRED", Mh = "ACCOUNTANT_REVIEW_REQUIRED", Nh = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M8.32497 15.1744C12.1492 15.1744 15.2494 12.0742 15.2494 8.24998C15.2494 4.42573 12.1492 1.32556 8.32497 1.32556C4.50071 1.32556 1.40054 4.42573 1.40054 8.24998C1.40054 12.0742 4.50071 15.1744 8.32497 15.1744Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.54623 8.25001L7.06541 10.7692L12.1037 5.73083", stroke: "#182428", strokeMiterlimit: 10 })), "CircleCheck"), Rh = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M7.81985 0.464722V3.49919", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M7.81985 12.0008V15.0353", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M15.1051 7.75H12.0706", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M3.56907 7.75H0.534607", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9702 2.59967L10.8227 4.74724", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.81706 10.7528L2.66949 12.9004", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M12.9702 12.9004L10.8227 10.7528", stroke: "black", strokeMiterlimit: 10 }), c.createElement("path", { d: "M4.81706 4.74724L2.66949 2.59967", stroke: "black", strokeMiterlimit: 10 })), "Processing"), Oh = ht({ maxWidth: "100%", width: "fit-content", display: "inline-flex", padding: "4px 5px", justifyContent: "center", alignItems: "center", gap: "5px", borderRadius: "sm", border: "{borderWidths.md} solid", borderColor: "border.layout", background: "surface.background", cursor: "pointer", "&:focus": { outline: "none" }, "&[data-state='closed']": {}, "& .Tight-sub-label": { color: "typography.base" }, "& .Tight-medium-icon > path": { stroke: "icon.base" } }), Lh = ht({ background: "surface.intent.secondary", border: "{borderWidths.sm} solid", borderColor: "border.intent.secondary", "& .Tight-sub-label": { color: "typography.intent.secondary" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.secondary" }, "&:hover, &:focus-visible, &[data-state='open']": { background: "surface.intent.secondary.hover", borderColor: "border.intent.secondary.hover", "& .Tight-sub-label": { color: "typography.intent.secondary.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.secondary.hover" } } }), Fh = ht({ borderRadius: "sm", border: "{borderWidths.md} solid", borderColor: "border.intent.action", background: "surface.intent.action", "& .Tight-sub-label": { color: "typography.intent.action" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.action" }, "&:hover, &:focus-visible, &[data-state='open']": { background: "surface.intent.action.hover", borderColor: "border.intent.action.hover", "& .Tight-sub-label": { color: "typography.intent.action.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.action.hover" } } }), _h = ht({ borderRadius: "sm", border: "{borderWidths.md} solid", borderColor: "border.intent.success", background: "surface.intent.success", "& .Tight-sub-label": { color: "typography.intent.success" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.success" }, "&:hover, &:focus-visible, &[data-state='open']": { background: "surface.intent.success.hover", borderColor: "border.intent.success.hover", "& .Tight-sub-label": { color: "typography.intent.success.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.success.hover" } } }), Wh = ht({ background: "surface.intent.warning", border: "{borderWidths.sm} solid", borderColor: "border.intent.warning", "& .Tight-sub-label": { color: "typography.intent.warning" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.warning" }, "&:hover, &:focus-visible, &[data-state='open']": { background: "surface.intent.warning.hover", borderColor: "border.intent.warning.hover", "& .Tight-sub-label": { color: "typography.intent.warning.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.warning.hover" } } }), Bh = ht({ background: "surface.intent.danger", border: "{borderWidths.sm} solid", borderColor: "border.intent.danger", "& .Tight-sub-label": { color: "typography.intent.danger" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.danger" }, "&:hover, &:focus-visible, &[data-state='open']": { background: "surface.intent.danger.hover", borderColor: "border.intent.danger.hover", "& .Tight-sub-label": { color: "typography.intent.danger.hover" }, "& .Tight-medium-icon > path": { stroke: "icon.intent.danger.hover" } } }), Hh = kt(bt.badge, Oh), zh = kt(null, Fn), Vh = kt(null, ta), jh = kt(bt["neutral-badge"], Lh), qh = kt(bt["highlight-badge"], Fh), $h = kt(bt["success-badge"], _h), Uh = kt(bt["warning-badge"], Wh), Kh = kt(bt["critical-badge"], Bh);
|
|
2399
|
+
function Yh({ type: e2, children: t2, onClick: r2, popupTriggerProps: n2 }) {
|
|
2400
|
+
let o2;
|
|
2401
|
+
switch (e2) {
|
|
2402
|
+
case "critical":
|
|
2403
|
+
o2 = Kh;
|
|
2404
|
+
break;
|
|
2405
|
+
case "warning":
|
|
2406
|
+
o2 = Uh;
|
|
2407
|
+
break;
|
|
2408
|
+
case "neutral":
|
|
2409
|
+
o2 = jh;
|
|
2410
|
+
break;
|
|
2411
|
+
case "success":
|
|
2412
|
+
o2 = $h;
|
|
2413
|
+
break;
|
|
2414
|
+
case "highlight":
|
|
2415
|
+
o2 = qh;
|
|
2416
|
+
}
|
|
2417
|
+
const a2 = Pt([Hh, zh, o2, Vh]);
|
|
2418
|
+
return w("button", { ...a2, onClick: r2, ...n2, children: t2 });
|
|
2419
|
+
}
|
|
2420
|
+
const Gh = h({ userId: void 0, userRole: void 0, userEmail: void 0 }), Qh = [{ status: "USER_REVIEW_REQUIRED", displayName: "Needs Review" }, { status: "RECONCILED", displayName: "Reconciled" }, { status: "ACCOUNTANT_REVIEW_REQUIRED", displayName: "Flag to Accountant" }], Xh = [{ status: "ACCOUNTANT_REVIEW_REQUIRED", displayName: "Needs Review" }, { status: "RECONCILIATION_DISCREPANCY", displayName: "Discrepancy" }, { status: "RECONCILED", displayName: "Reconciled" }, { status: "USER_REVIEW_REQUIRED", displayName: "Flag to User" }], Zh = (e2) => {
|
|
2421
|
+
switch (e2) {
|
|
2422
|
+
case "OWNER":
|
|
2423
|
+
default:
|
|
2424
|
+
return Qh;
|
|
2425
|
+
case "ACCOUNTANT":
|
|
2426
|
+
return Xh;
|
|
2427
|
+
}
|
|
2428
|
+
};
|
|
2429
|
+
function Jh({ onClick: e2 }) {
|
|
2430
|
+
const t2 = Ol(), { userRole: r2 } = g(Gh), n2 = Zh(r2) || [];
|
|
2431
|
+
return w($l, { children: w(ru, { children: n2.map(({ status: r3, displayName: n3 }) => w(au, { onClick: () => ((r4) => {
|
|
2432
|
+
e2(r4), t2.setOpen(false);
|
|
2433
|
+
})(r3), children: n3 }, r3)) }) });
|
|
2434
|
+
}
|
|
2435
|
+
const eg = (e2, t2) => {
|
|
2436
|
+
const r2 = ((e3, t3) => {
|
|
2437
|
+
switch (t3) {
|
|
2438
|
+
case "ACCOUNTANT":
|
|
2439
|
+
return e3 === Mh;
|
|
2440
|
+
case "OWNER":
|
|
2441
|
+
return e3 === Dh;
|
|
2442
|
+
}
|
|
2443
|
+
})(e2, t2), n2 = /* @__PURE__ */ ((e3, t3) => "OWNER" === t3 && e3 === Mh)(e2, t2), o2 = /* @__PURE__ */ ((e3, t3) => "ACCOUNTANT" === t3 && e3 === Dh)(e2, t2), a2 = /* @__PURE__ */ ((e3) => "RECONCILIATION_DISCREPANCY" === e3)(e2), i2 = /* @__PURE__ */ ((e3) => "RECONCILED" === e3)(e2);
|
|
2444
|
+
let l2, s2, c2 = "neutral";
|
|
2445
|
+
return n2 ? (l2 = "Pending Review", s2 = w(Go, { Component: Rh }), c2 = "neutral") : o2 ? (l2 = "Pending User Review", s2 = w(Go, { Component: Rh }), c2 = "neutral") : r2 ? (l2 = "Needs Review", s2 = w(Go, { Component: va }), c2 = "warning") : a2 ? (l2 = "Discrepancy", s2 = w(Go, { Component: Jo }), c2 = "critical") : i2 ? (l2 = "Reconciled", s2 = w(Go, { Component: Nh }), c2 = "success") : (l2 = "Processing", s2 = w(Go, { Component: Rh }), c2 = "neutral"), { text: l2, type: c2, Icon: s2 };
|
|
2446
|
+
};
|
|
2447
|
+
function tg({ status: e2, transactionId: t2 }) {
|
|
2448
|
+
const [r2, n2] = v(false), { mutate: o2 } = $u(), a2 = () => {
|
|
2449
|
+
n2(false);
|
|
2450
|
+
}, i2 = () => {
|
|
2451
|
+
n2(!r2);
|
|
2452
|
+
}, { userRole: l2 } = g(Gh), { text: s2, type: c2, Icon: d2 } = eg(e2, l2);
|
|
2453
|
+
return t2 && !function(e3) {
|
|
2454
|
+
return e3.startsWith(Ki.TRANSACTION_LINE_ITEM) || e3.startsWith(Ki.PROCESSOR_TRANSACTION);
|
|
2455
|
+
}(t2) ? C(Rl, { open: r2, blockInteraction: false, onOpenChange: a2, enableClickMiddleware: false, children: [w(Ll, { children: (e3) => C(Yh, { type: c2, popupTriggerProps: e3, onClick: i2, children: [d2, w(no, { children: s2 })] }) }), w(Jh, { onClick: (e3) => {
|
|
2456
|
+
o2({ id: t2, reviewStatus: e3 }), a2();
|
|
2457
|
+
} })] }) : null;
|
|
2458
|
+
}
|
|
2459
|
+
function rg({ status: e2, transactionId: t2 }) {
|
|
2460
|
+
return w(tg, { status: e2, transactionId: t2 }, t2);
|
|
2461
|
+
}
|
|
2462
|
+
const ng = Xo((e2) => c.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("g", { clipPath: "url(#clip0_9779_2940)" }, c.createElement("path", { d: "M11.9147 7.99997L6.31472 2.39996L0.714716 7.99997", stroke: "#182428", strokeMiterlimit: 10 })), c.createElement("defs", null, c.createElement("clipPath", { id: "clip0_9779_2940" }, c.createElement("rect", { width: 12, height: 12, fill: "white", transform: "translate(0.314728)" })))), "ArrowUp"), og = Xo((e2) => c.createElement("svg", { width: 13, height: 12, viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("g", { clipPath: "url(#clip0_9779_2922)" }, c.createElement("path", { d: "M0.714706 3.99996L6.31472 9.59998L11.9147 3.99996", stroke: "#182428", strokeMiterlimit: 10 })), c.createElement("defs", null, c.createElement("clipPath", { id: "clip0_9779_2922" }, c.createElement("rect", { width: 12, height: 12, fill: "white", transform: "translate(0.314728)" })))), "ArrowDown");
|
|
2463
|
+
function ag({ row: e2 }) {
|
|
2464
|
+
const t2 = e2.getIsExpanded();
|
|
2465
|
+
return e2.getCanExpand() ? w(es, { "aria-label": t2 ? "Collapse row" : "Expand row", "aria-expanded": t2, children: w(Pa, { Component: t2 ? ng : og }) }) : w(es, { active: false, children: w(Pa, { Component: Aa }) });
|
|
2466
|
+
}
|
|
2467
|
+
function ig({ row: e2 }) {
|
|
2468
|
+
return w(ag, { row: e2 });
|
|
2469
|
+
}
|
|
2470
|
+
const lg = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M0.495239 8.15601H14.7767", strokeMiterlimit: 10 })), "Dash"), sg = kt(null, ht({ position: "absolute", top: "-1", right: "-1", width: "10", height: "10", borderRadius: "999px", backgroundColor: "surface.intent.warning", boxShadow: "0 0 0 1px {colors.border.intent.warning}" })), cg = kt(null, ht({ position: "relative", display: "inline-block" })), dg = kt(null, ht({ stroke: "icon.base" })), ug = kt(null, ht({ stroke: "icon.base.weak" }));
|
|
2471
|
+
function hg({ hasConversation: e2, hasRead: t2 = false }) {
|
|
2472
|
+
return w(k, { children: e2 ? C("div", { ...cg, children: [w(ps, { Component: Zo, stylists: [dg] }), !t2 && w("div", { "data-testid": "unread-comment-badge", ...sg, "aria-hidden": "true" })] }) : w("div", { "data-testid": "no-conversations-dash", children: w(_l, { Component: lg, stylists: [ug] }) }) });
|
|
2473
|
+
}
|
|
2474
|
+
function gg({ conversationId: e2 }) {
|
|
2475
|
+
const { query: { data: t2 } } = mi(e2 ?? null), { startPrefetch: r2, cancelPrefetch: n2 } = fi(), { startPrefetch: o2, cancelPrefetch: a2 } = Ji(), i2 = er(t2), l2 = i2 && "READ" == (t2 == null ? void 0 : t2.readStatus), s2 = m(() => {
|
|
2476
|
+
er(e2) && (r2({ id: e2 }), o2({ id: e2 }));
|
|
2477
|
+
}, [e2, r2, o2]), c2 = m(() => {
|
|
2478
|
+
er(e2) && (n2(), a2());
|
|
2479
|
+
}, [e2, n2, a2]);
|
|
2480
|
+
return w("div", { onMouseEnter: s2, onMouseLeave: c2, children: w(hg, { hasConversation: i2, hasRead: l2 }) });
|
|
2481
|
+
}
|
|
2482
|
+
const pg = j(), vg = [pg.display({ id: Me.SELECT, header: () => null, cell: ({ row: e2 }) => void 0 === e2.getParentRow() ? w(Ed, { checked: e2.getIsSelected(), onClick: e2.getToggleSelectedHandler() }, e2.original.id) : null, maxSize: 35, meta: { clickable: true } }), pg.accessor("date", { id: Me.DATE, cell: (e2) => w(wl, { children: w(Od, { transaction: e2.row.original }) }), header: () => w(os, { columnName: "Date", sortDef: "DATE", sortAscDisplay: vd.ASC, sortDescDisplay: vd.DESC }), size: 130, maxSize: 144 }), pg.accessor("description", { id: Me.DESCRIPTION, cell: (e2) => w(wl, { children: w(Fd, { bankTransaction: e2.row.original }) }), header: () => w(os, { columnName: "Source", sortDef: "DESCRIPTION", sortAscDisplay: md.ASC, sortDescDisplay: md.DESC }), size: 180 }), pg.accessor("amount", { id: Me.AMOUNT, cell: (e2) => w(wl, { children: w(Hd, { transaction: e2.row.original }) }), header: () => w(os, { columnName: "Amount", sortDef: "AMOUNT", sortAscDisplay: bd.ASC, sortDescDisplay: bd.DESC }), size: 130, maxSize: 180 }), pg.accessor("category.id", { id: Me.CATEGORY, cell: (e2) => w(Ph, { transaction: e2.row.original }), header: () => w(os, { columnName: "Category" }), size: 130, meta: { clickable: true } }), pg.accessor((e2) => {
|
|
2483
|
+
var _a2;
|
|
2484
|
+
return (_a2 = e2.classSegments[0]) == null ? void 0 : _a2.id;
|
|
2485
|
+
}, { id: Me.CLASS_SEGMENT, cell: (e2) => {
|
|
2486
|
+
var _a2;
|
|
2487
|
+
return w(wl, { children: w(Ah, { name: (_a2 = e2.row.original.classSegments[0]) == null ? void 0 : _a2.name }) });
|
|
2488
|
+
}, header: () => w(os, { columnName: "Business" }), size: 130 }), pg.accessor("reviewStatus", { id: Me.REVIEW_STATUS, cell: (e2) => w(wl, { children: w(rg, { status: e2.getValue(), transactionId: e2.row.original.id }) }), header: () => w(os, { columnName: "Reviewed", sortDef: "REVIEW_STATUS", sortAscDisplay: fd.ASC, sortDescDisplay: fd.DESC }), size: 130, maxSize: 160, meta: { clickable: true } }), pg.display({ id: Me.COMMENTS, cell: (e2) => {
|
|
2489
|
+
var _a2;
|
|
2490
|
+
const t2 = e2.row.original;
|
|
2491
|
+
return w(wl, { alignVariant: "center", children: w(gg, { conversationId: (_a2 = t2.conversation) == null ? void 0 : _a2.id }) });
|
|
2492
|
+
}, header: () => w(os, { columnName: "Comments" }), size: 110, maxSize: 110, meta: { clickable: true } }), pg.display({ id: Me.EXPAND, cell: (e2) => w(ig, { row: e2.row }), size: 40, maxSize: 60 })];
|
|
2493
|
+
function mg(e2) {
|
|
2494
|
+
return e2 ? vg.filter((t2) => e2.includes(t2.id)) : vg;
|
|
2495
|
+
}
|
|
2496
|
+
function bg(e2) {
|
|
2497
|
+
if (e2) return Object.values(Me).reduce((t2, r2) => (t2[r2] = e2.includes(r2), t2), {});
|
|
2498
|
+
}
|
|
2499
|
+
function fg({ transactions: e2, columns: t2 }) {
|
|
2500
|
+
return function({ transactions: e3, columns: t3 }) {
|
|
2501
|
+
return q({ data: e3 ?? yg, manualPagination: true, manualSorting: true, manualFiltering: true, manualGrouping: true, rowCount: (e3 == null ? void 0 : e3.length) ?? yg.length, columns: mg(t3), getCoreRowModel: $(), getRowCanExpand: (e4) => e4.original.children.length > 0, getSubRows: (e4) => e4.children.map((t4) => function(e5, t5, r2) {
|
|
2502
|
+
return { parentId: t5, parentsChildren: r2, ...e5, matchingBankTransaction: null, rule: null, tax: { paymentInfo: null }, customData: null, children: [], conversation: null };
|
|
2503
|
+
}(t4, e4.id, e4.children)), getExpandedRowModel: U(), paginateExpandedRows: false, getRowId: (e4) => e4.id, state: { columnOrder: t3, columnVisibility: bg(t3) } });
|
|
2504
|
+
}({ transactions: e2, columns: t2 ? [...t2, Me.EXPAND] : void 0 });
|
|
2505
|
+
}
|
|
2506
|
+
const yg = [];
|
|
2507
|
+
const Tg = [Me.COMMENTS, Me.DATE, Me.DESCRIPTION, Me.AMOUNT, Me.CATEGORY, Me.REVIEW_STATUS];
|
|
2508
|
+
function xg(e2, t2) {
|
|
2509
|
+
return Fi("BankTransactionFormRouter", { routeProps: { transactionId: e2, initialTab: t2 } });
|
|
2510
|
+
}
|
|
2511
|
+
function wg(e2) {
|
|
2512
|
+
var _a2;
|
|
2513
|
+
const t2 = e2.row, r2 = (_a2 = e2.column.columnDef.meta) == null ? void 0 : _a2.clickable, n2 = t2.getCanExpand(), o2 = "BANK_TRANSFER" === t2.original.type, a2 = "category" === e2.column.id && (n2 || o2);
|
|
2514
|
+
if ("comments" === e2.column.id) {
|
|
2515
|
+
const e3 = t2.getParentRow();
|
|
2516
|
+
xg((e3 == null ? void 0 : e3.original.id) ?? t2.original.id, "conversation");
|
|
2517
|
+
} else if (!r2 || a2) if (n2) t2.toggleExpanded();
|
|
2518
|
+
else {
|
|
2519
|
+
const e3 = t2.getParentRow();
|
|
2520
|
+
xg((e3 == null ? void 0 : e3.original.id) ?? t2.original.id);
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
function kg({ rowData: e2, hasSelect: t2 = true }) {
|
|
2524
|
+
const { startPrefetch: r2, cancelPrefetch: n2 } = Ui(), o2 = m(() => r2({ id: e2.original.id }), [r2, e2.original]);
|
|
2525
|
+
return w(Li, { rowData: e2, onMouseEnter: o2, onMouseLeave: n2, onCellClick: wg, shouldDisplayDivider: (r3) => function(e3, t3, r4) {
|
|
2526
|
+
return !(0 === e3 || t3 && 1 === e3 || e3 === r4 - 1 || t3 || 1 === e3);
|
|
2527
|
+
}(r3, t2, e2.getVisibleCells().length) });
|
|
2528
|
+
}
|
|
2529
|
+
const Cg = "All caught up", Sg = "We'll let you know if something comes up.";
|
|
2530
|
+
function Eg() {
|
|
2531
|
+
return C(k, { children: [w(ps, { Component: Nh }), w(to, { children: Cg }), w(no, { children: Sg })] });
|
|
2532
|
+
}
|
|
2533
|
+
function Ig() {
|
|
2534
|
+
const { linkPlaid: e2 } = Js();
|
|
2535
|
+
return w(pa, { onClick: e2, children: w(to, { children: "Link your bank" }) });
|
|
2536
|
+
}
|
|
2537
|
+
const Pg = "Your bank transactions will be categorized for you", Ag = "If any require your review, they'll be flagged here.";
|
|
2538
|
+
function Dg() {
|
|
2539
|
+
return C(k, { children: [w(ps, { Component: ma }), w(to, { children: Pg }), w(no, { children: Ag }), w(Ig, {})] });
|
|
2540
|
+
}
|
|
2541
|
+
const Mg = kt(null, ht({ minWidth: "900px" }));
|
|
2542
|
+
function Ng({ hasLinkedAccount: e2, sortInstance: t2, setSortInstance: r2, isFilling: n2, paginationControls: o2, transactions: a2 }) {
|
|
2543
|
+
const i2 = function({ transactions: e3 }) {
|
|
2544
|
+
return fg({ transactions: e3, columns: Tg });
|
|
2545
|
+
}({ transactions: a2 }), l2 = function(e3, t3) {
|
|
2546
|
+
let r3;
|
|
2547
|
+
return e3 ? t3 && (r3 = w(Eg, {})) : r3 = w(Dg, {}), r3;
|
|
2548
|
+
}(e2 ?? false, !(a2.length > 0));
|
|
2549
|
+
return C("div", { ...Mg, children: [w("div", { id: Vo }), C(ja.Provider, { value: o2, children: [C(St, { children: [w(Mt, { children: "Transactions For Your Review" }), w(Ka, {})] }), w(dl, { dashboard: "businessOwnerDashboard", children: n2 ? w(Ja, {}) : C(k, { children: [w(ul.Provider, { value: { sortInstance: t2, setSortInstance: r2 }, children: w(wi, { headerGroups: i2.getHeaderGroups() }) }), Jt(l2) ? w(Ci, { children: i2.getRowModel().rows.map((e3) => w(kg, { rowData: e3, hasSelect: false }, e3.id)) }) : w(gs, { children: l2 })] }) })] })] });
|
|
2550
|
+
}
|
|
2551
|
+
function Rg() {
|
|
2552
|
+
const { sortInstance: e2, setSortInstance: t2, apiSort: r2 } = yd(), { query: { data: n2 }, isFilling: o2, paginationControls: a2 } = ji({ filter: qo, sort: r2, limit: Uo }), i2 = (n2 == null ? void 0 : n2.data) ?? Ko, { query: { data: l2 }, isFilling: s2 } = cc();
|
|
2553
|
+
return w(Ng, { sortInstance: e2, setSortInstance: t2, isFilling: o2 || s2, paginationControls: a2, transactions: i2, hasLinkedAccount: l2 ?? false });
|
|
2554
|
+
}
|
|
2555
|
+
const Og = kt(bt["business-owner-dashboard"], ht({ gap: 10, display: "flex", flexDirection: "column", width: "100%", maxWidth: 1440 })), Lg = kt(null, ht({ display: "flex", width: "100%", justifyContent: "center" })), Fg = "In April 2025, your total income increased significantly to $7,500, up from $5,000 the previous month, reflecting strong revenue growth. However, expenses also rose slightly to $2,677.99, compared to $2,400 last month, which slightly narrowed your net profit margin despite a healthy $4,822.01 net profit. \n\nA key area for improvement is transaction categorization; with one transaction remaining uncategorized and only two user-categorized, enhancing categorization accuracy will improve financial tracking and insights. To maintain positive momentum, consider reviewing variable expenses to identify any controllable cost increases.\n\nGoing forward, continue focusing on revenue growth while keeping a close eye on expense management, and aim to fully categorize all transactions to gain more precise financial visibility. ", _g = "A summary of this month's financials will appear here once more data is available.", Wg = (e2) => {
|
|
2556
|
+
const t2 = jo[e2], r2 = document.getElementById(t2);
|
|
2557
|
+
r2 && r2.scrollIntoView({ behavior: "smooth" });
|
|
2558
|
+
}, Bg = { status: { operator: "IN", values: ["ACTIVE", "INACTIVE"] } };
|
|
2559
|
+
function Hg({ period: e2, onChangePeriod: t2 }) {
|
|
2560
|
+
const { sortInstance: r2, setSortInstance: n2, apiSort: o2 } = is(), { query: { data: a2 }, isFilling: i2, paginationControls: l2 } = pi({ limit: Uo, sort: o2, filter: $o }), s2 = (a2 == null ? void 0 : a2.data) ?? Yo, { query: { data: c2 }, isFilling: d2 } = dr({ queryKey: Wa.all(), queryFn: za, select: Ha }), { query: { data: h2 } } = cc(), { query: { data: g2 } } = nc(), p2 = u(() => {
|
|
2561
|
+
let e3 = [];
|
|
2562
|
+
g2 && (e3 = g2.map((e4) => {
|
|
2563
|
+
return t4 = e4.apiInstitutionName, r4 = e4.id, { id: `${t4}_bank_error_task`, priority: "URGENT", name: "Fix your bank connection", description: `Please relink your ${t4} bank using your latest credentials`, type: "BANK_ERROR", dismissable: "DISMISSABLE", status: "ACTIVE", meta: { plaidItemId: r4 } };
|
|
2564
|
+
var t4, r4;
|
|
2565
|
+
}));
|
|
2566
|
+
let t3 = [];
|
|
2567
|
+
h2 || (t3 = [Hs]);
|
|
2568
|
+
const r3 = c2 ?? [];
|
|
2569
|
+
return [...e3, ...t3, ...r3];
|
|
2570
|
+
}, [c2, h2, g2]), v2 = function() {
|
|
2571
|
+
var _a2;
|
|
2572
|
+
const { query: { data: e3 } } = ji({ filter: Bg, limit: 1 });
|
|
2573
|
+
return (((_a2 = e3 == null ? void 0 : e3.data) == null ? void 0 : _a2.length) ?? 0) > 0;
|
|
2574
|
+
}(), m2 = false === h2 && !v2, b2 = /* @__PURE__ */ new Date(), f2 = (y2 = b2.getMonth(), T2 = b2.getFullYear(), { month: y2, year: T2 });
|
|
2575
|
+
var y2, T2;
|
|
2576
|
+
const [x2, k2] = Ml(f2, e2, t2), S2 = function(e3, t3) {
|
|
2577
|
+
return { beginDate: Rt(t3 - 1, e3 + 1, 1), endDate: Rt(t3, e3 + 1, 0) };
|
|
2578
|
+
}(x2.month, x2.year), { query: { data: E2 }, isFilling: I2 } = Ps(x2), P2 = m2 && !v2 ? Fg : E2 ?? _g;
|
|
2579
|
+
return w("div", { ...Lg, children: C("div", { ...Og, children: [w(St, { children: w(Mt, { children: "Action Items" }) }), w(Ho, { children: d2 ? w(pd, {}) : p2.map((e3) => "LINK_BANK" === e3.type || "BANK_ERROR" === e3.type ? w(ec, { task: e3 }, e3.id) : w(Fa, { task: e3, handleClick: () => Wg(e3.type) }, e3.id)) }), w(hd, { period: x2, handleDateChange: (e3) => {
|
|
2580
|
+
var t3, r3;
|
|
2581
|
+
(t3 = f2).year === (r3 = e3).year && r3.month > t3.month || r3.year > t3.year || k2(e3);
|
|
2582
|
+
}, todayPeriod: f2, showSamples: m2 }), w(St, { children: w(Mt, { children: "Financial Summary" }) }), w(Bs, { isSample: m2, isFilling: I2, children: P2 }), w(Wo, { filter: S2 }), w(Ss, { sortInstance: r2, setSortInstance: n2, conversations: s2, paginationControls: l2, isFilling: i2 }), w(Rg, {})] }) });
|
|
2583
|
+
}
|
|
2584
|
+
function zg(e2) {
|
|
2585
|
+
return w("div", { className: yt(bt.component), children: w(Hg, { ...e2 }) });
|
|
2586
|
+
}
|
|
2587
|
+
const Vg = ve("tight-component-store", 1, { upgrade(e2) {
|
|
2588
|
+
e2.createObjectStore("queryClient");
|
|
2589
|
+
} });
|
|
2590
|
+
const jg = { queryClient: lr, persister: /* @__PURE__ */ function(e2 = "reactQuery") {
|
|
2591
|
+
return { persistClient: async (t2) => {
|
|
2592
|
+
await async function(e3, t3) {
|
|
2593
|
+
return (await Vg).put("queryClient", t3, e3);
|
|
2594
|
+
}(e2, t2);
|
|
2595
|
+
}, restoreClient: async () => await async function(e3) {
|
|
2596
|
+
return (await Vg).get("queryClient", e3);
|
|
2597
|
+
}(e2), removeClient: async () => {
|
|
2598
|
+
await async function(e3) {
|
|
2599
|
+
return (await Vg).delete("queryClient", e3);
|
|
2600
|
+
}(e2);
|
|
2601
|
+
} };
|
|
2602
|
+
}(), maxAge: ir, dehydrateOptions: { shouldDehydrateQuery: (e2) => !e2.isStale() } };
|
|
2603
|
+
function qg({ children: e2 }) {
|
|
2604
|
+
return w(me, { client: lr, persistOptions: jg, children: e2 });
|
|
2605
|
+
}
|
|
2606
|
+
function $g(e2) {
|
|
2607
|
+
return w(Zr || k, { children: e2.children });
|
|
2608
|
+
}
|
|
2609
|
+
const Ug = ht({ position: "absolute", top: 0, left: 0, width: "100dvw", height: "100dvh", minWidth: "100dvw", minHeight: "100dvh", maxHeight: "100dvh", maxWidth: "100dvw", overflow: "hidden" }), Kg = ht({ backgroundColor: "overlay" }), Yg = kt(null, Ug, Kg), Gg = kt(null, bt.component, Ug);
|
|
2610
|
+
function Qg({ children: e2 }) {
|
|
2611
|
+
const t2 = d(null), r2 = d(null);
|
|
2612
|
+
return C(se, { lockScroll: true, children: [w("div", { ...Yg }), w("div", { onMouseDown: (e3) => {
|
|
2613
|
+
r2.current = e3.target;
|
|
2614
|
+
}, onClick: (e3) => {
|
|
2615
|
+
const n2 = r2.current === t2.current, o2 = e3.target === t2.current;
|
|
2616
|
+
n2 && o2 && (r2.current = null, _i());
|
|
2617
|
+
}, ref: t2, ...Gg, children: e2 })] });
|
|
2618
|
+
}
|
|
2619
|
+
const Xg = h({ drawerHistory: [] });
|
|
2620
|
+
function Zg({ children: e2 }) {
|
|
2621
|
+
const t2 = De((e3) => e3.drawerHistory), r2 = u(() => ({ drawerHistory: t2 }), [t2]);
|
|
2622
|
+
return w(Xg.Provider, { value: r2, children: t2.length > 0 && w(Qg, { children: e2 }) });
|
|
2623
|
+
}
|
|
2624
|
+
function Jg({ Component: e2, name: t2 }) {
|
|
2625
|
+
const { drawerHistory: r2 } = g(Xg), n2 = r2.at(-1);
|
|
2626
|
+
if (void 0 === n2) return null;
|
|
2627
|
+
const o2 = n2[t2];
|
|
2628
|
+
return void 0 !== o2 ? w(e2, { ...o2.routeProps }) : void 0;
|
|
2629
|
+
}
|
|
2630
|
+
const ep = kt(null, ht({ color: "typography.accent.danger" })), tp = [kt(null, ht({ color: "icon.accent.danger", "& path": { stroke: "icon.accent.danger" } }))], rp = kt(null, ht({ display: "flex", alignItems: "center", gap: "4px" }));
|
|
2631
|
+
function np({ errorMessage: e2 }) {
|
|
2632
|
+
return C("div", { ...rp, children: [w(Go, { Component: Jo, stylists: tp }), w(no, { stylists: [ep], children: e2 })] });
|
|
2633
|
+
}
|
|
2634
|
+
const op = ht({ display: "flex", flexDirection: "column", padding: "12px 16px", cursor: "pointer", outline: "none", gap: "8px", borderRadius: "md", backgroundColor: "surface.intent.action.discrete", "&[data-state='closed'][data-disablehover='false']:hover, &:not([data-state])[data-disablehover='false']:hover:not(:focus-within)": { backgroundColor: "surface.intent.action.discrete.hover" }, "&[data-state='open']": { backgroundColor: "surface.intent.action.discrete.active" }, "&[data-clicked='false']:has(:focus-visible)": { outline: "4px solid", outlineColor: "border.layout" } }), ap = ht({ "&[data-haserror='true']": { border: "{borderWidths.lg} solid", borderColor: "border.intent.danger" } });
|
|
2635
|
+
function ip({ children: e2, inputRef: t2, popupTriggerProps: r2, label: n2, isDefaultValue: o2, className: a2, additionalStyles: i2, onClick: l2, onBlur: s2, errorMessage: c2, disableHover: d2 = false }) {
|
|
2636
|
+
const u2 = kt(a2 || null, op, i2, ap, ta), [h2, g2] = v(true);
|
|
2637
|
+
return C(k, { children: [C("div", { ...u2, onClick: l2, ...r2, onMouseDown: (e3) => {
|
|
2638
|
+
g2(true), t2 && t2.current && e3.target !== t2.current && (e3.preventDefault(), t2.current.focus());
|
|
2639
|
+
}, onFocus: () => {
|
|
2640
|
+
t2 && t2.current && function(e3) {
|
|
2641
|
+
if ("setSelectionRange" in e3) {
|
|
2642
|
+
const t3 = e3.value.length;
|
|
2643
|
+
e3.setSelectionRange(t3, t3);
|
|
2644
|
+
}
|
|
2645
|
+
}(t2.current);
|
|
2646
|
+
}, onBlur: () => {
|
|
2647
|
+
g2(false), s2 == null ? void 0 : s2();
|
|
2648
|
+
}, "data-clicked": h2, "data-isdefaultvalue": o2, "data-haserror": void 0 !== c2, "data-disablehover": d2, children: [void 0 !== n2 && w(no, { children: n2 }), e2] }), c2 && w(np, { errorMessage: c2 })] });
|
|
2649
|
+
}
|
|
2650
|
+
const { formContext: lp, fieldContext: sp, useFieldContext: cp, useFormContext: dp } = be(), up = ht({ backgroundColor: "surface.foreground.disabled", pointerEvents: "none", border: "{borderWidths.lg} solid", borderColor: "border.layout.strong" }), hp = mt({ base: { backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid", borderColor: "border.layout.strong" }, variants: { kind: { text: { cursor: "text" }, button: { cursor: "pointer" }, container: { cursor: "default" } } } });
|
|
2651
|
+
function gp({ kind: e2, label: t2, children: r2, inputRef: n2, disabled: o2, popupTriggerProps: a2, onClick: i2, disableHover: l2 = false }) {
|
|
2652
|
+
const s2 = cp(), c2 = fe(s2.store, (e3) => {
|
|
2653
|
+
var _a2;
|
|
2654
|
+
return (_a2 = e3.meta.errors[0]) == null ? void 0 : _a2.message;
|
|
2655
|
+
}), d2 = o2 ? up : hp({ kind: e2 });
|
|
2656
|
+
return w(ip, { label: t2, inputRef: n2, popupTriggerProps: a2, className: bt["editable-form-input"], additionalStyles: d2, errorMessage: c2, onBlur: s2.handleBlur, disableHover: l2, onClick: i2, children: r2 });
|
|
2657
|
+
}
|
|
2658
|
+
const pp = kt(bt["button-secondary"], ht({ color: "typography.intent.primary", border: "{borderWidths.md} solid", borderColor: "border.intent.primary", backgroundColor: "surface.intent.primary", "& .Tight-text": { color: "typography.intent.primary" }, "& path": { stroke: "icon.intent.primary" }, "&:hover:not(:disabled)": { backgroundColor: "surface.intent.primary.hover", borderColor: "border.intent.primary.hover", "& .Tight-text": { color: "typography.intent.primary.hover" }, "& path": { stroke: "icon.intent.primary.hover" } }, "&:active:enabled, &[data-active='true']:enabled": { backgroundColor: "surface.intent.primary.active", borderColor: "border.intent.primary.active", "& .Tight-text": { color: "typography.intent.primary.active" }, "& path": { stroke: "icon.intent.primary.active" } } }));
|
|
2659
|
+
function vp({ children: e2, stylists: t2 = [], ...r2 }) {
|
|
2660
|
+
return w(ha, { stylists: [pp, ...t2], ...r2, children: e2 });
|
|
2661
|
+
}
|
|
2662
|
+
const mp = [kt(null, ht({ "& path": { stroke: "surface.foreground" } }))];
|
|
2663
|
+
function bp({ onClick: e2 }) {
|
|
2664
|
+
return C(vp, { size: "small", onClick: (t2) => {
|
|
2665
|
+
t2.stopPropagation(), t2.preventDefault(), e2();
|
|
2666
|
+
}, children: [w(Pa, { stylists: mp, Component: yh }), w(no, { children: "Add Split" })] });
|
|
2667
|
+
}
|
|
2668
|
+
const fp = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", height: "39px", padding: 0 }));
|
|
2669
|
+
const yp = ht({ border: "{borderWidths.lg} solid transparent", "&:focus-within, &[data-isdefaultvalue='false']": { backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid", borderColor: "border.layout.strong" }, "&:focus-within": { cursor: "text" } });
|
|
2670
|
+
function Tp({ children: e2, inputRef: t2, popupTriggerProps: r2, label: n2, onClick: o2 }) {
|
|
2671
|
+
const a2 = cp(), i2 = fe(a2.store, (e3) => {
|
|
2672
|
+
var _a2;
|
|
2673
|
+
return (_a2 = e3.meta.errors[0]) == null ? void 0 : _a2.message;
|
|
2674
|
+
}), l2 = fe(a2.store, (e3) => e3.meta.isDefaultValue);
|
|
2675
|
+
return w(ip, { label: n2, inputRef: t2, popupTriggerProps: r2, isDefaultValue: l2, className: bt["discrete-form-input"], additionalStyles: yp, errorMessage: i2, onClick: o2, onBlur: a2.handleBlur, children: e2 });
|
|
2676
|
+
}
|
|
2677
|
+
const xp = kt(null, ht({ display: "flex", flexDirection: "column", maxHeight: "200px", overflowY: "auto", minWidth: "120px" }));
|
|
2678
|
+
function wp({ options: e2, onSelect: t2, selectedLabel: r2 }) {
|
|
2679
|
+
const n2 = Ol();
|
|
2680
|
+
return w("div", { ...xp, children: e2.map((e3) => w(Yl, { onClick: () => {
|
|
2681
|
+
return r3 = Number(e3.value), n2 == null ? void 0 : n2.setOpen(false), void t2(r3);
|
|
2682
|
+
var r3;
|
|
2683
|
+
}, active: r2 === e3.label, children: e3.label }, e3.value)) });
|
|
2684
|
+
}
|
|
2685
|
+
const kp = kt(null, ht({ cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "space-between", padding: "8px", borderRadius: "sm", gap: "7px", backgroundColor: "surface.intent.action.discrete", border: "{borderWidths.lg} solid transparent", "&:hover": { backgroundColor: "surface.intent.action.discrete.hover", border: "{borderWidths.lg} solid", borderColor: "border.intent.action.hover" } }), ea);
|
|
2686
|
+
function Cp({ selectedLabel: e2, options: t2, onSelect: r2 }) {
|
|
2687
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (t3) => C("div", { ...kp, ...t3, children: [w(to, { children: e2 }), w(_l, { Component: og })] }) }), w($l, { children: w(wp, { options: t2, onSelect: r2, selectedLabel: e2 }) })] });
|
|
2688
|
+
}
|
|
2689
|
+
const Sp = kt(null, ht({ display: "flex", alignItems: "center", gap: "15px" })), Ep = Ht.map((e2, t2) => ({ value: t2, label: e2 })), Ip = zt({}).map((e2) => ({ value: e2, label: String(e2) }));
|
|
2690
|
+
function Pp({ currentMonthYear: e2, onMonthYearChange: t2 }) {
|
|
2691
|
+
const r2 = e2.getFullYear(), n2 = e2.getMonth(), o2 = (e3, r3) => {
|
|
2692
|
+
const n3 = new Date(e3, r3, 1);
|
|
2693
|
+
t2(n3);
|
|
2694
|
+
};
|
|
2695
|
+
return C("div", { ...Sp, children: [w(Cp, { selectedLabel: Ht[n2], options: Ep, onSelect: (e3) => o2(r2, e3) }), w(Cp, { selectedLabel: String(r2), options: Ip, onSelect: (e3) => o2(e3, n2) })] });
|
|
2696
|
+
}
|
|
2697
|
+
const Ap = kt(null, ht({ background: "surface.foreground", padding: "25px", gap: "15px" })), Dp = kt(null, ht({ display: "flex", justifyContent: "space-between", alignItems: "center", gap: "8px", alignSelf: "stretch", marginBottom: "30px" })), Mp = kt(null, ht({ backgroundColor: "surface.intent.action.discrete", border: "{borderWidths.lg} solid transparent", padding: "8px", borderRadius: "sm", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", "&:hover": { backgroundColor: "surface.intent.action.discrete.hover", border: "{borderWidths.lg} solid", borderColor: "border.intent.action.hover" }, "&:disabled": { opacity: 0.6, pointerEvents: "none" } }), ea), Np = kt(null, ht({ display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: "2px 2px" })), Rp = kt(null, ht({ padding: "8px", textAlign: "center" })), Op = kt(null, ht({ backgroundColor: "surface.intent.action.discrete", border: "{borderWidths.lg} solid transparent", padding: "6px", width: "36px", height: "36px", position: "relative", display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "sm", cursor: "pointer", "&:hover:not(:disabled)": { backgroundColor: "surface.intent.action.discrete.hover", border: "{borderWidths.lg} solid", borderColor: "border.intent.action.hover" }, "&[data-selected='true']": { backgroundColor: "surface.intent.action.discrete.active", border: "{borderWidths.lg} solid", borderColor: "border.intent.action.active" }, "&[data-today='true']::after": { content: "''", position: "absolute", bottom: "3px", width: "4px", height: "4px", borderRadius: "50%", backgroundColor: "brand.primary" }, "&:disabled": { cursor: "default" } }), ea), Lp = kt(null, ht({ color: "typography.base" }));
|
|
2698
|
+
function Fp({ date: e2, selectedDate: t2, currentMonth: r2, onClick: n2, maxDate: o2 }) {
|
|
2699
|
+
const a2 = t2 && Vt(e2, t2), i2 = jt(e2), l2 = e2.getMonth() !== r2, s2 = !!o2 && qt(e2, o2);
|
|
2700
|
+
return w("button", { ...Op, onClick: () => n2(e2), "data-selected": a2, "data-today": i2, disabled: s2, children: w(to, { stylists: l2 || s2 ? [Lp] : [], children: e2.getDate().toString() }) });
|
|
2701
|
+
}
|
|
2702
|
+
function _p({ selectedDate: e2, onDateSelect: t2, viewDate: r2, onViewDateChange: n2, maxDate: o2 }) {
|
|
2703
|
+
const a2 = Ol(), i2 = r2 || /* @__PURE__ */ new Date(), l2 = i2.getFullYear(), s2 = i2.getMonth(), c2 = function(e3, t3) {
|
|
2704
|
+
const r3 = Rt(e3, t3, 1), n3 = new Date(r3);
|
|
2705
|
+
return n3.setDate(n3.getDate() - r3.getDay()), Array.from({ length: 42 }, (e4, t4) => {
|
|
2706
|
+
const r4 = new Date(n3);
|
|
2707
|
+
return r4.setDate(n3.getDate() + t4), r4;
|
|
2708
|
+
});
|
|
2709
|
+
}(l2, s2), d2 = Ie(c2), u2 = void 0 === o2 || d2 && qt(o2, d2), h2 = (e3) => {
|
|
2710
|
+
t2(e3), a2.setOpen(false);
|
|
2711
|
+
}, g2 = (e3) => {
|
|
2712
|
+
const t3 = new Date(i2);
|
|
2713
|
+
t3.setMonth(i2.getMonth() + e3), n2(t3);
|
|
2714
|
+
};
|
|
2715
|
+
return C("div", { ...Ap, children: [C("div", { ...Dp, children: [w("button", { ...Mp, onClick: () => g2(-1), children: w(Pa, { Component: Va }) }), w(Pp, { currentMonthYear: i2, onMonthYearChange: n2 }), w("button", { ...Mp, onClick: () => g2(1), disabled: !u2, children: w(Pa, { Component: Aa }) })] }), C("div", { ...Np, children: [Bt.map((e3) => w("div", { ...Rp, children: w(no, { children: e3 }) }, e3)), c2.map((t3) => w(Fp, { date: t3, selectedDate: e2, currentMonth: s2, onClick: h2, maxDate: o2 }, t3.toISOString()))] })] });
|
|
2716
|
+
}
|
|
2717
|
+
const Wp = kt(null, At({ body: "default" }), ht({ outline: "none", border: "none", padding: 0, backgroundColor: "transparent", flex: 1, cursor: "pointer", "&:focus": { cursor: "text" } }));
|
|
2718
|
+
const Bp = kt(null, At({ body: "default" }), ht({ outline: "none", border: "none", padding: 0, backgroundColor: "transparent", cursor: "text", overflowWrap: "break-word", minWidth: "100%", maxWidth: "100%", "&::placeholder": { color: "typography.base.weak" }, "&:focus": { outline: "none" } }));
|
|
2719
|
+
const Hp = kt(bt["category-text"], ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", padding: 0, outline: "none", border: "none", background: "none", borderRadius: "md", color: "typography.intent.action", flex: "1 1 0", minWidth: 0, cursor: "pointer", "&:hover": { color: "typography.intent.action.hover" }, "&:focus-visible": { outline: "4px solid", outlineOffset: "2px", outlineColor: "border.layout" }, "&:hover > .Tight-medium-icon > path": { stroke: "typography.intent.action.hover" } }), ra), zp = kt(null, ht({ color: "inherit" }));
|
|
2720
|
+
function Vp(e2) {
|
|
2721
|
+
((navigator.userAgent ? navigator.userAgent.toLowerCase().includes("mac") : navigator.platform.toLowerCase().includes("mac")) ? e2.metaKey : e2.ctrlKey) && "Enter" === e2.key && (e2.preventDefault(), e2.currentTarget.requestSubmit());
|
|
2722
|
+
}
|
|
2723
|
+
function jp(e2) {
|
|
2724
|
+
"Enter" === e2.key && e2.currentTarget.blur();
|
|
2725
|
+
}
|
|
2726
|
+
const qp = kt(bt["amount-input"], At({ body: "default" }), ht({ outline: "none", border: "none", padding: 0, backgroundColor: "transparent", flex: 1, cursor: "pointer", width: "100%", "&:focus": { cursor: "text" } })), $p = kt(null, ht({ display: "flex", alignItems: "center", gap: "2px" }));
|
|
2727
|
+
function Up({ value: e2, onChange: t2, inputRef: r2, onClick: n2, onBlur: o2, autofocus: a2 = false }) {
|
|
2728
|
+
return C("div", { ...$p, children: [w(Ds, { children: "$" }), w(Te, { ...qp, getInputRef: r2, thousandSeparator: true, decimalScale: 2, value: e2, onValueChange: (e3) => {
|
|
2729
|
+
t2(void 0 === e3.floatValue ? null : e3.floatValue);
|
|
2730
|
+
}, fixedDecimalScale: true, onClick: n2, onBlur: o2, onKeyDown: jp, autoFocus: a2 })] });
|
|
2731
|
+
}
|
|
2732
|
+
const Kp = kt(bt["amount-input-container"], ht({ borderRadius: "md", border: "none", background: "transparent", color: "typography.intent.action", maxWidth: "120px", "&:hover:not(:focus-within)": { color: "typography.intent.action.hover" }, "& .Tight-amount-input, & .Tight-text": { color: "inherit" }, "&[data-clicked='true']:focus-within": { outline: "1px solid", outlineOffset: "2px", outlineColor: "border.layout.strong" }, "&[data-clicked='false']:has(:focus-visible)": { outline: "4px solid", outlineOffset: "2px", outlineColor: "border.layout" } }), ra);
|
|
2733
|
+
const Yp = s.object({ amount: s.number({ message: "Required" }).refine((e2) => 0 !== e2, { message: "Amount must not be 0" }), date: s.string("Required").refine((e2) => (function(e3, t2) {
|
|
2734
|
+
const r2 = Rt(e3.getFullYear(), e3.getMonth(), e3.getDate()), n2 = Rt(t2.getFullYear(), t2.getMonth(), t2.getDate());
|
|
2735
|
+
return r2.getTime() < n2.getTime();
|
|
2736
|
+
}(new Date(e2), /* @__PURE__ */ new Date()) || Vt(new Date(e2), /* @__PURE__ */ new Date())) && qt(new Date(e2), /* @__PURE__ */ new Date("2000-01-01")), { message: "Invalid date" }), category: s.object({ id: s.string(), name: s.string().optional() }, { message: "Required" }).nullable(), classSegments: s.array(s.object({ id: s.string(), name: s.string().optional() })), bankAccount: s.object({ id: s.string(), name: s.string().optional() }, { message: "Required" }), glAccount: s.object({ id: s.string(), name: s.string().optional(), accountNo: s.string().optional() }, { message: "Required" }), notes: s.string().nullable(), children: s.array(s.object({ amount: s.number().refine((e2) => 0 !== e2, { message: "Child expense amounts must not be 0" }), category: s.object({ id: s.string(), name: s.string().optional() }, { message: "Required" }), glAccount: s.object({ id: s.string() }, { message: "Required" }), classSegments: s.array(s.object({ id: s.string(), name: s.string().optional() })) })) }), Gp = Yp.extend({}).check((e2) => {
|
|
2737
|
+
var _a2, _b2, _c2;
|
|
2738
|
+
const t2 = (_b2 = (_a2 = e2.value) == null ? void 0 : _a2.children) == null ? void 0 : _b2.reduce((e3, t3) => e3 + t3.amount, 0);
|
|
2739
|
+
i((_c2 = e2.value) == null ? void 0 : _c2.children) || t2 === e2.value.amount || e2.issues.push({ code: "custom", message: "Sum of children amounts must equal total amount", input: e2.value, path: ["children"] });
|
|
2740
|
+
}), Qp = Yp.extend({ matchingBankTransaction: s.object({ id: s.string(), description: s.string().optional(), amount: s.number().optional(), date: s.string().optional(), bankAccountId: s.string().optional(), apiName: s.enum({ BOX: "BOX", CLOVER: "CLOVER", STRIPE: "STRIPE", PLAID: "PLAID", KNOX: "KNOX", UBER: "UBER", FRESHBOOKS: "FRESHBOOKS", HARVEST: "HARVEST", KW: "KW", FRESHBOOKS2: "FRESHBOOKS2", CAPITAL_ONE: "CAPITAL_ONE", SQUARE: "SQUARE", DOTLOOP: "DOTLOOP", REALOGY: "REALOGY", UPWORK: "UPWORK", SHOPIFY: "SHOPIFY", DEDUCTR: "DEDUCTR", ENTERPRISE: "ENTERPRISE", MOXIWORKS: "MOXIWORKS", APPDIRECT: "APPDIRECT", LONEWOLF: "LONEWOLF", LONEWOLF_TRANSACTIONDESK: "LONEWOLF_TRANSACTIONDESK", SAMPLE_BANK: "SAMPLE_BANK", TAXBOT: "TAXBOT", GUSTO: "GUSTO", XERO: "XERO", UNIT: "UNIT", MOOV: "MOOV", QBO: "QBO", QUALPAY: "QUALPAY", BENCH: "BENCH", PARTNER_IMPLEMENTATION: "PARTNER_IMPLEMENTATION", CHECK: "CHECK", RUTTER: "RUTTER", WAVE: "WAVE", MANUAL_ENTRY: "MANUAL_ENTRY", CSV_IMPORT: "CSV_IMPORT" }).optional() }).nullish() }).refine((e2) => {
|
|
2741
|
+
var _a2;
|
|
2742
|
+
const t2 = (_a2 = e2.matchingBankTransaction) == null ? void 0 : _a2.amount, r2 = e2.amount;
|
|
2743
|
+
return !!Jt(t2) || t2 === r2;
|
|
2744
|
+
}, { message: "Transfer amount must equal the matching bank transaction amount", path: ["matchingBankTransaction"], when: (e2) => Qp.pick({ amount: true, matchingBankTransaction: true }).safeParse(e2.value).success }), Xp = (e2) => "MANUAL_ENTRY" === e2.apiName || "CSV_IMPORT" === e2.apiName, Zp = (e2) => {
|
|
2745
|
+
const t2 = e2 == null ? void 0 : e2.description;
|
|
2746
|
+
return `${t2} | ${Qn(Number(e2 == null ? void 0 : e2.amount), { dollarSign: true })} | ${$t(Yt((e2 == null ? void 0 : e2.date) || ""))}`;
|
|
2747
|
+
}, Jp = kt(null, ht({ whiteSpace: "normal" })), ev = ({ onClick: e2 }) => {
|
|
2748
|
+
var _a2;
|
|
2749
|
+
const { query: { data: t2 }, isFilling: r2 } = ic(), n2 = (_a2 = t2 == null ? void 0 : t2.data) == null ? void 0 : _a2.filter((e3) => e3.glAccountId && "ACTIVE" === e3.status), o2 = Ol();
|
|
2750
|
+
return w($l, { children: w(ru, { children: r2 ? w(du, {}) : n2 == null ? void 0 : n2.map((t3) => w(au, { onClick: () => ((t4) => {
|
|
2751
|
+
void 0 !== e2 && e2(t4), o2.setOpen(false);
|
|
2752
|
+
})(t3), children: w(to, { stylists: [Jp], children: `${t3 == null ? void 0 : t3.apiAccountName} *${t3 == null ? void 0 : t3.apiAccountNo}` }) }, t3 == null ? void 0 : t3.id)) }) });
|
|
2753
|
+
}, tv = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", padding: 0, cursor: "pointer" }));
|
|
2754
|
+
function rv({ label: e2, disabled: t2, bankAccount: r2, onClick: n2 }) {
|
|
2755
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (n3) => w(gp, { label: e2, popupTriggerProps: n3, disabled: t2, children: w("button", { ...tv, type: "button", disabled: t2, children: w(to, { children: Sh(r2 == null ? void 0 : r2.apiAccountName, r2 == null ? void 0 : r2.apiAccountNo) }) }) }) }), w(ev, { onClick: n2 })] });
|
|
2756
|
+
}
|
|
2757
|
+
const nv = { filter: { type: { values: ["BANK_TRANSFER"], operator: "IN" } } }, ov = kt(null, ht({ whiteSpace: "normal" }));
|
|
2758
|
+
function av({ onClick: e2, transactionId: t2 }) {
|
|
2759
|
+
var _a2;
|
|
2760
|
+
const { query: { data: r2 }, isFilling: n2 } = ji(nv), o2 = (_a2 = r2 == null ? void 0 : r2.data) == null ? void 0 : _a2.filter((e3) => e3.id !== t2), a2 = Ol();
|
|
2761
|
+
return w($l, { children: w(ru, { children: n2 ? w(du, {}) : o2 == null ? void 0 : o2.map((t3) => w(au, { onClick: () => ((t4) => {
|
|
2762
|
+
e2(t4), a2 == null ? void 0 : a2.setOpen(false);
|
|
2763
|
+
})(t3), children: w(to, { stylists: [ov], children: Zp(t3) }) }, t3.id)) }) });
|
|
2764
|
+
}
|
|
2765
|
+
const iv = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", padding: 0, cursor: "pointer" })), lv = kt(null, ht({ color: "typography.base.weak" }));
|
|
2766
|
+
const sv = Yp.extend({}), cv = [{ value: "FEDERAL", label: "Federal" }, { value: "STATE", label: "State" }, { value: "SALES", label: "Sales" }], dv = [{ value: "Q1", label: "Q1" }, { value: "Q2", label: "Q2" }, { value: "Q3", label: "Q3" }, { value: "Q4", label: "Q4" }], uv = ["FEDERAL", "STATE", "SALES"], hv = ["Q1", "Q2", "Q3", "Q4"], gv = Yp.extend({ tax: s.object({ paymentInfo: s.object({ region: s.enum(uv, { message: `Tax region must be one of: ${uv.join(", ")}` }), quarter: s.enum(hv, { message: `Tax quarter must be one of: ${hv.join(", ")}` }), year: s.number({ message: "Tax year is required" }) }).nullable() }) }).superRefine((e2, t2) => {
|
|
2767
|
+
var _a2;
|
|
2768
|
+
((_a2 = e2.tax) == null ? void 0 : _a2.paymentInfo) || (t2.addIssue({ path: ["tax", "paymentInfo", "region"], code: "custom", message: `Tax region must be one of: ${uv.join(", ")}` }), t2.addIssue({ path: ["tax", "paymentInfo", "quarter"], code: "custom", message: `Tax quarter must be one of: ${hv.join(", ")}` }), t2.addIssue({ path: ["tax", "paymentInfo", "year"], code: "custom", message: "Tax year is required" }));
|
|
2769
|
+
}), pv = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", height: "39px", padding: 0, cursor: "pointer" }));
|
|
2770
|
+
const vv = kt(null, ht({ display: "grid", textWrap: "nowrap" }));
|
|
2771
|
+
function mv({ children: e2, rows: t2, cols: r2 }) {
|
|
2772
|
+
return w("div", { ...vv, style: { gridTemplateColumns: `repeat(${r2}, 1fr)`, gridTemplateRows: `repeat(${t2}, 1fr)` }, children: e2 });
|
|
2773
|
+
}
|
|
2774
|
+
const bv = kt(null, ht({ minWidth: 0, "&:focus": { zIndex: 1 } }), la, aa, ia, ea);
|
|
2775
|
+
function fv({ option: e2, handleClick: t2, selected: r2 }) {
|
|
2776
|
+
return void 0 === e2 ? null : w("button", { type: "button", ...bv, onClick: () => t2(e2), "data-active": r2 === e2, children: w(bl, { children: e2.label }) });
|
|
2777
|
+
}
|
|
2778
|
+
function yv({ options: e2, handleClick: t2, selected: r2, rows: n2, cols: o2 }) {
|
|
2779
|
+
return w(mv, { rows: n2, cols: o2, children: e2 == null ? void 0 : e2.map((e3) => w(fv, { option: e3, handleClick: t2, selected: r2 }, e3.value)) });
|
|
2780
|
+
}
|
|
2781
|
+
function Tv({ options: e2 }) {
|
|
2782
|
+
const t2 = Ol(), r2 = cp();
|
|
2783
|
+
return w($l, { children: w(ru, { children: e2.map((e3) => w(au, { onClick: () => {
|
|
2784
|
+
r2.handleChange(e3.value), r2.handleBlur(), t2.setOpen(false);
|
|
2785
|
+
}, children: w(bl, { children: e3.label }) }, e3.value)) }) });
|
|
2786
|
+
}
|
|
2787
|
+
const xv = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: "10px", outline: "none", border: "none", background: "none", padding: 0, cursor: "pointer" })), wv = kt(null, ht({ color: "typography.base.weak" }));
|
|
2788
|
+
const kv = { amount: null, category: { id: "", name: "" }, bankAccount: { id: "", name: "" }, glAccount: { id: "", name: "", accountNo: "" }, date: "", notes: null, classSegments: [], children: [], matchingBankTransaction: { id: "", description: "", amount: 0, date: "", bankAccountId: "", apiName: void 0 }, tax: { paymentInfo: null } }, { useAppForm: Cv, withForm: Sv } = ye({ formContext: lp, fieldContext: sp, formComponents: { SaveButton: function({ showIcon: e2 = true, textContent: t2 = "Save" }) {
|
|
2789
|
+
return C(qs, { type: "submit", children: [e2 && w(Pa, { Component: Td }), w(to, { children: t2 })] });
|
|
2790
|
+
} }, fieldComponents: { DiscreteAmountField: function({ label: e2 }) {
|
|
2791
|
+
const t2 = d(null), r2 = cp();
|
|
2792
|
+
return w(Tp, { inputRef: t2, label: e2, children: w(Up, { value: r2.state.value, onChange: r2.handleChange, inputRef: t2 }) });
|
|
2793
|
+
}, ExpenseCategoryField: function({ category: e2, onClick: t2, childrenField: r2, totalAmount: n2, glAccount: o2 }) {
|
|
2794
|
+
const a2 = () => {
|
|
2795
|
+
const t3 = Math.floor(n2 / 2 * 100) / 100, a3 = n2 - t3;
|
|
2796
|
+
r2 == null ? void 0 : r2.pushValue({ amount: t3, category: e2, classSegments: [], glAccount: o2 }), r2 == null ? void 0 : r2.pushValue({ amount: a3, category: e2, classSegments: [], glAccount: o2 });
|
|
2797
|
+
};
|
|
2798
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (t3) => C(gp, { label: "Category", popupTriggerProps: t3, children: [C("button", { ...fp, type: "button", children: [w(Go, { Component: bh(e2 == null ? void 0 : e2.name) }), w(to, { children: (e2 == null ? void 0 : e2.name) || "Uncategorized" })] }), r2 && w(bp, { onClick: a2 })] }) }), w(ch, { onClick: t2 })] });
|
|
2799
|
+
}, DateInput: function({ label: e2, maxDate: t2, autofocus: r2 = false, editable: n2 = false }) {
|
|
2800
|
+
const o2 = cp(), a2 = fe(o2.store, (e3) => e3.meta.isDefaultValue), i2 = d(null), [l2, s2] = v(() => o2.state.value ? Yt(o2.state.value) : /* @__PURE__ */ new Date()), c2 = o2.state.value ? Yt(o2.state.value) : null, [u2, h2] = v(""), g2 = (e3) => {
|
|
2801
|
+
const r3 = function(e4) {
|
|
2802
|
+
const t3 = e4.replace(/\D/g, "");
|
|
2803
|
+
return t3.length <= 2 ? t3 : t3.length <= 4 ? `${t3.slice(0, 2)}/${t3.slice(2)}` : `${t3.slice(0, 2)}/${t3.slice(2, 4)}/${t3.slice(4, 8)}`;
|
|
2804
|
+
}(e3.target.value);
|
|
2805
|
+
h2(r3);
|
|
2806
|
+
const n3 = Kt(r3);
|
|
2807
|
+
if (n3) {
|
|
2808
|
+
const e4 = t2 ? qt(a3 = n3, i3 = t2) ? i3 : a3 : n3;
|
|
2809
|
+
o2.handleChange(Gt(e4)), s2(e4);
|
|
2810
|
+
} else o2.handleChange("");
|
|
2811
|
+
var a3, i3;
|
|
2812
|
+
}, p2 = u2 || (c2 ? $t(c2) : ""), [m2, b2] = v(false), f2 = (e3) => {
|
|
2813
|
+
m2 && (() => {
|
|
2814
|
+
if (t2 && c2 && !a2) {
|
|
2815
|
+
const e4 = Kt(u2);
|
|
2816
|
+
e4 && qt(e4, t2) && h2($t(c2));
|
|
2817
|
+
}
|
|
2818
|
+
})(), b2(e3);
|
|
2819
|
+
}, y2 = (e3) => {
|
|
2820
|
+
"Enter" === e3.key && (e3.preventDefault(), f2(!m2));
|
|
2821
|
+
}, T2 = n2 ? gp : Tp;
|
|
2822
|
+
return C(Rl, { placement: "bottom-start", onOpenChange: f2, open: m2, children: [w(Ll, { children: (t3) => w(T2, { label: e2, inputRef: i2, popupTriggerProps: t3, onClick: () => b2(true), children: w("input", { ...Wp, ref: i2, type: "text", id: o2.name, value: p2, onChange: g2, placeholder: "MM/DD/YYYY", maxLength: 10, autoFocus: r2, onKeyDown: y2, autoComplete: "off" }) }) }), w($l, { initialFocus: false, children: w(_p, { selectedDate: c2, onDateSelect: (e3) => {
|
|
2823
|
+
o2.handleChange(Gt(e3)), h2($t(e3)), s2(e3);
|
|
2824
|
+
}, viewDate: l2, onViewDateChange: s2, maxDate: t2 }) })] });
|
|
2825
|
+
}, TextAreaInput: function({ label: e2, placeholder: t2, autofocus: r2 = false, resizeable: n2 = true }) {
|
|
2826
|
+
const o2 = cp(), a2 = d(null);
|
|
2827
|
+
return w(gp, { label: e2, inputRef: a2, children: w("textarea", { ...Bp, ref: a2, value: o2.state.value || "", onChange: (e3) => o2.handleChange(e3.target.value), placeholder: t2 ?? "Add note...", rows: 4, style: { resize: n2 ? "both" : "none" }, autoFocus: r2 }) });
|
|
2828
|
+
}, SplitExpenseCategoryField: function({ value: e2, onChange: t2 }) {
|
|
2829
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (t3) => C("button", { ...Hp, ...t3, type: "button", children: [w(Go, { Component: bh(e2 == null ? void 0 : e2.name) }), w(to, { stylists: [zp], children: (e2 == null ? void 0 : e2.name) || "Uncategorized" })] }) }), w(ch, { onClick: t2 })] });
|
|
2830
|
+
}, SplitExpenseAmountField: function({ value: e2, onChange: t2, onBlur: r2 }) {
|
|
2831
|
+
const [n2, o2] = v(false);
|
|
2832
|
+
return w("div", { ...Kp, "data-clicked": n2, children: w(Up, { value: e2, onChange: t2, onClick: () => o2(true), onBlur: () => (o2(false), void r2()) }) });
|
|
2833
|
+
}, BankAccountField: function({ transaction: e2 }) {
|
|
2834
|
+
const { state: { value: t2 }, handleChange: r2 } = cp(), n2 = sc(t2.id), o2 = Jt(e2) || !Xp(e2);
|
|
2835
|
+
return w(rv, { label: "Bank Account", disabled: o2, onClick: (e3) => {
|
|
2836
|
+
r2(((e4) => ({ id: e4.id, name: e4.apiAccountName }))(e3));
|
|
2837
|
+
}, bankAccount: n2 });
|
|
2838
|
+
}, GlAccountField: function() {
|
|
2839
|
+
const e2 = cp(), t2 = e2.state.value;
|
|
2840
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (e3) => w(gp, { label: "Account", popupTriggerProps: e3, children: w("button", { ...pv, type: "button", children: w(to, { children: jd(t2.accountNo, t2.name) }) }) }) }), w(Bu, { onClick: (t3) => {
|
|
2841
|
+
const r2 = gu(t3);
|
|
2842
|
+
e2.handleChange(r2);
|
|
2843
|
+
}, types: uu })] });
|
|
2844
|
+
}, BankGlAccountField: function({ transaction: e2 }) {
|
|
2845
|
+
const { state: { value: t2 }, handleChange: r2 } = cp(), { query: { data: n2 } } = bu(), { query: { data: o2 } } = (a2 = t2 == null ? void 0 : t2.id, ic({ select: (e3) => lc(e3.data, a2) }));
|
|
2846
|
+
var a2;
|
|
2847
|
+
const i2 = e2 ? Eh(e2.amount) : "";
|
|
2848
|
+
return w(rv, { label: i2, onClick: (e3) => {
|
|
2849
|
+
const t3 = ((e4, t4) => e4 == null ? void 0 : e4.flatMap((e5) => [e5, ...e5.children ?? []]).find((e5) => {
|
|
2850
|
+
var _a2;
|
|
2851
|
+
return Number((_a2 = e5.id) == null ? void 0 : _a2.split("_")[1]) === t4.glAccountId;
|
|
2852
|
+
}))(n2, e3);
|
|
2853
|
+
t3 && r2(gu(t3));
|
|
2854
|
+
}, bankAccount: o2 });
|
|
2855
|
+
}, MatchingBankTransferField: function({ transaction: e2 }) {
|
|
2856
|
+
const t2 = cp(), r2 = t2.state.value, n2 = r2 ? Zp(r2) : "Select", o2 = r2 ? [] : [lv];
|
|
2857
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (e3) => w(gp, { label: "Matching Bank Transfer", popupTriggerProps: e3, children: w("button", { ...iv, children: w(to, { stylists: o2, children: n2 }) }) }) }), w(av, { onClick: (e3) => {
|
|
2858
|
+
const r3 = ((e4) => {
|
|
2859
|
+
var _a2;
|
|
2860
|
+
return { id: e4.id, description: e4 == null ? void 0 : e4.description, amount: e4 == null ? void 0 : e4.amount, date: e4 == null ? void 0 : e4.date, bankAccountId: (_a2 = e4 == null ? void 0 : e4.bankAccount) == null ? void 0 : _a2.id, apiName: e4 == null ? void 0 : e4.apiName };
|
|
2861
|
+
})(e3);
|
|
2862
|
+
t2.handleChange(r3), t2.handleBlur();
|
|
2863
|
+
}, transactionId: e2 == null ? void 0 : e2.id })] });
|
|
2864
|
+
}, ButtonGroupField: function({ label: e2, options: t2 }) {
|
|
2865
|
+
const r2 = cp(), n2 = t2.find((e3) => e3.value === r2.state.value);
|
|
2866
|
+
return w(gp, { label: e2, disableHover: true, children: w(yv, { options: t2, selected: n2, handleClick: (e3) => {
|
|
2867
|
+
r2.handleChange(e3.value.toString());
|
|
2868
|
+
}, rows: 1, cols: t2.length }) });
|
|
2869
|
+
}, GenericSelectorField: function({ options: e2, label: t2 }) {
|
|
2870
|
+
const r2 = cp();
|
|
2871
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (e3) => w(gp, { label: t2, popupTriggerProps: e3, children: w("button", { ...xv, type: "button", children: r2.state.value ? w(to, { children: r2.state.value.toString() }) : w(to, { stylists: [wv], children: `Select ${t2}...` }) }) }) }), w(Tv, { options: e2 })] });
|
|
2872
|
+
} } });
|
|
2873
|
+
function Ev(e2) {
|
|
2874
|
+
const { mutate: t2 } = $u(), r2 = e2 ? function(e3) {
|
|
2875
|
+
return { amount: _d(e3.amount), category: e3.category, date: e3.date, bankAccount: e3.bankAccount, glAccount: e3.glAccount, notes: e3.notes, classSegments: e3.classSegments, children: e3.children.map((e4) => ({ amount: _d(e4.amount), category: e4.category, glAccount: e4.glAccount, classSegments: e4.classSegments })), matchingBankTransaction: e3.matchingBankTransaction, tax: e3.tax };
|
|
2876
|
+
}(e2) : kv, n2 = e2 ? function(e3) {
|
|
2877
|
+
switch (e3.type) {
|
|
2878
|
+
case "EXPENSE":
|
|
2879
|
+
return Gp;
|
|
2880
|
+
case "BANK_TRANSFER":
|
|
2881
|
+
return Qp;
|
|
2882
|
+
case "REVENUE":
|
|
2883
|
+
return sv;
|
|
2884
|
+
case "TAX_PAYMENT":
|
|
2885
|
+
return gv;
|
|
2886
|
+
default:
|
|
2887
|
+
return;
|
|
2888
|
+
}
|
|
2889
|
+
}(e2) : void 0;
|
|
2890
|
+
return Cv({ defaultValues: r2, validators: { onBlur: n2 }, onSubmit: (r3) => {
|
|
2891
|
+
var _a2, _b2, _c2;
|
|
2892
|
+
var n3, o2;
|
|
2893
|
+
e2 && (t2((n3 = e2.id, o2 = r3.value, { id: n3, amount: o2.amount ? Wd(o2.amount) : 0, categoryId: (_a2 = o2.category) == null ? void 0 : _a2.id, bankAccountId: o2.bankAccount.id, glAccountId: (_b2 = o2.glAccount) == null ? void 0 : _b2.id, date: o2.date, notes: o2.notes, classSegmentIds: o2.classSegments.map((e3) => e3.id), children: o2.children.map((e3) => {
|
|
2894
|
+
var _a3, _b3;
|
|
2895
|
+
return { amount: e3.amount ? Wd(e3.amount) : 0, categoryId: (_a3 = e3.category) == null ? void 0 : _a3.id, glAccountId: (_b3 = e3.glAccount) == null ? void 0 : _b3.id, classSegmentIds: o2.classSegments.map((e4) => e4.id) };
|
|
2896
|
+
}), matchingBankTransactionId: (_c2 = o2.matchingBankTransaction) == null ? void 0 : _c2.id, tax: o2.tax })), r3.formApi.reset(r3.value, { keepDefaultValues: true }));
|
|
2897
|
+
}, onSubmitInvalid: () => {
|
|
2898
|
+
} });
|
|
2899
|
+
}
|
|
2900
|
+
const Iv = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("path", { d: "M10.6196 14.2124H4.3803C4.06894 14.2128 3.7693 14.0937 3.54327 13.8795C3.31724 13.6654 3.18207 13.3726 3.16568 13.0617L2.61591 3.22968H12.384L11.8342 13.0617C11.8179 13.3726 11.6827 13.6654 11.4567 13.8795C11.2306 14.0937 10.931 14.2128 10.6196 14.2124Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M1.3949 3.22968H13.605", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M6.27894 0.787598H8.72097C9.0448 0.787598 9.35537 0.91624 9.58435 1.14522C9.81334 1.37421 9.94198 1.68478 9.94198 2.00861V3.22963H5.05792V2.00861C5.05792 1.68478 5.18656 1.37421 5.41555 1.14522C5.64453 0.91624 5.9551 0.787598 6.27894 0.787598Z", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M9.09821 5.05792V12.384", stroke: "#182428", strokeMiterlimit: 10 }), c.createElement("path", { d: "M5.90167 5.05792V12.384", stroke: "#182428", strokeMiterlimit: 10 })), "Delete"), Pv = kt(null, ht({ position: "relative", display: "flex", flexDirection: "row", alignItems: "center", justifyContent: "space-between", outline: "none", border: "none", background: "none", padding: "15px 0px", gap: "15px", width: "100%" })), Av = kt(null, ht({ backgroundColor: "border.layout", height: "25px", width: "1px", margin: 0 })), Dv = kt(null, ht({ backgroundColor: "border.layout", height: "1px", width: "100%" })), Mv = kt(null, ht({ background: "none", border: "none", outline: "none", marginLeft: "auto", display: "flex", alignItems: "center", justifyContent: "center", padding: "4px", borderRadius: "md", cursor: "pointer", "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout" }, "&:hover": { "& svg": { "& path": { stroke: "icon.accent.danger" } } } }), oa), Nv = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: "15px" })), Rv = Sv({ defaultValues: kv, props: { index: 0, numRows: 1, removeSplit: () => {
|
|
2901
|
+
} }, render: function({ form: e2, index: t2, numRows: r2, removeSplit: n2 }) {
|
|
2902
|
+
return C(k, { children: [C("div", { ...Pv, children: [w(e2.AppField, { name: `children[${t2}].category`, children: (e3) => w(e3.SplitExpenseCategoryField, { value: e3.state.value, onChange: e3.handleChange }) }), C("div", { ...Nv, children: [w("div", { ...Av }), w(e2.AppField, { name: `children[${t2}].amount`, children: (e3) => w(e3.SplitExpenseAmountField, { value: e3.state.value, onChange: e3.handleChange, onBlur: e3.handleBlur }) }), w("button", { onClick: () => n2(t2), ...Mv, children: w(Go, { Component: Iv }) })] })] }), t2 < r2 - 1 && w("div", { ...Dv })] });
|
|
2903
|
+
} }), Ov = kt(null, ht({ display: "flex", flexDirection: "column", alignItems: "flex-start", outline: "none", border: "none", background: "none" })), Lv = ht({ backgroundColor: "surface.foreground", border: "{borderWidths.lg} solid", borderRadius: "md", borderColor: "border.layout.strong", display: "flex", flexDirection: "column", padding: "12px 16px", cursor: "pointer", outline: "none" }), Fv = ht({ borderColor: "border.intent.danger" }), _v = Sv({ defaultValues: kv, render: function({ form: e2 }) {
|
|
2904
|
+
const t2 = fe(e2.store, (e3) => {
|
|
2905
|
+
var _a2, _b2;
|
|
2906
|
+
const t3 = ((_a2 = e3.errors) == null ? void 0 : _a2[0]) ?? {}, r3 = Object.values(t3).flat().filter((e4) => "object" == typeof e4 && null !== e4 && "message" in e4);
|
|
2907
|
+
return (_b2 = r3[0]) == null ? void 0 : _b2.message;
|
|
2908
|
+
}), r2 = kt(null, Lv, t2 ? Fv : void 0);
|
|
2909
|
+
return C(k, { children: [C("div", { ...r2, children: [w(no, { children: "Category" }), w(e2.AppField, { name: "children", mode: "array", children: (t3) => {
|
|
2910
|
+
const r3 = (r4) => {
|
|
2911
|
+
t3.removeValue(r4), 1 === t3.state.value.length && (e2.setFieldValue("category", t3.state.value[0].category), t3.removeValue(0)), e2.validate("blur");
|
|
2912
|
+
};
|
|
2913
|
+
return C("div", { ...Ov, children: [t3.state.value.map((n2, o2) => {
|
|
2914
|
+
var _a2;
|
|
2915
|
+
return w(Rv, { form: e2, index: o2, numRows: t3.state.value.length, removeSplit: r3 }, `${(_a2 = n2 == null ? void 0 : n2.category) == null ? void 0 : _a2.id}-${o2}`);
|
|
2916
|
+
}), w(bp, { onClick: () => {
|
|
2917
|
+
var _a2, _b2, _c2;
|
|
2918
|
+
const e3 = (_a2 = Ie(t3.state.value)) == null ? void 0 : _a2.category, r4 = (_b2 = Ie(t3.state.value)) == null ? void 0 : _b2.classSegments, n2 = (_c2 = Ie(t3.state.value)) == null ? void 0 : _c2.glAccount;
|
|
2919
|
+
t3.pushValue({ amount: 0, category: e3 || { id: "", name: "" }, glAccount: n2 || { id: "" }, classSegments: r4 || [] });
|
|
2920
|
+
} })] });
|
|
2921
|
+
} })] }), t2 && w(np, { errorMessage: t2 })] });
|
|
2922
|
+
} }), Wv = Sv({ defaultValues: kv, render: function({ form: e2 }) {
|
|
2923
|
+
const t2 = fe(e2.store, (e3) => e3.values.amount) ?? 0;
|
|
2924
|
+
return w(e2.Subscribe, { selector: (e3) => e3.values.children, children: (r2) => Array.isArray(r2) && 0 !== r2.length ? w(_v, { form: e2 }) : w(e2.AppField, { name: "children", mode: "array", children: (r3) => w(e2.AppField, { name: "category", children: (n2) => w(n2.ExpenseCategoryField, { category: n2.state.value, glAccount: e2.state.values.glAccount, onClick: n2.handleChange, childrenField: r3, totalAmount: t2 }) }) }) });
|
|
2925
|
+
} }), Bv = kt(null, ht({ position: "absolute", right: 0, top: 0, height: "100%", maxHeight: "100%", maxWidth: "100%", backgroundColor: "surface.background", width: "512px", minWidth: "fit-content", display: "flex", _focus: { outline: "none" } }));
|
|
2926
|
+
function Hv({ children: e2 }) {
|
|
2927
|
+
const t2 = d(null);
|
|
2928
|
+
return b(() => {
|
|
2929
|
+
var _a2;
|
|
2930
|
+
(_a2 = t2.current) == null ? void 0 : _a2.focus();
|
|
2931
|
+
}, []), w("div", { ref: t2, tabIndex: -1, ...Bv, children: e2 });
|
|
2932
|
+
}
|
|
2933
|
+
const zv = kt(null, ht({ display: "flex", backgroundColor: "surface.foreground", flexDirection: "column", height: "100%", maxHeight: "100%", overflowY: "auto", overflowX: "hidden", minWidth: "fit-content", borderLeft: "1px solid {colors.border.layout.strong}", justifyContent: "flex-start", alignItems: "center", padding: 5, gap: "10px" }));
|
|
2934
|
+
function Vv({ children: e2 }) {
|
|
2935
|
+
return w("div", { tabIndex: -1, ...zv, children: e2 });
|
|
2936
|
+
}
|
|
2937
|
+
function jv({ active: e2, icon: t2, onClick: r2, ariaLabel: n2 }) {
|
|
2938
|
+
return w(es, { ariaLabel: n2, onClick: r2, active: e2, children: w(ps, { Component: t2 }) });
|
|
2939
|
+
}
|
|
2940
|
+
const qv = kt(null, ht({ display: "flex", height: "100%", maxHeight: "100%", minHeight: 0, flexDirection: "column", width: "512px", overflow: "hidden" }));
|
|
2941
|
+
function $v({ children: e2 }) {
|
|
2942
|
+
return w("div", { ...qv, children: e2 });
|
|
2943
|
+
}
|
|
2944
|
+
const Uv = Object.freeze({ thumbs_up: "👍", thumbs_down: "👎", red_heart: "❤️", hundred_points: "💯", eyes: "👀" });
|
|
2945
|
+
function Kv(e2) {
|
|
2946
|
+
return void 0 !== Uv[e2];
|
|
2947
|
+
}
|
|
2948
|
+
function Yv(e2) {
|
|
2949
|
+
return Uv[e2];
|
|
2950
|
+
}
|
|
2951
|
+
const Gv = Xo((e2) => c.createElement("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", strokeWidth: 1.5, width: 24, height: 24, ...e2 }, c.createElement("defs", null, c.createElement("style", null, ".cls-63ce7444ea57ea6c838005ed-1{fill:none;stroke:currentColor;stroke-miterlimit:10;}")), c.createElement("path", { className: "cls-63ce7444ea57ea6c838005ed-1", d: "M6.27,21.55H8.5l2.33.95h7.92a2.86,2.86,0,0,0,2.85-2.59l.88-9.13c0-.14,0-.28,0-.42h0a2.18,2.18,0,0,0-2.18-2.18H15.63l.52-1.09a6.27,6.27,0,0,0,.62-2.73h0A2.86,2.86,0,0,0,13.91,1.5h0A1.9,1.9,0,0,0,12,3.41h0a6,6,0,0,1-1.25,3.66l-2.33,3H6.27" }), c.createElement("rect", { className: "cls-63ce7444ea57ea6c838005ed-1", x: 1.5, y: 9.14, width: 4.77, height: 13.36 })), "ThumbsUp"), Qv = ht({ fontSize: "26px", lineHeight: "26px", width: "26px", userSelect: "none" });
|
|
2952
|
+
function Xv({ cldrShortName: e2 }) {
|
|
2953
|
+
return w("div", { className: Qv, children: Yv(e2) });
|
|
2954
|
+
}
|
|
2955
|
+
const Zv = mt({ base: { padding: 0, border: "none", outline: "none" }, variants: { type: { sent: { cursor: "default" }, received: { cursor: "pointer" } } } }), Jv = ht({ display: "flex", gap: "4px", backgroundColor: "surface.elevated", borderRadius: "sm", borderWidth: "sm", borderColor: "border.layout", borderStyle: "solid", padding: "4px 8px", alignItems: "center", justifyContent: "center", scrollbar: "hidden", overflow: "hidden" });
|
|
2956
|
+
function em({ reactions: e2, type: t2, handleClick: r2 }) {
|
|
2957
|
+
return w("div", { className: Jv, children: e2.map((e3, n2) => w("button", { className: Zv({ type: t2 }), onClick: "received" === t2 ? () => r2(e3.emojiCode) : void 0, children: w(Xv, { cldrShortName: e3.emojiCode }) }, `${e3.emojiCode}_${n2}`)) });
|
|
2958
|
+
}
|
|
2959
|
+
const tm = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
2960
|
+
const { id: n2, emojiCode: o2 } = e2, a2 = { path: "/v6/messages/{id}/reactions/{emojiCode}", pathParams: { id: n2, emojiCode: o2 }, accessToken: t2, method: "POST", endpointManager: _a(r2) };
|
|
2961
|
+
return await gn(a2);
|
|
2962
|
+
}, rm = async ({ data: e2, accessToken: t2, environment: r2 }) => {
|
|
2963
|
+
const { id: n2, emojiCode: o2 } = e2, a2 = { path: "/v6/messages/{id}/reactions/{emojiCode}", pathParams: { id: n2, emojiCode: o2 }, accessToken: t2, method: "DELETE", endpointManager: _a(r2) };
|
|
2964
|
+
return await gn(a2);
|
|
2965
|
+
};
|
|
2966
|
+
function nm(e2, t2, r2) {
|
|
2967
|
+
return Xt(Gi.of({ id: e2 }), t2, r2);
|
|
2968
|
+
}
|
|
2969
|
+
async function om(e2) {
|
|
2970
|
+
const t2 = Gi.of({ id: e2 });
|
|
2971
|
+
return Gr("mutation successful, invalidating messages queries"), lr.invalidateQueries({ queryKey: t2 }).catch((e3) => Qr({ error: e3, severity: "error" }));
|
|
2972
|
+
}
|
|
2973
|
+
function am(e2, t2, r2) {
|
|
2974
|
+
const n2 = [...e2];
|
|
2975
|
+
return n2[r2] = t2, n2;
|
|
2976
|
+
}
|
|
2977
|
+
function im(e2) {
|
|
2978
|
+
const { userId: t2, userEmail: r2 } = g(Gh), n2 = { mutationFn: tm, onMutateFn: ({ data: n3, accessToken: o2, environment: a2 }) => {
|
|
2979
|
+
if (void 0 !== t2) return async function({ data: e3, accessToken: t3, conversationId: r3, environment: n4, userId: o3, userEmail: a3 }) {
|
|
2980
|
+
const i2 = nm(r3, t3, n4);
|
|
2981
|
+
await lr.cancelQueries({ queryKey: i2 });
|
|
2982
|
+
const l2 = lr.getQueryData(i2);
|
|
2983
|
+
return lr.setQueryData(i2, (t4) => {
|
|
2984
|
+
const r4 = t4.findIndex((t5) => t5.id === e3.id);
|
|
2985
|
+
if (-1 === r4) return t4;
|
|
2986
|
+
const n5 = function(e4, t5, r5, n6) {
|
|
2987
|
+
return { ...e4, reactions: [...e4.reactions, { emojiCode: t5.emojiCode, authorInfo: [{ userId: r5, email: n6 }] }] };
|
|
2988
|
+
}(t4[r4], e3, o3, a3);
|
|
2989
|
+
return am(t4, n5, r4);
|
|
2990
|
+
}), { oldMessages: l2 };
|
|
2991
|
+
}({ data: n3, accessToken: o2, conversationId: e2, environment: a2, userId: t2, userEmail: r2 });
|
|
2992
|
+
}, onSettled: () => om(e2) };
|
|
2993
|
+
return Hu(n2);
|
|
2994
|
+
}
|
|
2995
|
+
function lm(e2) {
|
|
2996
|
+
const { userId: t2 } = g(Gh);
|
|
2997
|
+
return Hu({ mutationFn: rm, onMutateFn: ({ data: r2, accessToken: n2, environment: o2 }) => {
|
|
2998
|
+
if (void 0 !== t2) return async function({ data: e3, accessToken: t3, conversationId: r3, environment: n3, userId: o3 }) {
|
|
2999
|
+
const a2 = nm(r3, t3, n3);
|
|
3000
|
+
await lr.cancelQueries({ queryKey: a2 });
|
|
3001
|
+
const i2 = lr.getQueryData(a2);
|
|
3002
|
+
return lr.setQueryData(a2, (t4) => {
|
|
3003
|
+
const r4 = t4.findIndex((t5) => t5.id === e3.id), n4 = t4[r4];
|
|
3004
|
+
if (Jt(n4) || 0 === n4.reactions.length) return t4;
|
|
3005
|
+
const a3 = function(e4, t5, r5) {
|
|
3006
|
+
const n5 = e4.reactions.filter((e5) => e5.emojiCode !== t5 || !e5.authorInfo.some((e6) => e6.userId === r5));
|
|
3007
|
+
return { ...e4, reactions: n5 };
|
|
3008
|
+
}(n4, e3.emojiCode, o3);
|
|
3009
|
+
return am(t4, a3, r4);
|
|
3010
|
+
}), { oldMessages: i2 };
|
|
3011
|
+
}({ data: r2, accessToken: n2, conversationId: e2, environment: o2, userId: t2 });
|
|
3012
|
+
}, onSettled: () => om(e2) });
|
|
3013
|
+
}
|
|
3014
|
+
const sm = ht({ backgroundColor: "surface.elevated", borderRadius: "sm", borderWidth: "sm", borderColor: "border.layout", borderStyle: "solid", display: "flex", justifyContent: "center", alignItems: "center", padding: "8px", cursor: "pointer" }), cm = Object.keys(Uv).filter(Kv).map((e2) => ({ emojiCode: e2, authorInfo: [] }));
|
|
3015
|
+
function dm({ conversationId: e2, messageId: t2, type: r2, reactions: n2, reactionIsOpen: o2, setReactionIsOpen: a2 }) {
|
|
3016
|
+
const { userId: i2 } = g(Gh), { mutate: l2 } = im(e2);
|
|
3017
|
+
return C(Rl, { placement: "top-end", open: o2, onOpenChange: a2, blockInteraction: true, children: [w(Ll, { children: (e3) => w("button", { className: sm, ...e3, children: w(Go, { Component: Gv }) }) }), w($l, { type: "reaction", children: w(em, { reactions: cm, type: r2, handleClick: (e3) => {
|
|
3018
|
+
n2.some((t3) => {
|
|
3019
|
+
const r3 = t3.emojiCode === e3, n3 = t3.authorInfo.some((e4) => e4.userId === i2);
|
|
3020
|
+
return r3 && n3;
|
|
3021
|
+
}) || (l2({ id: t2, emojiCode: e3 }), a2(false));
|
|
3022
|
+
} }) })] });
|
|
3023
|
+
}
|
|
3024
|
+
function um(e2) {
|
|
3025
|
+
const [t2, r2] = v(false), [n2, o2] = v(false);
|
|
3026
|
+
return function(e3, t3, r3, n3) {
|
|
3027
|
+
b(() => {
|
|
3028
|
+
if (null === e3.current || !t3 || n3) return;
|
|
3029
|
+
const o3 = e3.current, a2 = (e4) => {
|
|
3030
|
+
e4.target === o3 || o3.contains(e4.target) || r3(false);
|
|
3031
|
+
};
|
|
3032
|
+
return window.addEventListener("mousemove", a2), () => {
|
|
3033
|
+
window.removeEventListener("mousemove", a2);
|
|
3034
|
+
};
|
|
3035
|
+
}, [t3, e3, n3, r3]);
|
|
3036
|
+
}(e2, t2, r2, n2), { isHover: t2, reactionIsOpen: n2, setIsHover: r2, setReactionIsOpen: o2 };
|
|
3037
|
+
}
|
|
3038
|
+
const hm = mt({ base: { position: "absolute", bottom: "-25px" }, variants: { type: { sent: { right: "2px" }, received: { left: "2px" } } } });
|
|
3039
|
+
function gm({ reactions: e2, type: t2, handleClick: r2 }) {
|
|
3040
|
+
const n2 = hm({ type: t2 });
|
|
3041
|
+
return w("div", { className: n2, children: w(em, { reactions: e2, handleClick: r2, type: t2 }) });
|
|
3042
|
+
}
|
|
3043
|
+
const pm = mt({ base: { display: "flex", alignItems: "center", gap: "10px" }, variants: { type: { sent: { flexDirection: "row-reverse" }, received: { flexDirection: "row" } }, hasReactionsOnMessage: { true: { marginBottom: "18px" } } } }), vm = mt({ base: { position: "static", display: "flex", maxWidth: 325, padding: "12px 16px", flexDirection: "column", alignItems: "flex-start", borderRadius: "md", borderWidth: 1, borderStyle: "solid", flexShrink: 1, overflow: "wrap", wordBreak: "break-word", whiteSpace: "pre-wrap" }, variants: { type: { sent: { color: "typography.intent.primary", borderColor: "border.intent.primary", backgroundColor: "surface.intent.primary" }, received: { color: "typography.base", borderColor: "border.layout", backgroundColor: "surface.foreground" } } } }), mm = ht({ position: "relative", display: "flex", flexDirection: "column" });
|
|
3044
|
+
function bm({ conversationId: e2, messageId: t2, sentByCurrentUser: r2, children: n2, reactions: o2 = [] }) {
|
|
3045
|
+
const a2 = d(null), { isHover: i2, setIsHover: l2, reactionIsOpen: s2, setReactionIsOpen: c2 } = um(a2), { mutate: u2 } = lm(e2), h2 = r2 ? "sent" : "received", g2 = o2.filter((e3) => Kv(e3.emojiCode)), p2 = g2.length > 0;
|
|
3046
|
+
return C("div", { className: pm({ type: h2, hasReactionsOnMessage: p2 }), ref: a2, onMouseEnter: () => "received" === h2 && l2(true), children: [C("div", { className: mm, children: [w("div", { className: vm({ type: h2 }), children: n2 }), p2 && w(gm, { reactions: g2, type: h2, handleClick: (e3) => u2({ id: t2, emojiCode: e3 }) })] }), i2 && w(dm, { conversationId: e2, messageId: t2, type: h2, reactions: g2, reactionIsOpen: s2, setReactionIsOpen: c2 })] });
|
|
3047
|
+
}
|
|
3048
|
+
const fm = kt(null, ht({ display: "flex", flexDirection: "column-reverse", justifyContent: "center", gap: "10px", alignSelf: "stretch" }));
|
|
3049
|
+
function ym({ children: e2 }) {
|
|
3050
|
+
return w("div", { ...fm, children: e2 });
|
|
3051
|
+
}
|
|
3052
|
+
const Tm = kt(null, ht({ display: "flex", flexDirection: "column-reverse", alignItems: "flex-start", gap: "26px", flex: "1 1 0%", alignSelf: "stretch", overflow: "scroll", overflowX: "hidden", flexFlow: "column", padding: 15, scrollbarWidth: "thin", maxHeight: "calc(100% + 15px)", marginBottom: "-15px" })), xm = ht({ minHeight: 1, width: "100%" }), wm = "data-hasscrolled";
|
|
3053
|
+
function km({ messageGroups: e2, children: t2 }) {
|
|
3054
|
+
const r2 = d(null);
|
|
3055
|
+
return b(() => {
|
|
3056
|
+
if (null !== r2.current) {
|
|
3057
|
+
const e3 = null === r2.current.getAttribute(wm) ? "instant" : "smooth";
|
|
3058
|
+
r2.current.scrollIntoView({ behavior: e3 }), r2.current.setAttribute(wm, "true");
|
|
3059
|
+
}
|
|
3060
|
+
}, [e2]), w(k, { children: C("div", { tabIndex: -1, ...Tm, children: [w("div", { className: xm, ref: r2 }), t2] }) });
|
|
3061
|
+
}
|
|
3062
|
+
const Cm = s.object({ message: s.string().refine((e2) => "" !== e2, { message: "Required" }) }), Sm = ht.raw({ maxHeight: 150, maxWidth: "100%", whiteSpace: "pre-wrap", overflowWrap: "break-word", width: "100%", boxSizing: "border-box", margin: 0, padding: 0, fontFamily: "body" }), Em = ht.raw({ visibility: "hidden", fontSizeAdjust: "none", fontSize: "100%", fontStyle: "normal", letterSpacing: "normal", fontStretch: "normal", fontVariant: "normal", fontWeight: "normal", textAlign: "left", textAlignLast: "initial", textDecoration: "none", textEmphasis: "none", textIndent: "0px", textJustify: "auto", textShadow: "none", textTransform: "none" }), Im = ht(Em, Sm), Pm = ht.raw({ resize: "none", inset: 0, outline: "none", overflow: "auto", position: "absolute", appearance: "none", border: "none", backgroundColor: "transparent" }), Am = ht(Pm, Sm), Dm = ht({ display: "block", width: "100%" }), Mm = ht({ position: "relative" }), Nm = ht({ display: "flex", justifyContent: "flex-end" }), Rm = ht({ paddingInline: "8px", display: "flex", alignItems: "start", justifyContent: "center" });
|
|
3063
|
+
const Om = Object.freeze({ message: "" }), { useAppForm: Lm } = ye({ formContext: lp, fieldContext: sp, formComponents: {}, fieldComponents: { MessageAreaInput: function({ blockSubmit: e2 = false }) {
|
|
3064
|
+
const t2 = cp(), r2 = d(null), n2 = !e2 && Cm.safeParse(t2.form.state.values).success;
|
|
3065
|
+
return w(gp, { kind: "text", inputRef: r2, disableHover: true, children: C("div", { className: Dm, children: [C("div", { className: Mm, children: [C("pre", { className: Im, children: [t2.state.value, w("br", {})] }), w("textarea", { ref: r2, placeholder: "Message...", value: t2.state.value, className: Am, onChange: (e3) => t2.handleChange(e3.target.value) })] }), w("div", { className: Nm, children: w(ol, { disabled: !n2, type: "submit", children: w("span", { className: Rm, children: w(Go, { Component: vs }) }) }) })] }) });
|
|
3066
|
+
} } });
|
|
3067
|
+
const Fm = ht({ width: "100%" });
|
|
3068
|
+
function _m({ conversationId: e2, addMessage: t2, blockSubmit: r2 }) {
|
|
3069
|
+
const { form: n2 } = function({ onSubmit: e3 }) {
|
|
3070
|
+
return { form: Lm({ defaultValues: Om, onSubmit: (t3) => {
|
|
3071
|
+
Cm.safeParse(t3.value).success && (e3(t3), t3.formApi.reset());
|
|
3072
|
+
} }) };
|
|
3073
|
+
}({ onSubmit: t2 }), o2 = d(null);
|
|
3074
|
+
return w("form", { className: Fm, ref: o2, onKeyDown: (e3) => function(e4, t3, r3) {
|
|
3075
|
+
if (!e4.shiftKey && "Enter" === e4.key && (e4.preventDefault(), e4.stopPropagation(), null !== t3 && !r3)) {
|
|
3076
|
+
const e5 = new SubmitEvent("submit", { bubbles: true, cancelable: true });
|
|
3077
|
+
t3.dispatchEvent(e5);
|
|
3078
|
+
}
|
|
3079
|
+
}(e3, o2.current, r2), onSubmit: (e3) => {
|
|
3080
|
+
if (!r2) return e3.preventDefault(), e3.stopPropagation(), n2.handleSubmit();
|
|
3081
|
+
}, children: w(n2.AppField, { name: "message", children: (e3) => w(e3.MessageAreaInput, { blockSubmit: r2 }) }) });
|
|
3082
|
+
}
|
|
3083
|
+
function Wm(e2, t2) {
|
|
3084
|
+
return { id: `placeholder_${e2.conversationId}_${Date.now()}`, conversationId: e2.conversationId, author: { userId: t2 ?? "placeholderUserId", email: "placeholderEmail" }, status: "ACTIVE", createdDateTime: "", lastUpdatedDateTime: "", text: e2.text, reactions: [] };
|
|
3085
|
+
}
|
|
3086
|
+
async function Bm() {
|
|
3087
|
+
const e2 = Gi.all();
|
|
3088
|
+
return Gr("mutation successful, invalidating messages queries"), lr.invalidateQueries({ queryKey: e2 }).catch((e3) => Qr({ error: e3, severity: "error" }));
|
|
3089
|
+
}
|
|
3090
|
+
function Hm() {
|
|
3091
|
+
const { userId: e2 } = g(Gh), t2 = { mutationFn: Zi, onMutateFn: ({ data: t3, accessToken: r2, environment: n2 }) => async function({ data: e3, accessToken: t4, environment: r3, userId: n3 }) {
|
|
3092
|
+
const o2 = Xt(Gi.of({ id: e3.conversationId }), t4, r3);
|
|
3093
|
+
await lr.cancelQueries({ queryKey: o2 });
|
|
3094
|
+
const a2 = lr.getQueryData(o2);
|
|
3095
|
+
return lr.setQueryData(o2, (t5) => [Wm(e3, n3), ...t5]), { oldMessages: a2 };
|
|
3096
|
+
}({ data: t3, accessToken: r2, environment: n2, userId: e2 }), onSettled: Bm };
|
|
3097
|
+
return Hu(t2);
|
|
3098
|
+
}
|
|
3099
|
+
function zm({ isConversationLoading: e2, message: t2 }) {
|
|
3100
|
+
return w(km, { messageGroups: [], children: e2 && w(ym, { children: w(bm, { conversationId: "", messageId: "", sentByCurrentUser: true, children: t2 }) }) });
|
|
3101
|
+
}
|
|
3102
|
+
const Vm = async ({ data: e2, accessToken: t2, environment: r2 }) => (async ({ data: e3, accessToken: t3, environment: r3 }) => bi({ data: { data: e3 }, accessToken: t3, environment: r3 }))({ data: [e2], accessToken: t2, environment: r2 });
|
|
3103
|
+
const jm = async ({ data: e2, accessToken: t2, environment: r2 }) => bi({ data: { data: [e2] }, accessToken: t2, environment: r2 });
|
|
3104
|
+
const qm = ht({ minHeight: "{borderWidths.lg}", maxHeight: "{borderWidths.lg}", width: "100%", backgroundColor: "border.layout", flex: "1 1 0", display: "flex" }), $m = ht({ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", gap: 5, paddingLeft: 15, paddingRight: 15 }), Um = ht({ wordBreak: "break-word", maxWidth: 250, textAlign: "center" }), Km = "Marked As Resolved";
|
|
3105
|
+
function Ym({ resolver: e2 }) {
|
|
3106
|
+
const t2 = e2 ? `${e2} ${Km}` : Km;
|
|
3107
|
+
return C("div", { className: $m, children: [w("div", { className: qm }), w("div", { className: Um, children: t2 }), w("div", { className: qm })] });
|
|
3108
|
+
}
|
|
3109
|
+
const Gm = kt(null, ht({ display: "flex", alignItems: "center", justifyContent: "center", maxWidth: "100%", minHeight: 0, height: "auto", padding: "0 15px 15px", flexDirection: "column", position: "relative" })), Qm = (e2, t2) => ({ subject: e2.slice(0, 40), status: "ACTIVE", readStatus: "READ", resolutionStatus: "OPEN", ...t2 && { attachedEntityId: t2 }, message: { text: e2 } });
|
|
3110
|
+
function Xm({ conversationId: e2, setConversationId: t2, isResolved: r2, isUnread: n2, transactionId: o2 }) {
|
|
3111
|
+
var _a2;
|
|
3112
|
+
const { userId: a2 } = g(Gh), { mutate: i2 } = Hm(), { query: { data: l2 }, isFilling: s2 } = function(e3) {
|
|
3113
|
+
const t3 = er(e3);
|
|
3114
|
+
return dr({ queryKey: Gi.of({ id: e3 ?? "" }), queryFn: Xi, select: Qi, enabled: t3 });
|
|
3115
|
+
}(e2), { mutate: c2, isPending: d2, variables: u2 } = function(e3, t3) {
|
|
3116
|
+
return Hu({ mutationFn: jm, onSuccess: (r3) => {
|
|
3117
|
+
var _a3, _b2, _c2;
|
|
3118
|
+
const n3 = (_c2 = (_b2 = (_a3 = r3.data) == null ? void 0 : _a3[0]) == null ? void 0 : _b2.data) == null ? void 0 : _c2.id;
|
|
3119
|
+
if (Jt(r3) || Jt(n3)) return;
|
|
3120
|
+
e3(n3);
|
|
3121
|
+
const o3 = hi.base(), a3 = zi.all();
|
|
3122
|
+
return Gr("mutation successful, invalidating conversation, bank transaction, and message queries"), Promise.all([lr.invalidateQueries({ queryKey: o3 }), lr.invalidateQueries({ queryKey: a3 }), (async () => {
|
|
3123
|
+
if (er(t3)) {
|
|
3124
|
+
const e4 = { id: t3 }, r4 = zi.single(e4);
|
|
3125
|
+
return await lr.invalidateQueries({ queryKey: r4 });
|
|
3126
|
+
}
|
|
3127
|
+
})()]).catch((e4) => Qr({ error: e4, severity: "error" }));
|
|
3128
|
+
} });
|
|
3129
|
+
}(t2, o2), { mutate: h2 } = Hu({ mutationFn: Vm, onSuccess: async () => {
|
|
3130
|
+
const e3 = hi.base();
|
|
3131
|
+
return Gr("mutation successful, invalidating conversations queries"), lr.invalidateQueries({ queryKey: e3 }).catch((e4) => Qr({ error: e4, severity: "error" }));
|
|
3132
|
+
} });
|
|
3133
|
+
b(() => {
|
|
3134
|
+
r2 && n2 && e2 && h2({ id: e2, readStatus: "READ" });
|
|
3135
|
+
}, [r2, n2, e2, h2]);
|
|
3136
|
+
const p2 = Jt(e2) || Jt(l2) || s2;
|
|
3137
|
+
return C(k, { children: [p2 ? w(zm, { isConversationLoading: d2, message: (_a2 = u2 == null ? void 0 : u2.message) == null ? void 0 : _a2.text }) : C(km, { messageGroups: l2, children: [r2 && w(Ym, { resolver: "Bookkeeper" }), l2.map((t3, r3) => {
|
|
3138
|
+
const n3 = t3[0].author.userId === a2;
|
|
3139
|
+
return w(ym, { children: t3.map((t4) => w(bm, { conversationId: e2, messageId: t4.id, sentByCurrentUser: n3, reactions: t4.reactions, children: t4.text }, t4.id)) }, r3);
|
|
3140
|
+
})] }), w("div", { ...Gm, children: w(_m, { conversationId: e2, addMessage: ({ value: t3 }) => {
|
|
3141
|
+
if (Jt(e2)) {
|
|
3142
|
+
const e3 = Qm(t3.message, o2);
|
|
3143
|
+
c2(e3);
|
|
3144
|
+
} else i2({ conversationId: e2, text: t3.message });
|
|
3145
|
+
}, blockSubmit: d2 }) })] });
|
|
3146
|
+
}
|
|
3147
|
+
const Zm = kt(bt["drawer-header-border"], ht({ height: "1px", backgroundColor: "border.layout.strong" }));
|
|
3148
|
+
function Jm() {
|
|
3149
|
+
return w("div", { ...Zm });
|
|
3150
|
+
}
|
|
3151
|
+
const eb = kt(bt["drawer-header"], ht({ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", padding: "10px 25px 10px 15px", backgroundColor: "surface.foreground", height: "55px", minHeight: "55px" }));
|
|
3152
|
+
function tb({ children: e2 }) {
|
|
3153
|
+
return C(k, { children: [w("div", { ...eb, children: e2 }), w(Jm, {})] });
|
|
3154
|
+
}
|
|
3155
|
+
function rb({ conversationId: e2, transactionId: t2 }) {
|
|
3156
|
+
const [r2, n2] = v(e2), { query: { data: o2 } } = mi(r2), a2 = "CLOSED" === (o2 == null ? void 0 : o2.resolutionStatus);
|
|
3157
|
+
return C($v, { children: [w(tb, {}), w(Xm, { conversationId: r2, setConversationId: n2, isResolved: a2, isUnread: "UNREAD" === (o2 == null ? void 0 : o2.readStatus), transactionId: t2 })] });
|
|
3158
|
+
}
|
|
3159
|
+
const nb = kt(null, ht({ display: "flex", flexDirection: "column", overflow: "hidden", maxHeight: "100%", flexGrow: 1 })), ob = kt(null, ht({ display: "flex", flexDirection: "row", maxHeight: "100%", overflow: "hidden", flexShrink: 1, flexGrow: 1 })), ab = kt(null, ht({ display: "flex", flexDirection: "column", flex: 1, backgroundColor: "surface.background", maxHeight: "100%" })), ib = kt(bt["transaction-form-body"], ht({ display: "flex", flexDirection: "column", flex: 1, padding: "15px", gap: "8px", overflow: "auto", width: "512px" })), lb = ht({ maxWidth: 1, width: 1, display: "flex", flexGrow: 1, backgroundColor: "border.layout.strong" }), sb = (e2) => {
|
|
3160
|
+
Vp(e2), function(e3) {
|
|
3161
|
+
"Escape" === e3.key && e3.target instanceof HTMLElement && e3.target.blur();
|
|
3162
|
+
}(e2);
|
|
3163
|
+
}, cb = ({ children: e2, onSubmit: t2, Header: r2, initialTab: n2, conversationId: o2, transactionId: a2 }) => {
|
|
3164
|
+
const [i2, l2] = v(n2 ?? null);
|
|
3165
|
+
return w(Hv, { children: w("div", { ...nb, children: C("div", { ...ob, children: [C("form", { onSubmit: (e3) => {
|
|
3166
|
+
e3.preventDefault(), t2();
|
|
3167
|
+
}, onKeyDown: sb, ...ab, children: [r2, w("div", { ...ib, children: e2 })] }), null !== i2 && w("div", { className: lb }), "conversation" === i2 && w(rb, { conversationId: o2, transactionId: a2 }), w(Vv, { children: w(jv, { active: "conversation" === i2, onClick: () => {
|
|
3168
|
+
return l2((e3 = "conversation") === i2 ? null : e3);
|
|
3169
|
+
var e3;
|
|
3170
|
+
}, icon: Zo, ariaLabel: "conversation-tab" }) })] }) }) });
|
|
3171
|
+
}, db = kt(null, ht({ display: "flex", flexDirection: "column", margin: "0 0 7px 0", padding: 0, justifyContent: "center", minHeight: "36px", backgroundColor: "surface.background", gap: "4px" })), ub = kt(null, ht({ textWrap: "wrap" }));
|
|
3172
|
+
function hb({ transaction: e2, bankAccount: t2 }) {
|
|
3173
|
+
const r2 = e2 ? e2.description : "", n2 = Jt(t2) || Jt(e2) ? "" : Ih(t2, e2);
|
|
3174
|
+
return C("div", { ...db, children: [w(to, { stylists: [ub], children: r2 }), t2 && w(no, { children: n2 })] });
|
|
3175
|
+
}
|
|
3176
|
+
const gb = kt(null, ht({ display: "flex", backgroundColor: "surface.intent.action.discrete", border: "none", padding: "6px", margin: 0, borderRadius: "sm", outline: "none", cursor: "pointer", "&:hover": { backgroundColor: "surface.intent.action.discrete.hover" }, "&:focus-visible": { outline: "4px solid", outlineColor: "border.layout" } }), ta);
|
|
3177
|
+
function pb() {
|
|
3178
|
+
return w("button", { ...gb, onClick: () => Wi(), type: "button", children: w(Go, { Component: Fl, ...gb }) });
|
|
3179
|
+
}
|
|
3180
|
+
const vb = Xo((e2) => c.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e2 }, c.createElement("g", { clipPath: "url(#clip0_9779_2768)" }, c.createElement("path", { d: "M2.70654 9.12132C3.60197 9.12132 4.32787 8.39543 4.32787 7.49999C4.32787 6.60456 3.60197 5.87866 2.70654 5.87866C1.8111 5.87866 1.08521 6.60456 1.08521 7.49999C1.08521 8.39543 1.8111 9.12132 2.70654 9.12132Z", fill: "#182428" }), c.createElement("path", { d: "M8.32496 9.12132C9.22039 9.12132 9.94629 8.39543 9.94629 7.49999C9.94629 6.60456 9.22039 5.87866 8.32496 5.87866C7.42952 5.87866 6.70363 6.60456 6.70363 7.49999C6.70363 8.39543 7.42952 9.12132 8.32496 9.12132Z", fill: "#182428" }), c.createElement("path", { d: "M13.9434 9.12132C14.8388 9.12132 15.5647 8.39543 15.5647 7.49999C15.5647 6.60456 14.8388 5.87866 13.9434 5.87866C13.048 5.87866 12.3221 6.60456 12.3221 7.49999C12.3221 8.39543 13.048 9.12132 13.9434 9.12132Z", fill: "#182428" }))), "Dots");
|
|
3181
|
+
function mb({ children: e2 }) {
|
|
3182
|
+
return C(Rl, { placement: "bottom-start", children: [w(Ll, { children: (e3) => w(es, { popupTriggerProps: e3, children: w(Pa, { Component: vb }) }) }), w($l, { children: e2 })] });
|
|
3183
|
+
}
|
|
3184
|
+
const bb = "ACTIVE", fb = "INACTIVE";
|
|
3185
|
+
function yb({ transaction: e2 }) {
|
|
3186
|
+
const { mutate: t2 } = qu(), r2 = () => t2([e2].map((e3) => ({ id: e3.id, status: fb })));
|
|
3187
|
+
return w(au, { onClick: () => ((e3) => {
|
|
3188
|
+
Ys({ title: "Delete transaction", body: "Are you sure you want to delete this transaction?", buttons: [{ key: "cancel", label: "Cancel" }, { key: "delete", label: "Delete" }] }).then((t3) => {
|
|
3189
|
+
"delete" === t3 && e3();
|
|
3190
|
+
});
|
|
3191
|
+
})(r2), children: w(to, { children: "Delete" }) });
|
|
3192
|
+
}
|
|
3193
|
+
function Tb({ transaction: e2 }) {
|
|
3194
|
+
const { mutate: t2 } = qu(), r2 = () => {
|
|
3195
|
+
t2([e2].map((e3) => ({ id: e3.id, status: bb })));
|
|
3196
|
+
};
|
|
3197
|
+
return w(au, { onClick: () => r2(), children: w(to, { children: "Restore" }) });
|
|
3198
|
+
}
|
|
3199
|
+
const xb = kt(null, ht({ display: "flex", flexDirection: "row", alignItems: "center", gap: "15px", flexShrink: 1 }));
|
|
3200
|
+
function wb({ children: e2 }) {
|
|
3201
|
+
return w("div", { ...xb, children: e2 });
|
|
3202
|
+
}
|
|
3203
|
+
const kb = Sv({ defaultValues: kv, props: { title: "Transaction", transaction: null }, render: function({ form: e2, title: t2, transaction: r2 }) {
|
|
3204
|
+
return C(tb, { children: [C(wb, { children: [w(pb, {}), w(to, { children: t2 }), w(mb, { children: C(ru, { children: [(r2 == null ? void 0 : r2.status) === bb && w(yb, { transaction: r2 }), (r2 == null ? void 0 : r2.status) === fb && w(Tb, { transaction: r2 })] }) })] }), w(e2.Subscribe, { selector: (e3) => e3.isDefaultValue, children: (t3) => t3 ? null : w(e2.SaveButton, {}) })] });
|
|
3205
|
+
} });
|
|
3206
|
+
function Cb({ transactionId: e2 }) {
|
|
3207
|
+
const { query: { data: t2, isFetching: r2 }, isFilling: n2 } = $i({ id: e2 });
|
|
3208
|
+
return { transaction: t2, form: Ev(t2), bankAccount: sc(t2 == null ? void 0 : t2.bankAccount.id), showBankAccountField: !Jt(t2) && Xp(t2), isLoading: n2 || r2 && !t2 };
|
|
3209
|
+
}
|
|
3210
|
+
function Sb({ transactionId: e2, initialTab: t2 }) {
|
|
3211
|
+
var _a2;
|
|
3212
|
+
const { transaction: r2, form: n2, bankAccount: o2, showBankAccountField: a2, isLoading: i2 } = Cb({ transactionId: e2 });
|
|
3213
|
+
if (i2) return null;
|
|
3214
|
+
const l2 = w(kb, { form: n2, transaction: r2, title: "Expense" }), s2 = ((_a2 = r2 == null ? void 0 : r2.conversation) == null ? void 0 : _a2.id) ?? null;
|
|
3215
|
+
return C(cb, { onSubmit: n2.handleSubmit, Header: l2, initialTab: t2, conversationId: s2, transactionId: e2, children: [(r2 == null ? void 0 : r2.description) && w(hb, { transaction: r2, bankAccount: o2 }), w(n2.AppField, { name: "amount", children: (e3) => w(e3.DiscreteAmountField, { label: "Total" }) }), w(n2.AppField, { name: "date", children: (e3) => w(e3.DateInput, { label: "Transaction Date", maxDate: /* @__PURE__ */ new Date() }) }), w(Wv, { form: n2 }), a2 && w(n2.AppField, { name: "bankAccount", children: (e3) => w(e3.BankAccountField, { transaction: r2 }) }), w(n2.AppField, { name: "notes", children: (e3) => w(e3.TextAreaInput, { label: "Note" }) })] });
|
|
3216
|
+
}
|
|
3217
|
+
function Eb({ transactionId: e2, initialTab: t2 }) {
|
|
3218
|
+
var _a2;
|
|
3219
|
+
const { transaction: r2, form: n2, bankAccount: o2, isLoading: a2 } = Cb({ transactionId: e2 });
|
|
3220
|
+
if (a2) return null;
|
|
3221
|
+
const i2 = w(kb, { form: n2, transaction: r2, title: "Bank Transfer" }), l2 = ((_a2 = r2 == null ? void 0 : r2.conversation) == null ? void 0 : _a2.id) ?? null;
|
|
3222
|
+
return C(cb, { onSubmit: n2.handleSubmit, Header: i2, initialTab: t2, conversationId: l2, transactionId: e2, children: [(r2 == null ? void 0 : r2.description) && w(hb, { transaction: r2, bankAccount: o2 }), w(n2.AppField, { name: "amount", children: (e3) => w(e3.DiscreteAmountField, { label: "Total" }) }), w(n2.AppField, { name: "date", children: (e3) => w(e3.DateInput, { label: "Transaction Date", maxDate: /* @__PURE__ */ new Date() }) }), w(n2.AppField, { name: "bankAccount", children: (e3) => w(e3.BankAccountField, { transaction: r2 }) }), w(n2.AppField, { name: "glAccount", children: (e3) => w(e3.BankGlAccountField, { transaction: r2 }) }), w(n2.AppField, { name: "matchingBankTransaction", children: (e3) => w(e3.MatchingBankTransferField, { transaction: r2 }) }), w(n2.AppField, { name: "notes", children: (e3) => w(e3.TextAreaInput, { label: "Note" }) })] });
|
|
3223
|
+
}
|
|
3224
|
+
function Ib({ transactionId: e2, initialTab: t2 }) {
|
|
3225
|
+
var _a2;
|
|
3226
|
+
const { transaction: r2, form: n2, bankAccount: o2, showBankAccountField: a2, isLoading: i2 } = Cb({ transactionId: e2 });
|
|
3227
|
+
if (i2) return null;
|
|
3228
|
+
const l2 = w(kb, { form: n2, transaction: r2, title: "Income" }), s2 = ((_a2 = r2 == null ? void 0 : r2.conversation) == null ? void 0 : _a2.id) ?? null;
|
|
3229
|
+
return C(cb, { onSubmit: n2.handleSubmit, Header: l2, initialTab: t2, conversationId: s2, transactionId: e2, children: [(r2 == null ? void 0 : r2.description) && w(hb, { transaction: r2, bankAccount: o2 }), w(n2.AppField, { name: "amount", children: (e3) => w(e3.DiscreteAmountField, { label: "Total" }) }), w(n2.AppField, { name: "date", children: (e3) => w(e3.DateInput, { label: "Transaction Date", maxDate: /* @__PURE__ */ new Date() }) }), w(n2.AppField, { name: "glAccount", children: (e3) => w(e3.GlAccountField, {}) }), a2 && w(n2.AppField, { name: "bankAccount", children: (e3) => w(e3.BankAccountField, { transaction: r2 }) }), w(n2.AppField, { name: "notes", children: (e3) => w(e3.TextAreaInput, { label: "Note" }) })] });
|
|
3230
|
+
}
|
|
3231
|
+
function Pb({ transactionId: e2, initialTab: t2 }) {
|
|
3232
|
+
var _a2;
|
|
3233
|
+
const { transaction: r2, form: n2, bankAccount: o2, showBankAccountField: a2, isLoading: i2 } = Cb({ transactionId: e2 });
|
|
3234
|
+
if (i2) return null;
|
|
3235
|
+
const l2 = w(kb, { form: n2, transaction: r2, title: "Tax Payment" }), s2 = ((_a2 = r2 == null ? void 0 : r2.conversation) == null ? void 0 : _a2.id) ?? null;
|
|
3236
|
+
return C(cb, { Header: l2, onSubmit: n2.handleSubmit, initialTab: t2, conversationId: s2, transactionId: e2, children: [(r2 == null ? void 0 : r2.description) && w(hb, { transaction: r2, bankAccount: o2 }), w(n2.AppField, { name: "amount", children: (e3) => w(e3.DiscreteAmountField, { label: "Total" }) }), w(n2.AppField, { name: "date", children: (e3) => w(e3.DateInput, { label: "Transaction Date", maxDate: /* @__PURE__ */ new Date() }) }), w(n2.AppField, { name: "tax.paymentInfo.region", children: (e3) => w(e3.ButtonGroupField, { label: "Region", options: cv }) }), w(n2.AppField, { name: "tax.paymentInfo.quarter", children: (e3) => w(e3.ButtonGroupField, { label: "Quarter", options: dv }) }), w(n2.AppField, { name: "tax.paymentInfo.year", children: (e3) => w(e3.GenericSelectorField, { label: "Year", options: zt({ startYear: (/* @__PURE__ */ new Date()).getFullYear() + 1 }).map((e4) => ({ value: e4, label: String(e4) })) }) }), a2 && w(n2.AppField, { name: "bankAccount", children: (e3) => w(e3.BankAccountField, { transaction: r2 }) }), w(n2.AppField, { name: "notes", children: (e3) => w(e3.TextAreaInput, { label: "Note" }) })] });
|
|
3237
|
+
}
|
|
3238
|
+
function Ab({ transactionId: e2, initialTab: t2 }) {
|
|
3239
|
+
const { query: { data: r2 }, isFilling: n2 } = $i({ id: e2 });
|
|
3240
|
+
if (b(() => {
|
|
3241
|
+
!n2 && Jt(r2) && Wi();
|
|
3242
|
+
}, [r2, n2]), Jt(r2)) return null;
|
|
3243
|
+
switch (r2.type) {
|
|
3244
|
+
case "EXPENSE":
|
|
3245
|
+
return w(Sb, { transactionId: e2, initialTab: t2 });
|
|
3246
|
+
case "BANK_TRANSFER":
|
|
3247
|
+
return w(Eb, { transactionId: e2, initialTab: t2 });
|
|
3248
|
+
case "REVENUE":
|
|
3249
|
+
return w(Ib, { transactionId: e2, initialTab: t2 });
|
|
3250
|
+
case "TAX_PAYMENT":
|
|
3251
|
+
return w(Pb, { transactionId: e2, initialTab: t2 });
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
function Db({ subject: e2 }) {
|
|
3255
|
+
return w(tb, { children: C(wb, { children: [w(pb, {}), w(to, { children: e2 })] }) });
|
|
3256
|
+
}
|
|
3257
|
+
function Mb({ conversationId: e2 }) {
|
|
3258
|
+
const [t2, r2] = v(e2), { query: { data: n2 } } = mi(t2), o2 = "CLOSED" === (n2 == null ? void 0 : n2.resolutionStatus);
|
|
3259
|
+
return w(Hv, { children: C($v, { children: [w(Db, { subject: (n2 == null ? void 0 : n2.subject) ?? "Conversation" }), w(Xm, { conversationId: t2, setConversationId: r2, isResolved: o2, isUnread: "UNREAD" === (n2 == null ? void 0 : n2.readStatus) })] }) });
|
|
3260
|
+
}
|
|
3261
|
+
function Nb() {
|
|
3262
|
+
return C(Zg, { children: [w(Jg, { name: "BankTransactionFormRouter", Component: Ab }), w(Jg, { name: "Conversation", Component: Mb })] });
|
|
3263
|
+
}
|
|
3264
|
+
const Rb = ({ environment: e2, children: t2 }) => w(sr.Provider, { value: e2, children: t2 }), Ob = { all: () => ["sdk", "introspect"] }, Lb = async (e2) => {
|
|
3265
|
+
const t2 = e2.queryKey, r2 = { path: "/sdk/introspect", accessToken: t2[2].accessToken, environment: t2[2].environment };
|
|
3266
|
+
return await li(r2);
|
|
3267
|
+
};
|
|
3268
|
+
function Fb({ children: e2 }) {
|
|
3269
|
+
const { query: { data: t2 } } = dr({ queryKey: Ob.all(), queryFn: Lb });
|
|
3270
|
+
return w(Gh.Provider, { value: { userId: t2 == null ? void 0 : t2.userId, userRole: (t2 == null ? void 0 : t2.userRole) || "OWNER", userEmail: t2 == null ? void 0 : t2.email }, children: e2 });
|
|
3271
|
+
}
|
|
3272
|
+
function _b({ children: e2, environment: t2, accessToken: r2 }) {
|
|
3273
|
+
const n2 = { activeToken: r2, accountantToken: void 0 };
|
|
3274
|
+
return b(() => {
|
|
3275
|
+
((e3) => {
|
|
3276
|
+
$r.setProperties(Kr), Ur = e3;
|
|
3277
|
+
})(t2);
|
|
3278
|
+
}, [t2]), w($g, { children: w(Rb, { environment: t2, children: w(qg, { children: w(nr.Provider, { value: n2, children: C(Fb, { children: [w(he.ConfirmationRoot, {}), e2, w(Nb, {})] }) }) }) }) });
|
|
3279
|
+
}
|
|
3280
|
+
export {
|
|
3281
|
+
zg as BusinessOwnerDashboard,
|
|
3282
|
+
_b as Tight,
|
|
3283
|
+
Be as useOptions
|
|
3284
|
+
};
|
|
3285
|
+
//# sourceMappingURL=index.js.map
|